@hebcal/core 6.9.3 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +8 -7
  2. package/dist/bundle.js +1123 -996
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +9 -9
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/DailyLearning.js +1 -1
  7. package/dist/esm/DailyLearning.js.map +1 -1
  8. package/dist/esm/HebrewDateEvent.js +1 -1
  9. package/dist/esm/HebrewDateEvent.js.map +1 -1
  10. package/dist/esm/HolidayEvent.js +3 -3
  11. package/dist/esm/HolidayEvent.js.map +1 -1
  12. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  13. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  14. package/dist/esm/ParshaEvent.js +1 -1
  15. package/dist/esm/ParshaEvent.js.map +1 -1
  16. package/dist/esm/TimedEvent.js +1 -1
  17. package/dist/esm/TimedEvent.js.map +1 -1
  18. package/dist/esm/YomKippurKatanEvent.js +1 -1
  19. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  20. package/dist/esm/ashkenazi.po.js +1 -1
  21. package/dist/esm/ashkenazi.po.js.map +1 -1
  22. package/dist/esm/calendar.js +15 -12
  23. package/dist/esm/calendar.js.map +1 -1
  24. package/dist/esm/candles.js +7 -7
  25. package/dist/esm/candles.js.map +1 -1
  26. package/dist/esm/cities.json.js +1 -1
  27. package/dist/esm/cities.json.js.map +1 -1
  28. package/dist/esm/event.d.ts +47 -0
  29. package/dist/esm/event.js +63 -4
  30. package/dist/esm/event.js.map +1 -1
  31. package/dist/esm/getStartAndEnd.js +1 -1
  32. package/dist/esm/getStartAndEnd.js.map +1 -1
  33. package/dist/esm/hallel.js +3 -5
  34. package/dist/esm/hallel.js.map +1 -1
  35. package/dist/esm/he-x-NoNikud.po.js +1 -1
  36. package/dist/esm/he-x-NoNikud.po.js.map +1 -1
  37. package/dist/esm/he.po.js +1 -1
  38. package/dist/esm/he.po.js.map +1 -1
  39. package/dist/esm/hebcal.d.ts +2 -2
  40. package/dist/esm/hebcal.js +4 -5
  41. package/dist/esm/hebcal.js.map +1 -1
  42. package/dist/esm/holidays.js +2 -2
  43. package/dist/esm/holidays.js.map +1 -1
  44. package/dist/esm/index.d.ts +8 -8
  45. package/dist/esm/index.js +1 -1
  46. package/dist/esm/isAssurBemlacha.js +3 -5
  47. package/dist/esm/isAssurBemlacha.js.map +1 -1
  48. package/dist/esm/isAveilut.js +1 -1
  49. package/dist/esm/isAveilut.js.map +1 -1
  50. package/dist/esm/isFastDay.js +2 -8
  51. package/dist/esm/isFastDay.js.map +1 -1
  52. package/dist/esm/locale.js +1 -1
  53. package/dist/esm/location.js +1 -1
  54. package/dist/esm/location.js.map +1 -1
  55. package/dist/esm/modern.js +1 -1
  56. package/dist/esm/modern.js.map +1 -1
  57. package/dist/esm/molad.js +1 -1
  58. package/dist/esm/molad.js.map +1 -1
  59. package/dist/esm/moladBase.js +1 -1
  60. package/dist/esm/moladBase.js.map +1 -1
  61. package/dist/esm/moladDate.js +1 -1
  62. package/dist/esm/moladDate.js.map +1 -1
  63. package/dist/esm/omer.js +1 -1
  64. package/dist/esm/omer.js.map +1 -1
  65. package/dist/esm/parshaName.js +1 -1
  66. package/dist/esm/parshaName.js.map +1 -1
  67. package/dist/esm/parshaYear.js +1 -1
  68. package/dist/esm/parshaYear.js.map +1 -1
  69. package/dist/esm/pkgVersion.d.ts +1 -1
  70. package/dist/esm/pkgVersion.js +2 -2
  71. package/dist/esm/pkgVersion.js.map +1 -1
  72. package/dist/esm/reformatTimeStr.js +1 -1
  73. package/dist/esm/reformatTimeStr.js.map +1 -1
  74. package/dist/esm/sedra.js +1 -1
  75. package/dist/esm/sedra.js.map +1 -1
  76. package/dist/esm/sefira.json.js +1 -1
  77. package/dist/esm/sefira.json.js.map +1 -1
  78. package/dist/esm/staticHolidays.js +1 -1
  79. package/dist/esm/staticHolidays.js.map +1 -1
  80. package/dist/esm/string.js +1 -1
  81. package/dist/esm/string.js.map +1 -1
  82. package/dist/esm/tachanun.js +1 -1
  83. package/dist/esm/tachanun.js.map +1 -1
  84. package/dist/esm/zmanim.js +1 -1
  85. package/dist/esm/zmanim.js.map +1 -1
  86. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"bundle.min.js","sources":["../src/pkgVersion.ts","../node_modules/@hebcal/hdate/dist/esm/greg.js","../node_modules/@hebcal/hdate/dist/esm/hebrewStripNikkud.js","../node_modules/@hebcal/hdate/dist/esm/gregNamespace.js","../node_modules/@hebcal/hdate/dist/esm/hdateBase.js","../node_modules/@hebcal/hdate/dist/esm/anniversary.js","../node_modules/@hebcal/hdate/dist/esm/gematriya.js","../node_modules/@hebcal/hdate/dist/esm/pad.js","../node_modules/@hebcal/hdate/dist/esm/dateFormat.js","../node_modules/@hebcal/hdate/dist/esm/ashkenazi.po.js","../node_modules/@hebcal/hdate/dist/esm/he.po.js","../node_modules/@hebcal/hdate/dist/esm/locale.js","../node_modules/@hebcal/hdate/dist/esm/hdate.js","../node_modules/@hebcal/hdate/dist/esm/anniversaryHDate.js","../src/ashkenazi.po.ts","../src/he.po.ts","../src/locale.ts","../src/he-x-NoNikud.po.ts","../src/event.ts","../src/HebrewDateEvent.ts","../node_modules/temporal-utils/dist/errorMessages.js","../node_modules/temporal-utils/dist/utils.js","../node_modules/temporal-polyfill/chunks/internal.js","../node_modules/temporal-polyfill/chunks/root.js","../node_modules/temporal-polyfill/chunks/apiHelpers.js","../node_modules/temporal-polyfill/chunks/classApi.js","../node_modules/temporal-polyfill/chunks/classApi-basic.js","../node_modules/@hebcal/noaa/dist/index.js","../node_modules/temporal-polyfill/shim.js","../src/cities.json.ts","../node_modules/quick-lru/index.js","../src/location.ts","../src/reformatTimeStr.ts","../src/moladBase.ts","../src/moladDate.ts","../src/string.ts","../src/molad.ts","../src/zmanim.ts","../src/modern.ts","../src/sedra.ts","../src/staticHolidays.ts","../src/HolidayEvent.ts","../src/YomKippurKatanEvent.ts","../src/holidays.ts","../src/isAssurBemlacha.ts","../src/isAveilut.ts","../src/isFastDay.ts","../src/TimedEvent.ts","../src/candles.ts","../src/sefira.json.ts","../src/omer.ts","../src/tachanun.ts","../src/ParshaEvent.ts","../src/parshaName.ts","../src/getStartAndEnd.ts","../src/DailyLearning.ts","../src/MevarchimChodeshEvent.ts","../src/calendar.ts","../src/hebcal.ts","../src/hallel.ts","../src/parshaYear.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.9.3';\n","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/** @private */\nconst lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/** @private */\nconst monthLengths = [lengths, lengths.slice()];\nmonthLengths[1][2] = 29;\n/**\n * @private\n */\nfunction mod(x, y) {\n return x - y * Math.floor(x / y);\n}\n/**\n * @private\n */\nfunction quotient(x, y) {\n return Math.floor(x / y);\n}\n/**\n * @private\n * @param abs - R.D. number of days\n */\nfunction yearFromFixed(abs) {\n const l0 = abs - 1;\n const n400 = quotient(l0, 146097);\n const d1 = mod(l0, 146097);\n const n100 = quotient(d1, 36524);\n const d2 = mod(d1, 36524);\n const n4 = quotient(d2, 1461);\n const d3 = mod(d2, 1461);\n const n1 = quotient(d3, 365);\n const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;\n return n100 !== 4 && n1 !== 4 ? year + 1 : year;\n}\n/*\nconst ABS_14SEP1752 = 639797;\nconst ABS_2SEP1752 = 639785;\n*/\n/*\n * Formerly in namespace, now top-level\n */\n/**\n * Returns true if the Gregorian year is a leap year.\n *\n * Uses the proleptic Gregorian rule (divisible by 4, except centuries\n * that are not divisible by 400) for **all** years, including those\n * before the Gregorian calendar was adopted in 1582.\n * @param year Gregorian year\n * @returns `true` if February has 29 days in `year`\n * @example\n * isGregLeapYear(2000); // true\n * isGregLeapYear(2020); // true\n * isGregLeapYear(2023); // false\n * isGregLeapYear(2100); // false (divisible by 100 but not 400)\n */\nexport function isGregLeapYear(year) {\n return !(year % 4) && (!!(year % 100) || !(year % 400));\n}\n/**\n * Number of days in the Gregorian month for given year\n * @param month Gregorian month (1=January, 12=December)\n * @param year Gregorian year\n * @returns an integer 28-31\n * @example\n * daysInGregMonth(2, 2024); // 29 (February in a leap year)\n * daysInGregMonth(2, 2023); // 28\n * daysInGregMonth(7, 2024); // 31 (July)\n */\nexport function daysInGregMonth(month, year) {\n // 1 based months\n return monthLengths[+isGregLeapYear(year)][month];\n}\n/**\n * Returns true if the object is a Javascript `Date`.\n *\n * Note that this only tests the type: an invalid date such as\n * `new Date('foo')` is still a `Date` and returns `true`.\n * @example\n * isDate(new Date()); // true\n * isDate('2024-01-01'); // false\n * isDate(1700000000000); // false\n */\nexport function isDate(obj) {\n // eslint-disable-next-line no-prototype-builtins\n return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);\n}\n/**\n * @private\n * @param year\n * @param month (1-12)\n * @param day (1-31)\n */\nfunction toFixed(year, month, day) {\n const py = year - 1;\n return (365 * py +\n quotient(py, 4) -\n quotient(py, 100) +\n quotient(py, 400) +\n quotient(367 * month - 362, 12) +\n (month <= 2 ? 0 : isGregLeapYear(year) ? -1 : -2) +\n day);\n}\n/**\n * Converts Gregorian date to absolute R.D. (Rata Die) days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).\n *\n * Only the local-time year, month and day of `date` are used; hours,\n * minutes, seconds and milliseconds are ignored.\n *\n * Dates are interpreted on the **proleptic** Gregorian calendar, which\n * applies the Gregorian rules uniformly to every year without the\n * ten-day discontinuity of the Gregorian Reformation of 1582.\n * @param date Gregorian date\n * @returns R.D. number of days\n * @throws {TypeError} if `date` is not a `Date`\n * @throws {RangeError} if `date` is an Invalid Date\n * @see {@link abs2greg}\n * @example\n * greg2abs(new Date(2008, 10, 13)); // 733359 (13 November 2008)\n * greg2abs(new Date(2005, 3, 2)); // 732038 (2 April 2005)\n */\nexport function greg2abs(date) {\n if (!isDate(date)) {\n throw new TypeError(`not a Date: ${date}`);\n }\n else if (isNaN(date.getTime())) {\n throw new RangeError('Invalid Date');\n }\n const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());\n /*\n if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {\n throw new RangeError(`Invalid Date: ${date}`);\n }\n */\n return abs;\n}\n/**\n * Converts from Rata Die (R.D. number) to Gregorian date.\n * See the footnote on page 384 of ``Calendrical Calculations, Part II:\n * Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.\n * Clamen, Software--Practice and Experience, Volume 23, Number 4\n * (April, 1993), pages 383-404 for an explanation.\n *\n * Note that this function returns the daytime portion of the date.\n * For example, the 15th of Cheshvan 5769 began at sundown on\n * 12 November 2008 and continues through 13 November 2008. This\n * function would return only the date 13 November 2008.\n *\n * The returned `Date` is in the local (i.e. host system) time zone with\n * hours, minutes, seconds and milliseconds all set to zero, and is on the\n * **proleptic** Gregorian calendar (see {@link greg2abs}).\n * @param abs - R.D. number of days\n * @returns Gregorian date at local midnight\n * @throws {TypeError} if `abs` is not a number\n * @see {@link greg2abs}\n * @example\n * const abs = hebrew2abs(5769, months.CHESHVAN, 15);\n * const date = abs2greg(abs); // 13 November 2008\n * const year = date.getFullYear(); // 2008\n * const monthNum = date.getMonth() + 1; // 11\n * const day = date.getDate(); // 13\n */\nexport function abs2greg(abs) {\n if (typeof abs !== 'number' || isNaN(abs)) {\n throw new TypeError(`not a Number: ${abs}`);\n }\n abs = Math.trunc(abs);\n /*\n if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {\n throw new RangeError(`Invalid Date: ${abs}`);\n }\n */\n const year = yearFromFixed(abs);\n const priorDays = abs - toFixed(year, 1, 1);\n const correction = abs < toFixed(year, 3, 1) ? 0 : isGregLeapYear(year) ? 1 : 2;\n const month = quotient(12 * (priorDays + correction) + 373, 367);\n const day = abs - toFixed(year, month, 1) + 1;\n const dt = new Date(year, month - 1, day);\n if (year < 100 && year >= 0) {\n dt.setFullYear(year);\n }\n return dt;\n}\n//# sourceMappingURL=greg.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/**\n * Removes niqqud from Hebrew string\n * @example\n * hebrewStripNikkud('אֱלוּל'); // 'אלול'\n * hebrewStripNikkud('חֶשְׁוָן'); // 'חשון'\n */\nexport function hebrewStripNikkud(str) {\n if (typeof str !== 'string') {\n throw new TypeError(`bad nikkud str: ${str}`);\n }\n const a = str.normalize();\n // now strip out niqqud and trope\n return a.replace(/[\\u0590-\\u05bd]/g, '').replace(/[\\u05bf-\\u05c7]/g, '');\n}\n//# sourceMappingURL=hebrewStripNikkud.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/* eslint-disable @typescript-eslint/no-namespace */\nimport { abs2greg, daysInGregMonth, greg2abs, isDate, isGregLeapYear, } from './greg.js';\n/**\n * Gregorian date helper functions.\n *\n * These are aliases retained for backwards compatibility. Each member\n * simply forwards to the identically-behaving top-level function, which\n * is the preferred form in new code because it tree-shakes cleanly:\n *\n * | Namespace | Top-level equivalent |\n * | --- | --- |\n * | `greg.abs2greg` | {@link abs2greg} |\n * | `greg.daysInMonth` | {@link daysInGregMonth} |\n * | `greg.greg2abs` | {@link greg2abs} |\n * | `greg.isDate` | {@link isDate} |\n * | `greg.isLeapYear` | {@link isGregLeapYear} |\n * @example\n * import {greg} from '@hebcal/hdate';\n * greg.greg2abs(new Date(2008, 10, 13)); // 733359\n * greg.isLeapYear(2024); // true\n */\nexport var greg;\n(function (greg) {\n})(greg || (greg = {}));\ngreg.abs2greg = abs2greg;\ngreg.daysInMonth = daysInGregMonth;\ngreg.greg2abs = greg2abs;\ngreg.isDate = isDate;\ngreg.isLeapYear = isGregLeapYear;\n//# sourceMappingURL=gregNamespace.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/*\n * More minimal HDate\n */\nimport { hebrewStripNikkud } from './hebrewStripNikkud.js';\nconst NISAN = 1;\nconst IYYAR = 2;\nconst SIVAN = 3;\nconst TAMUZ = 4;\nconst AV = 5;\nconst ELUL = 6;\nconst TISHREI = 7;\nconst CHESHVAN = 8;\nconst KISLEV = 9;\nconst TEVET = 10;\nconst SHVAT = 11;\nconst ADAR_I = 12;\nconst ADAR_II = 13;\n/**\n * Hebrew months of the year (NISAN=1, TISHREI=7).\n *\n * Months are numbered from Nisan, the first month of the ecclesiastical\n * year, even though the civil year begins with Tishrei on Rosh Hashanah\n * (see {@link HDate.getTishreiMonth} for Tishrei-based numbering).\n *\n * In a common year month 12 is Adar; in a leap year month 12 is Adar I\n * and month 13 is Adar II.\n * @readonly\n * @enum {number}\n * @example\n * import {months, getMonthName} from '@hebcal/hdate';\n * months.TISHREI; // 7\n * getMonthName(months.ADAR_I, 5784); // 'Adar I' (5784 is a leap year)\n * getMonthName(months.ADAR_I, 5783); // 'Adar'\n */\nexport const months = {\n /** Nissan / ניסן */\n NISAN,\n /** Iyyar / אייר */\n IYYAR,\n /** Sivan / סיון */\n SIVAN,\n /** Tamuz (sometimes Tammuz) / תמוז */\n TAMUZ,\n /** Av / אב */\n AV,\n /** Elul / אלול */\n ELUL,\n /** Tishrei / תִּשְׁרֵי */\n TISHREI,\n /** Cheshvan / חשון */\n CHESHVAN,\n /** Kislev / כסלו */\n KISLEV,\n /** Tevet / טבת */\n TEVET,\n /** Sh'vat / שבט */\n SHVAT,\n /** Adar or Adar Rishon / אדר */\n ADAR_I,\n /** Adar Sheini (only on leap years) / אדר ב׳ */\n ADAR_II,\n};\nconst NISAN_STR = 'Nisan';\nconst monthNames0 = [\n '',\n NISAN_STR,\n 'Iyyar',\n 'Sivan',\n 'Tamuz',\n 'Av',\n 'Elul',\n 'Tishrei',\n 'Cheshvan',\n 'Kislev',\n 'Tevet',\n \"Sh'vat\",\n];\n/*\n * Transliterations of Hebrew month names.\n * Regular years are index 0 and leap years are index 1.\n * @private\n */\nconst monthNames = [\n [...monthNames0, 'Adar', NISAN_STR],\n [...monthNames0, 'Adar I', 'Adar II', NISAN_STR],\n];\n// Typed-array cache for elapsedDays, indexed by `year - ED_CACHE_MIN`.\n// The range covers Hebrew years ~AD 1240 through ~AD 3240, which spans\n// every realistic modern use. Years outside the range fall through\n// uncached. 0 is the \"not computed\" sentinel; every valid input\n// (year >= 1) produces a result >= 1, so it can't collide.\n// elapsedDays(6999) is ~2.56M, well within Int32 range.\nconst ED_CACHE_MIN = 5000;\nconst ED_CACHE_MAX = 6999;\nconst edCache = new Int32Array(ED_CACHE_MAX - ED_CACHE_MIN + 1);\nconst EPOCH = -1373428;\n// Avg year length in the cycle (19 solar years with 235 lunar months)\nconst AVG_HEBYEAR_DAYS = 365.24682220597794;\n/**\n * @private\n */\nfunction assertNumber(n, name) {\n if (typeof n !== 'number' || isNaN(n)) {\n throw new TypeError(`param '${name}' not a number: ${n}`);\n }\n}\n/**\n * Converts Hebrew date to R.D. (Rata Die) fixed days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 on the (proleptic)\n * Gregorian Calendar.\n *\n * R.D. is the common currency between the two calendars: convert a\n * Hebrew date to R.D. with this function, then to a Gregorian `Date`\n * with {@link abs2greg}.\n * @param year Hebrew year\n * @param month Hebrew month (1=NISAN, 7=TISHREI)\n * @param day Hebrew date (1-30)\n * @returns R.D. number of days\n * @throws {TypeError} if any argument is not a number\n * @throws {RangeError} if `year` is less than 1\n * @see {@link abs2hebrew}\n * @example\n * import {hebrew2abs, months} from '@hebcal/hdate';\n * hebrew2abs(5769, months.CHESHVAN, 15); // 733359\n */\nexport function hebrew2abs(year, month, day) {\n assertNumber(year, 'year');\n assertNumber(month, 'month');\n assertNumber(day, 'day');\n if (year < 1) {\n throw new RangeError(`hebrew2abs: invalid year ${year}`);\n }\n let tempabs = day;\n if (month < TISHREI) {\n const endMonth = monthsInYear(year);\n for (let m = TISHREI; m <= endMonth; m++) {\n tempabs += daysInMonth(m, year);\n }\n for (let m = NISAN; m < month; m++) {\n tempabs += daysInMonth(m, year);\n }\n }\n else {\n for (let m = TISHREI; m < month; m++) {\n tempabs += daysInMonth(m, year);\n }\n }\n return EPOCH + elapsedDays(year) + tempabs - 1;\n}\n/**\n * Convenience wrapper for `hebrew2abs` that accepts a\n * `SimpleHebrewDate` (`{yy, mm, dd}`) rather than three separate\n * arguments. Returns the same R.D. (Rata Die) day number.\n * @param hdate Hebrew date, or any object with `yy`/`mm`/`dd` fields\n * (an {@link HDate} qualifies)\n * @returns R.D. number of days\n * @example\n * import {hd2abs, months} from '@hebcal/hdate';\n * hd2abs({yy: 5769, mm: months.CHESHVAN, dd: 15}); // 733359\n */\nexport function hd2abs(hdate) {\n return hebrew2abs(hdate.yy, hdate.mm, hdate.dd);\n}\n/**\n * @private\n */\nfunction newYear(year) {\n return EPOCH + elapsedDays(year);\n}\n/**\n * Converts absolute R.D. days to Hebrew date\n * @param abs absolute R.D. days\n * @returns the Hebrew date as a plain `{yy, mm, dd}` object\n * @throws {TypeError} if `abs` is not a number\n * @throws {RangeError} if `abs` precedes the Hebrew epoch\n * @see {@link hebrew2abs}\n * @example\n * abs2hebrew(733359); // {yy: 5769, mm: 8, dd: 15} (15 Cheshvan 5769)\n */\nexport function abs2hebrew(abs) {\n assertNumber(abs, 'abs');\n abs = Math.trunc(abs);\n if (abs <= EPOCH) {\n throw new RangeError(`abs2hebrew: ${abs} is before epoch`);\n }\n // first, quickly approximate year\n let year = Math.floor((abs - EPOCH) / AVG_HEBYEAR_DAYS);\n while (newYear(year) <= abs) {\n ++year;\n }\n --year;\n let month = abs < hebrew2abs(year, 1, 1) ? 7 : 1;\n while (abs > hebrew2abs(year, month, daysInMonth(month, year))) {\n ++month;\n }\n const day = 1 + abs - hebrew2abs(year, month, 1);\n return { yy: year, mm: month, dd: day };\n}\n/**\n * Returns true if Hebrew year is a leap year.\n *\n * The Hebrew calendar is lunisolar: 7 years out of every 19-year\n * (Metonic) cycle are leap years, in which a 13th month (Adar I) is\n * inserted before Adar so that Nisan stays in the spring.\n * @param year Hebrew year\n * @returns `true` if `year` has 13 months\n * @example\n * isLeapYear(5783); // false\n * isLeapYear(5784); // true\n */\nexport function isLeapYear(year) {\n return (1 + year * 7) % 19 < 7;\n}\n/**\n * Number of months in this Hebrew year (either 12 or 13 depending on leap year).\n *\n * Because Adar II is the last month of a leap year and Adar the last\n * month of a common year, this doubles as \"the number of the final\n * month\", which is how the anniversary rules identify Adar.\n * @param year Hebrew year\n * @returns 12 or 13\n * @example\n * monthsInYear(5783); // 12\n * monthsInYear(5784); // 13\n */\nexport function monthsInYear(year) {\n return 12 + +isLeapYear(year); // boolean is cast to 1 or 0\n}\n// Static day counts indexed by month number. 0 marks months whose length\n// depends on the year (CHESHVAN, KISLEV, ADAR_I).\nconst STATIC_DAYS_IN_MONTH = [\n 0, 30, 29, 30, 29, 30, 29, 30, 0, 0, 29, 30, 0, 29,\n];\n/**\n * Number of days in Hebrew month in a given year (29 or 30).\n *\n * Most months have a fixed length. Cheshvan and Kislev vary to absorb\n * the 353/354/355-day variation of the Hebrew year (see\n * {@link longCheshvan} and {@link shortKislev}), and Adar I has 30 days\n * in a leap year but 29 in a common year.\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @returns an integer 29-30\n * @example\n * import {daysInMonth, months} from '@hebcal/hdate';\n * daysInMonth(months.CHESHVAN, 5769); // 29\n * daysInMonth(months.KISLEV, 5769); // 30\n */\nexport function daysInMonth(month, year) {\n const d = STATIC_DAYS_IN_MONTH[month];\n if (d !== 0)\n return d;\n if (month === ADAR_I)\n return isLeapYear(year) ? 30 : 29;\n if (month === CHESHVAN)\n return longCheshvan(year) ? 30 : 29;\n return shortKislev(year) ? 29 : 30; // KISLEV\n}\n/**\n * Returns a transliterated string name of Hebrew month in year,\n * for example 'Elul' or 'Cheshvan'.\n *\n * The year matters only for the 12th month, which is named `'Adar'` in a\n * common year and `'Adar I'` in a leap year. To translate the result into\n * another locale, pass it to {@link Locale.gettext}.\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @returns transliterated month name\n * @throws {TypeError} if `month` is out of range 1-14\n * @example\n * import {getMonthName, months} from '@hebcal/hdate';\n * getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'\n * getMonthName(months.ADAR_I, 5784); // 'Adar I' (leap year)\n * getMonthName(months.ADAR_I, 5783); // 'Adar' (common year)\n */\nexport function getMonthName(month, year) {\n assertNumber(month, 'month');\n assertNumber(year, 'year');\n if (month < 1 || month > 14) {\n throw new TypeError(`bad monthNum: ${month}`);\n }\n return monthNames[+isLeapYear(year)][month];\n}\n/**\n * Days from sunday prior to start of Hebrew calendar to mean\n * conjunction of Tishrei in Hebrew YEAR, after applying the four\n * postponement rules (dechiyot) that fix Rosh Hashanah.\n *\n * This is an implementation detail of the calendar arithmetic rather\n * than a supported entry point; prefer {@link hebrew2abs} or\n * {@link daysInYear}. Results for years 5000-6999 are cached.\n * @internal\n * @param year Hebrew year\n * @returns days elapsed since the epoch\n */\nexport function elapsedDays(year) {\n if (year >= ED_CACHE_MIN && year <= ED_CACHE_MAX) {\n const idx = year - ED_CACHE_MIN;\n const n = edCache[idx];\n if (n !== 0)\n return n;\n const elapsed = elapsedDays0(year);\n edCache[idx] = elapsed;\n return elapsed;\n }\n return elapsedDays0(year);\n}\n/**\n * Days from sunday prior to start of Hebrew calendar to mean\n * conjunction of Tishrei in Hebrew YEAR\n * @private\n * @param year Hebrew year\n */\nfunction elapsedDays0(year) {\n const prevYear = year - 1;\n const mElapsed = 235 * Math.floor(prevYear / 19) + // Months in complete 19 year lunar (Metonic) cycles so far\n 12 * (prevYear % 19) + // Regular months in this cycle\n Math.floor(((prevYear % 19) * 7 + 1) / 19); // Leap months this cycle\n const pElapsed = 204 + 793 * (mElapsed % 1080);\n const hElapsed = 5 +\n 12 * mElapsed +\n 793 * Math.floor(mElapsed / 1080) +\n Math.floor(pElapsed / 1080);\n const parts = (pElapsed % 1080) + 1080 * (hElapsed % 24);\n const day = 1 + 29 * mElapsed + Math.floor(hElapsed / 24);\n let altDay = day;\n if (parts >= 19440 ||\n (2 === day % 7 && parts >= 9924 && !isLeapYear(year)) ||\n (1 === day % 7 && parts >= 16789 && isLeapYear(prevYear))) {\n altDay++;\n }\n if (altDay % 7 === 0 || altDay % 7 === 3 || altDay % 7 === 5) {\n return altDay + 1;\n }\n else {\n return altDay;\n }\n}\n/**\n * Number of days in the hebrew YEAR.\n * A common Hebrew calendar year can have a length of 353, 354 or 355 days\n * A leap Hebrew calendar year can have a length of 383, 384 or 385 days\n *\n * The three lengths within each group are deficient, regular and\n * complete years respectively; see {@link shortKislev} and\n * {@link longCheshvan} for which month absorbs the difference.\n * @param year Hebrew year\n * @returns 353-355 in a common year, 383-385 in a leap year\n * @example\n * daysInYear(5783); // 355\n * daysInYear(5784); // 383 (leap year)\n */\nexport function daysInYear(year) {\n return elapsedDays(year + 1) - elapsedDays(year);\n}\n/**\n * true if Cheshvan is long in Hebrew year.\n *\n * Cheshvan normally has 29 days, but gains a 30th in a \"complete\"\n * (שלמה) year, one of the two ways the calendar stretches a year to\n * keep Rosh Hashanah off a forbidden weekday.\n * @param year Hebrew year\n * @returns `true` if Cheshvan has 30 days\n * @example\n * longCheshvan(5783); // true\n * longCheshvan(5784); // false\n */\nexport function longCheshvan(year) {\n return daysInYear(year) % 10 === 5;\n}\n/**\n * true if Kislev is short in Hebrew year.\n *\n * Kislev normally has 30 days, but drops to 29 in a \"deficient\" (חסרה)\n * year, the counterpart to {@link longCheshvan} that shortens a year by\n * a day.\n * @param year Hebrew year\n * @returns `true` if Kislev has 29 days\n * @example\n * shortKislev(5783); // false\n * shortKislev(5784); // true\n */\nexport function shortKislev(year) {\n return daysInYear(year) % 10 === 3;\n}\n/**\n * Converts Hebrew month string name to numeric.\n *\n * Accepts transliterated names (`'Cheshvan'`, `'Sh'vat'`), Hebrew-script\n * names with or without nikud (`'חשון'`, `'תִּשְׁרֵי'`), an optional bet\n * prefix (`'בתמוז'`), and passes numbers through unchanged. Matching is\n * case-insensitive and only needs enough of the name to be unambiguous.\n * `'Adar'` resolves to Adar I; `'Adar II'` (and `'אדר ב׳'`) to Adar II.\n * @param monthName monthName\n * @returns Hebrew month number (1=NISAN, 7=TISHREI)\n * @throws {TypeError} if `monthName` is neither a string nor a number\n * @throws {RangeError} if the name is not recognized, or a numeric month\n * is outside 1-14\n * @example\n * monthFromName('Cheshvan'); // 8\n * monthFromName('חשון'); // 8\n * monthFromName('Adar II'); // 13\n * monthFromName(7); // 7 (passthrough)\n */\nexport function monthFromName(monthName) {\n if (typeof monthName === 'number') {\n if (isNaN(monthName) || monthName < 1 || monthName > 14) {\n throw new RangeError(`bad monthName: ${monthName}`);\n }\n return monthName;\n }\n if (typeof monthName !== 'string') {\n throw new TypeError(`bad monthName: ${monthName}`);\n }\n let c = monthName.trim().toLowerCase();\n // remove all niqud and trailing gershayim (for Adar Alef/Bet)\n c = hebrewStripNikkud(c).replace(/׳$/, '');\n // If Hebrew month starts with a bet (for example `בתמוז`) then ignore it\n if (c.startsWith('ב')) {\n c = c.substring(1);\n }\n /*\n the Hebrew months are unique to their second letter\n N Nisan (November?)\n I Iyyar\n E Elul\n C Cheshvan\n K Kislev\n 1 1Adar\n 2 2Adar\n Si Sh Sivan, Shvat\n Ta Ti Te Tamuz, Tishrei, Tevet\n Av Ad Av, Adar\n \n אב אד אי אל אב אדר אייר אלול\n ח חשון\n ט טבת\n כ כסלו\n נ ניסן\n ס סיון\n ש שבט\n תמ תש תמוז תשרי\n */\n switch (c[0]) {\n case 'n':\n case 'נ':\n if (c[1] === 'o') {\n break; /* this catches \"november\" */\n }\n return NISAN;\n case 'i':\n return IYYAR;\n case 'e':\n return ELUL;\n case 'c':\n case 'ח':\n return CHESHVAN;\n case 'k':\n case 'כ':\n return KISLEV;\n case 's':\n switch (c[1]) {\n case 'i':\n return SIVAN;\n case 'h':\n return SHVAT;\n default:\n break;\n }\n break;\n case 't':\n switch (c[1]) {\n case 'a':\n return TAMUZ;\n case 'i':\n return TISHREI;\n case 'e':\n return TEVET;\n default:\n break;\n }\n break;\n case 'a':\n switch (c[1]) {\n case 'v':\n return AV;\n case 'd':\n if (/(1|[^i]i|a|א)$/i.test(c)) {\n return ADAR_I;\n }\n return ADAR_II; // else assume sheini\n default:\n break;\n }\n break;\n case 'ס':\n return SIVAN;\n case 'ט':\n return TEVET;\n case 'ש':\n return SHVAT;\n case 'א':\n switch (c[1]) {\n case 'ב':\n return AV;\n case 'ד':\n if (/(1|[^i]i|a|א)$/i.test(c)) {\n return ADAR_I;\n }\n return ADAR_II; // else assume sheini\n case 'י':\n return IYYAR;\n case 'ל':\n return ELUL;\n default:\n break;\n }\n break;\n case 'ת':\n switch (c[1]) {\n case 'מ':\n return TAMUZ;\n case 'ש':\n return TISHREI;\n default:\n break;\n }\n break;\n }\n throw new RangeError(`bad monthName: ${monthName}`);\n}\n//# sourceMappingURL=hdateBase.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { hebrew2abs, abs2hebrew, isLeapYear, months, monthsInYear, shortKislev, longCheshvan, } from './hdateBase.js';\nimport { abs2greg, greg2abs, isDate } from './greg.js';\nconst NISAN = months.NISAN;\nconst CHESHVAN = months.CHESHVAN;\nconst KISLEV = months.KISLEV;\nconst TEVET = months.TEVET;\nconst SHVAT = months.SHVAT;\nconst ADAR_I = months.ADAR_I;\nconst ADAR_II = months.ADAR_II;\n/**\n * Returns true if the object is a SimpleHebrewDate\n * @private\n */\nfunction isSimpleHebrewDate(obj0) {\n const obj = obj0;\n return (typeof obj === 'object' &&\n obj !== null &&\n typeof obj.yy === 'number' &&\n typeof obj.mm === 'number' &&\n typeof obj.dd === 'number');\n}\n/**\n * Normalizes any accepted form of an event date into a `SimpleHebrewDate`.\n *\n * When the caller passes an object (a `SimpleHebrewDate` or anything\n * structurally compatible with it, such as an `HDate`), this returns a\n * copy rather than the object itself: callers keep their original event\n * date around and reuse it across years, and the anniversary functions\n * are free to modify the value they get back from here.\n * @private\n */\nfunction toSimpleHebrewDate(obj) {\n if (isSimpleHebrewDate(obj)) {\n const hd = obj;\n return { yy: hd.yy, mm: hd.mm, dd: hd.dd };\n }\n else if (isDate(obj)) {\n const abs = greg2abs(obj);\n return abs2hebrew(abs);\n }\n else {\n // typeof obj === 'number'\n return abs2hebrew(obj);\n }\n}\n/**\n * Calculates yahrzeit and converts the result to a Gregorian `Date`.\n *\n * See {@link getYahrzeitHD} for a description of the algorithm.\n * @deprecated Use {@link yahrzeit} instead, which returns an `HDate`.\n * Returning a Gregorian `Date` loses the Hebrew date that was actually\n * computed and invites a needless conversion back again; call\n * `.greg()` on the result if you really do want a `Date`.\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear` as a Gregorian date, or\n * `undefined` when `hyear` is on or before the year of death\n * @see {@link yahrzeit} to get the result as an `HDate`\n * @see {@link birthdayOrAnniversary} for birthdays and other\n * non-yahrzeit anniversaries\n * @example\n * import {getYahrzeit} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const anniversary = getYahrzeit(5780, dt); // '2/25/2020' == '30 Sh\\'vat 5780'\n */\nexport function getYahrzeit(hyear, date) {\n const hd = getYahrzeitHD(hyear, date);\n if (!hd) {\n return hd;\n }\n return abs2greg(hebrew2abs(hd.yy, hd.mm, hd.dd));\n}\n/**\n * Calculates yahrzeit, the anniversary of a death, and returns it as a\n * `SimpleHebrewDate` (`{yy, mm, dd}`).\n * `hyear` must be after original `date` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * **This is not the same calculation as a birthday.** When the original\n * date does not exist in the target year, a yahrzeit falls *earlier* —\n * on the last day of the preceding month — because the anniversary\n * should not be observed later than the day itself. A birthday in the\n * same situation is *postponed* to the first of the following month.\n * See {@link getBirthdayHD} for the contrast.\n *\n * The two also differ in whether the original year is a legal `hyear`.\n * A yahrzeit is by definition an *anniversary* of a death, so the\n * earliest one that exists is the first: the day of the death itself is\n * not a yahrzeit, and a \"zeroth\" yahrzeit has no meaning to return.\n * `hyear` must therefore be strictly after the year of death, and this\n * function returns `undefined` otherwise. A birth date, by contrast, is\n * a real and meaningful day in its own right, so\n * {@link getBirthdayHD} accepts the year of birth and hands back the\n * original date.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @see {@link yahrzeit} for the same result as an `HDate` instance\n * @example\n * import {getYahrzeitHD} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // 30 Adar I 5774\n * getYahrzeitHD(5780, dt); // {yy: 5780, mm: 11, dd: 30} (30 Sh'vat)\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear`, or `undefined`\n * when `hyear` is on or before the original year\n */\nexport function getYahrzeitHD(hyear, date) {\n let hDeath = toSimpleHebrewDate(date);\n if (hyear <= hDeath.yy) {\n // Hebrew year ${hyear} occurs on or before original date in ${hDeath.yy}\n return undefined;\n }\n if (hDeath.mm === CHESHVAN &&\n hDeath.dd === 30 &&\n !longCheshvan(hDeath.yy + 1)) {\n // If it's Heshvan 30 it depends on the first anniversary;\n // if that was not Heshvan 30, use the day before Kislev 1.\n hDeath = abs2hebrew(hebrew2abs(hyear, KISLEV, 1) - 1);\n }\n else if (hDeath.mm === KISLEV &&\n hDeath.dd === 30 &&\n shortKislev(hDeath.yy + 1)) {\n // If it's Kislev 30 it depends on the first anniversary;\n // if that was not Kislev 30, use the day before Teveth 1.\n hDeath = abs2hebrew(hebrew2abs(hyear, TEVET, 1) - 1);\n }\n else if (hDeath.mm === ADAR_II) {\n // If it's Adar II, use the same day in last month of year (Adar or Adar II).\n hDeath.mm = monthsInYear(hyear);\n }\n else if (hDeath.mm === ADAR_I && hDeath.dd === 30 && !isLeapYear(hyear)) {\n // If it's the 30th in Adar I and year is not a leap year\n // (so Adar has only 29 days), use the last day in Shevat.\n hDeath.dd = 30;\n hDeath.mm = SHVAT;\n }\n // In all other cases, use the normal anniversary of the date of death.\n // advance day to rosh chodesh if needed\n if (hDeath.mm === CHESHVAN && hDeath.dd === 30 && !longCheshvan(hyear)) {\n hDeath.mm = KISLEV;\n hDeath.dd = 1;\n }\n else if (hDeath.mm === KISLEV && hDeath.dd === 30 && shortKislev(hyear)) {\n hDeath.mm = TEVET;\n hDeath.dd = 1;\n }\n hDeath.yy = hyear;\n return hDeath;\n}\n/**\n * Calculates a birthday or anniversary (non-yahrzeit) and converts the\n * result to a Gregorian `Date`.\n *\n * See {@link getBirthdayHD} for a description of the algorithm.\n * @deprecated Use {@link birthdayOrAnniversary} instead, which returns\n * an `HDate`. Returning a Gregorian `Date` loses the Hebrew date that\n * was actually computed and invites a needless conversion back again;\n * call `.greg()` on the result if you really do want a `Date`.\n * @example\n * import {getBirthdayOrAnniversary} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const anniversary = getBirthdayOrAnniversary(5780, dt); // '3/26/2020' == '1 Nisan 5780'\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of the original event\n * @returns anniversary occurring in `hyear` as a Gregorian date, or\n * `undefined` when `hyear` precedes the original year\n * @see {@link birthdayOrAnniversary} to get the result as an `HDate`\n * @see {@link yahrzeit} for anniversaries of a death\n */\nexport function getBirthdayOrAnniversary(hyear, date) {\n const hd = getBirthdayHD(hyear, date);\n if (!hd) {\n return hd;\n }\n return abs2greg(hebrew2abs(hd.yy, hd.mm, hd.dd));\n}\n/**\n * Calculates a birthday or anniversary (non-yahrzeit) and returns it as\n * a `SimpleHebrewDate` (`{yy, mm, dd}`).\n * `hyear` must be on or after original `date` of anniversary.\n * Returns `undefined` when requested year preceeds the original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * **This is not the same calculation as a yahrzeit.** When the original\n * date is missing from the target year, a birthday is *postponed* to the\n * first of the following month, whereas a yahrzeit moves *earlier* to\n * the last day of the preceding month. Passing the same original date to\n * both functions can therefore return dates almost a month apart.\n *\n * Unlike {@link getYahrzeitHD}, `hyear` may equal the original year, in\n * which case the original date is returned unchanged. A birth date is a\n * meaningful day in its own right — it is the day the person was born,\n * not merely the zeroth anniversary of it. A death has no comparable\n * day: a yahrzeit only begins to exist on the first anniversary, which\n * is why {@link getYahrzeitHD} rejects the year of death.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @see {@link birthdayOrAnniversary} for the same result as an `HDate` instance\n * @example\n * import {getBirthdayHD} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // 30 Adar I 5774\n * getBirthdayHD(5780, dt); // {yy: 5780, mm: 1, dd: 1} (1 Nisan)\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of the original event\n * @returns anniversary occurring in `hyear`, or `undefined`\n * when `hyear` precedes the original year\n */\nexport function getBirthdayHD(hyear, date) {\n const orig = toSimpleHebrewDate(date);\n const origYear = orig.yy;\n if (hyear === origYear) {\n return orig;\n }\n else if (hyear < origYear) {\n // Hebrew year ${hyear} occurs on or before original date in ${origYear}\n return undefined;\n }\n const isOrigLeap = isLeapYear(origYear);\n let month = orig.mm;\n let day = orig.dd;\n if ((month === ADAR_I && !isOrigLeap) || (month === ADAR_II && isOrigLeap)) {\n month = monthsInYear(hyear);\n }\n else if (month === CHESHVAN && day === 30 && !longCheshvan(hyear)) {\n month = KISLEV;\n day = 1;\n }\n else if (month === KISLEV && day === 30 && shortKislev(hyear)) {\n month = TEVET;\n day = 1;\n }\n else if (month === ADAR_I &&\n day === 30 &&\n isOrigLeap &&\n !isLeapYear(hyear)) {\n month = NISAN;\n day = 1;\n }\n return { yy: hyear, mm: month, dd: day };\n}\n//# sourceMappingURL=anniversary.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nconst GERESH = '׳';\nconst GERSHAYIM = '״';\nconst heb2num = {\n א: 1,\n ב: 2,\n ג: 3,\n ד: 4,\n ה: 5,\n ו: 6,\n ז: 7,\n ח: 8,\n ט: 9,\n י: 10,\n כ: 20,\n ל: 30,\n מ: 40,\n נ: 50,\n ס: 60,\n ע: 70,\n פ: 80,\n צ: 90,\n ק: 100,\n ר: 200,\n ש: 300,\n ת: 400,\n};\nconst num2heb = {};\nfor (const [key, val] of Object.entries(heb2num)) {\n num2heb[val] = key;\n}\nfunction num2digits(num) {\n const digits = [];\n while (num > 0) {\n if (num === 15 || num === 16) {\n digits.push(9, num - 9);\n break;\n }\n let incr = 100;\n let i;\n for (i = 400; i > num; i -= incr) {\n if (i === incr) {\n incr = incr / 10;\n }\n }\n digits.push(i);\n num -= i;\n }\n return digits;\n}\n/**\n * Converts a numerical value to a string of Hebrew letters.\n *\n * When specifying years of the Hebrew calendar in the present millennium,\n * we omit the thousands (which is presently 5 [ה]).\n * @example\n * gematriya(5774) // 'תשע״ד' - cropped to 774\n * gematriya(25) // 'כ״ה'\n * gematriya(60) // 'ס׳'\n * gematriya(3761) // 'ג׳תשס״א'\n * gematriya(1123) // 'א׳קכ״ג'\n */\nexport function gematriya(num) {\n const num1 = parseInt(num, 10);\n if (!num1 || num1 < 0) {\n throw new TypeError(`invalid number: ${num}`);\n }\n let str = '';\n const thousands = Math.floor(num1 / 1000);\n if (thousands > 0 && thousands !== 5) {\n const tdigits = num2digits(thousands);\n for (const tdig of tdigits) {\n str += num2heb[tdig];\n }\n str += GERESH;\n }\n const digits = num2digits(num1 % 1000);\n if (digits.length === 1) {\n return str + num2heb[digits[0]] + GERESH;\n }\n for (let i = 0; i < digits.length; i++) {\n if (i + 1 === digits.length) {\n str += GERSHAYIM;\n }\n str += num2heb[digits[i]];\n }\n return str;\n}\n/**\n * Converts a string of Hebrew letters to a numerical value.\n *\n * Only considers the value of Hebrew letters `א` through `ת`.\n * Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)\n * and vowels (nekudot).\n * @example\n * gematriyaStrToNum('תשע״ד'); // 774\n * gematriyaStrToNum('ט״ו'); // 15\n * gematriyaStrToNum('ג׳תשס״א'); // 3761 (thousands prefix)\n */\nexport function gematriyaStrToNum(str) {\n if (typeof str !== 'string') {\n throw new TypeError(`bad gematriya str: ${str}`);\n }\n let num = 0;\n const gereshIdx = str.indexOf(GERESH);\n if (gereshIdx !== -1 && gereshIdx !== str.length - 1) {\n const thousands = str.substring(0, gereshIdx);\n num += gematriyaStrToNum(thousands) * 1000;\n str = str.substring(gereshIdx);\n }\n for (const ch of str) {\n const n = heb2num[ch];\n if (typeof n === 'number') {\n num += n;\n }\n }\n return num;\n}\n//# sourceMappingURL=gematriya.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/**\n * Formats a number with leading zeros so the resulting string is 4 digits long.\n * Similar to `string.padStart(4, '0')` but will also format\n * negative numbers similar to how the JavaScript date formats\n * negative year numbers (e.g. `-37` is formatted as `-000037`).\n * @example\n * pad4(7); // '0007'\n * pad4(2024); // '2024'\n * pad4(-37); // '-000037'\n */\nexport function pad4(num) {\n if (num < 0) {\n return '-00' + pad4(-num);\n }\n else if (num < 10) {\n return '000' + num;\n }\n else if (num < 100) {\n return '00' + num;\n }\n else if (num < 1000) {\n return '0' + num;\n }\n return String(num);\n}\n/**\n * Formats a number with leading zeros so the resulting string is 2 digits long.\n * Similar to `string.padStart(2, '0')`.\n * @example\n * pad2(3); // '03'\n * pad2(11); // '11'\n */\nexport function pad2(num) {\n if (num >= 0 && num < 10) {\n return '0' + num;\n }\n return String(num);\n}\n//# sourceMappingURL=pad.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { pad2, pad4 } from './pad.js';\nconst _formatters = new Map();\n/**\n * @private\n */\nfunction getFormatter(tzid) {\n const fmt = _formatters.get(tzid);\n if (fmt)\n return fmt;\n const f = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n timeZone: tzid,\n });\n _formatters.set(tzid, f);\n return f;\n}\nconst dateFormatRegex = /^(\\d+).(\\d+).(\\d+),?\\s+(\\d+).(\\d+).(\\d+)/;\n/**\n * Returns a string similar to `Date.toISOString()` but in the\n * timezone `tzid`. Contrary to the typical meaning of `Z` at the end\n * of the string, this is not actually a UTC date.\n * @example\n * const dt = new Date(Date.UTC(2021, 0, 31, 7, 30, 50));\n * getPseudoISO('UTC', dt); // '2021-01-31T07:30:50Z'\n * getPseudoISO('America/New_York', dt); // '2021-01-31T02:30:50Z'\n * getPseudoISO('Asia/Jerusalem', dt); // '2021-01-31T09:30:50Z'\n */\nexport function getPseudoISO(tzid, date) {\n const str = getFormatter(tzid).format(date);\n const m = dateFormatRegex.exec(str);\n if (m === null) {\n throw new Error(`Unable to parse formatted string: ${str}`);\n }\n let hour = m[4];\n if (hour === '24') {\n hour = '00';\n }\n m[3] = pad4(parseInt(m[3], 10));\n return `${m[3]}-${m[1]}-${m[2]}T${hour}:${m[5]}:${m[6]}Z`;\n}\n/**\n * Returns number of minutes `tzid` is offset from UTC on date `date`.\n * @example\n * const january = new Date(Date.UTC(2020, 0, 15, 12));\n * getTimezoneOffset('America/New_York', january); // 300 (UTC-5)\n * getTimezoneOffset('America/Los_Angeles', january); // 480 (UTC-8)\n * getTimezoneOffset('Asia/Jerusalem', january); // -120 (UTC+2)\n */\nexport function getTimezoneOffset(tzid, date) {\n const utcStr = getPseudoISO('UTC', date);\n const localStr = getPseudoISO(tzid, date);\n const diffMs = new Date(utcStr).getTime() - new Date(localStr).getTime();\n return Math.ceil(diffMs / 1000 / 60);\n}\n/**\n * Formats the date portion of `dt` as `YYYY-MM-DD` using the date's\n * local-time fields (year/month/day), not its UTC fields. The year is\n * always padded to at least 4 digits and negative years are prefixed\n * with `-`, matching the formatting that `pad4` applies.\n *\n * This is intentionally separate from `Date.prototype.toISOString()`,\n * which always reports in UTC and may report a different day for\n * dates near midnight in non-UTC time zones.\n * @example\n * isoDateString(new Date(2008, 10, 13)); // '2008-11-13'\n * isoDateString(new Date(2021, 0, 31)); // '2021-01-31'\n */\nexport function isoDateString(dt) {\n return (pad4(dt.getFullYear()) +\n '-' +\n pad2(dt.getMonth() + 1) +\n '-' +\n pad2(dt.getDate()));\n}\n//# sourceMappingURL=dateFormat.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nexport default { \"headers\": { \"plural-forms\": \"nplurals=2; plural=(n > 1);\", \"language\": \"und-x-ashkenaz\" }, \"contexts\": { \"\": { \"Tevet\": [\"Teves\"] } } };\n//# sourceMappingURL=ashkenazi.po.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nexport default { \"headers\": { \"plural-forms\": \"nplurals=2; plural=(n > 1);\", \"language\": \"he\" }, \"contexts\": { \"\": { \"Adar\": [\"אֲדָר\"], \"Adar I\": [\"אֲדָר א׳\"], \"Adar II\": [\"אֲדָר ב׳\"], \"Av\": [\"אָב\"], \"Cheshvan\": [\"חֶשְׁוָן\"], \"Elul\": [\"אֱלוּל\"], \"Iyyar\": [\"אִיָּיר\"], \"Kislev\": [\"כִּסְלֵו\"], \"Nisan\": [\"נִיסָן\"], \"Sh'vat\": [\"שְׁבָט\"], \"Sivan\": [\"סִיוָן\"], \"Tamuz\": [\"תַּמּוּז\"], \"Tammuz\": [\"תַּמּוּז\"], \"Tevet\": [\"טֵבֵת\"], \"Tishrei\": [\"תִּשְׁרֵי\"] } } };\n//# sourceMappingURL=he.po.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { hebrewStripNikkud } from './hebrewStripNikkud.js';\nimport poAshkenazi from './ashkenazi.po.js';\nimport poHe from './he.po.js';\nconst noopLocale = {\n headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },\n contexts: { '': {} },\n};\nconst alias = {\n h: 'he',\n a: 'ashkenazi',\n s: 'en',\n '': 'en',\n};\n/** @private */\nconst locales = new Map();\n/** @private */\nfunction getEnOrdinal(n) {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return n + (s[(v - 20) % 10] || s[v] || s[0]);\n}\n/** @private */\nfunction checkLocale(locale) {\n if (typeof locale !== 'string') {\n throw new TypeError(`Invalid locale name: ${locale}`);\n }\n locale = alias[locale] || locale;\n return locale.toLowerCase();\n}\n/** @private */\nfunction getExistingLocale(locale) {\n const locale1 = checkLocale(locale);\n const loc = locales.get(locale1);\n if (!loc) {\n throw new RangeError(`Locale '${locale}' not found`);\n }\n return loc;\n}\n/**\n * A locale in Hebcal is used for translations/transliterations of\n * holidays. `@hebcal/hdate` supports four locales by default\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n * * `he-x-NoNikud` - Hebrew without nikud (e.g. \"שבת\")\n *\n * The locale set that ships here covers only what this package needs:\n * month names, a handful of connective words, and the parts of speech\n * used by {@link HDate.render}. Packages built on top of it (such as\n * `@hebcal/core`) register their own holiday translations into the same\n * locales with {@link Locale.addTranslations}.\n *\n * Every method is static — `Locale` is a namespace, not something you\n * instantiate. Locale names are matched case-insensitively, and the\n * single letters `h`, `a` and `s` are accepted as aliases for `he`,\n * `ashkenazi` and `en` respectively.\n * @example\n * import {Locale, HDate, months} from '@hebcal/hdate';\n *\n * Locale.gettext('Cheshvan', 'he'); // 'חֶשְׁוָן'\n * Locale.gettext('Cheshvan', 'ashkenazi'); // 'Cheshvan'\n * Locale.ordinal(15, 'en'); // '15th'\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * hd.render('en'); // '15th of Cheshvan, 5769'\n * hd.render('he'); // '15 חֶשְׁוָן, 5769'\n */\nexport class Locale {\n /**\n * Returns translation only if `locale` offers a non-empty translation for `id`.\n * Otherwise, returns `undefined`.\n * @param id Message ID to translate\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.\n * @example\n * Locale.lookupTranslation('Adar II', 'he-x-NoNikud'); // 'אדר ב׳'\n * Locale.lookupTranslation('Foobar', 'he-x-NoNikud'); // undefined\n */\n static lookupTranslation(id, locale) {\n const loc = (typeof locale === 'string' && locales.get(checkLocale(locale))) ||\n noopLocale.contexts[''];\n const array = loc[id];\n if (array?.length && array[0].length) {\n return array[0];\n }\n return undefined;\n }\n /**\n * By default, if no translation was found, returns `id`.\n * @param id Message ID to translate\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.\n * @example\n * Locale.gettext('Elul', 'he'); // 'אֱלוּל'\n * Locale.gettext('Tevet', 'ashkenazi'); // 'Teves'\n * Locale.gettext('Unknown', 'he'); // 'Unknown' (falls back to id)\n */\n static gettext(id, locale) {\n const text = this.lookupTranslation(id, locale);\n if (text === undefined) {\n return id;\n }\n return text;\n }\n /**\n * Register locale translations, replacing the locale entirely if it\n * was already registered. Use {@link Locale.addTranslations} to merge\n * into an existing locale instead.\n * @param locale Locale name (i.e.: `'he'`, `'fr'`)\n * @param data parsed data from a `.po` file.\n * @throws {TypeError} if `data` is not in the compact `.po` format\n * @example\n * import {Locale} from '@hebcal/hdate';\n * // typically `import poFr from './fr.po'` — inlined here for clarity\n * const poFr = {headers: {}, contexts: {'': {Shabbat: ['Chabbat']}}};\n * Locale.addLocale('fr', poFr);\n * Locale.gettext('Shabbat', 'fr'); // 'Chabbat'\n */\n static addLocale(locale, data) {\n locale = checkLocale(locale);\n const ctx = data.contexts;\n if (typeof ctx !== 'object' || typeof ctx[''] !== 'object') {\n throw new TypeError(`Locale '${locale}' invalid compact format`);\n }\n locales.set(locale, ctx['']);\n }\n /**\n * Adds a translation to `locale`, replacing any previous translation.\n * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @param id Message ID to translate\n * @param translation Translation text\n * @example\n * Locale.addTranslation('ashkenazi', 'Foobar', 'Quux');\n * Locale.gettext('Foobar', 'ashkenazi'); // 'Quux'\n */\n static addTranslation(locale, id, translation) {\n const loc = getExistingLocale(locale);\n if (typeof id !== 'string' || id.length === 0) {\n throw new TypeError(`Invalid id string: ${id}`);\n }\n const isArray = Array.isArray(translation);\n if (isArray) {\n const t0 = translation[0];\n if (typeof t0 !== 'string' || t0.length === 0) {\n throw new TypeError(`Invalid translation array: ${translation}`);\n }\n }\n else if (typeof translation !== 'string') {\n throw new TypeError(`Invalid translation string: ${translation}`);\n }\n loc[id] = isArray ? translation : [translation];\n }\n /**\n * Adds multiple translations to `locale`, replacing any previous translations.\n *\n * The locale must already be registered (typically via `addLocale`);\n * to register a brand-new locale instead, call `addLocale` directly.\n * Use this method to merge an additional `.po` file (e.g. holiday\n * translations supplied by a separate `@hebcal/*` package) into an\n * existing locale.\n * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @param data parsed data from a `.po` file.\n * @throws {RangeError} if `locale` has not been registered\n * @throws {TypeError} if `data` is not in the compact `.po` format\n * @example\n * import {Locale} from '@hebcal/hdate';\n * Locale.addTranslations('ashkenazi', {\n * headers: {},\n * contexts: {'': {Sukkot: ['Sukkos'], Shavuot: ['Shavuos']}},\n * });\n * Locale.gettext('Sukkot', 'ashkenazi'); // 'Sukkos'\n * Locale.gettext('Tevet', 'ashkenazi'); // 'Teves' (existing translations kept)\n */\n static addTranslations(locale, data) {\n const loc = getExistingLocale(locale);\n const ctx = data.contexts;\n if (typeof ctx !== 'object' || typeof ctx[''] !== 'object') {\n throw new TypeError(`Locale '${locale}' invalid compact format`);\n }\n Object.assign(loc, ctx['']);\n }\n /**\n * Returns the names of registered locales\n * @example\n * Locale.getLocaleNames(); // ['ashkenazi', 'en', 'he', 'he-x-nonikud']\n */\n static getLocaleNames() {\n const keys = Array.from(locales.keys());\n return keys.sort((a, b) => a.localeCompare(b));\n }\n /**\n * Checks whether a locale has been registered\n * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @example\n * Locale.hasLocale('he'); // true\n * Locale.hasLocale('fr'); // false\n */\n static hasLocale(locale) {\n const locale1 = checkLocale(locale);\n return locales.has(locale1);\n }\n /**\n * Renders a number in ordinal, such as 1st, 2nd or 3rd\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.\n * @example\n * Locale.ordinal(3, 'en'); // '3rd'\n * Locale.ordinal(3, 'es'); // '3º'\n * Locale.ordinal(3, 'fr'); // '3.'\n * Locale.ordinal(3, 'he'); // '3'\n */\n static ordinal(n, locale) {\n const locale1 = checkLocale(locale || '');\n if (locale1 === 'en' || locale1.startsWith('ashkenazi')) {\n return getEnOrdinal(n);\n }\n else if (Locale.isHebrewLocale(locale1)) {\n return String(n);\n }\n else if (locale1 === 'es') {\n return n + 'º';\n }\n return n + '.';\n }\n /**\n * Removes nekudot from Hebrew string\n * @example\n * Locale.hebrewStripNikkud('אֱלוּל'); // 'אלול'\n */\n static hebrewStripNikkud(str) {\n return hebrewStripNikkud(str);\n }\n /**\n * Returns a new `LocaleData` derived from `data` with niqqud (vowel\n * points) stripped from every translation value. The input is not\n * modified.\n *\n * This is the helper used internally to build the `he-x-NoNikud`\n * locale from `he`; call it when registering a derived \"no nikud\"\n * variant of a custom Hebrew-script locale.\n * @param data locale data to copy\n * @returns a new `LocaleData` with niqqud removed\n * @see {@link Locale.hebrewStripNikkud}\n * @example\n * import {Locale} from '@hebcal/hdate';\n * const withNikud = {\n * headers: {},\n * contexts: {'': {Elul: ['אֱלוּל']}},\n * };\n * const stripped = Locale.copyLocaleNoNikud(withNikud);\n * stripped.contexts[''].Elul[0]; // 'אלול'\n * withNikud.contexts[''].Elul[0]; // 'אֱלוּל' (input unchanged)\n */\n static copyLocaleNoNikud(data) {\n const strs = data.contexts[''];\n const m = {};\n for (const [key, val] of Object.entries(strs)) {\n m[key] = [hebrewStripNikkud(val[0])];\n }\n return {\n headers: data.headers,\n contexts: { '': m },\n };\n }\n /**\n * Returns true if `locale` is a Hebrew locale (i.e. `he` or `he-x-NoNikud`)\n * @example\n * Locale.isHebrewLocale('he'); // true\n * Locale.isHebrewLocale('he-x-NoNikud'); // true\n * Locale.isHebrewLocale('en'); // false\n */\n static isHebrewLocale(locale) {\n if (typeof locale !== 'string') {\n return false;\n }\n locale = alias[locale] || locale;\n locale = locale.toLowerCase();\n return locale.startsWith('he');\n }\n}\nLocale.addLocale('en', noopLocale);\n/* Ashkenazic transliterations */\nLocale.addLocale('ashkenazi', poAshkenazi);\n/* Hebrew with nikkud */\nLocale.addLocale('he', poHe);\n/* Hebrew without nikkud */\nconst poHeNoNikud = Locale.copyLocaleNoNikud(poHe);\nLocale.addLocale('he-x-NoNikud', poHeNoNikud);\n//# sourceMappingURL=locale.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { abs2hebrew, daysInMonth, daysInYear, getMonthName, hebrew2abs, isLeapYear, longCheshvan, monthFromName, months, monthsInYear, shortKislev, } from './hdateBase.js';\nimport { abs2greg, greg2abs, isDate } from './greg.js';\nimport { gematriya, gematriyaStrToNum } from './gematriya.js';\nimport { Locale } from './locale.js';\nfunction mod(x, y) {\n return x - y * Math.floor(x / y);\n}\nfunction isSimpleHebrewDate(obj) {\n return obj.yy !== undefined;\n}\nconst UNITS_DAY = 'day';\nconst UNITS_WEEK = 'week';\nconst UNITS_MONTH = 'month';\nconst UNITS_YEAR = 'year';\n/**\n * A `HDate` represents a Hebrew calendar date.\n *\n * An instance of this class encapsulates a date in the Hebrew calendar system.\n * It consists of a year, month, and day, without any associated time or location data.\n * The Hebrew calendar is a lunisolar calendar, meaning it is based on both lunar and solar cycles.\n *\n * A Hebrew date internally stores three numbers:\n * - year: The Hebrew year (1-9999). Counted from the traditional Hebrew date of creation (3761 BCE in the Gregorian calendar)\n * - month: The Hebrew month (1-13). Month 1 is Nisan, month 7 is Tishrei. There are 12 months in a regular year and 13 months in a leap year.\n * - day: The day of the month (1-30)\n *\n * This class uses Rata Die to convert between the Hebrew and Gregorian calendars.\n *\n * To calculate times of day, use `Zmanim` class from `@hebcal/core`\n * @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}\n * @see {@link https://hebcal.github.io/api/core/classes/Zmanim.html | Zmanim}\n */\nexport class HDate {\n /** Hebrew year, 1-9999 */\n yy;\n /** Hebrew month of year (1=NISAN, 7=TISHREI) */\n mm;\n /** Hebrew day within the month (1-30) */\n dd;\n /** absolute Rata Die (R.D.) days */\n rd;\n /**\n * Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.\n *\n * 1. No parameters - represents the current Hebrew date at time of instantiation\n * 2. One parameter\n * * `Date` - represents the Hebrew date corresponding to the Gregorian date using\n * local time. Hours, minutes, seconds and milliseconds are ignored.\n * * `HDate` - clones a copy of the given Hebrew date\n * * `number` - Converts absolute R.D. days to Hebrew date.\n * R.D. 1 == the imaginary date January 1, 1 (Gregorian)\n * 3. Three parameters: Hebrew day, Hebrew month, Hebrew year. Hebrew day should\n * be a number between 1-30, Hebrew month can be a number or string, and\n * Hebrew year is always a number.\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate();\n * const hd2 = new HDate(new Date(2008, 10, 13));\n * const hd3 = new HDate(15, 'Cheshvan', 5769);\n * const hd4 = new HDate(15, months.CHESHVAN, 5769);\n * const hd5 = new HDate(733359); // ==> 15 Cheshvan 5769\n * const monthName = 'אייר';\n * const hd6 = new HDate(5, monthName, 5773);\n * @param [day] - Day of month (1-30) if a `number`.\n * If a `Date` is specified, represents the Hebrew date corresponding to the\n * Gregorian date using local time.\n * If an `HDate` is specified, clones a copy of the given Hebrew date.\n * @param [month] - Hebrew month of year (1=NISAN, 7=TISHREI)\n * @param [year] - Hebrew year\n */\n constructor(day, month, year) {\n if (arguments.length === 2 || arguments.length > 3) {\n throw new TypeError('HDate constructor requires 0, 1 or 3 arguments');\n }\n if (arguments.length === 3) {\n // Hebrew day, Hebrew month, Hebrew year\n this.dd = this.mm = 1;\n const yy = typeof year === 'string' ? parseInt(year, 10) : year;\n if (isNaN(yy)) {\n throw new TypeError(`HDate called with bad year: ${year}`);\n }\n this.yy = yy;\n setMonth(this, month); // will throw if we can't parse\n const dd = typeof day === 'string' ? parseInt(day, 10) : day;\n if (isNaN(dd)) {\n throw new TypeError(`HDate called with bad day: ${day}`);\n }\n setDate(this, dd);\n }\n else {\n // 0 arguments\n if (day === undefined || day === null) {\n day = new Date();\n }\n // 1 argument\n const abs0 = typeof day === 'number' && !isNaN(day)\n ? day\n : isDate(day)\n ? greg2abs(day)\n : isSimpleHebrewDate(day)\n ? day\n : null;\n if (abs0 === null) {\n throw new TypeError(`HDate called with bad arg: ${day}`);\n }\n const isNumber = typeof abs0 === 'number';\n const d = isNumber ? abs2hebrew(abs0) : abs0;\n this.yy = d.yy;\n this.mm = d.mm;\n this.dd = d.dd;\n if (isNumber) {\n this.rd = abs0;\n }\n }\n }\n /**\n * Returns the Hebrew year of this Hebrew date\n * @returns an integer >= 1\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getFullYear(); // 5769\n */\n getFullYear() {\n return this.yy;\n }\n /**\n * Returns `true` if this Hebrew date occurs during a Hebrew leap year\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.isLeapYear(); // false\n */\n isLeapYear() {\n return isLeapYear(this.yy);\n }\n /**\n * Returns the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date\n * @returns an integer 1-13\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getMonth(); // 8\n */\n getMonth() {\n return this.mm;\n }\n /**\n * The Tishrei-based month of this Hebrew date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year\n * @returns an integer 1-13\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getTishreiMonth(); // 2\n */\n getTishreiMonth() {\n const nummonths = monthsInYear(this.getFullYear());\n return (this.getMonth() + nummonths - 6) % nummonths || nummonths;\n }\n /**\n * Number of days in the month of this Hebrew date (29 or 30)\n * @returns an integer 29-30\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.daysInMonth(); // 29\n */\n daysInMonth() {\n return daysInMonth(this.getMonth(), this.getFullYear());\n }\n /**\n * Gets the day within the month (1-30)\n * @returns an integer 1-30\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getDate(); // 15\n */\n getDate() {\n return this.dd;\n }\n /**\n * Returns the day of the week for this Hebrew date,\n * where 0 represents Sunday, 1 represents Monday, 6 represents Saturday.\n *\n * For the day of the month, see `getDate()`\n * @returns an integer 0-6\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getDay(); // 4 (Thursday)\n */\n getDay() {\n return mod(this.abs(), 7);\n }\n /**\n * Converts this Hebrew date to the corresponding Gregorian date.\n *\n * The returned `Date` object will be in the local (i.e. host system) time zone.\n * Hours, minutes, seconds and milliseconds will all be zero.\n *\n * Note that this function returns the daytime portion of the date.\n * For example, the 15th of Cheshvan 5769 began at sundown on\n * 12 November 2008 and continues through 13 November 2008. This\n * function would return only the date 13 November 2008.\n * @example\n * const hd = new HDate(15, 'Cheshvan', 5769);\n * const date = hd.greg(); // 13 November 2008\n * const year = date.getFullYear(); // 2008\n * const monthNum = date.getMonth() + 1; // 11\n * const day = date.getDate(); // 13\n */\n greg() {\n return abs2greg(this.abs());\n }\n /**\n * Converts from Hebrew date representation to R.D. (Rata Die) fixed days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).\n * Note also that R.D. = Julian Date − 1,721,424.5\n * @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}\n * @example\n * const hd = new HDate(15, 'Cheshvan', 5769);\n * hd.abs(); // 733359\n */\n abs() {\n if (typeof this.rd !== 'number') {\n this.rd = hebrew2abs(this.yy, this.mm, this.dd);\n }\n return this.rd;\n }\n /**\n * Converts Hebrew date to R.D. (Rata Die) fixed days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian\n * Calendar.\n * @param year Hebrew year\n * @param month Hebrew month (1=NISAN, 7=TISHREI)\n * @param day Hebrew date (1-30)\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.hebrew2abs(5769, months.CHESHVAN, 15); // 733359\n */\n static hebrew2abs(year, month, day) {\n return hebrew2abs(year, month, day);\n }\n /**\n * Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getMonthName(); // 'Cheshvan'\n */\n getMonthName() {\n return getMonthName(this.getMonth(), this.getFullYear());\n }\n /**\n * Renders this Hebrew date as a translated or transliterated string,\n * including ordinal e.g. `'15th of Cheshvan, 5769'`.\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * console.log(hd.render('en')); // '15th of Cheshvan, 5769'\n * console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'\n * console.log(hd.render('en', false)); // '15th of Cheshvan'\n * console.log(hd.render('he', false)); // '15 חֶשְׁוָן'\n * @param [locale] Optional locale name (defaults to active locale).\n * @param [showYear=true] Display year (defaults to true).\n * @see {@link Locale}\n */\n render(locale, showYear = true) {\n const locale0 = locale || 'en';\n const day = this.getDate();\n const monthName0 = Locale.gettext(this.getMonthName(), locale0);\n const monthName = monthName0.replace(/'/g, '’');\n const nth = Locale.ordinal(day, locale0);\n const dayOf = getDayOfTranslation(locale0);\n const dateStr = `${nth}${dayOf} ${monthName}`;\n if (showYear) {\n const fullYear = this.getFullYear();\n return `${dateStr}, ${fullYear}`;\n }\n else {\n return dateStr;\n }\n }\n /**\n * Renders this Hebrew date in Hebrew gematriya, regardless of locale.\n * @param suppressNikud - suppress nekudot (default false)\n * @param suppressYear - suppress Hebrew year (default false)\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * hd.renderGematriya(); // 'ט״ו חֶשְׁוָן תשס״ט'\n * hd.renderGematriya(true); // 'ט״ו חשון תשס״ט'\n * hd.renderGematriya(false, true); // 'ט״ו חֶשְׁוָן'\n */\n renderGematriya(suppressNikud = false, suppressYear = false) {\n const d = this.getDate();\n const locale = suppressNikud ? 'he-x-NoNikud' : 'he';\n const m = Locale.gettext(this.getMonthName(), locale);\n const prefix = gematriya(d) + ' ' + m;\n if (suppressYear) {\n return prefix;\n }\n const y = this.getFullYear();\n return prefix + ' ' + gematriya(y);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **before** this Hebrew date.\n *\n * Strictly before: if this date already falls on `dayOfWeek`, the\n * previous occurrence a week earlier is returned.\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * wed.before(6).greg().toDateString(); // 'Sat Feb 15 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n before(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, -1);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **on or before** this Hebrew date\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const sat = new HDate(new Date('Saturday February 22, 2014'));\n * const sun = new HDate(new Date('Sunday February 23, 2014'));\n * wed.onOrBefore(6).greg().toDateString(); // 'Sat Feb 15 2014'\n * sat.onOrBefore(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sun.onOrBefore(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n onOrBefore(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 0);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **nearest** to this Hebrew date.\n *\n * Ties are broken forward: a date exactly 3 days from `dayOfWeek` in\n * both directions resolves to the later one.\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const tue = new HDate(new Date('Tuesday February 18, 2014'));\n * wed.nearest(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * tue.nearest(6).greg().toDateString(); // 'Sat Feb 15 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n nearest(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 3);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **on or after** this Hebrew date\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const sat = new HDate(new Date('Saturday February 22, 2014'));\n * const sun = new HDate(new Date('Sunday February 23, 2014'));\n * wed.onOrAfter(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sat.onOrAfter(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sun.onOrAfter(6).greg().toDateString(); // 'Sat Mar 01 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n onOrAfter(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 6);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **after** this Hebrew date.\n *\n * Strictly after: if this date already falls on `dayOfWeek`, the next\n * occurrence a week later is returned.\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const sat = new HDate(new Date('Saturday February 22, 2014'));\n * const sun = new HDate(new Date('Sunday February 23, 2014'));\n * wed.after(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sat.after(6).greg().toDateString(); // 'Sat Mar 01 2014'\n * sun.after(6).greg().toDateString(); // 'Sat Mar 01 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n after(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 7);\n }\n /**\n * Returns the next Hebrew date\n * @returns a new `HDate` one day later; the original is not modified\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.next().toString(); // '16 Cheshvan 5769'\n */\n next() {\n return new HDate(this.abs() + 1);\n }\n /**\n * Returns the previous Hebrew date\n * @returns a new `HDate` one day earlier; the original is not modified\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.prev().toString(); // '14 Cheshvan 5769'\n */\n prev() {\n return new HDate(this.abs() - 1);\n }\n /**\n * Returns a cloned `HDate` object with a specified amount of time added\n *\n * Units are case insensitive, and support plural and short forms.\n * Note, short forms are case sensitive.\n *\n * | Unit | Shorthand | Description\n * | --- | --- | --- |\n * | `day` | `d` | days |\n * | `week` | `w` | weeks |\n * | `month` | `M` | months |\n * | `year` | `y` | years |\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate(15, months.CHESHVAN, 5769);\n * hd1.add(7, 'd').toString(); // '22 Cheshvan 5769'\n * hd1.add(1, 'weeks').toString(); // '22 Cheshvan 5769'\n * hd1.add(1, 'year').toString(); // '15 Cheshvan 5770'\n * @param amount number of units to add (negative values subtract)\n * @param [units=d] unit of time, defaults to days\n * @returns a new `HDate`; the original is not modified\n * @throws {TypeError} if `units` is not a recognized unit of time\n */\n add(amount, units = 'd') {\n amount = typeof amount === 'string' ? parseInt(amount, 10) : amount;\n if (!amount) {\n return new HDate(this);\n }\n units = standardizeUnits(units);\n if (units === UNITS_DAY) {\n return new HDate(this.abs() + amount);\n }\n else if (units === UNITS_WEEK) {\n return new HDate(this.abs() + 7 * amount);\n }\n else if (units === UNITS_YEAR) {\n return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + amount);\n }\n else {\n // units === UNITS_MONTH\n let hd = new HDate(this);\n const sign = amount > 0 ? 1 : -1;\n amount = Math.abs(amount);\n for (let i = 0; i < amount; i++) {\n hd = new HDate(hd.abs() + sign * hd.daysInMonth());\n }\n return hd;\n }\n }\n /**\n * Returns a cloned `HDate` object with a specified amount of time subracted\n *\n * Units are case insensitive, and support plural and short forms.\n * Note, short forms are case sensitive.\n *\n * | Unit | Shorthand | Description\n * | --- | --- | --- |\n * | `day` | `d` | days |\n * | `week` | `w` | weeks |\n * | `month` | `M` | months |\n * | `year` | `y` | years |\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate(15, months.CHESHVAN, 5769);\n * hd1.subtract(1, 'weeks').toString(); // '8 Cheshvan 5769'\n * hd1.subtract(3, 'M').toString(); // '16 Av 5768'\n * @param amount number of units to subtract (negative values add)\n * @param [units=d] unit of time, defaults to days\n * @returns a new `HDate`; the original is not modified\n * @throws {TypeError} if `units` is not a recognized unit of time\n */\n subtract(amount, units = 'd') {\n return this.add(amount * -1, units);\n }\n /**\n * Returns the difference in days between the two given HDates.\n *\n * The result is positive if `this` date is comes chronologically\n * after the `other` date, and negative\n * if the order of the two dates is reversed.\n *\n * The result is zero if the two dates are identical.\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate(25, months.KISLEV, 5770);\n * const hd2 = new HDate(15, months.CHESHVAN, 5769);\n * const days = hd1.deltaDays(hd2); // 394\n * @param other Hebrew date to compare\n */\n deltaDays(other) {\n return this.abs() - other.abs();\n }\n /**\n * Compares this Hebrew date to another date, returning `true` if the dates match.\n * @param other Hebrew date to compare\n * @example\n * const hd1 = new HDate(new Date(2008, 10, 13));\n * const hd2 = new HDate(15, 'Cheshvan', 5769);\n * hd1.isSameDate(hd2); // true\n */\n isSameDate(other) {\n return this.yy === other.yy && this.mm === other.mm && this.dd === other.dd;\n }\n /**\n * Returns a string representation of this Hebrew date using English transliterations\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.toString(); // '15 Cheshvan 5769'\n */\n toString() {\n const day = this.getDate();\n const fullYear = this.getFullYear();\n const monthName = this.getMonthName();\n return `${day} ${monthName} ${fullYear}`;\n }\n /**\n * Returns true if Hebrew year is a leap year\n * @param year Hebrew year\n * @example\n * HDate.isLeapYear(5783); // false\n * HDate.isLeapYear(5784); // true\n */\n static isLeapYear(year) {\n return isLeapYear(year);\n }\n /**\n * Number of months in this Hebrew year (either 12 or 13 depending on leap year)\n * @param year Hebrew year\n * @example\n * HDate.monthsInYear(5783); // 12\n * HDate.monthsInYear(5784); // 13\n */\n static monthsInYear(year) {\n return monthsInYear(year);\n }\n /**\n * Number of days in Hebrew month in a given year (29 or 30)\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.daysInMonth(months.CHESHVAN, 5769); // 29\n */\n static daysInMonth(month, year) {\n return daysInMonth(month, year);\n }\n /**\n * Returns a transliterated string name of Hebrew month in year,\n * for example 'Elul' or 'Cheshvan'.\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'\n */\n static getMonthName(month, year) {\n return getMonthName(month, year);\n }\n /**\n * Returns the Hebrew month number (NISAN=1, TISHREI=7)\n * @param month A number, or Hebrew month name string\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.monthNum(months.CHESHVAN); // 8\n * HDate.monthNum('Cheshvan'); // 8\n * HDate.monthNum('חשון'); // 8\n */\n static monthNum(month) {\n if (typeof month === 'number') {\n if (isNaN(month) || month > 14) {\n throw new RangeError(`bad monthNum: ${month}`);\n }\n return month;\n }\n if (typeof month !== 'string') {\n throw new TypeError(`bad monthNum: ${month}`);\n }\n return month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 /* number */\n ? parseInt(month, 10)\n : monthFromName(month);\n }\n /**\n * Number of days in the Hebrew year.\n * Regular years can have 353, 354, or 355 days.\n * Leap years can have 383, 384, or 385 days.\n * @param year Hebrew year\n * @example\n * HDate.daysInYear(5783); // 355\n * HDate.daysInYear(5784); // 383\n */\n static daysInYear(year) {\n return daysInYear(year);\n }\n /**\n * true if Cheshvan is long in Hebrew year\n * @param year Hebrew year\n * @example\n * HDate.longCheshvan(5783); // true\n * HDate.longCheshvan(5784); // false\n */\n static longCheshvan(year) {\n return longCheshvan(year);\n }\n /**\n * true if Kislev is short in Hebrew year\n * @param year Hebrew year\n * @example\n * HDate.shortKislev(5783); // false\n * HDate.shortKislev(5784); // true\n */\n static shortKislev(year) {\n return shortKislev(year);\n }\n /**\n * Converts Hebrew month string name to numeric\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.monthFromName(months.CHESHVAN); // 8\n * HDate.monthFromName('Cheshvan'); // 8\n * HDate.monthFromName('חשון'); // 8\n */\n static monthFromName(monthName) {\n return monthFromName(monthName);\n }\n /**\n * Convenience function for determining the R.D. date\n * near a specified R.D. date, corresponding to the specified day of week.\n *\n * Note: Applying this function to d+6 gives us the `dayOfWeek` on or after an\n * absolute day d. Similarly, applying it to d+3 gives the `dayOfWeek` nearest to\n * absolute date d, applying it to d-1 gives the `dayOfWeek` previous to absolute\n * date d, and applying it to d+7 gives the `dayOfWeek` following absolute date d.\n *\n * The instance methods {@link HDate.before}, {@link HDate.onOrBefore},\n * {@link HDate.nearest}, {@link HDate.onOrAfter} and {@link HDate.after}\n * wrap this with those offsets already applied.\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @param absdate R.D. number of days\n * @returns R.D. number of days\n * @example\n * import {HDate} from '@hebcal/hdate';\n * // 733359 is Thursday 13 November 2008\n * HDate.dayOnOrBefore(6, 733359); // 733354 (Saturday 8 November 2008)\n * HDate.dayOnOrBefore(6, 733359 + 6); // 733361 (Saturday 15 November 2008)\n */\n static dayOnOrBefore(dayOfWeek, absdate) {\n // Use a floored modulo: R.D. numbers are negative before the common\n // era, and JavaScript's `%` truncates toward zero, which would return\n // a day *after* absdate for those negative inputs.\n return absdate - mod(absdate - dayOfWeek, 7);\n }\n /**\n * Tests if the object is an instance of `HDate`\n * @example\n * HDate.isHDate(new HDate()); // true\n * HDate.isHDate(new Date()); // false\n * HDate.isHDate(null); // false\n * HDate.isHDate(12345); // false\n * HDate.isHDate('15 Cheshvan 5769'); // false\n */\n static isHDate(obj0) {\n const obj = obj0;\n return (obj !== null &&\n typeof obj === 'object' &&\n typeof obj.yy === 'number' &&\n typeof obj.mm === 'number' &&\n typeof obj.dd === 'number' &&\n typeof obj.greg === 'function' &&\n typeof obj.abs === 'function');\n }\n /**\n * Construct a new instance of `HDate` from a Gematriya-formatted string.\n *\n * The string must have the form day-month-year, with the month name\n * written in Hebrew script (nikud optional, an optional bet prefix\n * allowed). A year below 1000 is assumed to omit the thousands and has\n * `currentThousands` added to it.\n * @param str Hebrew date in gematriya, e.g. `'כ״ז בְּתַמּוּז תשפ״ג'`\n * @param [currentThousands=5000] added to a year below 1000\n * @returns the parsed Hebrew date\n * @throws {TypeError} if `str` is not a string\n * @throws {RangeError} if `str` is not 3 or 4 space-separated parts,\n * or the month name is not recognized\n * @example\n * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג').toString(); // '27 Tamuz 5783'\n * HDate.fromGematriyaString('כ׳ סיון תש״ד').toString(); // '20 Sivan 5704'\n * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח').toString(); // '5 Iyyar 5708'\n */\n static fromGematriyaString(str, currentThousands = 5000) {\n if (typeof str !== 'string') {\n throw new TypeError(`bad gematriya str: ${str}`);\n }\n const parts = str.split(' ').filter(x => x.length !== 0);\n const numParts = parts.length;\n if (numParts !== 3 && numParts !== 4) {\n throw new RangeError(`cannot parse gematriya str: \"${str}\"`);\n }\n const day = gematriyaStrToNum(parts[0]);\n const monthStr = numParts === 3 ? parts[1] : parts[1] + ' ' + parts[2];\n const month = monthFromName(monthStr);\n const yearStr = numParts === 3 ? parts[2] : parts[3];\n let year = gematriyaStrToNum(yearStr);\n if (year < 1000) {\n year += currentThousands;\n }\n return new HDate(day, month, year);\n }\n}\nfunction standardizeUnits(units) {\n switch (units) {\n case 'd':\n return UNITS_DAY;\n case 'w':\n return UNITS_WEEK;\n case 'M':\n return UNITS_MONTH;\n case 'y':\n return UNITS_YEAR;\n }\n const str = String(units || '')\n .toLowerCase()\n .replace(/s$/, '');\n switch (str) {\n case UNITS_DAY:\n case UNITS_WEEK:\n case UNITS_MONTH:\n case UNITS_YEAR:\n return str;\n }\n throw new TypeError(`Invalid units '${units}'`);\n}\nfunction getDayOfTranslation(locale) {\n switch (locale) {\n case 'en':\n case 's':\n case 'a':\n case 'ashkenazi':\n return ' of';\n default:\n break;\n }\n const ofStr = Locale.lookupTranslation('of', locale);\n if (ofStr) {\n return ' ' + ofStr;\n }\n if (locale.startsWith('ashkenazi')) {\n return ' of';\n }\n return '';\n}\n/**\n * Sets the day of the month of the date. Returns the object it was called upon\n * @private\n * @param month A number, or Hebrew month name string\n */\nfunction setMonth(hd, month) {\n hd.mm = HDate.monthNum(month);\n fix(hd);\n return hd;\n}\nfunction setDate(hd, date) {\n hd.dd = date;\n fix(hd);\n return hd;\n}\nfunction fix(hd) {\n fixMonth(hd);\n fixDate(hd);\n}\nfunction fixDate(hd) {\n if (hd.dd < 1) {\n if (hd.mm === months.TISHREI) {\n hd.yy -= 1;\n }\n hd.dd += daysInMonth(hd.mm, hd.yy);\n hd.mm -= 1;\n fix(hd);\n }\n if (hd.dd > daysInMonth(hd.mm, hd.yy)) {\n if (hd.mm === months.ELUL) {\n hd.yy += 1;\n }\n hd.dd -= daysInMonth(hd.mm, hd.yy);\n if (hd.mm === monthsInYear(hd.yy)) {\n hd.mm = 1; // rollover to NISAN\n }\n else {\n hd.mm += 1;\n }\n fix(hd);\n }\n fixMonth(hd);\n}\nfunction fixMonth(hd) {\n if (hd.mm === months.ADAR_II && !hd.isLeapYear()) {\n hd.mm -= 1; // to Adar I\n fix(hd);\n }\n else if (hd.mm < 1) {\n hd.mm += monthsInYear(hd.yy);\n hd.yy -= 1;\n fix(hd);\n }\n else if (hd.mm > monthsInYear(hd.yy)) {\n hd.mm -= monthsInYear(hd.yy);\n hd.yy += 1;\n fix(hd);\n }\n delete hd.rd;\n}\nfunction onOrBefore(day, t, offset) {\n return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));\n}\n//# sourceMappingURL=hdate.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { getBirthdayHD, getYahrzeitHD } from './anniversary.js';\nimport { HDate } from './hdate.js';\n/**\n * Calculates yahrzeit, the anniversary of a death, and returns it as an\n * {@link HDate}.\n *\n * Same calculation as {@link getYahrzeitHD}, but the result comes back\n * as an `HDate` instance rather than a plain `{yy, mm, dd}` object, so it\n * can be rendered (`render`, `renderGematriya`) or used for further\n * Hebrew calendar arithmetic directly.\n *\n * Note that a yahrzeit is *not* calculated the same way as a birthday:\n * when the original date is missing from `hyear` it moves earlier rather\n * than later. See {@link getYahrzeitHD} for the full algorithm and its\n * edge cases (Marcheshvan 30, Kislev 30, Adar I / Adar II).\n *\n * `hyear` must be strictly after the year of death. A yahrzeit is an\n * *anniversary* of a death, so the first one is the earliest that\n * exists — the day of the death itself is not a yahrzeit, and there is\n * no meaningful \"zeroth\" one to return. This is the one place where\n * {@link birthdayOrAnniversary} legitimately accepts a year that this\n * function rejects: a birth date is a real day in its own right.\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear`, or `undefined` when `hyear`\n * is on or before the year of death\n * @see {@link getYahrzeitHD}\n * @see {@link birthdayOrAnniversary}\n * @example\n * import {yahrzeit} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * yahrzeit(5780, dt)?.toString(); // '30 Sh\\'vat 5780'\n * yahrzeit(5780, dt)?.renderGematriya(); // 'ל׳ שְׁבָט תש״פ'\n * yahrzeit(5774, dt); // undefined (year of death)\n */\nexport function yahrzeit(hyear, date) {\n const hd = getYahrzeitHD(hyear, date);\n return hd && new HDate(hd);\n}\n/**\n * Calculates a birthday or anniversary (non-yahrzeit) and returns it as\n * an {@link HDate}.\n *\n * Same calculation as {@link getBirthdayHD}, but the result comes back\n * as an `HDate` instance rather than a plain `{yy, mm, dd}` object, so it\n * can be rendered (`render`, `renderGematriya`) or used for further\n * Hebrew calendar arithmetic directly.\n *\n * Note that a birthday is *not* calculated the same way as a yahrzeit:\n * when the original date is missing from `hyear` it is postponed rather\n * than moved earlier. See {@link getBirthdayHD} for the full algorithm\n * and its edge cases.\n *\n * `hyear` may be the original year, in which case the original date is\n * returned unchanged: someone's birth date is a meaningful day in its\n * own right, not merely the zeroth anniversary of itself. A death has no\n * equivalent — a yahrzeit begins at the first anniversary — which is why\n * {@link yahrzeit} rejects the year of death.\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of the original event\n * @returns anniversary occurring in `hyear`, or `undefined` when `hyear`\n * precedes the original year\n * @see {@link getBirthdayHD}\n * @see {@link yahrzeit}\n * @example\n * import {birthdayOrAnniversary} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * birthdayOrAnniversary(5780, dt)?.toString(); // '1 Nisan 5780'\n * birthdayOrAnniversary(5774, dt)?.toString(); // '30 Adar I 5774'\n * birthdayOrAnniversary(5773, dt); // undefined\n */\nexport function birthdayOrAnniversary(hyear, date) {\n const hd = getBirthdayHD(hyear, date);\n return hd && new HDate(hd);\n}\n//# sourceMappingURL=anniversaryHDate.js.map","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n > 1);\",\"language\":\"und-x-ashkenaz\"},\"contexts\":{\"\":{\"Shabbat\":[\"Shabbos\"],\"Achrei Mot\":[\"Achrei Mos\"],\"Bechukotai\":[\"Bechukosai\"],\"Beha'alotcha\":[\"Beha’aloscha\"],\"Bereshit\":[\"Bereshis\"],\"Chukat\":[\"Chukas\"],\"Erev Shavuot\":[\"Erev Shavuos\"],\"Erev Sukkot\":[\"Erev Sukkos\"],\"Ki Tavo\":[\"Ki Savo\"],\"Ki Teitzei\":[\"Ki Seitzei\"],\"Ki Tisa\":[\"Ki Sisa\"],\"Matot\":[\"Matos\"],\"Pesach Shabbat Chol ha-Moed\":[\"Pesach Shabbos Chol ha-Moed\"],\"Purim Katan\":[\"Purim Koton\"],\"Rosh Hashana LaBehemot\":[\"Rosh Hashana LaBeheimos\"],\"Shabbat Chazon\":[\"Shabbos Chazon\"],\"Shabbat HaChodesh\":[\"Shabbos HaChodesh\"],\"Shabbat HaGadol\":[\"Shabbos HaGadol\"],\"Shabbat Nachamu\":[\"Shabbos Nachamu\"],\"Shabbat Parah\":[\"Shabbos Parah\"],\"Shabbat Shekalim\":[\"Shabbos Shekalim\"],\"Shabbat Shuva\":[\"Shabbos Shuvah\"],\"Shabbat Zachor\":[\"Shabbos Zachor\"],\"Shavuot\":[\"Shavuos\"],\"Shavuot I\":[\"Shavuos I\"],\"Shavuot II\":[\"Shavuos II\"],\"Shemot\":[\"Shemos\"],\"Shmini Atzeret\":[\"Shmini Atzeres\"],\"Simchat Torah\":[\"Simchas Torah\"],\"Sukkot\":[\"Sukkos\"],\"Sukkot I\":[\"Sukkos I\"],\"Sukkot II\":[\"Sukkos II\"],\"Sukkot II (CH''M)\":[\"Sukkos II (CH’’M)\"],\"Sukkot III (CH''M)\":[\"Sukkos III (CH’’M)\"],\"Sukkot IV (CH''M)\":[\"Sukkos IV (CH’’M)\"],\"Sukkot V (CH''M)\":[\"Sukkos V (CH’’M)\"],\"Sukkot VI (CH''M)\":[\"Sukkos VI (CH’’M)\"],\"Sukkot VII (Hoshana Raba)\":[\"Sukkos VII (Hoshana Raba)\"],\"Sukkot Shabbat Chol ha-Moed\":[\"Sukkos Shabbos Chol ha-Moed\"],\"Ta'anit Bechorot\":[\"Ta’anis Bechoros\"],\"Ta'anit BeHaB\":[\"Ta’anis BeHaB\"],\"Ta'anit Esther\":[\"Ta’anis Esther\"],\"Toldot\":[\"Toldos\"],\"Vaetchanan\":[\"Vaeschanan\"],\"Yitro\":[\"Yisro\"],\"Vezot Haberakhah\":[\"Vezos Haberakhah\"],\"Parashat\":[\"Parshas\"],\"Leil Selichot\":[\"Leil Selichos\"],\"Shabbat Mevarchim Chodesh\":[\"Shabbos Mevorchim Chodesh\"],\"Shabbat Shirah\":[\"Shabbos Shirah\"],\"Asara B'Tevet\":[\"Asara B’Teves\"],\"Birkat Hachamah\":[\"Birkas HaChamah\"],\"Birkat HaChamah\":[\"Birkas HaChamah\"],\"Shushan Purim Katan\":[\"Shushan Purim Koton\"],\"Alot HaShachar\":[\"Alos HaShachar\"],\"Misheyakir\":[\"Misheyakir\"],\"Misheyakir Machmir\":[\"Misheyakir Machmir\"],\"Sunrise\":[\"Sunrise\"],\"Kriat Shema, sof zeman\":[\"Krias Shema, sof zman\"],\"Tefilah, sof zeman\":[\"Tefilah, sof zman\"],\"Kriat Shema, sof zeman (MGA)\":[\"Krias Shema, sof zman (MGA)\"],\"Kriat Shema, sof zeman (GRA)\":[\"Krias Shema, sof zman (GRA)\"],\"Tefilah, sof zeman (MGA)\":[\"Tefilah, sof zman (MGA)\"],\"Tefilah, sof zeman (GRA)\":[\"Tefilah, sof zman (GRA)\"],\"Chatzot HaLailah\":[\"Chatzos HaLailah\"],\"Chatzot HaYom\":[\"Chatzos\"],\"Chatzot hayom\":[\"Chatzos\"],\"Mincha Gedolah\":[\"Mincha Gedolah\"],\"Mincha Ketanah\":[\"Mincha Ketanah\"],\"Plag HaMincha\":[\"Plag HaMincha\"],\"Sunset\":[\"Sunset\"],\"Bein HaShemashot\":[\"Bein HaShemashos\"],\"Tzeit HaKochavim\":[\"Tzeis HaKochavim\"]}}}","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n > 1);\",\"language\":\"he_IL\"},\"contexts\":{\"\":{\"Shabbat\":[\"שַׁבָּת\"],\"Parashat\":[\"פָּרָשַׁת\"],\"Achrei Mot\":[\"אַחֲרֵי מוֹת\"],\"Balak\":[\"בָּלָק\"],\"Bamidbar\":[\"בְּמִדְבַּר\"],\"Bechukotai\":[\"בְּחֻקֹּתַי\"],\"Beha'alotcha\":[\"בְּהַעֲלֹתְךָ\"],\"Behar\":[\"בְּהַר\"],\"Bereshit\":[\"בְּרֵאשִׁית\"],\"Beshalach\":[\"בְּשַׁלַּח\"],\"Bo\":[\"בֹּא\"],\"Chayei Sara\":[\"חַיֵּי שָֹרָה\"],\"Chukat\":[\"חֻקַּת\"],\"Devarim\":[\"דְּבָרִים\"],\"Eikev\":[\"עֵקֶב\"],\"Emor\":[\"אֱמוֹר\"],\"Ha'azinu\":[\"הַאֲזִינוּ\"],\"Kedoshim\":[\"קְדֹשִׁים\"],\"Ki Tavo\":[\"כִּי־תָבוֹא\"],\"Ki Teitzei\":[\"כִּי־תֵצֵא\"],\"Ki Tisa\":[\"כִּי תִשָּׂא\"],\"Korach\":[\"קֹרַח\"],\"Lech-Lecha\":[\"לֶךְ־לְךָ\"],\"Masei\":[\"מַסְעֵי\"],\"Matot\":[\"מַטּוֹת\"],\"Metzora\":[\"מְצֹרָע\"],\"Miketz\":[\"מִקֵּץ\"],\"Mishpatim\":[\"מִשְׁפָּטִים\"],\"Nasso\":[\"נָשׂא\"],\"Nitzavim\":[\"נִצָּבִים\"],\"Noach\":[\"נֹחַ\"],\"Pekudei\":[\"פְקוּדֵי\"],\"Pinchas\":[\"פִּינְחָס\"],\"Re'eh\":[\"רְאֵה\"],\"Sh'lach\":[\"שְׁלַח־לְךָ\"],\"Shemot\":[\"שְׁמוֹת\"],\"Shmini\":[\"שְּׁמִינִי\"],\"Shoftim\":[\"שׁוֹפְטִים\"],\"Tazria\":[\"תַזְרִיעַ\"],\"Terumah\":[\"תְּרוּמָה\"],\"Tetzaveh\":[\"תְּצַוֶּה\"],\"Toldot\":[\"תּוֹלְדוֹת\"],\"Tzav\":[\"צַו\"],\"Vaera\":[\"וָאֵרָא\"],\"Vaetchanan\":[\"וָאֶתְחַנַּן\"],\"Vayakhel\":[\"וַיַּקְהֵל\"],\"Vayechi\":[\"וַיְחִי\"],\"Vayeilech\":[\"וַיֵּלֶךְ\"],\"Vayera\":[\"וַיֵּרָא\"],\"Vayeshev\":[\"וַיֵּשֶׁב\"],\"Vayetzei\":[\"וַיֵּצֵא\"],\"Vayigash\":[\"וַיִּגַּשׁ\"],\"Vayikra\":[\"וַיִּקְרָא\"],\"Vayishlach\":[\"וַיִּשְׁלַח\"],\"Vezot Haberakhah\":[\"וְזֹאת הַבְּרָכָה\"],\"Yitro\":[\"יִתְרוֹ\"],\"Asara B'Tevet\":[\"עֲשָׂרָה בְּטֵבֵת\"],\"Candle lighting\":[\"הַדְלָקַת נֵרוֹת\"],\"Chanukah\":[\"חֲנוּכָּה\"],\"Chanukah: 1 Candle\":[\"חֲנוּכָּה: א׳ נֵר\"],\"Chanukah: 2 Candles\":[\"חֲנוּכָּה: ב׳ נֵרוֹת\"],\"Chanukah: 3 Candles\":[\"חֲנוּכָּה: ג׳ נֵרוֹת\"],\"Chanukah: 4 Candles\":[\"חֲנוּכָּה: ד׳ נֵרוֹת\"],\"Chanukah: 5 Candles\":[\"חֲנוּכָּה: ה׳ נֵרוֹת\"],\"Chanukah: 6 Candles\":[\"חֲנוּכָּה: ו׳ נֵרוֹת\"],\"Chanukah: 7 Candles\":[\"חֲנוּכָּה: ז׳ נֵרוֹת\"],\"Chanukah: 8 Candles\":[\"חֲנוּכָּה: ח׳ נֵרוֹת\"],\"Chanukah: 8th Day\":[\"חֲנוּכָּה: יוֹם ח׳\"],\"Days of the Omer\":[\"סְפִירַת הָעוֹמֶר\"],\"Omer\":[\"עוֹמֶר\"],\"day of the Omer\":[\"בָּעוֹמֶר\"],\"Erev Pesach\":[\"עֶרֶב פֶּסַח\"],\"Erev Purim\":[\"עֶרֶב פּוּרִים\"],\"Erev Rosh Hashana\":[\"עֶרֶב רֹאשׁ הַשָּׁנָה\"],\"Erev Shavuot\":[\"עֶרֶב שָׁבוּעוֹת\"],\"Erev Simchat Torah\":[\"עֶרֶב שִׂמְחַת תּוֹרָה\"],\"Erev Sukkot\":[\"עֶרֶב סֻכּוֹת\"],\"Erev Tish'a B'Av\":[\"עֶרֶב תִּשְׁעָה בְּאָב\"],\"Erev Yom Kippur\":[\"עֶרֶב יוֹם כִּפּוּר\"],\"Havdalah\":[\"הַבְדָּלָה\"],\"Lag BaOmer\":[\"ל״ג בָּעוֹמֶר\"],\"Leil Selichot\":[\"סְלִיחוֹת\"],\"Pesach\":[\"פֶּסַח\"],\"Pesach I\":[\"פֶּסַח א׳\"],\"Pesach II\":[\"פֶּסַח ב׳\"],\"Pesach II (CH''M)\":[\"פֶּסַח ב׳ (חוה״מ)\"],\"Pesach III (CH''M)\":[\"פֶּסַח ג׳ (חוה״מ)\"],\"Pesach IV (CH''M)\":[\"פֶּסַח ד׳ (חוה״מ)\"],\"Pesach Sheni\":[\"פֶּסַח שֵׁנִי\"],\"Pesach V (CH''M)\":[\"פֶּסַח ה׳ (חוה״מ)\"],\"Pesach VI (CH''M)\":[\"פֶּסַח ו׳ (חוה״מ)\"],\"Pesach VII\":[\"פֶּסַח ז׳\"],\"Pesach VIII\":[\"פֶּסַח ח׳\"],\"Pesach Shabbat Chol ha-Moed\":[\"שַׁבַּת חֹל הַמּוֹעֵד פֶּסַח\"],\"Purim\":[\"פּוּרִים\"],\"Purim Katan\":[\"פּוּרִים קָטָן\"],\"Rosh Chodesh\":[\"רֹאשׁ חוֹדֶשׁ\"],\"Rosh Hashana\":[\"רֹאשׁ הַשָּׁנָה\"],\"Rosh Hashana I\":[\"רֹאשׁ הַשָּׁנָה א׳\"],\"Rosh Hashana II\":[\"רֹאשׁ הַשָּׁנָה ב׳\"],\"Shabbat Chazon\":[\"שַׁבַּת חֲזוֹן\"],\"Shabbat HaChodesh\":[\"שַׁבַּת הַחֹדֶשׁ\"],\"Shabbat HaGadol\":[\"שַׁבַּת הַגָּדוֹל\"],\"Shabbat Nachamu\":[\"שַׁבַּת נַחֲמוּ\"],\"Shabbat Parah\":[\"שַׁבַּת פָּרָה\"],\"Shabbat Shekalim\":[\"שַׁבַּת שְׁקָלִים\"],\"Shabbat Shuva\":[\"שַׁבַּת שׁוּבָה\"],\"Shabbat Zachor\":[\"שַׁבַּת זָכוֹר\"],\"Shavuot\":[\"שָׁבוּעוֹת\"],\"Shavuot I\":[\"שָׁבוּעוֹת א׳\"],\"Shavuot II\":[\"שָׁבוּעוֹת ב׳\"],\"Shmini Atzeret\":[\"שְׁמִינִי עֲצֶרֶת\"],\"Shushan Purim\":[\"שׁוּשָׁן פּוּרִים\"],\"Sigd\":[\"חַג הַסִּיגְד\"],\"Simchat Torah\":[\"שִׂמְחַת תּוֹרָה\"],\"Sukkot\":[\"סֻכּוֹת\"],\"Sukkot I\":[\"סֻכּוֹת א׳\"],\"Sukkot II\":[\"סֻכּוֹת ב׳\"],\"Sukkot II (CH''M)\":[\"סֻכּוֹת ב׳ (חוה״מ)\"],\"Sukkot III (CH''M)\":[\"סֻכּוֹת ג׳ (חוה״מ)\"],\"Sukkot IV (CH''M)\":[\"סֻכּוֹת ד׳ (חוה״מ)\"],\"Sukkot V (CH''M)\":[\"סֻכּוֹת ה׳ (חוה״מ)\"],\"Sukkot VI (CH''M)\":[\"סֻכּוֹת ו׳ (חוה״מ)\"],\"Sukkot VII (Hoshana Raba)\":[\"סֻכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)\"],\"Sukkot Shabbat Chol ha-Moed\":[\"שַׁבַּת חֹל הַמּוֹעֵד סֻכּוֹת\"],\"Ta'anit Bechorot\":[\"תַּעֲנִית בְּכוֹרוֹת\"],\"Ta'anit BeHaB\":[\"תַּעֲנִית בה״ב\"],\"Ta'anit Esther\":[\"תַּעֲנִית אֶסְתֵּר\"],\"Tish'a B'Av\":[\"תִּשְׁעָה בְּאָב\"],\"Tu B'Av\":[\"ט״וּ בְּאָב\"],\"Tu BiShvat\":[\"ט״וּ בִּשְׁבָט\"],\"Tu B'Shvat\":[\"ט״וּ בִּשְׁבָט\"],\"Tzom Gedaliah\":[\"צוֹם גְּדַלְיָה\"],\"Tzom Tammuz\":[\"צוֹם י״ז בְּתַמּוּז\"],\"Yom HaAtzma'ut\":[\"יוֹם הָעַצְמָאוּת\"],\"Yom HaShoah\":[\"יוֹם הַשּׁוֹאָה\"],\"Yom HaZikaron\":[\"יוֹם הַזִּכָּרוֹן\"],\"Yom Kippur\":[\"יוֹם כִּפּוּר\"],\"Yom Yerushalayim\":[\"יוֹם יְרוּשָׁלַיִם\"],\"Yom HaAliyah\":[\"יוֹם הַעֲלִיָּה\"],\"Yom HaAliyah School Observance\":[\"שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה\"],\"Rosh Chodesh Adar\":[\"רֹאשׁ חוֹדֶשׁ אֲדָר\"],\"Rosh Chodesh Adar I\":[\"רֹאשׁ חוֹדֶשׁ אֲדָר א׳\"],\"Rosh Chodesh Adar II\":[\"רֹאשׁ חוֹדֶשׁ אֲדָר ב׳\"],\"Rosh Chodesh Av\":[\"רֹאשׁ חוֹדֶשׁ אָב\"],\"Rosh Chodesh Cheshvan\":[\"רֹאשׁ חוֹדֶשׁ חֶשְׁוָן\"],\"Rosh Chodesh Elul\":[\"רֹאשׁ חוֹדֶשׁ אֱלוּל\"],\"Rosh Chodesh Iyyar\":[\"רֹאשׁ חוֹדֶשׁ אִיָּיר\"],\"Rosh Chodesh Kislev\":[\"רֹאשׁ חוֹדֶשׁ כִּסְלֵו\"],\"Rosh Chodesh Nisan\":[\"רֹאשׁ חוֹדֶשׁ נִיסָן\"],\"Rosh Chodesh Sh'vat\":[\"רֹאשׁ חוֹדֶשׁ שְׁבָט\"],\"Rosh Chodesh Sivan\":[\"רֹאשׁ חוֹדֶשׁ סִיוָן\"],\"Rosh Chodesh Tamuz\":[\"רֹאשׁ חוֹדֶשׁ תַּמּוּז\"],\"Rosh Chodesh Tammuz\":[\"רֹאשׁ חוֹדֶשׁ תַּמּוּז\"],\"Rosh Chodesh Tevet\":[\"רֹאשׁ חוֹדֶשׁ טֵבֵת\"],\"min\":[\"דַּקּוֹת\"],\"Fast begins\":[\"תְּחִילַּת הַצוֹם\"],\"Fast ends\":[\"סִיּוּם הַצוֹם\"],\"Rosh Hashana LaBehemot\":[\"רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה\"],\"Tish'a B'Av (observed)\":[\"(תִּשְׁעָה בְּאָב (נִדְחָה\"],\"Shabbat Mevarchim Chodesh\":[\"שַׁבַּת מְבָרְכִים חוֹדֶשׁ\"],\"Shabbat Shirah\":[\"שַׁבַּת שִׁירָה\"],\"Lovingkindness\":[\"חֶסֶד\"],\"Might\":[\"גְּבוּרָה\"],\"Beauty\":[\"תִּפְאֶרֶת\"],\"Eternity\":[\"נֶּצַח\"],\"Splendor\":[\"הוֹד\"],\"Foundation\":[\"יְּסוֹד\"],\"Majesty\":[\"מַּלְכוּת\"],\"day\":[\"יוֹם\"],\"Yom Kippur Katan\":[\"יוֹם כִּפּוּר קָטָן\"],\"Yizkor\":[\"יִזְכּוֹר\"],\"Family Day\":[\"יוֹם הַמִּשׁפָּחָה\"],\"Yitzhak Rabin Memorial Day\":[\"יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין\"],\"Jabotinsky Day\":[\"יוֹם זַ׳בּוֹטִינְסְקִי\"],\"Herzl Day\":[\"יוֹם הֶרְצְל\"],\"Ben-Gurion Day\":[\"יוֹם בֶּן־גּוּרִיּוֹן\"],\"Hebrew Language Day\":[\"יוֹם הַשָׂפָה הַעִברִית\"],\"Birkat Hachamah\":[\"בִּרְכַּת הַחַמָּה\"],\"Birkat HaChamah\":[\"בִּרְכַּת הַחַמָּה\"],\"Shushan Purim Katan\":[\"שׁוּשָׁן פּוּרִים קָטָן\"],\"Purim Meshulash\":[\"פּוּרִים מְשׁוּלָּשׁ\"],\"Chag HaBanot\":[\"חַג הַבָּנוֹת\"],\"Molad\":[\"מוֹלָד הָלְּבָנָה\"],\"chalakim\":[\"חֲלָקִים\"],\"Alot HaShachar\":[\"עֲלוֹת הַשַּׁחַר\"],\"Misheyakir\":[\"מִשֶּׁיַּכִּיר\"],\"Misheyakir Machmir\":[\"מִשֶּׁיַּכִּיר מַחְמִיר\"],\"Sunrise\":[\"נֵץ הַחַמָּה\"],\"Kriat Shema, sof zeman\":[\"סוֹף זְמַן קְרִיאַת שְׁמַע\"],\"Tefilah, sof zeman\":[\"סוֹף זְמַן תְּפִלָּה\"],\"Kriat Shema, sof zeman (MGA)\":[\"סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)\"],\"Kriat Shema, sof zeman (GRA)\":[\"סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)\"],\"Tefilah, sof zeman (MGA)\":[\"סוֹף זְמַן תְּפִלָּה (מג״א)\"],\"Tefilah, sof zeman (GRA)\":[\"סוֹף זְמַן תְּפִלָּה (גְּרָ״א)\"],\"Chatzot HaLailah\":[\"חֲצוֹת הַלַּיְלָה\"],\"Chatzot HaYom\":[\"חֲצוֹת הַיּוֹם\"],\"Chatzot hayom\":[\"חֲצוֹת הַיּוֹם\"],\"Mincha Gedolah\":[\"מִנְחָה גְּדוֹלָה\"],\"Mincha Ketanah\":[\"מִנְחָה קְטַנָּה\"],\"Plag HaMincha\":[\"פְּלַג הַמִּנְחָה\"],\"Sunset\":[\"שְׁקִיעַת הַחַמָּה\"],\"Bein HaShemashot\":[\"בֵּין הַשְּׁמָשׁוֹת\"],\"Tzeit HaKochavim\":[\"צֵאת הַכּוֹכָבִים\"],\"Biur Chametz\":[\"בִּעוּר חָמֵץ\"],\"Finish eating chametz\":[\"סוֹף זְמַן אֲכִילַת חָמֵץ\"]}}}","import {Locale} from '@hebcal/hdate';\nimport poAshkenazi from './ashkenazi.po.js';\nimport poHe from './he.po.js';\nimport noNikudOverride from './he-x-NoNikud.po.js';\n\nLocale.addTranslations('he', poHe);\nLocale.addTranslations('ashkenazi', poAshkenazi);\n\n/* Hebrew without nikkud */\nconst poHeNoNikud = Locale.copyLocaleNoNikud(poHe);\nLocale.addTranslations('he-x-NoNikud', poHeNoNikud);\nLocale.addTranslations('he-x-NoNikud', noNikudOverride);\n\nexport {Locale} from '@hebcal/hdate';\n","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n != 1);\",\"language\":\"he-x-NoNikud\"},\"contexts\":{\"\":{\"Korach\":[\"קורח\"],\"Chukat\":[\"חוקת\"],\"Erev Yom Kippur\":[\"ערב יום כיפור\"],\"Yom Kippur\":[\"יום כיפור\"],\"Yom Kippur Katan\":[\"יום כיפור קטן\"],\"Pesach Shabbat Chol ha-Moed\":[\"שבת חול המועד פסח\"],\"Sukkot Shabbat Chol ha-Moed\":[\"שבת חול המועד סוכות\"],\"Erev Sukkot\":[\"ערב סוכות\"],\"Sukkot\":[\"סוכות\"],\"Sukkot I\":[\"סוכות א׳\"],\"Sukkot II\":[\"סוכות ב׳\"],\"Sukkot II (CH''M)\":[\"סוכות ב׳ (חוה״מ)\"],\"Sukkot III (CH''M)\":[\"סוכות ג׳ (חוה״מ)\"],\"Sukkot IV (CH''M)\":[\"סוכות ד׳ (חוה״מ)\"],\"Sukkot V (CH''M)\":[\"סוכות ה׳ (חוה״מ)\"],\"Sukkot VI (CH''M)\":[\"סוכות ו׳ (חוה״מ)\"],\"Sukkot VII (Hoshana Raba)\":[\"סוכות ז׳ (הושענא רבה)\"]}}}","import {HDate, Locale} from '@hebcal/hdate';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Holiday flags for Event. These flags are typically\n * combined using bitwise arithmetic to form a mask.\n */\nexport const flags = {\n /** Chag, yontiff, yom tov */\n CHAG: 0x000001,\n /** Light candles before sundown */\n LIGHT_CANDLES: 0x000002,\n /** End of holiday (end of Yom Tov) */\n YOM_TOV_ENDS: 0x000004,\n /** Observed only in the Diaspora (chutz l'aretz) */\n CHUL_ONLY: 0x000008,\n /** Observed only in Israel */\n IL_ONLY: 0x000010,\n /** Light candles in the evening at Tzeit time (3 small stars) */\n LIGHT_CANDLES_TZEIS: 0x000020,\n /** Candle-lighting for Chanukah */\n CHANUKAH_CANDLES: 0x000040,\n /** Rosh Chodesh, beginning of a new Hebrew month */\n ROSH_CHODESH: 0x000080,\n /** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */\n MINOR_FAST: 0x000100,\n /** Shabbat Shekalim, Zachor, ... */\n SPECIAL_SHABBAT: 0x000200,\n /** Weekly sedrot on Saturdays */\n PARSHA_HASHAVUA: 0x000400,\n /** Daily page of Talmud (Bavli) */\n DAF_YOMI: 0x000800,\n /** Days of the Omer */\n OMER_COUNT: 0x001000,\n /** Yom HaShoah, Yom HaAtzma'ut, ... */\n MODERN_HOLIDAY: 0x002000,\n /** Yom Kippur and Tish'a B'Av */\n MAJOR_FAST: 0x004000,\n /** On the Saturday before Rosh Chodesh */\n SHABBAT_MEVARCHIM: 0x008000,\n /** Molad */\n MOLAD: 0x010000,\n /** Yahrzeit or Hebrew Anniversary */\n USER_EVENT: 0x020000,\n /** Daily Hebrew date (\"11th of Sivan, 5780\") */\n HEBREW_DATE: 0x040000,\n /** A holiday that's not major, modern, rosh chodesh, or a fast day */\n MINOR_HOLIDAY: 0x080000,\n /** Evening before a major or minor holiday */\n EREV: 0x100000,\n /** Chol haMoed, intermediate days of Pesach or Sukkot */\n CHOL_HAMOED: 0x200000,\n /** Mishna Yomi */\n MISHNA_YOMI: 0x400000,\n /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */\n YOM_KIPPUR_KATAN: 0x800000,\n /** Daily page of Jerusalem Talmud (Yerushalmi) */\n YERUSHALMI_YOMI: 0x1000000,\n /** Nach Yomi */\n NACH_YOMI: 0x2000000,\n /** Daily Learning */\n DAILY_LEARNING: 0x4000000,\n /** Yizkor */\n YIZKOR: 0x8000000,\n /** BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot */\n BEHAB: 0x10000000,\n} as const;\n\nconst flagToCategory = [\n [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],\n [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],\n [flags.HEBREW_DATE, 'hebdate'],\n [flags.MINOR_FAST, 'holiday', 'fast'],\n [flags.MINOR_HOLIDAY, 'holiday', 'minor'],\n [flags.MODERN_HOLIDAY, 'holiday', 'modern'],\n [flags.MOLAD, 'molad'],\n [flags.OMER_COUNT, 'omer'],\n [flags.PARSHA_HASHAVUA, 'parashat'], // backwards-compat\n [flags.ROSH_CHODESH, 'roshchodesh'],\n [flags.SHABBAT_MEVARCHIM, 'mevarchim'],\n [flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],\n [flags.USER_EVENT, 'user'],\n [flags.YIZKOR, 'yizkor'],\n] as const;\n\n/**\n * Represents an Event with a title, date, and flags.\n *\n * Events are used to represent holidays, candle-lighting times,\n * Torah readings, Omer days, Hebrew dates, and more. Most concrete event\n * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent},\n * {@link ParshaEvent}, {@link OmerEvent}) and are produced by\n * {@link calendar}.\n *\n * To get the title of the event in a language other than English with\n * Sephardic transliterations, use the {@link Event.render} method.\n *\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.getDate().toString(); // '6 Sivan 5749'\n * ev.getDesc(); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n */\nexport class Event {\n /** Hebrew date of this event */\n readonly date: HDate;\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n readonly desc: string;\n /** Bitmask of optional event flags. See {@link flags} */\n readonly mask: number;\n /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */\n emoji?: string;\n /** Optional longer description or memo text */\n memo?: string;\n /** Alarms are used by iCalendar feeds */\n alarm?: Date | string | boolean;\n /**\n * Constructs Event\n * @param date Hebrew date event occurs\n * @param desc Description (not translated)\n * @param [mask=0] optional bitmask of holiday flags (see {@link flags})\n * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)\n */\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n if (!HDate.isHDate(date)) {\n throw new TypeError(`Invalid Event date: ${date}`);\n }\n if (typeof desc !== 'string') {\n throw new TypeError(`Invalid Event description: ${desc}`);\n }\n this.date = date;\n this.desc = desc;\n this.mask = +mask;\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n /**\n * Hebrew date of this event\n */\n getDate(): HDate {\n return this.date;\n }\n /**\n * Gregorian date of this event\n */\n greg(): Date {\n return this.date.greg();\n }\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n getDesc(): string {\n return this.desc;\n }\n /**\n * Bitmask of optional event flags. See {@link flags}\n */\n getFlags(): number {\n return this.mask;\n }\n /**\n * Returns (translated) description of this event\n * @example\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.render('en'); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n * ev.render('ashkenazi'); // 'Shavuos'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.desc, locale);\n }\n /**\n * Returns a brief (translated) description of this event.\n *\n * For most events this is the same as {@link render}. Some subclasses\n * (e.g. {@link CandleLightingEvent}, {@link HavdalahEvent},\n * {@link OmerEvent}) produce shorter text without an attached time or\n * extra qualifier — useful for compact UI display.\n * @example\n * import {CandleLightingEvent} from '@hebcal/core';\n * // For a regular Event, renderBrief() == render():\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.renderBrief('en'); // 'Shavuot'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return this.render(locale);\n }\n /**\n * Returns the event's emoji character (e.g. `🕯️`, `🕎`, `🇮🇱`, `🍏🍯`),\n * or `null` if no emoji is associated with this event.\n * Subclasses override this to provide holiday-specific emoji.\n */\n getEmoji(): string | null {\n return this.emoji || null;\n }\n /**\n * Returns a simplified (untranslated) description for this event, suitable\n * for grouping related events under a single name.\n *\n * For example, {@link HolidayEvent} strips qualifiers so that\n * `\"Erev Pesach\"` → `\"Pesach\"` and `\"Sukkot III (CH''M)\"` → `\"Sukkot\"`.\n * For many events the basename and the event description are identical.\n * @example\n * import {HolidayEvent, HDate, months, flags} from '@hebcal/core';\n * const ev = new HolidayEvent(\n * new HDate(14, months.NISAN, 5784), 'Erev Pesach', flags.EREV);\n * ev.getDesc(); // 'Erev Pesach'\n * ev.basename(); // 'Pesach'\n */\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns a URL to hebcal.com or sefaria.org for more detail on the event,\n * or `undefined` for events with no detail page.\n *\n * Subclasses such as {@link HolidayEvent}, {@link ChanukahEvent},\n * {@link AsaraBTevetEvent}, {@link ParshaEvent}, and {@link OmerEvent}\n * override this with their own URL patterns.\n */\n url(): string | undefined {\n return undefined;\n }\n /**\n * Is this event observed in Israel?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInIsrael(); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInIsrael(); // true\n */\n observedInIsrael(): boolean {\n return !(this.mask & flags.CHUL_ONLY);\n }\n /**\n * Is this event observed in the Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInDiaspora(); // true\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInDiaspora(); // true\n */\n observedInDiaspora(): boolean {\n return !(this.mask & flags.IL_ONLY);\n }\n /**\n * Is this event observed in Israel/Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedIn(false); // true\n * ev1.observedIn(true); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedIn(false); // true\n * ev2.observedIn(true); // true\n * @param il\n */\n observedIn(il: boolean): boolean {\n return il ? this.observedInIsrael() : this.observedInDiaspora();\n }\n /**\n * Returns an array of category strings classifying this event, derived\n * from its {@link flags} bitmask. The first element is the broad category\n * (e.g. `'holiday'`, `'roshchodesh'`, `'parashat'`, `'omer'`), followed\n * by zero or more refinements (e.g. `'major'`, `'minor'`, `'fast'`).\n *\n * Returns `['unknown']` if no flag maps to a known category.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur', flags.MAJOR_FAST)\n * .getCategories(); // ['holiday', 'major', 'fast']\n * new Event(new HDate(1, 'Shvat', 5784), 'Rosh Chodesh Sh\\'vat', flags.ROSH_CHODESH)\n * .getCategories(); // ['roshchodesh']\n */\n getCategories(): string[] {\n const mask = this.getFlags();\n for (const attrs of flagToCategory) {\n const attr0 = attrs[0] as number;\n if (mask & attr0) {\n return attrs.slice(1) as string[];\n }\n }\n return ['unknown'];\n }\n}\n","import {HDate, gematriya, months, Locale} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/** Daily Hebrew date (\"11th of Sivan, 5780\") */\nexport class HebrewDateEvent extends Event {\n /**\n * @param date\n */\n constructor(date: HDate) {\n super(date, date.toString(), flags.HEBREW_DATE);\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.render('en')); // '15th of Cheshvan, 5769'\n * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'\n */\n render(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n switch (locale0) {\n case 'h':\n case 'he':\n return hd.renderGematriya(false);\n case 'he-x-nonikud':\n return hd.renderGematriya(true);\n default:\n return hd.render(locale0, true);\n }\n }\n /**\n * @private\n * @param locale\n */\n private renderBriefHebrew(locale: string): string {\n const hd = this.getDate();\n const dd = hd.getDate();\n const mm = Locale.gettext(hd.getMonthName(), locale);\n return gematriya(dd) + ' ' + mm;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.renderBrief()); // '15th of Cheshvan'\n * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'\n */\n renderBrief(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {\n return this.render(locale0);\n }\n switch (locale0) {\n case 'h':\n case 'he':\n case 'he-x-nonikud':\n return this.renderBriefHebrew(locale0);\n default:\n return hd.render(locale0, false);\n }\n }\n}\n","// Low-Level\nexport const expectedPositive = (entityName, num) => `Non-positive ${entityName}: ${num}`;\nexport const expectedFinite = (entityName, num) => `Non-finite ${entityName}: ${num}`;\nexport const forbiddenBigIntToNumber = (entityName) => `Cannot convert bigint to ${entityName}`;\nexport const invalidObject = 'Invalid object';\nexport const numberOutOfRange = (entityName, val, min, max) => invalidEntity(entityName, val) + `; must be between ${min}-${max}`;\n// Entity/Fields/Bags\nexport const invalidEntity = (fieldName, val) => `Invalid ${fieldName}: ${val}`;\n// Calendar\nexport const unsupportedWeekNumbers = 'Calendar week operations forbidden';\n// Rounding\nexport const nonOneRoundingIncrement = 'Non-1 roundingIncrement not allowed';\n// Options\nexport const invalidOverflowOption = 'Invalid overflow option';\n","import * as errorMessages from './errorMessages.js';\nexport const nanoInMicro = 1_000;\nexport const nanoInMilli = 1_000_000;\nexport const nanoInSec = 1_000_000_000;\nexport const nanoInMinute = 60_000_000_000;\nexport const nanoInHour = 3_600_000_000_000;\nexport function normalizeOptions(options) {\n if (options === undefined) {\n return Object.create(null);\n }\n return requireObjectLike(options);\n}\nexport function toFiniteNumber(arg, entityName = 'number') {\n if (typeof arg === 'bigint') {\n throw new TypeError(errorMessages.forbiddenBigIntToNumber(entityName));\n }\n arg = Number(arg);\n if (!Number.isFinite(arg)) {\n throw new RangeError(errorMessages.expectedFinite(entityName, arg));\n }\n return arg;\n}\nexport function toIntegerWithTrunc(arg, entityName) {\n return Math.trunc(toFiniteNumber(arg, entityName)) || 0; // ensure no -0\n}\nexport function toPositiveIntegerWithTruncation(arg, entityName) {\n return requireNumberIsPositive(toIntegerWithTrunc(arg, entityName), entityName);\n}\n/*\nAlready known to be number.\n*/\nexport function requireNumberIsPositive(num, entityName = 'number') {\n if (num <= 0) {\n throw new RangeError(errorMessages.expectedPositive(entityName, num));\n }\n return num;\n}\n/*\nmin/max are inclusive\n*/\nexport function constrainToRange(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}\nexport function isObjectLike(arg) {\n return arg !== null && (typeof arg === 'object' || typeof arg === 'function');\n}\nexport function requireObjectLike(arg) {\n if (!isObjectLike(arg)) {\n throw new TypeError(errorMessages.invalidObject);\n }\n return arg;\n}\n// Options-bag-parsing-adjacent\n// ----------------------------\n/*\nAlready known to be number\n*/\nexport function normalizeNumberInRange(num, min, max, // inclusive\noptions) {\n const clamped = constrainToRange(num, min, max);\n if (normalizeOverflow(options) === 'reject' && num !== clamped) {\n throw new RangeError(errorMessages.numberOutOfRange('number', num, min, max));\n }\n return clamped;\n}\n/*\nMatch Temporal's field overflow shape without depending on the polyfill's\ninternal option readers. Undefined defaults to constrain; explicit reject asks\nfor exact in-range input.\n*/\nfunction normalizeOverflow(options) {\n options = normalizeOptions(options);\n const overflow = options.overflow;\n if (overflow === undefined) {\n return 'constrain';\n }\n if (overflow === 'constrain' || overflow === 'reject') {\n return overflow;\n }\n throw new RangeError(errorMessages.invalidOverflowOption);\n}\n","import * as TemporalUtils from \"temporal-utils/protected\";\n\nimport { toFiniteNumber, isObjectLike as isObjectLike$1, requireObjectLike, toIntegerWithTrunc, normalizeOptions, toPositiveIntegerWithTruncation } from \"temporal-utils/protected\";\n\nimport * as baseErrorMessages from \"temporal-utils/protected-error-messages\";\n\nconst invalidEntity = baseErrorMessages.invalidEntity;\n\nconst unsupportedWeekNumbers = baseErrorMessages.unsupportedWeekNumbers;\n\nconst missingField = fieldName => `Missing ${fieldName}`;\n\nconst noValidFields = validFields => \"No valid fields: \" + validFields.join();\n\nconst invalidBag = \"Invalid bag\";\n\nconst invalidChoice = (fieldName, val, choiceMap) => baseErrorMessages.invalidEntity(fieldName, val) + \"; must be \" + Object.keys(choiceMap).join();\n\nconst forbiddenValueOf = \"Cannot use valueOf\";\n\nconst invalidCallingContext = \"Invalid calling context\";\n\nconst missingYear = allowEra => \"Missing year\" + (allowEra ? \"/era/eraYear\" : \"\");\n\nconst invalidLeapMonth = \"Invalid leap month\";\n\nconst invalidCalendar = calendarId => baseErrorMessages.invalidEntity(\"Calendar\", calendarId);\n\nconst exoticCalendarRequired = (calendarId, remedy) => `Unknown calendar ${calendarId}; might need ${remedy}`;\n\nconst invalidTimeZone = calendarId => baseErrorMessages.invalidEntity(\"TimeZone\", calendarId);\n\nconst outOfBoundsDate = \"Out-of-bounds date\";\n\nconst invalidRelativeTo = arg => invalidEntity(\"relativeTo\", arg);\n\nconst failedParse = s => `Cannot parse: ${s}`;\n\nconst invalidSubstring = substring => `Invalid substring: ${substring}`;\n\nconst invalidFormatType = branding => `Cannot format ${branding}`;\n\nconst mismatchingFormatTypes = \"Mismatching types for formatting\";\n\nconst constrainToRange = TemporalUtils.constrainToRange;\n\nconst isObjectLike = TemporalUtils.isObjectLike;\n\nfunction throwRangeError(message) {\n throw new RangeError(message);\n}\n\nfunction throwTypeError(message) {\n throw new TypeError(message);\n}\n\nfunction clampProp(props, propName, min, max, overflow) {\n return clampEntity(propName, ((props, propName) => {\n const propVal = props[propName];\n return void 0 === propVal && throwTypeError(missingField(propName)), propVal;\n })(props, propName), min, max, overflow);\n}\n\nfunction clampEntity(entityName, num, min, max, overflow, choices) {\n const clamped = constrainToRange(num, min, max);\n return overflow && num !== clamped && throwRangeError(((entityName, val, min, max, choices) => choices ? baseErrorMessages.numberOutOfRange(entityName, choices[val], choices[min], choices[max]) : baseErrorMessages.numberOutOfRange(entityName, val, min, max))(entityName, num, min, max, choices)), \n clamped;\n}\n\nfunction memoize(generator, MapClass = Map) {\n const map = new MapClass;\n return (key, ...otherArgs) => {\n if (map.has(key)) {\n return map.get(key);\n }\n const val = generator(key, ...otherArgs);\n return map.set(key, val), val;\n };\n}\n\nconst createNameDescriptors = name => createPropDescriptors({\n name: name\n}, 1);\n\nconst createPropDescriptors = (propVals, readonly) => mapProps(value => ({\n value: value,\n configurable: 1,\n writable: !readonly\n}), propVals);\n\nconst createStringTagDescriptors = value => ({\n [Symbol.toStringTag]: {\n value: value,\n configurable: 1\n }\n});\n\nfunction mapProps(transformer, props) {\n const res = {};\n for (const propName in props) {\n res[propName] = transformer(props[propName], propName);\n }\n return res;\n}\n\nfunction zipPropsConst(propNames, propVal) {\n const res = {};\n for (const propName of propNames) {\n res[propName] = propVal;\n }\n return res;\n}\n\nfunction createPropGetters(propNames) {\n const getters = {};\n for (const propName of propNames) {\n getters[propName] = slots => slots[propName];\n }\n return getters;\n}\n\nfunction pluckProps(propNames, props, dest = Object.create(null)) {\n for (const propName of propNames) {\n dest[propName] = props[propName];\n }\n return dest;\n}\n\nfunction allPropsEqual(propNames, props0, props1) {\n for (const propName of propNames) {\n if (props0[propName] !== props1[propName]) {\n return 0;\n }\n }\n return 1;\n}\n\nfunction zeroOutProps(propNames, clearUntilI, props) {\n const copy = {\n ...props\n };\n for (let i = 0; i < clearUntilI; i++) {\n copy[propNames[i]] = 0;\n }\n return copy;\n}\n\nfunction bindArgs(f, ...boundArgs) {\n return (...dynamicArgs) => f(...boundArgs, ...dynamicArgs);\n}\n\nfunction identity(arg) {\n return arg;\n}\n\nfunction noop() {}\n\nfunction capitalize(s) {\n return s[0].toUpperCase() + s.substring(1);\n}\n\nfunction sortStrings(...strss) {\n return [].concat(...strss).sort();\n}\n\nfunction createRegExp(meat) {\n return new RegExp(`^${meat}$`, \"i\");\n}\n\nfunction parseSubsecNano(fracStr) {\n return parseInt(fracStr.padEnd(9, \"0\"));\n}\n\nfunction parseSign(s) {\n return s && \"+\" !== s ? -1 : 1;\n}\n\nfunction parseInt0(s) {\n return void 0 === s ? 0 : parseInt(s);\n}\n\nfunction padNumber(digits, num) {\n return String(num).padStart(digits, \"0\");\n}\n\nconst padNumber2 = /*@__PURE__*/ bindArgs(padNumber, 2);\n\nfunction compareNumbers(a, b) {\n return Math.sign(a - b);\n}\n\nfunction compareBigInts(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nfunction divFloorBigInt(num, denom) {\n const whole = num / denom;\n return num % denom < 0n ? whole - 1n : whole;\n}\n\nfunction divModFloorBigInt(num, divisor) {\n const quotient = divFloorBigInt(num, divisor);\n return [ quotient, num - quotient * divisor ];\n}\n\nfunction divModFloor(num, divisor) {\n return [ Math.floor(num / divisor), modFloor(num, divisor) ];\n}\n\nfunction modFloor(num, divisor) {\n return (num % divisor + divisor) % divisor;\n}\n\nfunction divTrunc(num, divisor) {\n return Math.trunc(num / divisor) || 0;\n}\n\nfunction modTrunc(num, divisor) {\n return num % divisor || 0;\n}\n\nfunction fabricateNearHalfFraction(halfCompare, sign = 1) {\n return sign * (.5 + halfCompare / 5);\n}\n\nfunction hasHalf(num) {\n return .5 === Math.abs(num % 1);\n}\n\nconst isoCalendarId = \"iso8601\";\n\nconst gregoryCalendarId = \"gregory\";\n\nconst gregoryEraOrigins = {\n \"bce\": -1,\n \"ce\": 0\n};\n\nfunction normalizeEraName(era) {\n const normalized = era.normalize(\"NFD\").toLowerCase().replace(/[^a-z0-9]/g, \"\");\n return \"bc\" === normalized || \"b\" === normalized ? \"bce\" : \"ad\" === normalized || \"a\" === normalized ? \"ce\" : normalized;\n}\n\nconst isoCalendarImpl = void 0;\n\nconst gregoryCalendarImpl = 0;\n\nfunction getCalendarSlotId(calendar) {\n return calendar === isoCalendarImpl ? \"iso8601\" : 0 === calendar ? \"gregory\" : calendar.id;\n}\n\nconst monthCodeRegExp = /^M(\\d{2})(L?)$/;\n\nfunction parseMonthCode(monthCode) {\n const m = monthCodeRegExp.exec(monthCode);\n return m || throwRangeError((monthCode => `Invalid monthCode: ${monthCode}`)(monthCode)), \n [ parseInt(m[1]), Boolean(m[2]) ];\n}\n\nfunction formatMonthCode(monthCodeNumber, isLeapMonth) {\n return \"M\" + padNumber2(monthCodeNumber) + (isLeapMonth ? \"L\" : \"\");\n}\n\nfunction monthCodeNumberToMonth(monthCodeNumber, isLeapMonth, leapMonth) {\n return monthCodeNumber + (isLeapMonth || leapMonth && monthCodeNumber >= leapMonth ? 1 : 0);\n}\n\nfunction monthToMonthCodeNumber(month, leapMonth) {\n return month - (leapMonth && month >= leapMonth ? 1 : 0);\n}\n\nconst unitNameMap = {\n nanosecond: 0,\n microsecond: 1,\n millisecond: 2,\n second: 3,\n minute: 4,\n hour: 5,\n day: 6,\n week: 7,\n month: 8,\n year: 9\n};\n\nconst unitNamesAsc = /*@__PURE__*/ Object.keys(unitNameMap);\n\nconst milliInUtcDay = 864e5;\n\nconst nanoInMicro = TemporalUtils.nanoInMicro;\n\nconst nanoInMilli = TemporalUtils.nanoInMilli;\n\nconst nanoInSec = TemporalUtils.nanoInSec;\n\nconst nanoInMinute = TemporalUtils.nanoInMinute;\n\nconst nanoInHour = TemporalUtils.nanoInHour;\n\nconst nanoInUtcDay = 864e11;\n\nconst unitNanoMap = [ 1, nanoInMicro, nanoInMilli, nanoInSec, nanoInMinute, nanoInHour, nanoInUtcDay ];\n\nconst bigNanoInMicro = /*@__PURE__*/ BigInt(nanoInMicro);\n\nconst bigNanoInMilli = /*@__PURE__*/ BigInt(nanoInMilli);\n\nconst bigNanoInSec = /*@__PURE__*/ BigInt(nanoInSec);\n\nconst bigNanoInMinute = /*@__PURE__*/ BigInt(nanoInMinute);\n\nconst bigNanoInHour = /*@__PURE__*/ BigInt(nanoInHour);\n\nconst bigNanoInUtcDay = /*@__PURE__*/ BigInt(nanoInUtcDay);\n\nfunction divideBigNanoToExactNumber(bigNano, divisorNano) {\n const days = Number(bigNano / bigNanoInUtcDay);\n const timeNano = Number(bigNano % bigNanoInUtcDay);\n return days * (nanoInUtcDay / divisorNano) + (Math.trunc(timeNano / divisorNano) + timeNano % divisorNano / divisorNano);\n}\n\nconst timeFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.slice(0, 6);\n\nconst timeGetters = /*@__PURE__*/ createPropGetters(timeFieldNamesAsc);\n\nconst yearFieldNamesAsc = [ \"year\" ];\n\nconst dayFieldNamesAsc = [ \"day\" ];\n\nconst calendarDateFieldNamesAsc = [ \"day\", \"month\", \"year\" ];\n\nconst offsetFieldNames = [ \"offset\" ];\n\nconst timeZoneFieldNames = [ \"timeZone\" ];\n\nconst eraYearFieldNames = [ \"era\", \"eraYear\" ];\n\nconst allYearFieldNames = [ \"era\", \"eraYear\", \"year\" ];\n\nconst monthFieldNames = [ \"month\", \"monthCode\" ];\n\nconst monthDayFieldNames = [ \"day\", \"month\", \"monthCode\" ];\n\nconst timeFieldNamesAlpha = /*@__PURE__*/ sortStrings(timeFieldNamesAsc);\n\nconst yearFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearFieldNamesAsc);\n\nconst yearMonthFieldNamesAlpha = /*@__PURE__*/ sortStrings(monthFieldNames, yearFieldNamesAsc);\n\nconst yearMonthFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthFieldNamesAlpha);\n\nconst yearMonthCodeFieldNamesAlpha = /*@__PURE__*/ sortStrings([ \"monthCode\" ], yearFieldNamesAsc);\n\nconst yearMonthCodeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthCodeFieldNamesAlpha);\n\nconst monthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, [ \"monthCode\" ]);\n\nconst dateFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthFieldNamesAlpha);\n\nconst dateFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthFieldNamesAlpha);\n\nconst dateTimeFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc);\n\nconst dateTimeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc);\n\nconst dateTimeAndOffsetFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc, offsetFieldNames);\n\nconst dateTimeAndOffsetFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc, offsetFieldNames);\n\nconst dateTimeAndZoneFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc, offsetFieldNames, timeZoneFieldNames);\n\nconst dateTimeAndZoneFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc, offsetFieldNames, timeZoneFieldNames);\n\nconst yearMonthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthCodeFieldNamesAlpha);\n\nconst yearMonthCodeDayFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthCodeFieldNamesAlpha);\n\nconst timeFieldDefaults = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, 0);\n\nfunction validateTimeFields(timeFields) {\n return constrainTimeFields(timeFields, 1), timeFields;\n}\n\nconst maxValues = {\n hour: 23,\n minute: 59,\n second: 59\n};\n\nfunction constrainTimeFields(timeFields, overflow) {\n const constrainedFields = {};\n for (const fieldName of timeFieldNamesAsc) {\n constrainedFields[fieldName] = clampEntity(fieldName, timeFields[fieldName], 0, maxValues[fieldName] || 999, overflow);\n }\n return constrainedFields;\n}\n\nfunction timeFieldsToNano(timeFields) {\n return timeFieldsToSec(timeFields) * nanoInSec + timeFieldsToSubsecNano(timeFields);\n}\n\nfunction timeFieldsToMilli(timeFields) {\n return 1e3 * timeFieldsToSec(timeFields) + timeFields.millisecond;\n}\n\nfunction timeFieldsToSec(timeFields) {\n return 3600 * timeFields.hour + 60 * timeFields.minute + timeFields.second;\n}\n\nfunction timeFieldsToSubsecNano(timeFields) {\n return timeFields.millisecond * nanoInMilli + timeFields.microsecond * nanoInMicro + timeFields.nanosecond;\n}\n\nfunction nanoToTimeAndDay(nano) {\n const [dayDelta, timeNano] = divModFloor(nano, nanoInUtcDay);\n return [ nanoToTimeFields(timeNano), dayDelta ];\n}\n\nfunction nanoToTimeFields(timeNano) {\n const [timeMilli, nanoAfterMilli] = divModFloor(timeNano, nanoInMilli);\n const [microsecond, nanosecond] = divModFloor(nanoAfterMilli, nanoInMicro);\n return milliToTimeFields(timeMilli, microsecond, nanosecond);\n}\n\nfunction milliToTimeFields(timeMilli, microsecond = 0, nanosecond = 0) {\n const [hour, milliAfterHour] = divModFloor(timeMilli, 36e5);\n const [minute, milliAfterMinute] = divModFloor(milliAfterHour, 6e4);\n const [second, millisecond] = divModFloor(milliAfterMinute, 1e3);\n return {\n hour: hour,\n minute: minute,\n second: second,\n millisecond: millisecond,\n microsecond: microsecond,\n nanosecond: nanosecond\n };\n}\n\nfunction epochNanoToSecMod(epochNano) {\n const [epochSec, nano] = divModFloorBigInt(epochNano, bigNanoInSec);\n return [ Number(epochSec), Number(nano) ];\n}\n\nfunction isoDateTimeToEpochNano(isoDateTime) {\n return isoDateToEpochNano(isoDateTime) + BigInt(timeFieldsToNano(isoDateTime));\n}\n\nfunction isoDateTimeToEpochMilli(isoDateTime) {\n return isoDateToEpochMilli(isoDateTime) + timeFieldsToMilli(isoDateTime);\n}\n\nfunction isoDateToEpochNano(isoDate) {\n return BigInt(isoDateToEpochDays(isoDate)) * bigNanoInUtcDay;\n}\n\nfunction isoDateToEpochMilli(isoDate) {\n return 864e5 * isoDateToEpochDays(isoDate);\n}\n\nfunction isoDateToEpochDays(isoDate) {\n return isoArgsToEpochDays(isoDate.year, isoDate.month, isoDate.day);\n}\n\nfunction isoArgsToEpochDays(isoYear, isoMonth = 1, isoDay = 1) {\n const monthIndex = isoMonth - 1;\n return isoYear += Math.floor(monthIndex / 12), isoMonth = modFloor(monthIndex, 12), \n Date.UTC(isoYear % 400 - 400, isoMonth, 0) / 864e5 + 146097 * (divTrunc(isoYear, 400) + 1) + isoDay;\n}\n\nfunction epochNanoToIsoDateTime(epochNano) {\n const [epochDays, nanoAfterDay] = divModFloorBigInt(epochNano, bigNanoInUtcDay);\n return {\n ...epochDaysToIsoDate(Number(epochDays)),\n ...nanoToTimeFields(Number(nanoAfterDay))\n };\n}\n\nfunction epochMilliToIsoDateTime(epochMilli, microsecond = 0, nanosecond = 0) {\n const [epochDays, milliAfterDay] = divModFloor(epochMilli, 864e5);\n return {\n ...epochDaysToIsoDate(epochDays),\n ...milliToTimeFields(milliAfterDay, microsecond, nanosecond)\n };\n}\n\nfunction epochDaysToIsoDate(epochDays) {\n const legacyDate = new Date(864e5 * modFloor(epochDays, 146097));\n return {\n year: legacyDate.getUTCFullYear() + 400 * Math.floor(epochDays / 146097),\n month: legacyDate.getUTCMonth() + 1,\n day: legacyDate.getUTCDate()\n };\n}\n\nfunction diffEpochMilliDays(epochMilli0, epochMilli1) {\n return Math.trunc((epochMilli1 - epochMilli0) / 864e5);\n}\n\nconst isoEpochOriginYear = 1970;\n\nconst isoEpochFirstLeapYear = 1972;\n\nconst isoMonthsInYear = 12;\n\nfunction computeIsoMonthCodeParts(month) {\n return [ month, 0 ];\n}\n\nfunction computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth) {\n if (!isLeapMonth) {\n return {\n year: 1972,\n month: monthCodeNumber\n };\n }\n}\n\nfunction computeIsoFieldsFromParts(year, month, day) {\n return {\n year: year,\n month: month,\n day: day\n };\n}\n\nfunction computeIsoDaysInMonth(year, month) {\n switch (month) {\n case 2:\n return computeIsoInLeapYear(year) ? 29 : 28;\n\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n }\n return 31;\n}\n\nfunction computeIsoDaysInYear(year) {\n return computeIsoInLeapYear(year) ? 366 : 365;\n}\n\nfunction computeIsoInLeapYear(year) {\n return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);\n}\n\nfunction addIsoMonths(year, month, monthDelta) {\n return year += divTrunc(monthDelta, 12), (month += modTrunc(monthDelta, 12)) < 1 ? (year--, \n month += 12) : month > 12 && (year++, month -= 12), {\n year: year,\n month: month\n };\n}\n\nfunction diffIsoMonthSlots(year0, month0, year1, month1) {\n return 12 * (year1 - year0) + month1 - month0;\n}\n\nfunction computeIsoDayOfWeek(isoDateFields) {\n return modFloor(isoArgsToEpochDays(isoDateFields.year, isoDateFields.month, isoDateFields.day) + 4, 7) || 7;\n}\n\nfunction computeIsoDayOfYear(isoDateFields) {\n return isoArgsToEpochDays(isoDateFields.year, isoDateFields.month, isoDateFields.day) - isoArgsToEpochDays(isoDateFields.year) + 1;\n}\n\nfunction computeIsoWeekFields(isoDateFields) {\n let yearOfWeek = isoDateFields.year;\n let weekOfYear = Math.floor((computeIsoDayOfYear(isoDateFields) - computeIsoDayOfWeek(isoDateFields) + 10) / 7);\n let weeksInYear = computeIsoWeeksInYear(yearOfWeek);\n return weekOfYear < 1 ? weekOfYear = weeksInYear = computeIsoWeeksInYear(--yearOfWeek) : weekOfYear > weeksInYear && (weekOfYear = 1, \n weeksInYear = computeIsoWeeksInYear(++yearOfWeek)), {\n weekOfYear: weekOfYear,\n yearOfWeek: yearOfWeek,\n Be: weeksInYear\n };\n}\n\nfunction computeIsoWeeksInYear(year) {\n const y0DayOfWeek = computeIsoDayOfWeek({\n year: year,\n month: 1,\n day: 1\n });\n return 4 === y0DayOfWeek || 3 === y0DayOfWeek && computeIsoInLeapYear(year) ? 53 : 52;\n}\n\nfunction computeGregoryEraFields({year: year}) {\n return year < 1 ? {\n era: \"bce\",\n eraYear: 1 - year\n } : {\n era: \"ce\",\n eraYear: year\n };\n}\n\nfunction validateIsoDateTimeFields(isoDateTime) {\n return validateIsoDateFields(isoDateTime), validateTimeFields(isoDateTime);\n}\n\nfunction validateIsoDateFields(isoInternals) {\n return constrainIsoDateFields(isoInternals, 1), isoInternals;\n}\n\nfunction isIsoDateFieldsValid(isoDate) {\n return allPropsEqual(calendarDateFieldNamesAsc, isoDate, constrainIsoDateFields(isoDate));\n}\n\nfunction constrainIsoDateFields(isoDate, overflow) {\n const {year: year} = isoDate;\n const month = clampProp(isoDate, \"month\", 1, 12, overflow);\n return {\n year: year,\n month: month,\n day: clampProp(isoDate, \"day\", 1, computeIsoDaysInMonth(year, month), overflow)\n };\n}\n\nfunction computeCalendarDateFields(calendar, isoDate) {\n return calendar ? calendar.ae(isoDate) : isoDate;\n}\n\nfunction computeCalendarMonthCodeParts(calendar, year, month) {\n return calendar ? calendar.L(year, month) : computeIsoMonthCodeParts(month);\n}\n\nfunction computeCalendarEraFields(calendar, isoDate) {\n return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar && calendar.h?.(isoDate) || {};\n}\n\nfunction computeCalendarIsoFieldsFromParts(calendar, year, month, day) {\n return calendar ? calendar.de(year, month, day) : computeIsoFieldsFromParts(year, month, day);\n}\n\nfunction computeCalendarMonthsInYearForYear(calendar, year) {\n return calendar ? calendar.j(year) : 12;\n}\n\nfunction computeCalendarDaysInMonthForYearMonth(calendar, year, month) {\n return calendar ? calendar.o(year, month) : computeIsoDaysInMonth(year, month);\n}\n\nfunction computeCalendarMonthCode(calendar, isoDate) {\n const {year: year, month: month} = computeCalendarDateFields(calendar, isoDate);\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n return formatMonthCode(monthCodeNumber, isLeapMonth);\n}\n\nfunction computeCalendarInLeapYear(calendar, isoDate) {\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n return calendar ? calendar.q(year) : computeIsoInLeapYear(year);\n}\n\nfunction computeCalendarMonthsInYear(calendar, isoDate) {\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n return computeCalendarMonthsInYearForYear(calendar, year);\n}\n\nfunction computeCalendarDaysInMonth(calendar, isoDate) {\n const {year: year, month: month} = computeCalendarDateFields(calendar, isoDate);\n return computeCalendarDaysInMonthForYearMonth(calendar, year, month);\n}\n\nfunction computeCalendarDaysInYear(calendar, isoDate) {\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n return calendar ? calendar.i(year) : computeIsoDaysInYear(year);\n}\n\nfunction computeCalendarDayOfYear(calendar, isoDate) {\n if (!calendar) {\n return computeIsoDayOfYear(isoDate);\n }\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n const yearStartIsoDate = computeCalendarIsoFieldsFromParts(calendar, year, 1, 1);\n return isoDateToEpochDays(isoDate) - isoDateToEpochDays(yearStartIsoDate) + 1;\n}\n\nfunction computeCalendarWeekOfYear(calendar, isoDate) {\n return calendar === isoCalendarImpl ? computeIsoWeekFields(isoDate).weekOfYear : void 0;\n}\n\nfunction computeCalendarYearOfWeek(calendar, isoDate) {\n return calendar === isoCalendarImpl ? computeIsoWeekFields(isoDate).yearOfWeek : void 0;\n}\n\nconst durationFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.map(unitName => unitName + \"s\");\n\nconst durationGetters = /*@__PURE__*/ createPropGetters(durationFieldNamesAsc);\n\nconst durationFieldNamesAlpha = /*@__PURE__*/ sortStrings(durationFieldNamesAsc);\n\nconst durationTimeFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(0, 6);\n\nconst durationDateFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(6);\n\nconst durationCalendarFieldNamesAsc = /*@__PURE__*/ durationDateFieldNamesAsc.slice(1);\n\nconst durationFieldDefaults = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, 0);\n\nconst durationTimeFieldDefaults = /*@__PURE__*/ zipPropsConst(durationTimeFieldNamesAsc, 0);\n\nconst clearDurationFields = /*@__PURE__*/ bindArgs(zeroOutProps, durationFieldNamesAsc);\n\nfunction requirePropDefined(optionName, optionVal) {\n return null == optionVal && throwRangeError(missingField(optionName)), optionVal;\n}\n\nconst requireString = /*@__PURE__*/ bindArgs(requireType, \"string\");\n\nfunction requireType(typeName, arg, entityName = typeName) {\n return typeof arg !== typeName && throwTypeError(invalidEntity(entityName, arg)), \n arg;\n}\n\nfunction requireNumberIsInteger(num, entityName = \"number\") {\n return Number.isInteger(num) || throwRangeError(((entityName, num) => `Non-integer ${entityName}: ${num}`)(entityName, num)), \n num || 0;\n}\n\nfunction toString(arg) {\n return \"symbol\" == typeof arg && throwTypeError(\"Cannot convert Symbol to string\"), \n String(arg);\n}\n\nfunction toStringViaPrimitive(arg, entityName) {\n return isObjectLike$1(arg) ? String(arg) : requireString(arg, entityName);\n}\n\nfunction toBigInt(bi) {\n return \"boolean\" == typeof bi ? BigInt(bi ? 1 : 0) : \"string\" == typeof bi ? BigInt(bi) : (\"bigint\" != typeof bi && throwTypeError(`Invalid bigint: ${bi}`), \n bi);\n}\n\nfunction toStrictInteger(arg, entityName) {\n return requireNumberIsInteger(toFiniteNumber(arg, entityName), entityName);\n}\n\nfunction normalizeOptionsOrString(options, optionName) {\n return \"string\" == typeof options ? ((optionName, optionVal) => {\n const res = Object.create(null);\n return res[optionName] = optionVal, res;\n })(optionName, options) : requireObjectLike(options);\n}\n\nconst smallestUnitStr = \"smallestUnit\";\n\nconst roundingModeName = \"roundingMode\";\n\nconst overflowMap = {\n constrain: 0,\n reject: 1\n};\n\nconst epochDisambigMap = {\n compatible: 0,\n reject: 1,\n earlier: 2,\n later: 3\n};\n\nconst offsetDisambigMap = {\n reject: 0,\n use: 1,\n prefer: 2,\n ignore: 3\n};\n\nconst calendarDisplayMap = {\n auto: 0,\n never: 1,\n critical: 2,\n always: 3\n};\n\nconst timeZoneDisplayMap = {\n auto: 0,\n never: 1,\n critical: 2\n};\n\nconst offsetDisplayMap = {\n auto: 0,\n never: 1\n};\n\nconst roundingModeMap = {\n floor: 0,\n halfFloor: 1,\n ceil: 2,\n halfCeil: 3,\n trunc: 4,\n halfTrunc: 5,\n expand: 6,\n halfExpand: 7,\n halfEven: 8\n};\n\nconst roundingModeFuncs = [ Math.floor, num => hasHalf(num) ? Math.floor(num) : Math.round(num), Math.ceil, num => hasHalf(num) ? Math.ceil(num) : Math.round(num), Math.trunc, num => hasHalf(num) ? Math.trunc(num) || 0 : Math.round(num), num => num < 0 ? Math.floor(num) : Math.ceil(num), num => Math.sign(num) * Math.round(Math.abs(num)) || 0, num => hasHalf(num) ? (num = Math.trunc(num) || 0) + num % 2 : Math.round(num) ];\n\nconst directionMap = {\n previous: -1,\n next: 1\n};\n\nfunction coerceRoundingIncInteger(options) {\n const roundingInc = options.roundingIncrement;\n return void 0 === roundingInc ? 1 : toIntegerWithTrunc(roundingInc, \"roundingIncrement\");\n}\n\nfunction coerceFractionalSecondDigits(options) {\n let subsecDigits = options.fractionalSecondDigits;\n if (void 0 !== subsecDigits) {\n if (\"number\" != typeof subsecDigits) {\n if (\"auto\" === toString(subsecDigits)) {\n return;\n }\n throwRangeError(invalidEntity(\"fractionalSecondDigits\", subsecDigits));\n }\n subsecDigits = clampEntity(\"fractionalSecondDigits\", Math.floor(subsecDigits), 0, 9, 1);\n }\n return subsecDigits;\n}\n\nfunction coerceUnitOption(optionName, options, minUnit = 0, ensureDefined) {\n let unitStr = options[optionName];\n if (void 0 === unitStr) {\n return ensureDefined ? minUnit : void 0;\n }\n if (unitStr = toString(unitStr), \"auto\" === unitStr) {\n return ensureDefined ? minUnit : null;\n }\n let unit = unitNameMap[unitStr];\n return void 0 === unit && (unit = durationFieldNamesAsc.indexOf(unitStr)), unit < 0 && throwRangeError(invalidChoice(optionName, unitStr, unitNameMap)), \n unit;\n}\n\nfunction coerceChoiceOption(optionName, enumNameMap, options, defaultChoice = 0) {\n const enumArg = options[optionName];\n if (void 0 === enumArg) {\n return defaultChoice;\n }\n const enumStr = toString(enumArg);\n const enumNum = enumNameMap[enumStr];\n return void 0 === enumNum && throwRangeError(invalidChoice(optionName, enumStr, enumNameMap)), \n enumNum;\n}\n\nconst coerceSmallestUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, smallestUnitStr);\n\nconst coerceLargestUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, \"largestUnit\");\n\nconst coerceTotalUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, \"unit\");\n\nconst coerceOverflow = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"overflow\", overflowMap);\n\nconst coerceEpochDisambig = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"disambiguation\", epochDisambigMap);\n\nconst coerceOffsetDisambig = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"offset\", offsetDisambigMap);\n\nconst coerceCalendarDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"calendarName\", calendarDisplayMap);\n\nconst coerceTimeZoneDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"timeZoneName\", timeZoneDisplayMap);\n\nconst coerceOffsetDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"offset\", offsetDisplayMap);\n\nconst coerceRoundingMode = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"roundingMode\", roundingModeMap);\n\nconst coerceDirection = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"direction\", directionMap);\n\nfunction validateRoundingInc(roundingInc, smallestUnit, allowManyLargeUnits, solarMode) {\n const upUnitNano = solarMode ? nanoInUtcDay : unitNanoMap[smallestUnit + 1];\n if (upUnitNano) {\n const unitNano = unitNanoMap[smallestUnit];\n upUnitNano % ((roundingInc = clampEntity(\"roundingIncrement\", roundingInc, 1, upUnitNano / unitNano - (solarMode ? 0 : 1), 1)) * unitNano) && throwRangeError(invalidEntity(\"roundingIncrement\", roundingInc));\n } else {\n roundingInc = clampEntity(\"roundingIncrement\", roundingInc, 1, allowManyLargeUnits ? 10 ** 9 : 1, 1);\n }\n return roundingInc;\n}\n\nfunction validateUnitRange(optionName, unit, minUnit, maxUnit) {\n return null != unit && clampEntity(optionName, unit, minUnit, maxUnit, 1, unitNamesAsc), \n unit;\n}\n\nfunction checkLargestSmallestUnit(largestUnit, smallestUnit) {\n smallestUnit > largestUnit && throwRangeError(\"smallestUnit > largestUnit\");\n}\n\nfunction refineDiffOptions(roundingModeInvert, options, defaultLargestUnit, maxUnit = 9, minUnit = 0, defaultRoundingMode = 4) {\n options = normalizeOptions(options);\n let largestUnit = coerceLargestUnit(options, minUnit);\n let roundingInc = coerceRoundingIncInteger(options);\n let roundingMode = coerceRoundingMode(options, defaultRoundingMode);\n let smallestUnit = coerceSmallestUnit(options, minUnit, 1);\n return largestUnit = validateUnitRange(\"largestUnit\", largestUnit, minUnit, maxUnit), \n smallestUnit = validateUnitRange(smallestUnitStr, smallestUnit, minUnit, maxUnit), \n null == largestUnit ? largestUnit = Math.max(defaultLargestUnit, smallestUnit) : checkLargestSmallestUnit(largestUnit, smallestUnit), \n roundingInc = validateRoundingInc(roundingInc, smallestUnit, 1), roundingModeInvert && (roundingMode = (roundingMode => roundingMode < 4 ? (roundingMode + 2) % 4 : roundingMode)(roundingMode)), \n [ largestUnit, smallestUnit, roundingInc, roundingMode ];\n}\n\nfunction refineRoundingOptions(options, maxUnit = 6, solarMode) {\n let roundingInc = coerceRoundingIncInteger(options = normalizeOptionsOrString(options, smallestUnitStr));\n const roundingMode = coerceRoundingMode(options, 7);\n let smallestUnit = coerceSmallestUnit(options);\n return smallestUnit = requirePropDefined(smallestUnitStr, smallestUnit), smallestUnit = validateUnitRange(smallestUnitStr, smallestUnit, 0, maxUnit), \n roundingInc = validateRoundingInc(roundingInc, smallestUnit, void 0, solarMode), \n [ smallestUnit, roundingInc, roundingMode ];\n}\n\nfunction refineUnitDiffOptions(smallestUnit, options) {\n return void 0 !== options ? ((smallestUnit, options) => {\n let roundingInc = coerceRoundingIncInteger(options = normalizeOptionsOrString(options, \"roundingMode\"));\n const roundingMode = coerceRoundingMode(options, 7);\n return roundingInc = validateRoundingInc(roundingInc, smallestUnit, 1), [ roundingInc, roundingMode ];\n })(smallestUnit, options) : [];\n}\n\nfunction combineDateAndTime(isoDate, time) {\n return pluckProps(calendarDateFieldNamesAsc, isoDate, pluckProps(timeFieldNamesAsc, time));\n}\n\nfunction refineOverflowOptions(options) {\n return void 0 === options ? 0 : coerceOverflow(requireObjectLike(options));\n}\n\nfunction refineZonedFieldOptions(options, defaultOffsetDisambig = 0) {\n options = normalizeOptions(options);\n const epochDisambig = coerceEpochDisambig(options);\n const offsetDisambig = coerceOffsetDisambig(options, defaultOffsetDisambig);\n return [ coerceOverflow(options), offsetDisambig, epochDisambig ];\n}\n\nconst maxMilli = 864e13;\n\nconst epochNanoMax = /*@__PURE__*/ BigInt(1e8) * bigNanoInUtcDay;\n\nconst epochNanoMin = /*@__PURE__*/ BigInt(-1e8) * bigNanoInUtcDay;\n\nconst plainDateEpochNanoMin = epochNanoMin - bigNanoInUtcDay;\n\nconst isoYearMonthIndexMin = -3261848;\n\nfunction checkIsoYearMonthInBounds(isoDate) {\n const isoYearMonthIndex = 12 * isoDate.year + isoDate.month;\n return (isoYearMonthIndex < isoYearMonthIndexMin || isoYearMonthIndex > 3309129) && throwRangeError(outOfBoundsDate), \n isoDate;\n}\n\nfunction checkIsoDateInBounds(isoDate, allowPlainDateLowerEdge = 1) {\n return checkIsoDateEpochNanoInBounds(isoDateToEpochNano(isoDate), allowPlainDateLowerEdge), \n isoDate;\n}\n\nfunction checkIsoDateTimeInBounds(isoDateTime) {\n const epochNano = isoDateToEpochNano(isoDateTime);\n return checkIsoDateEpochNanoInBounds(epochNano), epochNano !== plainDateEpochNanoMin || timeFieldsToNano(isoDateTime) || throwRangeError(outOfBoundsDate), \n isoDateTime;\n}\n\nfunction checkIsoDateEpochNanoInBounds(epochNano, allowPlainDateLowerEdge = 1) {\n (epochNano < (allowPlainDateLowerEdge ? plainDateEpochNanoMin : epochNanoMin) || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate);\n}\n\nfunction checkEpochNanoInBounds(epochNano) {\n return (epochNano < epochNanoMin || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate), \n epochNano;\n}\n\nfunction isoDateTimeAndOffsetToEpochNano(isoDateTime, offsetNano) {\n return checkEpochNanoInBounds(isoDateToEpochNano(isoDateTime) + BigInt(timeFieldsToNano(isoDateTime) - offsetNano));\n}\n\nfunction createEpochNanoSlots(epochNano) {\n return {\n epochNanoseconds: epochNano\n };\n}\n\nfunction createZonedEpochNanoSlots(epochNano, timeZone, calendar) {\n return {\n calendar: calendar,\n timeZone: timeZone,\n epochNanoseconds: epochNano\n };\n}\n\nfunction createDateTimeSlots(isoDateTime, calendar) {\n return pluckProps(timeFieldNamesAsc, isoDateTime, createDateSlots(isoDateTime, calendar));\n}\n\nfunction createDateSlots(isoDate, calendar) {\n return pluckProps(calendarDateFieldNamesAsc, isoDate, {\n calendar: calendar\n });\n}\n\nfunction createTimeSlots(time) {\n return pluckProps(timeFieldNamesAsc, time);\n}\n\nfunction createDurationSlots(durationFields) {\n return pluckProps(durationFieldNamesAsc, durationFields, {\n sign: computeDurationSign(durationFields)\n });\n}\n\nfunction getEpochMilli(slots) {\n return epochNano = slots.epochNanoseconds, Number(divFloorBigInt(epochNano, bigNanoInMilli));\n var epochNano;\n}\n\nfunction getEpochNano(slots) {\n return slots.epochNanoseconds;\n}\n\nfunction totalDuration(refineRelativeTo, slots, options) {\n const maxDurationUnit = getMaxDurationUnit(slots);\n const [totalUnit, relativeToSlots] = ((options, refineRelativeTo) => {\n const relativeToInternals = refineRelativeTo((options = normalizeOptionsOrString(options, \"unit\")).relativeTo);\n let totalUnit = coerceTotalUnit(options);\n return totalUnit = requirePropDefined(\"unit\", totalUnit), [ totalUnit, relativeToInternals ];\n })(options, refineRelativeTo);\n const maxUnit = Math.max(totalUnit, maxDurationUnit);\n const isZoned = relativeToSlots && isZonedEpochSlots(relativeToSlots);\n if (!relativeToSlots && isUniformUnit(maxUnit, isZoned)) {\n return totalDayTimeDuration(slots, totalUnit);\n }\n if (relativeToSlots || throwRangeError(\"Missing relativeTo\"), !slots.sign && isUniformUnit(totalUnit, isZoned)) {\n return 0;\n }\n const [balancedDuration, endEpochNano, relativeOps] = spanRelativeDuration(relativeToSlots, slots, totalUnit);\n return isUniformUnit(totalUnit, isZoned) ? totalDayTimeDuration(balancedDuration, totalUnit) : totalRelativeDuration(balancedDuration, endEpochNano, totalUnit, relativeOps);\n}\n\nfunction totalRelativeDuration(durationFields, endEpochNano, totalUnit, relativeOps) {\n const sign = computeDurationSign(durationFields) || 1;\n const nudgeWindow = clampRelativeDuration(clearDurationFields(totalUnit, durationFields), totalUnit, sign, relativeOps, endEpochNano);\n const epochNano0 = nudgeWindow.ee;\n const epochNano1 = nudgeWindow.te;\n const denom = Number(epochNano1 - epochNano0);\n const numerator = Number(endEpochNano - epochNano0);\n return nudgeWindow.pe[durationFieldNamesAsc[totalUnit]] + numerator / denom * sign;\n}\n\nfunction totalDayTimeDuration(durationFields, totalUnit) {\n return divideBigNanoToExactNumber(durationDayTimeToBigNano(durationFields), unitNanoMap[totalUnit]);\n}\n\nfunction clampRelativeDuration(durationFields, clampUnit, clampDistance, relativeOps, epochNanoProgress) {\n const unitName = durationFieldNamesAsc[clampUnit];\n let startDurationFields = durationFields;\n let shifted = 0;\n let window = computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, relativeOps);\n return epochNanoProgress && !((epochNanoProgress, epochNano0, epochNano1, sign) => sign > 0 ? compareBigInts(epochNano0, epochNanoProgress) <= 0 && compareBigInts(epochNanoProgress, epochNano1) <= 0 : compareBigInts(epochNano1, epochNanoProgress) <= 0 && compareBigInts(epochNanoProgress, epochNano0) <= 0)(epochNanoProgress, window.ee, window.te, Math.sign(clampDistance)) && (startDurationFields = {\n ...durationFields,\n [unitName]: durationFields[unitName] + clampDistance\n }, shifted = 1, window = computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, relativeOps)), \n {\n ...window,\n pe: startDurationFields,\n Ae: shifted\n };\n}\n\nfunction computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, relativeOps) {\n const endDurationFields = {\n ...startDurationFields,\n [unitName]: startDurationFields[unitName] + clampDistance\n };\n return {\n ee: moveRelativeToEpochNano(relativeOps, startDurationFields),\n te: moveRelativeToEpochNano(relativeOps, endDurationFields),\n se: endDurationFields\n };\n}\n\nfunction computeEpochNanoFrac(epochNanoProgress, epochNano0, epochNano1) {\n const denomBig = epochNano1 - epochNano0;\n const numeratorBig = epochNanoProgress - epochNano0;\n if (!numeratorBig) {\n return 0;\n }\n const absNumerator = numeratorBig < 0n ? -numeratorBig : numeratorBig;\n const absDenom = denomBig < 0n ? -denomBig : denomBig;\n const fracSign = compareBigInts(numeratorBig, 0n) === compareBigInts(denomBig, 0n) ? 1 : -1;\n return compareBigInts(absNumerator, absDenom) <= 0 ? absNumerator === absDenom ? fracSign : fabricateNearHalfFraction(compareBigInts(2n * absNumerator, absDenom), fracSign) : Number(numeratorBig) / Number(denomBig);\n}\n\nfunction roundZonedEpochSlotsToUnit(slots, smallestUnit, roundingInc, roundingMode) {\n let {epochNanoseconds: epochNanoseconds} = slots;\n const {timeZone: timeZone, calendar: calendar} = slots;\n if (0 === smallestUnit && 1 === roundingInc) {\n return {\n epochNanoseconds: epochNanoseconds,\n timeZone: timeZone,\n calendar: calendar\n };\n }\n if (6 === smallestUnit) {\n const isoFields0 = combineDateAndTime(zonedEpochSlotsToIso(slots), timeFieldDefaults);\n const isoFields1 = combineDateAndTime(moveByDays(isoFields0, 1), timeFieldDefaults);\n const epochNano0 = getStartOfDayInstantFor(timeZone, isoFields0);\n const epochNano1 = getStartOfDayInstantFor(timeZone, isoFields1);\n epochNanoseconds = roundWithMode(computeZonedDayRoundFrac(epochNanoseconds, epochNano0, epochNano1), roundingMode) ? epochNano1 : epochNano0;\n } else {\n const isoDateTime = zonedEpochSlotsToIso(slots);\n const offsetNano = isoDateTime.offsetNanoseconds;\n epochNanoseconds = getMatchingInstantFor(timeZone, roundDateTimeToNano(isoDateTime, computeNanoInc(smallestUnit, roundingInc), roundingMode), offsetNano, 2, 0, 1);\n }\n return {\n epochNanoseconds: epochNanoseconds,\n timeZone: timeZone,\n calendar: calendar\n };\n}\n\nfunction computeZonedHoursInDay(slots) {\n const {timeZone: timeZone} = slots;\n const isoFields0 = combineDateAndTime(zonedEpochSlotsToIso(slots), timeFieldDefaults);\n const isoFields1 = combineDateAndTime(moveByDays(isoFields0, 1), timeFieldDefaults);\n const epochNano0 = getStartOfDayInstantFor(timeZone, isoFields0);\n return divideBigNanoToExactNumber(getStartOfDayInstantFor(timeZone, isoFields1) - epochNano0, nanoInHour);\n}\n\nfunction computeZonedStartOfDay(slots) {\n const {timeZone: timeZone, calendar: calendar} = slots;\n return createZonedEpochNanoSlots(getStartOfDayInstantFor(timeZone, combineDateAndTime(zonedEpochSlotsToIso(slots), timeFieldDefaults)), timeZone, calendar);\n}\n\nfunction alignZonedEpoch(computeAlignment, slots) {\n const {calendar: calendar, timeZone: timeZone} = slots;\n return getStartOfDayInstantFor(timeZone, computeAlignment(calendar, zonedEpochSlotsToIso(slots)));\n}\n\nfunction roundZonedEpochToInterval(computeInterval, slots, roundingMode) {\n const {calendar: calendar, timeZone: timeZone} = slots;\n const isoSlots = zonedEpochSlotsToIso(slots);\n const [isoFields0, isoFields1] = computeInterval(calendar, isoSlots);\n const epochNano = slots.epochNanoseconds;\n const epochNano0 = getStartOfDayInstantFor(timeZone, isoFields0);\n const epochNano1 = getStartOfDayInstantFor(timeZone, isoFields1);\n return roundWithMode(computeZonedDayRoundFrac(epochNano, epochNano0, epochNano1), roundingMode) ? epochNano1 : epochNano0;\n}\n\nfunction computeZonedDayRoundFrac(epochNano, epochNano0, epochNano1) {\n return computeEpochNanoFrac(epochNano < epochNano1 ? epochNano : epochNano1 - 1n, epochNano0, epochNano1);\n}\n\nfunction roundDateTimeToNano(isoDateTime, nanoInc, roundingMode) {\n const [roundedTimeFields, dayDelta] = roundTimeToNano(isoDateTime, nanoInc, roundingMode);\n const roundedIsoDateTime = combineDateAndTime(moveByDays(isoDateTime, dayDelta), roundedTimeFields);\n return checkIsoDateTimeInBounds(roundedIsoDateTime), roundedIsoDateTime;\n}\n\nfunction roundTimeToNano(timeFields, nanoInc, roundingMode) {\n return nanoToTimeAndDay(roundNumberToInc(timeFieldsToNano(timeFields), nanoInc, roundingMode));\n}\n\nfunction roundToMinute(offsetNano) {\n return roundNumberToInc(offsetNano, nanoInMinute, 7);\n}\n\nfunction computeNanoInc(smallestUnit, roundingInc) {\n return unitNanoMap[smallestUnit] * roundingInc;\n}\n\nfunction computeBigNanoInc(smallestUnit, roundingInc) {\n return BigInt(unitNanoMap[smallestUnit]) * BigInt(roundingInc);\n}\n\nfunction computeDayFloor(slots) {\n return combineDateAndTime(slots, timeFieldDefaults);\n}\n\nfunction roundDayTimeDurationByInc(durationFields, nanoInc, roundingMode) {\n const maxUnit = Math.min(getMaxDurationUnit(durationFields), 6);\n return nanoToDurationDayTimeFields(roundBigNanoToInc(durationDayTimeToBigNano(durationFields), BigInt(nanoInc), roundingMode), maxUnit);\n}\n\nfunction roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps, isZoned) {\n if (0 === smallestUnit && 1 === roundingInc) {\n return durationFields;\n }\n const sign = computeDurationSign(durationFields) || 1;\n const nudgeFunc = isUniformUnit(smallestUnit, isZoned) ? isZoned && smallestUnit < 6 && largestUnit >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;\n let [roundedDurationFields, roundedEpochNano, grewBigUnit] = nudgeFunc(sign, durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps);\n return grewBigUnit && 7 !== smallestUnit && (roundedDurationFields = ((durationFields, endEpochNano, largestUnit, smallestUnit, sign, relativeOps) => {\n for (let currentUnit = smallestUnit + 1; currentUnit <= largestUnit; currentUnit++) {\n if (7 === currentUnit && 7 !== largestUnit) {\n continue;\n }\n const baseDurationFields = clearDurationFields(currentUnit, durationFields);\n baseDurationFields[durationFieldNamesAsc[currentUnit]] += sign;\n const thresholdCompare = compareBigInts(endEpochNano, moveRelativeToEpochNano(relativeOps, baseDurationFields));\n if (thresholdCompare && thresholdCompare !== sign) {\n break;\n }\n durationFields = baseDurationFields;\n }\n return durationFields;\n })(roundedDurationFields, roundedEpochNano, largestUnit, Math.max(6, smallestUnit), sign, relativeOps)), \n roundedDurationFields;\n}\n\nfunction roundBigNanoToInc(bigNano, bigNanoInc, roundingMode) {\n return roundBigNanoToIncWithTail(bigNano, bigNanoInc, roundingMode, bigNano / bigNanoInc % 2n);\n}\n\nfunction roundBigNanoToDayOriginInc(bigNano, bigNanoInc, roundingMode) {\n const [day, timeNano] = divModFloorBigInt(bigNano, bigNanoInUtcDay);\n const dayOriginNano = day * bigNanoInUtcDay;\n return dayOriginNano + roundBigNanoToIncWithTail(timeNano, bigNanoInc, roundingMode, (dayOriginNano / bigNanoInc + timeNano / bigNanoInc) % 2n);\n}\n\nfunction roundBigNanoToIncWithTail(bigNano, bigNanoInc, roundingMode, quotientTail) {\n const quotient = bigNano / bigNanoInc;\n const remainder = bigNano % bigNanoInc;\n let fraction = 0;\n remainder && (fraction = fabricateNearHalfFraction(compareBigInts(2n * (remainder < 0n ? -remainder : remainder), bigNanoInc), Math.sign(Number(remainder))));\n const roundedTail = roundWithMode(Number(quotientTail) + fraction, roundingMode);\n return (quotient - quotientTail + BigInt(roundedTail)) * bigNanoInc;\n}\n\nfunction roundNumberToInc(num, roundingInc, roundingMode) {\n return roundWithMode(num / roundingInc, roundingMode) * roundingInc;\n}\n\nfunction roundWithMode(num, roundingMode) {\n return roundingModeFuncs[roundingMode](num);\n}\n\nfunction nudgeDayTimeDuration(sign, durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) {\n const bigNano = durationDayTimeToBigNano(durationFields);\n const roundedBigNano = roundBigNanoToInc(bigNano, computeBigNanoInc(smallestUnit, roundingInc), roundingMode);\n const nanoDiff = roundedBigNano - bigNano;\n const expandedBigUnit = Math.sign(Number(roundedBigNano / bigNanoInUtcDay) - Number(bigNano / bigNanoInUtcDay)) === sign;\n const roundedDayTimeFields = nanoToDurationDayTimeFields(roundedBigNano, Math.min(largestUnit, 6));\n return [ {\n ...durationFields,\n ...roundedDayTimeFields\n }, endEpochNano + nanoDiff, expandedBigUnit ];\n}\n\nfunction nudgeZonedTimeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps) {\n const timeNano = Number(durationTimeToBigNano(durationFields));\n const nanoInc = computeNanoInc(smallestUnit, roundingInc);\n let roundedTimeNano = roundNumberToInc(timeNano, nanoInc, roundingMode);\n const dayWindow = clampRelativeDuration({\n ...durationFields,\n ...durationTimeFieldDefaults\n }, 6, sign, relativeOps, endEpochNano);\n const dayEpochNano0 = dayWindow.ee;\n const dayEpochNano1 = dayWindow.te;\n const beyondDayNano = roundedTimeNano - Number(dayEpochNano1 - dayEpochNano0);\n let dayDelta = 0;\n beyondDayNano && Math.sign(beyondDayNano) !== sign ? endEpochNano = dayEpochNano0 + BigInt(roundedTimeNano) : (dayDelta += sign, \n roundedTimeNano = roundNumberToInc(beyondDayNano, nanoInc, roundingMode), endEpochNano = dayEpochNano1 + BigInt(roundedTimeNano));\n const durationTimeFields = nanoToDurationTimeFields(roundedTimeNano);\n return [ {\n ...durationFields,\n ...durationTimeFields,\n days: durationFields.days + dayDelta\n }, endEpochNano, Boolean(dayDelta) ];\n}\n\nfunction nudgeRelativeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps) {\n const smallestUnitFieldName = durationFieldNamesAsc[smallestUnit];\n const baseDurationFields = clearDurationFields(smallestUnit, durationFields);\n 7 === smallestUnit && (durationFields = {\n ...durationFields,\n weeks: durationFields.weeks + Math.trunc(durationFields.days / 7)\n });\n const truncedVal = divTrunc(durationFields[smallestUnitFieldName], roundingInc) * roundingInc;\n baseDurationFields[smallestUnitFieldName] = truncedVal;\n const nudgeWindow = clampRelativeDuration(baseDurationFields, smallestUnit, roundingInc * sign, relativeOps, endEpochNano);\n const epochNano0 = nudgeWindow.ee;\n const epochNano1 = nudgeWindow.te;\n const frac = computeEpochNanoFrac(endEpochNano, epochNano0, epochNano1);\n const windowStartVal = nudgeWindow.pe[smallestUnitFieldName];\n const windowEndVal = nudgeWindow.se[smallestUnitFieldName];\n const roundedVal = roundNumberToInc(windowStartVal + frac * sign * roundingInc, roundingInc, roundingMode);\n const roundedToEnd = roundedVal === windowEndVal;\n return baseDurationFields[smallestUnitFieldName] = roundedVal, [ baseDurationFields, roundedToEnd ? epochNano1 : epochNano0, nudgeWindow.Ae || roundedToEnd ];\n}\n\nfunction getTimeZoneTransitionEpochNanoseconds(slots, options) {\n return slots.timeZone.O(slots.epochNanoseconds, (options => {\n const normalizedOptions = normalizeOptionsOrString(options, \"direction\");\n const res = coerceDirection(normalizedOptions, 0);\n return res || throwRangeError(invalidEntity(\"direction\", res)), res;\n })(options));\n}\n\nconst zonedEpochSlotsToIso = /*@__PURE__*/ memoize(_zonedEpochSlotsToIso, WeakMap);\n\nfunction _zonedEpochSlotsToIso(slots) {\n const {epochNanoseconds: epochNanoseconds, timeZone: timeZone} = slots;\n const offsetNanoseconds = timeZone.B(epochNanoseconds);\n return {\n ...epochNanoToIsoDateTime(epochNanoseconds + BigInt(offsetNanoseconds)),\n offsetNanoseconds: offsetNanoseconds\n };\n}\n\nfunction getMatchingInstantFor(timeZone, isoDateTime, offsetNano, offsetDisambig = 0, epochDisambig = 0, epochFuzzy, hasZ) {\n if (void 0 !== offsetNano && 1 === offsetDisambig && (1 === offsetDisambig || hasZ)) {\n return isoDateTimeAndOffsetToEpochNano(isoDateTime, offsetNano);\n }\n 2 !== offsetDisambig && 0 !== offsetDisambig || checkIsoDateInBounds(isoDateTime, 0);\n const possibleEpochNanos = timeZone.N(isoDateTime);\n if (void 0 !== offsetNano && 3 !== offsetDisambig) {\n const matchingEpochNano = ((possibleEpochNanos, isoDateTime, offsetNano, fuzzy) => {\n const zonedEpochNano = isoDateTimeToEpochNano(isoDateTime);\n fuzzy && (offsetNano = roundToMinute(offsetNano));\n for (const possibleEpochNano of possibleEpochNanos) {\n let possibleOffsetNano = Number(zonedEpochNano - possibleEpochNano);\n if (fuzzy && (possibleOffsetNano = roundToMinute(possibleOffsetNano)), possibleOffsetNano === offsetNano) {\n return possibleEpochNano;\n }\n }\n })(possibleEpochNanos, isoDateTime, offsetNano, epochFuzzy);\n if (void 0 !== matchingEpochNano) {\n return matchingEpochNano;\n }\n 0 === offsetDisambig && throwRangeError(\"Invalid TimeZone offset\");\n }\n return hasZ ? isoDateTimeToEpochNano(isoDateTime) : getSingleInstantFor(timeZone, isoDateTime, epochDisambig, possibleEpochNanos);\n}\n\nfunction getSingleInstantFor(timeZone, isoDateTime, disambig = 0, possibleEpochNanos = timeZone.N(isoDateTime)) {\n if (1 === possibleEpochNanos.length) {\n return possibleEpochNanos[0];\n }\n if (1 === disambig && throwRangeError(\"Ambiguous offset\"), possibleEpochNanos.length) {\n return possibleEpochNanos[3 === disambig ? 1 : 0];\n }\n const zonedEpochNano = isoDateTimeToEpochNano(isoDateTime);\n const gapNano = ((timeZone, zonedEpochNano) => {\n const startOffsetNano = timeZone.B(zonedEpochNano - bigNanoInUtcDay);\n return (gapNano => (gapNano > nanoInUtcDay && throwRangeError(\"Out-of-bounds TimeZone gap\"), \n gapNano))(timeZone.B(zonedEpochNano + bigNanoInUtcDay) - startOffsetNano);\n })(timeZone, zonedEpochNano);\n const shiftedIsoDateTime = epochNanoToIsoDateTime(zonedEpochNano + BigInt(gapNano * (2 === disambig ? -1 : 1)));\n return (possibleEpochNanos = timeZone.N(shiftedIsoDateTime))[2 === disambig ? 0 : possibleEpochNanos.length - 1];\n}\n\nfunction getStartOfDayInstantFor(timeZone, isoDateTime) {\n const possibleEpochNanos = timeZone.N(isoDateTime);\n if (possibleEpochNanos.length) {\n return possibleEpochNanos[0];\n }\n const zonedEpochNanoDayBefore = isoDateTimeToEpochNano(isoDateTime) - bigNanoInUtcDay;\n return timeZone.O(zonedEpochNanoDayBefore, 1);\n}\n\nfunction moveYearMonth(doSubtract, calendar, isoDateFields, durationSlots, options) {\n const overflow = refineOverflowOptions(options);\n durationSlots.sign && getMaxDurationUnit(durationSlots) < 8 && throwRangeError(\"Cannot use small units\");\n const startOfMonthFields = checkIsoDateInBounds(moveToStartOfMonth(calendar, isoDateFields));\n return moveToStartOfMonth(calendar, dateAddWithOverflow(calendar, startOfMonthFields, doSubtract ? negateDurationFields(durationSlots) : durationSlots, overflow));\n}\n\nfunction moveEpochNano(epochNano, durationFields) {\n return checkEpochNanoInBounds(epochNano + (durationHasDateParts(fields = durationFields) && throwRangeError(\"Cannot use large units\"), \n durationTimeToBigNano(fields)));\n var fields;\n}\n\nfunction moveZonedEpochSlots(slots, durationFields, options) {\n const {calendar: calendar, epochNanoseconds: epochNano, timeZone: timeZone} = slots;\n const timeOnlyNano = durationTimeToBigNano(durationFields);\n let movedEpochNano = epochNano;\n if (durationHasDateParts(durationFields)) {\n const isoDateTime = zonedEpochSlotsToIso(slots);\n movedEpochNano = getSingleInstantFor(timeZone, combineDateAndTime(moveDate(calendar, isoDateTime, {\n ...durationFields,\n ...durationTimeFieldDefaults\n }, options), isoDateTime)) + timeOnlyNano;\n } else {\n movedEpochNano += timeOnlyNano, refineOverflowOptions(options);\n }\n return {\n ...slots,\n epochNanoseconds: checkEpochNanoInBounds(movedEpochNano)\n };\n}\n\nfunction moveDateTime(calendar, isoDateTimeFields, durationFields, options) {\n const [movedTimeFields, dayDelta] = moveTime(isoDateTimeFields, durationFields);\n return checkIsoDateTimeInBounds(combineDateAndTime(moveDate(calendar, isoDateTimeFields, {\n ...durationFields,\n ...durationTimeFieldDefaults,\n days: durationFields.days + dayDelta\n }, options), movedTimeFields));\n}\n\nfunction moveDate(calendar, isoDateFields, durationFields, options) {\n if (durationFields.years || durationFields.months || durationFields.weeks) {\n return dateAddWithOverflow(calendar, isoDateFields, durationFields, refineOverflowOptions(options));\n }\n refineOverflowOptions(options);\n const days = durationFields.days + Number(durationTimeToBigNano(durationFields) / bigNanoInUtcDay);\n return days ? checkIsoDateInBounds(moveByDays(isoDateFields, days)) : isoDateFields;\n}\n\nfunction moveToStartOfMonth(calendar, isoDateFields) {\n return moveByDays(isoDateFields, 1 - computeCalendarDateFields(calendar, isoDateFields).day);\n}\n\nfunction moveTime(timeFields, durationFields) {\n const durationBigNano = durationTimeToBigNano(durationFields);\n const durDays = Number(durationBigNano / bigNanoInUtcDay);\n const durTimeNano = Number(durationBigNano % bigNanoInUtcDay);\n const [newTimeFields, overflowDays] = nanoToTimeAndDay(timeFieldsToNano(timeFields) + durTimeNano);\n return [ newTimeFields, durDays + overflowDays ];\n}\n\nfunction moveByDays(isoDate, days) {\n return days ? epochDaysToIsoDate(isoDateToEpochDays(isoDate) + days) : isoDate;\n}\n\nfunction dateAddWithOverflow(calendar, isoDateFields, durationFields, overflow) {\n let {years: years, months: months, weeks: weeks, days: days} = durationFields;\n let isoDate;\n if (days += Number(durationTimeToBigNano(durationFields) / bigNanoInUtcDay), years || months) {\n isoDate = addDateMonths(calendar, isoDateFields, years, months, overflow);\n } else {\n if (!weeks && !days) {\n return isoDateFields;\n }\n isoDate = isoDateFields;\n }\n return (weeks || days) && (isoDate = moveByDays(isoDate, 7 * weeks + days)), checkIsoDateInBounds(isoDate);\n}\n\nfunction addCalendarMonths(calendar, year, month, monthDelta) {\n return calendar ? calendar.K(year, month, monthDelta) : addIsoMonths(year, month, monthDelta);\n}\n\nfunction addDateMonths(calendar, isoDateFields, years, months, overflow) {\n const dateParts = computeCalendarDateFields(calendar, isoDateFields);\n let {year: year, month: month, day: day} = dateParts;\n if (years) {\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n year += years, month = computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, calendar ? calendar.p(year) : void 0, overflow), \n month = clampEntity(\"month\", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);\n }\n if (months) {\n const yearMonthParts = calendar ? calendar.K(year, month, months) : addIsoMonths(year, month, months);\n ({year: year, month: month} = yearMonthParts);\n }\n return day = clampEntity(\"day\", day, 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow), \n computeCalendarIsoFieldsFromParts(calendar, year, month, day);\n}\n\nfunction computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, targetLeapMonth, overflow) {\n if (isLeapMonth) {\n const leapMonthMeta = calendar ? calendar.l : void 0;\n return void 0 !== targetLeapMonth && (leapMonthMeta < 0 || targetLeapMonth === monthCodeNumber + 1) ? targetLeapMonth : (1 === overflow && throwRangeError(invalidLeapMonth), \n leapMonthMeta < 0 ? -leapMonthMeta : monthCodeNumber);\n }\n return monthCodeNumberToMonth(monthCodeNumber, 0, targetLeapMonth);\n}\n\nfunction getCommonCalendar(a, b) {\n return getCalendarSlotId(a) !== getCalendarSlotId(b) && throwRangeError(\"Mismatching Calendars\"), \n a;\n}\n\nfunction getCommonTimeZone(a, b) {\n return a.m !== b.m && throwRangeError(\"Mismatching TimeZones\"), \n a;\n}\n\nfunction getZonedTimeZoneId(slots) {\n return slots.timeZone.id;\n}\n\nfunction diffInstants(invert, instantSlots0, instantSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 3, 5);\n const durationFields = diffEpochNanos(instantSlots0.epochNanoseconds, instantSlots1.epochNanoseconds, largestUnit, smallestUnit, roundingInc, roundingMode);\n return createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);\n}\n\nfunction diffZonedDateTimes(invert, calendar, slots0, slots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 5);\n const epochNano0 = slots0.epochNanoseconds;\n const epochNano1 = slots1.epochNanoseconds;\n let durationFields;\n if (compareBigInts(epochNano1, epochNano0)) {\n if (largestUnit < 6) {\n durationFields = diffEpochNanos(epochNano0, epochNano1, largestUnit, smallestUnit, roundingInc, roundingMode);\n } else {\n const timeZone = getCommonTimeZone(slots0.timeZone, slots1.timeZone);\n durationFields = diffZonedEpochsExact(timeZone, calendar, slots0, slots1, largestUnit), \n durationFields = roundRelativeDuration(durationFields, epochNano1, largestUnit, smallestUnit, roundingInc, roundingMode, createZonedRelativeOps(calendar, timeZone, slots0), 1);\n }\n } else {\n durationFields = durationFieldDefaults;\n }\n return createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);\n}\n\nfunction diffPlainDateTimes(invert, calendar, plainDateTimeSlots0, plainDateTimeSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 6);\n const startEpochNano = isoDateTimeToEpochNano(plainDateTimeSlots0);\n const endEpochNano = isoDateTimeToEpochNano(plainDateTimeSlots1);\n const sign = compareBigInts(endEpochNano, startEpochNano);\n let durationFields;\n return sign ? largestUnit <= 6 ? durationFields = diffEpochNanos(startEpochNano, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) : (durationFields = diffDateTimesBig(calendar, plainDateTimeSlots0, plainDateTimeSlots1, sign, largestUnit), \n durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createDateTimeRelativeOps(calendar, plainDateTimeSlots0))) : durationFields = durationFieldDefaults, \n createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);\n}\n\nfunction diffPlainDates(invert, calendar, plainDateSlots0, plainDateSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 6, 9, 6);\n return diffDateLike(invert, calendar, plainDateSlots0, plainDateSlots1, largestUnit, smallestUnit, roundingInc, roundingMode);\n}\n\nfunction diffPlainYearMonth(invert, calendar, plainYearMonthSlots0, plainYearMonthSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 9, 9, 8);\n const firstOfMonth0 = moveToStartOfMonth(calendar, plainYearMonthSlots0);\n const firstOfMonth1 = moveToStartOfMonth(calendar, plainYearMonthSlots1);\n return compareIsoDate(firstOfMonth0, firstOfMonth1) ? diffDateLike(invert, calendar, checkIsoDateInBounds(firstOfMonth0), checkIsoDateInBounds(firstOfMonth1), largestUnit, smallestUnit, roundingInc, roundingMode, 8) : createDurationSlots(durationFieldDefaults);\n}\n\nfunction diffDateLike(invert, calendar, startIsoDate, endIsoDate, largestUnit, smallestUnit, roundingInc, roundingMode, smallestPrecision = 6) {\n const startEpochNano = isoDateToEpochNano(startIsoDate);\n const endEpochNano = isoDateToEpochNano(endIsoDate);\n let durationFields;\n return compareBigInts(endEpochNano, startEpochNano) ? 6 === largestUnit ? durationFields = diffEpochNanos(startEpochNano, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) : (durationFields = diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit), \n smallestUnit === smallestPrecision && 1 === roundingInc || (durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createDateRelativeOps(calendar, startIsoDate)))) : durationFields = durationFieldDefaults, \n createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);\n}\n\nfunction diffPlainTimes(invert, plainTimeSlots0, plainTimeSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 5, 5);\n const timeDiffNano = roundNumberToInc(timeFieldsToNano(plainTimeSlots1) - timeFieldsToNano(plainTimeSlots0), computeNanoInc(smallestUnit, roundingInc), roundingMode);\n const durationFields = {\n ...durationFieldDefaults,\n ...nanoToDurationTimeFields(timeDiffNano, largestUnit)\n };\n return createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);\n}\n\nfunction diffZonedEpochsExact(timeZone, calendar, slots0, slots1, largestUnit) {\n const sign = compareBigInts(slots1.epochNanoseconds, slots0.epochNanoseconds);\n if (!sign) {\n return durationFieldDefaults;\n }\n if (largestUnit < 6) {\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(slots1.epochNanoseconds - slots0.epochNanoseconds, largestUnit)\n };\n }\n if (!compareIsoDate(zonedEpochSlotsToIso(slots0), zonedEpochSlotsToIso(slots1))) {\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(slots1.epochNanoseconds - slots0.epochNanoseconds, 5)\n };\n }\n const [isoFields0, isoFields1, remainderNano] = prepareZonedEpochDiff(timeZone, slots0, slots1, sign);\n return {\n ...6 === largestUnit ? {\n ...durationFieldDefaults,\n days: diffDays(isoFields0, isoFields1)\n } : diffCalendarDates(calendar, isoFields0, isoFields1, largestUnit),\n ...nanoToDurationTimeFields(remainderNano)\n };\n}\n\nfunction diffDateTimesExact(calendar, startIsoDateTime, endIsoDateTime, largestUnit) {\n const startEpochNano = isoDateTimeToEpochNano(startIsoDateTime);\n const endEpochNano = isoDateTimeToEpochNano(endIsoDateTime);\n const sign = compareBigInts(endEpochNano, startEpochNano);\n return sign ? largestUnit <= 6 ? {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(endEpochNano - startEpochNano, largestUnit)\n } : diffDateTimesBig(calendar, startIsoDateTime, endIsoDateTime, sign, largestUnit) : durationFieldDefaults;\n}\n\nfunction diffDateTimesBig(calendar, startIsoDateTime, endIsoDateTime, sign, largestUnit) {\n let diffEndDate = endIsoDateTime;\n let timeNano = timeFieldsToNano(endIsoDateTime) - timeFieldsToNano(startIsoDateTime);\n return Math.sign(timeNano) === -sign && (diffEndDate = moveByDays(endIsoDateTime, -sign), \n timeNano += nanoInUtcDay * sign), {\n ...diffCalendarDates(calendar, startIsoDateTime, diffEndDate, largestUnit),\n ...nanoToDurationTimeFields(timeNano)\n };\n}\n\nfunction diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit) {\n if (largestUnit <= 7) {\n const days = diffDays(startIsoDate, endIsoDate);\n return 7 === largestUnit ? {\n ...durationFieldDefaults,\n weeks: divTrunc(days, 7),\n days: modTrunc(days, 7)\n } : {\n ...durationFieldDefaults,\n days: days\n };\n }\n const yearMonthDayStart = computeCalendarDateFields(calendar, startIsoDate);\n const yearMonthDayEnd = computeCalendarDateFields(calendar, endIsoDate);\n if (8 === largestUnit) {\n const {year: year0, month: month0, day: day0} = yearMonthDayStart;\n const {year: year1, month: month1, day: day1} = yearMonthDayEnd;\n const sign = Math.sign(compareNumbers(year1, year0) || compareNumbers(month1, month0) || diffDays(startIsoDate, endIsoDate));\n let months = 0;\n let days = 0;\n if (sign) {\n months = calendar ? calendar._(year0, month0, year1, month1) : diffIsoMonthSlots(year0, month0, year1, month1);\n let anchorIsoDate = addDateMonths(calendar, startIsoDate, 0, months, 0);\n sign * compareNumbers(day0, day1) > 0 && (months -= sign, anchorIsoDate = addDateMonths(calendar, startIsoDate, 0, months, 0)), \n days = diffDays(anchorIsoDate, endIsoDate);\n }\n return {\n ...durationFieldDefaults,\n months: months,\n days: days\n };\n }\n const {year: year0, month: month0, day: day0} = yearMonthDayStart;\n let {year: year1, month: month1, day: day1} = yearMonthDayEnd;\n let yearDiff = year1 - year0;\n let monthDiff = month1 - month0;\n let dayDiff = day1 - day0;\n if (yearDiff || monthDiff) {\n const sign = Math.sign(yearDiff || monthDiff);\n let daysInMonth1 = computeCalendarDaysInMonthForYearMonth(calendar, year1, month1);\n let dayCorrect = 0;\n if (Math.sign(day1 - day0) === -sign) {\n const origDaysInMonth1 = daysInMonth1;\n const yearMonthParts = calendar ? calendar.K(year1, month1, -sign) : addIsoMonths(year1, month1, -sign);\n ({year: year1, month: month1} = yearMonthParts), yearDiff = year1 - year0, monthDiff = month1 - month0, \n daysInMonth1 = computeCalendarDaysInMonthForYearMonth(calendar, year1, month1), \n dayCorrect = sign < 0 ? -origDaysInMonth1 : daysInMonth1;\n }\n if (dayDiff = day1 - Math.min(day0, daysInMonth1) + dayCorrect, yearDiff) {\n const [monthCodeNumber0, isLeapMonth0] = computeCalendarMonthCodeParts(calendar, year0, month0);\n const [monthCodeNumber1, isLeapMonth1] = computeCalendarMonthCodeParts(calendar, year1, month1);\n const leapMonthMeta = calendar ? calendar.l : void 0;\n if (monthDiff = void 0 !== leapMonthMeta && isLeapMonth0 && !isLeapMonth1 && (leapMonthMeta < 0 ? sign > 0 && monthCodeNumber1 === -leapMonthMeta : sign < 0 && monthCodeNumber1 === monthCodeNumber0) ? 0 : monthCodeNumber1 - monthCodeNumber0 || Number(isLeapMonth1) - Number(isLeapMonth0), \n Math.sign(monthDiff) === -sign) {\n const monthCorrect = sign < 0 && -computeCalendarMonthsInYearForYear(calendar, year1);\n year1 -= sign, yearDiff = year1 - year0, monthDiff = month1 - computeYearMovedMonth(calendar, monthCodeNumber0, isLeapMonth0, calendar ? calendar.p(year1) : void 0, 0) + (monthCorrect || computeCalendarMonthsInYearForYear(calendar, year1));\n } else if (calendar) {\n const month0Projected = computeYearMovedMonth(calendar, monthCodeNumber0, isLeapMonth0, calendar.p(year1), 0);\n monthDiff = calendar._(year1, month0Projected, year1, month1);\n }\n }\n }\n return {\n ...durationFieldDefaults,\n years: yearDiff,\n months: monthDiff,\n days: dayDiff\n };\n}\n\nfunction compareIsoDate(isoDate0, isoDate1) {\n return compareNumbers(isoDate0.year, isoDate1.year) || compareNumbers(isoDate0.month, isoDate1.month) || compareNumbers(isoDate0.day, isoDate1.day);\n}\n\nfunction prepareZonedEpochDiff(timeZone, slots0, slots1, sign) {\n const startIsoDate = zonedEpochSlotsToIso(slots0);\n const endIsoDate = zonedEpochSlotsToIso(slots1);\n const endEpochNano = slots1.epochNanoseconds;\n let dayCorrection = 0;\n const timeDiffNano = timeFieldsToNano(endIsoDate) - timeFieldsToNano(startIsoDate);\n Math.sign(timeDiffNano) === -sign && dayCorrection++;\n const maxDayCorrection = dayCorrection + (sign > 0 ? 1 : 0);\n for (;dayCorrection <= maxDayCorrection; dayCorrection++) {\n const midIsoDate = moveByDays(endIsoDate, dayCorrection * -sign);\n const midEpochNano = getSingleInstantFor(timeZone, combineDateAndTime(midIsoDate, startIsoDate));\n if (compareBigInts(endEpochNano, midEpochNano) !== -sign) {\n return [ startIsoDate, midIsoDate, Number(endEpochNano - midEpochNano) ];\n }\n }\n}\n\nfunction diffEpochNanos(startEpochNano, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) {\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(roundBigNanoToInc(endEpochNano - startEpochNano, computeBigNanoInc(smallestUnit, roundingInc), roundingMode), largestUnit)\n };\n}\n\nfunction diffDays(startIsoDate, endIsoDate) {\n return isoDateToEpochDays(endIsoDate) - isoDateToEpochDays(startIsoDate);\n}\n\nfunction createDateRelativeOps(calendar, origin) {\n return {\n origin: origin,\n ie: isoDateToEpochNano(origin),\n calendar: calendar,\n he: isoDateToEpochNano\n };\n}\n\nfunction createDateTimeRelativeOps(calendar, origin) {\n return {\n origin: origin,\n ie: isoDateTimeToEpochNano(origin),\n calendar: calendar,\n he: movedIsoDate => isoDateTimeToEpochNano(combineDateAndTime(movedIsoDate, origin))\n };\n}\n\nfunction createZonedRelativeOps(calendar, timeZone, slots) {\n const origin = zonedEpochSlotsToIso(slots);\n return {\n origin: origin,\n ie: slots.epochNanoseconds,\n calendar: calendar,\n he: movedIsoDate => getSingleInstantFor(timeZone, combineDateAndTime(movedIsoDate, origin))\n };\n}\n\nfunction moveRelativeToEpochNano(relativeOps, dateDuration) {\n return durationHasDateParts(dateDuration) ? relativeOps.he(moveDate(relativeOps.calendar, relativeOps.origin, dateDuration)) : relativeOps.ie;\n}\n\nfunction spanRelativeDuration(relativeToSlots, durationFields, largestUnit) {\n const {calendar: calendar} = relativeToSlots;\n if (isZonedEpochSlots(relativeToSlots)) {\n const {timeZone: timeZone} = relativeToSlots;\n const endSlots = moveZonedEpochSlots(relativeToSlots, durationFields);\n return [ diffZonedEpochsExact(timeZone, calendar, relativeToSlots, endSlots, largestUnit), endSlots.epochNanoseconds, createZonedRelativeOps(calendar, timeZone, relativeToSlots) ];\n }\n const origin = checkIsoDateTimeInBounds(combineDateAndTime(relativeToSlots, timeFieldDefaults));\n const end = moveDateTime(calendar, origin, durationFields);\n return [ diffDateTimesExact(calendar, origin, end, largestUnit), isoDateTimeToEpochNano(end), createDateRelativeOps(calendar, relativeToSlots) ];\n}\n\nfunction moveRelativeEndpointToEpochNano(relativeToSlots, durationFields) {\n return isZonedEpochSlots(relativeToSlots) ? moveZonedEpochSlots(relativeToSlots, durationFields).epochNanoseconds : isoDateTimeToEpochNano(moveDateTime(relativeToSlots.calendar, combineDateAndTime(relativeToSlots, timeFieldDefaults), durationFields));\n}\n\nfunction isZonedEpochSlots(slots) {\n return \"timeZone\" in slots;\n}\n\nfunction isUniformUnit(unit, isZoned) {\n return unit <= 6 - (isZoned ? 1 : 0);\n}\n\nfunction nanoToGivenFields(nano, largestUnit, fieldNames) {\n const fields = {};\n for (let unit = largestUnit; unit >= 0; unit--) {\n const divisor = unitNanoMap[unit];\n fields[fieldNames[unit]] = divTrunc(nano, divisor), nano = modTrunc(nano, divisor);\n }\n return fields;\n}\n\nconst maxDurationSeconds = 2 ** 53;\n\nfunction addDurations(refineRelativeTo, doSubtract, slots, otherSlots, options) {\n const relativeToSlots = refineRelativeTo(normalizeOptions(options).relativeTo);\n const maxUnit = Math.max(getMaxDurationUnit(slots), getMaxDurationUnit(otherSlots));\n return isUniformUnit(maxUnit, relativeToSlots && isZonedEpochSlots(relativeToSlots)) ? addDayTimeDurationsChecked(doSubtract, slots, otherSlots, maxUnit) : (relativeToSlots || throwRangeError(\"Missing relativeTo\"), \n doSubtract && (otherSlots = negateDurationFields(otherSlots)), createDurationSlots(((relativeToSlots, durationFields0, durationFields1, largestUnit) => {\n const {calendar: calendar} = relativeToSlots;\n if (isZonedEpochSlots(relativeToSlots)) {\n const {timeZone: timeZone} = relativeToSlots;\n const midSlots = moveZonedEpochSlots(relativeToSlots, durationFields0);\n return diffZonedEpochsExact(timeZone, calendar, relativeToSlots, moveZonedEpochSlots(midSlots, durationFields1), largestUnit);\n }\n const origin = combineDateAndTime(relativeToSlots, timeFieldDefaults);\n const mid = moveDateTime(calendar, origin, durationFields0);\n return diffDateTimesExact(calendar, origin, moveDateTime(calendar, mid, durationFields1), largestUnit);\n })(relativeToSlots, slots, otherSlots, maxUnit)));\n}\n\nfunction addDurationsWithoutRelativeTo(doSubtract, slots, otherSlots) {\n const maxUnit = Math.max(getMaxDurationUnit(slots), getMaxDurationUnit(otherSlots));\n return maxUnit > 6 && throwRangeError(\"Cannot use large units\"), addDayTimeDurationsChecked(doSubtract, slots, otherSlots, maxUnit);\n}\n\nfunction addDayTimeDurationsChecked(doSubtract, slots, otherSlots, maxUnit) {\n return createDurationSlots(validateDurationFields(((a, b, largestUnit, doSubtract) => {\n const combined = durationDayTimeToBigNano(a) + durationDayTimeToBigNano(b) * BigInt(doSubtract ? -1 : 1);\n return Number.isFinite(Number(combined / bigNanoInUtcDay)) || throwRangeError(outOfBoundsDate), \n {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(combined, largestUnit)\n };\n })(slots, otherSlots, maxUnit, doSubtract)));\n}\n\nfunction roundDuration(refineRelativeTo, slots, options) {\n const durationLargestUnit = getMaxDurationUnit(slots);\n const [largestUnit, smallestUnit, roundingInc, roundingMode, relativeToSlots] = ((options, defaultLargestUnit, refineRelativeTo) => {\n options = normalizeOptionsOrString(options, smallestUnitStr);\n let largestUnit = coerceLargestUnit(options);\n const relativeToInternals = refineRelativeTo(options.relativeTo);\n let roundingInc = coerceRoundingIncInteger(options);\n const roundingMode = coerceRoundingMode(options, 7);\n let smallestUnit = coerceSmallestUnit(options);\n return void 0 === largestUnit && void 0 === smallestUnit && throwRangeError(\"Required smallestUnit or largestUnit\"), \n null == smallestUnit && (smallestUnit = 0), null == largestUnit && (largestUnit = Math.max(smallestUnit, defaultLargestUnit)), \n checkLargestSmallestUnit(largestUnit, smallestUnit), roundingInc = validateRoundingInc(roundingInc, smallestUnit, 1), \n roundingInc > 1 && smallestUnit > 5 && largestUnit !== smallestUnit && throwRangeError(\"For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit\"), \n [ largestUnit, smallestUnit, roundingInc, roundingMode, relativeToInternals ];\n })(options, durationLargestUnit, refineRelativeTo);\n if (!relativeToSlots && Math.max(durationLargestUnit, largestUnit) <= 6) {\n return createDurationSlots(validateDurationFields(((durationFields, largestUnit, smallestUnit, roundingInc, roundingMode) => {\n const roundedBigNano = roundBigNanoToInc(durationDayTimeToBigNano(durationFields), computeBigNanoInc(smallestUnit, roundingInc), roundingMode);\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(roundedBigNano, largestUnit)\n };\n })(slots, largestUnit, smallestUnit, roundingInc, roundingMode)));\n }\n const isZoned = relativeToSlots && isZonedEpochSlots(relativeToSlots);\n const needsZonedDayLength = isZoned && largestUnit >= 6 && smallestUnit < 6;\n if (!slots.sign && !needsZonedDayLength) {\n return slots;\n }\n relativeToSlots || throwRangeError(\"Missing relativeTo\");\n const [balancedDuration, endEpochNano, relativeOps] = spanRelativeDuration(relativeToSlots, slots, largestUnit);\n return createDurationSlots(roundRelativeDuration(balancedDuration, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps, isZoned));\n}\n\nfunction absDuration(slots) {\n return -1 === slots.sign ? negateDuration(slots) : slots;\n}\n\nfunction negateDuration(slots) {\n return createDurationSlots(negateDurationFields(slots));\n}\n\nfunction negateDurationFields(fields) {\n const res = {};\n for (const fieldName of durationFieldNamesAsc) {\n res[fieldName] = -1 * fields[fieldName] || 0;\n }\n return res;\n}\n\nfunction computeDurationSign(fields, fieldNames = durationFieldNamesAsc) {\n let sign = 0;\n for (const fieldName of fieldNames) {\n const fieldSign = Math.sign(fields[fieldName]);\n fieldSign && (sign && sign !== fieldSign && throwRangeError(\"Cannot mix duration signs\"), \n sign = fieldSign);\n }\n return sign;\n}\n\nfunction validateDurationFields(fields) {\n for (const calendarUnit of durationCalendarFieldNamesAsc) {\n clampEntity(calendarUnit, fields[calendarUnit], -4294967295, 4294967295, 1);\n }\n const bigNano = durationDayTimeToBigNano(fields);\n return validateDurationTimeUnit(Number(bigNano / bigNanoInSec)), fields;\n}\n\nfunction validateDurationTimeUnit(n) {\n Number.isSafeInteger(n) || throwRangeError(\"Out-of-bounds duration\");\n}\n\nfunction durationDayTimeToBigNano(fields) {\n return BigInt(fields.days) * bigNanoInUtcDay + durationTimeToBigNano(fields);\n}\n\nfunction durationTimeToBigNano(fields) {\n return BigInt(fields.hours) * bigNanoInHour + BigInt(fields.minutes) * bigNanoInMinute + durationSubMinuteToBigNano(fields);\n}\n\nfunction durationSubMinuteToBigNano(fields) {\n return BigInt(fields.seconds) * bigNanoInSec + BigInt(fields.milliseconds) * bigNanoInMilli + BigInt(fields.microseconds) * bigNanoInMicro + BigInt(fields.nanoseconds);\n}\n\nfunction nanoToDurationDayTimeFields(bigNano, largestUnit = 6) {\n const days = Number(bigNano / bigNanoInUtcDay);\n const timeNano = Number(bigNano % bigNanoInUtcDay);\n const unitNano = unitNanoMap[largestUnit];\n const largestUnitVal = largestUnit <= 3 ? Number(bigNano / BigInt(unitNano)) : days * (nanoInUtcDay / unitNano) + divTrunc(timeNano, unitNano);\n Number.isFinite(largestUnitVal) || throwRangeError(outOfBoundsDate), largestUnit <= 3 && Math.abs(largestUnitVal) / (nanoInSec / unitNanoMap[largestUnit]) >= maxDurationSeconds && throwRangeError(outOfBoundsDate);\n const dayTimeFields = nanoToGivenFields(timeNano, largestUnit, durationFieldNamesAsc);\n return dayTimeFields[durationFieldNamesAsc[largestUnit]] = largestUnitVal, dayTimeFields;\n}\n\nfunction nanoToDurationTimeFields(nano, largestUnit = 5) {\n return nanoToGivenFields(nano, largestUnit, durationFieldNamesAsc);\n}\n\nfunction durationHasDateParts(fields) {\n return Boolean(computeDurationSign(fields, durationDateFieldNamesAsc));\n}\n\nfunction getMaxDurationUnit(fields) {\n let unit = 9;\n for (;unit > 0 && !fields[durationFieldNamesAsc[unit]]; unit--) {}\n return unit;\n}\n\nfunction compareZonedEpochSlots(zonedEpochSlots0, zonedEpochSlots1) {\n return compareBigInts(zonedEpochSlots0.epochNanoseconds, zonedEpochSlots1.epochNanoseconds);\n}\n\nfunction compareDurations(refineRelativeTo, durationSlots0, durationSlots1, options) {\n const relativeToSlots = refineRelativeTo(normalizeOptions(options).relativeTo);\n const maxUnit = Math.max(getMaxDurationUnit(durationSlots0), getMaxDurationUnit(durationSlots1));\n return allPropsEqual(durationFieldNamesAsc, durationSlots0, durationSlots1) ? 0 : isUniformUnit(maxUnit, relativeToSlots && isZonedEpochSlots(relativeToSlots)) ? compareBigInts(durationDayTimeToBigNano(durationSlots0), durationDayTimeToBigNano(durationSlots1)) : (relativeToSlots || throwRangeError(\"Missing relativeTo\"), \n compareBigInts(moveRelativeEndpointToEpochNano(relativeToSlots, durationSlots0), moveRelativeEndpointToEpochNano(relativeToSlots, durationSlots1)));\n}\n\nfunction compareIsoDateTimeFields(isoDateTime0, isoDateTime1) {\n return compareIsoDateFields(isoDateTime0, isoDateTime1) || compareTimeFields(isoDateTime0, isoDateTime1);\n}\n\nfunction compareIsoDateFields(isoFields0, isoFields1) {\n return compareNumbers(isoDateToEpochDays(isoFields0), isoDateToEpochDays(isoFields1));\n}\n\nfunction compareTimeFields(isoFields0, isoFields1) {\n return compareNumbers(timeFieldsToNano(isoFields0), timeFieldsToNano(isoFields1));\n}\n\nfunction instantsEqual(instantSlots0, instantSlots1) {\n return !compareZonedEpochSlots(instantSlots0, instantSlots1);\n}\n\nfunction zonedDateTimesEqual(zonedDateTimeSlots0, zonedDateTimeSlots1) {\n return !compareZonedEpochSlots(zonedDateTimeSlots0, zonedDateTimeSlots1) && zonedDateTimeSlots0.timeZone.m === zonedDateTimeSlots1.timeZone.m && zonedDateTimeSlots0.calendar === zonedDateTimeSlots1.calendar;\n}\n\nfunction plainDateTimesEqual(plainDateTimeSlots0, plainDateTimeSlots1) {\n return !compareIsoDateTimeFields(plainDateTimeSlots0, plainDateTimeSlots1) && plainDateTimeSlots0.calendar === plainDateTimeSlots1.calendar;\n}\n\nfunction plainDatesEqual(plainDateSlots0, plainDateSlots1) {\n return !compareIsoDateFields(plainDateSlots0, plainDateSlots1) && plainDateSlots0.calendar === plainDateSlots1.calendar;\n}\n\nfunction plainYearMonthsEqual(plainYearMonthSlots0, plainYearMonthSlots1) {\n return !compareIsoDateFields(plainYearMonthSlots0, plainYearMonthSlots1) && plainYearMonthSlots0.calendar === plainYearMonthSlots1.calendar;\n}\n\nfunction plainMonthDaysEqual(plainMonthDaySlots0, plainMonthDaySlots1) {\n return !compareIsoDateFields(plainMonthDaySlots0, plainMonthDaySlots1) && plainMonthDaySlots0.calendar === plainMonthDaySlots1.calendar;\n}\n\nfunction plainTimesEqual(plainTimeSlots0, plainTimeSlots1) {\n return !compareTimeFields(plainTimeSlots0, plainTimeSlots1);\n}\n\nfunction getCalendarEraOrigins(calendar) {\n return 0 === calendar ? gregoryEraOrigins : calendar ? calendar.k : void 0;\n}\n\nfunction getCalendarFieldNames(calendar, fieldNames, fieldNamesWithEra = fieldNames) {\n return getCalendarEraOrigins(calendar) ? fieldNamesWithEra : fieldNames;\n}\n\nfunction resolveCalendarYear(calendar, fields) {\n const exoticCalendar = calendar || void 0;\n const eraOrigins = getCalendarEraOrigins(calendar);\n let {era: era, eraYear: eraYear, year: year} = fields;\n if (void 0 !== year && (year = toIntegerWithTrunc(year, \"year\")), void 0 !== eraYear && (eraYear = toIntegerWithTrunc(eraYear, \"eraYear\")), \n void 0 !== era || void 0 !== eraYear) {\n void 0 !== era && void 0 !== eraYear || throwTypeError(\"Mismatching era/eraYear\"), \n eraOrigins || throwRangeError(\"Forbidden era/eraYear\");\n const normalizedEra = normalizeEraName(era);\n const eraOrigin = eraOrigins[normalizedEra];\n void 0 === eraOrigin && throwRangeError((era => `Invalid era: ${era}`)(era));\n const yearByEra = exoticCalendar?.$ ? exoticCalendar.$(eraYear, normalizedEra, eraOrigin) : eraYearToYear(eraYear, eraOrigin);\n void 0 !== year && year !== yearByEra && throwRangeError(\"Mismatching year/eraYear\"), \n year = yearByEra;\n } else {\n void 0 === year && throwTypeError(missingYear(eraOrigins));\n }\n return year;\n}\n\nfunction resolveCalendarMonth(calendar, fields, year, overflow, monthCodeParts) {\n let {month: month, monthCode: monthCode} = fields;\n if (void 0 !== monthCode) {\n const monthByCode = ((calendar, monthCode, year, overflow, monthCodeParts = parseMonthCode(monthCode)) => {\n const leapMonth = calendar ? calendar.p(year) : void 0;\n const [monthCodeNumber, wantsLeapMonth] = monthCodeParts;\n let month = monthCodeNumberToMonth(monthCodeNumber, wantsLeapMonth, leapMonth);\n if (wantsLeapMonth) {\n const leapMonthMeta = calendar ? calendar.l : void 0;\n void 0 === leapMonthMeta && throwRangeError(invalidLeapMonth), leapMonthMeta > 0 ? (month > leapMonthMeta && throwRangeError(invalidLeapMonth), \n leapMonth !== month && (1 === overflow && throwRangeError(invalidLeapMonth), month = monthCodeNumberToMonth(monthCodeNumber, 0, leapMonth))) : (month !== -leapMonthMeta && throwRangeError(invalidLeapMonth), \n void 0 === leapMonth && 1 === overflow && throwRangeError(invalidLeapMonth));\n }\n return month;\n })(calendar, monthCode, year, overflow, monthCodeParts);\n void 0 !== month && month !== monthByCode && throwRangeError(\"Mismatching month/monthCode\"), \n month = monthByCode, overflow = 1;\n } else {\n void 0 === month && throwTypeError(\"Missing month/monthCode\");\n }\n return clampEntity(\"month\", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);\n}\n\nfunction resolveCalendarDay(calendar, fields, month, year, overflow) {\n return clampProp(fields, \"day\", 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow);\n}\n\nfunction eraYearToYear(eraYear, eraOrigin) {\n return (eraOrigin + eraYear) * (Math.sign(eraOrigin) || 1) || 0;\n}\n\nfunction resolveTimeFields(fields, overflow) {\n return constrainTimeFields(pluckProps(timeFieldNamesAsc, {\n ...timeFieldDefaults,\n ...fields\n }), overflow);\n}\n\nconst offsetRegExp = /*@__PURE__*/ createRegExp(\"([+-])(\\\\d{2})(?::?(\\\\d{2})(?::?(\\\\d{2})(?:[.,](\\\\d{1,9}))?)?)?\");\n\nfunction parseOffsetNano(s) {\n const offsetNano = parseOffsetNanoMaybe(s);\n return void 0 === offsetNano && throwRangeError(failedParse(s)), offsetNano;\n}\n\nfunction parseOffsetNanoMaybe(s, onlyHourMinute) {\n const parts = offsetRegExp.exec(s);\n if (parts && (s => (s => {\n \"T\" !== s[0] && \"t\" !== s[0] || (s = s.slice(1));\n const fractionIndex = s.search(/[.,]/);\n const main = fractionIndex < 0 ? s : s.slice(0, fractionIndex);\n const parts = main.split(\":\");\n return 1 === parts.length ? /^(?:\\d{2}|\\d{4}|\\d{6})$/i.test(main) : (2 === parts.length || 3 === parts.length) && parts.every(part => 2 === part.length && /^\\d{2}$/i.test(part));\n })(s.slice(1)))(parts[0])) {\n return ((parts, onlyHourMinute) => {\n const firstSubMinutePart = parts[4] || parts[5];\n onlyHourMinute && firstSubMinutePart && throwRangeError(invalidSubstring(firstSubMinutePart));\n const offsetNanoPos = parseInt0(parts[2]) * nanoInHour + parseInt0(parts[3]) * nanoInMinute + parseInt0(parts[4]) * nanoInSec + parseSubsecNano(parts[5] || \"\");\n return offsetNano = offsetNanoPos * parseSign(parts[1]), Math.abs(offsetNano) >= nanoInUtcDay && throwRangeError(\"Out-of-bounds offset\"), \n offsetNano;\n var offsetNano;\n })(parts, onlyHourMinute);\n }\n}\n\nconst dateFieldRefiners = {\n era: toStringViaPrimitive,\n month: toPositiveIntegerWithTruncation,\n monthCode(monthCode, entityName) {\n if (\"string\" == typeof monthCode) {\n return monthCode;\n }\n if (monthCode && \"object\" == typeof monthCode) {\n const monthCodeToString = monthCode.toString;\n if (\"function\" == typeof monthCodeToString) {\n return requireString(monthCodeToString.call(monthCode), entityName);\n }\n }\n return requireString(monthCode, entityName);\n },\n day: toPositiveIntegerWithTruncation\n};\n\nconst timeFieldRefiners = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, toIntegerWithTrunc);\n\nconst durationFieldRefiners = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, toStrictInteger);\n\nconst dateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateFieldRefiners, timeFieldRefiners);\n\nconst zonedDateTimeFieldRefiners = {\n offset(offsetString) {\n return parseOffsetNano(toStringViaPrimitive(offsetString));\n },\n ...dateTimeFieldRefiners\n};\n\nfunction readAndRefineBagFields(bag, validFieldNames, fieldRefiners, requiredFieldNames, disallowEmpty = !requiredFieldNames) {\n const res = {};\n let anyMatching = 0;\n for (const fieldName of validFieldNames) {\n let fieldVal = bag[fieldName];\n if (void 0 !== fieldVal) {\n anyMatching = 1;\n const refiner = fieldRefiners[fieldName];\n refiner && (fieldVal = refiner(fieldVal, fieldName)), res[fieldName] = fieldVal;\n } else {\n requiredFieldNames && requiredFieldNames.includes(fieldName) && throwTypeError(missingField(fieldName));\n }\n }\n return disallowEmpty && !anyMatching && throwTypeError(noValidFields(validFieldNames)), \n res;\n}\n\nfunction createPlainDateTimeFromRefinedFields(isoDate, time = timeFieldDefaults, calendar) {\n const isoDateTime = combineDateAndTime(isoDate, time);\n return checkIsoDateTimeInBounds(isoDateTime), createDateTimeSlots(isoDateTime, calendar);\n}\n\nfunction createPlainDateFromFields(calendar, fields, options) {\n return createPlainDateFromPreparedFields(calendar, fields, prepareDateFields(calendar, fields), refineOverflowOptions(options));\n}\n\nfunction createPlainDateFromFieldsWithOptionsRefiner(calendar, fields, refineOptions) {\n const prepared = prepareDateFields(calendar, fields);\n const refinedOptions = refineOptions();\n return [ createPlainDateFromPreparedFields(calendar, fields, prepared, refinedOptions[0]), ...refinedOptions ];\n}\n\nfunction createPlainDateFromPreparedFields(calendar, fields, prepared, overflow) {\n const year = prepared[1];\n const month = resolveCalendarMonth(calendar, fields, year, overflow, prepared[0]);\n return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, resolveCalendarDay(calendar, fields, month, year, overflow))), calendar);\n}\n\nfunction parseMonthCodeField(fields) {\n if (void 0 !== fields.monthCode) {\n return parseMonthCode(fields.monthCode);\n }\n}\n\nfunction prepareDateFields(calendar, fields) {\n const eraOrigins = getCalendarEraOrigins(calendar);\n return void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins)), \n void 0 === fields.monthCode && void 0 === fields.month && throwTypeError(\"Missing month/monthCode\"), \n void 0 === fields.day && throwTypeError(missingField(\"day\")), [ parseMonthCodeField(fields), resolveCalendarYear(calendar, fields) ];\n}\n\nfunction createPlainYearMonthFromFields(calendar, fields, options) {\n const eraOrigins = getCalendarEraOrigins(calendar);\n void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins)), \n void 0 === fields.monthCode && void 0 === fields.month && throwTypeError(\"Missing month/monthCode\");\n const monthCodeParts = parseMonthCodeField(fields);\n const year = resolveCalendarYear(calendar, fields);\n return createDateSlots(checkIsoYearMonthInBounds(computeCalendarIsoFieldsFromParts(calendar, year, resolveCalendarMonth(calendar, fields, year, refineOverflowOptions(options), monthCodeParts), 1)), calendar);\n}\n\nfunction createPlainMonthDayFromFields(calendar, fields, options) {\n const isIso = calendar === isoCalendarImpl;\n const eraOrigins = getCalendarEraOrigins(calendar);\n void 0 === fields.day && throwTypeError(missingField(\"day\")), isIso || void 0 === fields.month || void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins));\n const monthCodeParts = parseMonthCodeField(fields);\n let yearMaybe = void 0 !== fields.eraYear || void 0 !== fields.year ? resolveCalendarYear(calendar, fields) : void 0;\n const overflow = refineOverflowOptions(options);\n let day;\n let monthCodeNumber;\n let isLeapMonth;\n if (void 0 === yearMaybe && isIso && (yearMaybe = 1972), void 0 !== yearMaybe) {\n isIso || checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, yearMaybe, 1, 1));\n const month = resolveCalendarMonth(calendar, fields, yearMaybe, overflow, monthCodeParts);\n day = resolveCalendarDay(calendar, fields, month, yearMaybe, overflow), [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, yearMaybe, month);\n } else {\n void 0 === fields.monthCode && throwTypeError(\"Missing month/monthCode\"), [monthCodeNumber, isLeapMonth] = monthCodeParts;\n const referenceYear = calendar ? calendar.ne : 1972;\n if (void 0 !== referenceYear) {\n day = resolveCalendarDay(calendar, fields, resolveCalendarMonth(calendar, fields, referenceYear, overflow, monthCodeParts), referenceYear, overflow);\n } else {\n const constrainedDay = 0 === overflow && calendar ? calendar.fe?.(monthCodeNumber, isLeapMonth, fields.day) : void 0;\n day = void 0 !== constrainedDay ? constrainedDay : fields.day;\n }\n }\n isLeapMonth && ((calendar && calendar.U?.[monthCodeNumber]) ?? 1 / 0) < fields.day && (1 === overflow && throwRangeError(invalidLeapMonth), \n isLeapMonth = 0, day = constrainToRange(fields.day, 1, (calendar && calendar.R) ?? 1 / 0));\n let res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));\n for (;!res && 0 === overflow && day > 1; ) {\n day--, res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));\n }\n res || throwRangeError(\"Cannot guess year\");\n const {year: finalYear, month: finalMonth} = res;\n return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, finalYear, finalMonth, day)), calendar);\n}\n\nconst RawDateTimeFormat = Intl.DateTimeFormat;\n\nfunction formatEpochMilliToPartsRecord(intlFormat, epochMilli) {\n epochMilli < -864e13 && throwRangeError(outOfBoundsDate);\n const parts = intlFormat.formatToParts(epochMilli);\n const hash = {};\n for (const part of parts) {\n hash[part.type] = part.value;\n }\n return hash;\n}\n\nconst utcTimeZoneId = \"UTC\";\n\nconst timeZonePeriodDaysByName = {\n \"El_Aaiun\": 17,\n \"Tucuman\": 12,\n \"Tirane\": 11,\n \"Riga\": 10,\n \"Simferopol\": 9,\n \"Vienna\": 9,\n \"Tunis\": 8,\n \"Boa_Vista\": 6,\n \"Fortaleza\": 6,\n \"Maceio\": 6,\n \"Noronha\": 6,\n \"Recife\": 6,\n \"Gaza\": 6,\n \"Hebron\": 6,\n \"DeNoronha\": 6\n};\n\nconst minPossibleTransitionSec = -388152e4;\n\nfunction refineTimeDisplayTuple(options, maxSmallestUnit = 4) {\n const subsecDigits = coerceFractionalSecondDigits(options);\n const roundingMode = coerceRoundingMode(options, 4);\n const smallestUnit = coerceSmallestUnit(options);\n return [ roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, maxSmallestUnit), subsecDigits) ];\n}\n\nfunction refineDateDisplayOptions(options) {\n return coerceCalendarDisplay(normalizeOptions(options));\n}\n\nfunction refineTimeDisplayOptions(options, maxSmallestUnit) {\n return refineTimeDisplayTuple(normalizeOptions(options), maxSmallestUnit);\n}\n\nfunction resolveSmallestUnitAndSubsecDigits(smallestUnit, subsecDigits) {\n return null != smallestUnit ? [ unitNanoMap[smallestUnit], smallestUnit < 4 ? 9 - 3 * smallestUnit : -1 ] : [ void 0 === subsecDigits ? 1 : 10 ** (9 - subsecDigits), subsecDigits ];\n}\n\nfunction formatInstantIso(refineTimeZoneString, instantSlots, options) {\n const [timeZoneArg, roundingMode, nanoInc, subsecDigits] = (options => {\n const subsecDigits = coerceFractionalSecondDigits(options = normalizeOptions(options));\n const roundingMode = coerceRoundingMode(options, 4);\n const smallestUnit = coerceSmallestUnit(options);\n return [ options.timeZone, roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, 4), subsecDigits) ];\n })(options);\n const providedTimeZone = void 0 !== timeZoneArg;\n return ((providedTimeZone, timeZone, epochNano, roundingMode, nanoInc, subsecDigits) => {\n epochNano = roundBigNanoToDayOriginInc(epochNano, BigInt(nanoInc), roundingMode);\n const offsetNano = timeZone.B(epochNano);\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(epochNano + BigInt(offsetNano)), subsecDigits) + (providedTimeZone ? formatOffsetNano(roundToMinute(offsetNano)) : \"Z\");\n })(providedTimeZone, queryTimeZone(providedTimeZone ? refineTimeZoneString(timeZoneArg) : \"UTC\"), instantSlots.epochNanoseconds, roundingMode, nanoInc, subsecDigits);\n}\n\nfunction formatInstantIsoAuto(instantSlots) {\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(instantSlots.epochNanoseconds), void 0) + \"Z\";\n}\n\nfunction formatZonedDateTimeIso(zonedDateTimeSlots0, options) {\n const displayOptions = (options => {\n options = normalizeOptions(options);\n const calendarDisplay = coerceCalendarDisplay(options);\n const subsecDigits = coerceFractionalSecondDigits(options);\n const offsetDisplay = coerceOffsetDisplay(options);\n const roundingMode = coerceRoundingMode(options, 4);\n const smallestUnit = coerceSmallestUnit(options);\n return [ calendarDisplay, coerceTimeZoneDisplay(options), offsetDisplay, roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, 4), subsecDigits) ];\n })(options);\n return ((calendar, timeZoneId, timeZone, epochNano, calendarDisplay, timeZoneDisplay, offsetDisplay, roundingMode, nanoInc, subsecDigits) => {\n epochNano = roundBigNanoToDayOriginInc(epochNano, BigInt(nanoInc), roundingMode);\n const offsetNano = timeZone.B(epochNano);\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(epochNano + BigInt(offsetNano)), subsecDigits) + formatOffsetNano(roundToMinute(offsetNano), offsetDisplay) + formatTimeZone(timeZoneId, timeZoneDisplay) + formatCalendar(calendar, calendarDisplay);\n })(zonedDateTimeSlots0.calendar, zonedDateTimeSlots0.timeZone.id, zonedDateTimeSlots0.timeZone, zonedDateTimeSlots0.epochNanoseconds, ...displayOptions);\n}\n\nfunction formatZonedDateTimeIsoAuto(zonedDateTimeSlots) {\n const calendar = zonedDateTimeSlots.calendar;\n const timeZone = zonedDateTimeSlots.timeZone;\n const offsetNano = timeZone.B(zonedDateTimeSlots.epochNanoseconds);\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(zonedDateTimeSlots.epochNanoseconds + BigInt(offsetNano)), void 0) + formatOffsetNano(roundToMinute(offsetNano)) + formatTimeZone(timeZone.id, 0) + (calendar === isoCalendarImpl ? \"\" : formatCalendarId(getCalendarSlotId(calendar), 0));\n}\n\nfunction formatPlainDateTimeIso(plainDateTimeSlots0, options) {\n const displayOptions = (options => (options = normalizeOptions(options), [ coerceCalendarDisplay(options), ...refineTimeDisplayTuple(options) ]))(options);\n return ((calendar, isoDateTime, calendarDisplay, roundingMode, nanoInc, subsecDigits) => formatIsoDateTimeFields(roundDateTimeToNano(isoDateTime, nanoInc, roundingMode), subsecDigits) + formatCalendar(calendar, calendarDisplay))(plainDateTimeSlots0.calendar, plainDateTimeSlots0, ...displayOptions);\n}\n\nfunction formatDateTimeIsoAuto(isoDateTimeSlots) {\n const calendar = isoDateTimeSlots.calendar;\n return formatIsoDateTimeFields(isoDateTimeSlots, void 0) + (calendar === isoCalendarImpl ? \"\" : formatCalendarId(getCalendarSlotId(calendar), 0));\n}\n\nfunction formatPlainDateIso(plainDateSlots, options) {\n return calendar = plainDateSlots.calendar, isoDate = plainDateSlots, calendarDisplay = refineDateDisplayOptions(options), \n formatIsoDateFields(isoDate) + formatCalendar(calendar, calendarDisplay);\n var calendar, isoDate, calendarDisplay;\n}\n\nfunction formatDateIsoAuto(plainDateSlots) {\n return formatIsoDateFields(plainDateSlots) + (plainDateSlots.calendar === isoCalendarImpl ? \"\" : formatCalendarId(getCalendarSlotId(plainDateSlots.calendar), 0));\n}\n\nfunction formatPlainYearMonthIso(plainYearMonthSlots, options) {\n return formatDateLikeIso(plainYearMonthSlots.calendar, formatIsoYearMonthFields, plainYearMonthSlots, refineDateDisplayOptions(options));\n}\n\nfunction formatYearMonthIsoAuto(plainYearMonthSlots) {\n const calendar = plainYearMonthSlots.calendar;\n return calendar !== isoCalendarImpl ? formatIsoDateFields(plainYearMonthSlots) + formatCalendarId(getCalendarSlotId(calendar), 0) : formatIsoYearMonthFields(plainYearMonthSlots);\n}\n\nfunction formatPlainMonthDayIso(plainMonthDaySlots, options) {\n return formatDateLikeIso(plainMonthDaySlots.calendar, formatIsoMonthDayFields, plainMonthDaySlots, refineDateDisplayOptions(options));\n}\n\nfunction formatMonthDayIsoAuto(plainMonthDaySlots) {\n const calendar = plainMonthDaySlots.calendar;\n return calendar !== isoCalendarImpl ? formatIsoDateFields(plainMonthDaySlots) + formatCalendarId(getCalendarSlotId(calendar), 0) : formatIsoMonthDayFields(plainMonthDaySlots);\n}\n\nfunction formatDateLikeIso(calendar, formatSimple, isoDate, calendarDisplay) {\n const showCalendar = calendarDisplay > 1 || 0 === calendarDisplay && calendar !== isoCalendarImpl;\n return 1 === calendarDisplay ? calendar === isoCalendarImpl ? formatSimple(isoDate) : formatIsoDateFields(isoDate) : showCalendar ? formatIsoDateFields(isoDate) + formatCalendarId(getCalendarSlotId(calendar), 2 === calendarDisplay) : formatSimple(isoDate);\n}\n\nfunction formatPlainTimeIso(slots, options) {\n return ((fields, roundingMode, nanoInc, subsecDigits) => formatTimeFields(roundTimeToNano(fields, nanoInc, roundingMode)[0], subsecDigits))(slots, ...refineTimeDisplayOptions(options));\n}\n\nfunction formatTimeIsoAuto(slots) {\n return formatTimeFields(slots, void 0);\n}\n\nfunction formatDurationIso(slots, options) {\n const [roundingMode, nanoInc, subsecDigits] = refineTimeDisplayOptions(options, 3);\n return nanoInc > 1 && validateDurationFields(slots = {\n ...slots,\n ...roundDayTimeDurationByInc(slots, nanoInc, roundingMode)\n }), formatDurationSlots(slots, subsecDigits);\n}\n\nfunction formatDurationIsoAuto(slots) {\n return formatDurationSlots(slots, void 0);\n}\n\nfunction formatDurationSlots(durationSlots, subsecDigits) {\n const {sign: sign} = durationSlots;\n const abs = -1 === sign ? negateDurationFields(durationSlots) : durationSlots;\n const {hours: hours, minutes: minutes} = abs;\n const bigNano = durationSubMinuteToBigNano(abs);\n const wholeSec = Number(bigNano / bigNanoInSec);\n const subsecNano = Number(bigNano % bigNanoInSec);\n validateDurationTimeUnit(wholeSec);\n const subsecNanoString = formatSubsecNano(subsecNano, subsecDigits);\n const forceSec = subsecDigits >= 0 || !sign || subsecNanoString;\n return (sign < 0 ? \"-\" : \"\") + \"P\" + formatDurationFragments({\n \"Y\": formatDurationNumber(abs.years),\n \"M\": formatDurationNumber(abs.months),\n \"W\": formatDurationNumber(abs.weeks),\n \"D\": formatDurationNumber(abs.days)\n }) + (hours || minutes || wholeSec || forceSec ? \"T\" + formatDurationFragments({\n \"H\": formatDurationNumber(hours),\n \"M\": formatDurationNumber(minutes),\n \"S\": formatDurationNumber(wholeSec, forceSec) + subsecNanoString\n }) : \"\");\n}\n\nfunction formatDurationFragments(fragObj) {\n const parts = [];\n for (const fragName in fragObj) {\n const fragVal = fragObj[fragName];\n fragVal && parts.push(fragVal, fragName);\n }\n return parts.join(\"\");\n}\n\nfunction formatDurationNumber(n, force) {\n if (!n && !force) {\n return \"\";\n }\n const options = Object.create(null);\n return options.useGrouping = 0, n.toLocaleString(\"fullwide\", options);\n}\n\nfunction formatIsoDateTimeFields(isoDateTime, subsecDigits) {\n return formatIsoDateFields(isoDateTime) + \"T\" + formatTimeFields(isoDateTime, subsecDigits);\n}\n\nfunction formatIsoDateFields(isoDateFields) {\n return formatIsoYearMonthFields(isoDateFields) + \"-\" + padNumber2(isoDateFields.day);\n}\n\nfunction formatIsoYearMonthFields(isoDateFields) {\n const {year: year} = isoDateFields;\n return (year < 0 || year > 9999 ? getSignStr(year) + padNumber(6, Math.abs(year)) : padNumber(4, year)) + \"-\" + padNumber2(isoDateFields.month);\n}\n\nfunction formatIsoMonthDayFields(isoDateFields) {\n return padNumber2(isoDateFields.month) + \"-\" + padNumber2(isoDateFields.day);\n}\n\nfunction formatTimeFields(timeFields, subsecDigits) {\n const parts = [ padNumber2(timeFields.hour), padNumber2(timeFields.minute) ];\n return -1 !== subsecDigits && parts.push(padNumber2(timeFields.second) + ((millisecond, microsecond, nanosecond, subsecDigits) => formatSubsecNano(millisecond * nanoInMilli + microsecond * nanoInMicro + nanosecond, subsecDigits))(timeFields.millisecond, timeFields.microsecond, timeFields.nanosecond, subsecDigits)), \n parts.join(\":\");\n}\n\nfunction formatOffsetNano(offsetNano, offsetDisplay = 0) {\n if (1 === offsetDisplay) {\n return \"\";\n }\n const [hour, nanoRemainder0] = divModFloor(Math.abs(offsetNano), nanoInHour);\n const [minute, nanoRemainder1] = divModFloor(nanoRemainder0, nanoInMinute);\n const [second, nanoRemainder2] = divModFloor(nanoRemainder1, nanoInSec);\n return getSignStr(offsetNano) + padNumber2(hour) + \":\" + padNumber2(minute) + (second || nanoRemainder2 ? \":\" + padNumber2(second) + formatSubsecNano(nanoRemainder2) : \"\");\n}\n\nfunction formatTimeZone(timeZoneId, timeZoneDisplay) {\n return 1 !== timeZoneDisplay ? \"[\" + (2 === timeZoneDisplay ? \"!\" : \"\") + timeZoneId + \"]\" : \"\";\n}\n\nfunction formatCalendar(calendar, calendarDisplay) {\n return calendarDisplay > 1 || 0 === calendarDisplay && calendar !== isoCalendarImpl ? formatCalendarId(getCalendarSlotId(calendar), 2 === calendarDisplay) : \"\";\n}\n\nfunction formatCalendarId(calendarId, isCritical) {\n return \"[\" + (isCritical ? \"!\" : \"\") + \"u-ca=\" + calendarId + \"]\";\n}\n\nconst trailingZerosRE = /0+$/;\n\nfunction formatSubsecNano(totalNano, subsecDigits) {\n let s = padNumber(9, totalNano);\n return s = void 0 === subsecDigits ? s.replace(trailingZerosRE, \"\") : s.slice(0, subsecDigits), \n s ? \".\" + s : \"\";\n}\n\nfunction getSignStr(num) {\n return num < 0 ? \"-\" : \"+\";\n}\n\nconst icuRegExp = /^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/;\n\nconst badCharactersRegExp = /[^\\w\\/:+-]+/;\n\nfunction refineTimeZoneId(rawId) {\n return resolveTimeZoneId(requireString(rawId));\n}\n\nfunction resolveTimeZoneId(rawId) {\n return resolveTimeZoneRecord(rawId).id;\n}\n\nfunction resolveTimeZoneRecord(rawId) {\n const upperRawId = rawId.toUpperCase();\n const offsetRecord = (upperRawId => {\n const offsetNano = parseOffsetNanoMaybe(upperRawId, 1);\n if (void 0 !== offsetNano) {\n return {\n id: formatOffsetNano(offsetNano),\n X: offsetNano,\n m: offsetNano\n };\n }\n })(upperRawId);\n if (offsetRecord) {\n return {\n kind: \"fixed\",\n ...offsetRecord\n };\n }\n const normId = \"UTC\" === upperRawId ? \"UTC\" : (rawId => (badCharactersRegExp.test(rawId) && throwRangeError(invalidTimeZone(rawId)), \n icuRegExp.test(rawId) && throwRangeError(\"Forbidden ICU TimeZone\"), rawId.toLowerCase().split(\"/\").map((part, partI) => (part.length <= 3 || /\\d/.test(part)) && !/etc|yap/.test(part) ? part.toUpperCase() : part.replace(/baja|dumont|[a-z]+/g, (a, i) => a.length <= 2 && !partI || \"in\" === a || \"chat\" === a ? a.toUpperCase() : a.length > 2 || !i ? capitalize(a).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : a)).join(\"/\")))(rawId);\n return queryNamedTimeZoneRecord(normId);\n}\n\nconst queryNamedTimeZoneRecord = /*@__PURE__*/ memoize(normId => {\n if (\"UTC\" === normId) {\n return {\n kind: \"utc\",\n id: normId,\n m: normId\n };\n }\n const upperNormId = normId.toUpperCase();\n const format = queryTimeZoneIntlFormat(upperNormId);\n return {\n kind: \"named\",\n id: normId,\n format: format,\n m: format.resolvedOptions().timeZone\n };\n});\n\nconst queryTimeZoneIntlFormat = /*@__PURE__*/ memoize(upperNormId => new RawDateTimeFormat(\"en-u-hc-h23\", {\n calendar: \"iso8601\",\n timeZone: upperNormId,\n era: \"short\",\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n}));\n\nfunction queryTimeZone(rawTimeZoneId) {\n const record = resolveTimeZoneRecord(rawTimeZoneId);\n return queryTimeZoneRecord(record.id, record);\n}\n\nconst queryTimeZoneRecord = /*@__PURE__*/ memoize((normTimeZoneId, record) => \"named\" === record.kind ? new IntlTimeZone(normTimeZoneId, record.m, record.format) : new FixedTimeZone(normTimeZoneId, record.m, \"fixed\" === record.kind ? record.X : 0));\n\nclass FixedTimeZone {\n constructor(id, compareKey, offsetNano) {\n this.id = id, this.m = compareKey, this.X = offsetNano;\n }\n B() {\n return this.X;\n }\n N(isoDateTime) {\n return [ isoDateTimeAndOffsetToEpochNano(isoDateTime, this.X) ];\n }\n O() {}\n}\n\nclass IntlTimeZone {\n constructor(id, compareKey, format) {\n this.id = id, this.m = compareKey, this.ke = ((computeOffsetSec, periodDays) => {\n const getSample = memoize(computeOffsetSec);\n const getSplit = memoize(createSplitTuple);\n const periodSec = 86400 * periodDays;\n function getOffsetSec(epochSec) {\n const [startEpochSec, endEpochSec] = computePeriod(epochSec, periodSec);\n const clampedStartEpochSec = clampIntlSampleEpochSec(startEpochSec);\n const clampedEndEpochSec = clampIntlSampleEpochSec(endEpochSec);\n const startOffsetSec = getSample(clampedStartEpochSec);\n const endOffsetSec = getSample(clampedEndEpochSec);\n return startOffsetSec === endOffsetSec ? startOffsetSec : pinch(getSplit(clampedStartEpochSec, clampedEndEpochSec), startOffsetSec, endOffsetSec, epochSec);\n }\n function pinch(split, startOffsetSec, endOffsetSec, forEpochSec) {\n let offsetSec;\n let splitDurSec;\n for (;(void 0 === forEpochSec || void 0 === (offsetSec = forEpochSec < split[0] ? startOffsetSec : forEpochSec >= split[1] ? endOffsetSec : void 0)) && (splitDurSec = split[1] - split[0]); ) {\n const middleEpochSec = split[0] + Math.floor(splitDurSec / 2);\n computeOffsetSec(middleEpochSec) === endOffsetSec ? split[1] = middleEpochSec : split[0] = middleEpochSec + 1;\n }\n return offsetSec;\n }\n return {\n xe(zonedEpochSec) {\n const wideOffsetSec0 = getOffsetSec(zonedEpochSec - 86400);\n const wideOffsetSec1 = getOffsetSec(zonedEpochSec + 86400);\n const wideUtcEpochSec0 = zonedEpochSec - wideOffsetSec0;\n const wideUtcEpochSec1 = zonedEpochSec - wideOffsetSec1;\n if (wideOffsetSec0 === wideOffsetSec1) {\n return [ wideUtcEpochSec0 ];\n }\n const narrowOffsetSec0 = getOffsetSec(wideUtcEpochSec0);\n return narrowOffsetSec0 === getOffsetSec(wideUtcEpochSec1) ? [ zonedEpochSec - narrowOffsetSec0 ] : wideOffsetSec0 > wideOffsetSec1 ? [ wideUtcEpochSec0, wideUtcEpochSec1 ] : [];\n },\n we: getOffsetSec,\n O: function getTransition(epochSec, direction) {\n if (direction > 0 && epochSec >= 864e10) {\n return;\n }\n if (direction < 0) {\n if (epochSec <= minPossibleTransitionSec) {\n return;\n }\n const lookaheadEpochSec = getCurrentEpochSec() + 94867200;\n if (epochSec > lookaheadEpochSec) {\n return getTransition(lookaheadEpochSec, -1);\n }\n }\n const searchEpochSec = direction > 0 ? Math.max(epochSec, minPossibleTransitionSec) : epochSec;\n let [startEpochSec, endEpochSec] = computePeriod(searchEpochSec, periodSec);\n const inc = periodSec * direction;\n const searchLimit = direction > 0 ? Math.max(epochSec, getCurrentEpochSec()) + 94867200 : minPossibleTransitionSec;\n const inBounds = () => direction < 0 ? endEpochSec > searchLimit : startEpochSec < searchLimit;\n for (;inBounds(); ) {\n const clampedStartEpochSec = clampIntlSampleEpochSec(startEpochSec);\n const clampedEndEpochSec = clampIntlSampleEpochSec(endEpochSec);\n const startOffsetSec = getSample(clampedStartEpochSec);\n const endOffsetSec = getSample(clampedEndEpochSec);\n if (startOffsetSec !== endOffsetSec) {\n const split = getSplit(clampedStartEpochSec, clampedEndEpochSec);\n pinch(split, startOffsetSec, endOffsetSec);\n const transitionEpochSec = split[0];\n if ((compareNumbers(transitionEpochSec, epochSec) || 1) === direction) {\n return transitionEpochSec;\n }\n }\n startEpochSec += inc, endEpochSec += inc;\n }\n }\n };\n })((format => epochSec => {\n const intlParts = formatEpochMilliToPartsRecord(format, 1e3 * epochSec);\n return 86400 * isoArgsToEpochDays((intlParts => {\n const relatedYear = intlParts.relatedYear;\n if (void 0 !== relatedYear) {\n return parseInt(relatedYear);\n }\n const year = parseInt(intlParts.year);\n return void 0 !== intlParts.era && \"bce\" === normalizeEraName(intlParts.era) ? 1 - year : year;\n })(intlParts), parseInt(intlParts.month), parseInt(intlParts.day)) + 3600 * parseInt(intlParts.hour) + 60 * parseInt(intlParts.minute) + parseInt(intlParts.second) - epochSec;\n })(format), (timeZoneId => {\n const timeZoneName = timeZoneId.split(\"/\").pop();\n return timeZonePeriodDaysByName[timeZoneName] || 60;\n })(id));\n }\n B(epochNano) {\n return this.ke.we((epochNano => epochNanoToSecMod(epochNano)[0])(epochNano)) * nanoInSec;\n }\n N(isoDateTime) {\n const zonedEpochSec = 86400 * isoDateToEpochDays(isoDateTime) + timeFieldsToSec(isoDateTime);\n const subsecNano = timeFieldsToSubsecNano(isoDateTime);\n return this.ke.xe(zonedEpochSec).map(epochSec => checkEpochNanoInBounds(BigInt(epochSec) * bigNanoInSec + BigInt(subsecNano)));\n }\n O(epochNano, direction) {\n const [epochSec, subsecNano] = epochNanoToSecMod(epochNano);\n const resEpochSec = this.ke.O(epochSec + (direction > 0 || subsecNano ? 1 : 0), direction);\n if (void 0 !== resEpochSec) {\n return BigInt(resEpochSec) * bigNanoInSec;\n }\n }\n}\n\nfunction getCurrentEpochSec() {\n return Math.floor(Date.now() / 1e3);\n}\n\nfunction createSplitTuple(startEpochSec, endEpochSec) {\n return [ startEpochSec, endEpochSec ];\n}\n\nfunction computePeriod(epochSec, periodSec) {\n const startEpochSec = Math.floor(epochSec / periodSec) * periodSec;\n return [ startEpochSec, startEpochSec + periodSec ];\n}\n\nfunction clampIntlSampleEpochSec(epochSec) {\n return constrainToRange(epochSec, -1e10, 864e10);\n}\n\nfunction refineMaybeZonedDateTimeObjectLike(refineTimeZoneString, calendar, bag) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateTimeAndZoneFieldNamesAlpha, dateTimeAndZoneFieldNamesWithEraAlpha), zonedDateTimeFieldRefiners, [], 0);\n if (void 0 !== fields.timeZone) {\n const isoDateFields = createPlainDateFromFields(calendar, fields);\n const timeFields = resolveTimeFields(fields);\n const timeZone = queryTimeZone(refineTimeZoneString(fields.timeZone));\n return {\n epochNanoseconds: getMatchingInstantFor(timeZone, combineDateAndTime(isoDateFields, timeFields), fields.offset),\n timeZone: timeZone,\n calendar: calendar\n };\n }\n return createPlainDateFromFields(calendar, fields);\n}\n\nfunction refineZonedDateTimeObjectLike(refineTimeZoneString, calendar, bag, options) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateTimeAndZoneFieldNamesAlpha, dateTimeAndZoneFieldNamesWithEraAlpha), zonedDateTimeFieldRefiners, timeZoneFieldNames, 0);\n const timeZoneId = refineTimeZoneString(fields.timeZone);\n const [isoDateFields, overflow, offsetDisambig, epochDisambig] = createPlainDateFromFieldsWithOptionsRefiner(calendar, fields, () => refineZonedFieldOptions(options));\n const timeFields = resolveTimeFields(fields, overflow);\n const timeZone = queryTimeZone(timeZoneId);\n return createZonedEpochNanoSlots(getMatchingInstantFor(timeZone, combineDateAndTime(isoDateFields, timeFields), fields.offset, offsetDisambig, epochDisambig), timeZone, calendar);\n}\n\nfunction refinePlainDateTimeObjectLike(calendar, bag, options) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateTimeFieldNamesAlpha, dateTimeFieldNamesWithEraAlpha), dateTimeFieldRefiners, [], 0);\n const [isoDateInternals, overflow] = createPlainDateFromFieldsWithOptionsRefiner(calendar, fields, () => [ refineOverflowOptions(options) ]);\n return createPlainDateTimeFromRefinedFields(isoDateInternals, resolveTimeFields(fields, overflow), calendar);\n}\n\nfunction refinePlainDateObjectLike(calendar, bag, options, requireFields = []) {\n return createPlainDateFromFields(calendar, readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha), dateFieldRefiners, requireFields), options);\n}\n\nfunction refinePlainYearMonthObjectLike(calendar, bag, options, requireFields) {\n return createPlainYearMonthFromFields(calendar, readAndRefineBagFields(bag, getCalendarFieldNames(calendar, yearMonthFieldNamesAlpha, yearMonthFieldNamesWithEraAlpha), dateFieldRefiners, requireFields), options);\n}\n\nfunction refinePlainMonthDayObjectLike(calendar, calendarAbsent, bag, options) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha), dateFieldRefiners, dayFieldNamesAsc, 0);\n return calendarAbsent && void 0 !== fields.month && void 0 === fields.monthCode && void 0 === fields.year && (fields.year = 1972), \n createPlainMonthDayFromFields(calendar, fields, options);\n}\n\nfunction refinePlainTimeObjectLike(bag, options) {\n return resolveTimeFields(readAndRefineBagFields(bag, timeFieldNamesAlpha, timeFieldRefiners, [], 1), refineOverflowOptions(options));\n}\n\nfunction refineDurationObjectLike(bag) {\n const durationFields = readAndRefineBagFields(bag, durationFieldNamesAlpha, durationFieldRefiners);\n return createDurationSlots(validateDurationFields({\n ...durationFieldDefaults,\n ...durationFields\n }));\n}\n\nfunction throwFailedParse(s) {\n throwRangeError(failedParse(s));\n}\n\nfunction parseInstant(s) {\n const organized = parseDateTimeLike(s = toStringViaPrimitive(s));\n let offsetNano;\n return organized || throwFailedParse(s), organized.C ? offsetNano = 0 : organized.offset ? offsetNano = parseOffsetNano(organized.offset) : throwFailedParse(s), \n organized.timeZoneId && parseOffsetNanoMaybe(organized.timeZoneId, 1), validateIsoDateTimeFields(organized), \n createEpochNanoSlots(isoDateTimeAndOffsetToEpochNano(organized, offsetNano));\n}\n\nfunction parseRelativeToSlots(s, resolveCalendar) {\n const organized = parseDateTimeLike(requireString(s));\n return organized || throwFailedParse(s), organized.timeZoneId ? finalizeZonedDateTime(organized, resolveCalendar, void 0) : (organized.C && throwFailedParse(s), \n finalizeDate(organized, resolveCalendar));\n}\n\nfunction parseZonedDateTime(s, resolveCalendar, options) {\n const organized = parseDateTimeLike(requireString(s));\n return organized && organized.timeZoneId || throwFailedParse(s), finalizeZonedDateTime(organized, resolveCalendar, options);\n}\n\nfunction parsePlainDateTime(s, resolveCalendar) {\n const organized = parseDateTimeLike(requireString(s));\n return organized && !organized.C || throwFailedParse(s), finalizeDateTime(organized, resolveCalendar);\n}\n\nfunction parsePlainDate(s, resolveCalendar) {\n const slots = finalizeDateLike(parsePlainDateLike(requireString(s)), void 0, resolveCalendar);\n return createDateSlots(slots, slots.calendar);\n}\n\nfunction parsePlainYearMonth(s, resolveCalendar) {\n const organized = parseYearMonthOnly(requireString(s));\n if (organized) {\n return requireIsoCalendar(organized), createDateSlots(checkIsoYearMonthInBounds(validateIsoDateFields(organized)), resolveCalendar(organized.calendarId));\n }\n const dateSlots = finalizeDateLike(parsePlainDateLike(s), projectIsoYearMonthDate, resolveCalendar);\n const {calendar: calendar} = dateSlots;\n return createDateSlots(moveToStartOfMonth(calendar, dateSlots), calendar);\n}\n\nfunction requireIsoCalendar(organized) {\n \"iso8601\" !== organized.calendarId && throwRangeError(invalidSubstring(organized.calendarId));\n}\n\nfunction parsePlainMonthDay(s, resolveCalendar) {\n const organized = parseMonthDayOnly(requireString(s));\n if (organized) {\n return requireIsoCalendar(organized), createDateSlots(validateIsoDateFields(organized), resolveCalendar(organized.calendarId));\n }\n const dateSlots = finalizeDateLike(parsePlainDateLike(s), projectIsoMonthDayDate, resolveCalendar);\n const {calendar: calendar} = dateSlots;\n const {year: origYear, month: origMonth, day: day} = computeCalendarDateFields(calendar, dateSlots);\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, origYear, origMonth);\n const {year: year, month: month} = ((calendar, monthCodeNumber, isLeapMonth, day) => {\n const yearMonthFields = calendar ? calendar.u(monthCodeNumber, isLeapMonth, day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth);\n return yearMonthFields || throwRangeError(\"Cannot guess year\"), yearMonthFields;\n })(calendar, monthCodeNumber, isLeapMonth, day);\n return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, day)), calendar);\n}\n\nfunction parsePlainTime(s) {\n let organized = (s => {\n const parts = parseTimeOnlyParts(s);\n return parts ? (organizeAnnotationParts(parts[13]), organizeTimeParts(parts, 1)) : void 0;\n })(s = requireString(s));\n if (!organized) {\n const dateTime = parseDateTimeLike(s);\n dateTime && dateTime.re || throwFailedParse(s), dateTime.C && throwRangeError(invalidSubstring(\"Z\")), \n requireIsoCalendar(dateTime), organized = dateTime;\n }\n let altParsed;\n return (altParsed = parseYearMonthOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s), \n (altParsed = parseMonthDayOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s), \n createTimeSlots(validateTimeFields(organized));\n}\n\nfunction parseDuration(s) {\n const parts = durationRegExp.exec(requireString(s));\n return parts || throwFailedParse(s), createDurationSlots(validateDurationFields((parts => {\n let hasAny = 0;\n let hasAnyFrac = 0;\n let leftoverNano = 0;\n let durationFields = {\n years: parseUnit(parts[2]),\n months: parseUnit(parts[3]),\n weeks: parseUnit(parts[4]),\n days: parseUnit(parts[5]),\n hours: parseUnit(parts[6], parts[7], 5),\n minutes: parseUnit(parts[8], parts[9], 4),\n seconds: parseUnit(parts[10], parts[11], 3),\n ...nanoToGivenFields(leftoverNano, 2, durationFieldNamesAsc)\n };\n return hasAny || throwRangeError(noValidFields(durationFieldNamesAsc)), parseSign(parts[1]) < 0 && (durationFields = negateDurationFields(durationFields)), \n durationFields;\n function parseUnit(wholeStr, fracStr, timeUnit) {\n let leftoverUnits = 0;\n let wholeUnits = 0;\n return timeUnit && ([leftoverUnits, leftoverNano] = divModFloor(leftoverNano, unitNanoMap[timeUnit])), \n void 0 !== wholeStr && (hasAnyFrac && throwRangeError(invalidSubstring(wholeStr)), \n wholeUnits = (s => {\n const n = parseInt(s);\n return Number.isFinite(n) || throwRangeError(invalidSubstring(s)), n;\n })(wholeStr), hasAny = 1, fracStr && (leftoverNano = parseSubsecNano(fracStr) * (unitNanoMap[timeUnit] / nanoInSec), \n hasAnyFrac = 1)), leftoverUnits + wholeUnits;\n }\n })(parts)));\n}\n\nfunction parseCalendarId(s) {\n const res = parseDateTimeLike(s) || parseYearMonthOnly(s) || parseMonthDayOnly(s);\n if (res) {\n return res.calendarId;\n }\n const timeParts = parseTimeOnlyParts(s);\n return timeParts ? organizeAnnotationParts(timeParts[13]).calendarId : s;\n}\n\nfunction parseTimeZoneId(s) {\n const parsed = parseDateTimeLike(s);\n return parsed && (parsed.timeZoneId || parsed.C && \"UTC\" || parsed.offset) || s;\n}\n\nfunction parsePlainDateLike(s) {\n const organized = parseDateTimeLike(s);\n return organized && !organized.C || throwFailedParse(s), organized;\n}\n\nfunction finalizeDateLike(organized, isoDateProjector, resolveCalendar) {\n return isoDateProjector && \"iso8601\" === organized.calendarId ? (validateIsoDateFields(organized), \n organized.re && validateTimeFields(organized), finalizeDate(isoDateProjector(organized), resolveCalendar)) : organized.re ? finalizeDateTime(organized, resolveCalendar) : finalizeDate(organized, resolveCalendar);\n}\n\nfunction projectIsoYearMonthDate(organized) {\n const day = 12 * organized.year + organized.month === isoYearMonthIndexMin ? 20 : 1;\n return {\n ...organized,\n day: day\n };\n}\n\nfunction projectIsoMonthDayDate(organized) {\n return {\n ...organized,\n year: 1972\n };\n}\n\nfunction finalizeZonedDateTime(organized, resolveCalendar, options) {\n const timeZone = queryTimeZone(resolveTimeZoneId(organized.timeZoneId));\n let epochNano;\n if (validateIsoDateTimeFields(organized), organized.re) {\n const offsetNano = organized.offset ? parseOffsetNano(organized.offset) : void 0;\n const [, offsetDisambig, epochDisambig] = refineZonedFieldOptions(options);\n epochNano = getMatchingInstantFor(timeZone, organized, offsetNano, offsetDisambig, epochDisambig, !(timeZone.X || void 0 === organized.offset || (offset = organized.offset, \n offset.replace(/\\D/g, \"\").length > 4)), organized.C);\n } else {\n refineZonedFieldOptions(options), epochNano = getStartOfDayInstantFor(timeZone, organized);\n }\n var offset;\n return checkEpochNanoInBounds(epochNano), createZonedEpochNanoSlots(epochNano, timeZone, resolveCalendar(organized.calendarId));\n}\n\nfunction finalizeDateTime(organized, resolveCalendar) {\n return validateIsoDateTimeFields(organized), checkIsoDateTimeInBounds(organized), \n {\n ...combineDateAndTime(organized, organized),\n calendar: resolveCalendar(organized.calendarId)\n };\n}\n\nfunction finalizeDate(organized, resolveCalendar) {\n return validateIsoDateFields(organized), checkIsoDateInBounds(organized), {\n calendar: resolveCalendar(organized.calendarId),\n year: organized.year,\n month: organized.month,\n day: organized.day\n };\n}\n\nfunction timeRegExpStr(separatorIndex) {\n return `(\\\\d{2})(?:(:?)(\\\\d{2})(?:\\\\${separatorIndex}(\\\\d{2})(?:[.,](\\\\d{1,9}))?)?)?`;\n}\n\nconst dateTimeRegExpStr = \"(?:(?:([+-])(\\\\d{6}))|(\\\\d{4}))(-?)(\\\\d{2})\\\\4(\\\\d{2})(?:[T ]\" + timeRegExpStr(8) + \"(Z|([+-])\" + timeRegExpStr(15) + \")?)?\";\n\nconst yearMonthRegExp = /*@__PURE__*/ createRegExp(\"(?:(?:([+-])(\\\\d{6}))|(\\\\d{4}))-?(\\\\d{2})((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})\");\n\nconst monthDayRegExp = /*@__PURE__*/ createRegExp(\"(?:--)?(\\\\d{2})-?(\\\\d{2})((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})\");\n\nconst dateTimeRegExp = /*@__PURE__*/ createRegExp(dateTimeRegExpStr + \"((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})\");\n\nconst timeRegExp = /*@__PURE__*/ createRegExp(\"T?\" + timeRegExpStr(2) + `(([+-])${timeRegExpStr(9)})?((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})`);\n\nconst annotationRegExp = /*@__PURE__*/ new RegExp(\"\\\\[(!?)([^\\\\]]*)\\\\]\", \"g\");\n\nconst durationRegExp = /*@__PURE__*/ createRegExp(\"([+-])?P(\\\\d+Y)?(\\\\d+M)?(\\\\d+W)?(\\\\d+D)?(?:T(?!$)(?:(\\\\d+)(?:[.,](\\\\d{1,9}))?H)?(?:(\\\\d+)(?:[.,](\\\\d{1,9}))?M)?(?:(\\\\d+)(?:[.,](\\\\d{1,9}))?S)?)?\");\n\nfunction parseDateTimeLike(s) {\n const parts = dateTimeRegExp.exec(s);\n return parts ? (parts => {\n const zOrOffset = parts[12];\n const hasZ = \"Z\" === (zOrOffset || \"\").toUpperCase();\n return {\n year: organizeIsoYearParts(parts),\n month: parseInt(parts[5]),\n day: parseInt(parts[6]),\n ...organizeTimeParts(parts, 7),\n ...organizeAnnotationParts(parts[19]),\n re: Boolean(parts[7]),\n C: hasZ,\n offset: hasZ ? void 0 : zOrOffset\n };\n })(parts) : void 0;\n}\n\nfunction parseYearMonthOnly(s) {\n const parts = yearMonthRegExp.exec(s);\n if (parts) {\n return (parts => ({\n year: organizeIsoYearParts(parts),\n month: parseInt(parts[4]),\n day: 1,\n ...organizeAnnotationParts(parts[5])\n }))(parts);\n }\n}\n\nfunction parseMonthDayOnly(s) {\n const parts = monthDayRegExp.exec(s);\n return parts ? (parts => ({\n year: 1972,\n month: parseInt(parts[1]),\n day: parseInt(parts[2]),\n ...organizeAnnotationParts(parts[3])\n }))(parts) : void 0;\n}\n\nfunction parseTimeOnlyParts(s) {\n const parts = timeRegExp.exec(s);\n if (parts) {\n return parts[6] && parseOffsetNano(parts[6]), parts;\n }\n}\n\nfunction organizeTimeParts(parts, hourIndex) {\n const second = parseInt0(parts[hourIndex + 3]);\n return {\n ...nanoToTimeAndDay(parseSubsecNano(parts[hourIndex + 4] || \"\"))[0],\n hour: parseInt0(parts[hourIndex]),\n minute: parseInt0(parts[hourIndex + 2]),\n second: 60 === second ? 59 : second\n };\n}\n\nfunction organizeIsoYearParts(parts) {\n const yearSign = parseSign(parts[1]);\n const year = parseInt(parts[2] || parts[3]);\n return yearSign < 0 && !year && throwRangeError(invalidSubstring(-0)), yearSign * year;\n}\n\nfunction organizeAnnotationParts(s) {\n let calendarIsCritical;\n let timeZoneId;\n const calendarIds = [];\n return s.replace(annotationRegExp, (whole, criticalStr, mainStr) => {\n const isCritical = Boolean(criticalStr);\n const [val, name] = mainStr.split(\"=\").reverse();\n return name ? \"u-ca\" === name ? (calendarIds.push(val.toLowerCase()), calendarIsCritical || (calendarIsCritical = isCritical)) : (isCritical || /[A-Z]/.test(name)) && throwRangeError(invalidSubstring(whole)) : (timeZoneId && throwRangeError(invalidSubstring(whole)), \n timeZoneId = val), \"\";\n }), calendarIds.length > 1 && calendarIsCritical && throwRangeError(invalidSubstring(s)), \n {\n timeZoneId: timeZoneId,\n calendarId: calendarIds[0] || \"iso8601\"\n };\n}\n\nfunction mergeCalendarFields(calendar, baseFields, additionalFields) {\n const merged = Object.assign(Object.create(null), baseFields);\n return spliceFields(merged, additionalFields, monthFieldNames), getCalendarEraOrigins(calendar) && (spliceFields(merged, additionalFields, allYearFieldNames), \n calendar && calendar.ge && spliceFields(merged, additionalFields, monthDayFieldNames, eraYearFieldNames)), \n merged;\n}\n\nfunction spliceFields(dest, additional, allPropNames, deletablePropNames) {\n let anyMatching = 0;\n const nonMatchingPropNames = [];\n for (const propName of allPropNames) {\n void 0 !== additional[propName] ? anyMatching = 1 : nonMatchingPropNames.push(propName);\n }\n if (Object.assign(dest, additional), anyMatching) {\n for (const deletablePropName of deletablePropNames || nonMatchingPropNames) {\n delete dest[deletablePropName];\n }\n }\n}\n\nfunction mergeZonedDateTimeFields(zonedDateTimeSlots, modFields, options) {\n const {calendar: calendar, timeZone: timeZone} = zonedDateTimeSlots;\n const validFieldNames = getCalendarFieldNames(calendar, dateTimeAndOffsetFieldNamesAlpha, dateTimeAndOffsetFieldNamesWithEraAlpha);\n const zonedSlots = zonedEpochSlotsToIso(zonedDateTimeSlots);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, zonedSlots);\n const origFields = {\n year: year,\n monthCode: computeMonthCode(calendar, year, month),\n day: day,\n hour: zonedSlots.hour,\n minute: zonedSlots.minute,\n second: zonedSlots.second,\n millisecond: zonedSlots.millisecond,\n microsecond: zonedSlots.microsecond,\n nanosecond: zonedSlots.nanosecond,\n offset: zonedSlots.offsetNanoseconds\n };\n const partialFields = readAndRefineBagFields(modFields, validFieldNames, zonedDateTimeFieldRefiners);\n const mergedCalendarFields = mergeCalendarFields(calendar, origFields, partialFields);\n const mergedAllFields = {\n ...origFields,\n ...partialFields\n };\n const [isoDateFields, overflow, offsetDisambig, epochDisambig] = createPlainDateFromFieldsWithOptionsRefiner(calendar, mergedCalendarFields, () => refineZonedFieldOptions(options, 2));\n return createZonedEpochNanoSlots(getMatchingInstantFor(timeZone, combineDateAndTime(isoDateFields, constrainTimeFields(mergedAllFields, overflow)), mergedAllFields.offset, offsetDisambig, epochDisambig), timeZone, calendar);\n}\n\nfunction mergePlainDateTimeFields(plainDateTimeSlots, modFields, options) {\n const {calendar: calendar} = plainDateTimeSlots;\n const validFieldNames = getCalendarFieldNames(calendar, dateTimeFieldNamesAlpha, dateTimeFieldNamesWithEraAlpha);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, plainDateTimeSlots);\n const origFields = {\n year: year,\n monthCode: computeMonthCode(calendar, year, month),\n day: day,\n hour: plainDateTimeSlots.hour,\n minute: plainDateTimeSlots.minute,\n second: plainDateTimeSlots.second,\n millisecond: plainDateTimeSlots.millisecond,\n microsecond: plainDateTimeSlots.microsecond,\n nanosecond: plainDateTimeSlots.nanosecond\n };\n const partialFields = readAndRefineBagFields(modFields, validFieldNames, dateTimeFieldRefiners);\n const mergedCalendarFields = mergeCalendarFields(calendar, origFields, partialFields);\n const mergedAllFields = {\n ...origFields,\n ...partialFields\n };\n const [plainDateSlots, overflow] = createPlainDateFromFieldsWithOptionsRefiner(calendar, mergedCalendarFields, () => [ refineOverflowOptions(options) ]);\n return createPlainDateTimeFromRefinedFields(plainDateSlots, constrainTimeFields(mergedAllFields, overflow), calendar);\n}\n\nfunction mergePlainDateFields(plainDateSlots, modFields, options) {\n const {calendar: calendar} = plainDateSlots;\n const validFieldNames = getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, plainDateSlots);\n return createPlainDateFromFields(calendar, mergeCalendarFields(calendar, {\n year: year,\n monthCode: computeMonthCode(calendar, year, month),\n day: day\n }, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners)), options);\n}\n\nfunction mergePlainYearMonthFields(plainYearMonthSlots, modFields, options) {\n const {calendar: calendar} = plainYearMonthSlots;\n const validFieldNames = getCalendarFieldNames(calendar, yearMonthFieldNamesAlpha, yearMonthFieldNamesWithEraAlpha);\n const {year: year, month: month} = computeCalendarDateFields(calendar, plainYearMonthSlots);\n return createPlainYearMonthFromFields(calendar, mergeCalendarFields(calendar, {\n year: year,\n monthCode: computeMonthCode(calendar, year, month)\n }, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners)), options);\n}\n\nfunction mergePlainMonthDayFields(plainMonthDaySlots, modFields, options) {\n const {calendar: calendar} = plainMonthDaySlots;\n const validFieldNames = getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, plainMonthDaySlots);\n return createPlainMonthDayFromFields(calendar, mergeCalendarFields(calendar, {\n monthCode: computeMonthCode(calendar, year, month),\n day: day\n }, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners)), options);\n}\n\nfunction mergePlainTimeFields(initialFields, mod, options) {\n return ((initialFields, modFields, options) => resolveTimeFields({\n ...pluckProps(timeFieldNamesAlpha, initialFields),\n ...readAndRefineBagFields(modFields, timeFieldNamesAlpha, timeFieldRefiners)\n }, refineOverflowOptions(options)))(initialFields, mod, options);\n}\n\nfunction mergeDurationFields(slots, fields) {\n return createDurationSlots((initialFields = slots, modFields = fields, validateDurationFields({\n ...initialFields,\n ...readAndRefineBagFields(modFields, durationFieldNamesAlpha, durationFieldRefiners)\n })));\n var initialFields, modFields;\n}\n\nfunction computeMonthCode(calendar, year, month) {\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n return formatMonthCode(monthCodeNumber, isLeapMonth);\n}\n\nfunction instantToZonedDateTime(instantSlots, timeZone, calendar) {\n return createZonedEpochNanoSlots(instantSlots.epochNanoseconds, timeZone, calendar);\n}\n\nfunction zonedDateTimeToInstant(zonedDateTimeSlots0) {\n return createEpochNanoSlots(zonedDateTimeSlots0.epochNanoseconds);\n}\n\nfunction zonedDateTimeToPlainDateTime(zonedDateTimeSlots0) {\n return createDateTimeSlots(zonedEpochSlotsToIso(zonedDateTimeSlots0), zonedDateTimeSlots0.calendar);\n}\n\nfunction zonedDateTimeToPlainDate(zonedDateTimeSlots0) {\n return createDateSlots(zonedEpochSlotsToIso(zonedDateTimeSlots0), zonedDateTimeSlots0.calendar);\n}\n\nfunction zonedDateTimeToPlainTime(zonedDateTimeSlots0) {\n return createTimeSlots(zonedEpochSlotsToIso(zonedDateTimeSlots0));\n}\n\nfunction plainDateTimeToZonedDateTime(plainDateTimeSlots, timeZone, options) {\n const epochNano = getSingleInstantFor(timeZone, plainDateTimeSlots, (options => coerceEpochDisambig(normalizeOptions(options)))(options));\n return createZonedEpochNanoSlots(checkEpochNanoInBounds(epochNano), timeZone, plainDateTimeSlots.calendar);\n}\n\nfunction plainDateToZonedDateTime(refineTimeZoneString, refinePlainTimeArg, plainDateSlots, options) {\n const timeZoneId = refineTimeZoneString(options.timeZone);\n const plainTimeArg = options.plainTime;\n const timeFields = void 0 !== plainTimeArg ? refinePlainTimeArg(plainTimeArg) : void 0;\n const timeZone = queryTimeZone(timeZoneId);\n let epochNano;\n return epochNano = timeFields ? getSingleInstantFor(timeZone, combineDateAndTime(plainDateSlots, timeFields)) : getStartOfDayInstantFor(timeZone, combineDateAndTime(plainDateSlots, timeFieldDefaults)), \n createZonedEpochNanoSlots(epochNano, timeZone, plainDateSlots.calendar);\n}\n\nfunction convertPlainYearMonthToDate(calendar, input, bag) {\n return createPlainDateFromMergedFields(calendar, pluckProps(getCalendarFieldNames(calendar, yearMonthCodeFieldNamesAlpha, yearMonthCodeFieldNamesWithEraAlpha), input), readAndRefineBagFields(requireObjectLike(bag), dayFieldNamesAsc, dateFieldRefiners, []));\n}\n\nfunction convertPlainMonthDayToDate(calendar, input, bag) {\n const extraFieldNames = getCalendarFieldNames(calendar, yearFieldNamesAsc, yearFieldNamesWithEraAlpha);\n return createPlainDateFromMergedFields(calendar, pluckProps(monthCodeDayFieldNamesAlpha, input), readAndRefineBagFields(requireObjectLike(bag), extraFieldNames, dateFieldRefiners, []));\n}\n\nfunction convertToPlainMonthDay(calendar, input) {\n return createPlainMonthDayFromFields(calendar, readAndRefineBagFields(input, monthCodeDayFieldNamesAlpha, dateFieldRefiners));\n}\n\nfunction convertToPlainYearMonth(calendar, input, options) {\n return createPlainYearMonthFromFields(calendar, readAndRefineBagFields(input, getCalendarFieldNames(calendar, yearMonthCodeFieldNamesAlpha, yearMonthCodeFieldNamesWithEraAlpha), dateFieldRefiners), options);\n}\n\nfunction createPlainDateFromMergedFields(calendar, inputFields, extraFields) {\n const mergedFieldNames = getCalendarFieldNames(calendar, yearMonthCodeDayFieldNamesAlpha, yearMonthCodeDayFieldNamesWithEraAlpha);\n let mergedFields = mergeCalendarFields(calendar, inputFields, extraFields);\n return mergedFields = readAndRefineBagFields(mergedFields, mergedFieldNames, dateFieldRefiners, []), \n createPlainDateFromFields(calendar, mergedFields);\n}\n\nfunction epochMilliToInstant(epochMilli) {\n return createEpochNanoSlots(checkEpochNanoInBounds(BigInt(toStrictInteger(epochMilli)) * bigNanoInMilli));\n}\n\nfunction epochNanoToInstant(epochNano) {\n return createEpochNanoSlots(checkEpochNanoInBounds(toBigInt(epochNano)));\n}\n\nfunction applyPlainFormatTimeZone(options) {\n return options.timeZone = \"UTC\", [ \"full\", \"long\" ].includes(options.timeStyle) && (options.timeStyle = \"medium\"), \n options;\n}\n\nfunction applyZonedFormatTimeZone(options, timeZoneId) {\n return void 0 !== options.timeZone && throwTypeError(\"Cannot specify TimeZone\"), \n options.timeZone = timeZoneId, options;\n}\n\nfunction checkResolvedCalendarCompatible(format, slots, strictCalendarCheck) {\n const resolvedCalendarId = format.resolvedOptions().calendar;\n !strictCalendarCheck && slots.calendar === isoCalendarImpl || getCalendarSlotId(slots.calendar) === resolvedCalendarId || throwRangeError(\"Mismatching Calendars\");\n}\n\nfunction createOptionsTransformer(shapeFieldNames, invalidShapeFieldNames, ignoredFieldNames, defaultShapeFields, dateStyleReplacementFields) {\n const shapeFieldNameSet = new Set(shapeFieldNames);\n const invalidShapeFieldNameSet = new Set(invalidShapeFieldNames);\n const ignoredFieldNameSet = new Set(ignoredFieldNames);\n return (options, allowPartialOverlap) => {\n let dateStyle;\n let timeStyle;\n const granularShapeFields = {};\n const modifierFields = {};\n const otherFields = {};\n let hasInvalidGranularShapeFields = 0;\n let hasInvalidStyleFields = 0;\n for (const name of Object.keys(options)) {\n const value = options[name];\n void 0 === value || ignoredFieldNameSet.has(name) || (shapeFieldNameSet.has(name) ? \"dateStyle\" === name ? dateStyle = value : \"timeStyle\" === name ? timeStyle = value : granularShapeFields[name] = value : \"era\" === name ? modifierFields[name] = value : invalidShapeFieldNameSet.has(name) ? \"dateStyle\" === name || \"timeStyle\" === name ? hasInvalidStyleFields = 1 : hasInvalidGranularShapeFields = 1 : otherFields[name] = value);\n }\n const hasDateStyle = void 0 !== dateStyle;\n const hasTimeStyle = void 0 !== timeStyle;\n const hasAnyStyle = hasDateStyle || hasTimeStyle;\n const hasGranularShapeFields = Object.keys(granularShapeFields).length > 0;\n const hasInvalids = hasInvalidGranularShapeFields || hasInvalidStyleFields;\n const hasShapeFields = hasGranularShapeFields || hasDateStyle || hasTimeStyle;\n const hasModifierFields = Object.keys(modifierFields).length > 0;\n (!allowPartialOverlap && hasInvalids || allowPartialOverlap && hasInvalids && !hasShapeFields || hasAnyStyle && (hasGranularShapeFields || hasModifierFields || hasInvalidGranularShapeFields)) && throwTypeError(\"Invalid formatting options\");\n const transformedOptions = {};\n return hasAnyStyle || hasShapeFields || Object.assign(transformedOptions, defaultShapeFields), \n Object.assign(transformedOptions, granularShapeFields, modifierFields, otherFields), \n hasDateStyle && (dateStyleReplacementFields ? Object.assign(transformedOptions, dateStyleReplacementFields[dateStyle]) : transformedOptions.dateStyle = dateStyle), \n hasTimeStyle && (transformedOptions.timeStyle = timeStyle), transformedOptions;\n };\n}\n\nconst dateDefaultShapeFields = {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\"\n};\n\nconst timeDefaultShapeFields = {\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n};\n\nconst dateTimeDefaultShapeFields = /*@__PURE__*/ Object.assign({}, dateDefaultShapeFields, timeDefaultShapeFields);\n\nconst dateShapeFieldNames = [ \"weekday\", \"year\", \"month\", \"day\", \"dateStyle\" ];\n\nconst timeShapeFieldNames = [ \"dayPeriod\", \"hour\", \"minute\", \"second\", \"fractionalSecondDigits\", \"timeStyle\" ];\n\nconst dateTimeShapeFieldNames = /*@__PURE__*/ dateShapeFieldNames.concat(timeShapeFieldNames);\n\nconst yearMonthIgnoredFieldNames = /*@__PURE__*/ [ \"weekday\", \"day\" ].concat(timeShapeFieldNames);\n\nconst monthDayIgnoredFieldNames = /*@__PURE__*/ [ \"weekday\", \"year\" ].concat(timeShapeFieldNames);\n\nconst transformInstantOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], dateTimeDefaultShapeFields);\n\nconst transformZonedOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], {\n ...dateTimeDefaultShapeFields,\n timeZoneName: \"short\"\n});\n\nconst transformDateTimeOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [ \"timeZoneName\" ], dateTimeDefaultShapeFields);\n\nconst transformDateOptions = /*@__PURE__*/ createOptionsTransformer(dateShapeFieldNames, timeShapeFieldNames, [ \"timeZoneName\" ], dateDefaultShapeFields);\n\nconst transformTimeOptions = /*@__PURE__*/ createOptionsTransformer(timeShapeFieldNames, dateShapeFieldNames, [ \"timeZoneName\", \"era\" ], timeDefaultShapeFields);\n\nconst transformYearMonthOptions = /*@__PURE__*/ createOptionsTransformer([ \"year\", \"month\", \"dateStyle\" ], yearMonthIgnoredFieldNames, [ \"timeZoneName\" ], {\n year: \"numeric\",\n month: \"numeric\"\n}, {\n full: {\n year: \"numeric\",\n month: \"long\"\n },\n long: {\n year: \"numeric\",\n month: \"long\"\n },\n medium: {\n year: \"numeric\",\n month: \"short\"\n },\n short: {\n year: \"2-digit\",\n month: \"numeric\"\n }\n});\n\nconst transformMonthDayOptions = /*@__PURE__*/ createOptionsTransformer([ \"month\", \"day\", \"dateStyle\" ], monthDayIgnoredFieldNames, [ \"timeZoneName\", \"era\" ], {\n month: \"numeric\",\n day: \"numeric\"\n}, {\n full: {\n month: \"long\",\n day: \"numeric\"\n },\n long: {\n month: \"long\",\n day: \"numeric\"\n },\n medium: {\n month: \"short\",\n day: \"numeric\"\n },\n short: {\n month: \"numeric\",\n day: \"numeric\"\n }\n});\n\nfunction zonedDateTimeWithPlainTime(zonedDateTimeSlots, plainTimeFields) {\n const {timeZone: timeZone} = zonedDateTimeSlots;\n const isoDateTime = zonedEpochSlotsToIso(zonedDateTimeSlots);\n const {offsetNanoseconds: offsetNanoseconds} = isoDateTime;\n const time = plainTimeFields || timeFieldDefaults;\n let epochNano;\n return epochNano = plainTimeFields ? getMatchingInstantFor(timeZone, combineDateAndTime(isoDateTime, time), offsetNanoseconds, 2) : getStartOfDayInstantFor(timeZone, combineDateAndTime(isoDateTime, time)), \n createZonedEpochNanoSlots(epochNano, timeZone, zonedDateTimeSlots.calendar);\n}\n\nfunction getCurrentIsoDateTime(timeZone) {\n const epochNano = getCurrentEpochNano();\n const offsetNano = timeZone.B(epochNano);\n return epochNanoToIsoDateTime(epochNano + BigInt(offsetNano));\n}\n\nfunction getCurrentEpochNano() {\n return BigInt(Date.now()) * bigNanoInMilli;\n}\n\nfunction getCurrentTimeZoneId() {\n return (new RawDateTimeFormat).resolvedOptions().timeZone;\n}\n\nfunction createDateTimeFormatShell(createArgsProvider, transformOptions = identity) {\n const internalsMap = new WeakMap;\n function getInternals(format) {\n const internals = internalsMap.get(format);\n return internals || throwTypeError(\"Invalid calling context\"), internals;\n }\n class ShimDateTimeFormat {\n constructor(locales, options = Object.create(null)) {\n const transformedOptions = transformOptions(options);\n const observedOptionNames = [];\n const trackedOptions = new Proxy(Object.create(null), {\n get(_target, name) {\n const value = transformedOptions[name];\n return void 0 !== value && observedOptionNames.push(name), value;\n }\n });\n const baseFormat = new RawDateTimeFormat(locales, trackedOptions);\n const resolvedOptions = baseFormat.resolvedOptions();\n const copiedOptions = pluckProps(observedOptionNames, resolvedOptions);\n internalsMap.set(this, {\n Z: createArgsProvider({\n t: baseFormat,\n ze: resolvedOptions.locale,\n F: copiedOptions,\n Ce: transformedOptions\n }),\n t: baseFormat\n });\n }\n get format() {\n const internals = getInternals(this);\n return internals.qe || (internals.qe = record => {\n const [format, ...rest] = internals.Z.A(record);\n return format.format(...rest);\n });\n }\n formatToParts(record) {\n const {Z: argsProvider} = getInternals(this);\n const [format, ...rest] = argsProvider.A(record);\n return format.formatToParts(...rest);\n }\n resolvedOptions() {\n return getInternals(this).t.resolvedOptions();\n }\n }\n const {prototype: prototype} = ShimDateTimeFormat;\n function DateTimeFormat(locales, options) {\n return new ShimDateTimeFormat(locales, options);\n }\n RawDateTimeFormat.prototype.formatRange && Object.defineProperties(prototype, createPropDescriptors({\n formatRange(record0, record1) {\n const {Z: argsProvider} = getInternals(this);\n const [format, epochMilli0, epochMilli1] = argsProvider.v(record0, record1);\n return format.formatRange(epochMilli0, epochMilli1);\n },\n formatRangeToParts(record0, record1) {\n const {Z: argsProvider} = getInternals(this);\n const [format, epochMilli0, epochMilli1] = argsProvider.v(record0, record1);\n return format.formatRangeToParts(epochMilli0, epochMilli1);\n }\n }));\n const rawStaticDescriptors = Object.getOwnPropertyDescriptors(RawDateTimeFormat);\n return rawStaticDescriptors.prototype.value = prototype, Object.defineProperties(DateTimeFormat, rawStaticDescriptors), \n prototype.constructor = DateTimeFormat, Object.defineProperties(prototype, createStringTagDescriptors(\"Intl.DateTimeFormat\")), \n DateTimeFormat;\n}\n\nexport { RawDateTimeFormat, absDuration, addCalendarMonths, addDateMonths, addDurations, addDurationsWithoutRelativeTo, addIsoMonths, alignZonedEpoch, applyPlainFormatTimeZone, applyZonedFormatTimeZone, bigNanoInHour, bigNanoInMicro, bigNanoInMilli, bigNanoInMinute, bigNanoInSec, bigNanoInUtcDay, bindArgs, checkEpochNanoInBounds, checkIsoDateInBounds, checkIsoDateTimeInBounds, checkIsoYearMonthInBounds, checkResolvedCalendarCompatible, clampEntity, coerceRoundingIncInteger, coerceRoundingMode, combineDateAndTime, compareBigInts, compareDurations, compareIsoDateFields, compareIsoDateTimeFields, compareNumbers, compareTimeFields, compareZonedEpochSlots, computeBigNanoInc, computeCalendarDateFields, computeCalendarDayOfYear, computeCalendarDaysInMonth, computeCalendarDaysInYear, computeCalendarEraFields, computeCalendarInLeapYear, computeCalendarIsoFieldsFromParts, computeCalendarMonthCode, computeCalendarMonthsInYear, computeCalendarWeekOfYear, computeCalendarYearOfWeek, computeDayFloor, computeEpochNanoFrac, computeGregoryEraFields, computeIsoDayOfWeek, computeIsoDaysInMonth, computeIsoDaysInYear, computeIsoFieldsFromParts, computeIsoInLeapYear, computeIsoMonthCodeParts, computeIsoWeekFields, computeIsoYearMonthFieldsForMonthDay, computeNanoInc, computeZonedHoursInDay, computeZonedStartOfDay, constrainToRange, convertPlainMonthDayToDate, convertPlainYearMonthToDate, convertToPlainMonthDay, convertToPlainYearMonth, createDateRelativeOps, createDateSlots, createDateTimeFormatShell, createDateTimeRelativeOps, createDateTimeSlots, createDurationSlots, createEpochNanoSlots, createNameDescriptors, createPlainDateTimeFromRefinedFields, createPlainMonthDayFromFields, createPlainYearMonthFromFields, createPropDescriptors, createPropGetters, createStringTagDescriptors, createTimeSlots, createZonedEpochNanoSlots, createZonedRelativeOps, diffCalendarDates, diffEpochMilliDays, diffInstants, diffIsoMonthSlots, diffPlainDateTimes, diffPlainDates, diffPlainTimes, diffPlainYearMonth, diffZonedDateTimes, divideBigNanoToExactNumber, durationFieldDefaults, durationGetters, epochDaysToIsoDate, epochMilliToInstant, epochMilliToIsoDateTime, epochNanoToInstant, epochNanoToIsoDateTime, eraYearToYear, exoticCalendarRequired, forbiddenValueOf, formatDateIsoAuto, formatDateTimeIsoAuto, formatDurationIso, formatDurationIsoAuto, formatEpochMilliToPartsRecord, formatInstantIso, formatInstantIsoAuto, formatMonthDayIsoAuto, formatOffsetNano, formatPlainDateIso, formatPlainDateTimeIso, formatPlainMonthDayIso, formatPlainTimeIso, formatPlainYearMonthIso, formatTimeIsoAuto, formatYearMonthIsoAuto, formatZonedDateTimeIso, formatZonedDateTimeIsoAuto, getCalendarSlotId, getCommonCalendar, getCommonTimeZone, getCurrentEpochNano, getCurrentIsoDateTime, getCurrentTimeZoneId, getEpochMilli, getEpochNano, getMatchingInstantFor, getSingleInstantFor, getTimeZoneTransitionEpochNanoseconds, getZonedTimeZoneId, gregoryCalendarId, gregoryCalendarImpl, gregoryEraOrigins, instantToZonedDateTime, instantsEqual, invalidBag, invalidCalendar, invalidCallingContext, invalidFormatType, invalidRelativeTo, invalidTimeZone, isObjectLike, isoArgsToEpochDays, isoCalendarId, isoCalendarImpl, isoDateTimeToEpochMilli, isoDateTimeToEpochNano, isoDateToEpochDays, isoDateToEpochMilli, isoDateToEpochNano, isoEpochFirstLeapYear, isoEpochOriginYear, isoMonthsInYear, mapProps, maxMilli, memoize, mergeDurationFields, mergePlainDateFields, mergePlainDateTimeFields, mergePlainMonthDayFields, mergePlainTimeFields, mergePlainYearMonthFields, mergeZonedDateTimeFields, milliInUtcDay, mismatchingFormatTypes, modFloor, monthCodeNumberToMonth, monthToMonthCodeNumber, moveByDays, moveDate, moveDateTime, moveEpochNano, moveTime, moveYearMonth, moveZonedEpochSlots, nanoInHour, nanoInMicro, nanoInMilli, nanoInMinute, nanoInSec, nanoInUtcDay, nanoToTimeAndDay, negateDuration, negateDurationFields, noop, normalizeOptionsOrString, outOfBoundsDate, parseCalendarId, parseDuration, parseInstant, parsePlainDate, parsePlainDateTime, parsePlainMonthDay, parsePlainTime, parsePlainYearMonth, parseRelativeToSlots, parseTimeZoneId, parseZonedDateTime, plainDateTimeToZonedDateTime, plainDateTimesEqual, plainDateToZonedDateTime, plainDatesEqual, plainMonthDaysEqual, plainTimesEqual, plainYearMonthsEqual, prepareZonedEpochDiff, queryTimeZone, refineDurationObjectLike, refineMaybeZonedDateTimeObjectLike, refineOverflowOptions, refinePlainDateObjectLike, refinePlainDateTimeObjectLike, refinePlainMonthDayObjectLike, refinePlainTimeObjectLike, refinePlainYearMonthObjectLike, refineRoundingOptions, refineTimeZoneId, refineUnitDiffOptions, refineZonedDateTimeObjectLike, refineZonedFieldOptions, requireNumberIsInteger, requireString, resolveTimeZoneId, roundBigNanoToDayOriginInc, roundBigNanoToInc, roundDateTimeToNano, roundDuration, roundNumberToInc, roundTimeToNano, roundWithMode, roundZonedEpochSlotsToUnit, roundZonedEpochToInterval, roundingModeName, throwRangeError, throwTypeError, timeFieldDefaults, timeFieldsToMilli, timeFieldsToNano, timeGetters, toBigInt, toStrictInteger, totalDuration, totalRelativeDuration, transformDateOptions, transformDateTimeOptions, transformInstantOptions, transformMonthDayOptions, transformTimeOptions, transformYearMonthOptions, transformZonedOptions, unsupportedWeekNumbers, utcTimeZoneId, validateDurationFields, validateIsoDateFields, validateIsoDateTimeFields, validateRoundingInc, validateTimeFields, zonedDateTimeToInstant, zonedDateTimeToPlainDate, zonedDateTimeToPlainDateTime, zonedDateTimeToPlainTime, zonedDateTimeWithPlainTime, zonedDateTimesEqual, zonedEpochSlotsToIso };\n","const NativeTemporal = globalThis.Temporal;\n\nexport { NativeTemporal };\n","import { createNameDescriptors, createStringTagDescriptors, mapProps, noop, throwTypeError, invalidCallingContext, forbiddenValueOf as forbiddenValueOf$1, computeCalendarEraFields, computeCalendarDateFields, computeCalendarMonthCode, computeCalendarDaysInMonth, computeCalendarDaysInYear, computeCalendarMonthsInYear, computeCalendarInLeapYear, computeIsoDayOfWeek, computeCalendarDayOfYear, computeCalendarWeekOfYear, computeCalendarYearOfWeek, createPropGetters, durationGetters as durationGetters$1, timeGetters as timeGetters$1 } from \"./internal.js\";\n\nconst PlainYearMonthBranding = \"PlainYearMonth\";\n\nconst PlainMonthDayBranding = \"PlainMonthDay\";\n\nconst PlainDateBranding = \"PlainDate\";\n\nconst PlainDateTimeBranding = \"PlainDateTime\";\n\nconst PlainTimeBranding = \"PlainTime\";\n\nconst ZonedDateTimeBranding = \"ZonedDateTime\";\n\nconst InstantBranding = \"Instant\";\n\nconst DurationBranding = \"Duration\";\n\nconst CalendarBranding = \"Calendar\";\n\nfunction defineTemporalClass(branding, cls, getSlots, ...getterMaps) {\n return Object.defineProperties(cls, createNameDescriptors(branding)), Object.defineProperties(cls.prototype, createStringTagDescriptors(\"Temporal.\" + branding)), \n Object.defineProperties(cls.prototype, mapProps(getter => ({\n get() {\n return getter(getSlots(this));\n },\n configurable: 1\n }), Object.assign({}, ...getterMaps))), cls;\n}\n\nconst attachDebugString = \"noop\" === noop.name ? instance => {\n Object.defineProperty(instance, \"_str_\", {\n value: instance.toJSON()\n });\n} : noop;\n\nfunction invalidRecordType() {\n throwTypeError(invalidCallingContext);\n}\n\nfunction forbiddenValueOf() {\n throwTypeError(forbiddenValueOf$1);\n}\n\nconst yearMonthFieldGetters$1 = {\n era(slots) {\n return computeCalendarEraFields(slots.calendar, slots).era;\n },\n eraYear(slots) {\n return computeCalendarEraFields(slots.calendar, slots).eraYear;\n },\n year(slots) {\n return computeCalendarDateFields(slots.calendar, slots).year;\n },\n month(slots) {\n return computeCalendarDateFields(slots.calendar, slots).month;\n },\n monthCode(slots) {\n return computeCalendarMonthCode(slots.calendar, slots);\n }\n};\n\nconst dateFieldGetters$1 = {\n era(slots) {\n return computeCalendarEraFields(slots.calendar, slots).era;\n },\n eraYear(slots) {\n return computeCalendarEraFields(slots.calendar, slots).eraYear;\n },\n year(slots) {\n return computeCalendarDateFields(slots.calendar, slots).year;\n },\n month(slots) {\n return computeCalendarDateFields(slots.calendar, slots).month;\n },\n monthCode(slots) {\n return computeCalendarMonthCode(slots.calendar, slots);\n },\n day(slots) {\n return computeCalendarDateFields(slots.calendar, slots).day;\n }\n};\n\nconst monthDayFieldGetters$1 = {\n monthCode(slots) {\n return computeCalendarMonthCode(slots.calendar, slots);\n },\n day(slots) {\n return computeCalendarDateFields(slots.calendar, slots).day;\n }\n};\n\nconst yearMonthDerivedGetters = {\n daysInMonth(slots) {\n return computeCalendarDaysInMonth(slots.calendar, slots);\n },\n daysInYear(slots) {\n return computeCalendarDaysInYear(slots.calendar, slots);\n },\n monthsInYear(slots) {\n return computeCalendarMonthsInYear(slots.calendar, slots);\n },\n inLeapYear(slots) {\n return computeCalendarInLeapYear(slots.calendar, slots);\n }\n};\n\nconst dateDerivedGetters = {\n dayOfWeek(slots) {\n return computeIsoDayOfWeek(slots);\n },\n dayOfYear(slots) {\n return computeCalendarDayOfYear(slots.calendar, slots);\n },\n weekOfYear(slots) {\n return computeCalendarWeekOfYear(slots.calendar, slots);\n },\n yearOfWeek(slots) {\n return computeCalendarYearOfWeek(slots.calendar, slots);\n },\n daysInWeek() {\n return 7;\n },\n daysInMonth(slots) {\n return computeCalendarDaysInMonth(slots.calendar, slots);\n },\n daysInYear(slots) {\n return computeCalendarDaysInYear(slots.calendar, slots);\n },\n monthsInYear(slots) {\n return computeCalendarMonthsInYear(slots.calendar, slots);\n },\n inLeapYear(slots) {\n return computeCalendarInLeapYear(slots.calendar, slots);\n }\n};\n\nfunction createNativeGetters(shimGetters) {\n return createPropGetters(Object.keys(shimGetters));\n}\n\nconst durationGetters = /*@__PURE__*/ createNativeGetters(durationGetters$1);\n\nconst timeGetters = /*@__PURE__*/ createNativeGetters(timeGetters$1);\n\nconst yearMonthFieldGetters = /*@__PURE__*/ createNativeGetters(yearMonthFieldGetters$1);\n\nconst dateFieldGetters = /*@__PURE__*/ createNativeGetters(dateFieldGetters$1);\n\nconst monthDayFieldGetters = /*@__PURE__*/ createNativeGetters(monthDayFieldGetters$1);\n\ncreateNativeGetters(yearMonthDerivedGetters), createNativeGetters(dateDerivedGetters);\n\nexport { CalendarBranding, DurationBranding, InstantBranding, PlainDateBranding, PlainDateTimeBranding, PlainMonthDayBranding, PlainTimeBranding, PlainYearMonthBranding, ZonedDateTimeBranding, attachDebugString, dateDerivedGetters, dateFieldGetters$1 as dateFieldGetters, dateFieldGetters as dateFieldGetters$1, defineTemporalClass, durationGetters, forbiddenValueOf, invalidRecordType, monthDayFieldGetters$1 as monthDayFieldGetters, monthDayFieldGetters as monthDayFieldGetters$1, timeGetters, yearMonthDerivedGetters, yearMonthFieldGetters$1 as yearMonthFieldGetters, yearMonthFieldGetters as yearMonthFieldGetters$1 };\n","import { createPropDescriptors, createDateTimeFormatShell, memoize, throwTypeError, invalidFormatType, applyPlainFormatTimeZone, transformMonthDayOptions, transformYearMonthOptions, transformTimeOptions, transformDateOptions, transformDateTimeOptions, transformInstantOptions, RawDateTimeFormat, mismatchingFormatTypes, checkResolvedCalendarCompatible, timeFieldsToMilli, isoDateToEpochMilli, isoDateTimeToEpochMilli, getEpochMilli } from \"./internal.js\";\n\nimport { PlainMonthDayBranding, PlainYearMonthBranding, PlainTimeBranding, PlainDateBranding, PlainDateTimeBranding, InstantBranding } from \"./apiHelpers.js\";\n\nfunction createIntlExtended(DateTimeFormat) {\n return Object.defineProperties(Object.create(Intl), createPropDescriptors({\n DateTimeFormat: DateTimeFormat\n }));\n}\n\nfunction createDateTimeFormatClass(getTemporalBrandingAndSlots) {\n return createDateTimeFormatShell(internals => {\n const getTemporalFormat = memoize(branding => {\n let options;\n switch (branding) {\n case InstantBranding:\n options = transformInstantOptions(internals.F, 1);\n break;\n\n case PlainDateTimeBranding:\n options = applyPlainFormatTimeZone(transformDateTimeOptions(internals.F, 1));\n break;\n\n case PlainDateBranding:\n options = applyPlainFormatTimeZone(transformDateOptions(internals.F, 1));\n break;\n\n case PlainTimeBranding:\n options = applyPlainFormatTimeZone(transformTimeOptions(internals.F, 1));\n break;\n\n case PlainYearMonthBranding:\n options = applyPlainFormatTimeZone(transformYearMonthOptions(internals.F, 1));\n break;\n\n case PlainMonthDayBranding:\n options = applyPlainFormatTimeZone(transformMonthDayOptions(internals.F, 1));\n break;\n\n default:\n throwTypeError(invalidFormatType(branding));\n }\n return new RawDateTimeFormat(internals.ze, options);\n });\n return {\n A(formattable) {\n if (void 0 === formattable) {\n return [ internals.t ];\n }\n const brandingAndSlots = getTemporalBrandingAndSlots(formattable);\n if (!brandingAndSlots) {\n return [ internals.t, Number(formattable) ];\n }\n const [branding, slots] = brandingAndSlots;\n const format = getTemporalFormat(branding);\n return checkTemporalDateTimeFormatCompatible(format, branding, slots), [ format, temporalDateTimeToEpochMilli(branding, slots) ];\n },\n v(start, end) {\n void 0 !== start && void 0 !== end || throwTypeError(mismatchingFormatTypes);\n const startBrandingAndSlots = getTemporalBrandingAndSlots(start);\n const startEpochMilli = startBrandingAndSlots ? void 0 : Number(start);\n const endBrandingAndSlots = getTemporalBrandingAndSlots(end);\n const endEpochMilli = endBrandingAndSlots ? void 0 : Number(end);\n if (!startBrandingAndSlots && !endBrandingAndSlots) {\n return [ internals.t, startEpochMilli, endEpochMilli ];\n }\n startBrandingAndSlots && endBrandingAndSlots || throwTypeError(mismatchingFormatTypes);\n const [startBranding, startSlots] = startBrandingAndSlots;\n const [endBranding, endSlots] = endBrandingAndSlots;\n startBranding !== endBranding && throwTypeError(mismatchingFormatTypes);\n const format = getTemporalFormat(startBranding);\n return checkTemporalDateTimeFormatCompatible(format, startBranding, startSlots), \n checkTemporalDateTimeFormatCompatible(format, startBranding, endSlots), [ format, temporalDateTimeToEpochMilli(startBranding, startSlots), temporalDateTimeToEpochMilli(startBranding, endSlots) ];\n }\n };\n });\n}\n\nfunction checkTemporalDateTimeFormatCompatible(format, branding, slots) {\n switch (branding) {\n case InstantBranding:\n case PlainTimeBranding:\n return;\n\n case PlainDateTimeBranding:\n case PlainDateBranding:\n return void checkResolvedCalendarCompatible(format, slots);\n\n case PlainYearMonthBranding:\n case PlainMonthDayBranding:\n return void checkResolvedCalendarCompatible(format, slots, 1);\n\n default:\n throwTypeError(invalidFormatType(branding));\n }\n}\n\nfunction temporalDateTimeToEpochMilli(branding, slots) {\n switch (branding) {\n case InstantBranding:\n return getEpochMilli(slots);\n\n case PlainDateTimeBranding:\n return isoDateTimeToEpochMilli(slots);\n\n case PlainDateBranding:\n case PlainYearMonthBranding:\n case PlainMonthDayBranding:\n return isoDateToEpochMilli(slots);\n\n case PlainTimeBranding:\n return timeFieldsToMilli(slots);\n\n default:\n throwTypeError(invalidFormatType(branding));\n }\n}\n\nexport { createDateTimeFormatClass, createIntlExtended };\n","import { requireString, isoCalendarId, isoCalendarImpl, gregoryCalendarId, gregoryCalendarImpl, throwRangeError, exoticCalendarRequired, timeGetters, checkEpochNanoInBounds, toBigInt, queryTimeZone, refineTimeZoneId, compareZonedEpochSlots, getCalendarSlotId, getEpochMilli, getEpochNano, formatOffsetNano, zonedEpochSlotsToIso, computeZonedHoursInDay, mergeZonedDateTimeFields, zonedDateTimeWithPlainTime, moveZonedEpochSlots, negateDurationFields, getCommonCalendar, createDurationSlots, diffZonedDateTimes, refineRoundingOptions, roundZonedEpochSlotsToUnit, computeZonedStartOfDay, zonedDateTimesEqual, zonedDateTimeToInstant, zonedDateTimeToPlainDateTime, zonedDateTimeToPlainDate, zonedDateTimeToPlainTime, RawDateTimeFormat, applyZonedFormatTimeZone, getZonedTimeZoneId, transformZonedOptions, checkResolvedCalendarCompatible, formatZonedDateTimeIso, getTimeZoneTransitionEpochNanoseconds, isObjectLike, refineZonedFieldOptions, refineZonedDateTimeObjectLike, parseZonedDateTime, createZonedEpochNanoSlots, throwTypeError, invalidTimeZone, resolveTimeZoneId, parseTimeZoneId, epochMilliToInstant, epochNanoToInstant, createEpochNanoSlots, moveEpochNano, diffInstants, roundBigNanoToDayOriginInc, computeBigNanoInc, instantsEqual, instantToZonedDateTime, transformInstantOptions, formatInstantIso, parseInstant, requireNumberIsInteger, bigNanoInMilli, isoEpochFirstLeapYear, checkIsoDateInBounds, validateIsoDateFields, createDateSlots, mergePlainMonthDayFields, plainMonthDaysEqual, convertPlainMonthDayToDate, applyPlainFormatTimeZone, transformMonthDayOptions, isoDateToEpochMilli, formatPlainMonthDayIso, refineOverflowOptions, refinePlainMonthDayObjectLike, parsePlainMonthDay, checkIsoYearMonthInBounds, compareIsoDateFields, mergePlainYearMonthFields, moveYearMonth, diffPlainYearMonth, plainYearMonthsEqual, convertPlainYearMonthToDate, transformYearMonthOptions, formatPlainYearMonthIso, refinePlainYearMonthObjectLike, parsePlainYearMonth, invalidBag, validateTimeFields, mapProps, createTimeSlots, compareTimeFields, mergePlainTimeFields, moveTime, diffPlainTimes, roundTimeToNano, plainTimesEqual, transformTimeOptions, timeFieldsToMilli, formatPlainTimeIso, refinePlainTimeObjectLike, parsePlainTime, computeNanoInc, checkIsoDateTimeInBounds, validateIsoDateTimeFields, createDateTimeSlots, compareIsoDateTimeFields, mergePlainDateTimeFields, createPlainDateTimeFromRefinedFields, moveDateTime, diffPlainDateTimes, roundDateTimeToNano, plainDateTimesEqual, plainDateTimeToZonedDateTime, transformDateTimeOptions, isoDateTimeToEpochMilli, formatPlainDateTimeIso, combineDateAndTime, refinePlainDateTimeObjectLike, parsePlainDateTime, timeFieldDefaults, mergePlainDateFields, moveDate, diffPlainDates, plainDatesEqual, plainDateToZonedDateTime, convertToPlainYearMonth, convertToPlainMonthDay, transformDateOptions, formatPlainDateIso, refinePlainDateObjectLike, parsePlainDate, invalidCalendar, parseCalendarId, durationGetters, validateDurationFields, toStrictInteger, compareDurations, mergeDurationFields, negateDuration, absDuration, addDurations, roundDuration, totalDuration, formatDurationIso, refineDurationObjectLike, parseDuration, refineMaybeZonedDateTimeObjectLike, parseRelativeToSlots, createStringTagDescriptors, createPropDescriptors, getCurrentTimeZoneId, getCurrentEpochNano, getCurrentIsoDateTime } from \"./internal.js\";\n\nimport { createDateTimeFormatClass, createIntlExtended } from \"./classApi.js\";\n\nimport { defineTemporalClass, dateDerivedGetters, dateFieldGetters, forbiddenValueOf, ZonedDateTimeBranding, invalidRecordType, attachDebugString, InstantBranding, monthDayFieldGetters, PlainMonthDayBranding, yearMonthDerivedGetters, yearMonthFieldGetters, PlainYearMonthBranding, PlainDateTimeBranding, PlainDateBranding, PlainTimeBranding, DurationBranding } from \"./apiHelpers.js\";\n\nimport \"temporal-utils/protected-error-messages\";\n\nimport { toIntegerWithTrunc } from \"temporal-utils/protected\";\n\nfunction resolveBasicCalendarId(rawCalendarId) {\n const lowerRawCalendarId = requireString(rawCalendarId).toLowerCase();\n return lowerRawCalendarId === isoCalendarId ? isoCalendarImpl : lowerRawCalendarId === gregoryCalendarId ? gregoryCalendarImpl : void throwRangeError(exoticCalendarRequired(rawCalendarId, \"temporal-polyfill/full\"));\n}\n\nfunction resolveBasicCalendarArg(rawCalendarId = isoCalendarId) {\n return resolveBasicCalendarId(rawCalendarId);\n}\n\nconst zonedDateTimeSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst ZonedDateTime = /*@__PURE__*/ defineTemporalClass(ZonedDateTimeBranding, class {\n constructor(epochNanoseconds, timeZoneId, calendar = void 0) {\n const epochNano = checkEpochNanoInBounds(toBigInt(epochNanoseconds));\n const timeZone = queryTimeZone(refineTimeZoneId(timeZoneId));\n const calendarImpl = resolveBasicCalendarArg(calendar);\n initZonedDateTime(this, createZonedEpochNanoSlots(epochNano, timeZone, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createZonedDateTime(toZonedDateTimeSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareZonedEpochSlots(toZonedDateTimeSlots(arg0), toZonedDateTimeSlots(arg1));\n }\n get calendarId() {\n return getCalendarSlotId(getZonedDateTimeSlots(this).calendar);\n }\n get timeZoneId() {\n return getZonedDateTimeSlots(this).timeZone.id;\n }\n get epochMilliseconds() {\n return getEpochMilli(getZonedDateTimeSlots(this));\n }\n get epochNanoseconds() {\n return getEpochNano(getZonedDateTimeSlots(this));\n }\n get offset() {\n return formatOffsetNano(zonedEpochSlotsToIso(getZonedDateTimeSlots(this)).offsetNanoseconds);\n }\n get offsetNanoseconds() {\n return zonedEpochSlotsToIso(getZonedDateTimeSlots(this)).offsetNanoseconds;\n }\n get hoursInDay() {\n return computeZonedHoursInDay(getZonedDateTimeSlots(this));\n }\n with(mod, options = void 0) {\n return createZonedDateTime(mergeZonedDateTimeFields(getZonedDateTimeSlots(this), validateBag(mod), options));\n }\n withCalendar(calendarArg) {\n return createZonedDateTime({\n ...getZonedDateTimeSlots(this),\n calendar: refineCalendarArg(calendarArg)\n });\n }\n withTimeZone(timeZoneArg) {\n return createZonedDateTime({\n ...getZonedDateTimeSlots(this),\n timeZone: queryTimeZone(refineTimeZoneArg(timeZoneArg))\n });\n }\n withPlainTime(plainTimeArg = void 0) {\n return createZonedDateTime(zonedDateTimeWithPlainTime(getZonedDateTimeSlots(this), optionalToPlainTimeFields(plainTimeArg)));\n }\n add(durationArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n return createZonedDateTime(moveZonedEpochSlots(slots, toDurationSlots(durationArg), options));\n }\n subtract(durationArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n return createZonedDateTime(moveZonedEpochSlots(slots, negateDurationFields(toDurationSlots(durationArg)), options));\n }\n until(otherArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n const other = toZonedDateTimeSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(createDurationSlots(diffZonedDateTimes(0, calendar, slots, other, options)));\n }\n since(otherArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n const other = toZonedDateTimeSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(createDurationSlots(diffZonedDateTimes(1, calendar, slots, other, options)));\n }\n round(options) {\n const slots = getZonedDateTimeSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options);\n return createZonedDateTime(roundZonedEpochSlotsToUnit(slots, smallestUnit, roundingInc, roundingMode));\n }\n startOfDay() {\n return createZonedDateTime(computeZonedStartOfDay(getZonedDateTimeSlots(this)));\n }\n equals(otherArg) {\n return zonedDateTimesEqual(getZonedDateTimeSlots(this), toZonedDateTimeSlots(otherArg));\n }\n toInstant() {\n return createInstant(zonedDateTimeToInstant(getZonedDateTimeSlots(this)));\n }\n toPlainDateTime() {\n return createPlainDateTime(zonedDateTimeToPlainDateTime(getZonedDateTimeSlots(this)));\n }\n toPlainDate() {\n return createPlainDate(zonedDateTimeToPlainDate(getZonedDateTimeSlots(this)));\n }\n toPlainTime() {\n return createPlainTime(zonedDateTimeToPlainTime(getZonedDateTimeSlots(this)));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getZonedDateTimeSlots(this);\n const format = new RawDateTimeFormat(locales, applyZonedFormatTimeZone(transformZonedOptions(options), getZonedTimeZoneId(slots)));\n return checkResolvedCalendarCompatible(format, slots), format.format(getEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatZonedDateTimeIso(getZonedDateTimeSlots(this), options);\n }\n toJSON() {\n return formatZonedDateTimeIso(getZonedDateTimeSlots(this));\n }\n getTimeZoneTransition(options) {\n const slots = getZonedDateTimeSlots(this);\n const newEpochNano = getTimeZoneTransitionEpochNanoseconds(slots, options);\n return newEpochNano ? createZonedDateTime({\n ...slots,\n epochNanoseconds: newEpochNano\n }) : null;\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getZonedDateTimeIsoSlots, dateFieldGetters, dateDerivedGetters, timeGetters);\n\nfunction createZonedDateTime(slots) {\n return initZonedDateTime(Object.create(ZonedDateTime.prototype), slots);\n}\n\nfunction getZonedDateTimeSlots(obj) {\n return getZonedDateTimeSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getZonedDateTimeIsoSlots(obj) {\n const slots = getZonedDateTimeSlots(obj);\n return {\n ...zonedEpochSlotsToIso(slots),\n calendar: slots.calendar\n };\n}\n\nfunction getZonedDateTimeSlotsIfPresent(obj) {\n return zonedDateTimeSlotsMap.get(obj);\n}\n\nfunction toZonedDateTimeSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (ownSlots) {\n return refineZonedFieldOptions(options), ownSlots;\n }\n const calendar = getCalendarFromBag(arg);\n return refineZonedDateTimeObjectLike(refineTimeZoneArg, calendar, arg, options);\n }\n return parseZonedDateTime(arg, resolveBasicCalendarId, options);\n}\n\nfunction initZonedDateTime(instance, slots) {\n return zonedDateTimeSlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nfunction refineTimeZoneArg(arg) {\n if (isObjectLike(arg)) {\n const slots = getZonedDateTimeSlotsIfPresent(arg);\n return slots || throwTypeError(invalidTimeZone(arg)), slots.timeZone.id;\n }\n return (arg => resolveTimeZoneId(parseTimeZoneId(requireString(arg))))(arg);\n}\n\nconst instantSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst Instant = /*@__PURE__*/ defineTemporalClass(InstantBranding, class {\n constructor(epochNanoseconds) {\n const epochNano = checkEpochNanoInBounds(toBigInt(epochNanoseconds));\n initInstant(this, createEpochNanoSlots(epochNano));\n }\n static from(arg) {\n return createInstant(toInstantSlots(arg));\n }\n static fromEpochMilliseconds(epochMilli) {\n return createInstant(epochMilliToInstant(epochMilli));\n }\n static fromEpochNanoseconds(epochNano) {\n return createInstant(epochNanoToInstant(epochNano));\n }\n static compare(a, b) {\n return compareZonedEpochSlots(toInstantSlots(a), toInstantSlots(b));\n }\n get epochMilliseconds() {\n return getEpochMilli(getInstantSlots(this));\n }\n get epochNanoseconds() {\n return getEpochNano(getInstantSlots(this));\n }\n add(durationArg) {\n const slots = getInstantSlots(this);\n return createInstant(createEpochNanoSlots(moveEpochNano(slots.epochNanoseconds, toDurationSlots(durationArg))));\n }\n subtract(durationArg) {\n const slots = getInstantSlots(this);\n return createInstant(createEpochNanoSlots(moveEpochNano(slots.epochNanoseconds, negateDurationFields(toDurationSlots(durationArg)))));\n }\n until(otherArg, options = void 0) {\n return createDuration(diffInstants(0, getInstantSlots(this), toInstantSlots(otherArg), options));\n }\n since(otherArg, options = void 0) {\n return createDuration(diffInstants(1, getInstantSlots(this), toInstantSlots(otherArg), options));\n }\n round(options) {\n const slots = getInstantSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options, 5, 1);\n return createInstant(createEpochNanoSlots(roundBigNanoToDayOriginInc(slots.epochNanoseconds, computeBigNanoInc(smallestUnit, roundingInc), roundingMode)));\n }\n equals(otherArg) {\n return instantsEqual(getInstantSlots(this), toInstantSlots(otherArg));\n }\n toZonedDateTimeISO(timeZoneArg) {\n return createZonedDateTime(instantToZonedDateTime(getInstantSlots(this), queryTimeZone(refineTimeZoneArg(timeZoneArg))));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getInstantSlots(this);\n return new RawDateTimeFormat(locales, transformInstantOptions(options)).format(getEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatInstantIso(refineTimeZoneArg, getInstantSlots(this), options);\n }\n toJSON() {\n return formatInstantIso(refineTimeZoneArg, getInstantSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n});\n\nfunction createInstant(slots) {\n return initInstant(Object.create(Instant.prototype), slots);\n}\n\nfunction getInstantSlots(obj) {\n return getInstantSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getInstantSlotsIfPresent(obj) {\n return instantSlotsMap.get(obj);\n}\n\nfunction toInstantSlots(arg) {\n if (isObjectLike(arg)) {\n const ownSlots = getInstantSlotsIfPresent(arg);\n if (ownSlots) {\n return ownSlots;\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (zonedDateTimeSlots) {\n return createEpochNanoSlots(zonedDateTimeSlots.epochNanoseconds);\n }\n }\n return parseInstant(arg);\n}\n\nconst {toTemporalInstant: toTemporalInstant} = {\n toTemporalInstant() {\n const epochMilli = Date.prototype.valueOf.call(this);\n return createInstant(createEpochNanoSlots(BigInt(requireNumberIsInteger(epochMilli)) * bigNanoInMilli));\n }\n};\n\nfunction initInstant(instance, slots) {\n return instantSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nconst plainMonthDaySlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainMonthDay = /*@__PURE__*/ defineTemporalClass(PlainMonthDayBranding, class {\n constructor(isoMonth, isoDay, calendar = void 0, referenceIsoYear) {\n const isoMonthInt = toIntegerWithTrunc(isoMonth);\n const isoDayInt = toIntegerWithTrunc(isoDay);\n const calendarImpl = resolveBasicCalendarArg(calendar);\n const isoYearInt = toIntegerWithTrunc(referenceIsoYear ?? isoEpochFirstLeapYear);\n const fields = checkIsoDateInBounds(validateIsoDateFields({\n year: isoYearInt,\n month: isoMonthInt,\n day: isoDayInt\n }));\n initPlainMonthDay(this, createDateSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainMonthDay(toPlainMonthDaySlots(arg, options));\n }\n get calendarId() {\n return getCalendarSlotId(getPlainMonthDaySlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainMonthDay(mergePlainMonthDayFields(getPlainMonthDaySlots(this), validateBag(mod), options));\n }\n equals(otherArg) {\n return plainMonthDaysEqual(getPlainMonthDaySlots(this), toPlainMonthDaySlots(otherArg));\n }\n toPlainDate(bag) {\n const slots = getPlainMonthDaySlots(this);\n return createPlainDate(convertPlainMonthDayToDate(slots.calendar, this, bag));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainMonthDaySlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformMonthDayOptions(options)));\n return checkResolvedCalendarCompatible(format, slots, 1), format.format(isoDateToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainMonthDayIso(getPlainMonthDaySlots(this), options);\n }\n toJSON() {\n return formatPlainMonthDayIso(getPlainMonthDaySlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainMonthDaySlots, monthDayFieldGetters);\n\nfunction createPlainMonthDay(slots) {\n return initPlainMonthDay(Object.create(PlainMonthDay.prototype), slots);\n}\n\nfunction getPlainMonthDaySlots(obj) {\n return getPlainMonthDaySlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainMonthDaySlotsIfPresent(obj) {\n return plainMonthDaySlotsMap.get(obj);\n}\n\nfunction toPlainMonthDaySlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainMonthDaySlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const calendarMaybe = extractCalendarFromBag(arg);\n return refinePlainMonthDayObjectLike(void 0 === calendarMaybe ? isoCalendarImpl : calendarMaybe, void 0 === calendarMaybe, arg, options);\n }\n const res = parsePlainMonthDay(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainMonthDay(instance, slots) {\n return plainMonthDaySlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nconst plainYearMonthSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainYearMonth = /*@__PURE__*/ defineTemporalClass(PlainYearMonthBranding, class {\n constructor(isoYear, isoMonth, calendar = void 0, referenceIsoDay) {\n const isoYearInt = toIntegerWithTrunc(isoYear);\n const isoMonthInt = toIntegerWithTrunc(isoMonth);\n const calendarImpl = resolveBasicCalendarArg(calendar);\n const isoDayInt = toIntegerWithTrunc(referenceIsoDay ?? 1);\n const fields = checkIsoYearMonthInBounds(validateIsoDateFields({\n year: isoYearInt,\n month: isoMonthInt,\n day: isoDayInt\n }));\n initPlainYearMonth(this, createDateSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainYearMonth(toPlainYearMonthSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareIsoDateFields(toPlainYearMonthSlots(arg0), toPlainYearMonthSlots(arg1));\n }\n get calendarId() {\n return getCalendarSlotId(getPlainYearMonthSlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainYearMonth(mergePlainYearMonthFields(getPlainYearMonthSlots(this), validateBag(mod), options));\n }\n add(durationArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n return createPlainYearMonth(createDateSlots(moveYearMonth(0, slots.calendar, slots, toDurationSlots(durationArg), options), slots.calendar));\n }\n subtract(durationArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n return createPlainYearMonth(createDateSlots(moveYearMonth(1, slots.calendar, slots, toDurationSlots(durationArg), options), slots.calendar));\n }\n until(otherArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n const other = toPlainYearMonthSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(diffPlainYearMonth(0, calendar, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n const other = toPlainYearMonthSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(diffPlainYearMonth(1, calendar, slots, other, options));\n }\n equals(otherArg) {\n return plainYearMonthsEqual(getPlainYearMonthSlots(this), toPlainYearMonthSlots(otherArg));\n }\n toPlainDate(bag) {\n const slots = getPlainYearMonthSlots(this);\n return createPlainDate(convertPlainYearMonthToDate(slots.calendar, this, bag));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainYearMonthSlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformYearMonthOptions(options)));\n return checkResolvedCalendarCompatible(format, slots, 1), format.format(isoDateToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainYearMonthIso(getPlainYearMonthSlots(this), options);\n }\n toJSON() {\n return formatPlainYearMonthIso(getPlainYearMonthSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainYearMonthSlots, yearMonthFieldGetters, yearMonthDerivedGetters);\n\nfunction createPlainYearMonth(slots) {\n return initPlainYearMonth(Object.create(PlainYearMonth.prototype), slots);\n}\n\nfunction getPlainYearMonthSlots(obj) {\n return getPlainYearMonthSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainYearMonthSlotsIfPresent(obj) {\n return plainYearMonthSlotsMap.get(obj);\n}\n\nfunction toPlainYearMonthSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainYearMonthSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const calendar = getCalendarFromBag(arg);\n return refinePlainYearMonthObjectLike(calendar, arg, options);\n }\n const res = parsePlainYearMonth(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainYearMonth(instance, slots) {\n return plainYearMonthSlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nfunction getTemporalBrandingAndSlots(obj) {\n if (!isObjectLike(obj)) {\n return;\n }\n let slots = getInstantSlotsIfPresent(obj);\n return slots ? [ InstantBranding, slots ] : (slots = getZonedDateTimeSlotsIfPresent(obj), \n slots ? [ ZonedDateTimeBranding, slots ] : (slots = getPlainDateTimeSlotsIfPresent(obj), \n slots ? [ PlainDateTimeBranding, slots ] : (slots = getPlainDateSlotsIfPresent(obj), \n slots ? [ PlainDateBranding, slots ] : (slots = getPlainTimeSlotsIfPresent(obj), \n slots ? [ PlainTimeBranding, slots ] : (slots = getPlainYearMonthSlotsIfPresent(obj), \n slots ? [ PlainYearMonthBranding, slots ] : (slots = getPlainMonthDaySlotsIfPresent(obj), \n slots ? [ PlainMonthDayBranding, slots ] : (slots = getDurationSlotsIfPresent(obj), \n slots ? [ DurationBranding, slots ] : void 0)))))));\n}\n\nfunction validateBag(bag) {\n return (getTemporalBrandingAndSlots(bag) || void 0 !== bag.calendar || void 0 !== bag.timeZone) && throwTypeError(invalidBag), \n bag;\n}\n\nconst plainTimeSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainTime = /*@__PURE__*/ defineTemporalClass(PlainTimeBranding, class {\n constructor(hour = 0, minute = 0, second = 0, millisecond = 0, microsecond = 0, nanosecond = 0) {\n const fields = validateTimeFields(mapProps(toIntegerWithTrunc, {\n hour: hour,\n minute: minute,\n second: second,\n millisecond: millisecond,\n microsecond: microsecond,\n nanosecond: nanosecond\n }));\n initPlainTime(this, createTimeSlots(fields));\n }\n static from(arg, options = void 0) {\n return createPlainTime(toPlainTimeSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareTimeFields(toPlainTimeSlots(arg0), toPlainTimeSlots(arg1));\n }\n with(mod, options = void 0) {\n return createPlainTime(mergePlainTimeFields(getPlainTimeSlots(this), validateBag(mod), options));\n }\n add(durationArg) {\n const slots = getPlainTimeSlots(this);\n return createPlainTime(moveTime(slots, toDurationSlots(durationArg))[0]);\n }\n subtract(durationArg) {\n const slots = getPlainTimeSlots(this);\n return createPlainTime(moveTime(slots, negateDurationFields(toDurationSlots(durationArg)))[0]);\n }\n until(otherArg, options = void 0) {\n return createDuration(diffPlainTimes(0, getPlainTimeSlots(this), toPlainTimeSlots(otherArg), options));\n }\n since(otherArg, options = void 0) {\n return createDuration(diffPlainTimes(1, getPlainTimeSlots(this), toPlainTimeSlots(otherArg), options));\n }\n round(options) {\n const slots = getPlainTimeSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options, 5);\n return createPlainTime(roundTimeToNano(slots, computeNanoInc(smallestUnit, roundingInc), roundingMode)[0]);\n }\n equals(other) {\n return plainTimesEqual(getPlainTimeSlots(this), toPlainTimeSlots(other));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainTimeSlots(this);\n return new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformTimeOptions(options))).format(timeFieldsToMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainTimeIso(getPlainTimeSlots(this), options);\n }\n toJSON() {\n return formatPlainTimeIso(getPlainTimeSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainTimeSlots, timeGetters);\n\nfunction createPlainTime(slots) {\n return initPlainTime(Object.create(PlainTime.prototype), slots);\n}\n\nfunction getPlainTimeSlots(obj) {\n return getPlainTimeSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainTimeSlotsIfPresent(obj) {\n return plainTimeSlotsMap.get(obj);\n}\n\nfunction toPlainTimeSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainTimeSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const dateTimeSlots = getPlainDateTimeSlotsIfPresent(arg);\n if (dateTimeSlots) {\n return refineOverflowOptions(options), createTimeSlots(dateTimeSlots);\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n return zonedDateTimeSlots ? (refineOverflowOptions(options), zonedDateTimeToPlainTime(zonedDateTimeSlots)) : refinePlainTimeObjectLike(arg, options);\n }\n const timeSlots = parsePlainTime(arg);\n return refineOverflowOptions(options), timeSlots;\n}\n\nfunction optionalToPlainTimeFields(timeArg) {\n return void 0 === timeArg ? void 0 : toPlainTimeSlots(timeArg);\n}\n\nfunction initPlainTime(instance, slots) {\n return plainTimeSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nconst plainDateTimeSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainDateTime = /*@__PURE__*/ defineTemporalClass(PlainDateTimeBranding, class {\n constructor(isoYear, isoMonth, isoDay, hour = 0, minute = 0, second = 0, millisecond = 0, microsecond = 0, nanosecond = 0, calendar = void 0) {\n const fields = checkIsoDateTimeInBounds(validateIsoDateTimeFields(mapProps(toIntegerWithTrunc, {\n year: isoYear,\n month: isoMonth,\n day: isoDay,\n hour: hour,\n minute: minute,\n second: second,\n millisecond: millisecond,\n microsecond: microsecond,\n nanosecond: nanosecond\n })));\n const calendarImpl = resolveBasicCalendarArg(calendar);\n initPlainDateTime(this, createDateTimeSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainDateTime(toPlainDateTimeSlots(arg, options));\n }\n static compare(arg0, arg1) {\n const slots0 = toPlainDateTimeSlots(arg0);\n const slots1 = toPlainDateTimeSlots(arg1);\n return compareIsoDateTimeFields(slots0, slots1);\n }\n get calendarId() {\n return getCalendarSlotId(getPlainDateTimeSlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainDateTime(mergePlainDateTimeFields(getPlainDateTimeSlots(this), validateBag(mod), options));\n }\n withCalendar(calendarArg) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeSlots(slots, refineCalendarArg(calendarArg)));\n }\n withPlainTime(plainTimeArg = void 0) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createPlainDateTimeFromRefinedFields(slots, optionalToPlainTimeFields(plainTimeArg), slots.calendar));\n }\n add(durationArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeSlots(moveDateTime(slots.calendar, slots, toDurationSlots(durationArg), options), slots.calendar));\n }\n subtract(durationArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeSlots(moveDateTime(slots.calendar, slots, negateDurationFields(toDurationSlots(durationArg)), options), slots.calendar));\n }\n until(otherArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n const other = toPlainDateTimeSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(diffPlainDateTimes(0, calendar, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n const other = toPlainDateTimeSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(diffPlainDateTimes(1, calendar, slots, other, options));\n }\n round(options) {\n const slots = getPlainDateTimeSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options);\n return createPlainDateTime(createDateTimeSlots(roundDateTimeToNano(slots, computeNanoInc(smallestUnit, roundingInc), roundingMode), slots.calendar));\n }\n equals(otherArg) {\n return plainDateTimesEqual(getPlainDateTimeSlots(this), toPlainDateTimeSlots(otherArg));\n }\n toZonedDateTime(timeZoneArg, options = void 0) {\n return createZonedDateTime(plainDateTimeToZonedDateTime(getPlainDateTimeSlots(this), queryTimeZone(refineTimeZoneArg(timeZoneArg)), options));\n }\n toPlainDate() {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDate(createDateSlots(slots, slots.calendar));\n }\n toPlainTime() {\n return createPlainTime(createTimeSlots(getPlainDateTimeSlots(this)));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainDateTimeSlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformDateTimeOptions(options)));\n return checkResolvedCalendarCompatible(format, slots), format.format(isoDateTimeToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainDateTimeIso(getPlainDateTimeSlots(this), options);\n }\n toJSON() {\n return formatPlainDateTimeIso(getPlainDateTimeSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainDateTimeSlots, dateFieldGetters, dateDerivedGetters, timeGetters);\n\nfunction createPlainDateTime(slots) {\n return initPlainDateTime(Object.create(PlainDateTime.prototype), slots);\n}\n\nfunction getPlainDateTimeSlots(obj) {\n return getPlainDateTimeSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainDateTimeSlotsIfPresent(obj) {\n return plainDateTimeSlotsMap.get(obj);\n}\n\nfunction toPlainDateTimeSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainDateTimeSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const dateSlots = getPlainDateSlotsIfPresent(arg);\n if (dateSlots) {\n return refineOverflowOptions(options), createDateTimeSlots(combineDateAndTime(dateSlots, timeFieldDefaults), dateSlots.calendar);\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (zonedDateTimeSlots) {\n return refineOverflowOptions(options), zonedDateTimeToPlainDateTime(zonedDateTimeSlots);\n }\n const calendar = getCalendarFromBag(arg);\n return refinePlainDateTimeObjectLike(calendar, arg, options);\n }\n const res = parsePlainDateTime(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainDateTime(instance, slots) {\n return plainDateTimeSlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nconst plainDateSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainDate = /*@__PURE__*/ defineTemporalClass(PlainDateBranding, class {\n constructor(isoYear, isoMonth, isoDay, calendar = void 0) {\n const fields = checkIsoDateInBounds(validateIsoDateFields(mapProps(toIntegerWithTrunc, {\n year: isoYear,\n month: isoMonth,\n day: isoDay\n })));\n const calendarImpl = resolveBasicCalendarArg(calendar);\n initPlainDate(this, createDateSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainDate(toPlainDateSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareIsoDateFields(toPlainDateSlots(arg0), toPlainDateSlots(arg1));\n }\n get calendarId() {\n return getCalendarSlotId(getPlainDateSlots(this).calendar);\n }\n with(mod, options = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(mergePlainDateFields(slots, validateBag(mod), options));\n }\n withCalendar(calendarArg) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(createDateSlots(slots, refineCalendarArg(calendarArg)));\n }\n add(durationArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(createDateSlots(moveDate(slots.calendar, slots, toDurationSlots(durationArg), options), slots.calendar));\n }\n subtract(durationArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(createDateSlots(moveDate(slots.calendar, slots, negateDurationFields(toDurationSlots(durationArg)), options), slots.calendar));\n }\n until(otherArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n const other = toPlainDateSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(diffPlainDates(0, calendar, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n const other = toPlainDateSlots(otherArg);\n const calendar = getCommonCalendar(slots.calendar, other.calendar);\n return createDuration(diffPlainDates(1, calendar, slots, other, options));\n }\n equals(otherArg) {\n return plainDatesEqual(getPlainDateSlots(this), toPlainDateSlots(otherArg));\n }\n toZonedDateTime(options) {\n const optionsObj = isObjectLike(options) ? {\n timeZone: options.timeZone,\n plainTime: options.plainTime\n } : {\n timeZone: options\n };\n return createZonedDateTime(plainDateToZonedDateTime(refineTimeZoneArg, toPlainTimeSlots, getPlainDateSlots(this), optionsObj));\n }\n toPlainDateTime(plainTimeArg = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDateTime(createPlainDateTimeFromRefinedFields(slots, optionalToPlainTimeFields(plainTimeArg), slots.calendar));\n }\n toPlainYearMonth() {\n const slots = getPlainDateSlots(this);\n return createPlainYearMonth(convertToPlainYearMonth(slots.calendar, this));\n }\n toPlainMonthDay() {\n const slots = getPlainDateSlots(this);\n return createPlainMonthDay(convertToPlainMonthDay(slots.calendar, this));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainDateSlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformDateOptions(options)));\n return checkResolvedCalendarCompatible(format, slots), format.format(isoDateToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainDateIso(getPlainDateSlots(this), options);\n }\n toJSON() {\n return formatPlainDateIso(getPlainDateSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainDateSlots, dateFieldGetters, dateDerivedGetters);\n\nfunction createPlainDate(slots) {\n return initPlainDate(Object.create(PlainDate.prototype), slots);\n}\n\nfunction getPlainDateSlots(obj) {\n return getPlainDateSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainDateSlotsIfPresent(obj) {\n return plainDateSlotsMap.get(obj);\n}\n\nfunction toPlainDateSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainDateSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const dateTimeSlots = getPlainDateTimeSlotsIfPresent(arg);\n if (dateTimeSlots) {\n return refineOverflowOptions(options), createDateSlots(dateTimeSlots, dateTimeSlots.calendar);\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (zonedDateTimeSlots) {\n return refineOverflowOptions(options), zonedDateTimeToPlainDate(zonedDateTimeSlots);\n }\n const calendar = getCalendarFromBag(arg);\n return refinePlainDateObjectLike(calendar, arg, options);\n }\n const res = parsePlainDate(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainDate(instance, slots) {\n return plainDateSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nfunction getCalendarFromBag(bag) {\n const calendar = extractCalendarFromBag(bag);\n return void 0 === calendar ? isoCalendarImpl : calendar;\n}\n\nfunction extractCalendarFromBag(bag) {\n const {calendar: calendarArg} = bag;\n if (void 0 !== calendarArg) {\n return refineCalendarArg(calendarArg);\n }\n}\n\nfunction refineCalendarArg(arg) {\n if (isObjectLike(arg)) {\n const slots = getPlainDateSlotsIfPresent(arg) || getPlainDateTimeSlotsIfPresent(arg) || getZonedDateTimeSlotsIfPresent(arg) || getPlainMonthDaySlotsIfPresent(arg) || getPlainYearMonthSlotsIfPresent(arg);\n return slots || throwTypeError(invalidCalendar(arg)), slots.calendar;\n }\n return (arg => resolveBasicCalendarId(parseCalendarId(requireString(arg))))(arg);\n}\n\nconst durationSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst Duration = /*@__PURE__*/ defineTemporalClass(DurationBranding, class {\n constructor(years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0, microseconds = 0, nanoseconds = 0) {\n const fields = validateDurationFields(mapProps(toStrictInteger, {\n years: years,\n months: months,\n weeks: weeks,\n days: days,\n hours: hours,\n minutes: minutes,\n seconds: seconds,\n milliseconds: milliseconds,\n microseconds: microseconds,\n nanoseconds: nanoseconds\n }));\n initDuration(this, createDurationSlots(fields));\n }\n static from(arg) {\n return createDuration(toDurationSlots(arg));\n }\n static compare(durationArg0, durationArg1, options = void 0) {\n return compareDurations(refinePublicRelativeTo, toDurationSlots(durationArg0), toDurationSlots(durationArg1), options);\n }\n get sign() {\n return getDurationSlots(this).sign;\n }\n get blank() {\n return !getDurationSlots(this).sign;\n }\n with(mod) {\n return createDuration(mergeDurationFields(getDurationSlots(this), mod));\n }\n negated() {\n return createDuration(negateDuration(getDurationSlots(this)));\n }\n abs() {\n return createDuration(absDuration(getDurationSlots(this)));\n }\n add(otherArg, options = void 0) {\n return createDuration(addDurations(refinePublicRelativeTo, 0, getDurationSlots(this), toDurationSlots(otherArg), options));\n }\n subtract(otherArg, options = void 0) {\n return createDuration(addDurations(refinePublicRelativeTo, 1, getDurationSlots(this), toDurationSlots(otherArg), options));\n }\n round(roundTo) {\n return createDuration(roundDuration(refinePublicRelativeTo, getDurationSlots(this), roundTo));\n }\n total(totalOf) {\n return totalDuration(refinePublicRelativeTo, getDurationSlots(this), totalOf);\n }\n toLocaleString(locales = void 0, options) {\n const slots = getDurationSlots(this);\n return Intl.DurationFormat ? new Intl.DurationFormat(locales, options).format(slots) : formatDurationIso(slots, options);\n }\n toString(options = void 0) {\n return formatDurationIso(getDurationSlots(this), options);\n }\n toJSON() {\n return formatDurationIso(getDurationSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getDurationSlots, durationGetters);\n\nfunction createDuration(slots) {\n return initDuration(Object.create(Duration.prototype), slots);\n}\n\nfunction getDurationSlots(obj) {\n return getDurationSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getDurationSlotsIfPresent(obj) {\n return durationSlotsMap.get(obj);\n}\n\nfunction toDurationSlots(arg) {\n if (isObjectLike(arg)) {\n return getDurationSlotsIfPresent(arg) || refineDurationObjectLike(arg);\n }\n return parseDuration(arg);\n}\n\nfunction refinePublicRelativeTo(relativeTo) {\n if (void 0 !== relativeTo) {\n if (isObjectLike(relativeTo)) {\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(relativeTo);\n if (zonedDateTimeSlots) {\n return zonedDateTimeSlots;\n }\n const dateSlots = getPlainDateSlotsIfPresent(relativeTo);\n if (dateSlots) {\n return dateSlots;\n }\n const dateTimeSlots = getPlainDateTimeSlotsIfPresent(relativeTo);\n if (dateTimeSlots) {\n return createDateSlots(dateTimeSlots, dateTimeSlots.calendar);\n }\n const calendar = getCalendarFromBag(relativeTo);\n return refineMaybeZonedDateTimeObjectLike(refineTimeZoneArg, calendar, relativeTo);\n }\n return parseRelativeToSlots(relativeTo, resolveBasicCalendarId);\n }\n}\n\nfunction initDuration(instance, slots) {\n return durationSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nconst Now = /*@__PURE__*/ Object.defineProperties({}, {\n ...createStringTagDescriptors(\"Temporal.Now\"),\n ...createPropDescriptors({\n timeZoneId() {\n return getCurrentTimeZoneId();\n },\n instant() {\n return createInstant(createEpochNanoSlots(getCurrentEpochNano()));\n },\n zonedDateTimeISO(timeZoneArg = getCurrentTimeZoneId()) {\n const timeZone = queryTimeZone(refineTimeZoneArg(timeZoneArg));\n return createZonedDateTime(createZonedEpochNanoSlots(getCurrentEpochNano(), timeZone));\n },\n plainDateTimeISO(timeZoneArg = getCurrentTimeZoneId()) {\n const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneArg(timeZoneArg)));\n return createPlainDateTime(createDateTimeSlots(isoDateTime));\n },\n plainDateISO(timeZoneArg = getCurrentTimeZoneId()) {\n const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneArg(timeZoneArg)));\n return createPlainDate(createDateSlots(isoDateTime));\n },\n plainTimeISO(timeZoneArg = getCurrentTimeZoneId()) {\n const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneArg(timeZoneArg)));\n return createPlainTime(createTimeSlots(isoDateTime));\n }\n })\n});\n\nconst Temporal = /*@__PURE__*/ Object.defineProperties({}, {\n ...createStringTagDescriptors(\"Temporal\"),\n ...createPropDescriptors({\n PlainYearMonth: PlainYearMonth,\n PlainMonthDay: PlainMonthDay,\n PlainDate: PlainDate,\n PlainTime: PlainTime,\n PlainDateTime: PlainDateTime,\n ZonedDateTime: ZonedDateTime,\n Instant: Instant,\n Duration: Duration,\n Now: Now\n })\n});\n\nconst DateTimeFormat = /*@__PURE__*/ createDateTimeFormatClass(getTemporalBrandingAndSlots);\n\nconst IntlExtended = /*@__PURE__*/ createIntlExtended(DateTimeFormat);\n\nexport { DateTimeFormat, IntlExtended, Temporal, toTemporalInstant };\n","import 'temporal-polyfill/global';\n/**\n * java.lang.Math.toRadians\n * @private\n * @param degrees\n */\nfunction degreesToRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * java.lang.Math.toDegrees\n * @private\n * @param radians\n */\nfunction radiansToDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\n/**\n * A class that contains location information such as latitude and longitude required for astronomical calculations. The\n * elevation field may not be used by some calculation engines and would be ignored if set.\n *\n * @author &copy; Eliyahu Hershfeld 2004 - 2016\n * @version 1.1\n */\nexport class GeoLocation {\n /**\n * GeoLocation constructor with parameters for all required fields.\n *\n * @param {string} name\n * The location name for display use such as &quot;Lakewood, NJ&quot;\n * @param {number} latitude\n * the latitude in a double format such as 40.095965 for Lakewood, NJ.\n * <b>Note: </b> For latitudes south of the equator, a negative value should be used.\n * @param {number} longitude\n * double the longitude in a double format such as -74.222130 for Lakewood, NJ.\n * <b>Note: </b> For longitudes west of the <a href=\"http://en.wikipedia.org/wiki/Prime_Meridian\">Prime\n * Meridian </a> (Greenwich), a negative value should be used.\n * @param {number} elevation\n * the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating\n * sunrise and set.\n * @param {string} timeZoneId\n * the <code>TimeZone</code> for the location.\n */\n constructor(name, latitude, longitude, elevation, timeZoneId) {\n this.setLocationName(name);\n this.setLatitude(latitude);\n this.setLongitude(longitude);\n this.setElevation(elevation);\n this.setTimeZone(timeZoneId);\n }\n latitude;\n longitude;\n locationName = null;\n timeZoneId;\n elevation;\n /**\n * Method to get the elevation in Meters.\n *\n * @return {number} Returns the elevation in Meters.\n */\n getElevation() {\n return this.elevation;\n }\n /**\n * Method to set the elevation in Meters <b>above </b> sea level.\n *\n * @param {number} elevation\n * The elevation to set in Meters. An Error will be thrown if the value is a negative.\n */\n setElevation(elevation) {\n if (typeof elevation !== 'number')\n throw new TypeError('Invalid elevation');\n if (elevation < 0) {\n throw new RangeError(`elevation ${elevation} must be zero or positive`);\n }\n this.elevation = elevation;\n }\n setLatitude(latitude) {\n if (typeof latitude !== 'number')\n throw new TypeError('Invalid latitude');\n if (latitude < -90 || latitude > 90) {\n throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);\n }\n this.latitude = latitude;\n }\n /**\n * @return {number} Returns the latitude.\n */\n getLatitude() {\n return this.latitude;\n }\n setLongitude(longitude) {\n if (typeof longitude !== 'number')\n throw new TypeError('Invalid longitude');\n if (longitude < -180 || longitude > 180) {\n throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);\n }\n this.longitude = longitude;\n }\n /**\n * @return {number} Returns the longitude.\n */\n getLongitude() {\n return this.longitude;\n }\n /**\n * @return {string|null} Returns the location name.\n */\n getLocationName() {\n return this.locationName;\n }\n /**\n * @param {string|null} name\n * The setter method for the display name.\n */\n setLocationName(name) {\n this.locationName = name;\n }\n /**\n * @return {string} Returns the timeZone.\n */\n getTimeZone() {\n return this.timeZoneId;\n }\n /**\n * Method to set the TimeZone.\n * @param {string} timeZoneId\n * The timeZone to set.\n */\n setTimeZone(timeZoneId) {\n if (!timeZoneId) {\n throw new RangeError('Invalid timeZoneId');\n }\n this.timeZoneId = timeZoneId;\n }\n}\n/**\n * The commonly used average solar refraction. Calendrical Calculations lists a more accurate global average of\n * 34.478885263888294\n * @private\n */\nconst refraction = 34 / 60;\n// private double refraction = 34.478885263888294 / 60d;\n/**\n * The commonly used average solar radius in minutes of a degree.\n * @private\n */\nconst solarRadius = 16 / 60;\n/**\n * The commonly used average earth radius in KM. At this time, this only affects elevation adjustment and not the\n * sunrise and sunset calculations. The value currently defaults to 6356.9 KM.\n * @private\n */\nconst earthRadius = 6356.9; // in KM\n/**\n * Implementation of sunrise and sunset methods to calculate astronomical times based on the <a\n * href=\"http://noaa.gov\">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a\n * href=\"http://noaa.gov\">NOAA - National Oceanic and Atmospheric Administration</a>'s <a href =\n * \"http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html\">Surface Radiation Research Branch</a>. NOAA's <a\n * href=\"http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF\">implementation</a> is based on equations from <a\n * href=\"http://www.willbell.com/math/mc1.htm\">Astronomical Algorithms</a> by <a\n * href=\"http://en.wikipedia.org/wiki/Jean_Meeus\">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith\n * to account for elevation. The algorithm can be found in the <a\n * href=\"http://en.wikipedia.org/wiki/Sunrise_equation\">Wikipedia Sunrise Equation</a> article.\n *\n * @author &copy; Eliyahu Hershfeld 2011 - 2019\n */\nexport class NOAACalculator {\n /**\n * A constructor that takes in <a href=\"http://en.wikipedia.org/wiki/Geolocation\">geolocation</a> information as a\n * parameter.\n *\n * @param {GeoLocation} geoLocation\n * The location information used for calculating astronomical sun times.\n * @param {Temporal.PlainDate} date\n */\n constructor(geoLocation, date) {\n this.date = date;\n this.geoLocation = geoLocation;\n }\n /**\n * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;\n * @private\n */\n static GEOMETRIC_ZENITH = 90;\n /**\n * Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the\n * center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth\n * were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun is not\n * a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to true\n * sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be\n * obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16 minutes of\n * arc, and atmospheric refraction accounts for\n * 34 minutes or so, giving a total of 50\n * arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset.\n */\n // const ZENITH: number = GEOMETRIC_ZENITH + 5.0 / 6.0;\n /** Sun's zenith at civil twilight (96&deg;). */\n static CIVIL_ZENITH = 96;\n /** Sun's zenith at nautical twilight (102&deg;). */\n static NAUTICAL_ZENITH = 102;\n /** Sun's zenith at astronomical twilight (108&deg;). */\n static ASTRONOMICAL_ZENITH = 108;\n /**\n * The Java Calendar encapsulated by this class to track the current date used by the class\n * @private\n */\n date;\n /**\n * the {@link GeoLocation} used for calculations.\n * @private\n */\n geoLocation;\n /**\n * The getSunrise method Returns a `Date` representing the\n * {@link getElevationAdjustment elevation adjusted} sunrise time. The zenith used\n * for the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus\n * {@link getElevationAdjustment}. This is adjusted\n * to add approximately 50/60 of a degree to account for 34 archminutes of refraction\n * and 16 archminutes for the sun's radius for a total of {@link adjustZenith 90.83333&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} the `Date` representing the exact sunrise time. If the calculation can't be computed such as\n * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it\n * does not set, a null will be returned. See detailed explanation on top of the page.\n * @see adjustZenith\n * @see getSeaLevelSunrise()\n * @see getUTCSunrise\n */\n getSunrise() {\n const sunrise = this.getUTCSunrise0(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunrise))\n return null;\n return this.getDateFromTime(sunrise, true);\n }\n /**\n * A method that returns the sunrise without {@link getElevationAdjustment elevation\n * adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,\n * something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the\n * base for dawn calculations that are calculated as a dip below the horizon before sunrise.\n *\n * @return {Temporal.ZonedDateTime | null} the `Date` representing the exact sea-level sunrise time. If the calculation can't be computed\n * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, a null will be returned. See detailed explanation on top of the page.\n * @see getSunrise\n * @see getUTCSeaLevelSunrise\n * @see getSeaLevelSunset()\n */\n getSeaLevelSunrise() {\n const sunrise = this.getUTCSeaLevelSunrise(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunrise))\n return null;\n return this.getDateFromTime(sunrise, true);\n }\n /**\n * A method that returns the beginning of civil twilight (dawn) using a zenith of {@link CIVIL_ZENITH 96&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of civil twilight using a zenith of 96&deg;. If the calculation\n * can't be computed, null will be returned. See detailed explanation on top of the page.\n * @see CIVIL_ZENITH\n */\n getBeginCivilTwilight() {\n return this.getSunriseOffsetByDegrees(NOAACalculator.CIVIL_ZENITH);\n }\n /**\n * A method that returns the beginning of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of nautical twilight using a zenith of 102&deg;. If the\n * calculation can't be computed null will be returned. See detailed explanation on top of the page.\n * @see NAUTICAL_ZENITH\n */\n getBeginNauticalTwilight() {\n return this.getSunriseOffsetByDegrees(NOAACalculator.NAUTICAL_ZENITH);\n }\n /**\n * A method that returns the beginning of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH\n * 108&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of astronomical twilight using a zenith of 108&deg;. If the\n * calculation can't be computed, null will be returned. See detailed explanation on top of the page.\n * @see ASTRONOMICAL_ZENITH\n */\n getBeginAstronomicalTwilight() {\n return this.getSunriseOffsetByDegrees(NOAACalculator.ASTRONOMICAL_ZENITH);\n }\n /**\n * The getSunset method Returns a `Date` representing the\n * {@link getElevationAdjustment elevation adjusted} sunset time. The zenith used for\n * the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus\n * {@link getElevationAdjustment}. This is adjusted\n * to add approximately 50/60 of a degree to account for 34 archminutes of refraction\n * and 16 archminutes for the sun's radius for a total of {@link adjustZenith 90.83333&deg;}.\n * Note:\n * In certain cases the calculates sunset will occur before sunrise. This will typically happen when a timezone\n * other than the local timezone is used (calculating Los Angeles sunset using a GMT timezone for example). In this\n * case the sunset date will be incremented to the following date.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` representing the exact sunset time. If the calculation can't be computed such as in\n * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it\n * does not set, a null will be returned. See detailed explanation on top of the page.\n * @see adjustZenith\n * @see getSeaLevelSunset()\n * @see getUTCSunset\n */\n getSunset() {\n const sunset = this.getUTCSunset0(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunset))\n return null;\n return this.getDateFromTime(sunset, false);\n }\n /**\n * A method that returns the sunset without {@link getElevationAdjustment elevation\n * adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,\n * something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the\n * base for dusk calculations that are calculated as a dip below the horizon after sunset.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` representing the exact sea-level sunset time. If the calculation can't be computed\n * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, a null will be returned. See detailed explanation on top of the page.\n * @see getSunset\n * @see getUTCSeaLevelSunset\n */\n getSeaLevelSunset() {\n const sunset = this.getUTCSeaLevelSunset(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunset))\n return null;\n return this.getDateFromTime(sunset, false);\n }\n /**\n * A method that returns the end of civil twilight using a zenith of {@link CIVIL_ZENITH 96&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the end of civil twilight using a zenith of {@link CIVIL_ZENITH 96&deg;}. If\n * the calculation can't be computed, null will be returned. See detailed explanation on top of the page.\n * @see CIVIL_ZENITH\n */\n getEndCivilTwilight() {\n return this.getSunsetOffsetByDegrees(NOAACalculator.CIVIL_ZENITH);\n }\n /**\n * A method that returns the end of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the end of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102&deg;}\n * . If the calculation can't be computed, null will be returned. See detailed explanation on top of the\n * page.\n * @see NAUTICAL_ZENITH\n */\n getEndNauticalTwilight() {\n return this.getSunsetOffsetByDegrees(NOAACalculator.NAUTICAL_ZENITH);\n }\n /**\n * A method that returns the end of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH 108&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the end of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH\n * 108&deg;}. If the calculation can't be computed, null will be returned. See detailed explanation on top\n * of the page.\n * @see ASTRONOMICAL_ZENITH\n */\n getEndAstronomicalTwilight() {\n return this.getSunsetOffsetByDegrees(NOAACalculator.ASTRONOMICAL_ZENITH);\n }\n /**\n * A utility method that returns a date offset by the offset time passed in. Please note that the level of light\n * during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or\n * after sunset with the intent of getting a rough \"level of light\" calculation, the sunrise or sunset time passed\n * to this method should be sea level sunrise and sunset.\n *\n * @param {Temporal.ZonedDateTime | null} time\n * the start time\n * @param {number} offset\n * the offset in milliseconds to add to the time.\n * @return {Temporal.ZonedDateTime | null} the `Date` with the offset in milliseconds added to it\n */\n static getTimeOffset(time, offset) {\n if (time === null || isNaN(offset)) {\n return null;\n }\n return time.add({ milliseconds: offset });\n }\n /**\n * A utility method that returns the time of an offset by degrees below or above the horizon of\n * {@link getSunrise() sunrise}. Note that the degree offset is from the vertical, so for a calculation of 14&deg;\n * before sunrise, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.\n *\n * @param {number} offsetZenith\n * the degrees before {@link getSunrise} to use in the calculation. For time after sunrise use\n * negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14&deg;\n * before sunrise, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a\n * parameter.\n * @return {Temporal.ZonedDateTime | null} The `Date` of the offset after (or before) {@link getSunrise}. If the calculation\n * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the\n * page.\n */\n getSunriseOffsetByDegrees(offsetZenith) {\n const dawn = this.getUTCSunrise0(offsetZenith);\n if (isNaN(dawn))\n return null;\n return this.getDateFromTime(dawn, true);\n }\n /**\n * A utility method that returns the time of an offset by degrees below or above the horizon of {@link getSunset()\n * sunset}. Note that the degree offset is from the vertical, so for a calculation of 14&deg; after sunset, an\n * offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.\n *\n * @param {number} offsetZenith\n * the degrees after {@link getSunset} to use in the calculation. For time before sunset use negative\n * numbers. Note that the degree offset is from the vertical, so for a calculation of 14&deg; after\n * sunset, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.\n * @return {Temporal.ZonedDateTime | null} The `Date`of the offset after (or before) {@link getSunset}. If the calculation can't\n * be computed such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise, and one where it does not set, a null will be returned. See detailed explanation on top of the\n * page.\n */\n getSunsetOffsetByDegrees(offsetZenith) {\n const sunset = this.getUTCSunset0(offsetZenith);\n if (isNaN(sunset))\n return null;\n return this.getDateFromTime(sunset, false);\n }\n /**\n * A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using\n * daylight savings time.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time after sunrise use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n */\n getUTCSunrise0(zenith) {\n return this.getUTCSunrise(this.getAdjustedDate(), this.geoLocation, zenith, true);\n }\n /**\n * A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using\n * daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible\n * light, something that is not affected by elevation. This method returns UTC sunrise calculated at sea level. This\n * forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time after sunrise use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n * @see getUTCSunrise\n * @see getUTCSeaLevelSunset\n */\n getUTCSeaLevelSunrise(zenith) {\n return this.getUTCSunrise(this.getAdjustedDate(), this.geoLocation, zenith, false);\n }\n /**\n * A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using\n * daylight savings time.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time after sunset use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n * @see getUTCSeaLevelSunset\n */\n getUTCSunset0(zenith) {\n return this.getUTCSunset(this.getAdjustedDate(), this.geoLocation, zenith, true);\n }\n /**\n * A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and\n * without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the\n * amount of visible light, something that is not affected by elevation. This method returns UTC sunset calculated\n * at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after\n * sunset.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time before sunset use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n * @see getUTCSunset\n * @see getUTCSeaLevelSunrise\n */\n getUTCSeaLevelSunset(zenith) {\n return this.getUTCSunset(this.getAdjustedDate(), this.geoLocation, zenith, false);\n }\n /**\n * Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.\n * @private\n * @see GeoLocation#getAntimeridianAdjustment()\n * @return the adjusted Calendar\n */\n getAdjustedDate() {\n return this.date;\n }\n /**\n * Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher\n * elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon\n * used at sea level. This is only used for sunrise and sunset and not times before or after it such as\n * {@link getBeginNauticalTwilight() nautical twilight} since those\n * calculations are based on the level of available light at the given dip below the horizon, something that is not\n * affected by elevation, the adjustment should only made if the zenith == 90&deg; {@link adjustZenith adjusted}\n * for refraction and solar radius. The algorithm used is\n *\n * <pre>\n * elevationAdjustment = Math.toDegrees(Math.acos(earthRadiusInMeters / (earthRadiusInMeters + elevationMeters)));\n * </pre>\n *\n * The source of this algorithm is <a href=\"http://www.calendarists.com\">Calendrical Calculations</a> by Edward M.\n * Reingold and Nachum Dershowitz. An alternate algorithm that produces an almost identical (but not accurate)\n * result found in Ma'aglay Tzedek by Moishe Kosower and other sources is:\n *\n * <pre>\n * elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);\n * </pre>\n *\n * @param {number} elevation\n * elevation in Meters.\n * @return {number} the adjusted zenith\n */\n getElevationAdjustment(elevation) {\n // double elevationAdjustment = 0.0347 * Math.sqrt(elevation);\n const elevationAdjustment = radiansToDegrees(Math.acos(earthRadius / (earthRadius + elevation / 1000)));\n return elevationAdjustment;\n }\n /**\n * Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and\n * elevation. The value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle\n * that the center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the\n * Earth were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun\n * is not a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to\n * true sunset or sunrise, instead the centre of the Sun's disk must lie just below the horizon for the upper edge\n * to be obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16\n * minutes of arc, and atmospheric refraction\n * accounts for 34 minutes or so, giving a total\n * of 50 arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset. Since a\n * person at an elevation can see blow the horizon of a person at sea level, this will also adjust the zenith to\n * account for elevation if available. Note that this will only adjust the value if the zenith is exactly 90 degrees.\n * For values below and above this no correction is done. As an example, astronomical twilight is when the sun is\n * 18&deg; below the horizon or {@link ASTRONOMICAL_ZENITH 108&deg;\n * below the zenith}. This is traditionally calculated with none of the above mentioned adjustments. The same goes\n * for various <em>tzais</em> and <em>alos</em> times such as the\n * {@link ZmanimCalendar#ZENITH_16_POINT_1 16.1&deg;} dip used in\n * {@link ComplexZmanimCalendar#getAlos16Point1Degrees}.\n *\n * @param {number} zenith\n * the azimuth below the vertical zenith of 90&deg;. For sunset typically the {@link adjustZenith\n * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link adjustZenith adjusts}\n * this slightly to account for solar refraction and the sun's radius. Another example would be\n * {@link getEndNauticalTwilight} that passes\n * {@link NAUTICAL_ZENITH} to this method.\n * @param {number} elevation\n * elevation in Meters.\n * @return {number} The zenith adjusted to include the sun's radius, refracton\n * and {@link getElevationAdjustment elevation} adjustment. This will only be adjusted for\n * sunrise and sunset (if the zenith == 90&deg;)\n * @see getElevationAdjustment\n */\n adjustZenith(zenith, elevation) {\n let adjustedZenith = zenith;\n if (zenith === NOAACalculator.GEOMETRIC_ZENITH) {\n // only adjust if it is exactly sunrise or sunset\n adjustedZenith =\n zenith +\n (solarRadius + refraction + this.getElevationAdjustment(elevation));\n }\n return adjustedZenith;\n }\n /**\n * The <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a> of January 1, 2000\n * @private\n */\n static JULIAN_DAY_JAN_1_2000 = 2451545;\n /**\n * Julian days per century\n * @private\n */\n static JULIAN_DAYS_PER_CENTURY = 36525;\n /**\n * A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.\n * @param date\n * Used to calculate day of year.\n * @param geoLocation\n * The location information used for astronomical calculating sun times.\n * @param zenith\n * the azimuth below the vertical zenith of 90 degrees. for sunrise typically the {@link adjustZenith\n * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link adjustZenith adjusts}\n * this slightly to account for solar refraction and the sun's radius. Another example would be\n * {@link getBeginNauticalTwilight} that passes\n * {@link NAUTICAL_ZENITH} to this method.\n * @param adjustForElevation\n * Should the time be adjusted for elevation\n * @return The UTC time of sunrise in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in\n * the calculation (expected behavior for some locations such as near the poles,\n * `NaN` will be returned.\n */\n getUTCSunrise(date, geoLocation, zenith, adjustForElevation) {\n const elevation = adjustForElevation\n ? geoLocation.getElevation()\n : 0;\n const adjustedZenith = this.adjustZenith(zenith, elevation);\n let sunrise = NOAACalculator.getSunriseUTC(NOAACalculator.getJulianDay(date), geoLocation.getLatitude(), -geoLocation.getLongitude(), adjustedZenith);\n sunrise = sunrise / 60;\n // ensure that the time is >= 0 and < 24\n while (sunrise < 0) {\n sunrise += 24;\n }\n while (sunrise >= 24) {\n sunrise -= 24;\n }\n return sunrise;\n }\n /**\n * A method that calculates UTC sunset as well as any time based on an angle above or below sunset.\n * @param date\n * Used to calculate day of year.\n * @param geoLocation\n * The location information used for astronomical calculating sun times.\n * @param zenith\n * the azimuth below the vertical zenith of 90&deg;. For sunset typically the {@link adjustZenith\n * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link adjustZenith adjusts}\n * this slightly to account for solar refraction and the sun's radius. Another example would be\n * {@link getEndNauticalTwilight} that passes\n * {@link NAUTICAL_ZENITH} to this method.\n * @param adjustForElevation\n * Should the time be adjusted for elevation\n * @return The UTC time of sunset in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in\n * the calculation (expected behavior for some locations such as near the poles,\n * `NaN` will be returned.\n */\n getUTCSunset(date, geoLocation, zenith, adjustForElevation) {\n const elevation = adjustForElevation\n ? geoLocation.getElevation()\n : 0;\n const adjustedZenith = this.adjustZenith(zenith, elevation);\n let sunset = NOAACalculator.getSunsetUTC(NOAACalculator.getJulianDay(date), geoLocation.getLatitude(), -geoLocation.getLongitude(), adjustedZenith);\n sunset = sunset / 60;\n // ensure that the time is >= 0 and < 24\n while (sunset < 0) {\n sunset += 24;\n }\n while (sunset >= 24) {\n sunset -= 24;\n }\n return sunset;\n }\n /**\n * A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset\n * passed as parameters to this method. An example of the use of this method would be the calculation of a\n * non-elevation adjusted temporal hour by passing in {@link getSeaLevelSunrise() sea level sunrise} and\n * {@link getSeaLevelSunset() sea level sunset} as parameters.\n *\n * @param {Temporal.ZonedDateTime | null} startOfDay\n * The start of the day.\n * @param {Temporal.ZonedDateTime | null} endOfDay\n * The end of the day.\n *\n * @return {number} the <code>long</code> millisecond length of the temporal hour. If the calculation can't be computed a\n * `NaN` will be returned. See detailed explanation on top of the page.\n *\n * @see getTemporalHour()\n */\n getTemporalHour(startOfDay = this.getSeaLevelSunrise(), endOfDay = this.getSeaLevelSunset()) {\n if (startOfDay === null || endOfDay === null) {\n return NaN;\n }\n const delta = endOfDay.epochMilliseconds - startOfDay.epochMilliseconds;\n return Math.floor(delta / 12);\n }\n /**\n * A method that returns sundial or solar noon. It occurs when the Sun is <a href\n * =\"http://en.wikipedia.org/wiki/Transit_%28astronomy%29\">transiting</a> the <a\n * href=\"http://en.wikipedia.org/wiki/Meridian_%28astronomy%29\">celestial meridian</a>. In this class it is\n * calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the\n * real transit time due to changes in declination (the lengthening or shortening day).\n *\n * @param {Temporal.ZonedDateTime | null} startOfDay\n * the start of day for calculating the sun's transit. This can be sea level sunrise, visual sunrise (or\n * any arbitrary start of day) passed to this method.\n * @param {Temporal.ZonedDateTime | null} endOfDay\n * the end of day for calculating the sun's transit. This can be sea level sunset, visual sunset (or any\n * arbitrary end of day) passed to this method.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` representing Sun's transit. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, null will be returned. See detailed explanation on top of the page.\n */\n getSunTransit(startOfDay = this.getSeaLevelSunrise(), endOfDay = this.getSeaLevelSunset()) {\n const temporalHour = this.getTemporalHour(startOfDay, endOfDay);\n return NOAACalculator.getTimeOffset(startOfDay, temporalHour * 6);\n }\n /**\n * A method that returns a `Date` from the time passed in as a parameter.\n * @protected\n * @param {number} time\n * The time to be set as the time for the `Date`. The time expected is in the format: 18.75\n * for 6:45:00 PM.\n * @param {boolean} isSunrise true if the time is sunrise, and false if it is sunset\n * @return {Temporal.ZonedDateTime | null} The Date.\n */\n getDateFromTime(time, isSunrise) {\n const epochMillis = this.getEpochMillisFromTime(time, isSunrise);\n if (isNaN(epochMillis)) {\n return null;\n }\n return Temporal.Instant.fromEpochMilliseconds(epochMillis).toZonedDateTimeISO(this.geoLocation.getTimeZone());\n }\n /**\n * The instant that {@link getDateFromTime} describes, as milliseconds since\n * the epoch, without building a `Temporal.ZonedDateTime`.\n *\n * Constructing a `ZonedDateTime` costs roughly 750ns because the IANA zone\n * has to be resolved, and that dominates this calculation. Callers that only\n * want an instant — a `Date`, or the difference between two times — can skip\n * it. Deriving the instant arithmetically also avoids a `PlainTime`\n * allocation and turns the day rollover into a subtraction rather than a\n * ~610ns `PlainDate.add({days})`.\n *\n * @param {number} time\n * The time in the format 18.75 for 6:45:00 PM, as returned by\n * {@link getUTCSunrise} / {@link getUTCSunset}, i.e. already\n * normalized to `[0, 24)`.\n * @param {boolean} isSunrise true if the time is sunrise, and false if it is sunset\n * @return {number} milliseconds since the epoch, or `NaN` if `time` is `NaN`\n */\n getEpochMillisFromTime(time, isSunrise) {\n if (isNaN(time)) {\n return NaN;\n }\n let calculatedTime = time;\n const cal = this.getAdjustedDate();\n const hours = Math.trunc(calculatedTime); // retain only the hours\n calculatedTime -= hours;\n const minutes = Math.trunc((calculatedTime *= 60)); // retain only the minutes\n calculatedTime -= minutes;\n const seconds = Math.trunc((calculatedTime *= 60)); // retain only the seconds\n calculatedTime -= seconds; // remaining milliseconds\n // Check if a date transition has occurred, or is about to occur - this indicates the date of the event is\n // actually not the target date, but the day prior or after\n const localTimeHours = Math.trunc(this.geoLocation.getLongitude() / 15);\n let dayOffset = 0;\n if (isSunrise && localTimeHours + hours > 18) {\n dayOffset = -1;\n }\n else if (!isSunrise && localTimeHours + hours < 6) {\n dayOffset = 1;\n }\n const year = cal.year;\n let millis = Date.UTC(year, cal.month - 1, cal.day, hours, minutes, seconds, Math.trunc(calculatedTime * 1000));\n if (year >= 0 && year < 100) {\n // Date.UTC() maps years 0-99 onto 1900-1999; setUTCFullYear() does not.\n // Worth the branch (about 3ns): @hebcal/core computes candle-lighting\n // times for early historical years rather than suppressing them.\n const d = new Date(millis);\n d.setUTCFullYear(year);\n millis = d.getTime();\n }\n return millis + dayOffset * 86400000;\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a> from a Java Calendar\n * @private\n * @param {Temporal.ZonedDateTime} date\n * The Java Calendar\n * @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days\n * should be added later.\n */\n static getJulianDay(date) {\n let { year, month } = date;\n const { day } = date;\n if (month <= 2) {\n year -= 1;\n month += 12;\n }\n const a = Math.trunc(year / 100);\n const b = Math.trunc(2 - a + a / 4);\n return (Math.floor(365.25 * (year + 4716)) +\n Math.floor(30.6001 * (month + 1)) +\n day +\n b -\n 1524.5);\n }\n /**\n * Convert <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a> to centuries since J2000.0.\n * @private\n * @param julianDay\n * the Julian Day to convert\n * @return the centuries since 2000 Julian corresponding to the Julian Day\n */\n static getJulianCenturiesFromJulianDay(julianDay) {\n return ((julianDay - NOAACalculator.JULIAN_DAY_JAN_1_2000) /\n NOAACalculator.JULIAN_DAYS_PER_CENTURY);\n }\n /**\n * Convert centuries since J2000.0 to <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a>.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the Julian Day corresponding to the Julian centuries passed in\n */\n static getJulianDayFromJulianCenturies(julianCenturies) {\n return (julianCenturies * NOAACalculator.JULIAN_DAYS_PER_CENTURY +\n NOAACalculator.JULIAN_DAY_JAN_1_2000);\n }\n /**\n * Returns the Geometric <a href=\"http://en.wikipedia.org/wiki/Mean_longitude\">Mean Longitude</a> of the Sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the Geometric Mean Longitude of the Sun in degrees\n */\n static getSunGeometricMeanLongitude(julianCenturies) {\n let longitude = 280.46646 + julianCenturies * (36000.76983 + 0.0003032 * julianCenturies);\n while (longitude > 360) {\n longitude -= 360;\n }\n while (longitude < 0) {\n longitude += 360;\n }\n return longitude; // in degrees\n }\n /**\n * Returns the Geometric <a href=\"http://en.wikipedia.org/wiki/Mean_anomaly\">Mean Anomaly</a> of the Sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the Geometric Mean Anomaly of the Sun in degrees\n */\n static getSunGeometricMeanAnomaly(julianCenturies) {\n return (357.52911 + julianCenturies * (35999.05029 - 0.0001537 * julianCenturies)); // in degrees\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Eccentricity_%28orbit%29\">eccentricity of earth's orbit</a>.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the unitless eccentricity\n */\n static getEarthOrbitEccentricity(julianCenturies) {\n return (0.016708634 -\n julianCenturies * (0.000042037 + 0.0000001267 * julianCenturies)); // unitless\n }\n /**\n * Returns the <a href=\"http://en.wikipedia.org/wiki/Equation_of_the_center\">equation of center</a> for the sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the equation of center for the sun in degrees\n */\n static getSunEquationOfCenter(julianCenturies) {\n const m = NOAACalculator.getSunGeometricMeanAnomaly(julianCenturies);\n const mrad = degreesToRadians(m);\n const sinm = Math.sin(mrad);\n const sin2m = Math.sin(mrad + mrad);\n const sin3m = Math.sin(mrad + mrad + mrad);\n return (sinm *\n (1.914602 - julianCenturies * (0.004817 + 0.000014 * julianCenturies)) +\n sin2m * (0.019993 - 0.000101 * julianCenturies) +\n sin3m * 0.000289); // in degrees\n }\n /**\n * Return the true longitude of the sun\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the sun's true longitude in degrees\n */\n static getSunTrueLongitude(julianCenturies) {\n const sunLongitude = NOAACalculator.getSunGeometricMeanLongitude(julianCenturies);\n const center = NOAACalculator.getSunEquationOfCenter(julianCenturies);\n return sunLongitude + center; // in degrees\n }\n /**\n * Return the apparent longitude of the sun\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return sun's apparent longitude in degrees\n */\n static getSunApparentLongitude(julianCenturies) {\n const sunTrueLongitude = NOAACalculator.getSunTrueLongitude(julianCenturies);\n const omega = 125.04 - 1934.136 * julianCenturies;\n const lambda = sunTrueLongitude - 0.00569 - 0.00478 * Math.sin(degreesToRadians(omega));\n return lambda; // in degrees\n }\n /**\n * Returns the mean <a href=\"http://en.wikipedia.org/wiki/Axial_tilt\">obliquity of the ecliptic</a> (Axial tilt).\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the mean obliquity in degrees\n */\n static getMeanObliquityOfEcliptic(julianCenturies) {\n const seconds = 21.448 -\n julianCenturies *\n (46.815 + julianCenturies * (0.00059 - julianCenturies * 0.001813));\n return 23 + (26 + seconds / 60) / 60; // in degrees\n }\n /**\n * Returns the corrected <a href=\"http://en.wikipedia.org/wiki/Axial_tilt\">obliquity of the ecliptic</a> (Axial\n * tilt).\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the corrected obliquity in degrees\n */\n static getObliquityCorrection(julianCenturies) {\n const obliquityOfEcliptic = NOAACalculator.getMeanObliquityOfEcliptic(julianCenturies);\n const omega = 125.04 - 1934.136 * julianCenturies;\n return obliquityOfEcliptic + 0.00256 * Math.cos(degreesToRadians(omega)); // in degrees\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Declination\">declination</a> of the sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return\n * the sun's declination in degrees\n */\n static getSunDeclination(julianCenturies) {\n const obliquityCorrection = NOAACalculator.getObliquityCorrection(julianCenturies);\n const lambda = NOAACalculator.getSunApparentLongitude(julianCenturies);\n const sint = Math.sin(degreesToRadians(obliquityCorrection)) *\n Math.sin(degreesToRadians(lambda));\n const theta = radiansToDegrees(Math.asin(sint));\n return theta; // in degrees\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Equation_of_time\">Equation of Time</a> - the difference between\n * true solar time and mean solar time\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return equation of time in minutes of time\n */\n static getEquationOfTime(julianCenturies) {\n const epsilon = NOAACalculator.getObliquityCorrection(julianCenturies);\n const geomMeanLongSun = NOAACalculator.getSunGeometricMeanLongitude(julianCenturies);\n const eccentricityEarthOrbit = NOAACalculator.getEarthOrbitEccentricity(julianCenturies);\n const geomMeanAnomalySun = NOAACalculator.getSunGeometricMeanAnomaly(julianCenturies);\n let y = Math.tan(degreesToRadians(epsilon) / 2);\n y *= y;\n const sin2l0 = Math.sin(2 * degreesToRadians(geomMeanLongSun));\n const sinm = Math.sin(degreesToRadians(geomMeanAnomalySun));\n const cos2l0 = Math.cos(2 * degreesToRadians(geomMeanLongSun));\n const sin4l0 = Math.sin(4 * degreesToRadians(geomMeanLongSun));\n const sin2m = Math.sin(2 * degreesToRadians(geomMeanAnomalySun));\n const equationOfTime = y * sin2l0 -\n 2 * eccentricityEarthOrbit * sinm +\n 4 * eccentricityEarthOrbit * y * sinm * cos2l0 -\n 0.5 * y * y * sin4l0 -\n 1.25 * eccentricityEarthOrbit * eccentricityEarthOrbit * sin2m;\n return radiansToDegrees(equationOfTime) * 4; // in minutes of time\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Hour_angle\">hour angle</a> of the sun at sunrise for the\n * latitude.\n * @private\n * @param {number} lat\n * , the latitude of observer in degrees\n * @param solarDec\n * the declination angle of sun in degrees\n * @param {number} zenith\n * the zenith\n * @return hour angle of sunrise in radians\n */\n static getSunHourAngleAtSunrise(lat, solarDec, zenith) {\n const latRad = degreesToRadians(lat);\n const sdRad = degreesToRadians(solarDec);\n return Math.acos(Math.cos(degreesToRadians(zenith)) /\n (Math.cos(latRad) * Math.cos(sdRad)) -\n Math.tan(latRad) * Math.tan(sdRad)); // in radians\n }\n /**\n * Returns the <a href=\"http://en.wikipedia.org/wiki/Hour_angle\">hour angle</a> of the sun at sunset for the\n * latitude.\n * @private\n * @param {number} lat\n * the latitude of observer in degrees\n * @param solarDec\n * the declination angle of sun in degrees\n * @param {number} zenith\n * the zenith\n * @return the hour angle of sunset in radians\n */\n static getSunHourAngleAtSunset(lat, solarDec, zenith) {\n const latRad = degreesToRadians(lat);\n const sdRad = degreesToRadians(solarDec);\n const hourAngle = Math.acos(Math.cos(degreesToRadians(zenith)) /\n (Math.cos(latRad) * Math.cos(sdRad)) -\n Math.tan(latRad) * Math.tan(sdRad));\n return -hourAngle; // in radians\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Celestial_coordinate_system\">Solar Elevation</a> for the\n * horizontal coordinate system at the given location at the given time. Can be negative if the sun is below the\n * horizon. Not corrected for altitude.\n *\n * @param {Temporal.ZonedDateTime} date\n * time of calculation\n * @param {number} lat\n * latitude of location for calculation\n * @param {number} lon\n * longitude of location for calculation\n * @return {number} solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees\n */\n static getSolarElevation(date, lat, lon) {\n const julianDay = NOAACalculator.getJulianDay(date.toPlainDate());\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n const equationOfTime = NOAACalculator.getEquationOfTime(julianCenturies);\n let longitude = date.hour + 12 + (date.minute + equationOfTime + date.second / 60) / 60;\n longitude = -((longitude * 360) / 24) % 360;\n const hourAngleRad = degreesToRadians(lon - longitude);\n const declination = NOAACalculator.getSunDeclination(julianCenturies);\n const decRad = degreesToRadians(declination);\n const latRad = degreesToRadians(lat);\n return radiansToDegrees(Math.asin(Math.sin(latRad) * Math.sin(decRad) +\n Math.cos(latRad) * Math.cos(decRad) * Math.cos(hourAngleRad)));\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Celestial_coordinate_system\">Solar Azimuth</a> for the\n * horizontal coordinate system at the given location at the given time. Not corrected for altitude. True south is 0\n * degrees.\n *\n * @param {Temporal.ZonedDateTime} date\n * time of calculation\n * @param {number} latitude\n * latitude of location for calculation\n * @param {number} lon\n * longitude of location for calculation\n * @return {number}\n */\n static getSolarAzimuth(date, latitude, lon) {\n const julianDay = NOAACalculator.getJulianDay(date.toPlainDate());\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n const equationOfTime = NOAACalculator.getEquationOfTime(julianCenturies);\n let longitude = date.hour + 12 + (date.minute + equationOfTime + date.second / 60) / 60;\n longitude = -((longitude * 360) / 24) % 360;\n const hourAngleRad = degreesToRadians(lon - longitude);\n const declination = NOAACalculator.getSunDeclination(julianCenturies);\n const decRad = degreesToRadians(declination);\n const latRad = degreesToRadians(latitude);\n return (radiansToDegrees(Math.atan(Math.sin(hourAngleRad) /\n (Math.cos(hourAngleRad) * Math.sin(latRad) -\n Math.tan(decRad) * Math.cos(latRad)))) + 180);\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Universal_Coordinated_Time\">Universal Coordinated Time</a> (UTC)\n * of sunrise for the given day at the given location on earth\n * @private\n * @param julianDay\n * the Julian day\n * @param {number} latitude\n * the latitude of observer in degrees\n * @param {number} longitude\n * the longitude of observer in degrees\n * @param {number} zenith\n * the zenith\n * @return the time in minutes from zero UTC\n */\n static getSunriseUTC(julianDay, latitude, longitude, zenith) {\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n // Find the time of solar noon at the location, and use that declination. This is better than start of the\n // Julian day\n const noonmin = NOAACalculator.getSolarNoonUTC(julianCenturies, longitude);\n const tnoon = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay + noonmin / 1440);\n // First pass to approximate sunrise (using solar noon)\n let eqTime = NOAACalculator.getEquationOfTime(tnoon);\n let solarDec = NOAACalculator.getSunDeclination(tnoon);\n let hourAngle = NOAACalculator.getSunHourAngleAtSunrise(latitude, solarDec, zenith);\n let delta = longitude - radiansToDegrees(hourAngle);\n let timeDiff = 4 * delta; // in minutes of time\n let timeUTC = 720 + timeDiff - eqTime; // in minutes\n // Second pass includes fractional Julian Day in gamma calc\n const newt = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) +\n timeUTC / 1440);\n eqTime = NOAACalculator.getEquationOfTime(newt);\n solarDec = NOAACalculator.getSunDeclination(newt);\n hourAngle = NOAACalculator.getSunHourAngleAtSunrise(latitude, solarDec, zenith);\n delta = longitude - radiansToDegrees(hourAngle);\n timeDiff = 4 * delta;\n timeUTC = 720 + timeDiff - eqTime; // in minutes\n return timeUTC;\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Universal_Coordinated_Time\">Universal Coordinated Time</a> (UTC)\n * of <a href=\"http://en.wikipedia.org/wiki/Noon#Solar_noon\">solar noon</a> for the given day at the given location\n * on earth.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @param {number} longitude\n * the longitude of observer in degrees\n * @return the time in minutes from zero UTC\n */\n static getSolarNoonUTC(julianCenturies, longitude) {\n // First pass uses approximate solar noon to calculate eqtime\n const tnoon = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) +\n longitude / 360);\n let eqTime = NOAACalculator.getEquationOfTime(tnoon);\n const solNoonUTC = 720 + longitude * 4 - eqTime; // min\n const newt = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) -\n 0.5 +\n solNoonUTC / 1440);\n eqTime = NOAACalculator.getEquationOfTime(newt);\n return 720 + longitude * 4 - eqTime; // min\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Universal_Coordinated_Time\">Universal Coordinated Time</a> (UTC)\n * of sunset for the given day at the given location on earth\n * @private\n * @param julianDay\n * the Julian day\n * @param {number} latitude\n * the latitude of observer in degrees\n * @param {number} longitude\n * : longitude of observer in degrees\n * @param {number} zenith\n * the zenith\n * @return the time in minutes from zero Universal Coordinated Time (UTC)\n */\n static getSunsetUTC(julianDay, latitude, longitude, zenith) {\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n // Find the time of solar noon at the location, and use that declination. This is better than start of the\n // Julian day\n const noonmin = NOAACalculator.getSolarNoonUTC(julianCenturies, longitude);\n const tnoon = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay + noonmin / 1440);\n // First calculates sunrise and approx length of day\n let eqTime = NOAACalculator.getEquationOfTime(tnoon);\n let solarDec = NOAACalculator.getSunDeclination(tnoon);\n let hourAngle = NOAACalculator.getSunHourAngleAtSunset(latitude, solarDec, zenith);\n let delta = longitude - radiansToDegrees(hourAngle);\n let timeDiff = 4 * delta;\n let timeUTC = 720 + timeDiff - eqTime;\n // Second pass includes fractional Julian Day in gamma calc\n const newt = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) +\n timeUTC / 1440);\n eqTime = NOAACalculator.getEquationOfTime(newt);\n solarDec = NOAACalculator.getSunDeclination(newt);\n hourAngle = NOAACalculator.getSunHourAngleAtSunset(latitude, solarDec, zenith);\n delta = longitude - radiansToDegrees(hourAngle);\n timeDiff = 4 * delta;\n timeUTC = 720 + timeDiff - eqTime; // in minutes\n return timeUTC;\n }\n}\n","import { createPropDescriptors } from \"./chunks/internal.js\";\n\nimport { NativeTemporal } from \"./chunks/root.js\";\n\nimport { Temporal, DateTimeFormat, toTemporalInstant } from \"./chunks/classApi-basic.js\";\n\nfunction installImplementation() {\n Object.defineProperties(globalThis, createPropDescriptors({\n Temporal: Temporal\n })), Object.defineProperties(Intl, createPropDescriptors({\n DateTimeFormat: DateTimeFormat\n })), Object.defineProperties(Date.prototype, createPropDescriptors({\n toTemporalInstant: toTemporalInstant\n }));\n}\n\nfunction install() {\n NativeTemporal || installImplementation();\n}\n\nexport { install, installImplementation };\n","export default\n[\n \"Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27\",\n \"Atlanta|US|33.749|-84.38798|America/New_York|336\",\n \"Austin|US|30.26715|-97.74306|America/Chicago|165\",\n \"Baghdad|IQ|33.34058|44.40088|Asia/Baghdad|41\",\n \"Beer Sheva|IL|31.25181|34.7913|Asia/Jerusalem|285\",\n \"Berlin|DE|52.52437|13.41053|Europe/Berlin|43\",\n \"Baltimore|US|39.29038|-76.61219|America/New_York|35\",\n \"Bogota|CO|4.60971|-74.08175|America/Bogota|2582\",\n \"Boston|US|42.35843|-71.05977|America/New_York|38\",\n \"Budapest|HU|47.49801|19.03991|Europe/Budapest|104\",\n \"Buenos Aires|AR|-34.61315|-58.37723|America/Argentina/Buenos_Aires|31\",\n \"Buffalo|US|42.88645|-78.87837|America/New_York|191\",\n \"Chicago|US|41.85003|-87.65005|America/Chicago|180\",\n \"Cincinnati|US|39.162|-84.45689|America/New_York|267\",\n \"Cleveland|US|41.4995|-81.69541|America/New_York|204\",\n \"Dallas|US|32.78306|-96.80667|America/Chicago|139\",\n \"Denver|US|39.73915|-104.9847|America/Denver|1636\",\n \"Detroit|US|42.33143|-83.04575|America/Detroit|192\",\n \"Eilat|IL|29.55805|34.94821|Asia/Jerusalem|63\",\n \"Gibraltar|GI|36.14474|-5.35257|Europe/Gibraltar|11\",\n \"Haifa|IL|32.81841|34.9885|Asia/Jerusalem|40\",\n \"Hawaii|US|21.30694|-157.85833|Pacific/Honolulu|18\",\n \"Helsinki|FI|60.16952|24.93545|Europe/Helsinki|26\",\n \"Houston|US|29.76328|-95.36327|America/Chicago|30\",\n \"Jerusalem|IL|31.76904|35.21633|Asia/Jerusalem|786\",\n \"Johannesburg|ZA|-26.20227|28.04363|Africa/Johannesburg|1767\",\n \"Kiev|UA|50.45466|30.5238|Europe/Kiev|187\",\n \"La Paz|BO|-16.5|-68.15|America/La_Paz|3782\",\n \"Livingston|US|40.79593|-74.31487|America/New_York|98\",\n \"Las Vegas|US|36.17497|-115.13722|America/Los_Angeles|613\",\n \"London|GB|51.50853|-0.12574|Europe/London|25\",\n \"Los Angeles|US|34.05223|-118.24368|America/Los_Angeles|96\",\n \"Marseilles|FR|43.29695|5.38107|Europe/Paris|28\",\n \"Miami|US|25.77427|-80.19366|America/New_York|25\",\n \"Minneapolis|US|44.97997|-93.26384|America/Chicago|262\",\n \"Melbourne|AU|-37.814|144.96332|Australia/Melbourne|25\",\n \"Mexico City|MX|19.42847|-99.12766|America/Mexico_City|2240\",\n \"Montreal|CA|45.50884|-73.58781|America/Toronto|216\",\n \"Moscow|RU|55.75222|37.61556|Europe/Moscow|144\",\n \"New York|US|40.71427|-74.00597|America/New_York|57\",\n \"Omaha|US|41.25861|-95.93779|America/Chicago|315\",\n \"Ottawa|CA|45.41117|-75.69812|America/Toronto|71\",\n \"Panama City|PA|8.9936|-79.51973|America/Panama|17\",\n \"Paris|FR|48.85341|2.3488|Europe/Paris|42\",\n \"Pawtucket|US|41.87871|-71.38256|America/New_York|0\",\n \"Petach Tikvah|IL|32.08707|34.88747|Asia/Jerusalem|54\",\n \"Philadelphia|US|39.95233|-75.16379|America/New_York|8\",\n \"Phoenix|US|33.44838|-112.07404|America/Phoenix|366\",\n \"Pittsburgh|US|40.44062|-79.99589|America/New_York|239\",\n \"Providence|US|41.82399|-71.41283|America/New_York|0\",\n \"Portland|US|45.52345|-122.67621|America/Los_Angeles|15\",\n \"Saint Louis|US|38.62727|-90.19789|America/Chicago|149\",\n \"Saint Petersburg|RU|59.93863|30.31413|Europe/Moscow|11\",\n \"San Diego|US|32.71533|-117.15726|America/Los_Angeles|20\",\n \"San Francisco|US|37.77493|-122.41942|America/Los_Angeles|28\",\n \"Sao Paulo|BR|-23.5475|-46.63611|America/Sao_Paulo|769\",\n \"Seattle|US|47.60621|-122.33207|America/Los_Angeles|56\",\n \"Sydney|AU|-33.86785|151.20732|Australia/Sydney|58\",\n \"Tel Aviv|IL|32.08088|34.78057|Asia/Jerusalem|15\",\n \"Tiberias|IL|32.79221|35.53124|Asia/Jerusalem|0\",\n \"Toronto|CA|43.70011|-79.4163|America/Toronto|175\",\n \"Vancouver|CA|49.24966|-123.11934|America/Vancouver|70\",\n \"White Plains|US|41.03399|-73.76291|America/New_York|82\",\n \"Washington DC|US|38.89511|-77.03637|America/New_York|6\",\n \"Worcester|US|42.26259|-71.80229|America/New_York|164\"\n]\n","export default class QuickLRU extends Map {\n\t#size = 0;\n\t#cache = new Map();\n\t#oldCache = new Map();\n\t#maxSize;\n\t#maxAge;\n\t#onEviction;\n\n\tconstructor(options = {}) {\n\t\tsuper();\n\n\t\tif (!(options.maxSize && options.maxSize > 0)) {\n\t\t\tthrow new TypeError('`maxSize` must be a number greater than 0');\n\t\t}\n\n\t\tif (typeof options.maxAge === 'number' && options.maxAge === 0) {\n\t\t\tthrow new TypeError('`maxAge` must be a number greater than 0');\n\t\t}\n\n\t\tthis.#maxSize = options.maxSize;\n\t\tthis.#maxAge = options.maxAge || Number.POSITIVE_INFINITY;\n\t\tthis.#onEviction = options.onEviction;\n\t}\n\n\t// For tests.\n\tget __oldCache() {\n\t\treturn this.#oldCache;\n\t}\n\n\t#emitEvictions(cache) {\n\t\tif (typeof this.#onEviction !== 'function') {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const [key, item] of cache) {\n\t\t\tthis.#onEviction(key, item.value);\n\t\t}\n\t}\n\n\t#deleteIfExpired(key, item) {\n\t\tif (typeof item.expiry === 'number' && item.expiry <= Date.now()) {\n\t\t\tif (typeof this.#onEviction === 'function') {\n\t\t\t\tthis.#onEviction(key, item.value);\n\t\t\t}\n\n\t\t\treturn this.delete(key);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t#getOrDeleteIfExpired(key, item) {\n\t\tconst deleted = this.#deleteIfExpired(key, item);\n\t\tif (deleted === false) {\n\t\t\treturn item.value;\n\t\t}\n\t}\n\n\t#getItemValue(key, item) {\n\t\treturn item.expiry ? this.#getOrDeleteIfExpired(key, item) : item.value;\n\t}\n\n\t#peek(key, cache) {\n\t\tconst item = cache.get(key);\n\t\treturn this.#getItemValue(key, item);\n\t}\n\n\t#set(key, value) {\n\t\tthis.#cache.set(key, value);\n\t\tthis.#size++;\n\n\t\tif (this.#size >= this.#maxSize) {\n\t\t\tthis.#size = 0;\n\t\t\tthis.#emitEvictions(this.#oldCache);\n\t\t\tthis.#oldCache = this.#cache;\n\t\t\tthis.#cache = new Map();\n\t\t}\n\t}\n\n\t#moveToRecent(key, item) {\n\t\tthis.#oldCache.delete(key);\n\t\tthis.#set(key, item);\n\t}\n\n\t* #entriesAscending() {\n\t\tfor (const item of this.#oldCache) {\n\t\t\tconst [key, value] = item;\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\t\tif (deleted === false) {\n\t\t\t\t\tyield item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const item of this.#cache) {\n\t\t\tconst [key, value] = item;\n\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\tif (deleted === false) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\tget(key) {\n\t\tif (this.#cache.has(key)) {\n\t\t\tconst item = this.#cache.get(key);\n\t\t\treturn this.#getItemValue(key, item);\n\t\t}\n\n\t\tif (this.#oldCache.has(key)) {\n\t\t\tconst item = this.#oldCache.get(key);\n\t\t\tif (this.#deleteIfExpired(key, item) === false) {\n\t\t\t\tthis.#moveToRecent(key, item);\n\t\t\t\treturn item.value;\n\t\t\t}\n\t\t}\n\t}\n\n\tset(key, value, {maxAge = this.#maxAge} = {}) {\n\t\tconst expiry = typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY\n\t\t\t? (Date.now() + maxAge)\n\t\t\t: undefined;\n\n\t\tif (this.#cache.has(key)) {\n\t\t\tthis.#cache.set(key, {\n\t\t\t\tvalue,\n\t\t\t\texpiry,\n\t\t\t});\n\t\t} else {\n\t\t\tthis.#set(key, {value, expiry});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\thas(key) {\n\t\tif (this.#cache.has(key)) {\n\t\t\treturn !this.#deleteIfExpired(key, this.#cache.get(key));\n\t\t}\n\n\t\tif (this.#oldCache.has(key)) {\n\t\t\treturn !this.#deleteIfExpired(key, this.#oldCache.get(key));\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpeek(key) {\n\t\tif (this.#cache.has(key)) {\n\t\t\treturn this.#peek(key, this.#cache);\n\t\t}\n\n\t\tif (this.#oldCache.has(key)) {\n\t\t\treturn this.#peek(key, this.#oldCache);\n\t\t}\n\t}\n\n\texpiresIn(key) {\n\t\tconst item = this.#cache.get(key) ?? this.#oldCache.get(key);\n\t\tif (item) {\n\t\t\treturn item.expiry ? item.expiry - Date.now() : Number.POSITIVE_INFINITY;\n\t\t}\n\t}\n\n\tdelete(key) {\n\t\tconst deleted = this.#cache.delete(key);\n\t\tif (deleted) {\n\t\t\tthis.#size--;\n\t\t}\n\n\t\treturn this.#oldCache.delete(key) || deleted;\n\t}\n\n\tclear() {\n\t\tthis.#cache.clear();\n\t\tthis.#oldCache.clear();\n\t\tthis.#size = 0;\n\t}\n\n\tresize(newSize) {\n\t\tif (!(newSize && newSize > 0)) {\n\t\t\tthrow new TypeError('`maxSize` must be a number greater than 0');\n\t\t}\n\n\t\tconst items = [...this.#entriesAscending()];\n\t\tconst removeCount = items.length - newSize;\n\t\tif (removeCount < 0) {\n\t\t\tthis.#cache = new Map(items);\n\t\t\tthis.#oldCache = new Map();\n\t\t\tthis.#size = items.length;\n\t\t} else {\n\t\t\tif (removeCount > 0) {\n\t\t\t\tthis.#emitEvictions(items.slice(0, removeCount));\n\t\t\t}\n\n\t\t\tthis.#oldCache = new Map(items.slice(removeCount));\n\t\t\tthis.#cache = new Map();\n\t\t\tthis.#size = 0;\n\t\t}\n\n\t\tthis.#maxSize = newSize;\n\t}\n\n\tevict(count = 1) {\n\t\tconst requested = Number(count);\n\t\tif (!requested || requested <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst items = [...this.#entriesAscending()];\n\t\tconst evictCount = Math.trunc(Math.min(requested, Math.max(items.length - 1, 0)));\n\t\tif (evictCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#emitEvictions(items.slice(0, evictCount));\n\t\tthis.#oldCache = new Map(items.slice(evictCount));\n\t\tthis.#cache = new Map();\n\t\tthis.#size = 0;\n\t}\n\n\t* keys() {\n\t\tfor (const [key] of this) {\n\t\t\tyield key;\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const [, value] of this) {\n\t\t\tyield value;\n\t\t}\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tfor (const item of this.#cache) {\n\t\t\tconst [key, value] = item;\n\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\tif (deleted === false) {\n\t\t\t\tyield [key, value.value];\n\t\t\t}\n\t\t}\n\n\t\tfor (const item of this.#oldCache) {\n\t\t\tconst [key, value] = item;\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\t\tif (deleted === false) {\n\t\t\t\t\tyield [key, value.value];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t* entriesDescending() {\n\t\tlet items = [...this.#cache];\n\t\tfor (let i = items.length - 1; i >= 0; --i) {\n\t\t\tconst item = items[i];\n\t\t\tconst [key, value] = item;\n\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\tif (deleted === false) {\n\t\t\t\tyield [key, value.value];\n\t\t\t}\n\t\t}\n\n\t\titems = [...this.#oldCache];\n\t\tfor (let i = items.length - 1; i >= 0; --i) {\n\t\t\tconst item = items[i];\n\t\t\tconst [key, value] = item;\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\t\tif (deleted === false) {\n\t\t\t\t\tyield [key, value.value];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t* entriesAscending() {\n\t\tfor (const [key, value] of this.#entriesAscending()) {\n\t\t\tyield [key, value.value];\n\t\t}\n\t}\n\n\tget size() {\n\t\tif (!this.#size) {\n\t\t\treturn this.#oldCache.size;\n\t\t}\n\n\t\tlet oldCacheSize = 0;\n\t\tfor (const key of this.#oldCache.keys()) {\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\toldCacheSize++;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.min(this.#size + oldCacheSize, this.#maxSize);\n\t}\n\n\tget maxSize() {\n\t\treturn this.#maxSize;\n\t}\n\n\tget maxAge() {\n\t\treturn this.#maxAge;\n\t}\n\n\tentries() {\n\t\treturn this.entriesAscending();\n\t}\n\n\tforEach(callbackFunction, thisArgument = this) {\n\t\tfor (const [key, value] of this.entriesAscending()) {\n\t\t\tcallbackFunction.call(thisArgument, value, key, this);\n\t\t}\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'QuickLRU';\n\t}\n\n\ttoString() {\n\t\treturn `QuickLRU(${this.size}/${this.maxSize})`;\n\t}\n\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn this.toString();\n\t}\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {GeoLocation} from '@hebcal/noaa';\nimport citiesJson from './cities.json.js';\nimport QuickLRU from 'quick-lru';\n\nconst classicCities = new Map<string, Location>();\n\n// Zip-Codes.com TimeZone IDs\nconst ZIPCODES_TZ_MAP: Record<string, string> = {\n '0': 'UTC',\n '4': 'America/Puerto_Rico', // Atlantic (GMT -04:00)\n '5': 'America/New_York', // Eastern (GMT -05:00)\n '6': 'America/Chicago', // Central (GMT -06:00)\n '7': 'America/Denver', // Mountain (GMT -07:00)\n '8': 'America/Los_Angeles', // Pacific (GMT -08:00)\n '9': 'America/Anchorage', // Alaska (GMT -09:00)\n '10': 'Pacific/Honolulu', // Hawaii-Aleutian Islands (GMT -10:00)\n '11': 'Pacific/Pago_Pago', // American Samoa (GMT -11:00)\n '13': 'Pacific/Funafuti', // Marshall Islands (GMT +12:00)\n '14': 'Pacific/Guam', // Guam (GMT +10:00)\n '15': 'Pacific/Palau', // Palau (GMT +9:00)\n '16': 'Pacific/Chuuk', // Micronesia (GMT +11:00)\n} as const;\n\n/** @private */\nconst timeFormatCache = new QuickLRU<string, Intl.DateTimeFormat>({\n maxSize: 120,\n});\n\n/**\n * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) from cache\n * or makes a new one if needed\n * @private\n */\nfunction getFormatter(tzid: string): Intl.DateTimeFormat {\n const fmt = timeFormatCache.get(tzid);\n if (fmt) return fmt;\n const f = new Intl.DateTimeFormat('en-US', {\n timeZone: tzid,\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n });\n timeFormatCache.set(tzid, f);\n return f;\n}\n\nfunction initClassicCities() {\n for (const entry of citiesJson) {\n const [cityName, cc, lat, lng, tzid, elev] = entry.split('|');\n const location = new Location(\n +lat,\n +lng,\n cc === 'IL',\n tzid,\n cityName,\n cc,\n undefined,\n +elev\n );\n Location.addLocation(cityName, location);\n }\n}\n\n/**\n * Class representing a geographic location for use with candle-lighting,\n * havdalah, and zmanim calculations.\n *\n * Extends {@link GeoLocation} from `@hebcal/noaa` with Jewish-calendar\n * specific data: an Israel/Diaspora flag, ISO country code, and an optional\n * geographic identifier. Also provides {@link Location.lookup} for the 65\n * built-in \"classic\" Hebcal cities.\n *\n * @example\n * import {Location} from '@hebcal/core';\n *\n * // Create a location for a custom address\n * const loc = new Location(\n * 41.85003, // latitude\n * -87.65005, // longitude\n * false, // not in Israel\n * 'America/Chicago',\n * 'Chicago, Illinois, USA',\n * 'US'\n * );\n *\n * // Or look up a built-in classic city\n * const tlv = Location.lookup('Tel Aviv');\n */\nexport class Location extends GeoLocation {\n private readonly il: boolean;\n private readonly cc?: string;\n private readonly geoid?: string | number;\n /**\n * First-level administrative division (e.g. a US state or a French\n * region) as an abbreviation, such as `\"CA\"`. Not set by this package;\n * populated by callers that hydrate a `Location` from a geo database.\n */\n admin1?: string;\n /**\n * Full name of the first-level administrative division, such as\n * `\"California\"`. Not set by this package.\n */\n stateName?: string;\n /**\n * Which kind of lookup produced this location: `'zip'` for a US Zip Code\n * or `'geoname'` for a GeoNames city. Not set by this package.\n */\n geo?: 'zip' | 'geoname';\n /** US Zip Code, such as `\"02912\"`. Not set by this package. */\n zip?: string;\n /** Approximate population of the city. Not set by this package. */\n population?: number;\n /** City name in plain ASCII, for sorting or URL generation. Not set by this package. */\n asciiname?: string;\n\n /**\n * Initialize a Location instance\n * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)\n * @param longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)\n * @param il - in Israel (true) or Diaspora (false)\n * @param tzid - Olson timezone ID, e.g. \"America/Chicago\"\n * @param [cityName] - optional descriptive city name\n * @param [countryCode] - ISO 3166 alpha-2 country code (e.g. \"FR\")\n * @param [geoid] - optional string or numeric geographic ID\n * @param [elevation] - in meters (default `0`)\n */\n constructor(\n latitude: number,\n longitude: number,\n il: boolean,\n tzid: string,\n cityName?: string,\n countryCode?: string,\n geoid?: string | number,\n elevation?: number\n ) {\n const lat = typeof latitude === 'number' ? latitude : parseFloat(latitude);\n if (isNaN(lat) || lat < -90 || lat > 90) {\n throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);\n }\n const long = typeof longitude === 'number' ? longitude : parseFloat(longitude);\n if (isNaN(long) || long < -180 || long > 180) {\n throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);\n }\n if (!tzid) {\n throw new RangeError('Invalid timezone');\n }\n const elev = typeof elevation === 'number' && elevation > 0 ? elevation : 0;\n if (cityName && typeof cityName !== 'string') {\n cityName = String(cityName);\n }\n super(cityName || null, lat, long, elev, tzid);\n this.il = Boolean(il);\n this.cc = countryCode;\n if (countryCode === 'IL') {\n this.il = true;\n }\n this.geoid = geoid;\n }\n\n /**\n * Returns `true` if this location is in Israel (uses the Israeli holiday\n * and Torah-reading schedule), `false` for the Diaspora.\n */\n getIsrael(): boolean {\n return this.il;\n }\n\n /**\n * Returns the full descriptive location name passed to the constructor,\n * or `null` if no name was provided.\n *\n * Note that the built-in classic cities are named by city alone, so\n * `getName()` and {@link getShortName} return the same string for them.\n * @example\n * const loc = new Location(41.85003, -87.65005, false,\n * 'America/Chicago', 'Chicago, Illinois, USA', 'US');\n * loc.getName(); // 'Chicago, Illinois, USA'\n * Location.lookup('San Francisco')?.getName(); // 'San Francisco'\n */\n getName(): string | null {\n return this.getLocationName();\n }\n\n /**\n * Returns the location name truncated at the first comma. Useful for\n * compact display where only the city name is desired.\n *\n * Special-cased so that US locations of the form `\"Washington, DC ...\"` or\n * `\"Washington, D.C., ...\"` keep the `DC` / `D.C.` suffix attached.\n * @example\n * const chi = new Location(41.85003, -87.65005, false,\n * 'America/Chicago', 'Chicago, Illinois, USA', 'US');\n * chi.getShortName(); // 'Chicago'\n * const dc = new Location(38.89511, -77.03637, false,\n * 'America/New_York', 'Washington, D.C., USA', 'US');\n * dc.getShortName(); // 'Washington, D.C.'\n */\n getShortName(): string | null {\n const name = this.getLocationName();\n if (!name) return name;\n const comma = name.indexOf(', ');\n if (comma === -1) return name;\n if (this.cc === 'US' && name[comma + 2] === 'D') {\n if (name[comma + 3] === 'C') {\n return name.substring(0, comma + 4);\n }\n if (name[comma + 3] === '.' && name[comma + 4] === 'C') {\n return name.substring(0, comma + 6);\n }\n }\n return name.substring(0, comma);\n }\n\n /**\n * Returns the ISO 3166 alpha-2 country code (e.g. `\"US\"`, `\"IL\"`, `\"FR\"`)\n * passed to the constructor, or `undefined` if none was provided.\n */\n getCountryCode(): string | undefined {\n return this.cc;\n }\n\n /**\n * Returns the Olson timezone identifier (e.g. `\"America/Chicago\"`).\n * Alias for `getTimeZone()` from the parent `GeoLocation` class.\n */\n getTzid(): string {\n return this.getTimeZone();\n }\n\n /**\n * Returns a cached 24-hour `Intl.DateTimeFormat` (e.g. `07:41` or `20:03`)\n * configured for this location's timezone. Formatters are memoized by\n * timezone so repeated calls do not allocate.\n * @example\n * const loc = Location.lookup('Tel Aviv')!;\n * const fmt = loc.getTimeFormatter();\n * fmt.format(new Date()); // e.g. '18:42'\n */\n getTimeFormatter(): Intl.DateTimeFormat {\n return getFormatter(this.getTimeZone());\n }\n\n /**\n * Returns the optional geographic identifier passed to the constructor\n * (typically a GeoNames numeric ID or a US Zip Code string), or\n * `undefined` if none was provided.\n */\n getGeoId(): string | number | undefined {\n return this.geoid;\n }\n\n /**\n * Creates a location object from one of 65 \"classic\" Hebcal city names.\n * The following city names are supported:\n * 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',\n * 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',\n * 'Buenos Aires', 'Buffalo', 'Chicago', 'Cincinnati', 'Cleveland',\n * 'Dallas', 'Denver', 'Detroit', 'Eilat', 'Gibraltar', 'Haifa',\n * 'Hawaii', 'Helsinki', 'Houston', 'Jerusalem', 'Johannesburg',\n * 'Kiev', 'La Paz', 'Livingston', 'Las Vegas', 'London', 'Los Angeles',\n * 'Marseilles', 'Miami', 'Minneapolis', 'Melbourne', 'Mexico City',\n * 'Montreal', 'Moscow', 'New York', 'Omaha', 'Ottawa', 'Panama City',\n * 'Paris', 'Pawtucket', 'Petach Tikvah', 'Philadelphia', 'Phoenix',\n * 'Pittsburgh', 'Providence', 'Portland', 'Saint Louis', 'Saint Petersburg',\n * 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',\n * 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',\n * 'Washington DC', 'Worcester'\n *\n * Lookups are case-insensitive. Returns `undefined` if the name is not\n * recognized. The list can be extended with {@link Location.addLocation}.\n * @example\n * const loc = Location.lookup('San Francisco');\n * console.log(loc?.getTzid()); // 'America/Los_Angeles'\n * @param name case-insensitive classic city name\n */\n static lookup(name: string): Location | undefined {\n if (classicCities.size === 0) {\n initClassicCities();\n }\n return classicCities.get(name.toLowerCase());\n }\n\n /**\n * Returns a JSON-serialized representation of this Location.\n * Useful for debugging and structured logging.\n */\n toString(): string {\n return JSON.stringify(this);\n }\n\n /**\n * Converts a legacy Hebcal-style timezone (a numeric GMT offset plus a\n * coarse DST region) to a standard IANA/Olson timezone ID.\n *\n * This exists to migrate data from older Hebcal versions that stored\n * timezones as GMT offset + DST scheme rather than as a full tzid.\n * @example\n * Location.legacyTzToTzid(2, 'israel'); // 'Asia/Jerusalem'\n * Location.legacyTzToTzid(0, 'eu'); // 'Europe/London'\n * Location.legacyTzToTzid(0, 'none'); // 'UTC'\n * Location.legacyTzToTzid(-5, 'none'); // 'Etc/GMT-5'\n * @param tz integer, GMT offset in hours\n * @param dst 'none', 'eu', 'usa', or 'israel'\n */\n static legacyTzToTzid(tz: number, dst: string): string | undefined {\n tz = +tz;\n if (dst === 'none') {\n if (tz === 0) {\n return 'UTC';\n }\n const plus = tz > 0 ? '+' : '';\n return `Etc/GMT${plus}${tz}`;\n }\n if (tz === 2 && dst === 'israel') {\n return 'Asia/Jerusalem';\n }\n if (dst === 'eu') {\n switch (tz) {\n case -2:\n return 'Atlantic/Cape_Verde';\n case -1:\n return 'Atlantic/Azores';\n case 0:\n return 'Europe/London';\n case 1:\n return 'Europe/Paris';\n case 2:\n return 'Europe/Athens';\n default:\n break;\n }\n }\n if (dst === 'usa') {\n return ZIPCODES_TZ_MAP[String(tz * -1)];\n }\n return undefined;\n }\n\n /**\n * Converts timezone info from Zip-Codes.com to a standard Olson tzid.\n * @example\n * Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'\n * @param state two-letter all-caps US state abbreviation like 'CA'\n * @param tz positive number, 5=America/New_York, 8=America/Los_Angeles\n * @param dst single char 'Y' or 'N'\n */\n static getUsaTzid(state: string, tz: number, dst: string): string {\n tz = +tz;\n if (tz === 10 && state === 'AK') {\n return 'America/Adak';\n }\n if (tz === 7 && state === 'AZ') {\n return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';\n }\n return ZIPCODES_TZ_MAP[tz];\n }\n\n /**\n * Registers a new named location with the built-in `Location.lookup()`\n * registry. Names are stored case-insensitively. Returns `false` if a\n * location with the same (lower-cased) name is already registered, and\n * `true` if successfully added.\n *\n * Use this to extend the built-in set of 65 classic Hebcal cities with\n * your own custom locations.\n * @example\n * const tlv = new Location(32.0853, 34.7818, true,\n * 'Asia/Jerusalem', 'My Office, Tel Aviv', 'IL');\n * Location.addLocation('My Office', tlv); // true\n * Location.lookup('my office')?.getTzid(); // 'Asia/Jerusalem'\n * @param cityName name to register the location under (case insensitive)\n * @param location the `Location` instance to register\n */\n static addLocation(cityName: string, location: Location): boolean {\n const name = cityName.toLowerCase();\n if (classicCities.has(name)) {\n return false;\n }\n classicCities.set(name, location);\n return true;\n }\n}\n","import {CalOptions} from './CalOptions.js';\n\nconst hour12cc: Record<string, number> = {\n US: 1,\n CA: 1,\n BR: 1,\n AU: 1,\n NZ: 1,\n DO: 1,\n PR: 1,\n GR: 1,\n IN: 1,\n KR: 1,\n NP: 1,\n ZA: 1,\n} as const;\n\n/**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {reformatTimeStr, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string') throw new TypeError(`Bad timeStr: ${timeStr}`);\n const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');\n const hour12 = options?.hour12;\n if (hour12 !== undefined && !hour12) {\n return timeStr;\n }\n if (!hour12 && hour12cc[cc] === undefined) {\n return timeStr;\n }\n const hm = timeStr.split(':');\n let hour: string | number = parseInt(hm[0], 10);\n if (hour < 12 && suffix) {\n suffix = suffix.replace('p', 'a').replace('P', 'A');\n if (hour === 0) {\n hour = 12;\n }\n } else if (hour > 12) {\n hour = hour % 12;\n } else if (hour === 0) {\n hour = '00';\n }\n return `${hour}:${hm[1]}${suffix}`;\n}\n","import {HDate, isLeapYear} from '@hebcal/hdate';\n\n/**\n * Represents a molad, the moment when the new moon is \"born\"\n */\nexport type MoladBase = {\n /** Hebrew date */\n readonly hdate: HDate;\n /** hour of day (0-23) */\n readonly hour: number;\n /** minutes past hour (0-59) */\n readonly minutes: number;\n /** parts of a minute (0-17) */\n readonly chalakim: number;\n};\n\n/*\n * Includes code ported from KosherJava, copyright 2004 Eliyahu Hershfeld,\n * released under LGPL 2.1.\n */\n\n/**\n * the Jewish epoch using the RD (Rata Die/Fixed Date or Reingold Dershowitz) day used in Calendrical Calculations.\n * Day 1 is January 1, 0001 of the Gregorian calendar\n */\nconst JEWISH_EPOCH: number = -1373429;\n\n/** The number of _chalakim_ (18) in a minute. */\nconst CHALAKIM_PER_MINUTE: number = 18;\n\n/** The number of _chalakim_ (1080) in an hour. */\nconst CHALAKIM_PER_HOUR: number = 1080;\n\n/** The number of _chalakim_ (25,920) in a 24-hour day. */\nconst CHALAKIM_PER_DAY: number = 25920; // 24 * 1080\n\n/** The number of _chalakim_ in an average Jewish month. A month has 29 days, 12 hours and 793\n * _chalakim_ (44 minutes and 3.3 seconds) for a total of 765,433 _chalakim_ */\nconst CHALAKIM_PER_MONTH: number = 765433; // (29 * 24 + 12) * 1080 + 793\n\n/**\n * Days from the beginning of Sunday till _molad BaHaRaD_. Calculated as 1 day, 5 hours and 204 _chalakim_ =\n * (24 + 5) * 1080 + 204 = 31524\n */\nconst CHALAKIM_MOLAD_TOHU: number = 31524;\n\n/**\n * Converts the NISSAN-based constants used by this class to numeric month starting from\n * TISHREI. This is required for _molad_ calculations.\n */\nfunction getJewishMonthOfYear(year: number, month: number): number {\n const leap: boolean = isLeapYear(year);\n return ((month + (leap ? 6 : 5)) % (leap ? 13 : 12)) + 1;\n}\n\n/**\n * Returns the number of _chalakim_ (parts - 1080 to the hour) from\n * the original hypothetical _Molad Tohu_ to the year and month\n * passed in.\n */\nfunction getChalakimSinceMoladTohu(year: number, month: number): number {\n // Jewish lunar month = 29 days, 12 hours and 793 chalakim\n // chalakim since Molad Tohu BeHaRaD - 1 day, 5 hours and 204 chalakim\n const monthOfYear: number = getJewishMonthOfYear(year, month);\n const monthsElapsed: number =\n 235 * Math.trunc((year - 1) / 19) + // Months in complete 19-year lunar (Metonic) cycles so far\n 12 * ((year - 1) % 19) + // Regular months in this cycle\n Math.trunc((7 * ((year - 1) % 19) + 1) / 19) + // Leap months this cycle\n (monthOfYear - 1); // add elapsed months till the start of the molad of the month\n // return chalakim prior to BeHaRaD + number of chalakim since\n return CHALAKIM_MOLAD_TOHU + CHALAKIM_PER_MONTH * monthsElapsed;\n}\n\n/**\n * Returns the number of days from the Jewish epoch from the number of chalakim from the epoch passed in.\n * @param chalakim the number of _chalakim_ since the beginning of Sunday prior to BaHaRaD\n * @return the number of days from the Jewish epoch\n */\nfunction moladToAbsDate(chalakim: number): number {\n return Math.trunc(chalakim / CHALAKIM_PER_DAY) + JEWISH_EPOCH;\n}\n\n/**\n * Calculates the molad (birth of the new moon) for a Hebrew month using\n * traditional chalakim arithmetic.\n *\n * Returns the raw components — day of week, hour, minutes and chalakim. Use\n * {@link Molad} for a higher-level interface with rendering and Kiddush Levana\n * times.\n * @param year Hebrew year\n * @param month Hebrew month (see `months` from `@hebcal/hdate`)\n * @return the components of the molad for that month\n */\nexport function calculateMolad(year: number, month: number): MoladBase {\n const chalakim = getChalakimSinceMoladTohu(year, month);\n const absDate = moladToAbsDate(chalakim);\n let hd = new HDate(absDate);\n const conjunctionDay: number = Math.trunc(chalakim / CHALAKIM_PER_DAY);\n const conjunctionParts: number = Math.trunc(\n chalakim - conjunctionDay * CHALAKIM_PER_DAY\n );\n\n let adjustedChalakim: number = conjunctionParts;\n let hour = Math.trunc(adjustedChalakim / CHALAKIM_PER_HOUR);\n adjustedChalakim = adjustedChalakim - hour * CHALAKIM_PER_HOUR;\n const minutes = Math.trunc(adjustedChalakim / CHALAKIM_PER_MINUTE);\n\n if (hour >= 6) {\n hd = hd.next();\n }\n hour = (hour + 18) % 24;\n\n const m: MoladBase = {\n hdate: hd,\n hour,\n minutes,\n chalakim: adjustedChalakim - minutes * CHALAKIM_PER_MINUTE,\n };\n\n return m;\n}\n","import 'temporal-polyfill/global';\nimport {getTimezoneOffset} from '@hebcal/hdate';\nimport {MoladBase} from './moladBase.js';\n\n/** constant for milliseconds in a minute (60,000) */\nconst MINUTE_MILLIS: number = 60 * 1000;\n\n/**\n * A method that will return the location's local mean time offset in milliseconds from local\n * [standard time](https://en.wikipedia.org/wiki/Standard_time). The globe is split into 360°, with\n * 15° per hour of the day. For a locale that is at a longitude that is evenly divisible by 15\n * (longitude % 15 == 0), at solar noon (with adjustment for the\n * [equation of time](https://en.wikipedia.org/wiki/Equation_of_time)) the sun should be directly overhead,\n * so a user who is 1° west of this will have noon at 4 minutes after standard time noon, and conversely, a user\n * who is 1° east of the 15° longitude will have noon at 11:56 AM. Lakewood, N.J., whose longitude is\n * -74.222, is 0.778 away from the closest multiple of 15 at -75°. This is multiplied by 4 to yield 3 minutes\n * and 10 seconds earlier than standard time. The offset returned does not account for the\n * [Daylight saving time](https://en.wikipedia.org/wiki/Daylight_saving_time) offset since this function is\n * unaware of dates.\n *\n * @param dt the date used to resolve the timezone offset\n * @param longitude the location's longitude\n * @param tzid IANA timezone identifier\n * @return the offset in milliseconds not accounting for Daylight saving time. A positive value will be returned\n * East of the 15° timezone line, and a negative value West of it.\n */\nfunction getLocalMeanTimeOffset(dt: Date, longitude: number, tzid: string): number {\n const offset: number = -1 * getTimezoneOffset(tzid, dt);\n const d = longitude * 4 * MINUTE_MILLIS - offset * MINUTE_MILLIS;\n return Math.trunc(d);\n}\n\n/**\n * Returns the moment of the molad as a `Temporal.ZonedDateTime` in the `UTC` zone.\n *\n * The molad is computed in Jerusalem *standard* time and then converted, so the\n * returned instant is correct year-round; only the zone of the returned object\n * is `UTC`. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds)\n * from the computed time — Har Habayis, at longitude 35.2354°, is 5.2354° away\n * from the multiple-of-15 timezone longitude — to get to standard time. Daylight\n * savings time is intentionally not applied; adjust when formatting for display.\n *\n * @param molad the molad to convert\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad\n */\nexport function getMoladAsDate(molad: MoladBase): Temporal.ZonedDateTime {\n const moladSeconds: number = (molad.chalakim * 10) / 3;\n const millis: number = Math.trunc(\n 1000 * (moladSeconds - Math.trunc(moladSeconds))\n );\n\n const dt = molad.hdate.greg();\n\n // The raw molad Date (point in time) must be generated using standard time. Using \"Asia/Jerusalem\" timezone will result in the time\n // being incorrectly off by an hour in the summer due to DST. Proper adjustment for the actual time in DST will be done by the date\n // formatter class used to display the Date.\n const tzid: string = 'Etc/GMT+2';\n const zdt = Temporal.ZonedDateTime.from({\n year: dt.getFullYear(),\n month: dt.getMonth() + 1,\n day: dt.getDate(),\n hour: molad.hour,\n minute: molad.minutes,\n second: Math.trunc(moladSeconds),\n millisecond: millis,\n timeZone: tzid,\n });\n\n const longitude: number = 35.2354; // Har Habayis longitude\n const offset = getLocalMeanTimeOffset(dt, longitude, tzid);\n // subtract local time difference of 20.94 minutes (20 minutes and 56.496 seconds) to get to Standard time\n const zdt2 = zdt.subtract({milliseconds: offset});\n return zdt2.withTimeZone('UTC');\n}\n","export function smartApostrophe(str: string): string {\n return str.replaceAll(\"'\", '’');\n}\n\nexport function urlFriendly(str: string): string {\n return str.toLowerCase().replaceAll(\"'\", '').replaceAll(' ', '-');\n}\n","import 'temporal-polyfill/global';\nimport {Event, flags} from './event.js';\nimport {CalOptions} from './CalOptions.js';\nimport {HDate, Locale, pad2} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {MoladBase, calculateMolad} from './moladBase.js';\nimport {getMoladAsDate} from './moladDate.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst enDoW = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n] as const;\n\nconst heDayNames = [\n 'רִאשׁוֹן',\n 'שֵׁנִי',\n 'שְׁלִישִׁי',\n 'רְבִיעִי',\n 'חֲמִישִׁי',\n 'שִׁישִּׁי',\n 'שַׁבָּת',\n] as const;\n\nconst frDoW = [\n 'Dimanche',\n 'Lundi',\n 'Mardi',\n 'Mercredi',\n 'Jeudi',\n 'Vendredi',\n 'Samedi',\n] as const;\nconst night = 'בַּלַּ֥יְלָה';\n\nfunction getDayNames(locale?: string): readonly string[] {\n if (Locale.isHebrewLocale(locale)) {\n return heDayNames;\n }\n if (locale === 'fr') {\n return frDoW;\n }\n return enDoW;\n}\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n if (hour < 12) return 'בַּבֹּקֶר';\n if (hour < 17) return 'בַּצׇּהֳרַיִים';\n if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a *molad* — the calculated moment when the new moon is \"born\"\n * for a given Hebrew month.\n *\n * The molad is announced in synagogue on Shabbat Mevarchim (the Shabbat\n * before Rosh Chodesh) and is the anchor point for Kiddush Levana zmanim.\n * Calculations use the traditional chalakim arithmetic\n * (1 hour = 1080 chalakim) anchored to *Molad Tohu BaHaRaD*.\n *\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * console.log(m.getMonthName()); // 'Nisan'\n * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // 22 57 7\n * console.log(m.render('en')); // 'Molad Nisan: Monday, 10:57pm and 7 chalakim'\n */\nexport class Molad {\n private readonly m: MoladBase;\n private readonly year: number;\n private readonly month: number;\n private instant?: Temporal.ZonedDateTime;\n\n /**\n * Calculates the molad for a given Hebrew year and month.\n * @param year Hebrew year\n * @param month 1=NISAN, 7=TISHREI (uses Nisan-based numbering)\n */\n constructor(year: number, month: number) {\n this.m = calculateMolad(year, month);\n this.year = year;\n this.month = month;\n }\n /**\n * The exact Hebrew date of the molad, which often falls on the\n * 28th or 30th of the preceeding month, occasionally on the first of the\n * month, and in extremely rare circumstances the 27th of the month.\n * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z\n * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z\n * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z\n */\n getMoladDate(): HDate {\n return this.m.hdate;\n }\n /**\n * The year of the molad (as constructed)\n */\n getYear(): number {\n return this.year;\n }\n /**\n * The month (1=NISSAN, 7=TISHREI) as constructed\n */\n getMonth(): number {\n return this.month;\n }\n /**\n * Returns a transliterated string name of the molad's Hebrew month,\n * for example 'Elul' or 'Cheshvan'.\n */\n getMonthName(): string {\n return HDate.getMonthName(this.month, this.year);\n }\n /**\n * @returns Day of Week (0=Sunday, 6=Saturday)\n */\n getDow(): number {\n return this.m.hdate.getDay();\n }\n /**\n * @returns hour of day (0-23)\n */\n getHour(): number {\n return this.m.hour;\n }\n /**\n * @returns minutes past hour (0-59)\n */\n getMinutes(): number {\n return this.m.minutes;\n }\n /**\n * @returns parts of a minute (0-17)\n */\n getChalakim(): number {\n return this.m.chalakim;\n }\n /**\n * Returns the moment of the molad as a `Temporal.ZonedDateTime` in the `UTC` zone.\n *\n * The molad is computed in Jerusalem *standard* time and then converted, so the\n * returned instant is correct year-round; only the zone of the returned object\n * is `UTC`. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds)\n * from the computed time — Har Habayis, at longitude 35.2354°, is 5.2354° away\n * from the multiple-of-15 timezone longitude — to get to standard time. Daylight\n * savings time is intentionally not applied; adjust when formatting for display.\n *\n * The returned value is cached after the first call.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * const zdt = m.getInstant();\n * console.log(zdt.toString()); // '2024-04-08T20:36:26.837+00:00[UTC]'\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad\n */\n getInstant(): Temporal.ZonedDateTime {\n this.instant ??= getMoladAsDate(this.m);\n return this.instant;\n }\n /**\n * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad.\n */\n getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 72});\n }\n\n /**\n * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the\n * [Mechaber](https://en.wikipedia.org/wiki/Yosef_Karo). See the\n * [Bach's](https://en.wikipedia.org/wiki/Yoel_Sirkis) opinion on this time. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad.\n */\n getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 168});\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as\n * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and\n * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying _alos_ before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad.\n */\n getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // add half the time between molad and molad (half of 29 days, 12 hours and 793 chalakim (44 minutes, 3.3\n // seconds), or 14 days, 18 hours, 22 minutes and 666 milliseconds). Add it as hours, not days, to avoid\n // DST/ST crossover issues.\n return zdt.add({\n hours: 24 * 14 + 18,\n minutes: 22,\n seconds: 1,\n milliseconds: 666,\n });\n }\n\n /**\n * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down\n * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles) who brings down the opinion of the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating\n * {@link Molad.getSofZmanKidushLevanaBetweenMoldos | half way between molad and molad} is of the opinion that Mechaber\n * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid\n * Heber's very detailed writeup in Siman Daled (chapter 4) of\n * [Shaarei Zmanim](https://www.worldcat.org/oclc/461326125). This method returns the time even if it is during\n * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_\n * before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad.\n */\n getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // 15 days after the molad. Add it as hours, not days, to avoid DST/ST crossover issues.\n return zdt.add({hours: 24 * 15});\n }\n\n /**\n * Returns a human-readable, localized string announcing the molad —\n * suitable for use on Shabbat Mevarchim. The format includes the Hebrew\n * month name, day of week, hour : minute, and chalakim if non-zero.\n *\n * Time format honors `options.hour12` and `options.location` (12-hour vs.\n * 24-hour); see {@link reformatTimeStr}.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * m.render('en', {hour12: true});\n * // => 'Molad Nisan: Monday, 10:57pm and 7 chalakim'\n * m.render('en', {hour12: false});\n * // => 'Molad Nisan: Monday, 22:57 and 7 chalakim'\n * m.render('he');\n * // => 'מוֹלָד הָלְּבָנָה נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …'\n * @param [locale] Optional locale name (defaults to empty locale)\n * @param options used for time formatting (12-hour vs 24-hour)\n */\n render(locale?: string, options?: CalOptions): string {\n const monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = getDayNames(locale);\n const dow = dayNames[this.getDow()];\n const minutes = this.getMinutes();\n const hour = this.getHour();\n const chalakim = this.getChalakim();\n const moladStr = Locale.gettext('Molad', locale);\n const minutesStr = Locale.lookupTranslation('min', locale) ?? 'minutes';\n const chalakimStr = Locale.gettext('chalakim', locale);\n const and = Locale.gettext('and', locale);\n if (Locale.isHebrewLocale(locale)) {\n const ampm = getHebrewTimeOfDay(hour);\n let result =\n `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +\n `בְּשָׁעָה ${hour} ${ampm}, ` +\n `ו-${minutes} ${minutesStr}`;\n if (chalakim !== 0) {\n result += ` ו-${chalakim} ${chalakimStr}`;\n }\n if (locale!.toLocaleLowerCase() === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(result);\n }\n return result;\n }\n const fmtTime = reformatTimeStr(`${hour}:${pad2(minutes)}`, 'pm', options);\n const month = smartApostrophe(monthName);\n const result = `${moladStr} ${month}: ${dow}, ${fmtTime}`;\n if (chalakim === 0) {\n return result;\n }\n return result + ` ${and} ${chalakim} ${chalakimStr}`;\n }\n}\n\n/** Represents a Molad announcement on Shabbat Mevarchim */\nexport class MoladEvent extends Event {\n readonly molad: Molad;\n private readonly options: CalOptions;\n /**\n * @param date Hebrew date event occurs\n * @param hyear molad year\n * @param hmonth molad month\n * @param options\n */\n constructor(date: HDate, hyear: number, hmonth: number, options: CalOptions) {\n const m = new Molad(hyear, hmonth);\n const monthName = m.getMonthName();\n super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);\n this.molad = m;\n this.options = options;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.molad.render(locale, this.options);\n }\n}\n","import 'temporal-polyfill/global';\nimport {GeoLocation, NOAACalculator} from '@hebcal/noaa';\nimport {HDate, getPseudoISO, getTimezoneOffset, isDate, pad2} from '@hebcal/hdate';\nimport {Molad} from './molad.js';\n\n/**\n * Converts an instant to a `Date`, discarding milliseconds.\n *\n * Zmanim are read out to the minute, and every accessor here reduces to an\n * instant, so we ask `@hebcal/noaa` for epoch milliseconds rather than a\n * `Temporal.ZonedDateTime`. Resolving the IANA zone to build a\n * `ZonedDateTime` costs roughly 750ns and nothing downstream uses it, which\n * made it the single most expensive step in a sunrise/sunset calculation.\n * @private\n */\nfunction millisToDate(millis: number): Date {\n const res = new Date(millis);\n res.setMilliseconds(0);\n return res;\n}\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°\n */\nconst GEOMETRIC_ZENITH: number = 90;\n\n/**\n * The zenith of 1.583° below geometric zenith (90°). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).\n *\n * @see Zmanim.sunriseBaalHatanya\n * @see Zmanim.sunsetBaalHatanya\n */\nconst ZENITH_1_POINT_583: number = GEOMETRIC_ZENITH + 1.583;\n\n/**\n * The zenith of civil twilight; the sun is 6° below the horizon.\n * Matches `NOAACalculator.CIVIL_ZENITH`.\n */\nconst CIVIL_ZENITH: number = GEOMETRIC_ZENITH + 6;\n\n/**\n * Length of one temporal (halachic) hour in milliseconds, i.e. one twelfth of\n * the day. Mirrors `NOAACalculator.getTemporalHour()`, including its floor, so\n * that results stay identical to the `ZonedDateTime` code path.\n * @private\n */\nfunction temporalHourMillis(startOfDay: number, endOfDay: number): number {\n return Math.floor((endOfDay - startOfDay) / 12);\n}\n\n/**\n * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.\n * Calculations are available for tzeit / tzais (nightfall),\n * shkiah (sunset) and more.\n *\n * Zmanim are estimated using an algorithm published by the US National Oceanic\n * and Atmospheric Administration. The NOAA solar calculator is based on equations\n * from _Astronomical Algorithms_ by Jean Meeus.\n *\n * The sunrise and sunset results are theoretically accurate to within a minute for\n * locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.\n * However, due to variations in atmospheric composition, temperature, pressure and\n * conditions, observed values may vary from calculations.\n * https://gml.noaa.gov/grad/solcalc/calcdetails.html\n *\n * @example\n * import {GeoLocation, Zmanim} from '@hebcal/core';\n * const latitude = 41.822232;\n * const longitude = -71.448292;\n * const tzid = 'America/New_York';\n * const friday = new Date(2023, 8, 8);\n * const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);\n * const zmanim = new Zmanim(gloc, friday, false);\n * const candleLighting = zmanim.sunsetOffset(-18, true);\n * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);\n * // '2023-09-08T18:49:00-04:00'\n */\nexport class Zmanim {\n private readonly hdate: HDate;\n private readonly plainDate: Temporal.PlainDate;\n private readonly gloc: GeoLocation;\n private readonly noaa: NOAACalculator;\n private useElevation: boolean;\n /**\n * Initialize a Zmanim instance.\n * @param gloc GeoLocation including latitude, longitude, and timezone\n * @param date Regular or Hebrew Date. If `date` is a regular `Date`,\n * hours, minutes, seconds and milliseconds are ignored.\n * @param useElevation use elevation for calculations (default `false`).\n * If `true`, use elevation to affect the calculation of all sunrise/sunset based\n * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven\n * by the amount of light in the sky and are not impacted by elevation.\n * These zmanim intentionally do not support elevation adjustment.\n */\n constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean) {\n this.hdate = new HDate(date);\n const dt = isDate(date) ? date : this.hdate.greg();\n // The constructor is ~1.8x cheaper than PlainDate.from(), which has to\n // walk a property bag and apply overflow handling. The fields come from a\n // real Date, so they are always in range and never need constraining.\n this.plainDate = new Temporal.PlainDate(\n dt.getFullYear(),\n dt.getMonth() + 1,\n dt.getDate()\n );\n this.gloc = gloc;\n this.noaa = new NOAACalculator(gloc, this.plainDate);\n this.useElevation = Boolean(useElevation);\n }\n /**\n * Returns `true` if this instance uses the location's elevation when\n * calculating sunrise/sunset-based zmanim.\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for sunrise/sunset-based zmanim.\n *\n * Degree-based zmanim (such as {@link alotHaShachar} or {@link tzeit})\n * estimate the amount of light in the sky and are never affected by this\n * setting.\n * @param useElevation `true` to include the location's elevation\n */\n setUseElevation(useElevation: boolean) {\n this.useElevation = useElevation;\n }\n /**\n * Convenience function to get the time when sun is above or below the horizon\n * for a certain angle (in degrees).\n * This function does not support elevation adjustment.\n * @param angle degrees of solar depression below the horizon; for example\n * `8.5` means the center of the sun is 8.5° below the horizon\n * @param rising `true` for the morning (before sunrise), `false` for the\n * evening (after sunset)\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = GEOMETRIC_ZENITH + angle;\n return millisToDate(\n rising\n ? this.sunriseMillis(offsetZenith, true)\n : this.sunsetMillis(offsetZenith, true)\n );\n }\n /**\n * Sunrise for a given zenith as epoch milliseconds, mirroring what\n * `NOAACalculator.getSunrise()` / `getSeaLevelSunrise()` /\n * `getSunriseOffsetByDegrees()` compute, minus the `ZonedDateTime`.\n *\n * Note that noaa's degree-based accessors pass `adjustForElevation = true`\n * as well; the adjustment is a no-op unless the zenith is exactly\n * {@link GEOMETRIC_ZENITH}, which is why degree-based zmanim are unaffected\n * by elevation.\n * @private\n */\n private sunriseMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunrise0(zenith)\n : this.noaa.getUTCSeaLevelSunrise(zenith);\n return this.noaa.getEpochMillisFromTime(utc, true);\n }\n /**\n * Sunset counterpart of {@link sunriseMillis}.\n * @private\n */\n private sunsetMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunset0(zenith)\n : this.noaa.getUTCSeaLevelSunset(zenith);\n return this.noaa.getEpochMillisFromTime(utc, false);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * Civil dawn; Sun is 6° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dawn(): Date {\n return millisToDate(this.sunriseMillis(CIVIL_ZENITH, true));\n }\n /**\n * Civil dusk; Sun is 6° below the horizon in the evening.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dusk(): Date {\n return millisToDate(this.sunsetMillis(CIVIL_ZENITH, true));\n }\n /**\n * Returns sunset for the previous day.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n gregEve(): Date {\n const prev0 = this.plainDate.subtract({days: 1});\n const prev = new Date(prev0.year, prev0.month - 1, prev0.day);\n const zman = new Zmanim(this.gloc, prev, this.useElevation);\n return zman.sunset();\n }\n /**\n * Length in milliseconds of one halachic hour of the night, calculated as\n * one twelfth of the time between the previous day's sunset and this\n * day's sunrise. Used internally by {@link chatzotNight}.\n */\n nightHour(): number {\n return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour\n }\n /**\n * Midday – Chatzot; Sunrise plus 6 halachic hours.\n *\n * Unlike most sunrise/sunset-based zmanim, this is always computed from\n * sea-level sunrise and sunset, so it is not affected by the\n * `useElevation` setting.\n */\n chatzot(): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, false);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, false);\n // NOAACalculator.getSunTransit(): sunrise plus 6 temporal hours\n return millisToDate(startOfDay + temporalHourMillis(startOfDay, endOfDay) * 6);\n }\n /**\n * Midnight – Chatzot; Sunset plus 6 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n chatzotNight(): Date {\n return new Date(this.sunrise().getTime() - this.nightHour() * 6);\n }\n /**\n * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n alotHaShachar(): Date {\n return this.timeAtAngle(16.1, true);\n }\n /**\n * Dawn – Alot haShachar; calculated as 72 minutes before sunrise or\n * sea level sunrise.\n */\n alotHaShachar72(): Date {\n return this.sunriseOffset(-72, false, false);\n }\n /**\n * Same as {@link alotHaShachar72}, but returns a `Temporal.ZonedDateTime`\n * with seconds precision (instead of a `Date` rounded to the minute), or\n * `null` if sunrise cannot be calculated for this date and location.\n */\n alotHaShachar72zdt(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n if (!zdt) {\n return null;\n }\n return zdt.subtract({minutes: 72});\n }\n\n /**\n * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakir(): Date {\n return this.timeAtAngle(11.5, true);\n }\n /**\n * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakirMachmir(): Date {\n return this.timeAtAngle(10.2, true);\n }\n private getShaahZmanisBasedZmanMillis(\n startOfDay: number,\n endOfDay: number,\n hours: number\n ): number {\n const offset = Math.trunc(temporalHourMillis(startOfDay, endOfDay) * hours);\n return startOfDay + offset;\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @param hours number of _shaos zmaniyos_ (solar hours) after sunrise\n */\n private getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation);\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(startOfDay, endOfDay, hours)\n );\n }\n /**\n * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanShma(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(3);\n }\n /**\n * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.\n *\n * This method returns the latest *zman tfila* (time to recite the morning prayers)\n * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanTfilla(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(4);\n }\n /**\n * This method returns the latest time for burning _chametz_ on _Erev Pesach_ according to the opinion\n * of the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon). This time is 5 halachic hours into the day, based on\n * the opinion of the GRA that the day is calculated from sunrise to sunset.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n * @return the `Date` of the latest time for burning _chametz_ on _Erev Pesach_. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise and one where it does not set, an `Invalid Date` will be returned.\n */\n sofZmanBiurChametzGRA(): Date {\n return this.getShaahZmanisBasedZman(5);\n }\n /**\n * Returns a 2-element array with alot (a `Date`, 72 minutes before sunrise)\n * and the length in milliseconds of one halachic hour of the resulting day.\n * Used internally by the Magen Avraham zmanim.\n * @param forceSeaLevel ignore the `useElevation` setting and use sea-level\n * sunrise and sunset\n */\n getTemporalHour72(forceSeaLevel: boolean): [Date, number] {\n const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);\n const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);\n const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;\n return [alot72, temporalHour];\n }\n /**\n * Returns a 2-element array with alot (a `Date`, when the sun is `angle`\n * degrees below the horizon in the morning) and the length in milliseconds\n * of one halachic hour of the resulting day. Used internally by the\n * degree-based Magen Avraham zmanim.\n * @param angle degrees of solar depression below the horizon\n */\n getTemporalHourByDeg(angle: number): [Date, number] {\n const alot = this.timeAtAngle(angle, true);\n const tzeit = this.timeAtAngle(angle, false);\n const temporalHour = (tzeit.getTime() - alot.getTime()) / 12;\n return [alot, temporalHour];\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed\n * 72 minutes after sea-level sunset.\n */\n sofZmanShmaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanShmaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanShmaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham\n */\n sofZmanTfillaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanTfillaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanTfillaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha gedola*, the earliest time one can pray mincha,\n * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * The Ramba\"m is of the opinion that it is better to delay *mincha* until\n * *mincha ketana* while the Ra\"sh, Tur, GRA and others are of the\n * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.\n */\n minchaGedola(): Date {\n return this.getShaahZmanisBasedZman(6.5);\n }\n /**\n * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the time of *mincha gedola* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the earliest time to pray *mincha*.\n */\n minchaGedolaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n const offset = Math.floor(6.5 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the\n * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,\n * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n */\n minchaKetana(): Date {\n return this.getShaahZmanisBasedZman(9.5);\n }\n /**\n * This method returns the time of *mincha ketana* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the preferred earliest time to pray *mincha* according to the opinion of\n * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n minchaKetanaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));\n }\n /**\n * Plag haMincha; Sunrise plus 10.75 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n plagHaMincha(): Date {\n return this.getShaahZmanisBasedZman(10.75);\n }\n /**\n * Nightfall – Tzeit HaKochavim; the sun is `angle` degrees below the\n * horizon in the evening.\n *\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n * @param [angle=8.5] optional time for solar depression.\n * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\n }\n /**\n * Nightfall – Tzeit HaKochavim; calculated as 72 minutes after sunset\n * (or sea-level sunset, depending on the `useElevation` setting).\n *\n * Returns a `Temporal.ZonedDateTime` with seconds precision, or `null` if\n * sunset cannot be calculated for this date and location.\n */\n tzeit72(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n if (!zdt) {\n return null;\n }\n return zdt.add({minutes: 72});\n }\n /**\n * Alias for sunrise\n */\n neitzHaChama(): Date {\n return this.sunrise();\n }\n /**\n * Alias for sunset\n */\n shkiah(): Date {\n return this.sunset();\n }\n /**\n * Rabbeinu Tam holds that bein hashmashos is a specific time\n * between sunset and tzeis hakochavim.\n * One opinion on how to calculate this time is that\n * it is 13.5 minutes before tzies 7.083.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n beinHaShmashos(): Date {\n const tzeit = this.tzeit(7.083);\n const millis = tzeit.getTime();\n if (isNaN(millis)) {\n return tzeit;\n }\n return new Date(millis - 13.5 * 60 * 1000);\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return previous midnight\n */\n private getMidnightLastNight(): Temporal.ZonedDateTime {\n // reset hour, minutes, seconds and millis\n return this.plainDate.toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return following midnight\n */\n private getMidnightTonight(): Temporal.ZonedDateTime {\n return this.plainDate.add({days: 1}).toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Returns the Date of the _molad_ based time if it occurs on the current date. Since _Kiddush Levana_\n * can only be said during the day, there are parameters to limit it to between _alos_ and _tzais_. If\n * the time occurs between _alos_ and _tzais_, _tzais_ will be returned.\n *\n * @param moladBasedTime\n * the _molad_ based time such as _molad_, _tchilas_ and _sof zman Kiddush Levana_\n * @param alos\n * optional start of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _alos_ or _tzais_ are null.\n * @param tzais\n * optional end of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _tzais_ or _alos_ are null\n * @param techila\n * is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,\n * and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either\n * _alos_ or _tzais_ are null.\n * @return the _molad_ based time. If the _zman_ does not occur during the current date, `null` will be\n * returned.\n */\n private getMoladBasedTime(\n moladBasedTime: Temporal.ZonedDateTime,\n alos: Temporal.ZonedDateTime | null,\n tzais: Temporal.ZonedDateTime | null,\n techila: boolean\n ): Temporal.ZonedDateTime | null {\n const lastMidnight: Temporal.ZonedDateTime = this.getMidnightLastNight();\n const midnightTonight: Temporal.ZonedDateTime = this.getMidnightTonight();\n\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, lastMidnight) < 0 ||\n Temporal.ZonedDateTime.compare(moladBasedTime, midnightTonight) > 0\n ) {\n return null; // Invalid time, bailout\n }\n if (alos === null || tzais === null) {\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone()); // Not enough info to adjust\n }\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, alos) > 0 &&\n Temporal.ZonedDateTime.compare(moladBasedTime, tzais) < 0\n ) {\n // It's the daytime (after alos but before tzais)\n // get the next/prev night\n return techila ? tzais : alos;\n }\n // It's the night, the provided time is valid\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone());\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as\n * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between\n * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be alos. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at\n * tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment halfway between molad and molad. If the time\n * occurs between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this\n * day, `null` will be returned.\n */\n public getSofZmanKidushLevanaBetweenMoldos(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French\n // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush Levana\n // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the\n // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 16) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevanaBetweenMoldos(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of\n * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles), who brings down the opinion of the\n * [Maharil](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating\n * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_}, is of\n * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on\n * the subject, see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of\n * [Shaarei Zmanim](https://hebrewbooks.org/53000).\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 15 days after the _molad_. If the time occurs\n * between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n public getSofZmanKidushLevana15Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in\n // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush\n // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will\n // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 17) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevana15Days(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to\n * [Rabbeinu Yonah](https://en.wikipedia.org/wiki/Yonah_Gerondi)'s opinion that it can be said 3 days after the _molad_.\n * If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to\n * this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual\n * _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.\n *\n * @param alos\n * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at _alos_ and ending\n * at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and ending at\n * _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment 3 days after the molad. If the time occurs\n * between _alos_ and _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n public getTchilasZmanKidushLevana3Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for\n // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh. The 3rd day after the _molad_ will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day\n // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() > 5 && hd.getDate() < 30) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana3Days(),\n alos,\n tzais,\n true\n );\n\n // Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when\n // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)\n if (zman === null && hd.getDate() === 30) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(\n molad2.getTchilasZmanKidushLevana3Days(),\n null,\n null,\n true\n );\n }\n\n return zman;\n }\n\n /**\n * Returns the point in time of the _Molad_, if it occurs on this date. For the traditional day of week, hour,\n * minute and chalakim, see {@link Molad} and its {@link Molad.render} method.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad. If the _molad_ does not occur on\n * this day, `null` will be returned.\n */\n public getZmanMolad(): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa\n // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on\n // Jan 2071, the molad will be on the 2nd day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() > 2 && hd.getDate() < 27) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getInstant(),\n null,\n null,\n true\n );\n\n // deal with molad that happens on the end of the previous month\n if (zman === null && hd.getDate() > 26) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(molad2.getInstant(), null, null, true);\n }\n return zman;\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7\n * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_\n * can't be recited, unless both `alos` and `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 7 days after the molad. If the _zman_\n * will not occur on this day, `null` will be returned.\n */\n public getTchilasZmanKidushLevana7Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for\n // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day\n // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 4 || hd.getDate() > 9) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana7Days(),\n alos,\n tzais,\n true\n );\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _netz amiti_ (sunrise) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are\n * calculated as a dip below the horizon before sunrise.\n *\n * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's\n * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which\n * the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom\n * DovBer Levine's commentary on\n * [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).\n * From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),\n * the sun disappears when it is 1° 35' or 1.583° below the sea level horizon. This in turn is based on the Gemara\n * [Shabbos 35a](https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35). There are other opinions brought down by\n * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after\n * sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' _zman_\n * and is probably a typo and should be 1.683°. These calculations are used by most\n * [Chabad](https://en.wikipedia.org/wiki/Chabad) calendars that use the Baal Hatanya's _zmanim_. See\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the\n * published time for _netz_ / sunrise.\n *\n * @return the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, `null` will be returned.\n */\n private getSunriseBaalHatanya(): number {\n return this.sunriseMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _shkiah amiti_ (sunset) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated\n * as a dip below the horizon after sunset.\n *\n * According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the\n * sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.\n * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.\n *\n * Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.\n *\n * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * @return the exact sea level _shkiah amiti_ (sunset) time. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise, and one where it does not set, `null` will be returned.\n */\n private getSunsetBaalHatanya(): number {\n return this.sunsetMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_\n * (dawn) calculated as the time when the sun is 16.9° below the eastern geometric horizon\n * before {@link sunrise}.\n *\n * The zenith of 16.9° below is based on the calculation that the time between dawn\n * and _netz amiti_ (sunrise) is 72 minutes, the time that it takes to walk 4 mil at 18 minutes\n * a mil ([Rambam](https://en.wikipedia.org/wiki/Maimonides) and others). The sun's position at 72\n * minutes before _netz amiti_ (sunrise) in Jerusalem\n * [around the equinox / equilux](https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/)\n * is 16.9° below geometric zenith.\n *\n * @return the `Date` of dawn. If the calculation can't be computed, such as in northern and southern\n * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach\n * low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n public alosBaalHatanya(): Date {\n return this.timeAtAngle(16.9, true);\n }\n\n private getShaahZmanisBaalHatanya(hours: number): Date {\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(\n this.getSunriseBaalHatanya(),\n this.getSunsetBaalHatanya(),\n hours\n )\n );\n }\n\n /**\n * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3\n * _shaos zmaniyos_ (solar hours) after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya\n * that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman shema_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n public sofZmanShmaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(3);\n }\n\n /**\n * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4\n * halachic hours into the day, based on the opinion of the Baal Hatanya that the day is\n * calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman tfilah_. If the calculation can't be computed, such as in\n * the Arctic Circle where there is at least one day a year where the sun does not rise and one where it does\n * not set, an `Invalid Date` will be returned.\n */\n public sofZmanTfilaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(4);\n }\n\n /**\n * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray\n * _mincha_. The [Rambam](https://en.wikipedia.org/wiki/Maimonides) is of the opinion that it is\n * better to delay _mincha_ until {@link minchaKetanaBaalHatanya | _mincha ketana_} while the\n * [Ra\"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),\n * [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),\n * [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed\n * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 sea level solar hours after\n * _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated from\n * _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n * @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise\n * and one where it does not set, an `Invalid Date` will be returned.\n */\n public minchaGedolaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(6.5);\n }\n\n /**\n * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray\n * _mincha_ in the opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n * For more information on this see the documentation on {@link minchaGedolaBaalHatanya | _mincha gedola_}.\n * This is calculated as 9.5 sea level solar hours after _netz amiti_ (sunrise), based on the opinion of\n * the Baal Hatanya that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _mincha ketana_. If the calculation can't be computed, such as\n * in the Arctic Circle where there is at least one day a year where the sun does not rise and one where it\n * does not set, an `Invalid Date` will be returned.\n */\n public minchaKetanaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(9.5);\n }\n\n /**\n * This method returns the time of _plag hamincha_. This is calculated as 10.75 sea level solar hours\n * after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated\n * from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _plag hamincha_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n public plagHaminchaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(10.75);\n }\n\n /**\n * A method that returns _tzais_ (nightfall) when the sun is 6° below the western geometric horizon\n * (90°) after {@link sunset}. This is the time the Baal Hatanya calls _shkiah amiti_ plus the\n * interval it takes the sun to descend a further 6°.\n *\n * @return the `Date` of nightfall. If the calculation can't be computed, such as in northern and southern\n * locations — even south of the Arctic Circle and north of the Antarctic Circle — where the sun may not\n * reach low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n public tzaisBaalHatanya(): Date {\n return this.timeAtAngle(6, false);\n }\n\n /**\n * Uses timeFormat to return a date like '20:34'.\n * Returns `XX:XX` if the date is invalid.\n * @param dt the time to format\n * @param timeFormat formatter to use, e.g. from\n * {@link Location.getTimeFormatter}\n */\n static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string {\n if (isNaN(dt.getTime())) {\n return 'XX:XX'; // Invalid Date\n }\n const time = timeFormat.format(dt);\n // Rewrite the h24 midnight (\"24:15\") that some locales produce. Checking\n // the two leading characters avoids the throwaway array that split(':')\n // allocated on every event; this runs once per timed event, and the\n // Intl.format() call above is already the expensive part.\n if (\n time.charCodeAt(0) === 0x32 && // '2'\n time.charCodeAt(1) === 0x34 && // '4'\n time.charCodeAt(2) === 0x3a // ':'\n ) {\n return '00' + time.substring(2);\n }\n return time;\n }\n\n /**\n * Discards seconds, rounding to nearest minute.\n * @param dt\n */\n static roundTime(dt: Date): Date {\n const millis = dt.getTime();\n if (isNaN(millis)) {\n return dt;\n }\n // Round up to next minute if needed\n const millisOnly = dt.getMilliseconds();\n const seconds = dt.getSeconds();\n if (seconds === 0 && millisOnly === 0) {\n return dt;\n }\n const secAndMillis = seconds * 1000 + millisOnly;\n const delta = secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;\n return new Date(millis + delta);\n }\n\n /**\n * Get offset string (like \"+05:00\" or \"-08:00\") from tzid (like \"Europe/Moscow\")\n * @param tzid\n * @param date\n */\n static timeZoneOffset(tzid: string, date: Date): string {\n const offset = getTimezoneOffset(tzid, date);\n const offsetAbs = Math.abs(offset);\n const hours = Math.floor(offsetAbs / 60);\n const minutes = offsetAbs % 60;\n return (offset < 0 ? '+' : '-') + pad2(hours) + ':' + pad2(minutes);\n }\n\n /**\n * Returns a string like \"2022-04-01T13:06:00-11:00\"\n * @param tzid\n * @param date\n */\n static formatISOWithTimeZone(tzid: string, date: Date): string {\n if (isNaN(date.getTime())) {\n return '0000-00-00T00:00:00Z';\n }\n return (\n getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date)\n );\n }\n\n /**\n * Returns sunrise + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunrise (default false)\n */\n sunriseOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();\n if (isNaN(sunrise.getTime())) {\n return sunrise;\n }\n if (roundMinute) {\n // For positive offsets only, round up to next minute if needed\n if (offset > 0 && sunrise.getSeconds() >= 30) {\n offset++;\n }\n sunrise.setSeconds(0, 0);\n }\n return new Date(sunrise.getTime() + offset * 60 * 1000);\n }\n\n /**\n * Returns sunset + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunset (default false)\n */\n sunsetOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();\n if (isNaN(sunset.getTime())) {\n return sunset;\n }\n if (roundMinute) {\n // For Havdalah only, round up to next minute if needed\n if (offset > 0 && sunset.getSeconds() >= 30) {\n offset++;\n }\n sunset.setSeconds(0, 0);\n }\n return new Date(sunset.getTime() + offset * 60 * 1000);\n }\n /**\n * Returns the Hebrew date relative to the specified location and Gregorian date,\n * taking into consideration whether the time is before or after sunset.\n *\n * For example, if the given date and is `2024-09-22T10:35` (before sunset), and\n * sunset for the specified location is **19:04**, then this function would\n * return a Hebrew date of `19th of Elul, 5784`.\n * If the given date is the same Gregorian day after sunset\n * (for example `2024-09-22T20:07`), this function would return a\n * Hebrew date of `20th of Elul, 5784`.\n * @example\n * import {GeoLocation, Zmanim, HDate} from '@hebcal/core';\n * const latitude = 48.85341;\n * const longitude = 2.3488;\n * const timezone = 'Europe/Paris';\n * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);\n * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);\n * console.log(before.toString()); // '19 Elul 5784'\n * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);\n * console.log(after.toString()); // '20 Elul 5784'\n */\n static makeSunsetAwareHDate(\n gloc: GeoLocation,\n date: Date,\n useElevation: boolean\n ): HDate {\n const zmanim = new Zmanim(gloc, date, useElevation);\n const sunset = zmanim.sunset();\n let hd = new HDate(date);\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n return hd;\n }\n if (date.getTime() >= sunsetMillis) {\n hd = hd.next();\n }\n return hd;\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\n\nconst SUN = 0;\nconst TUE = 2;\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst IYYAR = months.IYYAR;\n\n/**\n * Yom HaShoah first observed in 1951.\n * When the actual date of Yom Hashoah falls on a Friday, the\n * state of Israel observes Yom Hashoah on the preceding\n * Thursday. When it falls on a Sunday, Yom Hashoah is observed\n * on the following Monday.\n * http://www.ushmm.org/remembrance/dor/calendar/\n * @private\n * @param year\n */\nexport function dateYomHaShoah(year: number): HDate | null {\n if (year < 5711) {\n return null;\n }\n let nisan27dt = new HDate(27, NISAN, year);\n if (nisan27dt.getDay() === FRI) {\n nisan27dt = new HDate(26, NISAN, year);\n } else if (nisan27dt.getDay() === SUN) {\n nisan27dt = new HDate(28, NISAN, year);\n }\n return nisan27dt;\n}\n\n/**\n * Yom HaAtzma'ut only celebrated after 1948\n * @private\n * @param year\n */\nexport function dateYomHaZikaron(year: number): HDate | null {\n if (year < 5708) {\n return null;\n }\n let day;\n const pesach = new HDate(15, NISAN, year);\n const pdow = pesach.getDay();\n if (pdow === SUN) {\n day = 2;\n } else if (pdow === SAT) {\n day = 3;\n } else if (year < 5764) {\n day = 4;\n } else if (pdow === TUE) {\n day = 5;\n } else {\n day = 4;\n }\n return new HDate(day, IYYAR, year);\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n }\n if (!longC && shortK) {\n return INCOMPLETE;\n }\n return REGULAR;\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Vayera']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '6 Cheshvan 5784'\n * sedra.find(1)?.toString(); // '6 Cheshvan 5784', by 0-based index\n * // Matot and Masei are doubled in 5784, so the pair has a date...\n * sedra.find('Matot-Masei')?.toString(); // '28 Tamuz 5784'\n * sedra.find(['Matot', 'Masei'])?.toString(); // '28 Tamuz 5784'\n * // ...but neither half is read on its own that year:\n * sedra.find('Matot'); // null\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei).\n * Note that this index is 0-based, unlike {@link SedraResult.num} which\n * is 1-based.\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n }\n if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n }\n if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n }\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * // Matot and Masei are doubled in 5784, so each half resolves to the\n * // date of the combined reading:\n * const sedra = new Sedra(5784, false);\n * sedra.findContaining('Matot')?.toString(); // '28 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5784'\n * @example\n * import {Sedra} from '@hebcal/core';\n * // They are read separately in 5795, so each half has its own date, and\n * // asking for the doubled name returns the date of the first half:\n * const sedra = new Sedra(5795, false);\n * sedra.findContaining('Matot')?.toString(); // '21 Tamuz 5795'\n * sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5795'\n * sedra.findContaining('Matot-Masei')?.toString(); // '21 Tamuz 5795'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A Friday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(12, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '13 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Monday 8 Cheshvan — begins the upcoming Shabbat's parsha\n * sedra.lookupWeekday(new HDate(8, months.CHESHVAN, 5784))?.parsha; // ['Lech-Lecha']\n * // Tuesday is neither Monday nor Thursday\n * sedra.lookupWeekday(new HDate(9, months.CHESHVAN, 5784)); // undefined\n * // Thursday 17 Nisan — the upcoming Shabbat is Chol ha-Moed Pesach,\n * // so the next regular parsha is returned instead\n * sedra.lookupWeekday(new HDate(17, months.NISAN, 5784))?.parsha; // ['Achrei Mot']\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\n/**\n * An entry in the array returned by {@link Sedra.getSedraArray}: either a\n * `number` identifying a parsha (or, when negative, a doubled parsha) or a\n * `string` naming the holiday that displaces the weekly reading.\n */\nexport type NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n","import {months} from '@hebcal/hdate';\nimport {flags} from './event.js';\n\nconst Nisan = months.NISAN;\nconst Iyyar = months.IYYAR;\nconst Sivan = months.SIVAN;\nconst Tamuz = months.TAMUZ;\nconst Av = months.AV;\nconst Elul = months.ELUL;\nconst Tishrei = months.TISHREI;\nconst Cheshvan = months.CHESHVAN;\nconst Kislev = months.KISLEV;\nconst Shvat = months.SHVAT;\nconst Adar2 = months.ADAR_II;\n\nconst CHAG = flags.CHAG;\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES;\nconst YOM_TOV_ENDS = flags.YOM_TOV_ENDS;\nconst CHUL_ONLY = flags.CHUL_ONLY;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\nconst CHOL_HAMOED = flags.CHOL_HAMOED;\n\nconst emojiPesach = '🫓';\nconst emojiSukkot = '🌿🍋';\n\nconst ROSH_HASHANA_II = 'Rosh Hashana II';\nconst EREV_YOM_KIPPUR = 'Erev Yom Kippur';\nconst YOM_KIPPUR = 'Yom Kippur';\nconst EREV_SUKKOT = 'Erev Sukkot';\nconst SUKKOT_I = 'Sukkot I';\nconst SUKKOT_II = 'Sukkot II';\nconst SUKKOT_III_CHM = \"Sukkot III (CH''M)\";\nconst SUKKOT_IV_CHM = \"Sukkot IV (CH''M)\";\nconst SUKKOT_V_CHM = \"Sukkot V (CH''M)\";\nconst SUKKOT_VI_CHM = \"Sukkot VI (CH''M)\";\nconst SHMINI_ATZERET = 'Shmini Atzeret';\nconst SIMCHAT_TORAH = 'Simchat Torah';\nconst SUKKOT_II_CHM = \"Sukkot II (CH''M)\";\nconst SUKKOT_VII_HOSHANA_RABA = 'Sukkot VII (Hoshana Raba)';\nconst CHANUKAH_1_CANDLE = 'Chanukah: 1 Candle';\nconst TU_BISHVAT = 'Tu BiShvat';\nconst EREV_PURIM = 'Erev Purim';\nconst PURIM = 'Purim';\nconst SHUSHAN_PURIM = 'Shushan Purim';\nconst EREV_PESACH = 'Erev Pesach';\nconst PESACH_I = 'Pesach I';\nconst PESACH_II = 'Pesach II';\nconst PESACH_II_CHM = \"Pesach II (CH''M)\";\nconst PESACH_III_CHM = \"Pesach III (CH''M)\";\nconst PESACH_IV_CHM = \"Pesach IV (CH''M)\";\nconst PESACH_V_CHM = \"Pesach V (CH''M)\";\nconst PESACH_VI_CHM = \"Pesach VI (CH''M)\";\nconst PESACH_VII = 'Pesach VII';\nconst PESACH_VIII = 'Pesach VIII';\nconst PESACH_SHENI = 'Pesach Sheni';\nconst LAG_BAOMER = 'Lag BaOmer';\nconst EREV_SHAVUOT = 'Erev Shavuot';\nconst SHAVUOT = 'Shavuot';\nconst SHAVUOT_I = 'Shavuot I';\nconst SHAVUOT_II = 'Shavuot II';\nconst TU_BAV = \"Tu B'Av\";\nconst ROSH_HASHANA_LABEHEMOT = 'Rosh Hashana LaBehemot';\nconst EREV_ROSH_HASHANA = 'Erev Rosh Hashana';\nconst YOM_YERUSHALAYIM = 'Yom Yerushalayim';\nconst BEN_GURION_DAY = 'Ben-Gurion Day';\nconst FAMILY_DAY = 'Family Day';\nconst YITZHAK_RABIN_MEMORIAL_DAY = 'Yitzhak Rabin Memorial Day';\nconst HERZL_DAY = 'Herzl Day';\nconst JABOTINSKY_DAY = 'Jabotinsky Day';\nconst SIGD = 'Sigd';\nconst YOM_HAALIYAH = 'Yom HaAliyah';\nconst YOM_HAALIYAH_SCHOOL_OBSERVANCE = 'Yom HaAliyah School Observance';\nconst HEBREW_LANGUAGE_DAY = 'Hebrew Language Day';\nconst CANDLE_LIGHTING = 'Candle lighting';\nconst HAVDALAH = 'Havdalah';\nconst FAST_BEGINS = 'Fast begins';\nconst FAST_ENDS = 'Fast ends';\nconst BIUR_CHAMETZ = 'Biur Chametz';\nconst SOF_ZMAN_ACHILAT_CHAMETZ = 'Finish eating chametz';\nconst YIZKOR = 'Yizkor';\n\n/**\n * Transliterated names of holidays, used by `Event.getDesc()`\n */\nexport const holidayDesc = {\n /** Asara B'Tevet */\n ASARA_BTEVET: \"Asara B'Tevet\",\n /** Birkat Hachamah */\n BIRKAT_HACHAMAH: 'Birkat Hachamah',\n /** Chag HaBanot */\n CHAG_HABANOT: 'Chag HaBanot',\n /** Chanukah: 8th Day */\n CHANUKAH_8TH_DAY: 'Chanukah: 8th Day',\n /** Erev Tish'a B'Av */\n EREV_TISHA_BAV: \"Erev Tish'a B'Av\",\n /** Leil Selichot */\n LEIL_SELICHOT: 'Leil Selichot',\n /** Purim Katan */\n PURIM_KATAN: 'Purim Katan',\n /** Purim Meshulash */\n PURIM_MESHULASH: 'Purim Meshulash',\n /** Shabbat Chazon */\n SHABBAT_CHAZON: 'Shabbat Chazon',\n /** Shabbat HaChodesh */\n SHABBAT_HACHODESH: 'Shabbat HaChodesh',\n /** Shabbat HaGadol */\n SHABBAT_HAGADOL: 'Shabbat HaGadol',\n /** Shabbat Nachamu */\n SHABBAT_NACHAMU: 'Shabbat Nachamu',\n /** Shabbat Parah */\n SHABBAT_PARAH: 'Shabbat Parah',\n /** Shabbat Shekalim */\n SHABBAT_SHEKALIM: 'Shabbat Shekalim',\n /** Shabbat Shirah */\n SHABBAT_SHIRAH: 'Shabbat Shirah',\n /** Shabbat Shuva */\n SHABBAT_SHUVA: 'Shabbat Shuva',\n /** Shabbat Zachor */\n SHABBAT_ZACHOR: 'Shabbat Zachor',\n /** Shushan Purim Katan */\n SHUSHAN_PURIM_KATAN: 'Shushan Purim Katan',\n /** Ta'anit Bechorot */\n TAANIT_BECHOROT: \"Ta'anit Bechorot\",\n /** Ta'anit BeHaB */\n TAANIT_BEHAB: \"Ta'anit BeHaB\",\n /** Ta'anit Esther */\n TAANIT_ESTHER: \"Ta'anit Esther\",\n /** Tish'a B'Av */\n TISHA_BAV: \"Tish'a B'Av\",\n /** Tzom Gedaliah */\n TZOM_GEDALIAH: 'Tzom Gedaliah',\n /** Tzom Tammuz */\n TZOM_TAMMUZ: 'Tzom Tammuz',\n /** Yom HaAtzma'ut */\n YOM_HAATZMA_UT: \"Yom HaAtzma'ut\",\n /** Yom HaShoah */\n YOM_HASHOAH: 'Yom HaShoah',\n /** Yom HaZikaron */\n YOM_HAZIKARON: 'Yom HaZikaron',\n\n /** Ben-Gurion Day */\n BEN_GURION_DAY,\n /** Chanukah: 1 Candle */\n CHANUKAH_1_CANDLE,\n /** Erev Pesach */\n EREV_PESACH,\n /** Erev Purim */\n EREV_PURIM,\n /** Erev Rosh Hashana */\n EREV_ROSH_HASHANA,\n /** Erev Shavuot */\n EREV_SHAVUOT,\n /** Erev Sukkot */\n EREV_SUKKOT,\n /** Erev Yom Kippur */\n EREV_YOM_KIPPUR,\n /** Family Day */\n FAMILY_DAY,\n /** Hebrew Language Day */\n HEBREW_LANGUAGE_DAY,\n /** Herzl Day */\n HERZL_DAY,\n /** Jabotinsky Day */\n JABOTINSKY_DAY,\n /** Lag BaOmer */\n LAG_BAOMER,\n /** Pesach I */\n PESACH_I,\n /** Pesach II */\n PESACH_II,\n /** Pesach III (CH''M) */\n PESACH_III_CHM,\n /** Pesach II (CH''M) */\n PESACH_II_CHM,\n /** Pesach IV (CH''M) */\n PESACH_IV_CHM,\n /** Pesach Sheni */\n PESACH_SHENI,\n /** Pesach VII */\n PESACH_VII,\n /** Pesach VIII */\n PESACH_VIII,\n /** Pesach VI (CH''M) */\n PESACH_VI_CHM,\n /** Pesach V (CH''M) */\n PESACH_V_CHM,\n /** Purim */\n PURIM,\n /** Rosh Hashana II */\n ROSH_HASHANA_II,\n /** Rosh Hashana LaBehemot */\n ROSH_HASHANA_LABEHEMOT,\n /** Shavuot */\n SHAVUOT,\n /** Shavuot I */\n SHAVUOT_I,\n /** Shavuot II */\n SHAVUOT_II,\n /** Shmini Atzeret */\n SHMINI_ATZERET,\n /** Shushan Purim */\n SHUSHAN_PURIM,\n /** Sigd */\n SIGD,\n /** Simchat Torah */\n SIMCHAT_TORAH,\n /** Sukkot I */\n SUKKOT_I,\n /** Sukkot II */\n SUKKOT_II,\n /** Sukkot III (CH''M) */\n SUKKOT_III_CHM,\n /** Sukkot II (CH''M) */\n SUKKOT_II_CHM,\n /** Sukkot IV (CH''M) */\n SUKKOT_IV_CHM,\n /** Sukkot VII (Hoshana Raba) */\n SUKKOT_VII_HOSHANA_RABA,\n /** Sukkot VI (CH''M) */\n SUKKOT_VI_CHM,\n /** Sukkot V (CH''M) */\n SUKKOT_V_CHM,\n /** Tu B\\'Av */\n TU_BAV,\n /** Tu BiShvat */\n TU_BISHVAT,\n /** Yitzhak Rabin Memorial Day */\n YITZHAK_RABIN_MEMORIAL_DAY,\n /** Yom HaAliyah */\n YOM_HAALIYAH,\n /** Yom HaAliyah School Observance */\n YOM_HAALIYAH_SCHOOL_OBSERVANCE,\n /** Yom Kippur */\n YOM_KIPPUR,\n /** Yom Yerushalayim */\n YOM_YERUSHALAYIM,\n /** Candle lighting */\n CANDLE_LIGHTING,\n /** Havdalah */\n HAVDALAH,\n /** Fast begins */\n FAST_BEGINS,\n /** Fast ends */\n FAST_ENDS,\n /** Biur Chametz */\n BIUR_CHAMETZ,\n /** Finish eating chametz */\n SOF_ZMAN_ACHILAT_CHAMETZ,\n /** Yizkor */\n YIZKOR,\n} as const;\n\nexport interface Holiday {\n mm: number; // This should be an enum `Month` eventually\n dd: number;\n desc: string;\n flags: number;\n chmDay?: number;\n emoji?: string;\n}\n\nexport const staticHolidays: Holiday[] = [\n {\n mm: Tishrei,\n dd: 2,\n desc: ROSH_HASHANA_II,\n flags: CHAG | YOM_TOV_ENDS,\n emoji: '🍏🍯',\n },\n {mm: Tishrei, dd: 9, desc: EREV_YOM_KIPPUR, flags: EREV | LIGHT_CANDLES},\n {\n mm: Tishrei,\n dd: 10,\n desc: YOM_KIPPUR,\n flags: CHAG | MAJOR_FAST | YOM_TOV_ENDS,\n },\n\n {\n mm: Tishrei,\n dd: 14,\n desc: EREV_SUKKOT,\n flags: CHUL_ONLY | EREV | LIGHT_CANDLES,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 15,\n desc: SUKKOT_I,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 16,\n desc: SUKKOT_II,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 17,\n desc: SUKKOT_III_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 18,\n desc: SUKKOT_IV_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 19,\n desc: SUKKOT_V_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 20,\n desc: SUKKOT_VI_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 4,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 22,\n desc: SHMINI_ATZERET,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n },\n {\n mm: Tishrei,\n dd: 23,\n desc: SIMCHAT_TORAH,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n },\n\n {\n mm: Tishrei,\n dd: 14,\n desc: EREV_SUKKOT,\n flags: IL_ONLY | EREV | LIGHT_CANDLES,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 15,\n desc: SUKKOT_I,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 16,\n desc: SUKKOT_II_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 17,\n desc: SUKKOT_III_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 18,\n desc: SUKKOT_IV_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 19,\n desc: SUKKOT_V_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 4,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 20,\n desc: SUKKOT_VI_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 5,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 22,\n desc: SHMINI_ATZERET,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n },\n\n {\n mm: Tishrei,\n dd: 21,\n desc: SUKKOT_VII_HOSHANA_RABA,\n flags: LIGHT_CANDLES | CHOL_HAMOED,\n chmDay: -1,\n emoji: emojiSukkot,\n },\n {mm: Shvat, dd: 15, desc: TU_BISHVAT, flags: MINOR_HOLIDAY, emoji: '🌳'},\n {\n mm: Adar2,\n dd: 13,\n desc: EREV_PURIM,\n flags: EREV | MINOR_HOLIDAY,\n emoji: '🎭️📜',\n },\n {mm: Adar2, dd: 14, desc: PURIM, flags: MINOR_HOLIDAY, emoji: '🎭️📜'},\n {\n mm: Adar2,\n dd: 15,\n desc: SHUSHAN_PURIM,\n flags: MINOR_HOLIDAY,\n emoji: '🎭️📜',\n },\n // Pesach Israel\n {\n mm: Nisan,\n dd: 14,\n desc: EREV_PESACH,\n flags: IL_ONLY | EREV | LIGHT_CANDLES,\n emoji: '🫓🍷',\n },\n {\n mm: Nisan,\n dd: 15,\n desc: PESACH_I,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 16,\n desc: PESACH_II_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 17,\n desc: PESACH_III_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 18,\n desc: PESACH_IV_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 19,\n desc: PESACH_V_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 4,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 20,\n desc: PESACH_VI_CHM,\n flags: IL_ONLY | CHOL_HAMOED | LIGHT_CANDLES,\n chmDay: 5,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 21,\n desc: PESACH_VII,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n // Pesach chutz l'aretz\n {\n mm: Nisan,\n dd: 14,\n desc: EREV_PESACH,\n flags: CHUL_ONLY | EREV | LIGHT_CANDLES,\n emoji: '🫓🍷',\n },\n {\n mm: Nisan,\n dd: 15,\n desc: PESACH_I,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: '🫓🍷',\n },\n {\n mm: Nisan,\n dd: 16,\n desc: PESACH_II,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 17,\n desc: PESACH_III_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 18,\n desc: PESACH_IV_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 19,\n desc: PESACH_V_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 20,\n desc: PESACH_VI_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED | LIGHT_CANDLES,\n chmDay: 4,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 21,\n desc: PESACH_VII,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 22,\n desc: PESACH_VIII,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n\n {mm: Iyyar, dd: 14, desc: PESACH_SHENI, flags: MINOR_HOLIDAY},\n {mm: Iyyar, dd: 18, desc: LAG_BAOMER, flags: MINOR_HOLIDAY, emoji: '🔥'},\n {\n mm: Sivan,\n dd: 5,\n desc: EREV_SHAVUOT,\n flags: EREV | LIGHT_CANDLES,\n emoji: '⛰️🌸',\n },\n {\n mm: Sivan,\n dd: 6,\n desc: SHAVUOT,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: '⛰️🌸',\n },\n {\n mm: Sivan,\n dd: 6,\n desc: SHAVUOT_I,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: '⛰️🌸',\n },\n {\n mm: Sivan,\n dd: 7,\n desc: SHAVUOT_II,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: '⛰️🌸',\n },\n {mm: Av, dd: 15, desc: TU_BAV, flags: MINOR_HOLIDAY, emoji: '❤️'},\n {\n mm: Elul,\n dd: 1,\n desc: ROSH_HASHANA_LABEHEMOT,\n flags: MINOR_HOLIDAY,\n emoji: '🐑',\n },\n {\n mm: Elul,\n dd: 29,\n desc: EREV_ROSH_HASHANA,\n flags: EREV | LIGHT_CANDLES,\n emoji: '🍏🍯',\n },\n] as const;\n\nexport interface ModernHoliday {\n firstYear: number;\n mm: number; // This should be an enum `Month` eventually\n dd: number;\n desc: string;\n chul?: boolean;\n suppressEmoji?: boolean;\n satPostponeToSun?: boolean;\n friPostponeToSun?: boolean;\n friSatMovetoThu?: boolean;\n}\n\nexport const staticModernHolidays: ModernHoliday[] = [\n {firstYear: 5727, mm: Iyyar, dd: 28, desc: YOM_YERUSHALAYIM, chul: true},\n {\n firstYear: 5737,\n mm: Kislev,\n dd: 6,\n desc: BEN_GURION_DAY,\n satPostponeToSun: true,\n friPostponeToSun: true,\n },\n {firstYear: 5750, mm: Shvat, dd: 30, desc: FAMILY_DAY},\n {\n firstYear: 5758,\n mm: Cheshvan,\n dd: 12,\n desc: YITZHAK_RABIN_MEMORIAL_DAY,\n friSatMovetoThu: true,\n },\n {firstYear: 5764, mm: Iyyar, dd: 10, desc: HERZL_DAY, satPostponeToSun: true},\n {\n firstYear: 5765,\n mm: Tamuz,\n dd: 29,\n desc: JABOTINSKY_DAY,\n satPostponeToSun: true,\n },\n {\n firstYear: 5769,\n mm: Cheshvan,\n dd: 29,\n desc: SIGD,\n chul: true,\n suppressEmoji: true,\n friSatMovetoThu: true,\n },\n {firstYear: 5777, mm: Nisan, dd: 10, desc: YOM_HAALIYAH, chul: true},\n {firstYear: 5777, mm: Cheshvan, dd: 7, desc: YOM_HAALIYAH_SCHOOL_OBSERVANCE},\n // https://www.gov.il/he/departments/policies/2012_des5234\n {\n firstYear: 5773,\n mm: months.TEVET,\n dd: 21,\n desc: HEBREW_LANGUAGE_DAY,\n friSatMovetoThu: true,\n },\n] as const;\n","import {HDate, Locale, isoDateString} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport {smartApostrophe, urlFriendly} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.\n *\n * Most holiday-related events emitted by {@link calendar}\n * are instances of `HolidayEvent` or one of its subclasses\n * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},\n * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).\n *\n * Adds two notable behaviors over the base {@link Event}:\n *\n * - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,\n * `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `\"Erev Pesach\"` →\n * `\"Pesach\"`).\n * - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`\n * link for the holiday.\n */\nexport class HolidayEvent extends Event {\n /** During Sukkot or Pesach */\n readonly cholHaMoedDay?: number;\n /**\n * `true` if the fast day was postponed a day to avoid Shabbat.\n * - Tish'a B'Av postponed from the 9th to the 10th\n * - Tzom Tammuz postponed from the 17th to the 18th\n */\n readonly observed?: boolean;\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n super(date, desc, mask, attrs);\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n\n /**\n * Returns a simplified (untranslated) name for this holiday, stripping\n * qualifiers so that related events group under one name.\n *\n * Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,\n * Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,\n * `: 8th Day`, and a leading `\"Erev \"`.\n * @example\n * // 'Erev Pesach' => 'Pesach'\n * // 'Sukkot III (CH''M)' => 'Sukkot'\n * // 'Chanukah: 5 Candles' => 'Chanukah'\n * // 'Rosh Hashana 5784' => 'Rosh Hashana'\n */\n basename(): string {\n return this.getDesc()\n .replace(/ \\d{4}$/, '')\n .replace(/ \\(CH''M\\)$/, '')\n .replace(/ \\(observed\\)$/, '')\n .replace(/ \\(Hoshana Raba\\)$/, '')\n .replace(/ [IV]+$/, '')\n .replace(/: \\d Candles?$/, '')\n .replace(/: 8th Day$/, '')\n .replace(/^Erev /, '');\n }\n\n /**\n * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on\n * this holiday. Israel-only holidays get an `?i=on` query parameter.\n * Returns `undefined` for years outside `[100, 2999]`.\n */\n url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const url =\n 'https://www.hebcal.com/holidays/' +\n urlFriendly(this.basename()) +\n '-' +\n this.urlDateSuffix();\n return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;\n }\n\n /**\n * The date portion of {@link url}. For most holidays this is just the\n * Gregorian year; subclasses override it when a year alone is ambiguous.\n */\n urlDateSuffix(): string {\n const year = this.greg().getFullYear();\n return String(year);\n }\n\n getEmoji(): string {\n if (this.emoji) {\n return this.emoji;\n }\n if (this.getFlags() & flags.SPECIAL_SHABBAT) {\n return '🕍';\n }\n return '✡️';\n }\n\n getCategories(): string[] {\n if (this.cholHaMoedDay) {\n return ['holiday', 'major', 'cholhamoed'];\n }\n const cats = super.getCategories();\n if (cats[0] !== 'unknown') {\n return cats;\n }\n // Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.\n const desc = this.getDesc();\n switch (desc) {\n case hdesc.LAG_BAOMER:\n case hdesc.LEIL_SELICHOT:\n case hdesc.PESACH_SHENI:\n case hdesc.EREV_PURIM:\n case hdesc.PURIM_KATAN:\n case hdesc.SHUSHAN_PURIM:\n case hdesc.TU_BAV:\n case hdesc.TU_BISHVAT:\n case hdesc.ROSH_HASHANA_LABEHEMOT:\n return ['holiday', 'minor'];\n }\n\n return ['holiday', 'major'];\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const str = super.render(locale);\n return smartApostrophe(str);\n }\n /**\n * Returns a brief (translated) description of this event.\n * For most events, this is the same as render(). For some events, it procudes\n * a shorter text (e.g. without a time or added description).\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n const str = super.renderBrief(locale);\n return smartApostrophe(str);\n }\n}\n\n/**\n * Because Asara B'Tevet often occurs twice in the same Gregorian year,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class AsaraBTevetEvent extends HolidayEvent {\n /** Full `YYYYMMDD` date, since the Gregorian year alone is ambiguous here */\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n}\n\nconst chanukahEmoji = '🕎';\nconst KEYCAP_DIGITS = [\n '0️⃣',\n '1️⃣',\n '2️⃣',\n '3️⃣',\n '4️⃣',\n '5️⃣',\n '6️⃣',\n '7️⃣',\n '8️⃣',\n '9️⃣',\n] as const;\n\n/**\n * Because Chanukah sometimes starts in December and ends in January,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class ChanukahEvent extends HolidayEvent {\n readonly chanukahDay?: number;\n /**\n * @param chanukahDay should be undefined for 1st night of Chanukah\n */\n constructor(date: HDate, desc: string, mask: number, chanukahDay?: number) {\n super(date, desc, mask);\n this.chanukahDay = chanukahDay;\n this.emoji = chanukahEmoji;\n if (chanukahDay !== 8) {\n const candles = chanukahDay ? chanukahDay + 1 : 1;\n this.emoji += KEYCAP_DIGITS[candles];\n }\n }\n urlDateSuffix(): string {\n const dt = this.greg();\n let year = dt.getFullYear();\n if (dt.getMonth() === 0) {\n year--;\n }\n return String(year);\n }\n}\n\n/** Represents Rosh Hashana, the Jewish New Year */\nexport class RoshHashanaEvent extends HolidayEvent {\n private readonly hyear: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date event occurs\n * @param hyear Hebrew year\n * @param mask optional holiday flags\n */\n constructor(date: HDate, hyear: number, mask: number) {\n super(date, `Rosh Hashana ${hyear}`, mask);\n this.hyear = hyear;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;\n }\n\n getEmoji(): string {\n return '🍏🍯';\n }\n}\n\nconst roshChodeshStr = 'Rosh Chodesh';\n\n/** Represents Rosh Chodesh, the beginning of a new month */\nexport class RoshChodeshEvent extends HolidayEvent {\n /**\n * Constructs Rosh Chodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n */\n constructor(date: HDate, monthName: string) {\n super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName = this.getDesc().substring(roshChodeshStr.length + 1);\n const monthName0 = Locale.gettext(monthName, locale);\n const monthName1 = smartApostrophe(monthName0);\n return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;\n }\n\n basename(): string {\n return this.getDesc();\n }\n\n getEmoji(): string {\n return this.emoji || '🌒';\n }\n}\n","import {HDate, Locale} from '@hebcal/hdate';\nimport {flags} from './event.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst ykk = 'Yom Kippur Katan';\n\n/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */\nexport class YomKippurKatanEvent extends HolidayEvent {\n private readonly nextMonthName: string;\n /**\n * Normally created by {@link calendar} (via\n * `options.yomKippurKatan`) rather than directly.\n * @param date Hebrew date event occurs\n * @param nextMonthName name of the upcoming month\n */\n constructor(date: HDate, nextMonthName: string) {\n super(\n date,\n `${ykk} ${nextMonthName}`,\n flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN\n );\n this.nextMonthName = nextMonthName;\n this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.nextMonthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(ykk, locale) + ' ' + monthName;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(ykk, locale);\n }\n\n url(): string | undefined {\n return undefined;\n }\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport {flags} from './event.js';\nimport {dateYomHaShoah, dateYomHaZikaron} from './modern.js';\nimport {getSedra} from './sedra.js';\nimport {\n staticHolidays,\n staticModernHolidays,\n holidayDesc as hdesc,\n} from './staticHolidays.js';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent.js';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent.js';\n\n/**\n * Returns an array of holiday Events that occur on the given date, or\n * `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned (e.g. on the second day of a Yom Tov, both `\"Pesach II\"` for\n * Diaspora and any Israel-only events). Pass `true` or `false` to filter\n * to a single schedule.\n * @example\n * import {getHolidaysOnDate, HDate, months} from '@hebcal/core';\n * const events = getHolidaysOnDate(new HDate(15, months.NISAN, 5784), false);\n * events?.map(ev => ev.getDesc()); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\nexport function getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n): HolidayEvent[] | undefined {\n const hd = HDate.isHDate(date) ? (date as HDate) : new HDate(date);\n const hdStr = hd.toString();\n const yearMap = getHolidaysForYear_(hd.getFullYear());\n const events = yearMap.get(hdStr);\n // if il isn't a boolean return both diaspora + IL for day\n if (il === undefined || events === undefined) {\n return events;\n }\n const filtered = events.filter(ev => ev.observedIn(il));\n return filtered;\n}\n\nconst CHAG = flags.CHAG;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;\nconst BEHAB = flags.BEHAB;\nconst MINOR_FAST = flags.MINOR_FAST;\nconst SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;\nconst MODERN_HOLIDAY = flags.MODERN_HOLIDAY;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\n\nconst SUN = 0;\nconst TUE = 2;\nconst THU = 4;\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst IYYAR = months.IYYAR;\nconst TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\nconst CHESHVAN = months.CHESHVAN;\nconst KISLEV = months.KISLEV;\nconst TEVET = months.TEVET;\nconst ADAR_I = months.ADAR_I;\nconst ADAR_II = months.ADAR_II;\n\nconst emojiIsraelFlag = {emoji: '🇮🇱'} as const;\n/**\n * Holidays for an entire Hebrew year, indexed by `HDate.toString()`\n * (e.g. `'15 Nisan 5784'`). Returned by\n * {@link HebrewCalendar.getHolidaysForYear}. Because a single date can carry\n * more than one event, each key maps to an array. Entries are *not* filtered\n * by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.\n */\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\nconst yearCache = new QuickLRU<number, HolidayYearMap>({maxSize: 120});\n\n/**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @private\n */\nexport function getHolidaysForYear_(year: number): HolidayYearMap {\n if (typeof year !== 'number') {\n throw new TypeError(`bad Hebrew year: ${year}`);\n }\n if (year < 1 || year > 32658) {\n throw new RangeError(`Hebrew year ${year} out of range 1-32658`);\n }\n const cached = yearCache.get(year);\n if (cached) {\n return cached;\n }\n\n const RH = new HDate(1, TISHREI, year);\n const pesach = new HDate(15, NISAN, year);\n\n const map = new Map<string, HolidayEvent[]>();\n function add(...events: HolidayEvent[]) {\n for (const ev of events) {\n const key = ev.date.toString();\n const arr = map.get(key);\n if (typeof arr === 'object') {\n if (arr[0].getFlags() & EREV) {\n arr.unshift(ev);\n } else {\n arr.push(ev);\n }\n } else {\n map.set(key, [ev]);\n }\n }\n }\n\n for (const h of staticHolidays) {\n const hd = new HDate(h.dd, h.mm, year);\n const attrs: any = {};\n if (h.emoji) attrs.emoji = h.emoji;\n if (h.chmDay) attrs.cholHaMoedDay = h.chmDay;\n const ev = new HolidayEvent(hd, h.desc, h.flags, attrs);\n add(ev);\n }\n\n // standard holidays that don't shift based on year\n add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));\n\n // Variable date holidays\n const tzomGedaliahDay: number = RH.getDay() === THU ? 4 : 3;\n add(\n new HolidayEvent(\n new HDate(tzomGedaliahDay, TISHREI, year),\n hdesc.TZOM_GEDALIAH,\n MINOR_FAST\n )\n );\n // first SAT after RH\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())),\n hdesc.SHABBAT_SHUVA,\n SPECIAL_SHABBAT\n )\n );\n const rchTevet = HDate.shortKislev(year)\n ? new HDate(1, TEVET, year)\n : new HDate(30, KISLEV, year);\n add(new HolidayEvent(rchTevet, hdesc.CHAG_HABANOT, MINOR_HOLIDAY));\n add(\n new ChanukahEvent(\n new HDate(24, KISLEV, year),\n hdesc.CHANUKAH_1_CANDLE,\n EREV | MINOR_HOLIDAY | CHANUKAH_CANDLES,\n undefined\n )\n );\n // yes, we know Kislev 30-32 are wrong\n // HDate() corrects the month automatically\n for (let candles = 2; candles <= 8; candles++) {\n const hd = new HDate(23 + candles, KISLEV, year);\n add(\n new ChanukahEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n candles - 1\n )\n );\n }\n add(\n new ChanukahEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n 8\n )\n );\n add(\n new AsaraBTevetEvent(new HDate(10, TEVET, year), hdesc.ASARA_BTEVET, MINOR_FAST)\n );\n const pesachAbs = pesach.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)),\n hdesc.SHABBAT_SHEKALIM,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)),\n hdesc.SHABBAT_ZACHOR,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)),\n hdesc.TAANIT_ESTHER,\n MINOR_FAST\n )\n );\n const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);\n add(\n new HolidayEvent(\n new HDate(haChodeshAbs - 7),\n hdesc.SHABBAT_PARAH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs),\n hdesc.SHABBAT_HACHODESH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)),\n hdesc.SHABBAT_HAGADOL,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n // if the fast falls on Shabbat, move to Thursday\n pesach.prev().getDay() === SAT\n ? pesach.onOrBefore(THU)\n : new HDate(14, NISAN, year),\n hdesc.TAANIT_BECHOROT,\n MINOR_FAST\n )\n );\n add(\n new HolidayEvent(\n new HDate(\n HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)\n ),\n hdesc.LEIL_SELICHOT,\n MINOR_HOLIDAY,\n {emoji: '🕍'}\n )\n );\n\n if (pesach.getDay() === SUN) {\n add(\n new HolidayEvent(\n new HDate(16, ADAR_II, year),\n hdesc.PURIM_MESHULASH,\n MINOR_HOLIDAY\n )\n );\n }\n\n if (HDate.isLeapYear(year)) {\n add(\n new HolidayEvent(\n new HDate(14, ADAR_I, year),\n hdesc.PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n add(\n new HolidayEvent(\n new HDate(15, ADAR_I, year),\n hdesc.SHUSHAN_PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n }\n\n const nisan27dt = dateYomHaShoah(year);\n if (nisan27dt) {\n add(new HolidayEvent(nisan27dt, hdesc.YOM_HASHOAH, MODERN_HOLIDAY));\n }\n\n const yomHaZikaronDt = dateYomHaZikaron(year);\n if (yomHaZikaronDt) {\n add(\n new HolidayEvent(\n yomHaZikaronDt,\n hdesc.YOM_HAZIKARON,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n ),\n new HolidayEvent(\n yomHaZikaronDt.next(),\n hdesc.YOM_HAATZMA_UT,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n )\n );\n }\n\n for (const h of staticModernHolidays) {\n if (year >= h.firstYear) {\n let hd = new HDate(h.dd, h.mm, year);\n const dow = hd.getDay();\n if (h.friSatMovetoThu && (dow === FRI || dow === SAT)) {\n hd = hd.onOrBefore(THU);\n } else if (h.friPostponeToSun && dow === FRI) {\n hd = new HDate(hd.abs() + 2);\n } else if (h.satPostponeToSun && dow === SAT) {\n hd = hd.next();\n }\n const mask = h.chul ? MODERN_HOLIDAY : MODERN_HOLIDAY | IL_ONLY;\n const ev = new HolidayEvent(hd, h.desc, mask);\n if (!h.suppressEmoji) {\n ev.emoji = '🇮🇱';\n }\n add(ev);\n }\n }\n\n let tamuz17 = new HDate(17, TAMUZ, year);\n let tamuz17attrs;\n if (tamuz17.getDay() === SAT) {\n tamuz17 = new HDate(18, TAMUZ, year);\n tamuz17attrs = {observed: true};\n }\n add(new HolidayEvent(tamuz17, hdesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs));\n\n let av9dt = new HDate(9, AV, year);\n let av9title = hdesc.TISHA_BAV;\n let av9attrs;\n if (av9dt.getDay() === SAT) {\n av9dt = av9dt.next();\n av9attrs = {observed: true};\n av9title += ' (observed)';\n }\n const av9abs = av9dt.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs)),\n hdesc.SHABBAT_CHAZON,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n av9dt.prev(),\n hdesc.EREV_TISHA_BAV,\n EREV | MAJOR_FAST,\n av9attrs\n ),\n new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)),\n hdesc.SHABBAT_NACHAMU,\n SPECIAL_SHABBAT\n )\n );\n\n const monthsInYear = HDate.monthsInYear(year);\n for (let month = 1; month <= monthsInYear; month++) {\n const monthName = HDate.getMonthName(month, year);\n if (\n (month === NISAN\n ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)\n : HDate.daysInMonth(month - 1, year)) === 30\n ) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));\n } else if (month !== TISHREI) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n }\n }\n\n // Begin: Yom Kippur Katan\n // start at Iyyar because one may not fast during Nisan\n for (let month = months.IYYAR; month <= monthsInYear; month++) {\n const nextMonth = month + 1;\n // Yom Kippur Katan is not observed on the day before Rosh Hashanah.\n // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.\n // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.\n if (\n nextMonth === TISHREI ||\n nextMonth === months.CHESHVAN ||\n nextMonth === TEVET\n ) {\n continue;\n }\n let ykk = new HDate(29, month, year);\n const dow = ykk.getDay();\n if (dow === FRI || dow === SAT) {\n ykk = ykk.onOrBefore(THU);\n }\n\n const nextMonthName = HDate.getMonthName(nextMonth, year);\n const ev = new YomKippurKatanEvent(ykk, nextMonthName);\n add(ev);\n }\n\n for (const month of [CHESHVAN, IYYAR]) {\n const roshChodesh = new HDate(1, month, year);\n let shabbos = new HDate(HDate.dayOnOrBefore(SAT, roshChodesh.abs() + 6));\n if (shabbos.abs() === roshChodesh.abs()) {\n shabbos = new HDate(shabbos.abs() + 7);\n }\n const fastDays = [2, 5, 9].map(offset => new HDate(shabbos.abs() + offset));\n if (month === IYYAR && fastDays[2].getDate() === 14) {\n fastDays[2] = new HDate(17, IYYAR, year);\n }\n for (const hd of fastDays) {\n add(new HolidayEvent(hd, hdesc.TAANIT_BEHAB, MINOR_FAST | BEHAB));\n }\n }\n\n const sedra = getSedra(year, false);\n const beshalachHd = sedra.find(15) as HDate;\n add(new HolidayEvent(beshalachHd, hdesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT));\n\n // Birkat Hachamah appears only once every 28 years\n const birkatHaChama = getBirkatHaChama(year);\n if (birkatHaChama) {\n const hd = new HDate(birkatHaChama);\n add(new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'}));\n }\n\n yearCache.set(year, map);\n return map;\n}\n\n/**\n * Birkat Hachamah appears only once every 28 years.\n * Although almost always in Nisan, it can occur in Adar II.\n * - 27 Adar II 5461 (Gregorian year 1701)\n * - 29 Adar II 5993 (Gregorian year 2233)\n *\n * Due to drift, this will eventually slip into Iyyar\n * - 2 Iyyar 7141 (Gregorian year 3381)\n * @private\n */\nfunction getBirkatHaChama(year: number): number {\n const leap = HDate.isLeapYear(year);\n const startMonth = leap ? ADAR_II : NISAN;\n const startDay = leap ? 20 : 1;\n const baseRd = HDate.hebrew2abs(year, startMonth, startDay);\n for (let day = 0; day <= 40; day++) {\n const abs = baseRd + day;\n const elapsed = abs + 1373429;\n if (elapsed % 10227 === 172) {\n return abs;\n }\n }\n return 0;\n}\n\n/**\n * Returns a sorted array of holidays observed during the given Hebrew year,\n * filtered by Israel vs. Diaspora schedule.\n *\n * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * Use {@link calendar} for those.\n * @example\n * import {getHolidaysForYearArray} from '@hebcal/core';\n * const events = getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n const yearMap = getHolidaysForYear_(year);\n const startAbs = HDate.hebrew2abs(year, TISHREI, 1);\n const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;\n let events: HolidayEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt++) {\n const hd = new HDate(absDt);\n const holidays = yearMap.get(hd.toString());\n if (holidays) {\n const filtered: HolidayEvent[] = holidays.filter(ev => ev.observedIn(il));\n events = events.concat(filtered);\n }\n }\n return events;\n}\n","import {HDate, getPseudoISO} from '@hebcal/hdate';\nimport {Zmanim} from './zmanim.js';\nimport {Location} from './location.js';\nimport {getHolidaysOnDate} from './holidays.js';\nimport {Event, flags} from './event.js';\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES | flags.LIGHT_CANDLES_TZEIS;\n\nfunction isTomorrowShabbosOrYomTov(dow: number, events: Event[]): boolean {\n if (dow === 5) {\n return true;\n }\n const erev = events.find(ev => ev.getFlags() & LIGHT_CANDLES);\n if (erev) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if it is _Shabbos_ or if it is a _Yom Tov_ day that has a\n * _melacha_ (work) prohibition.\n *\n * @param dow day of week, where `6` is Shabbos\n * @param events events occurring on the day\n * @return `true` if the day is a _Yom Tov_ that is _assur bemlacha_, or _Shabbos_\n */\nfunction isTodayAssurBemelacha(dow: number, events: Event[]): boolean {\n if (dow === 6) {\n return true;\n }\n const chag = events.find(ev => ev.getFlags() & flags.CHAG);\n if (chag) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns `true` if the given moment (date + time) falls within a period\n * when *melacha* (work) is prohibited — i.e. Shabbat or a Yom Tov.\n *\n * The Shabbat/Yom Tov window is taken to begin at sunset (shkiah) on the\n * preceding day (Erev Shabbat / Erev Yom Tov / Yom Tov sheni) and to end\n * at *tzais* (nightfall) on the day itself. *Tzais* is calculated using a\n * solar depression of 8.5° for simplicity; consult a halachic authority\n * for more stringent opinions.\n *\n * `useElevation` controls whether the location's elevation is taken into\n * account when computing sunset (it has no effect on the degree-based\n * tzais calculation). The Israel/Diaspora schedule comes from\n * `location.getIsrael()`.\n *\n * Throws if sunset cannot be calculated for the given location\n * (e.g. polar regions).\n * @example\n * import {isAssurBemlacha, Location} from '@hebcal/core';\n * const loc = Location.lookup('Jerusalem')!;\n * // Friday after sunset:\n * isAssurBemlacha(new Date('2024-04-26T18:00:00Z'), loc, false); // true\n * @param currentTime the moment to test (with hour/minute)\n * @param location geographic location (also supplies Israel/Diaspora flag and tzid)\n * @param useElevation include elevation when computing sunset\n * @return `true` if *melacha* is prohibited, `false` if it is not\n */\nexport function isAssurBemlacha(\n currentTime: Date,\n location: Location,\n useElevation: boolean\n): boolean {\n // Determine the calendar date in the location's timezone, not the\n // timezone of the computer running this code. Otherwise the day-of-week,\n // Hebrew date and sunset/tzais times would depend on the machine's\n // local timezone, giving different (incorrect) results near midnight.\n const isoDate = getPseudoISO(location.getTzid(), currentTime);\n const year = parseInt(isoDate.substring(0, 4), 10);\n const month = parseInt(isoDate.substring(5, 7), 10);\n const day = parseInt(isoDate.substring(8, 10), 10);\n const hd = new HDate(new Date(year, month - 1, day));\n const zmanim = new Zmanim(location, hd, useElevation);\n // erev shabbos, YT or YT sheni and after shkiah\n const sunset = zmanim.sunset();\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n throw new Error('Could not determine sunset');\n }\n // erev shabbos, YT or YT sheni and after shkiah\n const il = location.getIsrael();\n const currentMillis = currentTime.getTime();\n const dow = hd.getDay();\n const events = getHolidaysOnDate(hd, il) || [];\n if (isTomorrowShabbosOrYomTov(dow, events) && currentMillis >= sunsetMillis) {\n return true;\n }\n // is shabbos or YT and it is before tzais\n if (isTodayAssurBemelacha(dow, events)) {\n const tzais = zmanim.tzeit();\n const tzaisMillis = tzais.getTime();\n return currentMillis <= tzaisMillis;\n }\n return false;\n}\n","import {HDate, months} from '@hebcal/hdate';\n\nconst NISAN = months.NISAN;\nconst SIVAN = months.SIVAN;\nconst TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst SAT = 6;\n\nfunction getHDate(date: HDate | Date | number): HDate {\n return HDate.isHDate(date) ? (date as HDate) : new HDate(date);\n}\n\nfunction isSefiratHaOmer(hd: HDate): boolean {\n const hyear = hd.getFullYear();\n const beginOmer = new HDate(16, NISAN, hyear).abs();\n const endOmer = new HDate(5, SIVAN, hyear).abs();\n const abs = hd.abs();\n return abs >= beginOmer && abs <= endOmer;\n}\n\nfunction isBeinHaMetzarim(hd: HDate): boolean {\n const hyear = hd.getFullYear();\n const begin = new HDate(17, TAMUZ, hyear).abs();\n const tishaBav = new HDate(9, AV, hyear);\n const end =\n tishaBav.getDay() === SAT ? new HDate(10, AV, hyear).abs() : tishaBav.abs();\n const abs = hd.abs();\n return abs >= begin && abs <= end;\n}\n\n/**\n * Returns `true` if the given date falls within a public period of communal\n * mourning — specifically:\n *\n * - **Sefirat HaOmer**: 16 Nisan through 5 Sivan (the 49 days of the Omer).\n * - **Bein HaMetzarim** (\"between the straits\"): 17 Tammuz through 9 Av\n * (10 Av when 9 Av is postponed because it falls on Shabbat).\n *\n * This is a broad helper — it does not attempt to model minhag-specific\n * exceptions within those periods (e.g. Lag BaOmer, Rosh Chodesh Iyar,\n * the distinction between Sephardic and Ashkenazic customs on which\n * portion of the Omer is observed as mourning, etc.).\n * @example\n * import {isAveilut, HDate, months} from '@hebcal/core';\n * isAveilut(new HDate(20, months.NISAN, 5784)); // true (Omer)\n * isAveilut(new HDate(25, months.TAMUZ, 5784)); // true (Three Weeks)\n * isAveilut(new HDate(15, months.AV, 5784)); // false\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @return `true` if the date is during a mourning period\n */\nexport function isAveilut(date: HDate | Date | number): boolean {\n const hd = getHDate(date);\n return isSefiratHaOmer(hd) || isBeinHaMetzarim(hd);\n}\n","import {HDate} from '@hebcal/hdate';\nimport {flags} from './event.js';\nimport {getHolidaysOnDate} from './holidays.js';\n\nconst FAST_DAY = flags.MAJOR_FAST | flags.MINOR_FAST;\nconst EREV = flags.EREV;\n\n/**\n * Returns `true` if the given date is observed as a major or minor fast day.\n *\n * Major fasts: Yom Kippur, Tish'a B'Av.\n * Minor fasts: Tzom Gedaliah, Asara B'Tevet, Ta'anit Esther, Ta'anit\n * Bechorot, Tzom Tammuz (plus BeHaB fasts when enabled).\n *\n * Erev Tish'a B'Av — even though the fast begins at sunset — is *not*\n * counted here: only the actual fast day itself returns `true`.\n * Postponed fasts return `true` on the actual observed date (e.g. when\n * 17 Tammuz falls on Shabbat and is observed on the 18th).\n * @example\n * import {isFastDay, HDate, months} from '@hebcal/core';\n * isFastDay(new HDate(10, months.TISHREI, 5784)); // true (Yom Kippur)\n * isFastDay(new HDate(11, months.TISHREI, 5784)); // false\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param il optional; use the Israeli schedule for holidays (default Diaspora)\n * @return `true` if the date is a major or minor fast day\n */\nexport function isFastDay(date: HDate | Date | number, il?: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const fastDay = events.find(ev => {\n const mask = ev.getFlags();\n return mask & FAST_DAY && !(mask & EREV);\n });\n return Boolean(fastDay);\n}\n","import {HDate, Locale} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event} from './event.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {Zmanim} from './zmanim.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst HAVDALAH = hdesc.HAVDALAH;\nconst CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;\n\n/**\n * Base class for events that have an associated wall-clock time and\n * geographic location — for example, candle lighting, havdalah, and\n * fast begin/end times.\n *\n * Stores both a `Date` (`eventTime`) and pre-formatted 24-hour\n * (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a\n * \"linked\" event such as the holiday whose candle-lighting time this\n * represents.\n */\nexport class TimedEvent extends Event {\n /** The exact moment of the event, rounded to the nearest minute */\n readonly eventTime: Date;\n /** Geographic location used to compute `eventTime` */\n readonly location: Location;\n /** 24-hour formatted time string in the location's timezone (e.g. `\"19:42\"`) */\n readonly eventTimeStr: string;\n /** Locale-aware formatted time string (e.g. `\"7:42pm\"` in US locale) */\n readonly fmtTime: string;\n /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */\n readonly linkedEvent?: Event;\n /**\n * Optional length of the event in minutes. Not computed or validated by\n * this class; it's a plain count of minutes for downstream renderers\n * (e.g. `@hebcal/icalendar`) to add to the event's start wall-clock time\n * when producing a non-zero-duration `DTEND`. Undefined means no\n * duration was specified.\n */\n duration?: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date the event occurs\n * @param desc Description (not translated)\n * @param mask optional holiday flags\n * @param eventTime the exact moment of the event\n * @param location geographic location used to format the time\n * @param linkedEvent optional event this time is associated with\n * @param options optional; `locale` and `hour12` affect {@link fmtTime}\n */\n constructor(\n date: HDate,\n desc: string,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, desc, mask);\n this.eventTime = Zmanim.roundTime(eventTime);\n this.location = location;\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n const opts = {...options, location};\n this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);\n if (linkedEvent !== undefined) {\n this.linkedEvent = linkedEvent;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Candle lighting\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale);\n }\n\n getCategories(): string[] {\n const desc = this.getDesc();\n switch (desc) {\n // LIGHT_CANDLES or LIGHT_CANDLES_TZEIS\n case CANDLE_LIGHTING:\n return ['candles'];\n // YOM_TOV_ENDS\n case HAVDALAH:\n return ['havdalah'];\n // flags.MINOR_FAST or flags.MAJOR_FAST\n case hdesc.FAST_BEGINS:\n case hdesc.FAST_ENDS:\n return ['zmanim', 'fast'];\n case hdesc.SOF_ZMAN_ACHILAT_CHAMETZ:\n return ['zmanim', 'achilasChametz'];\n case hdesc.BIUR_CHAMETZ:\n return ['zmanim', 'biurChametz'];\n }\n /* NOTREACHED */\n return ['unknown'];\n }\n}\n\n/**\n * Candle-lighting event for the eve of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default candle lighting\n * occurs 18 minutes before sundown in the Diaspora and 20 minutes before\n * sundown in Israel (40 minutes in Jerusalem; 30 minutes in Haifa and\n * Zikhron Ya'akov), configurable via `options.candleLightingMins`.\n */\nexport class CandleLightingEvent extends TimedEvent {\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);\n }\n\n getEmoji(): string {\n return '🕯️';\n }\n}\n\n/**\n * Havdalah event marking the end of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default Havdalah is\n * calculated by *tzeit hakochavim* (8.5° solar depression); pass\n * `options.havdalahMins` to use a fixed minute offset instead, or\n * `options.havdalahDeg` to use a different degree.\n */\nexport class HavdalahEvent extends TimedEvent {\n private readonly havdalahMins?: number;\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n havdalahMins?: number,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, HAVDALAH, mask, eventTime, location, linkedEvent, options);\n if (havdalahMins) {\n this.havdalahMins = havdalahMins;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.renderBrief(locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Havdalah\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n let str = Locale.gettext(this.getDesc(), locale);\n if (this.havdalahMins) {\n const min = Locale.gettext('min', locale);\n str += ` (${this.havdalahMins} ${min})`;\n }\n return str;\n }\n\n getEmoji(): string {\n return '✨';\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event, flags} from './event.js';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent.js';\nimport {Zmanim} from './zmanim.js';\nimport {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\n\n/**\n * @private\n */\nexport function makeCandleEvent(\n ev: Event | undefined,\n hd: HDate,\n options: CalOptions,\n isFriday: boolean,\n isSaturday: boolean\n): TimedEvent | undefined {\n let havdalahTitle = false;\n let useHavdalahOffset = isSaturday;\n let mask = ev ? ev.getFlags() : LIGHT_CANDLES;\n if (ev !== undefined) {\n // if linked event && dow == FRI, use Candle lighting time & title\n if (!isFriday) {\n if (mask & (LIGHT_CANDLES_TZEIS | flags.CHANUKAH_CANDLES)) {\n useHavdalahOffset = true;\n } else if (mask & flags.YOM_TOV_ENDS) {\n havdalahTitle = true;\n useHavdalahOffset = true;\n }\n }\n } else if (isSaturday) {\n havdalahTitle = true;\n mask = LIGHT_CANDLES_TZEIS;\n }\n // if Havdalah offset is 0 or undefined, we'll use tzeit time\n const offset = useHavdalahOffset\n ? Number(options.havdalahMins)\n : Number(options.candleLightingMins);\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd, useElevation);\n const time =\n useHavdalahOffset && !offset\n ? zmanim.tzeit(options.havdalahDeg)\n : zmanim.sunsetOffset(offset, true);\n if (isNaN(time.getTime())) {\n return undefined; // no sunset\n }\n if (havdalahTitle) {\n return new HavdalahEvent(\n hd,\n mask,\n time,\n location,\n options.havdalahMins,\n ev,\n options\n );\n } else {\n mask |= LIGHT_CANDLES;\n return new CandleLightingEvent(hd, mask, time, location, ev, options);\n }\n}\n\nconst FAST_BEGINS = hdesc.FAST_BEGINS;\nconst FAST_ENDS = hdesc.FAST_ENDS;\n\n/**\n * Tzeit HaKochavim as calculated by Rabbi Yechiel Michel Tucazinsky,\n * 6.45° below geometric zenith. Default end time for Tish'a B'Av.\n * @private\n */\nconst TZEIT_TUCAZINSKY = 6.45;\n\n/**\n * Observation of 3 medium-sized stars, 7.0833333° below geometric zenith.\n * Default end time for minor fasts in the Diaspora.\n * @private\n */\nconst TZEIT_3MEDIUM_STARS = 7.0833333;\n\n/**\n * Minutes after sunset that minor fasts (including Yom Kippur Katan) end in\n * Israel by default, following Rabbi Deblitzky's practice.\n * @see {https://www.yeshiva.org.il/calendar/timeprinciples}\n * @private\n */\nconst MINOR_FAST_END_MINUTES_IL = 15;\n\n/**\n * Computes the \"Fast ends\" time for a fast day.\n *\n * Tish'a B'Av always ends at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky),\n * regardless of `options`.\n *\n * For minor fasts: when `options.fastEndMins` is a nonzero number, the fast\n * ends that many minutes after sunset; otherwise, when `options.fastEndDeg` is\n * a nonzero number, the fast ends at tzeit for that solar depression angle.\n * When neither is specified, the default depends on `options.il`:\n * - In Israel, minor fasts end 15 minutes after sunset (Rabbi Deblitzky's practice).\n * - Elsewhere, minor fasts end at tzeit 7.083° (3 medium-sized stars).\n * @private\n */\nfunction makeFastEndTime(\n zmanim: Zmanim,\n isTishaBav: boolean,\n options: CalOptions\n): Date {\n if (isTishaBav) {\n return zmanim.tzeit(TZEIT_TUCAZINSKY);\n }\n const fastEndMins = options.fastEndMins;\n if (typeof fastEndMins === 'number' && fastEndMins !== 0) {\n return zmanim.sunsetOffset(Math.abs(fastEndMins), true);\n }\n const fastEndDeg = options.fastEndDeg;\n if (typeof fastEndDeg === 'number' && fastEndDeg !== 0) {\n return zmanim.tzeit(Math.abs(fastEndDeg));\n }\n if (options.il) {\n return zmanim.sunsetOffset(MINOR_FAST_END_MINUTES_IL, true);\n }\n return zmanim.tzeit(TZEIT_3MEDIUM_STARS);\n}\n\n/**\n * A fast day holiday with attached start and end time events.\n *\n * Wraps an underlying fast-day {@link HolidayEvent} and (when computable\n * for the given location) exposes a \"Fast begins\" and \"Fast ends\"\n * {@link TimedEvent}. Generated by {@link calendar} when\n * `options.candlelighting` is `true` and `options.location` is provided.\n *\n * - Minor fasts (including Yom Kippur Katan) begin at *Alot HaShachar*\n * (16.1° below horizon in the morning). By default they end at tzeit\n * 7.083° (3 medium-sized stars) in the Diaspora, or 15 minutes after\n * sunset in Israel (Rabbi Deblitzky's practice). This can be overridden\n * via `options.fastEndDeg` or `options.fastEndMins`.\n * - Tish'a B'Av begins at sunset on the previous day and always ends at tzeit\n * 6.45° below horizon (Rabbi Yechiel Michel Tucazinsky), regardless of\n * `options.fastEndDeg` / `options.fastEndMins`.\n * - When a minor fast falls on a Friday, the end time is suppressed\n * (Shabbat begins before nightfall).\n */\nexport class FastDayEvent extends HolidayEvent {\n /** original event */\n readonly linkedEvent: HolidayEvent;\n /** this will be a \"Fast begins\" event */\n readonly startEvent?: TimedEvent;\n /** this will be a \"Fast ends\" event */\n readonly endEvent?: TimedEvent;\n constructor(\n linkedEvent: HolidayEvent,\n startEvent?: TimedEvent,\n endEvent?: TimedEvent\n ) {\n super(linkedEvent.getDate(), linkedEvent.getDesc(), linkedEvent.getFlags());\n this.linkedEvent = linkedEvent;\n this.startEvent = startEvent;\n this.endEvent = endEvent;\n }\n render(locale?: string): string {\n return this.linkedEvent.render(locale);\n }\n renderBrief(locale?: string): string {\n return this.linkedEvent.renderBrief(locale);\n }\n urlDateSuffix(): string {\n return this.linkedEvent.urlDateSuffix();\n }\n url(): string | undefined {\n return this.linkedEvent.url();\n }\n getEmoji(): string {\n return this.linkedEvent.getEmoji();\n }\n getCategories(): string[] {\n return this.linkedEvent.getCategories();\n }\n}\n\n/**\n * Makes a pair of events representing fast start and end times\n * @private\n */\nexport function makeFastStartEnd(\n ev: HolidayEvent,\n options: CalOptions\n): FastDayEvent {\n const desc = ev.getDesc();\n if (desc === 'Yom Kippur') {\n throw new RangeError('YK does not require this function');\n }\n const hd = ev.getDate();\n const dt = hd.greg();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, dt, useElevation);\n let startEvent;\n let endEvent;\n if (desc === \"Erev Tish'a B'Av\") {\n const sunset = zmanim.sunset();\n if (!isNaN(sunset.getTime())) {\n startEvent = makeTimedEvent(ev, sunset, FAST_BEGINS, options);\n }\n } else if (desc.startsWith(\"Tish'a B'Av\")) {\n const fastEnd = makeFastEndTime(zmanim, true, options);\n if (!isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n } else {\n const dawn = zmanim.alotHaShachar();\n if (!isNaN(dawn.getTime())) {\n startEvent = makeTimedEvent(ev, dawn, FAST_BEGINS, options);\n }\n if (\n dt.getDay() !== 5 &&\n !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)\n ) {\n const fastEnd = makeFastEndTime(zmanim, false, options);\n if (!isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n }\n }\n const ev2 = new FastDayEvent(ev, startEvent, endEvent);\n // copy properties such as memo or emoji\n Object.assign(ev2, ev);\n return ev2;\n}\n\n/**\n * @private\n */\nfunction makeTimedEvent(\n ev: Event,\n time: Date,\n desc: string,\n options: CalOptions\n): TimedEvent {\n const location = options.location as Location;\n const hd = ev.getDate();\n return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);\n}\n\n/**\n * A Chanukah candle-lighting event that carries a specific time of day.\n *\n * Generated by {@link calendar} when both `options.candlelighting`\n * and `options.location` are set. On weekdays the time is Bein HaShmashos\n * (13.5 minutes before the sun is 7.083° below the horizon in the evening);\n * on Friday it is regular candle-lighting time, and on Saturday night it is\n * regular Havdalah time.\n */\nexport class TimedChanukahEvent extends ChanukahEvent {\n /** Time at which candles are lit, rounded to the nearest minute */\n eventTime: Date;\n /** {@link eventTime} formatted for the event's location, e.g. `'4:31pm'` */\n eventTimeStr: string;\n /** Location used to calculate {@link eventTime} */\n readonly location: Location;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param ev the untimed Chanukah event this is derived from\n * @param eventTime time at which candles are lit\n * @param location location used to format the time\n */\n constructor(ev: ChanukahEvent, eventTime: Date, location: Location) {\n super(ev.getDate(), ev.getDesc(), ev.getFlags(), ev.chanukahDay);\n this.eventTime = Zmanim.roundTime(eventTime);\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n this.location = location;\n this.emoji = ev.emoji;\n }\n}\n\n/**\n * Makes a candle-lighting event for Chankah (not on Friday/Saturday).\n * At one point this used civil dusk (6 degrees below horizon).\n * Another source suggests 4.6667 degrees below horizon.\n * @private\n */\nexport function makeWeekdayChanukahCandleLighting(\n ev: ChanukahEvent,\n options: CalOptions\n): TimedChanukahEvent | null {\n const hd = ev.getDate();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd.greg(), useElevation);\n const candleLightingTime = zmanim.beinHaShmashos();\n if (isNaN(candleLightingTime.getTime())) {\n return null;\n }\n return new TimedChanukahEvent(ev, candleLightingTime, location);\n}\n","export default\n{\n \"ps67lines\": [\n \"אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה\",\n \"לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ\",\n \"יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם\",\n \"יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה\",\n \"יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם\",\n \"אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ\",\n \"יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ\"\n ],\n \"lamnatzeachLetters\": \"ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה\",\n \"anaBekoach\": [\n \"אָנָּא\",\n \"בְּכֹחַ\",\n \"גְּדֻלַּת\",\n \"יְמִינְךָ\",\n \"תַּתִּיר\",\n \"צְרוּרָה\",\n \"אב״ג ית״ץ\",\n\n \"קַבֵּל\",\n \"רִנַּת\",\n \"עַמְּךָ\",\n \"שַׂגְּבֵנוּ\",\n \"טַהֲרֵנוּ\",\n \"נוֹרָא\",\n \"קר״ע שט״ן\",\n\n \"נָא\",\n \"גִבּוֹר\",\n \"דּוֹרְשֵׁי\",\n \"יִחוּדְךָ\",\n \"כְּבָבַת\",\n \"שָׁמְרֵם\",\n \"נג״ד יכ״ש\",\n\n \"בָּרְכֵם\",\n \"טַהֲרֵם\",\n \"רַחֲמֵי\",\n \"צִדְקָתְךָ\",\n \"תָּמִיד\",\n \"גָּמְלֵם\",\n \"בט״ר צת״ג\",\n\n \"חֲסִין\",\n \"קָדוֹשׁ\",\n \"בְּרֹב\",\n \"טוּבְךָ\",\n \"נַהֵל\",\n \"עֲדָתֶךָ\",\n \"חק״ב תנ״ע\",\n\n \"יָחִיד\",\n \"גֵּאֶה\",\n \"לְעַמְּךָ\",\n \"פְּנֵה\",\n \"זוֹכְרֵי\",\n \"קְדֻשָּׁתֶךָ\",\n \"יג״ל פז״ק\",\n\n \"שַׁוְעָתֵנוּ\",\n \"קַבֵּל\",\n \"וּשְׁמַע\",\n \"צַעֲקָתֵנוּ\",\n \"יוֹדֵעַ\",\n \"תַּעֲלוּמוֹת\",\n \"שק״ו צי״ת\"\n ]\n}\n","import {HDate, Locale, gematriya} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\nimport sefira from './sefira.json.js';\n\n/**\n * Language for counting the Omer can be English or Hebrew.\n * Lang for the Sefira can be English, Hebrew, or Hebrew in Sephardic transliteration.\n */\nexport type OmerLang = 'en' | 'he' | 'translit';\n\nconst sefirot = {\n en: {\n infix: 'within ',\n infix26: 'within ',\n words: [\n '',\n 'Lovingkindness',\n 'Might',\n 'Beauty',\n 'Eternity',\n 'Splendor',\n 'Foundation',\n 'Majesty',\n ],\n pfxWords: null,\n },\n he: {\n infix: null,\n infix26: null,\n words: [\n '',\n 'חֶֽסֶד',\n 'גְּבוּרָה',\n 'תִּפְאֶֽרֶת',\n 'נֶּֽצַח',\n 'הוֹד',\n 'יְּסוֹד',\n 'מַלְכוּת',\n ],\n pfxWords: [\n '',\n 'שֶׁבְּחֶֽסֶד',\n 'שֶׁבִּגְבוּרָה',\n 'שֶׁבְּתִפְאֶֽרֶת',\n 'שֶׁבְּנֶֽצַח',\n 'שֶׁבְּהוֹד',\n 'שֶׁבִּיְסוֹד',\n 'שֶׁבְּמַלְכוּת',\n ],\n },\n translit: {\n infix: \"sheb'\",\n infix26: 'shebi',\n words: [\n '',\n 'Chesed',\n 'Gevurah',\n 'Tiferet',\n 'Netzach',\n 'Hod',\n 'Yesod',\n 'Malkhut',\n ],\n pfxWords: null,\n },\n} as const;\n\nfunction checkDay(omerDay: number): void {\n if (omerDay < 1 || omerDay > 49) {\n throw new RangeError(`Invalid Omer day ${omerDay}`);\n }\n}\n\nfunction getWeeks(omerDay: number): number[] {\n const weekNum: number = Math.floor((omerDay - 1) / 7) + 1;\n const daysWithinWeeks: number = omerDay % 7 || 7;\n return [weekNum, daysWithinWeeks];\n}\n\nfunction omerTodayIsEn(omerDay: number): string {\n const [weekNumber, daysWithinWeeks]: number[] = getWeeks(omerDay);\n\n const totalDaysStr: string = omerDay === 1 ? 'day' : 'days';\n let str = `Today is ${omerDay} ${totalDaysStr}`;\n\n if (weekNumber > 1 || omerDay === 7) {\n const day7: boolean = daysWithinWeeks === 7;\n const numWeeks: number = day7 ? weekNumber : weekNumber - 1;\n const weeksStr: string = numWeeks === 1 ? 'week' : 'weeks';\n str += `, which are ${numWeeks} ${weeksStr}`;\n if (!day7) {\n const daysStr: string = daysWithinWeeks === 1 ? 'day' : 'days';\n str += ` and ${daysWithinWeeks} ${daysStr}`;\n }\n }\n return str + ' of the Omer';\n}\n\n// adapted from pip hdate package (GPL)\n// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py\n\nconst tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];\nconst ones = [\n '',\n 'אֶחָד',\n 'שְׁנַיִם',\n 'שְׁלוֹשָׁה',\n 'אַרְבָּעָה',\n 'חֲמִשָּׁה',\n 'שִׁשָּׁה',\n 'שִׁבְעָה',\n 'שְׁמוֹנָה',\n 'תִּשְׁעָה',\n];\n\nconst shnei = 'שְׁנֵי';\nconst yamim = 'יָמִים';\nconst shneiYamim = shnei + ' ' + yamim;\nconst shavuot = 'שָׁבוּעוֹת';\nconst yom = 'יוֹם';\nconst yomEchad = yom + ' ' + ones[1];\nconst asar = 'עָשָׂר';\n\nfunction omerTodayIsHe(omerDay: number): string {\n const ten: number = Math.floor(omerDay / 10);\n const one: number = omerDay % 10;\n let str = 'הַיּוֹם ';\n if (omerDay === 11) {\n str += 'אַחַד ' + asar;\n } else if (omerDay === 12) {\n str += 'שְׁנֵים ' + asar;\n } else if (12 < omerDay && omerDay < 20) {\n str += ones[one] + ' ' + asar;\n } else if (omerDay > 9) {\n str += ones[one];\n if (one) {\n str += ' ';\n str += ten === 3 ? 'וּ' : 'וְ';\n }\n }\n if (omerDay > 2) {\n if (omerDay > 20 || omerDay === 10 || omerDay === 20) {\n str += tens[ten];\n }\n if (omerDay < 11) {\n str += ones[one] + ' ' + yamim + ' ';\n } else {\n str += ' ' + yom + ' ';\n }\n } else if (omerDay === 1) {\n str += yomEchad + ' ';\n } else {\n // omer == 2\n str += shneiYamim + ' ';\n }\n if (omerDay > 6) {\n str = str.trim(); // remove trailing space before comma\n str += ', שֶׁהֵם ';\n const weeks: number = Math.floor(omerDay / 7);\n const days: number = omerDay % 7;\n if (weeks > 2) {\n str += ones[weeks] + ' ' + shavuot + ' ';\n } else if (weeks === 1) {\n str += 'שָׁבֽוּעַ' + ' ' + ones[1] + ' ';\n } else {\n // weeks == 2\n str += shnei + ' ' + shavuot + ' ';\n }\n if (days) {\n if (days === 2 || days === 3) {\n str += 'וּ';\n } else if (days === 5) {\n str += 'וַ';\n } else {\n str += 'וְ';\n }\n if (days > 2) {\n str += ones[days] + ' ' + yamim + ' ';\n } else if (days === 1) {\n str += yomEchad + ' ';\n } else {\n // days == 2\n str += shneiYamim + ' ';\n }\n }\n }\n str += 'לָעֽוֹמֶר';\n return str.normalize();\n}\n\nconst anaBekoach = sefira.anaBekoach;\n\nconst ps67lines = sefira.ps67lines;\n\nconst lamnatzeach = ps67lines.flatMap((x: string) => x.split(/[ ־]/));\n\nconst lamnatzeachLetters = sefira.lamnatzeachLetters.split('');\n\n/**\n * Represents one of the 49 days of counting the Omer between Pesach and\n * Shavuot (16 Nisan through 5 Sivan).\n *\n * Each day has an associated Sefirah pairing (e.g. *Chesed shebiGevurah*),\n * a word from Psalm 67 (Lamnatzeach), a letter from verse 5 of Psalm 67,\n * and a word/acrostic from the Ana BeKoach prayer — all accessible via\n * the methods on this class.\n *\n * @example\n * import {OmerEvent, HDate, months} from '@hebcal/core';\n * const ev = new OmerEvent(new HDate(16, months.NISAN, 5784), 1);\n * ev.render('en'); // '1st day of the Omer'\n * ev.render('he'); // 'א׳ בָּעוֹמֶר'\n * ev.sefira('translit'); // \"Chesed sheb'Chesed\"\n * ev.getTodayIs('en'); // 'Today is 1 day of the Omer'\n */\nexport class OmerEvent extends Event {\n private readonly weekNumber: number;\n private readonly daysWithinWeeks: number;\n readonly omer: number;\n\n /**\n * Constructs an Omer event for a given day (1–49).\n *\n * Throws `RangeError` if `omerDay` is outside 1–49.\n * @param date Hebrew date this Omer day is counted on (the evening of)\n * @param omerDay day of the Omer, 1 through 49\n */\n constructor(date: HDate, omerDay: number) {\n super(date, `Omer ${omerDay}`, flags.OMER_COUNT);\n checkDay(omerDay);\n this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;\n this.daysWithinWeeks = omerDay % 7 || 7;\n this.omer = omerDay;\n }\n\n /**\n * Returns the Sefirah pairing associated with this Omer day —\n * one of the seven lower Sefirot within another, calculated as\n * `day-within-week` of `week-within-cycle`. For example, on day 8\n * (week 2, day 1):\n * * חֶֽסֶד שֶׁבִּגְבוּרָה\n * * Chesed shebiGevurah\n * * Lovingkindness within Might\n * @example\n * import {OmerEvent, HDate, months} from '@hebcal/core';\n * const day8 = new OmerEvent(new HDate(23, months.NISAN, 5784), 8);\n * day8.sefira('en'); // 'Lovingkindness within Might'\n * day8.sefira('he'); // 'חֶֽסֶד שֶׁבִּגְבוּרָה'\n * day8.sefira('translit'); // 'Chesed shebiGevurah'\n * @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)\n * @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`\n */\n sefira(lang: OmerLang = 'en'): string {\n if (lang !== 'he' && lang !== 'translit') {\n lang = 'en';\n }\n const [weekNum, daysWithinWeeks]: number[] = getWeeks(this.omer);\n const config = sefirot[lang as OmerLang];\n const pfxWords = config.pfxWords;\n const words = config.words;\n const week = pfxWords ? pfxWords[weekNum] : words[weekNum];\n const dayWithinWeek = words[daysWithinWeeks];\n const infix = pfxWords\n ? ''\n : weekNum === 2 || weekNum === 6\n ? config.infix26\n : config.infix;\n return (dayWithinWeek + ' ' + infix + week).normalize();\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const isHebrewLocale = Locale.isHebrewLocale(locale);\n const omer = this.omer;\n const nth = isHebrewLocale ? gematriya(omer) : Locale.ordinal(omer, locale);\n return nth + ' ' + Locale.gettext('day of the Omer', locale);\n }\n /**\n * Returns translation of \"Omer day 22\" without ordinal numbers.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return (\n Locale.gettext('Omer', locale) +\n ' ' +\n Locale.gettext('day', locale) +\n ' ' +\n this.omer\n );\n }\n /**\n * Returns an emoji number symbol with a circle, for example `㊲`\n * from the “Enclosed CJK Letters and Months” block of the Unicode standard\n * @returns a single Unicode character from `①` through `㊾`\n */\n getEmoji(): string {\n if (typeof this.emoji === 'string') return this.emoji;\n let codePoint: number;\n const omerDay = this.omer;\n if (omerDay <= 20) {\n codePoint = 9312 + omerDay - 1;\n } else if (omerDay <= 35) {\n // between 21 and 35 inclusive\n codePoint = 12881 + omerDay - 21;\n } else {\n // between 36 and 49 inclusive\n codePoint = 12977 + omerDay - 36;\n }\n return String.fromCodePoint(codePoint);\n }\n\n /**\n * Number of *completed* weeks of the Omer. On day 7 this returns `1`; on\n * day 8 it also returns `1`, because the second week is still in progress.\n * Pair with {@link getDaysWithinWeeks} to render \"N weeks and M days\".\n */\n getWeeks(): number {\n const day7 = this.daysWithinWeeks === 7;\n return day7 ? this.weekNumber : this.weekNumber - 1;\n }\n\n /**\n * Day within the current week, from `1` through `7`.\n */\n getDaysWithinWeeks(): number {\n return this.daysWithinWeeks;\n }\n /**\n * Returns a sentence with that evening's omer count\n * @example\n * import {OmerEvent, HDate, months} from '@hebcal/core';\n * const ev = new OmerEvent(new HDate(25, months.NISAN, 5784), 10);\n * ev.getTodayIs('en');\n * // => 'Today is 10 days, which are 1 week and 3 days of the Omer'\n * ev.getTodayIs('he');\n * // => 'הַיּוֹם עֲשָׂרָה יָמִים, שֶׁהֵם שָׁבֽוּעַ אֶחָד וּשְׁלוֹשָׁה יָמִים לָעֽוֹמֶר'\n * @param locale locale name; Hebrew locales (`he`, `he-x-NoNikud`) produce\n * the Hebrew formula, anything else produces English. Defaults to `en`\n * when empty.\n */\n getTodayIs(locale: string): string {\n locale = (locale || 'en').toLowerCase();\n const isHebrew = Locale.isHebrewLocale(locale);\n const str = isHebrew ? omerTodayIsHe(this.omer) : omerTodayIsEn(this.omer);\n if (locale === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(str);\n }\n return str;\n }\n\n url(): string | undefined {\n const year = this.getDate().getFullYear();\n if (year < 5000 || year > 6759) {\n return undefined;\n }\n return `https://www.hebcal.com/omer/${year}/${this.omer}`;\n }\n\n /**\n * Returns the word from Psalm 67 (לַמְנַצֵּחַ, \"Lamnatzeach\") corresponding\n * to this Omer day. Psalm 67 contains 49 words (excluding its opening verse),\n * one for each day of the Omer. The words are taken from verses 2–8, split on\n * spaces and maqef (־).\n * @returns a Hebrew word from Psalm 67\n * @example\n * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);\n * ev.getLamnatzeachWord(); // 'אֱלֹהִים' (day 1, first word of verse 2)\n * @example\n * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);\n * ev.getLamnatzeachWord(); // 'אָרֶץ' (day 49, last word of verse 8)\n */\n getLamnatzeachWord(): string {\n return lamnatzeach[this.omer - 1];\n }\n\n /**\n * Returns the letter from verse 5 of Psalm 67 corresponding to this Omer day.\n * Verse 5 (יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים…) contains exactly 49 letters,\n * one for each day of the Omer, and is used as a Kabbalistic meditation during\n * the counting.\n * @returns a single Hebrew letter from verse 5 of Psalm 67\n * @example\n * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);\n * ev.getLamnatzeachLetter(); // 'י' (day 1, first letter of verse 5)\n * @example\n * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);\n * ev.getLamnatzeachLetter(); // 'ה' (day 49, last letter of verse 5)\n */\n getLamnatzeachLetter(): string {\n return lamnatzeachLetters[this.omer - 1];\n }\n\n /**\n * Returns the word from the Ana BeKoach prayer (אָנָּא בְּכֹחַ) corresponding\n * to this Omer day. Ana BeKoach is a 42-word Kabbalistic prayer whose initial\n * letters spell out the 42-letter name of God. The prayer has 7 verses of\n * 6 words each; the 7th entry of each group is the abbreviation of the acrostic\n * letters for that verse (e.g. `אב״ג ית״ץ` for verse 1). Together the 49\n * entries (7 verses × 7 entries) align with the 49 days of the Omer, connecting\n * each day to one of the lower seven Sefirot within a Sefirah.\n * @returns a Hebrew word or verse-abbreviation string from Ana BeKoach\n * @example\n * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);\n * ev.getAnaBekoachWord(); // 'אָנָּא' (day 1, first word of verse 1)\n * @example\n * const ev = new OmerEvent(new HDate(22, 'Nisan', 5785), 7);\n * ev.getAnaBekoachWord(); // 'אב״ג ית״ץ' (day 7, acrostic abbreviation for verse 1)\n * @example\n * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);\n * ev.getAnaBekoachWord(); // 'שק״ו צי״ת' (day 49, acrostic abbreviation for verse 7)\n */\n getAnaBekoachWord(): string {\n return anaBekoach[this.omer - 1].normalize();\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern.js';\n\nfunction range(start: number, end: number): readonly number[] {\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/**\n * Is *tachanun* said today?\n */\nexport type TachanunResult = {\n /** Tachanun is said at Shacharit */\n shacharit: boolean;\n /** Tachanun is said at Mincha */\n mincha: boolean;\n /** All congregations say Tachanun on the day */\n allCongs: boolean;\n};\n\nconst NONE: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n} as const;\n\n/**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n */\nexport function tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun0(hdate, il, true);\n}\n\nfunction tachanun0(hdate: HDate, il: boolean, checkNext: boolean): TachanunResult {\n const year = hdate.yy;\n const dates = tachanunYear(year, il);\n const abs = hdate.abs();\n if (dates.none.includes(abs)) {\n return NONE;\n }\n const dow = hdate.getDay();\n const ret: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n };\n if (!dates.some.includes(abs)) {\n ret.allCongs = true;\n }\n if (dow !== 6) {\n ret.shacharit = true;\n }\n const tomorrow = abs + 1;\n if (checkNext && !dates.yesPrev.includes(tomorrow)) {\n const tmp = tachanun0(new HDate(tomorrow), il, false);\n ret.mincha = tmp.shacharit;\n } else {\n ret.mincha = dow !== 5;\n }\n if (ret.allCongs && !ret.mincha && !ret.shacharit) {\n return NONE;\n }\n return ret;\n}\n\ntype TachanunYear = {\n none: number[];\n some: number[];\n yesPrev: number[];\n};\n\nfunction tachanunYear(year: number, il: boolean): TachanunYear {\n const leap = HDate.isLeapYear(year);\n const monthsInYear = HDate.monthsInYear(year);\n let av9dt = new HDate(9, months.AV, year);\n if (av9dt.getDay() === 6) {\n av9dt = av9dt.next();\n }\n let shushPurim = new HDate(15, months.ADAR_II, year);\n if (shushPurim.getDay() === 6) {\n shushPurim = shushPurim.next();\n }\n const none: readonly HDate[] = [\n new HDate(2, months.TISHREI, year), // Rosh Hashana II\n ].concat(\n // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)\n range(1, monthsInYear).map(month => new HDate(1, month, year)),\n // Rosh Chodesh - 30th of months that have one\n range(1, monthsInYear)\n .filter(month => HDate.daysInMonth(month, year) === 30)\n .map(month => new HDate(30, month, year)),\n // entire month of Nisan\n range(1, HDate.daysInMonth(months.NISAN, year)).map(\n mday => new HDate(mday, months.NISAN, year)\n ),\n new HDate(18, months.IYYAR, year), // Lag BaOmer\n // Rosh Chodesh Sivan thru Isru Chag\n range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)),\n av9dt, // Tisha B'Av\n new HDate(15, months.AV, year), // Tu B'Av\n new HDate(29, months.ELUL, year), // Erev Rosh Hashanah\n // Erev Yom Kippur thru Isru Chag\n range(9, 24 - (il ? 1 : 0)).map(mday => new HDate(mday, months.TISHREI, year)),\n // Chanukah\n range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)),\n new HDate(15, months.SHVAT, year), // Tu BiShvat\n new HDate(14, months.ADAR_II, year), // Purim\n shushPurim,\n leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan\n );\n const some: readonly HDate[] = [\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ].concat(\n // Until 14 Sivan\n range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),\n // Until after Rosh Chodesh Cheshvan\n range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),\n // Yom HaAtzma'ut, which changes based on day of week\n year >= 5708 ? (dateYomHaZikaron(year) as HDate).next() : [],\n // Yom Yerushalayim\n year >= 5727 ? new HDate(28, months.IYYAR, year) : []\n );\n const yesPrev: readonly HDate[] = [\n new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah\n new HDate(9, months.TISHREI, year), // Erev Yom Kippur\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ];\n return {\n none: none.map(hd => hd.abs()).sort((a, b) => a - b),\n some: some.map(hd => hd.abs()).sort((a, b) => a - b),\n yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),\n };\n}\n","import {Event, flags} from './event.js';\nimport {HDate, isoDateString} from '@hebcal/hdate';\nimport {renderParshaName} from './parshaName.js';\nimport {urlFriendly} from './string.js';\nimport {SedraResult} from './sedra.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents one of 54 weekly Torah portions, always on a Saturday.\n *\n * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot\n * with holiday readings such as Shabbat Chol ha-Moed, use\n * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from\n * `@hebcal/leyning` when the display title and exact Torah readings are needed.\n */\nexport class ParshaEvent extends Event {\n /** The parsha name(s) and date this event was constructed from */\n readonly p: SedraResult;\n /**\n * Normally created by {@link calendar} (via `options.sedrot`)\n * rather than directly.\n * @param parsha result from {@link Sedra.lookup}\n * @throws {TypeError} if called with anything other than exactly one argument\n * @throws {TypeError} if `parsha` is not a valid {@link SedraResult} — it must\n * have an `HDate` and one or two parsha names\n */\n constructor(parsha: SedraResult) {\n // eslint-disable-next-line prefer-rest-params\n if (arguments.length !== 1) {\n throw new TypeError(\n `ParshaEvent constructor takes a single SedraResult argument; ` +\n `got ${arguments.length} arguments`\n );\n }\n if (\n typeof parsha !== 'object' ||\n parsha === null ||\n !Array.isArray(parsha.parsha) ||\n parsha.parsha.length === 0 ||\n parsha.parsha.length > 2 ||\n !HDate.isHDate(parsha.hdate)\n ) {\n throw new TypeError(\n `Invalid SedraResult argument: ${JSON.stringify(parsha)}`\n );\n }\n const desc = 'Parashat ' + parsha.parsha.join('-');\n super(parsha.hdate, desc, flags.PARSHA_HASHAVUA);\n this.p = parsha;\n }\n /**\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.\n */\n render(locale?: string): string {\n return renderParshaName(this.p.parsha, locale);\n }\n\n basename(): string {\n return this.p.parsha.join('-');\n }\n\n url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const dt = this.urlDateSuffix();\n const url =\n 'https://www.hebcal.com/sedrot/' + urlFriendly(this.basename()) + '-' + dt;\n return this.p.il ? url + '?i=on' : url;\n }\n\n /**\n * The date portion of {@link url}, as `YYYYMMDD` — a parsha name recurs every\n * year, so the full date is needed to identify the reading.\n */\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n\n /** convenience function for compatibility with previous implementation */\n get parsha(): string[] {\n return this.p.parsha;\n }\n}\n","import {Locale} from './locale.js';\nimport {smartApostrophe} from './string.js';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n let name = Locale.gettext(parsha[0], locale);\n if (parsha.length === 2) {\n const hyphen = Locale.isHebrewLocale(locale) ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale);\n }\n name = smartApostrophe(name);\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n","import {greg2abs, isDate, daysInGregMonth, HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\n\nconst TISHREI = months.TISHREI;\n\n/**\n * Gets the R.D. days for a number, Date, or HDate\n * @private\n */\nfunction getAbs(d: Date | HDate | number): number {\n if (typeof d === 'number') return d;\n if (isDate(d)) return greg2abs(d as Date);\n if (HDate.isHDate(d)) return (d as HDate).abs();\n throw new TypeError(`Invalid date type: ${d}`);\n}\n\nfunction getYear(options: CalOptions): number {\n if (options.year !== undefined) {\n return Number(options.year);\n }\n return options.isHebrewYear\n ? new HDate().getFullYear()\n : new Date().getFullYear();\n}\n\nconst MAX_NUM_YEARS = 2000;\n\n/**\n * Parse options object to determine start & end days\n * @private\n */\nexport function getStartAndEnd(options: CalOptions): number[] {\n const hasStart = options.start !== undefined;\n const hasEnd = options.end !== undefined;\n if (hasStart !== hasEnd) {\n throw new TypeError('options.start requires options.end');\n }\n if (hasStart && hasEnd) {\n const start = getAbs(options.start!),\n end = getAbs(options.end!);\n if (end - start > 365 * MAX_NUM_YEARS) {\n throw new RangeError(`Date range exceeds ${MAX_NUM_YEARS} years`);\n }\n return [start, end];\n }\n const isHebrewYear = Boolean(options.isHebrewYear);\n const theYear = getYear(options);\n if (isNaN(theYear)) {\n throw new RangeError(`Invalid year ${options.year}`);\n }\n if (isHebrewYear && theYear < 1) {\n throw new RangeError(`Invalid Hebrew year ${theYear}`);\n }\n const theMonth = getMonth(options);\n const numYears = Number(options.numYears) || 1;\n if (numYears > MAX_NUM_YEARS) {\n throw new RangeError(`options.numYears exceeds ${MAX_NUM_YEARS}`);\n }\n if (isHebrewYear) {\n return startEndHebrew(theMonth, theYear, numYears);\n } else {\n return startEndGregorian(theMonth, theYear, numYears);\n }\n}\n\nfunction getMonth(options: CalOptions): number {\n if (options.month) {\n if (options.isHebrewYear) {\n return HDate.monthNum(options.month);\n }\n if (typeof options.month === 'number') {\n return options.month;\n }\n }\n return NaN;\n}\n\nfunction startEndGregorian(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const gregMonth = theMonth ? theMonth - 1 : 0;\n const startGreg = new Date(theYear, gregMonth, 1);\n if (theYear < 100) {\n startGreg.setFullYear(theYear);\n }\n const startAbs = greg2abs(startGreg);\n let endAbs;\n if (theMonth) {\n endAbs = startAbs + daysInGregMonth(theMonth, theYear) - 1;\n } else {\n const endYear = theYear + numYears;\n const endGreg = new Date(endYear, 0, 1);\n if (endYear < 100) {\n endGreg.setFullYear(endYear);\n }\n endAbs = greg2abs(endGreg) - 1;\n }\n return [startAbs, endAbs];\n}\n\nfunction startEndHebrew(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const startDate = new HDate(1, theMonth || TISHREI, theYear);\n let startAbs = startDate.abs();\n const endAbs = theMonth\n ? startAbs + startDate.daysInMonth()\n : new HDate(1, TISHREI, theYear + numYears).abs() - 1;\n // for full Hebrew year, start on Erev Rosh Hashana which\n // is technically in the previous Hebrew year\n // (but conveniently lets us get candle-lighting time for Erev)\n if (!theMonth && theYear > 1) {\n startAbs--;\n }\n return [startAbs, endAbs];\n}\n","import {HDate} from '@hebcal/hdate';\nimport {Event} from './event.js';\n\ntype LearningCalendar = {\n fn: (hd: HDate, il: boolean) => Event | null;\n startDate?: HDate;\n};\nconst cals = new Map<string, LearningCalendar>();\n\n/**\n * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),\n * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.\n *\n * `@hebcal/core` itself contains no learning schedules — they are provided\n * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}\n * package, which calls {@link DailyLearning.addCalendar} on import. After\n * `@hebcal/learning` is loaded, `calendar()` will emit\n * learning events when the corresponding `options.dailyLearning` flag is set.\n *\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate} from '@hebcal/core';\n *\n * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);\n * console.log(ev?.render('en')); // e.g. 'Daf Yomi: Berakhot 2'\n */\nexport class DailyLearning {\n /**\n * Registers a new learning calendar.\n *\n * The provided function is called whenever a caller asks for an event\n * from this calendar; if no learning occurs that day (e.g. the date is\n * before the cycle's start) it should return `null`.\n * @example\n * DailyLearning.addCalendar(\n * 'myCalendar',\n * (hd, il) => new Event(hd, 'Today\\'s learning', 0),\n * new HDate(1, 'Tishrei', 5780),\n * );\n * @param name case insensitive\n * @param calendar a function that returns an `Event` or `null`\n * @param startDate the first date for which this calendar is valid\n */\n static addCalendar(\n name: string,\n calendar: (hd: HDate, il: boolean) => Event | null,\n startDate?: HDate\n ) {\n if (typeof calendar !== 'function') {\n throw new TypeError(`Invalid calendar function: ${calendar}`);\n }\n cals.set(name.toLowerCase(), {\n fn: calendar,\n startDate: startDate,\n });\n }\n\n /**\n * Returns the learning event for the given date from the named calendar,\n * or `null` if there is no learning that day (or the named calendar is\n * not registered).\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate, months} from '@hebcal/core';\n * DailyLearning.lookup('dafYomi', new HDate(15, months.CHESHVAN, 5784), false);\n * @param name case insensitive\n * @param hd Hebrew Date\n * @param il true for Israel, false for Diaspora\n */\n static lookup(name: string, hd: HDate, il: boolean): Event | null {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.fn(hd, il);\n }\n return null;\n }\n\n /**\n * Returns the first Hebrew date for which the named learning calendar\n * is valid (as registered by {@link addCalendar}), or `undefined` if the\n * calendar was not registered with a start date or is not registered at all.\n * @param name case insensitive\n */\n static getStartDate(name: string): HDate | undefined {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.startDate;\n }\n return undefined;\n }\n\n /**\n * Returns `true` if a learning calendar with the given name has been\n * registered via {@link addCalendar}.\n * @param name case insensitive\n */\n static has(name: string): boolean {\n return cals.has(name.toLowerCase());\n }\n\n /**\n * Returns the (lower-cased) names of all currently-registered learning\n * calendars.\n */\n static getCalendars(): string[] {\n return Array.from(cals.keys());\n }\n}\n","import {HDate, Locale, months} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {Molad} from './molad.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';\n\n/** Represents Mevarchim haChodesh, the announcement of the new month */\nexport class MevarchimChodeshEvent extends Event {\n readonly monthName: string;\n /**\n * Constructs Mevarchim haChodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n * @param memo text for the event memo. When falsy, a memo announcing the\n * molad of the upcoming month is generated automatically\n * @param locale Optional locale name\n */\n constructor(date: HDate, monthName: string, memo: string, locale?: string) {\n super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);\n this.monthName = Locale.gettext(monthName, locale);\n if (memo) {\n this.memo = memo;\n } else {\n const hyear = date.getFullYear();\n const hmonth = date.getMonth();\n const monNext =\n hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;\n const molad = new Molad(hyear, monNext);\n this.memo = molad.render('en', {hour12: false});\n }\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.monthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n const str = this.render(locale);\n const space = str.indexOf(' ');\n return str.substring(space + 1);\n }\n}\n","import {Locale} from './locale.js';\nimport {abs2greg, HDate, months} from '@hebcal/hdate';\nimport {CalOptions, DailyLearningValue} from './CalOptions.js';\nimport {\n makeCandleEvent,\n makeFastStartEnd,\n makeWeekdayChanukahCandleLighting,\n} from './candles.js';\nimport {Event, flags} from './event.js';\nimport {getStartAndEnd} from './getStartAndEnd.js';\nimport {HebrewDateEvent} from './HebrewDateEvent.js';\nimport {HolidayYearMap, getHolidaysForYear_} from './holidays.js';\nimport {ParshaEvent} from './ParshaEvent.js';\nimport {Sedra, getSedra} from './sedra.js';\nimport {TimedEvent, HavdalahEvent} from './TimedEvent.js';\nimport {DailyLearning} from './DailyLearning.js';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent.js';\nimport {MevarchimChodeshEvent} from './MevarchimChodeshEvent.js';\nimport {MoladEvent, Molad} from './molad.js';\nimport {OmerEvent} from './omer.js';\nimport {Zmanim} from './zmanim.js';\nimport {Location} from './location.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\n/**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * The date range returned by this function can be controlled by:\n * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)\n * * `options.isHebrewYear` - to interpret `year` as Hebrew year\n * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)\n * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)\n *\n * Alternatively, specify start and end days with `Date` or {@link HDate} instances:\n * * `options.start` - use specific start date (requires `end` date)\n * * `options.end` - use specific end date (requires `start` date)\n *\n * Unless `options.noHolidays == true`, default holidays include:\n * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.\n * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.\n * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)\n * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)\n * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)\n * * Rosh Chodesh (unless `options.noRoshChodesh`)\n *\n * Holiday and Torah reading schedules differ between Israel and the Disapora.\n * Set `options.il=true` to use the Israeli schedule.\n *\n * Additional non-default event types can be specified:\n * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)\n * * Counting of the Omer (`options.omer`)\n * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)\n * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)\n * * Yom Kippur Katan (`options.yomKippurKatan`)\n * * BeHaB fast days after Pesach and Sukkot (`options.behab`)\n * * Yizkor (`options.yizkor`)\n *\n * Daily Study of texts are supported by the\n * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,\n * for example:\n * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)\n * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)\n * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)\n * * Nach Yomi (`options.dailyLearning.nachYomi`)\n *\n * Candle-lighting and Havdalah times are approximated using latitude and longitude\n * specified by the {@link Location} class. The `Location` class contains a small\n * database of cities with their associated geographic information and time-zone information.\n * If you ever have any doubts about Hebcal's times, consult your local halachic authority.\n * If you enter geographic coordinates above the arctic circle or antarctic circle,\n * the times are guaranteed to be wrong.\n *\n * To add candle-lighting options, set `options.candlelighting=true` and set\n * `options.location` to an instance of `Location`. By default, candle lighting\n * time is 18 minutes before sundown in the Diaspora and 20 minutes before\n * sundown in Israel (40 minutes for Jerusalem,\n * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is\n * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars\n * are observable in the night time sky with the naked eye). The default Havdalah\n * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.\n * These defaults can be changed using these options:\n * * `options.candleLightingMins` - minutes before sundown to light candles\n * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).\n * Havdalah times are suppressed when `options.havdalahMins=0`.\n * * `options.havdalahDeg` - degrees for solar depression for Havdalah.\n * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.\n * Havdalah times are suppressed when `options.havdalahDeg=0`.\n *\n * If both `options.candlelighting=true` and `options.location` is specified,\n * Chanukah candle-lighting times and minor fast start/end times will also be generated.\n * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before\n * the sun is 7.083° below the horizon in the evening)\n * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on\n * Saturday night (see above).\n *\n * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning).\n * They end when 3 medium-sized stars are observable in the night sky (sun is 7.083°\n * below the horizon in the evening) in the Diaspora, or 15 minutes after sunset in\n * Israel (Rabbi Deblitzky's practice). Override with:\n * * `options.fastEndDeg` - degrees of solar depression for the end of a minor fast\n * * `options.fastEndMins` - minutes after sunset for the end of a minor fast\n * (mutually exclusive with `options.fastEndDeg`)\n *\n * Tish'a B'Av is different: it begins at sunset on the previous day and always ends\n * at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring `options.fastEndDeg`\n * and `options.fastEndMins`. When a minor fast falls on a Friday the end time is\n * suppressed, because Shabbat begins before nightfall.\n *\n * Two options also exist for generating an Event with the Hebrew date:\n * * `options.addHebrewDates` - print the Hebrew date for the entire date range\n * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events\n *\n * Lastly, translation and transliteration of event titles is controlled by\n * `options.locale` and the {@link Locale} API.\n * `@hebcal/core` supports three locales by default:\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n *\n * Additional locales (such as `ru` or `fr`) are supported by the\n * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package\n *\n * @example\n * import {calendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\nexport function calendar(options: CalOptions = {}): Event[] {\n options = {...options}; // so we can modify freely\n checkCandleOptions(options);\n const location = (options.location = options.location || defaultLocation);\n const il = (options.il = options.il || location.getIsrael() || false);\n const hasUserMask = typeof options.mask === 'number';\n options.mask = getMaskFromOptions(options);\n if (options.locale) {\n const locale = options.locale;\n if (locale && typeof locale !== 'string') {\n throw new TypeError(`Invalid options.locale: ${locale}`);\n }\n if (!Locale.hasLocale(locale)) {\n throw new TypeError(\n `Locale '${locale}' not found; did you forget to import @hebcal/locales?`\n );\n }\n } else if (options.ashkenazi) {\n options.locale = 'ashkenazi';\n } else {\n options.locale = 'en';\n }\n\n const evts: Event[] = [];\n let sedra: Sedra | undefined;\n let holidaysYear: HolidayYearMap | undefined;\n let beginOmer = -1;\n let endOmer = -1;\n let currentYear = -1;\n const startAndEnd = getStartAndEnd(options);\n warnUnrecognizedOptions(options);\n const startAbs = startAndEnd[0];\n const endAbs = startAndEnd[1];\n const startGreg = abs2greg(startAbs);\n const startGregYear = startGreg.getFullYear();\n if (startGregYear < 100 || startGregYear > 9999) {\n options.candlelighting = false;\n options.sedrot = false;\n options.dailyLearning = {};\n }\n for (let abs = startAbs; abs <= endAbs; abs++) {\n const hd = new HDate(abs);\n const hyear = hd.getFullYear();\n if (hyear !== currentYear) {\n currentYear = hyear;\n holidaysYear = getHolidaysForYear_(currentYear);\n if (options.sedrot) {\n sedra = getSedra(currentYear, il);\n }\n if (options.omer) {\n beginOmer = HDate.hebrew2abs(currentYear, NISAN, 16);\n endOmer = HDate.hebrew2abs(currentYear, SIVAN, 5);\n }\n }\n const prevEventsLength = evts.length;\n const dow = hd.getDay();\n const isFriday = dow === FRI;\n const isSaturday = dow === SAT;\n let candlesEv: TimedEvent | undefined;\n const holidays0 = holidaysYear!.get(hd.toString()) || [];\n const holidays = holidays0.filter(ev => ev.observedIn(il));\n for (const ev of holidays) {\n candlesEv = appendHolidayAndRelated(\n candlesEv,\n evts,\n ev,\n options,\n isFriday,\n isSaturday,\n hasUserMask\n );\n }\n const mm = hd.getMonth();\n const dd = hd.getDate();\n // When Erev Pesach falls on Shabbat, burning chametz is moved to Friday.\n if (isFriday && options.candlelighting && mm === months.NISAN && dd === 13) {\n const biurEv = makeBiurChametzEvent(hd, options);\n if (biurEv) {\n evts.push(biurEv);\n }\n }\n if (options.sedrot && isSaturday) {\n const parsha0 = sedra!.lookup(abs);\n if (!parsha0.chag) {\n evts.push(new ParshaEvent(parsha0));\n }\n }\n if (options.yizkor) {\n if (\n (mm === months.TISHREI && (dd === 10 || dd === 22)) ||\n (mm === NISAN && dd === (il ? 21 : 22)) ||\n (mm === SIVAN && dd === (il ? 6 : 7))\n ) {\n const linkedEvent = holidays[0];\n const ev = new Event(hd, hdesc.YIZKOR, flags.YIZKOR, {\n emoji: '🕯️',\n linkedEvent,\n });\n evts.push(ev);\n }\n }\n const dailyLearning = options.dailyLearning;\n let numDailyLearning = 0;\n if (typeof dailyLearning === 'object' && dailyLearning !== null) {\n const events = makeDailyLearning(hd, dailyLearning, il);\n numDailyLearning = events.length;\n if (numDailyLearning) {\n evts.push(...events);\n }\n }\n if (options.omer && abs >= beginOmer && abs <= endOmer) {\n const omer = abs - beginOmer + 1;\n const omerEv = makeOmerEvent(hd, omer, options);\n evts.push(omerEv);\n }\n if (isSaturday && (options.molad || options.shabbatMevarchim)) {\n const events = makeMoladAndMevarchimChodesh(hd, options);\n evts.push(...events);\n }\n if (!candlesEv && options.candlelighting && (isFriday || isSaturday)) {\n candlesEv = makeCandleEvent(undefined, hd, options, isFriday, isSaturday);\n if (isFriday && candlesEv && sedra) {\n const parsha = sedra.lookup(abs);\n if (!parsha.chag) {\n const pe = new ParshaEvent(parsha);\n candlesEv.memo = pe.render(options.locale);\n } else {\n candlesEv.memo = Locale.gettext(parsha.parsha[0], options.locale);\n }\n }\n }\n // suppress Havdalah when options.havdalahMins=0 or options.havdalahDeg=0\n if (\n candlesEv instanceof HavdalahEvent &&\n (options.havdalahMins === 0 || options.havdalahDeg === 0)\n ) {\n candlesEv = undefined;\n }\n if (candlesEv) {\n evts.push(candlesEv);\n }\n if (\n options.addHebrewDates ||\n (options.addHebrewDatesForEvents &&\n prevEventsLength !== evts.length - numDailyLearning)\n ) {\n const e2 = new HebrewDateEvent(hd);\n if (prevEventsLength === evts.length) {\n evts.push(e2);\n } else {\n evts.splice(prevEventsLength, 0, e2);\n }\n }\n }\n return evts;\n}\n\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst SIVAN = months.SIVAN;\nconst ELUL = months.ELUL;\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES;\nconst YOM_TOV_ENDS = flags.YOM_TOV_ENDS;\nconst CHUL_ONLY = flags.CHUL_ONLY;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;\nconst MINOR_FAST = flags.MINOR_FAST;\nconst SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;\nconst MODERN_HOLIDAY = flags.MODERN_HOLIDAY;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst ROSH_CHODESH = flags.ROSH_CHODESH;\nconst PARSHA_HASHAVUA = flags.PARSHA_HASHAVUA;\nconst DAF_YOMI = flags.DAF_YOMI;\nconst MISHNA_YOMI = flags.MISHNA_YOMI;\nconst NACH_YOMI = flags.NACH_YOMI;\nconst YERUSHALMI_YOMI = flags.YERUSHALMI_YOMI;\nconst OMER_COUNT = flags.OMER_COUNT;\nconst SHABBAT_MEVARCHIM = flags.SHABBAT_MEVARCHIM;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\nconst CHOL_HAMOED = flags.CHOL_HAMOED;\nconst YOM_KIPPUR_KATAN = flags.YOM_KIPPUR_KATAN;\nconst YIZKOR = flags.YIZKOR;\nconst BEHAB = flags.BEHAB;\n\ntype StringIntMap = Record<string, number>;\n\nconst unrecognizedAlreadyWarned = new Set<string>();\nconst RECOGNIZED_OPTIONS: StringIntMap = {\n location: 1,\n year: 1,\n isHebrewYear: 1,\n month: 1,\n numYears: 1,\n start: 1,\n end: 1,\n candlelighting: 1,\n candleLightingMins: 1,\n havdalahMins: 1,\n havdalahDeg: 1,\n fastEndDeg: 1,\n fastEndMins: 1,\n sedrot: 1,\n il: 1,\n noMinorFast: 1,\n noModern: 1,\n shabbatMevarchim: 1,\n noRoshChodesh: 1,\n noSpecialShabbat: 1,\n noHolidays: 1,\n omer: 1,\n molad: 1,\n ashkenazi: 1,\n locale: 1,\n addHebrewDates: 1,\n addHebrewDatesForEvents: 1,\n mask: 1,\n yomKippurKatan: 1,\n behab: 1,\n hour12: 1,\n dailyLearning: 1,\n useElevation: 1,\n yizkor: 1,\n} as const satisfies Record<keyof CalOptions, 1>;\n\n/**\n * @private\n */\nfunction warnUnrecognizedOptions(options: CalOptions) {\n for (const k of Object.keys(options)) {\n if (RECOGNIZED_OPTIONS[k] === undefined && !unrecognizedAlreadyWarned.has(k)) {\n console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);\n unrecognizedAlreadyWarned.add(k);\n }\n }\n if (options.dailyLearning) {\n for (const [k, val] of Object.entries(options.dailyLearning)) {\n // Resolve aliases (e.g. `yerushalmi` -> `yerushalmi-vilna`) the same way\n // makeDailyLearning() does, so a valid option doesn't warn spuriously.\n const name = dailyLearningName(k, val);\n if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(name)) {\n console.warn(`Ignoring unrecognized DailyLearning calendar: ${k}`);\n unrecognizedAlreadyWarned.add(k);\n }\n }\n }\n}\n\nconst israelCityOffset: StringIntMap = {\n Jerusalem: 40,\n Haifa: 30,\n \"Zikhron Ya'aqov\": 30,\n \"Zikhron Ya'akov\": 30,\n 'Zikhron Yaakov': 30,\n \"Zichron Ya'akov\": 30,\n 'Zichron Yaakov': 30,\n} as const;\n\nconst geoIdCandleOffset: StringIntMap = {\n '281184': 40, // Jerusalem\n '294801': 30, // Haifa\n '293067': 30, // Zikhron Yaakov\n} as const;\n\n/**\n * @private\n * @constant\n * This calculation is based on the position of the sun 36 minutes after sunset in Jerusalem\n * around the equinox / equilux, which is 8.5° below geometric zenith.\n * The Ohr Meir considers this the time that 3 small stars are visible,\n * which is later than the required 3 medium stars.\n * @see {https://kosherjava.com/zmanim/docs/api/com/kosherjava/zmanim/ZmanimCalendar.html#ZENITH_8_POINT_5}\n */\nconst TZEIT_3SMALL_STARS = 8.5;\n\n/**\n * Modifies options in-place\n * @private\n */\nfunction checkCandleOptions(options: CalOptions) {\n if (!options.candlelighting) {\n return;\n }\n const location = options.location;\n if (location === undefined || !(location instanceof Location)) {\n throw new TypeError('options.candlelighting requires valid options.location');\n }\n if (\n typeof options.havdalahMins === 'number' &&\n typeof options.havdalahDeg === 'number'\n ) {\n throw new TypeError(\n 'options.havdalahMins and options.havdalahDeg are mutually exclusive'\n );\n }\n if (\n typeof options.fastEndDeg === 'number' &&\n typeof options.fastEndMins === 'number'\n ) {\n throw new TypeError(\n 'options.fastEndDeg and options.fastEndMins are mutually exclusive'\n );\n }\n\n const min0 = options.candleLightingMins;\n let min = typeof min0 === 'number' && !isNaN(min0) ? Math.trunc(min0) : 18;\n if (location.getIsrael() && Math.abs(min) === 18) {\n min = overrideIsraelCandleMins(location);\n }\n options.candleLightingMins = -1 * Math.abs(min);\n\n if (typeof options.havdalahMins === 'number') {\n options.havdalahMins = Math.trunc(Math.abs(options.havdalahMins));\n } else if (typeof options.havdalahDeg === 'number') {\n options.havdalahDeg = Math.abs(options.havdalahDeg);\n } else {\n options.havdalahDeg = TZEIT_3SMALL_STARS;\n }\n if (typeof options.fastEndDeg === 'number') {\n options.fastEndDeg = Math.abs(options.fastEndDeg);\n }\n if (typeof options.fastEndMins === 'number') {\n options.fastEndMins = Math.trunc(Math.abs(options.fastEndMins));\n }\n}\n\nfunction overrideIsraelCandleMins(location: Location) {\n const geoid = location.getGeoId();\n if (geoid) {\n const offset = geoIdCandleOffset[geoid];\n if (typeof offset === 'number') {\n return offset;\n }\n }\n const shortName = location.getShortName();\n if (shortName) {\n const offset = israelCityOffset[shortName];\n if (typeof offset === 'number') {\n return offset;\n }\n }\n return 20;\n}\n\n/**\n * Mask to filter Holiday array\n * @private\n */\nfunction getMaskFromOptions(options: CalOptions): number {\n if (typeof options.mask === 'number') {\n return setOptionsFromMask(options);\n }\n const il = options.il || options.location?.getIsrael() || false;\n let mask = 0;\n\n // default options\n if (!options.noHolidays) {\n mask |=\n ROSH_CHODESH |\n YOM_TOV_ENDS |\n MINOR_FAST |\n SPECIAL_SHABBAT |\n MODERN_HOLIDAY |\n MAJOR_FAST |\n MINOR_HOLIDAY |\n EREV |\n CHOL_HAMOED |\n LIGHT_CANDLES |\n LIGHT_CANDLES_TZEIS |\n CHANUKAH_CANDLES;\n }\n if (options.candlelighting) {\n mask |= LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | YOM_TOV_ENDS;\n }\n // suppression of defaults\n if (options.noRoshChodesh) {\n mask &= ~ROSH_CHODESH;\n }\n if (options.noModern) {\n mask &= ~MODERN_HOLIDAY;\n }\n if (options.noMinorFast) {\n mask &= ~MINOR_FAST;\n }\n if (options.noSpecialShabbat) {\n mask &= ~SPECIAL_SHABBAT;\n mask &= ~SHABBAT_MEVARCHIM;\n }\n if (il) {\n mask |= IL_ONLY;\n } else {\n mask |= CHUL_ONLY;\n }\n // non-default options\n if (options.sedrot) {\n mask |= PARSHA_HASHAVUA;\n }\n if (options.omer) {\n mask |= OMER_COUNT;\n }\n if (options.shabbatMevarchim) {\n mask |= SHABBAT_MEVARCHIM;\n }\n if (options.yomKippurKatan) {\n mask |= YOM_KIPPUR_KATAN;\n }\n if (options.behab) {\n mask |= BEHAB;\n }\n if (options.yizkor) {\n mask |= YIZKOR;\n }\n const dailyLearning = options.dailyLearning;\n if (typeof dailyLearning === 'object' && dailyLearning !== null) {\n if (dailyLearning.dafYomi) {\n mask |= DAF_YOMI;\n }\n if (dailyLearning.mishnaYomi) {\n mask |= MISHNA_YOMI;\n }\n if (dailyLearning.nachYomi) {\n mask |= NACH_YOMI;\n }\n if (dailyLearning.yerushalmi) {\n mask |= YERUSHALMI_YOMI;\n }\n }\n\n return mask;\n}\n\nconst MASK_LIGHT_CANDLES =\n LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | CHANUKAH_CANDLES | YOM_TOV_ENDS;\n\nconst defaultLocation = new Location(0, 0, false, 'UTC');\n\n/**\n * @private\n */\nfunction setOptionsFromMask(options: CalOptions): number {\n const m = options.mask || 0;\n if (m & ROSH_CHODESH) delete options.noRoshChodesh;\n if (m & MODERN_HOLIDAY) delete options.noModern;\n if (m & MINOR_FAST) delete options.noMinorFast;\n if (m & SPECIAL_SHABBAT) delete options.noSpecialShabbat;\n if (m & PARSHA_HASHAVUA) options.sedrot = true;\n if (m & (DAF_YOMI | MISHNA_YOMI | NACH_YOMI | YERUSHALMI_YOMI)) {\n options.dailyLearning = options.dailyLearning || {};\n if (m & DAF_YOMI) {\n options.dailyLearning.dafYomi = true;\n }\n if (m & MISHNA_YOMI) {\n options.dailyLearning.mishnaYomi = true;\n }\n if (m & NACH_YOMI) {\n options.dailyLearning.nachYomi = true;\n }\n if (m & YERUSHALMI_YOMI) {\n options.dailyLearning.yerushalmi = 1;\n }\n }\n if (m & OMER_COUNT) options.omer = true;\n if (m & SHABBAT_MEVARCHIM) options.shabbatMevarchim = true;\n if (m & YOM_KIPPUR_KATAN) options.yomKippurKatan = true;\n if (m & BEHAB) options.behab = true;\n if (m & YIZKOR) options.yizkor = true;\n return m;\n}\n\n/**\n * Appends the Event `ev` to the `events` array. Also may add related\n * timed events like candle-lighting or fast start/end\n * @private\n */\nfunction appendHolidayAndRelated(\n candlesEv: TimedEvent | undefined,\n events: Event[],\n ev: HolidayEvent,\n options: CalOptions,\n isFriday: boolean,\n isSaturday: boolean,\n hasUserMask: boolean\n): TimedEvent | undefined {\n const il = options.il || false;\n if (!ev.observedIn(il)) {\n return candlesEv; // holiday isn't observed here; bail out early\n }\n const eFlags = ev.getFlags();\n if (\n (!options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||\n (!options.behab && eFlags & BEHAB) ||\n (options.noModern && eFlags & MODERN_HOLIDAY)\n ) {\n return candlesEv; // bail out early\n }\n if (options.candlelighting && ev.getDesc() === hdesc.EREV_PESACH) {\n const evts = makeErevPesachChametzEvents(ev, options);\n if (evts.length) {\n events.push(...evts);\n }\n }\n const isMajorFast = Boolean(eFlags & MAJOR_FAST);\n const isMinorFast = Boolean(eFlags & MINOR_FAST);\n let fastEv;\n if (\n options.candlelighting &&\n (isMajorFast || isMinorFast) &&\n ev.getDesc() !== hdesc.YOM_KIPPUR\n ) {\n ev = fastEv = makeFastStartEnd(ev, options);\n if (\n fastEv.startEvent &&\n (isMajorFast || (isMinorFast && !options.noMinorFast))\n ) {\n events.push(fastEv.startEvent);\n }\n }\n if (eFlags & Number(options.mask) || (!eFlags && !hasUserMask)) {\n if (options.candlelighting && eFlags & MASK_LIGHT_CANDLES) {\n const hd = ev.getDate();\n candlesEv = makeCandleEvent(ev, hd, options, isFriday, isSaturday);\n if (eFlags & CHANUKAH_CANDLES && candlesEv && !options.noHolidays) {\n // Replace Chanukah event with a clone that includes candle lighting time.\n // For clarity, allow a \"duplicate\" candle lighting event to remain for Shabbat\n const chanukahEv = makeWeekdayChanukahCandleLighting(\n ev as ChanukahEvent,\n options\n );\n if (chanukahEv) {\n if (isFriday || isSaturday) {\n chanukahEv.eventTime = candlesEv.eventTime;\n chanukahEv.eventTimeStr = candlesEv.eventTimeStr;\n }\n ev = chanukahEv;\n }\n candlesEv = undefined;\n }\n }\n if (\n !options.noHolidays ||\n (options.yomKippurKatan && eFlags & YOM_KIPPUR_KATAN) ||\n (options.behab && eFlags & BEHAB)\n ) {\n events.push(ev); // the original event itself\n }\n }\n if ((isMajorFast || (isMinorFast && !options.noMinorFast)) && fastEv?.endEvent) {\n events.push(fastEv.endEvent);\n }\n return candlesEv;\n}\n\nfunction makeMoladAndMevarchimChodesh(hd: HDate, options: CalOptions): Event[] {\n const evts: Event[] = [];\n const hmonth = hd.getMonth();\n const hdate = hd.getDate();\n if (hmonth !== ELUL && hdate >= 23 && hdate <= 29) {\n const hyear = hd.getFullYear();\n const monNext = hmonth === HDate.monthsInYear(hyear) ? NISAN : hmonth + 1;\n if (options.molad) {\n evts.push(new MoladEvent(hd, hyear, monNext, options));\n }\n if (options.shabbatMevarchim) {\n const nextMonthName = HDate.getMonthName(monNext, hyear);\n const molad = new Molad(hyear, monNext);\n const memo = molad.render(options.locale, options);\n evts.push(new MevarchimChodeshEvent(hd, nextMonthName, memo, options.locale));\n }\n }\n return evts;\n}\n\nfunction dailyLearningName(key: string, val: DailyLearningValue): string {\n if (key === 'yerushalmi') {\n return val === 2 ? 'yerushalmi-schottenstein' : 'yerushalmi-vilna';\n }\n return key;\n}\n\nfunction makeDailyLearning(\n hd: HDate,\n dailyLearning: Record<string, DailyLearningValue>,\n il: boolean\n): Event[] {\n const evts: Event[] = [];\n for (const [key, val] of Object.entries(dailyLearning)) {\n if (val) {\n const name = dailyLearningName(key, val);\n const learningEv = DailyLearning.lookup(name, hd, il);\n if (learningEv) {\n evts.push(learningEv);\n }\n }\n }\n return evts;\n}\n\nfunction makeOmerEvent(hd: HDate, omerDay: number, options: CalOptions) {\n const omerEv = new OmerEvent(hd, omerDay);\n if (options.candlelighting) {\n const location = options.location!;\n const zmanim = new Zmanim(location, hd.prev(), false);\n const tzeit = zmanim.tzeit(7.0833);\n if (!isNaN(tzeit.getTime())) {\n omerEv.alarm = tzeit;\n }\n }\n return omerEv;\n}\n\nfunction makeErevPesachChametzEvents(\n erevPesachEv: Event,\n options: CalOptions\n): TimedEvent[] {\n const evts: TimedEvent[] = [];\n const location = options.location!;\n const useElevation = Boolean(options.useElevation);\n const hd = erevPesachEv.getDate();\n const zmanim = new Zmanim(location, hd, useElevation);\n const zmanAchilas = zmanim.sofZmanTfilla(); // Gra\n if (isNaN(zmanAchilas.getTime())) {\n return [];\n }\n const zmanAchilasEv = new TimedEvent(\n hd,\n hdesc.SOF_ZMAN_ACHILAT_CHAMETZ,\n 0,\n zmanAchilas,\n location,\n undefined,\n options\n );\n zmanAchilasEv.emoji = '🍞';\n evts.push(zmanAchilasEv);\n // When Erev Pesach falls on Shabbat, chametz cannot be burned on Shabbat,\n // so Biur Chametz is emitted on the Friday before (see makeBiurChametzEvent\n // called from the main calendar loop). Skip it here in that case.\n if (hd.getDay() !== SAT) {\n const biurEv = makeBiurChametzEvent(hd, options);\n if (biurEv) {\n evts.push(biurEv);\n }\n }\n return evts;\n}\n\nfunction makeBiurChametzEvent(\n hd: HDate,\n options: CalOptions\n): TimedEvent | undefined {\n const location = options.location!;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd, useElevation);\n const time = zmanim.sofZmanBiurChametzGRA();\n if (isNaN(time.getTime())) {\n return undefined;\n }\n const biurChametzEv = new TimedEvent(\n hd,\n hdesc.BIUR_CHAMETZ,\n 0,\n time,\n location,\n undefined,\n options\n );\n biurChametzEv.emoji = '🔥';\n return biurChametzEv;\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {birthdayOrAnniversary, yahrzeit, HDate} from '@hebcal/hdate';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions.js';\nimport {version as pkgVersion} from './pkgVersion.js';\nimport {Event, flags} from './event.js';\nimport {Sedra, getSedra} from './sedra.js';\nimport {hallel_} from './hallel.js';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {TachanunResult, tachanun} from './tachanun.js';\nimport {calendar} from './calendar.js';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * This is a convenience wrapper around the standalone {@link calendar} function.\n * See {@link calendar} for the complete list of supported options, the\n * candle-lighting and Havdalah defaults, and notes on locales.\n *\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * Returns `undefined` when `hyear` precedes the original year of `gdate`.\n *\n * When `hyear` is the original year, the original date is returned unchanged —\n * a \"0th birthday\" is a meaningful thing to ask for. This differs from\n * {@link getYahrzeit}, which returns `undefined` for the original year,\n * because a yahrzeit only has meaning from the first anniversary onward.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n return birthdayOrAnniversary(hyear, gdate);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n return yahrzeit(hyear, gdate);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must be filtered for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n *\n * Includes Rosh Chodesh, fasts, Yom Kippur Katan, Special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * The result is cached in an internal LRU.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const map = HebrewCalendar.getHolidaysForYear(5784);\n * for (const [hdStr, events] of map.entries()) {\n * for (const ev of events) {\n * console.log(hdStr, ev.getDesc());\n * }\n * }\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns a sorted array of holidays observed during the given Hebrew year.\n *\n * Events are pre-filtered by Israel vs. Diaspora schedule, so callers do not\n * need to inspect `flags.IL_ONLY` / `flags.CHUL_ONLY` themselves.\n * Includes Rosh Chodesh, fasts, modern holidays, special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const events = HebrewCalendar.getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of holiday Events that occur on the given date,\n * or `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned; pass `true` or `false` to filter to a single schedule.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * const hd = new HDate(15, months.NISAN, 5784);\n * const events = HebrewCalendar.getHolidaysOnDate(hd, false);\n * console.log(events?.map(ev => ev.getDesc())); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Returns `true` if Eruv Tavshilin should be prepared on the given date.\n *\n * Eruv Tavshilin is prepared when a Yom Tov falls on Friday (so cooking\n * for Shabbat that begins Friday night may continue from Yom Tov into\n * Shabbat). This requires the day before to be a weekday (Wednesday or\n * Thursday), the following Friday to be Yom Tov, and the day after Friday\n * (Shabbat) to also be a sacred day.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,\n * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv\n * // Tavshilin is prepared on Wednesday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true\n * // In Israel there is only one day of Yom Tov, so Friday is a weekday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false\n * @param date Gregorian or Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n if (date.getDay() < 3 || date.getDay() > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n if (!isChag(friday, il) || isChag(today, il) || !isChag(tomorrow, il)) {\n return false;\n }\n return true;\n }\n\n /**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n /**\n * Returns the semantic version string of the `@hebcal/core` package\n * (e.g. `\"6.8.2\"`). Useful for logging or feature detection.\n */\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year + schedule.\n *\n * Use this in preference to `new Sedra(...)` when calling repeatedly,\n * since an internal LRU cache (~120 entries) avoids recomputing the\n * keviyah-specific reading pattern.\n * @example\n * import {HebrewCalendar, HDate} from '@hebcal/core';\n * const sedra = HebrewCalendar.getSedra(5784, false);\n * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));\n * console.log(result.parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Determines which form of Hallel (if any) is recited\n * on a given Hebrew date.\n *\n * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysOnDate(hdate, il);\n if (!events) {\n return 0;\n }\n return hallel_(events, hdate);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * // Regular weekday — Tachanun is said at both services\n * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: true, allCongs: true }\n *\n * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)\n * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: false, allCongs: true }\n *\n * // Rosh Chodesh — no Tachanun\n * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);\n * // => { shacharit: false, mincha: false, allCongs: false }\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\n/**\n * @private\n */\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const chag = events.filter(ev => ev.getFlags() & flags.CHAG);\n return chag.length !== 0;\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\nconst NONE = 0;\nconst HALF = 1;\nconst WHOLE = 2;\n\n/**\n * @private\n */\nexport function hallel_(events: Event[], hdate: HDate): number {\n const abs = hdate.abs();\n for (const ev of events) {\n const hd: HDate = ev.getDate();\n if (hd.abs() !== abs) {\n continue;\n }\n const desc = ev.getDesc();\n const month = hd.getMonth();\n const mday = hd.getDate();\n const mask = ev.getFlags();\n if (\n desc.startsWith('Chanukah') ||\n desc.startsWith('Shavuot') ||\n desc.startsWith('Sukkot') ||\n (month === months.NISAN &&\n (mday === 15 || mday === 16) &&\n mask & flags.CHAG) || // Pesach\n desc === hdesc.YOM_HAATZMA_UT ||\n desc === hdesc.YOM_YERUSHALAYIM\n ) {\n return WHOLE;\n }\n\n if (\n mask & flags.ROSH_CHODESH ||\n (desc.startsWith('Pesach') &&\n desc !== hdesc.PESACH_I &&\n desc !== hdesc.PESACH_II)\n ) {\n return HALF;\n }\n }\n\n return NONE;\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {ParshaEvent} from './ParshaEvent.js';\nimport {getSedra} from './sedra.js';\n\n/**\n * Calculates the weekly Torah Reading (Parashat HaShavua) on Saturdays for\n * an entire Hebrew year.\n *\n * Saturdays on which a Yom Tov reading displaces the regular parsha\n * (e.g. Shabbat Chol ha-Moed Pesach/Sukkot, Yom Kippur on Shabbat) are\n * skipped — for those use {@link getHolidaysOnDate} or\n * {@link Sedra.lookup}.\n * @example\n * import {parshaYear} from '@hebcal/core';\n * const events = parshaYear(5784, false);\n * events[0].render('en'); // 'Parashat Ha’azinu'\n * events[0].getDate().toString(); // '8 Tishrei 5784'\n * @param year Hebrew year\n * @param il Israel (false for Diaspora)\n * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular\n * (non-holiday) Parashat HaShavua\n */\nexport function parshaYear(year: number, il: boolean): ParshaEvent[] {\n const sedra = getSedra(year, il);\n const startAbs = sedra.getFirstSaturday();\n const endAbs = HDate.hebrew2abs(year, months.ELUL, 29);\n const events: ParshaEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {\n const parsha = sedra.lookup(absDt);\n if (!parsha.chag) {\n const ev = new ParshaEvent(parsha);\n events.push(ev);\n }\n }\n return events;\n}\n"],"names":["version","lengths","monthLengths","slice","mod","x","y","Math","floor","quotient","isGregLeapYear","year","daysInGregMonth","month","isDate","obj","Date","prototype","isPrototypeOf","toFixed","day","py","greg2abs","date","TypeError","isNaN","getTime","RangeError","getFullYear","getMonth","getDate","abs2greg","abs","l0","n400","d1","n100","d2","n4","n1","yearFromFixed","trunc","dt","setFullYear","hebrewStripNikkud","str","normalize","replace","greg","daysInMonth","isLeapYear","months","NISAN","IYYAR","SIVAN","TAMUZ","AV","ELUL","TISHREI","CHESHVAN","KISLEV","TEVET","SHVAT","ADAR_I","ADAR_II","NISAN_STR","monthNames0","monthNames","ED_CACHE_MIN","edCache","Int32Array","ED_CACHE_MAX","EPOCH","assertNumber","n","name","hebrew2abs","tempabs","endMonth","monthsInYear","m","elapsedDays","newYear","abs2hebrew","yy","mm","dd","STATIC_DAYS_IN_MONTH","d","longCheshvan","shortKislev","getMonthName","idx","elapsed","elapsedDays0","prevYear","mElapsed","pElapsed","hElapsed","parts","altDay","daysInYear","monthFromName","monthName","c","trim","toLowerCase","startsWith","substring","test","toSimpleHebrewDate","obj0","isSimpleHebrewDate","hd","heb2num","num2heb","key","val","Object","entries","num2digits","num","digits","push","i","incr","gematriya","num1","parseInt","thousands","tdigits","tdig","length","gematriyaStrToNum","gereshIdx","indexOf","ch","pad4","String","pad2","_formatters","Map","dateFormatRegex","getPseudoISO","tzid","fmt","get","f","Intl","DateTimeFormat","hour","minute","second","hour12","timeZone","set","getFormatter","format","exec","Error","getTimezoneOffset","utcStr","localStr","diffMs","ceil","isoDateString","poHe$1","headers","language","contexts","Adar","Av","Cheshvan","Elul","Iyyar","Kislev","Nisan","Sivan","Tamuz","Tammuz","Tevet","Tishrei","noopLocale","alias","h","a","s","locales","checkLocale","locale","getExistingLocale","locale1","loc","Locale","lookupTranslation","id","array","gettext","text","this","undefined","addLocale","data","ctx","addTranslation","translation","isArray","Array","t0","addTranslations","assign","getLocaleNames","from","keys","sort","b","localeCompare","hasLocale","has","ordinal","v","getEnOrdinal","isHebrewLocale","copyLocaleNoNikud","strs","poHe","poHeNoNikud","UNITS_DAY","UNITS_WEEK","UNITS_MONTH","UNITS_YEAR","HDate","rd","constructor","arguments","monthNum","fix","setMonth","abs0","isNumber","getTishreiMonth","nummonths","getDay","render","showYear","locale0","nth","dayOf","ofStr","getDayOfTranslation","dateStr","renderGematriya","suppressNikud","suppressYear","prefix","before","dayOfWeek","onOrBefore","nearest","onOrAfter","after","next","prev","add","amount","units","standardizeUnits","sign","subtract","deltaDays","other","isSameDate","toString","fullYear","charCodeAt","dayOnOrBefore","absdate","isHDate","fromGematriyaString","currentThousands","split","filter","numParts","fixMonth","fixDate","t","offset","yahrzeit","hyear","hDeath","getYahrzeitHD","birthdayOrAnniversary","orig","origYear","isOrigLeap","getBirthdayHD","Shabbat","Parashat","Balak","Bamidbar","Bechukotai","Behar","Bereshit","Beshalach","Bo","Chukat","Devarim","Eikev","Emor","Kedoshim","Korach","Masei","Matot","Metzora","Miketz","Mishpatim","Nasso","Nitzavim","Noach","Pekudei","Pinchas","Shemot","Shmini","Shoftim","Tazria","Terumah","Tetzaveh","Toldot","Tzav","Vaera","Vaetchanan","Vayakhel","Vayechi","Vayeilech","Vayera","Vayeshev","Vayetzei","Vayigash","Vayikra","Vayishlach","Yitro","Chanukah","Omer","Havdalah","Pesach","Purim","Shavuot","Sigd","Sukkot","min","Lovingkindness","Might","Beauty","Eternity","Splendor","Foundation","Majesty","Yizkor","Molad","chalakim","Misheyakir","Sunrise","Sunset","flags","CHAG","LIGHT_CANDLES","YOM_TOV_ENDS","CHUL_ONLY","IL_ONLY","LIGHT_CANDLES_TZEIS","CHANUKAH_CANDLES","ROSH_CHODESH","MINOR_FAST","SPECIAL_SHABBAT","PARSHA_HASHAVUA","DAF_YOMI","OMER_COUNT","MODERN_HOLIDAY","MAJOR_FAST","SHABBAT_MEVARCHIM","MOLAD","USER_EVENT","HEBREW_DATE","MINOR_HOLIDAY","EREV","CHOL_HAMOED","MISHNA_YOMI","YOM_KIPPUR_KATAN","YERUSHALMI_YOMI","NACH_YOMI","DAILY_LEARNING","YIZKOR","BEHAB","flagToCategory","Event","desc","mask","attrs","getDesc","getFlags","renderBrief","getEmoji","emoji","basename","url","observedInIsrael","observedInDiaspora","observedIn","il","getCategories","HebrewDateEvent","super","renderBriefHebrew","numberOutOfRange","entityName","max","invalidEntity","fieldName","normalizeOptions","options","create","requireObjectLike","toFiniteNumber","arg","errorMessages.forbiddenBigIntToNumber","Number","isFinite","errorMessages.expectedFinite","toIntegerWithTrunc","toPositiveIntegerWithTruncation","errorMessages.expectedPositive","requireNumberIsPositive","isObjectLike","baseErrorMessages.invalidEntity","missingField","noValidFields","validFields","join","invalidChoice","choiceMap","missingYear","allowEra","invalidLeapMonth","invalidTimeZone","calendarId","outOfBoundsDate","failedParse","invalidSubstring","invalidFormatType","branding","mismatchingFormatTypes","constrainToRange","TemporalUtils.isObjectLike","throwRangeError","message","throwTypeError","clampProp","props","propName","overflow","clampEntity","propVal","choices","clamped","baseErrorMessages.numberOutOfRange","memoize","generator","MapClass","map","otherArgs","createPropDescriptors","propVals","readonly","mapProps","value","configurable","writable","createStringTagDescriptors","Symbol","toStringTag","transformer","res","zipPropsConst","propNames","createPropGetters","getters","slots","pluckProps","dest","allPropsEqual","props0","props1","zeroOutProps","clearUntilI","copy","bindArgs","boundArgs","dynamicArgs","identity","noop","capitalize","toUpperCase","sortStrings","strss","concat","createRegExp","meat","RegExp","parseSubsecNano","fracStr","padEnd","parseSign","parseInt0","padNumber","padStart","padNumber2","compareNumbers","compareBigInts","divFloorBigInt","denom","whole","divModFloorBigInt","divisor","divModFloor","modFloor","divTrunc","modTrunc","fabricateNearHalfFraction","halfCompare","hasHalf","isoCalendarId","gregoryEraOrigins","bce","ce","normalizeEraName","era","normalized","isoCalendarImpl","getCalendarSlotId","calendar","monthCodeRegExp","parseMonthCode","monthCode","Boolean","formatMonthCode","monthCodeNumber","isLeapMonth","monthCodeNumberToMonth","leapMonth","unitNameMap","nanosecond","microsecond","millisecond","week","unitNamesAsc","nanoInMicro","nanoInMilli","nanoInSec","nanoInMinute","nanoInHour","nanoInUtcDay","unitNanoMap","bigNanoInMicro","BigInt","bigNanoInMilli","bigNanoInSec","bigNanoInMinute","bigNanoInHour","bigNanoInUtcDay","divideBigNanoToExactNumber","bigNano","divisorNano","days","timeNano","timeFieldNamesAsc","timeGetters","yearFieldNamesAsc","dayFieldNamesAsc","calendarDateFieldNamesAsc","offsetFieldNames","timeZoneFieldNames","eraYearFieldNames","allYearFieldNames","monthFieldNames","monthDayFieldNames","timeFieldNamesAlpha","yearFieldNamesWithEraAlpha","yearMonthFieldNamesAlpha","yearMonthFieldNamesWithEraAlpha","yearMonthCodeFieldNamesAlpha","yearMonthCodeFieldNamesWithEraAlpha","monthCodeDayFieldNamesAlpha","dateFieldNamesAlpha","dateFieldNamesWithEraAlpha","dateTimeFieldNamesAlpha","dateTimeFieldNamesWithEraAlpha","dateTimeAndOffsetFieldNamesAlpha","dateTimeAndOffsetFieldNamesWithEraAlpha","dateTimeAndZoneFieldNamesAlpha","dateTimeAndZoneFieldNamesWithEraAlpha","yearMonthCodeDayFieldNamesAlpha","yearMonthCodeDayFieldNamesWithEraAlpha","timeFieldDefaults","validateTimeFields","timeFields","constrainTimeFields","maxValues","constrainedFields","timeFieldsToNano","timeFieldsToSec","timeFieldsToSubsecNano","timeFieldsToMilli","nanoToTimeAndDay","nano","dayDelta","nanoToTimeFields","timeMilli","nanoAfterMilli","milliAfterHour","milliAfterMinute","milliToTimeFields","epochNanoToSecMod","epochNano","epochSec","isoDateTimeToEpochNano","isoDateTime","isoDateToEpochNano","isoDateTimeToEpochMilli","isoDateToEpochMilli","isoDate","isoDateToEpochDays","isoArgsToEpochDays","isoYear","isoMonth","isoDay","monthIndex","UTC","epochNanoToIsoDateTime","epochDays","nanoAfterDay","epochDaysToIsoDate","legacyDate","getUTCFullYear","getUTCMonth","getUTCDate","computeIsoYearMonthFieldsForMonthDay","computeIsoDaysInMonth","computeIsoInLeapYear","addIsoMonths","monthDelta","computeIsoDayOfWeek","isoDateFields","computeIsoDayOfYear","computeIsoWeekFields","yearOfWeek","weekOfYear","weeksInYear","computeIsoWeeksInYear","Be","y0DayOfWeek","validateIsoDateTimeFields","validateIsoDateFields","isoInternals","constrainIsoDateFields","isIsoDateFieldsValid","computeCalendarDateFields","ae","computeCalendarMonthCodeParts","L","computeIsoMonthCodeParts","computeCalendarEraFields","eraYear","computeGregoryEraFields","computeCalendarIsoFieldsFromParts","de","computeIsoFieldsFromParts","computeCalendarMonthsInYearForYear","j","computeCalendarDaysInMonthForYearMonth","o","computeCalendarMonthCode","computeCalendarInLeapYear","q","computeCalendarMonthsInYear","computeCalendarDaysInMonth","computeCalendarDaysInYear","computeIsoDaysInYear","durationFieldNamesAsc","unitName","durationGetters","durationFieldNamesAlpha","durationTimeFieldNamesAsc","durationDateFieldNamesAsc","durationCalendarFieldNamesAsc","durationFieldDefaults","durationTimeFieldDefaults","clearDurationFields","requirePropDefined","optionName","optionVal","requireString","requireType","typeName","requireNumberIsInteger","isInteger","toStringViaPrimitive","isObjectLike$1","toBigInt","bi","toStrictInteger","normalizeOptionsOrString","smallestUnitStr","overflowMap","constrain","reject","epochDisambigMap","compatible","earlier","later","offsetDisambigMap","use","prefer","ignore","calendarDisplayMap","auto","never","critical","always","timeZoneDisplayMap","offsetDisplayMap","roundingModeMap","halfFloor","halfCeil","halfTrunc","expand","halfExpand","halfEven","roundingModeFuncs","round","directionMap","previous","coerceRoundingIncInteger","roundingInc","roundingIncrement","coerceFractionalSecondDigits","subsecDigits","fractionalSecondDigits","coerceUnitOption","minUnit","ensureDefined","unitStr","unit","coerceChoiceOption","enumNameMap","defaultChoice","enumArg","enumStr","enumNum","coerceSmallestUnit","coerceLargestUnit","coerceTotalUnit","coerceOverflow","coerceEpochDisambig","coerceOffsetDisambig","coerceCalendarDisplay","coerceTimeZoneDisplay","coerceOffsetDisplay","coerceRoundingMode","coerceDirection","validateRoundingInc","smallestUnit","allowManyLargeUnits","solarMode","upUnitNano","unitNano","validateUnitRange","maxUnit","checkLargestSmallestUnit","largestUnit","refineDiffOptions","roundingModeInvert","defaultLargestUnit","defaultRoundingMode","roundingMode","refineRoundingOptions","combineDateAndTime","time","refineOverflowOptions","refineZonedFieldOptions","defaultOffsetDisambig","epochDisambig","offsetDisambig","epochNanoMax","epochNanoMin","plainDateEpochNanoMin","isoYearMonthIndexMin","checkIsoYearMonthInBounds","isoYearMonthIndex","checkIsoDateInBounds","allowPlainDateLowerEdge","checkIsoDateEpochNanoInBounds","checkIsoDateTimeInBounds","checkEpochNanoInBounds","isoDateTimeAndOffsetToEpochNano","offsetNano","createEpochNanoSlots","epochNanoseconds","createZonedEpochNanoSlots","createDateTimeSlots","createDateSlots","createTimeSlots","createDurationSlots","durationFields","computeDurationSign","getEpochMilli","getEpochNano","totalDuration","refineRelativeTo","maxDurationUnit","getMaxDurationUnit","totalUnit","relativeToSlots","relativeToInternals","relativeTo","isZoned","isZonedEpochSlots","isUniformUnit","totalDayTimeDuration","balancedDuration","endEpochNano","relativeOps","spanRelativeDuration","nudgeWindow","clampRelativeDuration","epochNano0","ee","epochNano1","te","numerator","pe","totalRelativeDuration","durationDayTimeToBigNano","clampUnit","clampDistance","epochNanoProgress","startDurationFields","shifted","window","computeRelativeDurationWindow","Ae","endDurationFields","moveRelativeToEpochNano","se","computeEpochNanoFrac","denomBig","numeratorBig","absNumerator","absDenom","fracSign","roundZonedEpochSlotsToUnit","isoFields0","zonedEpochSlotsToIso","isoFields1","moveByDays","getStartOfDayInstantFor","roundWithMode","computeZonedDayRoundFrac","offsetNanoseconds","getMatchingInstantFor","roundDateTimeToNano","computeNanoInc","nanoInc","roundedTimeFields","roundTimeToNano","roundedIsoDateTime","roundNumberToInc","roundToMinute","computeBigNanoInc","roundDayTimeDurationByInc","nanoToDurationDayTimeFields","roundBigNanoToInc","roundRelativeDuration","nudgeFunc","nudgeZonedTimeDuration","nudgeDayTimeDuration","nudgeRelativeDuration","roundedDurationFields","roundedEpochNano","grewBigUnit","currentUnit","baseDurationFields","thresholdCompare","bigNanoInc","roundBigNanoToIncWithTail","roundBigNanoToDayOriginInc","dayOriginNano","quotientTail","remainder","fraction","roundedTail","roundedBigNano","nanoDiff","expandedBigUnit","roundedDayTimeFields","_largestUnit","durationTimeToBigNano","roundedTimeNano","dayWindow","dayEpochNano0","dayEpochNano1","beyondDayNano","durationTimeFields","nanoToDurationTimeFields","smallestUnitFieldName","weeks","truncedVal","frac","windowStartVal","windowEndVal","roundedVal","roundedToEnd","_zonedEpochSlotsToIso","WeakMap","B","epochFuzzy","hasZ","possibleEpochNanos","N","matchingEpochNano","fuzzy","zonedEpochNano","possibleEpochNano","possibleOffsetNano","getSingleInstantFor","disambig","gapNano","startOffsetNano","shiftedIsoDateTime","zonedEpochNanoDayBefore","O","moveYearMonth","doSubtract","durationSlots","startOfMonthFields","moveToStartOfMonth","dateAddWithOverflow","negateDurationFields","moveEpochNano","durationHasDateParts","fields","moveZonedEpochSlots","timeOnlyNano","movedEpochNano","moveDate","moveDateTime","isoDateTimeFields","movedTimeFields","moveTime","years","durationBigNano","durDays","durTimeNano","newTimeFields","overflowDays","addDateMonths","dateParts","computeYearMovedMonth","p","yearMonthParts","K","targetLeapMonth","leapMonthMeta","l","getCommonCalendar","diffInstants","invert","instantSlots0","instantSlots1","diffEpochNanos","diffZonedDateTimes","slots0","slots1","diffZonedEpochsExact","createZonedRelativeOps","diffPlainDateTimes","plainDateTimeSlots0","plainDateTimeSlots1","startEpochNano","diffDateTimesBig","origin","ie","he","movedIsoDate","createDateTimeRelativeOps","diffPlainDates","plainDateSlots0","plainDateSlots1","diffDateLike","diffPlainYearMonth","plainYearMonthSlots0","plainYearMonthSlots1","firstOfMonth0","firstOfMonth1","compareIsoDate","startIsoDate","endIsoDate","smallestPrecision","diffCalendarDates","createDateRelativeOps","diffPlainTimes","plainTimeSlots0","plainTimeSlots1","timeDiffNano","remainderNano","dayCorrection","maxDayCorrection","midIsoDate","midEpochNano","prepareZonedEpochDiff","diffDays","diffDateTimesExact","startIsoDateTime","endIsoDateTime","diffEndDate","yearMonthDayStart","yearMonthDayEnd","year0","month0","day0","year1","month1","day1","_","diffIsoMonthSlots","anchorIsoDate","yearDiff","monthDiff","dayDiff","daysInMonth1","dayCorrect","origDaysInMonth1","monthCodeNumber0","isLeapMonth0","monthCodeNumber1","isLeapMonth1","monthCorrect","month0Projected","isoDate0","isoDate1","dateDuration","endSlots","end","moveRelativeEndpointToEpochNano","nanoToGivenFields","fieldNames","maxDurationSeconds","addDurations","otherSlots","validateDurationFields","combined","addDayTimeDurationsChecked","durationFields0","durationFields1","midSlots","mid","negateDuration","fieldSign","calendarUnit","validateDurationTimeUnit","isSafeInteger","hours","minutes","durationSubMinuteToBigNano","seconds","milliseconds","microseconds","nanoseconds","largestUnitVal","dayTimeFields","compareZonedEpochSlots","zonedEpochSlots0","zonedEpochSlots1","compareIsoDateTimeFields","isoDateTime0","isoDateTime1","compareIsoDateFields","compareTimeFields","getCalendarEraOrigins","k","getCalendarFieldNames","fieldNamesWithEra","resolveCalendarYear","exoticCalendar","eraOrigins","normalizedEra","eraOrigin","yearByEra","$","eraYearToYear","resolveCalendarMonth","monthCodeParts","monthByCode","wantsLeapMonth","resolveCalendarDay","resolveTimeFields","offsetRegExp","parseOffsetNano","parseOffsetNanoMaybe","onlyHourMinute","fractionIndex","search","main","every","part","firstSubMinutePart","dateFieldRefiners","monthCodeToString","call","timeFieldRefiners","durationFieldRefiners","dateTimeFieldRefiners","zonedDateTimeFieldRefiners","offsetString","readAndRefineBagFields","bag","validFieldNames","fieldRefiners","requiredFieldNames","disallowEmpty","anyMatching","fieldVal","refiner","includes","createPlainDateTimeFromRefinedFields","createPlainDateFromFields","createPlainDateFromPreparedFields","prepareDateFields","createPlainDateFromFieldsWithOptionsRefiner","refineOptions","prepared","refinedOptions","parseMonthCodeField","createPlainYearMonthFromFields","createPlainMonthDayFromFields","isIso","yearMaybe","referenceYear","ne","constrainedDay","fe","U","R","u","finalYear","finalMonth","RawDateTimeFormat","timeZonePeriodDaysByName","El_Aaiun","Tucuman","Tirane","Riga","Simferopol","Vienna","Tunis","Boa_Vista","Fortaleza","Maceio","Noronha","Recife","Gaza","Hebron","DeNoronha","minPossibleTransitionSec","refineTimeDisplayTuple","maxSmallestUnit","resolveSmallestUnitAndSubsecDigits","refineDateDisplayOptions","refineTimeDisplayOptions","formatInstantIso","refineTimeZoneString","instantSlots","timeZoneArg","providedTimeZone","formatIsoDateTimeFields","formatOffsetNano","queryTimeZone","formatZonedDateTimeIso","zonedDateTimeSlots0","displayOptions","calendarDisplay","offsetDisplay","timeZoneId","timeZoneDisplay","formatTimeZone","formatCalendar","formatPlainDateTimeIso","formatPlainDateIso","plainDateSlots","formatIsoDateFields","formatPlainYearMonthIso","plainYearMonthSlots","formatDateLikeIso","formatIsoYearMonthFields","formatPlainMonthDayIso","plainMonthDaySlots","formatIsoMonthDayFields","formatSimple","showCalendar","formatCalendarId","formatPlainTimeIso","formatTimeFields","formatDurationIso","wholeSec","subsecNano","subsecNanoString","formatSubsecNano","forceSec","formatDurationFragments","Y","formatDurationNumber","M","W","D","H","S","formatDurationSlots","fragObj","fragName","fragVal","force","useGrouping","toLocaleString","getSignStr","nanoRemainder0","nanoRemainder1","nanoRemainder2","isCritical","trailingZerosRE","totalNano","icuRegExp","badCharactersRegExp","resolveTimeZoneId","rawId","resolveTimeZoneRecord","upperRawId","offsetRecord","X","kind","normId","partI","queryNamedTimeZoneRecord","upperNormId","queryTimeZoneIntlFormat","resolvedOptions","rawTimeZoneId","record","queryTimeZoneRecord","normTimeZoneId","IntlTimeZone","FixedTimeZone","compareKey","ke","computeOffsetSec","periodDays","getSample","getSplit","createSplitTuple","periodSec","getOffsetSec","startEpochSec","endEpochSec","computePeriod","clampedStartEpochSec","clampIntlSampleEpochSec","clampedEndEpochSec","startOffsetSec","endOffsetSec","pinch","forEpochSec","offsetSec","splitDurSec","middleEpochSec","xe","zonedEpochSec","wideOffsetSec0","wideOffsetSec1","wideUtcEpochSec0","wideUtcEpochSec1","narrowOffsetSec0","we","getTransition","direction","lookaheadEpochSec","getCurrentEpochSec","searchEpochSec","inc","searchLimit","inBounds","transitionEpochSec","intlParts","intlFormat","epochMilli","formatToParts","hash","type","formatEpochMilliToPartsRecord","relatedYear","timeZoneName","pop","resEpochSec","now","throwFailedParse","requireIsoCalendar","organized","parsePlainDateLike","parseDateTimeLike","C","finalizeDateLike","isoDateProjector","resolveCalendar","re","finalizeDate","finalizeDateTime","projectIsoYearMonthDate","projectIsoMonthDayDate","finalizeZonedDateTime","timeRegExpStr","separatorIndex","dateTimeRegExpStr","yearMonthRegExp","monthDayRegExp","dateTimeRegExp","timeRegExp","annotationRegExp","durationRegExp","zOrOffset","organizeIsoYearParts","organizeTimeParts","organizeAnnotationParts","parseYearMonthOnly","parseMonthDayOnly","parseTimeOnlyParts","hourIndex","yearSign","calendarIsCritical","calendarIds","criticalStr","mainStr","reverse","mergeCalendarFields","baseFields","additionalFields","merged","spliceFields","ge","additional","allPropNames","deletablePropNames","nonMatchingPropNames","deletablePropName","computeMonthCode","zonedDateTimeToPlainDateTime","zonedDateTimeToPlainDate","zonedDateTimeToPlainTime","createPlainDateFromMergedFields","inputFields","extraFields","mergedFieldNames","mergedFields","applyPlainFormatTimeZone","timeStyle","checkResolvedCalendarCompatible","strictCalendarCheck","resolvedCalendarId","createOptionsTransformer","shapeFieldNames","invalidShapeFieldNames","ignoredFieldNames","defaultShapeFields","dateStyleReplacementFields","shapeFieldNameSet","Set","invalidShapeFieldNameSet","ignoredFieldNameSet","allowPartialOverlap","dateStyle","granularShapeFields","modifierFields","otherFields","hasInvalidGranularShapeFields","hasInvalidStyleFields","hasDateStyle","hasTimeStyle","hasAnyStyle","hasGranularShapeFields","hasInvalids","hasShapeFields","hasModifierFields","transformedOptions","dateDefaultShapeFields","timeDefaultShapeFields","dateTimeDefaultShapeFields","dateShapeFieldNames","timeShapeFieldNames","dateTimeShapeFieldNames","yearMonthIgnoredFieldNames","monthDayIgnoredFieldNames","transformInstantOptions","transformZonedOptions","transformDateTimeOptions","transformDateOptions","transformTimeOptions","transformYearMonthOptions","full","long","medium","short","transformMonthDayOptions","getCurrentIsoDateTime","getCurrentEpochNano","getCurrentTimeZoneId","NativeTemporal","globalThis","Temporal","PlainYearMonthBranding","PlainMonthDayBranding","PlainDateBranding","PlainDateTimeBranding","PlainTimeBranding","ZonedDateTimeBranding","InstantBranding","DurationBranding","defineTemporalClass","cls","getSlots","getterMaps","defineProperties","getter","attachDebugString","instance","defineProperty","toJSON","invalidRecordType","forbiddenValueOf","yearMonthFieldGetters$1","dateFieldGetters$1","monthDayFieldGetters$1","yearMonthDerivedGetters","inLeapYear","dateDerivedGetters","dayOfYear","yearStartIsoDate","computeCalendarDayOfYear","computeCalendarWeekOfYear","computeCalendarYearOfWeek","daysInWeek","createNativeGetters","shimGetters","createDateTimeFormatClass","getTemporalBrandingAndSlots","createArgsProvider","transformOptions","internalsMap","getInternals","internals","ShimDateTimeFormat","observedOptionNames","trackedOptions","Proxy","_target","baseFormat","copiedOptions","Z","ze","F","Ce","qe","rest","A","argsProvider","formatRange","record0","record1","epochMilli0","epochMilli1","formatRangeToParts","rawStaticDescriptors","getOwnPropertyDescriptors","createDateTimeFormatShell","getTemporalFormat","formattable","brandingAndSlots","checkTemporalDateTimeFormatCompatible","temporalDateTimeToEpochMilli","start","startBrandingAndSlots","startEpochMilli","endBrandingAndSlots","endEpochMilli","startBranding","startSlots","endBranding","resolveBasicCalendarId","rawCalendarId","lowerRawCalendarId","remedy","resolveBasicCalendarArg","zonedDateTimeSlotsMap","ZonedDateTime","initZonedDateTime","createZonedDateTime","toZonedDateTimeSlots","compare","arg0","arg1","getZonedDateTimeSlots","epochMilliseconds","hoursInDay","computeZonedHoursInDay","zonedDateTimeSlots","modFields","zonedSlots","origFields","partialFields","mergedCalendarFields","mergedAllFields","mergeZonedDateTimeFields","validateBag","withCalendar","calendarArg","refineCalendarArg","withTimeZone","refineTimeZoneArg","withPlainTime","plainTimeArg","plainTimeFields","zonedDateTimeWithPlainTime","optionalToPlainTimeFields","durationArg","toDurationSlots","until","otherArg","createDuration","since","startOfDay","computeZonedStartOfDay","equals","zonedDateTimeSlots1","toInstant","createInstant","toPlainDateTime","createPlainDateTime","toPlainDate","createPlainDate","toPlainTime","createPlainTime","applyZonedFormatTimeZone","getZonedTimeZoneId","getTimeZoneTransition","newEpochNano","normalizedOptions","getTimeZoneTransitionEpochNanoseconds","valueOf","getZonedDateTimeIsoSlots","dateFieldGetters","getZonedDateTimeSlotsIfPresent","ownSlots","refineZonedDateTimeObjectLike","getCalendarFromBag","parseZonedDateTime","parsed","parseTimeZoneId","instantSlotsMap","Instant","initInstant","toInstantSlots","fromEpochMilliseconds","epochMilliToInstant","fromEpochNanoseconds","epochNanoToInstant","getInstantSlots","toZonedDateTimeISO","instantToZonedDateTime","getInstantSlotsIfPresent","parseInstant","toTemporalInstant","plainMonthDaySlotsMap","PlainMonthDay","referenceIsoYear","isoMonthInt","isoDayInt","calendarImpl","initPlainMonthDay","createPlainMonthDay","toPlainMonthDaySlots","getPlainMonthDaySlots","mergePlainMonthDayFields","plainMonthDaySlots0","plainMonthDaySlots1","input","extraFieldNames","convertPlainMonthDayToDate","monthDayFieldGetters","getPlainMonthDaySlotsIfPresent","calendarMaybe","extractCalendarFromBag","calendarAbsent","refinePlainMonthDayObjectLike","dateSlots","origMonth","yearMonthFields","parsePlainMonthDay","plainYearMonthSlotsMap","PlainYearMonth","referenceIsoDay","isoYearInt","initPlainYearMonth","createPlainYearMonth","toPlainYearMonthSlots","getPlainYearMonthSlots","mergePlainYearMonthFields","convertPlainYearMonthToDate","yearMonthFieldGetters","getPlainYearMonthSlotsIfPresent","requireFields","refinePlainYearMonthObjectLike","parsePlainYearMonth","getPlainDateTimeSlotsIfPresent","getPlainDateSlotsIfPresent","getPlainTimeSlotsIfPresent","getDurationSlotsIfPresent","plainTimeSlotsMap","PlainTime","initPlainTime","toPlainTimeSlots","initialFields","mergePlainTimeFields","getPlainTimeSlots","dateTimeSlots","refinePlainTimeObjectLike","timeSlots","altParsed","dateTime","parsePlainTime","timeArg","plainDateTimeSlotsMap","PlainDateTime","initPlainDateTime","toPlainDateTimeSlots","getPlainDateTimeSlots","plainDateTimeSlots","mergePlainDateTimeFields","toZonedDateTime","plainDateTimeToZonedDateTime","isoDateInternals","refinePlainDateTimeObjectLike","parsePlainDateTime","plainDateSlotsMap","PlainDate","initPlainDate","toPlainDateSlots","getPlainDateSlots","mergePlainDateFields","optionsObj","plainTime","refinePlainTimeArg","plainDateToZonedDateTime","toPlainYearMonth","convertToPlainYearMonth","toPlainMonthDay","convertToPlainMonthDay","refinePlainDateObjectLike","parsePlainDate","timeParts","parseCalendarId","durationSlotsMap","Duration","initDuration","durationArg0","durationArg1","durationSlots0","durationSlots1","compareDurations","refinePublicRelativeTo","getDurationSlots","blank","negated","roundTo","durationLargestUnit","needsZonedDayLength","roundDuration","total","totalOf","DurationFormat","refineDurationObjectLike","hasAny","hasAnyFrac","leftoverNano","parseUnit","wholeStr","timeUnit","leftoverUnits","wholeUnits","parseDuration","refineMaybeZonedDateTimeObjectLike","parseRelativeToSlots","Now","instant","zonedDateTimeISO","plainDateTimeISO","plainDateISO","plainTimeISO","degreesToRadians","degrees","PI","radiansToDegrees","radians","GeoLocation","latitude","longitude","elevation","setLocationName","setLatitude","setLongitude","setElevation","setTimeZone","locationName","getElevation","getLatitude","getLongitude","getLocationName","getTimeZone","earthRadius","NOAACalculator","geoLocation","static","getSunrise","sunrise","getUTCSunrise0","GEOMETRIC_ZENITH","getDateFromTime","getSeaLevelSunrise","getUTCSeaLevelSunrise","getBeginCivilTwilight","getSunriseOffsetByDegrees","CIVIL_ZENITH","getBeginNauticalTwilight","NAUTICAL_ZENITH","getBeginAstronomicalTwilight","ASTRONOMICAL_ZENITH","getSunset","sunset","getUTCSunset0","getSeaLevelSunset","getUTCSeaLevelSunset","getEndCivilTwilight","getSunsetOffsetByDegrees","getEndNauticalTwilight","getEndAstronomicalTwilight","getTimeOffset","offsetZenith","dawn","zenith","getUTCSunrise","getAdjustedDate","getUTCSunset","getElevationAdjustment","acos","adjustZenith","adjustedZenith","solarRadius","adjustForElevation","getSunriseUTC","getJulianDay","getSunsetUTC","getTemporalHour","endOfDay","NaN","delta","getSunTransit","temporalHour","isSunrise","epochMillis","getEpochMillisFromTime","calculatedTime","cal","localTimeHours","dayOffset","millis","setUTCFullYear","getJulianCenturiesFromJulianDay","julianDay","JULIAN_DAY_JAN_1_2000","JULIAN_DAYS_PER_CENTURY","getJulianDayFromJulianCenturies","julianCenturies","getSunGeometricMeanLongitude","getSunGeometricMeanAnomaly","getEarthOrbitEccentricity","getSunEquationOfCenter","mrad","sin","getSunTrueLongitude","getSunApparentLongitude","omega","getMeanObliquityOfEcliptic","getObliquityCorrection","cos","getSunDeclination","obliquityCorrection","lambda","sint","asin","getEquationOfTime","epsilon","geomMeanLongSun","eccentricityEarthOrbit","geomMeanAnomalySun","tan","sin2l0","sinm","getSunHourAngleAtSunrise","lat","solarDec","latRad","sdRad","getSunHourAngleAtSunset","getSolarElevation","lon","equationOfTime","hourAngleRad","decRad","getSolarAzimuth","atan","noonmin","getSolarNoonUTC","tnoon","eqTime","hourAngle","timeDiff","timeUTC","newt","solNoonUTC","citiesJson","QuickLRU","size","cache","oldCache","maxSize","maxAge","onEviction","POSITIVE_INFINITY","__oldCache","emitEvictions","item","deleteIfExpired","expiry","delete","getOrDeleteIfExpired","getItemValue","peek","moveToRecent","entriesAscending","expiresIn","deleted","clear","resize","newSize","items","removeCount","evict","count","requested","evictCount","values","iterator","entriesDescending","oldCacheSize","forEach","callbackFunction","thisArgument","for","classicCities","ZIPCODES_TZ_MAP","timeFormatCache","Location","cityName","countryCode","geoid","parseFloat","elev","cc","getIsrael","getName","getShortName","comma","getCountryCode","getTzid","getTimeFormatter","getGeoId","lookup","entry","lng","location","addLocation","initClassicCities","JSON","stringify","legacyTzToTzid","tz","dst","getUsaTzid","state","hour12cc","US","CA","BR","AU","NZ","DO","PR","GR","IN","KR","NP","ZA","reformatTimeStr","timeStr","suffix","hm","CHALAKIM_PER_DAY","getChalakimSinceMoladTohu","monthOfYear","leap","getJewishMonthOfYear","calculateMolad","absDate","moladToAbsDate","conjunctionDay","adjustedChalakim","hdate","getMoladAsDate","molad","moladSeconds","zdt","getLocalMeanTimeOffset","smartApostrophe","replaceAll","urlFriendly","enDoW","heDayNames","frDoW","night","getMoladDate","getYear","getDow","getHour","getMinutes","getChalakim","getInstant","getTchilasZmanKidushLevana3Days","getTchilasZmanKidushLevana7Days","getSofZmanKidushLevanaBetweenMoldos","getSofZmanKidushLevana15Days","dayNames","getDayNames","dow","moladStr","minutesStr","chalakimStr","and","ampm","getHebrewTimeOfDay","result","toLocaleLowerCase","fmtTime","MoladEvent","hmonth","millisToDate","setMilliseconds","ZENITH_1_POINT_583","temporalHourMillis","Zmanim","gloc","useElevation","plainDate","noaa","getUseElevation","setUseElevation","timeAtAngle","angle","rising","sunriseMillis","sunsetMillis","utc","seaLevelSunrise","seaLevelSunset","dusk","gregEve","prev0","nightHour","chatzot","chatzotNight","alotHaShachar","alotHaShachar72","sunriseOffset","alotHaShachar72zdt","misheyakir","misheyakirMachmir","getShaahZmanisBasedZmanMillis","getShaahZmanisBasedZman","sofZmanShma","sofZmanTfilla","sofZmanBiurChametzGRA","getTemporalHour72","forceSeaLevel","alot72","sunsetOffset","getTemporalHourByDeg","alot","sofZmanShmaMGA","sofZmanShmaMGA16Point1","sofZmanShmaMGA19Point8","sofZmanTfillaMGA","sofZmanTfillaMGA16Point1","sofZmanTfillaMGA19Point8","minchaGedola","minchaGedolaMGA","minchaKetana","minchaKetanaMGA","plagHaMincha","tzeit","tzeit72","neitzHaChama","shkiah","beinHaShmashos","getMidnightLastNight","getMidnightTonight","getMoladBasedTime","moladBasedTime","alos","tzais","techila","lastMidnight","midnightTonight","zman","hd2","molad2","getZmanMolad","getSunriseBaalHatanya","getSunsetBaalHatanya","alosBaalHatanya","getShaahZmanisBaalHatanya","sofZmanShmaBaalHatanya","sofZmanTfilaBaalHatanya","minchaGedolaBaalHatanya","minchaKetanaBaalHatanya","plagHaminchaBaalHatanya","tzaisBaalHatanya","formatTime","timeFormat","roundTime","millisOnly","getMilliseconds","getSeconds","secAndMillis","timeZoneOffset","offsetAbs","formatISOWithTimeZone","roundMinute","setSeconds","makeSunsetAwareHDate","dateYomHaZikaron","pdow","Sedra","rh0","rh","rhDay","firstSaturday","longC","shortK","yearType","types","theSedraArray","yearKey","find","parsha","parshiot","isValidDouble","findInternal","parsha2id","CHMPESACH","CHMSUKOT","plen","p1","p2","num2","findContaining","getSedraArray","getFirstSaturday","saturday","weekNum","index","getSedra","chag","lookupWeekday","findWeekdayParsha","sedra","endOfYear","endAbs","sat2","parsha2","doubles","PESACH","PESACH1","PESACH7","PESACH8","SHAVUOT","range","stop","yearStartVayeilech","yearStartHaazinu","yearStartRH","r020","r027","r3340","r4349","r4350","sedraCache","cacheKey","Shvat","Adar2","emojiPesach","emojiSukkot","ROSH_HASHANA_II","EREV_YOM_KIPPUR","YOM_KIPPUR","EREV_SUKKOT","SUKKOT_I","SUKKOT_II","SUKKOT_III_CHM","SUKKOT_IV_CHM","SUKKOT_V_CHM","SUKKOT_VI_CHM","SHMINI_ATZERET","SIMCHAT_TORAH","SUKKOT_II_CHM","SUKKOT_VII_HOSHANA_RABA","TU_BISHVAT","EREV_PURIM","PURIM","SHUSHAN_PURIM","EREV_PESACH","PESACH_I","PESACH_II","PESACH_II_CHM","PESACH_III_CHM","PESACH_IV_CHM","PESACH_V_CHM","PESACH_VI_CHM","PESACH_VII","PESACH_VIII","PESACH_SHENI","LAG_BAOMER","EREV_SHAVUOT","SHAVUOT_I","SHAVUOT_II","TU_BAV","ROSH_HASHANA_LABEHEMOT","EREV_ROSH_HASHANA","YOM_YERUSHALAYIM","BEN_GURION_DAY","FAMILY_DAY","YITZHAK_RABIN_MEMORIAL_DAY","HERZL_DAY","JABOTINSKY_DAY","SIGD","YOM_HAALIYAH","YOM_HAALIYAH_SCHOOL_OBSERVANCE","HEBREW_LANGUAGE_DAY","holidayDesc","ASARA_BTEVET","BIRKAT_HACHAMAH","CHAG_HABANOT","CHANUKAH_8TH_DAY","EREV_TISHA_BAV","LEIL_SELICHOT","PURIM_KATAN","PURIM_MESHULASH","SHABBAT_CHAZON","SHABBAT_HACHODESH","SHABBAT_HAGADOL","SHABBAT_NACHAMU","SHABBAT_PARAH","SHABBAT_SHEKALIM","SHABBAT_SHIRAH","SHABBAT_SHUVA","SHABBAT_ZACHOR","SHUSHAN_PURIM_KATAN","TAANIT_BECHOROT","TAANIT_BEHAB","TAANIT_ESTHER","TISHA_BAV","TZOM_GEDALIAH","TZOM_TAMMUZ","YOM_HAATZMA_UT","YOM_HASHOAH","YOM_HAZIKARON","CHANUKAH_1_CANDLE","BIUR_CHAMETZ","SOF_ZMAN_ACHILAT_CHAMETZ","staticHolidays","chmDay","staticModernHolidays","firstYear","chul","satPostponeToSun","friPostponeToSun","friSatMovetoThu","suppressEmoji","HolidayEvent","urlDateSuffix","cholHaMoedDay","cats","hdesc","AsaraBTevetEvent","KEYCAP_DIGITS","ChanukahEvent","chanukahDay","candles","RoshHashanaEvent","roshChodeshStr","RoshChodeshEvent","monthName1","ykk","YomKippurKatanEvent","nextMonthName","memo","getHolidaysOnDate","hdStr","events","getHolidaysForYear_","ev","SUN","TUE","THU","FRI","SAT","emojiIsraelFlag","yearCache","cached","RH","pesach","arr","unshift","tzomGedaliahDay","rchTevet","pesachAbs","haChodeshAbs","nisan27dt","dateYomHaShoah","yomHaZikaronDt","tamuz17attrs","tamuz17","observed","av9attrs","av9dt","av9title","av9abs","nextMonth","roshChodesh","shabbos","fastDays","beshalachHd","birkatHaChama","startMonth","startDay","baseRd","getBirkatHaChama","FAST_DAY","HAVDALAH","CANDLE_LIGHTING","TimedEvent","eventTime","linkedEvent","eventTimeStr","opts","FAST_BEGINS","FAST_ENDS","CandleLightingEvent","HavdalahEvent","havdalahMins","makeCandleEvent","isFriday","isSaturday","havdalahTitle","useHavdalahOffset","candleLightingMins","zmanim","havdalahDeg","makeFastEndTime","isTishaBav","fastEndMins","fastEndDeg","FastDayEvent","startEvent","endEvent","makeTimedEvent","TimedChanukahEvent","sefira","ps67lines","lamnatzeachLetters","anaBekoach","sefirot","en","infix","infix26","words","pfxWords","translit","getWeeks","omerDay","tens","ones","shnei","yamim","shneiYamim","shavuot","yom","yomEchad","asar","lamnatzeach","flatMap","OmerEvent","checkDay","weekNumber","daysWithinWeeks","omer","lang","config","codePoint","fromCodePoint","getDaysWithinWeeks","getTodayIs","ten","one","omerTodayIsHe","day7","numWeeks","omerTodayIsEn","getLamnatzeachWord","getLamnatzeachLetter","getAnaBekoachWord","NONE","shacharit","mincha","allCongs","tachanun","tachanun0","checkNext","dates","shushPurim","none","mday","some","yesPrev","tachanunYear","ret","tomorrow","tmp","ParshaEvent","renderParshaName","getAbs","MAX_NUM_YEARS","getStartAndEnd","hasStart","hasEnd","isHebrewYear","theYear","theMonth","numYears","startDate","startAbs","startEndHebrew","gregMonth","startGreg","endYear","endGreg","startEndGregorian","cals","DailyLearning","addCalendar","fn","getStartDate","getCalendars","mevarchimChodeshStr","MevarchimChodeshEvent","monNext","space","candlelighting","min0","geoIdCandleOffset","shortName","israelCityOffset","overrideIsraelCandleMins","TZEIT_3SMALL_STARS","checkCandleOptions","defaultLocation","hasUserMask","noRoshChodesh","noModern","noMinorFast","noSpecialShabbat","sedrot","dailyLearning","dafYomi","mishnaYomi","nachYomi","yerushalmi","shabbatMevarchim","yomKippurKatan","behab","yizkor","setOptionsFromMask","noHolidays","getMaskFromOptions","ashkenazi","evts","holidaysYear","beginOmer","endOmer","currentYear","startAndEnd","RECOGNIZED_OPTIONS","unrecognizedAlreadyWarned","console","warn","dailyLearningName","warnUnrecognizedOptions","startGregYear","prevEventsLength","candlesEv","holidays","appendHolidayAndRelated","biurEv","makeBiurChametzEvent","parsha0","numDailyLearning","makeDailyLearning","omerEv","makeOmerEvent","makeMoladAndMevarchimChodesh","addHebrewDates","addHebrewDatesForEvents","e2","splice","Jerusalem","Haifa","MASK_LIGHT_CANDLES","eFlags","erevPesachEv","zmanAchilas","zmanAchilasEv","makeErevPesachChametzEvents","isMajorFast","isMinorFast","fastEv","fastEnd","ev2","makeFastStartEnd","chanukahEv","candleLightingTime","makeWeekdayChanukahCandleLighting","learningEv","alarm","biurChametzEv","isChag","getBirthdayOrAnniversary","gdate","getYahrzeit","getHolidaysForYear","getHolidaysForYearArray","yearMap","absDt","filtered","eruvTavshilin","today","friday","pkgVersion","hallel","hallel_","currentTime","currentMillis","isTomorrowShabbosOrYomTov","isTodayAssurBemelacha","getHDate","isSefiratHaOmer","begin","tishaBav","isBeinHaMetzarim","fastDay"],"mappings":";oCACO,MAAMA,EAAU,QCCjBC,EAAU,CAAC,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,IAE1DC,EAAe,CAACD,EAASA,EAAQE;8FAKvC,SAASC,EAAIC,EAAGC,GACZ,OAAOD,EAAIC,EAAIC,KAAKC,MAAMH,EAAIC,EAClC,CAIA,SAASG,EAASJ,EAAGC,GACjB,OAAOC,KAAKC,MAAMH,EAAIC,EAC1B,CAsCO,SAASI,EAAeC,GAC3B,QAASA,EAAO,KAAUA,EAAO,MAAUA,EAAO,IACtD,CAWO,SAASC,EAAgBC,EAAOF,GAEnC,OAAOT,GAAcQ,EAAeC,IAAOE,EAC/C,CAWO,SAASC,EAAOC,GAEnB,MAAsB,iBAARA,GAAoBC,KAAKC,UAAUC,cAAcH,EACnE,CAOA,SAASI,EAAQR,EAAME,EAAOO,GAC1B,MAAMC,EAAKV,EAAO,EAClB,OAAQ,IAAMU,EACVZ,EAASY,EAAI,GACbZ,EAASY,EAAI,KACbZ,EAASY,EAAI,KACbZ,EAAS,IAAMI,EAAQ,IAAK,KAC3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ACvB6oD,KAAK6J,IAC1B,MAAMtzD,EAAOszD,EAAGnzD,WAChB,OAAOH,EAAO21D,MAAc31D,EAAOZ,MAErC,OAAO+J,QAAQq6D,EACjB,0BcXM,SAAqBz7E,EAAc6Y,GACvC,MAAMmqD,EAAQJ,GAAS5iE,EAAM6Y,GACvBs7D,EAAWnR,EAAMR,mBACjBU,EAASt1D,GAAM3J,WAAWjE,EAAMwC,EAAOM,KAAM,IAC7CuoE,EAAwB,GAC9B,IAAK,IAAImP,EAAQrG,EAAUqG,GAAStX,EAAQsX,GAAS,EAAG,CACtD,MAAM7Y,EAASqB,EAAM/M,OAAOukB,GAC5B,IAAK7Y,EAAOkB,KAAM,CAChB,MAAM0I,EAAK,IAAIgI,GAAY5R,GAC3B0J,EAAOrkE,KAAKukE,EACd,CACF,CACA,OAAOF,CACT","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,20,21,22,23,24,25,26,27,28,30]}
1
+ {"version":3,"file":"bundle.min.js","sources":["../src/pkgVersion.ts","../node_modules/@hebcal/hdate/dist/esm/greg.js","../node_modules/@hebcal/hdate/dist/esm/hebrewStripNikkud.js","../node_modules/@hebcal/hdate/dist/esm/gregNamespace.js","../node_modules/@hebcal/hdate/dist/esm/hdateBase.js","../node_modules/@hebcal/hdate/dist/esm/anniversary.js","../node_modules/@hebcal/hdate/dist/esm/gematriya.js","../node_modules/@hebcal/hdate/dist/esm/pad.js","../node_modules/@hebcal/hdate/dist/esm/dateFormat.js","../node_modules/@hebcal/hdate/dist/esm/ashkenazi.po.js","../node_modules/@hebcal/hdate/dist/esm/he.po.js","../node_modules/@hebcal/hdate/dist/esm/locale.js","../node_modules/@hebcal/hdate/dist/esm/hdate.js","../node_modules/@hebcal/hdate/dist/esm/anniversaryHDate.js","../src/ashkenazi.po.ts","../src/he.po.ts","../src/locale.ts","../src/he-x-NoNikud.po.ts","../src/event.ts","../src/HebrewDateEvent.ts","../node_modules/temporal-utils/dist/errorMessages.js","../node_modules/temporal-utils/dist/utils.js","../node_modules/temporal-polyfill/chunks/options.js","../node_modules/temporal-polyfill/chunks/internal.js","../node_modules/temporal-polyfill/chunks/root.js","../node_modules/temporal-polyfill/chunks/apiHelpers.js","../node_modules/temporal-polyfill/chunks/classApi.js","../node_modules/temporal-polyfill/chunks/classApi-basic.js","../node_modules/@hebcal/noaa/dist/index.js","../node_modules/temporal-polyfill/shim.js","../src/cities.json.ts","../node_modules/quick-lru/index.js","../src/location.ts","../src/reformatTimeStr.ts","../src/moladBase.ts","../src/moladDate.ts","../src/string.ts","../src/molad.ts","../src/zmanim.ts","../src/modern.ts","../src/sedra.ts","../src/staticHolidays.ts","../src/HolidayEvent.ts","../src/YomKippurKatanEvent.ts","../src/holidays.ts","../src/isAveilut.ts","../src/TimedEvent.ts","../src/candles.ts","../src/sefira.json.ts","../src/omer.ts","../src/tachanun.ts","../src/ParshaEvent.ts","../src/parshaName.ts","../src/getStartAndEnd.ts","../src/DailyLearning.ts","../src/MevarchimChodeshEvent.ts","../src/calendar.ts","../src/hebcal.ts","../src/hallel.ts","../src/isAssurBemlacha.ts","../src/isFastDay.ts","../src/parshaYear.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.10.0';\n","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/** @private */\nconst lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n/** @private */\nconst monthLengths = [lengths, lengths.slice()];\nmonthLengths[1][2] = 29;\n/**\n * @private\n */\nfunction mod(x, y) {\n return x - y * Math.floor(x / y);\n}\n/**\n * @private\n */\nfunction quotient(x, y) {\n return Math.floor(x / y);\n}\n/**\n * @private\n * @param abs - R.D. number of days\n */\nfunction yearFromFixed(abs) {\n const l0 = abs - 1;\n const n400 = quotient(l0, 146097);\n const d1 = mod(l0, 146097);\n const n100 = quotient(d1, 36524);\n const d2 = mod(d1, 36524);\n const n4 = quotient(d2, 1461);\n const d3 = mod(d2, 1461);\n const n1 = quotient(d3, 365);\n const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;\n return n100 !== 4 && n1 !== 4 ? year + 1 : year;\n}\n/*\nconst ABS_14SEP1752 = 639797;\nconst ABS_2SEP1752 = 639785;\n*/\n/*\n * Formerly in namespace, now top-level\n */\n/**\n * Returns true if the Gregorian year is a leap year.\n *\n * Uses the proleptic Gregorian rule (divisible by 4, except centuries\n * that are not divisible by 400) for **all** years, including those\n * before the Gregorian calendar was adopted in 1582.\n * @param year Gregorian year\n * @returns `true` if February has 29 days in `year`\n * @example\n * isGregLeapYear(2000); // true\n * isGregLeapYear(2020); // true\n * isGregLeapYear(2023); // false\n * isGregLeapYear(2100); // false (divisible by 100 but not 400)\n */\nexport function isGregLeapYear(year) {\n return !(year % 4) && (!!(year % 100) || !(year % 400));\n}\n/**\n * Number of days in the Gregorian month for given year\n * @param month Gregorian month (1=January, 12=December)\n * @param year Gregorian year\n * @returns an integer 28-31\n * @example\n * daysInGregMonth(2, 2024); // 29 (February in a leap year)\n * daysInGregMonth(2, 2023); // 28\n * daysInGregMonth(7, 2024); // 31 (July)\n */\nexport function daysInGregMonth(month, year) {\n // 1 based months\n return monthLengths[+isGregLeapYear(year)][month];\n}\n/**\n * Returns true if the object is a Javascript `Date`.\n *\n * Note that this only tests the type: an invalid date such as\n * `new Date('foo')` is still a `Date` and returns `true`.\n * @example\n * isDate(new Date()); // true\n * isDate('2024-01-01'); // false\n * isDate(1700000000000); // false\n */\nexport function isDate(obj) {\n // eslint-disable-next-line no-prototype-builtins\n return typeof obj === 'object' && Date.prototype.isPrototypeOf(obj);\n}\n/**\n * @private\n * @param year\n * @param month (1-12)\n * @param day (1-31)\n */\nfunction toFixed(year, month, day) {\n const py = year - 1;\n return (365 * py +\n quotient(py, 4) -\n quotient(py, 100) +\n quotient(py, 400) +\n quotient(367 * month - 362, 12) +\n (month <= 2 ? 0 : isGregLeapYear(year) ? -1 : -2) +\n day);\n}\n/**\n * Converts Gregorian date to absolute R.D. (Rata Die) days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).\n *\n * Only the local-time year, month and day of `date` are used; hours,\n * minutes, seconds and milliseconds are ignored.\n *\n * Dates are interpreted on the **proleptic** Gregorian calendar, which\n * applies the Gregorian rules uniformly to every year without the\n * ten-day discontinuity of the Gregorian Reformation of 1582.\n * @param date Gregorian date\n * @returns R.D. number of days\n * @throws {TypeError} if `date` is not a `Date`\n * @throws {RangeError} if `date` is an Invalid Date\n * @see {@link abs2greg}\n * @example\n * greg2abs(new Date(2008, 10, 13)); // 733359 (13 November 2008)\n * greg2abs(new Date(2005, 3, 2)); // 732038 (2 April 2005)\n */\nexport function greg2abs(date) {\n if (!isDate(date)) {\n throw new TypeError(`not a Date: ${date}`);\n }\n else if (isNaN(date.getTime())) {\n throw new RangeError('Invalid Date');\n }\n const abs = toFixed(date.getFullYear(), date.getMonth() + 1, date.getDate());\n /*\n if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {\n throw new RangeError(`Invalid Date: ${date}`);\n }\n */\n return abs;\n}\n/**\n * Converts from Rata Die (R.D. number) to Gregorian date.\n * See the footnote on page 384 of ``Calendrical Calculations, Part II:\n * Three Historical Calendars'' by E. M. Reingold, N. Dershowitz, and S. M.\n * Clamen, Software--Practice and Experience, Volume 23, Number 4\n * (April, 1993), pages 383-404 for an explanation.\n *\n * Note that this function returns the daytime portion of the date.\n * For example, the 15th of Cheshvan 5769 began at sundown on\n * 12 November 2008 and continues through 13 November 2008. This\n * function would return only the date 13 November 2008.\n *\n * The returned `Date` is in the local (i.e. host system) time zone with\n * hours, minutes, seconds and milliseconds all set to zero, and is on the\n * **proleptic** Gregorian calendar (see {@link greg2abs}).\n * @param abs - R.D. number of days\n * @returns Gregorian date at local midnight\n * @throws {TypeError} if `abs` is not a number\n * @see {@link greg2abs}\n * @example\n * const abs = hebrew2abs(5769, months.CHESHVAN, 15);\n * const date = abs2greg(abs); // 13 November 2008\n * const year = date.getFullYear(); // 2008\n * const monthNum = date.getMonth() + 1; // 11\n * const day = date.getDate(); // 13\n */\nexport function abs2greg(abs) {\n if (typeof abs !== 'number' || isNaN(abs)) {\n throw new TypeError(`not a Number: ${abs}`);\n }\n abs = Math.trunc(abs);\n /*\n if (abs < ABS_14SEP1752 && abs > ABS_2SEP1752) {\n throw new RangeError(`Invalid Date: ${abs}`);\n }\n */\n const year = yearFromFixed(abs);\n const priorDays = abs - toFixed(year, 1, 1);\n const correction = abs < toFixed(year, 3, 1) ? 0 : isGregLeapYear(year) ? 1 : 2;\n const month = quotient(12 * (priorDays + correction) + 373, 367);\n const day = abs - toFixed(year, month, 1) + 1;\n const dt = new Date(year, month - 1, day);\n if (year < 100 && year >= 0) {\n dt.setFullYear(year);\n }\n return dt;\n}\n//# sourceMappingURL=greg.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/**\n * Removes niqqud from Hebrew string\n * @example\n * hebrewStripNikkud('אֱלוּל'); // 'אלול'\n * hebrewStripNikkud('חֶשְׁוָן'); // 'חשון'\n */\nexport function hebrewStripNikkud(str) {\n if (typeof str !== 'string') {\n throw new TypeError(`bad nikkud str: ${str}`);\n }\n const a = str.normalize();\n // now strip out niqqud and trope\n return a.replace(/[\\u0590-\\u05bd]/g, '').replace(/[\\u05bf-\\u05c7]/g, '');\n}\n//# sourceMappingURL=hebrewStripNikkud.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/* eslint-disable @typescript-eslint/no-namespace */\nimport { abs2greg, daysInGregMonth, greg2abs, isDate, isGregLeapYear, } from './greg.js';\n/**\n * Gregorian date helper functions.\n *\n * These are aliases retained for backwards compatibility. Each member\n * simply forwards to the identically-behaving top-level function, which\n * is the preferred form in new code because it tree-shakes cleanly:\n *\n * | Namespace | Top-level equivalent |\n * | --- | --- |\n * | `greg.abs2greg` | {@link abs2greg} |\n * | `greg.daysInMonth` | {@link daysInGregMonth} |\n * | `greg.greg2abs` | {@link greg2abs} |\n * | `greg.isDate` | {@link isDate} |\n * | `greg.isLeapYear` | {@link isGregLeapYear} |\n * @example\n * import {greg} from '@hebcal/hdate';\n * greg.greg2abs(new Date(2008, 10, 13)); // 733359\n * greg.isLeapYear(2024); // true\n */\nexport var greg;\n(function (greg) {\n})(greg || (greg = {}));\ngreg.abs2greg = abs2greg;\ngreg.daysInMonth = daysInGregMonth;\ngreg.greg2abs = greg2abs;\ngreg.isDate = isDate;\ngreg.isLeapYear = isGregLeapYear;\n//# sourceMappingURL=gregNamespace.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/*\n * More minimal HDate\n */\nimport { hebrewStripNikkud } from './hebrewStripNikkud.js';\nconst NISAN = 1;\nconst IYYAR = 2;\nconst SIVAN = 3;\nconst TAMUZ = 4;\nconst AV = 5;\nconst ELUL = 6;\nconst TISHREI = 7;\nconst CHESHVAN = 8;\nconst KISLEV = 9;\nconst TEVET = 10;\nconst SHVAT = 11;\nconst ADAR_I = 12;\nconst ADAR_II = 13;\n/**\n * Hebrew months of the year (NISAN=1, TISHREI=7).\n *\n * Months are numbered from Nisan, the first month of the ecclesiastical\n * year, even though the civil year begins with Tishrei on Rosh Hashanah\n * (see {@link HDate.getTishreiMonth} for Tishrei-based numbering).\n *\n * In a common year month 12 is Adar; in a leap year month 12 is Adar I\n * and month 13 is Adar II.\n * @readonly\n * @enum {number}\n * @example\n * import {months, getMonthName} from '@hebcal/hdate';\n * months.TISHREI; // 7\n * getMonthName(months.ADAR_I, 5784); // 'Adar I' (5784 is a leap year)\n * getMonthName(months.ADAR_I, 5783); // 'Adar'\n */\nexport const months = {\n /** Nissan / ניסן */\n NISAN,\n /** Iyyar / אייר */\n IYYAR,\n /** Sivan / סיון */\n SIVAN,\n /** Tamuz (sometimes Tammuz) / תמוז */\n TAMUZ,\n /** Av / אב */\n AV,\n /** Elul / אלול */\n ELUL,\n /** Tishrei / תִּשְׁרֵי */\n TISHREI,\n /** Cheshvan / חשון */\n CHESHVAN,\n /** Kislev / כסלו */\n KISLEV,\n /** Tevet / טבת */\n TEVET,\n /** Sh'vat / שבט */\n SHVAT,\n /** Adar or Adar Rishon / אדר */\n ADAR_I,\n /** Adar Sheini (only on leap years) / אדר ב׳ */\n ADAR_II,\n};\nconst NISAN_STR = 'Nisan';\nconst monthNames0 = [\n '',\n NISAN_STR,\n 'Iyyar',\n 'Sivan',\n 'Tamuz',\n 'Av',\n 'Elul',\n 'Tishrei',\n 'Cheshvan',\n 'Kislev',\n 'Tevet',\n \"Sh'vat\",\n];\n/*\n * Transliterations of Hebrew month names.\n * Regular years are index 0 and leap years are index 1.\n * @private\n */\nconst monthNames = [\n [...monthNames0, 'Adar', NISAN_STR],\n [...monthNames0, 'Adar I', 'Adar II', NISAN_STR],\n];\n// Typed-array cache for elapsedDays, indexed by `year - ED_CACHE_MIN`.\n// The range covers Hebrew years ~AD 1240 through ~AD 3240, which spans\n// every realistic modern use. Years outside the range fall through\n// uncached. 0 is the \"not computed\" sentinel; every valid input\n// (year >= 1) produces a result >= 1, so it can't collide.\n// elapsedDays(6999) is ~2.56M, well within Int32 range.\nconst ED_CACHE_MIN = 5000;\nconst ED_CACHE_MAX = 6999;\nconst edCache = new Int32Array(ED_CACHE_MAX - ED_CACHE_MIN + 1);\nconst EPOCH = -1373428;\n// Avg year length in the cycle (19 solar years with 235 lunar months)\nconst AVG_HEBYEAR_DAYS = 365.24682220597794;\n/**\n * @private\n */\nfunction assertNumber(n, name) {\n if (typeof n !== 'number' || isNaN(n)) {\n throw new TypeError(`param '${name}' not a number: ${n}`);\n }\n}\n/**\n * Converts Hebrew date to R.D. (Rata Die) fixed days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 on the (proleptic)\n * Gregorian Calendar.\n *\n * R.D. is the common currency between the two calendars: convert a\n * Hebrew date to R.D. with this function, then to a Gregorian `Date`\n * with {@link abs2greg}.\n * @param year Hebrew year\n * @param month Hebrew month (1=NISAN, 7=TISHREI)\n * @param day Hebrew date (1-30)\n * @returns R.D. number of days\n * @throws {TypeError} if any argument is not a number\n * @throws {RangeError} if `year` is less than 1\n * @see {@link abs2hebrew}\n * @example\n * import {hebrew2abs, months} from '@hebcal/hdate';\n * hebrew2abs(5769, months.CHESHVAN, 15); // 733359\n */\nexport function hebrew2abs(year, month, day) {\n assertNumber(year, 'year');\n assertNumber(month, 'month');\n assertNumber(day, 'day');\n if (year < 1) {\n throw new RangeError(`hebrew2abs: invalid year ${year}`);\n }\n let tempabs = day;\n if (month < TISHREI) {\n const endMonth = monthsInYear(year);\n for (let m = TISHREI; m <= endMonth; m++) {\n tempabs += daysInMonth(m, year);\n }\n for (let m = NISAN; m < month; m++) {\n tempabs += daysInMonth(m, year);\n }\n }\n else {\n for (let m = TISHREI; m < month; m++) {\n tempabs += daysInMonth(m, year);\n }\n }\n return EPOCH + elapsedDays(year) + tempabs - 1;\n}\n/**\n * Convenience wrapper for `hebrew2abs` that accepts a\n * `SimpleHebrewDate` (`{yy, mm, dd}`) rather than three separate\n * arguments. Returns the same R.D. (Rata Die) day number.\n * @param hdate Hebrew date, or any object with `yy`/`mm`/`dd` fields\n * (an {@link HDate} qualifies)\n * @returns R.D. number of days\n * @example\n * import {hd2abs, months} from '@hebcal/hdate';\n * hd2abs({yy: 5769, mm: months.CHESHVAN, dd: 15}); // 733359\n */\nexport function hd2abs(hdate) {\n return hebrew2abs(hdate.yy, hdate.mm, hdate.dd);\n}\n/**\n * @private\n */\nfunction newYear(year) {\n return EPOCH + elapsedDays(year);\n}\n/**\n * Converts absolute R.D. days to Hebrew date\n * @param abs absolute R.D. days\n * @returns the Hebrew date as a plain `{yy, mm, dd}` object\n * @throws {TypeError} if `abs` is not a number\n * @throws {RangeError} if `abs` precedes the Hebrew epoch\n * @see {@link hebrew2abs}\n * @example\n * abs2hebrew(733359); // {yy: 5769, mm: 8, dd: 15} (15 Cheshvan 5769)\n */\nexport function abs2hebrew(abs) {\n assertNumber(abs, 'abs');\n abs = Math.trunc(abs);\n if (abs <= EPOCH) {\n throw new RangeError(`abs2hebrew: ${abs} is before epoch`);\n }\n // first, quickly approximate year\n let year = Math.floor((abs - EPOCH) / AVG_HEBYEAR_DAYS);\n while (newYear(year) <= abs) {\n ++year;\n }\n --year;\n let month = abs < hebrew2abs(year, 1, 1) ? 7 : 1;\n while (abs > hebrew2abs(year, month, daysInMonth(month, year))) {\n ++month;\n }\n const day = 1 + abs - hebrew2abs(year, month, 1);\n return { yy: year, mm: month, dd: day };\n}\n/**\n * Returns true if Hebrew year is a leap year.\n *\n * The Hebrew calendar is lunisolar: 7 years out of every 19-year\n * (Metonic) cycle are leap years, in which a 13th month (Adar I) is\n * inserted before Adar so that Nisan stays in the spring.\n * @param year Hebrew year\n * @returns `true` if `year` has 13 months\n * @example\n * isLeapYear(5783); // false\n * isLeapYear(5784); // true\n */\nexport function isLeapYear(year) {\n return (1 + year * 7) % 19 < 7;\n}\n/**\n * Number of months in this Hebrew year (either 12 or 13 depending on leap year).\n *\n * Because Adar II is the last month of a leap year and Adar the last\n * month of a common year, this doubles as \"the number of the final\n * month\", which is how the anniversary rules identify Adar.\n * @param year Hebrew year\n * @returns 12 or 13\n * @example\n * monthsInYear(5783); // 12\n * monthsInYear(5784); // 13\n */\nexport function monthsInYear(year) {\n return 12 + +isLeapYear(year); // boolean is cast to 1 or 0\n}\n// Static day counts indexed by month number. 0 marks months whose length\n// depends on the year (CHESHVAN, KISLEV, ADAR_I).\nconst STATIC_DAYS_IN_MONTH = [\n 0, 30, 29, 30, 29, 30, 29, 30, 0, 0, 29, 30, 0, 29,\n];\n/**\n * Number of days in Hebrew month in a given year (29 or 30).\n *\n * Most months have a fixed length. Cheshvan and Kislev vary to absorb\n * the 353/354/355-day variation of the Hebrew year (see\n * {@link longCheshvan} and {@link shortKislev}), and Adar I has 30 days\n * in a leap year but 29 in a common year.\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @returns an integer 29-30\n * @example\n * import {daysInMonth, months} from '@hebcal/hdate';\n * daysInMonth(months.CHESHVAN, 5769); // 29\n * daysInMonth(months.KISLEV, 5769); // 30\n */\nexport function daysInMonth(month, year) {\n const d = STATIC_DAYS_IN_MONTH[month];\n if (d !== 0)\n return d;\n if (month === ADAR_I)\n return isLeapYear(year) ? 30 : 29;\n if (month === CHESHVAN)\n return longCheshvan(year) ? 30 : 29;\n return shortKislev(year) ? 29 : 30; // KISLEV\n}\n/**\n * Returns a transliterated string name of Hebrew month in year,\n * for example 'Elul' or 'Cheshvan'.\n *\n * The year matters only for the 12th month, which is named `'Adar'` in a\n * common year and `'Adar I'` in a leap year. To translate the result into\n * another locale, pass it to {@link Locale.gettext}.\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @returns transliterated month name\n * @throws {TypeError} if `month` is out of range 1-14\n * @example\n * import {getMonthName, months} from '@hebcal/hdate';\n * getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'\n * getMonthName(months.ADAR_I, 5784); // 'Adar I' (leap year)\n * getMonthName(months.ADAR_I, 5783); // 'Adar' (common year)\n */\nexport function getMonthName(month, year) {\n assertNumber(month, 'month');\n assertNumber(year, 'year');\n if (month < 1 || month > 14) {\n throw new TypeError(`bad monthNum: ${month}`);\n }\n return monthNames[+isLeapYear(year)][month];\n}\n/**\n * Days from sunday prior to start of Hebrew calendar to mean\n * conjunction of Tishrei in Hebrew YEAR, after applying the four\n * postponement rules (dechiyot) that fix Rosh Hashanah.\n *\n * This is an implementation detail of the calendar arithmetic rather\n * than a supported entry point; prefer {@link hebrew2abs} or\n * {@link daysInYear}. Results for years 5000-6999 are cached.\n * @internal\n * @param year Hebrew year\n * @returns days elapsed since the epoch\n */\nexport function elapsedDays(year) {\n if (year >= ED_CACHE_MIN && year <= ED_CACHE_MAX) {\n const idx = year - ED_CACHE_MIN;\n const n = edCache[idx];\n if (n !== 0)\n return n;\n const elapsed = elapsedDays0(year);\n edCache[idx] = elapsed;\n return elapsed;\n }\n return elapsedDays0(year);\n}\n/**\n * Days from sunday prior to start of Hebrew calendar to mean\n * conjunction of Tishrei in Hebrew YEAR\n * @private\n * @param year Hebrew year\n */\nfunction elapsedDays0(year) {\n const prevYear = year - 1;\n const mElapsed = 235 * Math.floor(prevYear / 19) + // Months in complete 19 year lunar (Metonic) cycles so far\n 12 * (prevYear % 19) + // Regular months in this cycle\n Math.floor(((prevYear % 19) * 7 + 1) / 19); // Leap months this cycle\n const pElapsed = 204 + 793 * (mElapsed % 1080);\n const hElapsed = 5 +\n 12 * mElapsed +\n 793 * Math.floor(mElapsed / 1080) +\n Math.floor(pElapsed / 1080);\n const parts = (pElapsed % 1080) + 1080 * (hElapsed % 24);\n const day = 1 + 29 * mElapsed + Math.floor(hElapsed / 24);\n let altDay = day;\n if (parts >= 19440 ||\n (2 === day % 7 && parts >= 9924 && !isLeapYear(year)) ||\n (1 === day % 7 && parts >= 16789 && isLeapYear(prevYear))) {\n altDay++;\n }\n if (altDay % 7 === 0 || altDay % 7 === 3 || altDay % 7 === 5) {\n return altDay + 1;\n }\n else {\n return altDay;\n }\n}\n/**\n * Number of days in the hebrew YEAR.\n * A common Hebrew calendar year can have a length of 353, 354 or 355 days\n * A leap Hebrew calendar year can have a length of 383, 384 or 385 days\n *\n * The three lengths within each group are deficient, regular and\n * complete years respectively; see {@link shortKislev} and\n * {@link longCheshvan} for which month absorbs the difference.\n * @param year Hebrew year\n * @returns 353-355 in a common year, 383-385 in a leap year\n * @example\n * daysInYear(5783); // 355\n * daysInYear(5784); // 383 (leap year)\n */\nexport function daysInYear(year) {\n return elapsedDays(year + 1) - elapsedDays(year);\n}\n/**\n * true if Cheshvan is long in Hebrew year.\n *\n * Cheshvan normally has 29 days, but gains a 30th in a \"complete\"\n * (שלמה) year, one of the two ways the calendar stretches a year to\n * keep Rosh Hashanah off a forbidden weekday.\n * @param year Hebrew year\n * @returns `true` if Cheshvan has 30 days\n * @example\n * longCheshvan(5783); // true\n * longCheshvan(5784); // false\n */\nexport function longCheshvan(year) {\n return daysInYear(year) % 10 === 5;\n}\n/**\n * true if Kislev is short in Hebrew year.\n *\n * Kislev normally has 30 days, but drops to 29 in a \"deficient\" (חסרה)\n * year, the counterpart to {@link longCheshvan} that shortens a year by\n * a day.\n * @param year Hebrew year\n * @returns `true` if Kislev has 29 days\n * @example\n * shortKislev(5783); // false\n * shortKislev(5784); // true\n */\nexport function shortKislev(year) {\n return daysInYear(year) % 10 === 3;\n}\n/**\n * Converts Hebrew month string name to numeric.\n *\n * Accepts transliterated names (`'Cheshvan'`, `'Sh'vat'`), Hebrew-script\n * names with or without nikud (`'חשון'`, `'תִּשְׁרֵי'`), an optional bet\n * prefix (`'בתמוז'`), and passes numbers through unchanged. Matching is\n * case-insensitive and only needs enough of the name to be unambiguous.\n * `'Adar'` resolves to Adar I; `'Adar II'` (and `'אדר ב׳'`) to Adar II.\n * @param monthName monthName\n * @returns Hebrew month number (1=NISAN, 7=TISHREI)\n * @throws {TypeError} if `monthName` is neither a string nor a number\n * @throws {RangeError} if the name is not recognized, or a numeric month\n * is outside 1-14\n * @example\n * monthFromName('Cheshvan'); // 8\n * monthFromName('חשון'); // 8\n * monthFromName('Adar II'); // 13\n * monthFromName(7); // 7 (passthrough)\n */\nexport function monthFromName(monthName) {\n if (typeof monthName === 'number') {\n if (isNaN(monthName) || monthName < 1 || monthName > 14) {\n throw new RangeError(`bad monthName: ${monthName}`);\n }\n return monthName;\n }\n if (typeof monthName !== 'string') {\n throw new TypeError(`bad monthName: ${monthName}`);\n }\n let c = monthName.trim().toLowerCase();\n // remove all niqud and trailing gershayim (for Adar Alef/Bet)\n c = hebrewStripNikkud(c).replace(/׳$/, '');\n // If Hebrew month starts with a bet (for example `בתמוז`) then ignore it\n if (c.startsWith('ב')) {\n c = c.substring(1);\n }\n /*\n the Hebrew months are unique to their second letter\n N Nisan (November?)\n I Iyyar\n E Elul\n C Cheshvan\n K Kislev\n 1 1Adar\n 2 2Adar\n Si Sh Sivan, Shvat\n Ta Ti Te Tamuz, Tishrei, Tevet\n Av Ad Av, Adar\n \n אב אד אי אל אב אדר אייר אלול\n ח חשון\n ט טבת\n כ כסלו\n נ ניסן\n ס סיון\n ש שבט\n תמ תש תמוז תשרי\n */\n switch (c[0]) {\n case 'n':\n case 'נ':\n if (c[1] === 'o') {\n break; /* this catches \"november\" */\n }\n return NISAN;\n case 'i':\n return IYYAR;\n case 'e':\n return ELUL;\n case 'c':\n case 'ח':\n return CHESHVAN;\n case 'k':\n case 'כ':\n return KISLEV;\n case 's':\n switch (c[1]) {\n case 'i':\n return SIVAN;\n case 'h':\n return SHVAT;\n default:\n break;\n }\n break;\n case 't':\n switch (c[1]) {\n case 'a':\n return TAMUZ;\n case 'i':\n return TISHREI;\n case 'e':\n return TEVET;\n default:\n break;\n }\n break;\n case 'a':\n switch (c[1]) {\n case 'v':\n return AV;\n case 'd':\n if (/(1|[^i]i|a|א)$/i.test(c)) {\n return ADAR_I;\n }\n return ADAR_II; // else assume sheini\n default:\n break;\n }\n break;\n case 'ס':\n return SIVAN;\n case 'ט':\n return TEVET;\n case 'ש':\n return SHVAT;\n case 'א':\n switch (c[1]) {\n case 'ב':\n return AV;\n case 'ד':\n if (/(1|[^i]i|a|א)$/i.test(c)) {\n return ADAR_I;\n }\n return ADAR_II; // else assume sheini\n case 'י':\n return IYYAR;\n case 'ל':\n return ELUL;\n default:\n break;\n }\n break;\n case 'ת':\n switch (c[1]) {\n case 'מ':\n return TAMUZ;\n case 'ש':\n return TISHREI;\n default:\n break;\n }\n break;\n }\n throw new RangeError(`bad monthName: ${monthName}`);\n}\n//# sourceMappingURL=hdateBase.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { hebrew2abs, abs2hebrew, isLeapYear, months, monthsInYear, shortKislev, longCheshvan, } from './hdateBase.js';\nimport { abs2greg, greg2abs, isDate } from './greg.js';\nconst NISAN = months.NISAN;\nconst CHESHVAN = months.CHESHVAN;\nconst KISLEV = months.KISLEV;\nconst TEVET = months.TEVET;\nconst SHVAT = months.SHVAT;\nconst ADAR_I = months.ADAR_I;\nconst ADAR_II = months.ADAR_II;\n/**\n * Returns true if the object is a SimpleHebrewDate\n * @private\n */\nfunction isSimpleHebrewDate(obj0) {\n const obj = obj0;\n return (typeof obj === 'object' &&\n obj !== null &&\n typeof obj.yy === 'number' &&\n typeof obj.mm === 'number' &&\n typeof obj.dd === 'number');\n}\n/**\n * Normalizes any accepted form of an event date into a `SimpleHebrewDate`.\n *\n * When the caller passes an object (a `SimpleHebrewDate` or anything\n * structurally compatible with it, such as an `HDate`), this returns a\n * copy rather than the object itself: callers keep their original event\n * date around and reuse it across years, and the anniversary functions\n * are free to modify the value they get back from here.\n * @private\n */\nfunction toSimpleHebrewDate(obj) {\n if (isSimpleHebrewDate(obj)) {\n const hd = obj;\n return { yy: hd.yy, mm: hd.mm, dd: hd.dd };\n }\n else if (isDate(obj)) {\n const abs = greg2abs(obj);\n return abs2hebrew(abs);\n }\n else {\n // typeof obj === 'number'\n return abs2hebrew(obj);\n }\n}\n/**\n * Calculates yahrzeit and converts the result to a Gregorian `Date`.\n *\n * See {@link getYahrzeitHD} for a description of the algorithm.\n * @deprecated Use {@link yahrzeit} instead, which returns an `HDate`.\n * Returning a Gregorian `Date` loses the Hebrew date that was actually\n * computed and invites a needless conversion back again; call\n * `.greg()` on the result if you really do want a `Date`.\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear` as a Gregorian date, or\n * `undefined` when `hyear` is on or before the year of death\n * @see {@link yahrzeit} to get the result as an `HDate`\n * @see {@link birthdayOrAnniversary} for birthdays and other\n * non-yahrzeit anniversaries\n * @example\n * import {getYahrzeit} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const anniversary = getYahrzeit(5780, dt); // '2/25/2020' == '30 Sh\\'vat 5780'\n */\nexport function getYahrzeit(hyear, date) {\n const hd = getYahrzeitHD(hyear, date);\n if (!hd) {\n return hd;\n }\n return abs2greg(hebrew2abs(hd.yy, hd.mm, hd.dd));\n}\n/**\n * Calculates yahrzeit, the anniversary of a death, and returns it as a\n * `SimpleHebrewDate` (`{yy, mm, dd}`).\n * `hyear` must be after original `date` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * **This is not the same calculation as a birthday.** When the original\n * date does not exist in the target year, a yahrzeit falls *earlier* —\n * on the last day of the preceding month — because the anniversary\n * should not be observed later than the day itself. A birthday in the\n * same situation is *postponed* to the first of the following month.\n * See {@link getBirthdayHD} for the contrast.\n *\n * The two also differ in whether the original year is a legal `hyear`.\n * A yahrzeit is by definition an *anniversary* of a death, so the\n * earliest one that exists is the first: the day of the death itself is\n * not a yahrzeit, and a \"zeroth\" yahrzeit has no meaning to return.\n * `hyear` must therefore be strictly after the year of death, and this\n * function returns `undefined` otherwise. A birth date, by contrast, is\n * a real and meaningful day in its own right, so\n * {@link getBirthdayHD} accepts the year of birth and hands back the\n * original date.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @see {@link yahrzeit} for the same result as an `HDate` instance\n * @example\n * import {getYahrzeitHD} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // 30 Adar I 5774\n * getYahrzeitHD(5780, dt); // {yy: 5780, mm: 11, dd: 30} (30 Sh'vat)\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear`, or `undefined`\n * when `hyear` is on or before the original year\n */\nexport function getYahrzeitHD(hyear, date) {\n let hDeath = toSimpleHebrewDate(date);\n if (hyear <= hDeath.yy) {\n // Hebrew year ${hyear} occurs on or before original date in ${hDeath.yy}\n return undefined;\n }\n if (hDeath.mm === CHESHVAN &&\n hDeath.dd === 30 &&\n !longCheshvan(hDeath.yy + 1)) {\n // If it's Heshvan 30 it depends on the first anniversary;\n // if that was not Heshvan 30, use the day before Kislev 1.\n hDeath = abs2hebrew(hebrew2abs(hyear, KISLEV, 1) - 1);\n }\n else if (hDeath.mm === KISLEV &&\n hDeath.dd === 30 &&\n shortKislev(hDeath.yy + 1)) {\n // If it's Kislev 30 it depends on the first anniversary;\n // if that was not Kislev 30, use the day before Teveth 1.\n hDeath = abs2hebrew(hebrew2abs(hyear, TEVET, 1) - 1);\n }\n else if (hDeath.mm === ADAR_II) {\n // If it's Adar II, use the same day in last month of year (Adar or Adar II).\n hDeath.mm = monthsInYear(hyear);\n }\n else if (hDeath.mm === ADAR_I && hDeath.dd === 30 && !isLeapYear(hyear)) {\n // If it's the 30th in Adar I and year is not a leap year\n // (so Adar has only 29 days), use the last day in Shevat.\n hDeath.dd = 30;\n hDeath.mm = SHVAT;\n }\n // In all other cases, use the normal anniversary of the date of death.\n // advance day to rosh chodesh if needed\n if (hDeath.mm === CHESHVAN && hDeath.dd === 30 && !longCheshvan(hyear)) {\n hDeath.mm = KISLEV;\n hDeath.dd = 1;\n }\n else if (hDeath.mm === KISLEV && hDeath.dd === 30 && shortKislev(hyear)) {\n hDeath.mm = TEVET;\n hDeath.dd = 1;\n }\n hDeath.yy = hyear;\n return hDeath;\n}\n/**\n * Calculates a birthday or anniversary (non-yahrzeit) and converts the\n * result to a Gregorian `Date`.\n *\n * See {@link getBirthdayHD} for a description of the algorithm.\n * @deprecated Use {@link birthdayOrAnniversary} instead, which returns\n * an `HDate`. Returning a Gregorian `Date` loses the Hebrew date that\n * was actually computed and invites a needless conversion back again;\n * call `.greg()` on the result if you really do want a `Date`.\n * @example\n * import {getBirthdayOrAnniversary} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const anniversary = getBirthdayOrAnniversary(5780, dt); // '3/26/2020' == '1 Nisan 5780'\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of the original event\n * @returns anniversary occurring in `hyear` as a Gregorian date, or\n * `undefined` when `hyear` precedes the original year\n * @see {@link birthdayOrAnniversary} to get the result as an `HDate`\n * @see {@link yahrzeit} for anniversaries of a death\n */\nexport function getBirthdayOrAnniversary(hyear, date) {\n const hd = getBirthdayHD(hyear, date);\n if (!hd) {\n return hd;\n }\n return abs2greg(hebrew2abs(hd.yy, hd.mm, hd.dd));\n}\n/**\n * Calculates a birthday or anniversary (non-yahrzeit) and returns it as\n * a `SimpleHebrewDate` (`{yy, mm, dd}`).\n * `hyear` must be on or after original `date` of anniversary.\n * Returns `undefined` when requested year preceeds the original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * **This is not the same calculation as a yahrzeit.** When the original\n * date is missing from the target year, a birthday is *postponed* to the\n * first of the following month, whereas a yahrzeit moves *earlier* to\n * the last day of the preceding month. Passing the same original date to\n * both functions can therefore return dates almost a month apart.\n *\n * Unlike {@link getYahrzeitHD}, `hyear` may equal the original year, in\n * which case the original date is returned unchanged. A birth date is a\n * meaningful day in its own right — it is the day the person was born,\n * not merely the zeroth anniversary of it. A death has no comparable\n * day: a yahrzeit only begins to exist on the first anniversary, which\n * is why {@link getYahrzeitHD} rejects the year of death.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @see {@link birthdayOrAnniversary} for the same result as an `HDate` instance\n * @example\n * import {getBirthdayHD} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // 30 Adar I 5774\n * getBirthdayHD(5780, dt); // {yy: 5780, mm: 1, dd: 1} (1 Nisan)\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of the original event\n * @returns anniversary occurring in `hyear`, or `undefined`\n * when `hyear` precedes the original year\n */\nexport function getBirthdayHD(hyear, date) {\n const orig = toSimpleHebrewDate(date);\n const origYear = orig.yy;\n if (hyear === origYear) {\n return orig;\n }\n else if (hyear < origYear) {\n // Hebrew year ${hyear} occurs on or before original date in ${origYear}\n return undefined;\n }\n const isOrigLeap = isLeapYear(origYear);\n let month = orig.mm;\n let day = orig.dd;\n if ((month === ADAR_I && !isOrigLeap) || (month === ADAR_II && isOrigLeap)) {\n month = monthsInYear(hyear);\n }\n else if (month === CHESHVAN && day === 30 && !longCheshvan(hyear)) {\n month = KISLEV;\n day = 1;\n }\n else if (month === KISLEV && day === 30 && shortKislev(hyear)) {\n month = TEVET;\n day = 1;\n }\n else if (month === ADAR_I &&\n day === 30 &&\n isOrigLeap &&\n !isLeapYear(hyear)) {\n month = NISAN;\n day = 1;\n }\n return { yy: hyear, mm: month, dd: day };\n}\n//# sourceMappingURL=anniversary.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nconst GERESH = '׳';\nconst GERSHAYIM = '״';\nconst heb2num = {\n א: 1,\n ב: 2,\n ג: 3,\n ד: 4,\n ה: 5,\n ו: 6,\n ז: 7,\n ח: 8,\n ט: 9,\n י: 10,\n כ: 20,\n ל: 30,\n מ: 40,\n נ: 50,\n ס: 60,\n ע: 70,\n פ: 80,\n צ: 90,\n ק: 100,\n ר: 200,\n ש: 300,\n ת: 400,\n};\nconst num2heb = {};\nfor (const [key, val] of Object.entries(heb2num)) {\n num2heb[val] = key;\n}\nfunction num2digits(num) {\n const digits = [];\n while (num > 0) {\n if (num === 15 || num === 16) {\n digits.push(9, num - 9);\n break;\n }\n let incr = 100;\n let i;\n for (i = 400; i > num; i -= incr) {\n if (i === incr) {\n incr = incr / 10;\n }\n }\n digits.push(i);\n num -= i;\n }\n return digits;\n}\n/**\n * Converts a numerical value to a string of Hebrew letters.\n *\n * When specifying years of the Hebrew calendar in the present millennium,\n * we omit the thousands (which is presently 5 [ה]).\n * @example\n * gematriya(5774) // 'תשע״ד' - cropped to 774\n * gematriya(25) // 'כ״ה'\n * gematriya(60) // 'ס׳'\n * gematriya(3761) // 'ג׳תשס״א'\n * gematriya(1123) // 'א׳קכ״ג'\n */\nexport function gematriya(num) {\n const num1 = parseInt(num, 10);\n if (!num1 || num1 < 0) {\n throw new TypeError(`invalid number: ${num}`);\n }\n let str = '';\n const thousands = Math.floor(num1 / 1000);\n if (thousands > 0 && thousands !== 5) {\n const tdigits = num2digits(thousands);\n for (const tdig of tdigits) {\n str += num2heb[tdig];\n }\n str += GERESH;\n }\n const digits = num2digits(num1 % 1000);\n if (digits.length === 1) {\n return str + num2heb[digits[0]] + GERESH;\n }\n for (let i = 0; i < digits.length; i++) {\n if (i + 1 === digits.length) {\n str += GERSHAYIM;\n }\n str += num2heb[digits[i]];\n }\n return str;\n}\n/**\n * Converts a string of Hebrew letters to a numerical value.\n *\n * Only considers the value of Hebrew letters `א` through `ת`.\n * Ignores final Hebrew letters such as `ך` (kaf sofit) or `ם` (mem sofit)\n * and vowels (nekudot).\n * @example\n * gematriyaStrToNum('תשע״ד'); // 774\n * gematriyaStrToNum('ט״ו'); // 15\n * gematriyaStrToNum('ג׳תשס״א'); // 3761 (thousands prefix)\n */\nexport function gematriyaStrToNum(str) {\n if (typeof str !== 'string') {\n throw new TypeError(`bad gematriya str: ${str}`);\n }\n let num = 0;\n const gereshIdx = str.indexOf(GERESH);\n if (gereshIdx !== -1 && gereshIdx !== str.length - 1) {\n const thousands = str.substring(0, gereshIdx);\n num += gematriyaStrToNum(thousands) * 1000;\n str = str.substring(gereshIdx);\n }\n for (const ch of str) {\n const n = heb2num[ch];\n if (typeof n === 'number') {\n num += n;\n }\n }\n return num;\n}\n//# sourceMappingURL=gematriya.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/**\n * Formats a number with leading zeros so the resulting string is 4 digits long.\n * Similar to `string.padStart(4, '0')` but will also format\n * negative numbers similar to how the JavaScript date formats\n * negative year numbers (e.g. `-37` is formatted as `-000037`).\n * @example\n * pad4(7); // '0007'\n * pad4(2024); // '2024'\n * pad4(-37); // '-000037'\n */\nexport function pad4(num) {\n if (num < 0) {\n return '-00' + pad4(-num);\n }\n else if (num < 10) {\n return '000' + num;\n }\n else if (num < 100) {\n return '00' + num;\n }\n else if (num < 1000) {\n return '0' + num;\n }\n return String(num);\n}\n/**\n * Formats a number with leading zeros so the resulting string is 2 digits long.\n * Similar to `string.padStart(2, '0')`.\n * @example\n * pad2(3); // '03'\n * pad2(11); // '11'\n */\nexport function pad2(num) {\n if (num >= 0 && num < 10) {\n return '0' + num;\n }\n return String(num);\n}\n//# sourceMappingURL=pad.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { pad2, pad4 } from './pad.js';\nconst _formatters = new Map();\n/**\n * @private\n */\nfunction getFormatter(tzid) {\n const fmt = _formatters.get(tzid);\n if (fmt)\n return fmt;\n const f = new Intl.DateTimeFormat('en-US', {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n timeZone: tzid,\n });\n _formatters.set(tzid, f);\n return f;\n}\nconst dateFormatRegex = /^(\\d+).(\\d+).(\\d+),?\\s+(\\d+).(\\d+).(\\d+)/;\n/**\n * Returns a string similar to `Date.toISOString()` but in the\n * timezone `tzid`. Contrary to the typical meaning of `Z` at the end\n * of the string, this is not actually a UTC date.\n * @example\n * const dt = new Date(Date.UTC(2021, 0, 31, 7, 30, 50));\n * getPseudoISO('UTC', dt); // '2021-01-31T07:30:50Z'\n * getPseudoISO('America/New_York', dt); // '2021-01-31T02:30:50Z'\n * getPseudoISO('Asia/Jerusalem', dt); // '2021-01-31T09:30:50Z'\n */\nexport function getPseudoISO(tzid, date) {\n const str = getFormatter(tzid).format(date);\n const m = dateFormatRegex.exec(str);\n if (m === null) {\n throw new Error(`Unable to parse formatted string: ${str}`);\n }\n let hour = m[4];\n if (hour === '24') {\n hour = '00';\n }\n m[3] = pad4(parseInt(m[3], 10));\n return `${m[3]}-${m[1]}-${m[2]}T${hour}:${m[5]}:${m[6]}Z`;\n}\n/**\n * Returns number of minutes `tzid` is offset from UTC on date `date`.\n * @example\n * const january = new Date(Date.UTC(2020, 0, 15, 12));\n * getTimezoneOffset('America/New_York', january); // 300 (UTC-5)\n * getTimezoneOffset('America/Los_Angeles', january); // 480 (UTC-8)\n * getTimezoneOffset('Asia/Jerusalem', january); // -120 (UTC+2)\n */\nexport function getTimezoneOffset(tzid, date) {\n const utcStr = getPseudoISO('UTC', date);\n const localStr = getPseudoISO(tzid, date);\n const diffMs = new Date(utcStr).getTime() - new Date(localStr).getTime();\n return Math.ceil(diffMs / 1000 / 60);\n}\n/**\n * Formats the date portion of `dt` as `YYYY-MM-DD` using the date's\n * local-time fields (year/month/day), not its UTC fields. The year is\n * always padded to at least 4 digits and negative years are prefixed\n * with `-`, matching the formatting that `pad4` applies.\n *\n * This is intentionally separate from `Date.prototype.toISOString()`,\n * which always reports in UTC and may report a different day for\n * dates near midnight in non-UTC time zones.\n * @example\n * isoDateString(new Date(2008, 10, 13)); // '2008-11-13'\n * isoDateString(new Date(2021, 0, 31)); // '2021-01-31'\n */\nexport function isoDateString(dt) {\n return (pad4(dt.getFullYear()) +\n '-' +\n pad2(dt.getMonth() + 1) +\n '-' +\n pad2(dt.getDate()));\n}\n//# sourceMappingURL=dateFormat.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nexport default { \"headers\": { \"plural-forms\": \"nplurals=2; plural=(n > 1);\", \"language\": \"und-x-ashkenaz\" }, \"contexts\": { \"\": { \"Tevet\": [\"Teves\"] } } };\n//# sourceMappingURL=ashkenazi.po.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nexport default { \"headers\": { \"plural-forms\": \"nplurals=2; plural=(n > 1);\", \"language\": \"he\" }, \"contexts\": { \"\": { \"Adar\": [\"אֲדָר\"], \"Adar I\": [\"אֲדָר א׳\"], \"Adar II\": [\"אֲדָר ב׳\"], \"Av\": [\"אָב\"], \"Cheshvan\": [\"חֶשְׁוָן\"], \"Elul\": [\"אֱלוּל\"], \"Iyyar\": [\"אִיָּיר\"], \"Kislev\": [\"כִּסְלֵו\"], \"Nisan\": [\"נִיסָן\"], \"Sh'vat\": [\"שְׁבָט\"], \"Sivan\": [\"סִיוָן\"], \"Tamuz\": [\"תַּמּוּז\"], \"Tammuz\": [\"תַּמּוּז\"], \"Tevet\": [\"טֵבֵת\"], \"Tishrei\": [\"תִּשְׁרֵי\"] } } };\n//# sourceMappingURL=he.po.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { hebrewStripNikkud } from './hebrewStripNikkud.js';\nimport poAshkenazi from './ashkenazi.po.js';\nimport poHe from './he.po.js';\nconst noopLocale = {\n headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },\n contexts: { '': {} },\n};\nconst alias = {\n h: 'he',\n a: 'ashkenazi',\n s: 'en',\n '': 'en',\n};\n/** @private */\nconst locales = new Map();\n/** @private */\nfunction getEnOrdinal(n) {\n const s = ['th', 'st', 'nd', 'rd'];\n const v = n % 100;\n return n + (s[(v - 20) % 10] || s[v] || s[0]);\n}\n/** @private */\nfunction checkLocale(locale) {\n if (typeof locale !== 'string') {\n throw new TypeError(`Invalid locale name: ${locale}`);\n }\n locale = alias[locale] || locale;\n return locale.toLowerCase();\n}\n/** @private */\nfunction getExistingLocale(locale) {\n const locale1 = checkLocale(locale);\n const loc = locales.get(locale1);\n if (!loc) {\n throw new RangeError(`Locale '${locale}' not found`);\n }\n return loc;\n}\n/**\n * A locale in Hebcal is used for translations/transliterations of\n * holidays. `@hebcal/hdate` supports four locales by default\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n * * `he-x-NoNikud` - Hebrew without nikud (e.g. \"שבת\")\n *\n * The locale set that ships here covers only what this package needs:\n * month names, a handful of connective words, and the parts of speech\n * used by {@link HDate.render}. Packages built on top of it (such as\n * `@hebcal/core`) register their own holiday translations into the same\n * locales with {@link Locale.addTranslations}.\n *\n * Every method is static — `Locale` is a namespace, not something you\n * instantiate. Locale names are matched case-insensitively, and the\n * single letters `h`, `a` and `s` are accepted as aliases for `he`,\n * `ashkenazi` and `en` respectively.\n * @example\n * import {Locale, HDate, months} from '@hebcal/hdate';\n *\n * Locale.gettext('Cheshvan', 'he'); // 'חֶשְׁוָן'\n * Locale.gettext('Cheshvan', 'ashkenazi'); // 'Cheshvan'\n * Locale.ordinal(15, 'en'); // '15th'\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * hd.render('en'); // '15th of Cheshvan, 5769'\n * hd.render('he'); // '15 חֶשְׁוָן, 5769'\n */\nexport class Locale {\n /**\n * Returns translation only if `locale` offers a non-empty translation for `id`.\n * Otherwise, returns `undefined`.\n * @param id Message ID to translate\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.\n * @example\n * Locale.lookupTranslation('Adar II', 'he-x-NoNikud'); // 'אדר ב׳'\n * Locale.lookupTranslation('Foobar', 'he-x-NoNikud'); // undefined\n */\n static lookupTranslation(id, locale) {\n const loc = (typeof locale === 'string' && locales.get(checkLocale(locale))) ||\n noopLocale.contexts[''];\n const array = loc[id];\n if (array?.length && array[0].length) {\n return array[0];\n }\n return undefined;\n }\n /**\n * By default, if no translation was found, returns `id`.\n * @param id Message ID to translate\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.\n * @example\n * Locale.gettext('Elul', 'he'); // 'אֱלוּל'\n * Locale.gettext('Tevet', 'ashkenazi'); // 'Teves'\n * Locale.gettext('Unknown', 'he'); // 'Unknown' (falls back to id)\n */\n static gettext(id, locale) {\n const text = this.lookupTranslation(id, locale);\n if (text === undefined) {\n return id;\n }\n return text;\n }\n /**\n * Register locale translations, replacing the locale entirely if it\n * was already registered. Use {@link Locale.addTranslations} to merge\n * into an existing locale instead.\n * @param locale Locale name (i.e.: `'he'`, `'fr'`)\n * @param data parsed data from a `.po` file.\n * @throws {TypeError} if `data` is not in the compact `.po` format\n * @example\n * import {Locale} from '@hebcal/hdate';\n * // typically `import poFr from './fr.po'` — inlined here for clarity\n * const poFr = {headers: {}, contexts: {'': {Shabbat: ['Chabbat']}}};\n * Locale.addLocale('fr', poFr);\n * Locale.gettext('Shabbat', 'fr'); // 'Chabbat'\n */\n static addLocale(locale, data) {\n locale = checkLocale(locale);\n const ctx = data.contexts;\n if (typeof ctx !== 'object' || typeof ctx[''] !== 'object') {\n throw new TypeError(`Locale '${locale}' invalid compact format`);\n }\n locales.set(locale, ctx['']);\n }\n /**\n * Adds a translation to `locale`, replacing any previous translation.\n * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @param id Message ID to translate\n * @param translation Translation text\n * @example\n * Locale.addTranslation('ashkenazi', 'Foobar', 'Quux');\n * Locale.gettext('Foobar', 'ashkenazi'); // 'Quux'\n */\n static addTranslation(locale, id, translation) {\n const loc = getExistingLocale(locale);\n if (typeof id !== 'string' || id.length === 0) {\n throw new TypeError(`Invalid id string: ${id}`);\n }\n const isArray = Array.isArray(translation);\n if (isArray) {\n const t0 = translation[0];\n if (typeof t0 !== 'string' || t0.length === 0) {\n throw new TypeError(`Invalid translation array: ${translation}`);\n }\n }\n else if (typeof translation !== 'string') {\n throw new TypeError(`Invalid translation string: ${translation}`);\n }\n loc[id] = isArray ? translation : [translation];\n }\n /**\n * Adds multiple translations to `locale`, replacing any previous translations.\n *\n * The locale must already be registered (typically via `addLocale`);\n * to register a brand-new locale instead, call `addLocale` directly.\n * Use this method to merge an additional `.po` file (e.g. holiday\n * translations supplied by a separate `@hebcal/*` package) into an\n * existing locale.\n * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @param data parsed data from a `.po` file.\n * @throws {RangeError} if `locale` has not been registered\n * @throws {TypeError} if `data` is not in the compact `.po` format\n * @example\n * import {Locale} from '@hebcal/hdate';\n * Locale.addTranslations('ashkenazi', {\n * headers: {},\n * contexts: {'': {Sukkot: ['Sukkos'], Shavuot: ['Shavuos']}},\n * });\n * Locale.gettext('Sukkot', 'ashkenazi'); // 'Sukkos'\n * Locale.gettext('Tevet', 'ashkenazi'); // 'Teves' (existing translations kept)\n */\n static addTranslations(locale, data) {\n const loc = getExistingLocale(locale);\n const ctx = data.contexts;\n if (typeof ctx !== 'object' || typeof ctx[''] !== 'object') {\n throw new TypeError(`Locale '${locale}' invalid compact format`);\n }\n Object.assign(loc, ctx['']);\n }\n /**\n * Returns the names of registered locales\n * @example\n * Locale.getLocaleNames(); // ['ashkenazi', 'en', 'he', 'he-x-nonikud']\n */\n static getLocaleNames() {\n const keys = Array.from(locales.keys());\n return keys.sort((a, b) => a.localeCompare(b));\n }\n /**\n * Checks whether a locale has been registered\n * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @example\n * Locale.hasLocale('he'); // true\n * Locale.hasLocale('fr'); // false\n */\n static hasLocale(locale) {\n const locale1 = checkLocale(locale);\n return locales.has(locale1);\n }\n /**\n * Renders a number in ordinal, such as 1st, 2nd or 3rd\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to no-op locale.\n * @example\n * Locale.ordinal(3, 'en'); // '3rd'\n * Locale.ordinal(3, 'es'); // '3º'\n * Locale.ordinal(3, 'fr'); // '3.'\n * Locale.ordinal(3, 'he'); // '3'\n */\n static ordinal(n, locale) {\n const locale1 = checkLocale(locale || '');\n if (locale1 === 'en' || locale1.startsWith('ashkenazi')) {\n return getEnOrdinal(n);\n }\n else if (Locale.isHebrewLocale(locale1)) {\n return String(n);\n }\n else if (locale1 === 'es') {\n return n + 'º';\n }\n return n + '.';\n }\n /**\n * Removes nekudot from Hebrew string\n * @example\n * Locale.hebrewStripNikkud('אֱלוּל'); // 'אלול'\n */\n static hebrewStripNikkud(str) {\n return hebrewStripNikkud(str);\n }\n /**\n * Returns a new `LocaleData` derived from `data` with niqqud (vowel\n * points) stripped from every translation value. The input is not\n * modified.\n *\n * This is the helper used internally to build the `he-x-NoNikud`\n * locale from `he`; call it when registering a derived \"no nikud\"\n * variant of a custom Hebrew-script locale.\n * @param data locale data to copy\n * @returns a new `LocaleData` with niqqud removed\n * @see {@link Locale.hebrewStripNikkud}\n * @example\n * import {Locale} from '@hebcal/hdate';\n * const withNikud = {\n * headers: {},\n * contexts: {'': {Elul: ['אֱלוּל']}},\n * };\n * const stripped = Locale.copyLocaleNoNikud(withNikud);\n * stripped.contexts[''].Elul[0]; // 'אלול'\n * withNikud.contexts[''].Elul[0]; // 'אֱלוּל' (input unchanged)\n */\n static copyLocaleNoNikud(data) {\n const strs = data.contexts[''];\n const m = {};\n for (const [key, val] of Object.entries(strs)) {\n m[key] = [hebrewStripNikkud(val[0])];\n }\n return {\n headers: data.headers,\n contexts: { '': m },\n };\n }\n /**\n * Returns true if `locale` is a Hebrew locale (i.e. `he` or `he-x-NoNikud`)\n * @example\n * Locale.isHebrewLocale('he'); // true\n * Locale.isHebrewLocale('he-x-NoNikud'); // true\n * Locale.isHebrewLocale('en'); // false\n */\n static isHebrewLocale(locale) {\n if (typeof locale !== 'string') {\n return false;\n }\n locale = alias[locale] || locale;\n locale = locale.toLowerCase();\n return locale.startsWith('he');\n }\n}\nLocale.addLocale('en', noopLocale);\n/* Ashkenazic transliterations */\nLocale.addLocale('ashkenazi', poAshkenazi);\n/* Hebrew with nikkud */\nLocale.addLocale('he', poHe);\n/* Hebrew without nikkud */\nconst poHeNoNikud = Locale.copyLocaleNoNikud(poHe);\nLocale.addLocale('he-x-NoNikud', poHeNoNikud);\n//# sourceMappingURL=locale.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport { abs2hebrew, daysInMonth, daysInYear, getMonthName, hebrew2abs, isLeapYear, longCheshvan, monthFromName, months, monthsInYear, shortKislev, } from './hdateBase.js';\nimport { abs2greg, greg2abs, isDate } from './greg.js';\nimport { gematriya, gematriyaStrToNum } from './gematriya.js';\nimport { Locale } from './locale.js';\nfunction mod(x, y) {\n return x - y * Math.floor(x / y);\n}\nfunction isSimpleHebrewDate(obj) {\n return obj.yy !== undefined;\n}\nconst UNITS_DAY = 'day';\nconst UNITS_WEEK = 'week';\nconst UNITS_MONTH = 'month';\nconst UNITS_YEAR = 'year';\n/**\n * A `HDate` represents a Hebrew calendar date.\n *\n * An instance of this class encapsulates a date in the Hebrew calendar system.\n * It consists of a year, month, and day, without any associated time or location data.\n * The Hebrew calendar is a lunisolar calendar, meaning it is based on both lunar and solar cycles.\n *\n * A Hebrew date internally stores three numbers:\n * - year: The Hebrew year (1-9999). Counted from the traditional Hebrew date of creation (3761 BCE in the Gregorian calendar)\n * - month: The Hebrew month (1-13). Month 1 is Nisan, month 7 is Tishrei. There are 12 months in a regular year and 13 months in a leap year.\n * - day: The day of the month (1-30)\n *\n * This class uses Rata Die to convert between the Hebrew and Gregorian calendars.\n *\n * To calculate times of day, use `Zmanim` class from `@hebcal/core`\n * @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}\n * @see {@link https://hebcal.github.io/api/core/classes/Zmanim.html | Zmanim}\n */\nexport class HDate {\n /** Hebrew year, 1-9999 */\n yy;\n /** Hebrew month of year (1=NISAN, 7=TISHREI) */\n mm;\n /** Hebrew day within the month (1-30) */\n dd;\n /** absolute Rata Die (R.D.) days */\n rd;\n /**\n * Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.\n *\n * 1. No parameters - represents the current Hebrew date at time of instantiation\n * 2. One parameter\n * * `Date` - represents the Hebrew date corresponding to the Gregorian date using\n * local time. Hours, minutes, seconds and milliseconds are ignored.\n * * `HDate` - clones a copy of the given Hebrew date\n * * `number` - Converts absolute R.D. days to Hebrew date.\n * R.D. 1 == the imaginary date January 1, 1 (Gregorian)\n * 3. Three parameters: Hebrew day, Hebrew month, Hebrew year. Hebrew day should\n * be a number between 1-30, Hebrew month can be a number or string, and\n * Hebrew year is always a number.\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate();\n * const hd2 = new HDate(new Date(2008, 10, 13));\n * const hd3 = new HDate(15, 'Cheshvan', 5769);\n * const hd4 = new HDate(15, months.CHESHVAN, 5769);\n * const hd5 = new HDate(733359); // ==> 15 Cheshvan 5769\n * const monthName = 'אייר';\n * const hd6 = new HDate(5, monthName, 5773);\n * @param [day] - Day of month (1-30) if a `number`.\n * If a `Date` is specified, represents the Hebrew date corresponding to the\n * Gregorian date using local time.\n * If an `HDate` is specified, clones a copy of the given Hebrew date.\n * @param [month] - Hebrew month of year (1=NISAN, 7=TISHREI)\n * @param [year] - Hebrew year\n */\n constructor(day, month, year) {\n if (arguments.length === 2 || arguments.length > 3) {\n throw new TypeError('HDate constructor requires 0, 1 or 3 arguments');\n }\n if (arguments.length === 3) {\n // Hebrew day, Hebrew month, Hebrew year\n this.dd = this.mm = 1;\n const yy = typeof year === 'string' ? parseInt(year, 10) : year;\n if (isNaN(yy)) {\n throw new TypeError(`HDate called with bad year: ${year}`);\n }\n this.yy = yy;\n setMonth(this, month); // will throw if we can't parse\n const dd = typeof day === 'string' ? parseInt(day, 10) : day;\n if (isNaN(dd)) {\n throw new TypeError(`HDate called with bad day: ${day}`);\n }\n setDate(this, dd);\n }\n else {\n // 0 arguments\n if (day === undefined || day === null) {\n day = new Date();\n }\n // 1 argument\n const abs0 = typeof day === 'number' && !isNaN(day)\n ? day\n : isDate(day)\n ? greg2abs(day)\n : isSimpleHebrewDate(day)\n ? day\n : null;\n if (abs0 === null) {\n throw new TypeError(`HDate called with bad arg: ${day}`);\n }\n const isNumber = typeof abs0 === 'number';\n const d = isNumber ? abs2hebrew(abs0) : abs0;\n this.yy = d.yy;\n this.mm = d.mm;\n this.dd = d.dd;\n if (isNumber) {\n this.rd = abs0;\n }\n }\n }\n /**\n * Returns the Hebrew year of this Hebrew date\n * @returns an integer >= 1\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getFullYear(); // 5769\n */\n getFullYear() {\n return this.yy;\n }\n /**\n * Returns `true` if this Hebrew date occurs during a Hebrew leap year\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.isLeapYear(); // false\n */\n isLeapYear() {\n return isLeapYear(this.yy);\n }\n /**\n * Returns the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date\n * @returns an integer 1-13\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getMonth(); // 8\n */\n getMonth() {\n return this.mm;\n }\n /**\n * The Tishrei-based month of this Hebrew date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year\n * @returns an integer 1-13\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getTishreiMonth(); // 2\n */\n getTishreiMonth() {\n const nummonths = monthsInYear(this.getFullYear());\n return (this.getMonth() + nummonths - 6) % nummonths || nummonths;\n }\n /**\n * Number of days in the month of this Hebrew date (29 or 30)\n * @returns an integer 29-30\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.daysInMonth(); // 29\n */\n daysInMonth() {\n return daysInMonth(this.getMonth(), this.getFullYear());\n }\n /**\n * Gets the day within the month (1-30)\n * @returns an integer 1-30\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getDate(); // 15\n */\n getDate() {\n return this.dd;\n }\n /**\n * Returns the day of the week for this Hebrew date,\n * where 0 represents Sunday, 1 represents Monday, 6 represents Saturday.\n *\n * For the day of the month, see `getDate()`\n * @returns an integer 0-6\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getDay(); // 4 (Thursday)\n */\n getDay() {\n return mod(this.abs(), 7);\n }\n /**\n * Converts this Hebrew date to the corresponding Gregorian date.\n *\n * The returned `Date` object will be in the local (i.e. host system) time zone.\n * Hours, minutes, seconds and milliseconds will all be zero.\n *\n * Note that this function returns the daytime portion of the date.\n * For example, the 15th of Cheshvan 5769 began at sundown on\n * 12 November 2008 and continues through 13 November 2008. This\n * function would return only the date 13 November 2008.\n * @example\n * const hd = new HDate(15, 'Cheshvan', 5769);\n * const date = hd.greg(); // 13 November 2008\n * const year = date.getFullYear(); // 2008\n * const monthNum = date.getMonth() + 1; // 11\n * const day = date.getDate(); // 13\n */\n greg() {\n return abs2greg(this.abs());\n }\n /**\n * Converts from Hebrew date representation to R.D. (Rata Die) fixed days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).\n * Note also that R.D. = Julian Date − 1,721,424.5\n * @see {@link https://en.wikipedia.org/wiki/Rata_Die | Rata Die}\n * @example\n * const hd = new HDate(15, 'Cheshvan', 5769);\n * hd.abs(); // 733359\n */\n abs() {\n if (typeof this.rd !== 'number') {\n this.rd = hebrew2abs(this.yy, this.mm, this.dd);\n }\n return this.rd;\n }\n /**\n * Converts Hebrew date to R.D. (Rata Die) fixed days.\n * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian\n * Calendar.\n * @param year Hebrew year\n * @param month Hebrew month (1=NISAN, 7=TISHREI)\n * @param day Hebrew date (1-30)\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.hebrew2abs(5769, months.CHESHVAN, 15); // 733359\n */\n static hebrew2abs(year, month, day) {\n return hebrew2abs(year, month, day);\n }\n /**\n * Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.getMonthName(); // 'Cheshvan'\n */\n getMonthName() {\n return getMonthName(this.getMonth(), this.getFullYear());\n }\n /**\n * Renders this Hebrew date as a translated or transliterated string,\n * including ordinal e.g. `'15th of Cheshvan, 5769'`.\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * console.log(hd.render('en')); // '15th of Cheshvan, 5769'\n * console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'\n * console.log(hd.render('en', false)); // '15th of Cheshvan'\n * console.log(hd.render('he', false)); // '15 חֶשְׁוָן'\n * @param [locale] Optional locale name (defaults to active locale).\n * @param [showYear=true] Display year (defaults to true).\n * @see {@link Locale}\n */\n render(locale, showYear = true) {\n const locale0 = locale || 'en';\n const day = this.getDate();\n const monthName0 = Locale.gettext(this.getMonthName(), locale0);\n const monthName = monthName0.replace(/'/g, '’');\n const nth = Locale.ordinal(day, locale0);\n const dayOf = getDayOfTranslation(locale0);\n const dateStr = `${nth}${dayOf} ${monthName}`;\n if (showYear) {\n const fullYear = this.getFullYear();\n return `${dateStr}, ${fullYear}`;\n }\n else {\n return dateStr;\n }\n }\n /**\n * Renders this Hebrew date in Hebrew gematriya, regardless of locale.\n * @param suppressNikud - suppress nekudot (default false)\n * @param suppressYear - suppress Hebrew year (default false)\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * hd.renderGematriya(); // 'ט״ו חֶשְׁוָן תשס״ט'\n * hd.renderGematriya(true); // 'ט״ו חשון תשס״ט'\n * hd.renderGematriya(false, true); // 'ט״ו חֶשְׁוָן'\n */\n renderGematriya(suppressNikud = false, suppressYear = false) {\n const d = this.getDate();\n const locale = suppressNikud ? 'he-x-NoNikud' : 'he';\n const m = Locale.gettext(this.getMonthName(), locale);\n const prefix = gematriya(d) + ' ' + m;\n if (suppressYear) {\n return prefix;\n }\n const y = this.getFullYear();\n return prefix + ' ' + gematriya(y);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **before** this Hebrew date.\n *\n * Strictly before: if this date already falls on `dayOfWeek`, the\n * previous occurrence a week earlier is returned.\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * wed.before(6).greg().toDateString(); // 'Sat Feb 15 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n before(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, -1);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **on or before** this Hebrew date\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const sat = new HDate(new Date('Saturday February 22, 2014'));\n * const sun = new HDate(new Date('Sunday February 23, 2014'));\n * wed.onOrBefore(6).greg().toDateString(); // 'Sat Feb 15 2014'\n * sat.onOrBefore(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sun.onOrBefore(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n onOrBefore(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 0);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **nearest** to this Hebrew date.\n *\n * Ties are broken forward: a date exactly 3 days from `dayOfWeek` in\n * both directions resolves to the later one.\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const tue = new HDate(new Date('Tuesday February 18, 2014'));\n * wed.nearest(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * tue.nearest(6).greg().toDateString(); // 'Sat Feb 15 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n nearest(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 3);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **on or after** this Hebrew date\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const sat = new HDate(new Date('Saturday February 22, 2014'));\n * const sun = new HDate(new Date('Sunday February 23, 2014'));\n * wed.onOrAfter(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sat.onOrAfter(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sun.onOrAfter(6).greg().toDateString(); // 'Sat Mar 01 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n onOrAfter(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 6);\n }\n /**\n * Returns an `HDate` corresponding to the specified day of week\n * **after** this Hebrew date.\n *\n * Strictly after: if this date already falls on `dayOfWeek`, the next\n * occurrence a week later is returned.\n * @example\n * const wed = new HDate(new Date('Wednesday February 19, 2014'));\n * const sat = new HDate(new Date('Saturday February 22, 2014'));\n * const sun = new HDate(new Date('Sunday February 23, 2014'));\n * wed.after(6).greg().toDateString(); // 'Sat Feb 22 2014'\n * sat.after(6).greg().toDateString(); // 'Sat Mar 01 2014'\n * sun.after(6).greg().toDateString(); // 'Sat Mar 01 2014'\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @returns a new `HDate`; the original is not modified\n */\n after(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 7);\n }\n /**\n * Returns the next Hebrew date\n * @returns a new `HDate` one day later; the original is not modified\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.next().toString(); // '16 Cheshvan 5769'\n */\n next() {\n return new HDate(this.abs() + 1);\n }\n /**\n * Returns the previous Hebrew date\n * @returns a new `HDate` one day earlier; the original is not modified\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.prev().toString(); // '14 Cheshvan 5769'\n */\n prev() {\n return new HDate(this.abs() - 1);\n }\n /**\n * Returns a cloned `HDate` object with a specified amount of time added\n *\n * Units are case insensitive, and support plural and short forms.\n * Note, short forms are case sensitive.\n *\n * | Unit | Shorthand | Description\n * | --- | --- | --- |\n * | `day` | `d` | days |\n * | `week` | `w` | weeks |\n * | `month` | `M` | months |\n * | `year` | `y` | years |\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate(15, months.CHESHVAN, 5769);\n * hd1.add(7, 'd').toString(); // '22 Cheshvan 5769'\n * hd1.add(1, 'weeks').toString(); // '22 Cheshvan 5769'\n * hd1.add(1, 'year').toString(); // '15 Cheshvan 5770'\n * @param amount number of units to add (negative values subtract)\n * @param [units=d] unit of time, defaults to days\n * @returns a new `HDate`; the original is not modified\n * @throws {TypeError} if `units` is not a recognized unit of time\n */\n add(amount, units = 'd') {\n amount = typeof amount === 'string' ? parseInt(amount, 10) : amount;\n if (!amount) {\n return new HDate(this);\n }\n units = standardizeUnits(units);\n if (units === UNITS_DAY) {\n return new HDate(this.abs() + amount);\n }\n else if (units === UNITS_WEEK) {\n return new HDate(this.abs() + 7 * amount);\n }\n else if (units === UNITS_YEAR) {\n return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + amount);\n }\n else {\n // units === UNITS_MONTH\n let hd = new HDate(this);\n const sign = amount > 0 ? 1 : -1;\n amount = Math.abs(amount);\n for (let i = 0; i < amount; i++) {\n hd = new HDate(hd.abs() + sign * hd.daysInMonth());\n }\n return hd;\n }\n }\n /**\n * Returns a cloned `HDate` object with a specified amount of time subracted\n *\n * Units are case insensitive, and support plural and short forms.\n * Note, short forms are case sensitive.\n *\n * | Unit | Shorthand | Description\n * | --- | --- | --- |\n * | `day` | `d` | days |\n * | `week` | `w` | weeks |\n * | `month` | `M` | months |\n * | `year` | `y` | years |\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate(15, months.CHESHVAN, 5769);\n * hd1.subtract(1, 'weeks').toString(); // '8 Cheshvan 5769'\n * hd1.subtract(3, 'M').toString(); // '16 Av 5768'\n * @param amount number of units to subtract (negative values add)\n * @param [units=d] unit of time, defaults to days\n * @returns a new `HDate`; the original is not modified\n * @throws {TypeError} if `units` is not a recognized unit of time\n */\n subtract(amount, units = 'd') {\n return this.add(amount * -1, units);\n }\n /**\n * Returns the difference in days between the two given HDates.\n *\n * The result is positive if `this` date is comes chronologically\n * after the `other` date, and negative\n * if the order of the two dates is reversed.\n *\n * The result is zero if the two dates are identical.\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n *\n * const hd1 = new HDate(25, months.KISLEV, 5770);\n * const hd2 = new HDate(15, months.CHESHVAN, 5769);\n * const days = hd1.deltaDays(hd2); // 394\n * @param other Hebrew date to compare\n */\n deltaDays(other) {\n return this.abs() - other.abs();\n }\n /**\n * Compares this Hebrew date to another date, returning `true` if the dates match.\n * @param other Hebrew date to compare\n * @example\n * const hd1 = new HDate(new Date(2008, 10, 13));\n * const hd2 = new HDate(15, 'Cheshvan', 5769);\n * hd1.isSameDate(hd2); // true\n */\n isSameDate(other) {\n return this.yy === other.yy && this.mm === other.mm && this.dd === other.dd;\n }\n /**\n * Returns a string representation of this Hebrew date using English transliterations\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.toString(); // '15 Cheshvan 5769'\n */\n toString() {\n const day = this.getDate();\n const fullYear = this.getFullYear();\n const monthName = this.getMonthName();\n return `${day} ${monthName} ${fullYear}`;\n }\n /**\n * Returns true if Hebrew year is a leap year\n * @param year Hebrew year\n * @example\n * HDate.isLeapYear(5783); // false\n * HDate.isLeapYear(5784); // true\n */\n static isLeapYear(year) {\n return isLeapYear(year);\n }\n /**\n * Number of months in this Hebrew year (either 12 or 13 depending on leap year)\n * @param year Hebrew year\n * @example\n * HDate.monthsInYear(5783); // 12\n * HDate.monthsInYear(5784); // 13\n */\n static monthsInYear(year) {\n return monthsInYear(year);\n }\n /**\n * Number of days in Hebrew month in a given year (29 or 30)\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.daysInMonth(months.CHESHVAN, 5769); // 29\n */\n static daysInMonth(month, year) {\n return daysInMonth(month, year);\n }\n /**\n * Returns a transliterated string name of Hebrew month in year,\n * for example 'Elul' or 'Cheshvan'.\n * @param month Hebrew month (e.g. months.TISHREI)\n * @param year Hebrew year\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'\n */\n static getMonthName(month, year) {\n return getMonthName(month, year);\n }\n /**\n * Returns the Hebrew month number (NISAN=1, TISHREI=7)\n * @param month A number, or Hebrew month name string\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.monthNum(months.CHESHVAN); // 8\n * HDate.monthNum('Cheshvan'); // 8\n * HDate.monthNum('חשון'); // 8\n */\n static monthNum(month) {\n if (typeof month === 'number') {\n if (isNaN(month) || month > 14) {\n throw new RangeError(`bad monthNum: ${month}`);\n }\n return month;\n }\n if (typeof month !== 'string') {\n throw new TypeError(`bad monthNum: ${month}`);\n }\n return month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 /* number */\n ? parseInt(month, 10)\n : monthFromName(month);\n }\n /**\n * Number of days in the Hebrew year.\n * Regular years can have 353, 354, or 355 days.\n * Leap years can have 383, 384, or 385 days.\n * @param year Hebrew year\n * @example\n * HDate.daysInYear(5783); // 355\n * HDate.daysInYear(5784); // 383\n */\n static daysInYear(year) {\n return daysInYear(year);\n }\n /**\n * true if Cheshvan is long in Hebrew year\n * @param year Hebrew year\n * @example\n * HDate.longCheshvan(5783); // true\n * HDate.longCheshvan(5784); // false\n */\n static longCheshvan(year) {\n return longCheshvan(year);\n }\n /**\n * true if Kislev is short in Hebrew year\n * @param year Hebrew year\n * @example\n * HDate.shortKislev(5783); // false\n * HDate.shortKislev(5784); // true\n */\n static shortKislev(year) {\n return shortKislev(year);\n }\n /**\n * Converts Hebrew month string name to numeric\n * @example\n * import {HDate, months} from '@hebcal/hdate';\n * HDate.monthFromName(months.CHESHVAN); // 8\n * HDate.monthFromName('Cheshvan'); // 8\n * HDate.monthFromName('חשון'); // 8\n */\n static monthFromName(monthName) {\n return monthFromName(monthName);\n }\n /**\n * Convenience function for determining the R.D. date\n * near a specified R.D. date, corresponding to the specified day of week.\n *\n * Note: Applying this function to d+6 gives us the `dayOfWeek` on or after an\n * absolute day d. Similarly, applying it to d+3 gives the `dayOfWeek` nearest to\n * absolute date d, applying it to d-1 gives the `dayOfWeek` previous to absolute\n * date d, and applying it to d+7 gives the `dayOfWeek` following absolute date d.\n *\n * The instance methods {@link HDate.before}, {@link HDate.onOrBefore},\n * {@link HDate.nearest}, {@link HDate.onOrAfter} and {@link HDate.after}\n * wrap this with those offsets already applied.\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n * @param absdate R.D. number of days\n * @returns R.D. number of days\n * @example\n * import {HDate} from '@hebcal/hdate';\n * // 733359 is Thursday 13 November 2008\n * HDate.dayOnOrBefore(6, 733359); // 733354 (Saturday 8 November 2008)\n * HDate.dayOnOrBefore(6, 733359 + 6); // 733361 (Saturday 15 November 2008)\n */\n static dayOnOrBefore(dayOfWeek, absdate) {\n // Use a floored modulo: R.D. numbers are negative before the common\n // era, and JavaScript's `%` truncates toward zero, which would return\n // a day *after* absdate for those negative inputs.\n return absdate - mod(absdate - dayOfWeek, 7);\n }\n /**\n * Tests if the object is an instance of `HDate`\n * @example\n * HDate.isHDate(new HDate()); // true\n * HDate.isHDate(new Date()); // false\n * HDate.isHDate(null); // false\n * HDate.isHDate(12345); // false\n * HDate.isHDate('15 Cheshvan 5769'); // false\n */\n static isHDate(obj0) {\n const obj = obj0;\n return (obj !== null &&\n typeof obj === 'object' &&\n typeof obj.yy === 'number' &&\n typeof obj.mm === 'number' &&\n typeof obj.dd === 'number' &&\n typeof obj.greg === 'function' &&\n typeof obj.abs === 'function');\n }\n /**\n * Construct a new instance of `HDate` from a Gematriya-formatted string.\n *\n * The string must have the form day-month-year, with the month name\n * written in Hebrew script (nikud optional, an optional bet prefix\n * allowed). A year below 1000 is assumed to omit the thousands and has\n * `currentThousands` added to it.\n * @param str Hebrew date in gematriya, e.g. `'כ״ז בְּתַמּוּז תשפ״ג'`\n * @param [currentThousands=5000] added to a year below 1000\n * @returns the parsed Hebrew date\n * @throws {TypeError} if `str` is not a string\n * @throws {RangeError} if `str` is not 3 or 4 space-separated parts,\n * or the month name is not recognized\n * @example\n * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג').toString(); // '27 Tamuz 5783'\n * HDate.fromGematriyaString('כ׳ סיון תש״ד').toString(); // '20 Sivan 5704'\n * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח').toString(); // '5 Iyyar 5708'\n */\n static fromGematriyaString(str, currentThousands = 5000) {\n if (typeof str !== 'string') {\n throw new TypeError(`bad gematriya str: ${str}`);\n }\n const parts = str.split(' ').filter(x => x.length !== 0);\n const numParts = parts.length;\n if (numParts !== 3 && numParts !== 4) {\n throw new RangeError(`cannot parse gematriya str: \"${str}\"`);\n }\n const day = gematriyaStrToNum(parts[0]);\n const monthStr = numParts === 3 ? parts[1] : parts[1] + ' ' + parts[2];\n const month = monthFromName(monthStr);\n const yearStr = numParts === 3 ? parts[2] : parts[3];\n let year = gematriyaStrToNum(yearStr);\n if (year < 1000) {\n year += currentThousands;\n }\n return new HDate(day, month, year);\n }\n}\nfunction standardizeUnits(units) {\n switch (units) {\n case 'd':\n return UNITS_DAY;\n case 'w':\n return UNITS_WEEK;\n case 'M':\n return UNITS_MONTH;\n case 'y':\n return UNITS_YEAR;\n }\n const str = String(units || '')\n .toLowerCase()\n .replace(/s$/, '');\n switch (str) {\n case UNITS_DAY:\n case UNITS_WEEK:\n case UNITS_MONTH:\n case UNITS_YEAR:\n return str;\n }\n throw new TypeError(`Invalid units '${units}'`);\n}\nfunction getDayOfTranslation(locale) {\n switch (locale) {\n case 'en':\n case 's':\n case 'a':\n case 'ashkenazi':\n return ' of';\n default:\n break;\n }\n const ofStr = Locale.lookupTranslation('of', locale);\n if (ofStr) {\n return ' ' + ofStr;\n }\n if (locale.startsWith('ashkenazi')) {\n return ' of';\n }\n return '';\n}\n/**\n * Sets the day of the month of the date. Returns the object it was called upon\n * @private\n * @param month A number, or Hebrew month name string\n */\nfunction setMonth(hd, month) {\n hd.mm = HDate.monthNum(month);\n fix(hd);\n return hd;\n}\nfunction setDate(hd, date) {\n hd.dd = date;\n fix(hd);\n return hd;\n}\nfunction fix(hd) {\n fixMonth(hd);\n fixDate(hd);\n}\nfunction fixDate(hd) {\n if (hd.dd < 1) {\n if (hd.mm === months.TISHREI) {\n hd.yy -= 1;\n }\n hd.dd += daysInMonth(hd.mm, hd.yy);\n hd.mm -= 1;\n fix(hd);\n }\n if (hd.dd > daysInMonth(hd.mm, hd.yy)) {\n if (hd.mm === months.ELUL) {\n hd.yy += 1;\n }\n hd.dd -= daysInMonth(hd.mm, hd.yy);\n if (hd.mm === monthsInYear(hd.yy)) {\n hd.mm = 1; // rollover to NISAN\n }\n else {\n hd.mm += 1;\n }\n fix(hd);\n }\n fixMonth(hd);\n}\nfunction fixMonth(hd) {\n if (hd.mm === months.ADAR_II && !hd.isLeapYear()) {\n hd.mm -= 1; // to Adar I\n fix(hd);\n }\n else if (hd.mm < 1) {\n hd.mm += monthsInYear(hd.yy);\n hd.yy -= 1;\n fix(hd);\n }\n else if (hd.mm > monthsInYear(hd.yy)) {\n hd.mm -= monthsInYear(hd.yy);\n hd.yy += 1;\n fix(hd);\n }\n delete hd.rd;\n}\nfunction onOrBefore(day, t, offset) {\n return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));\n}\n//# sourceMappingURL=hdate.js.map","/*! @hebcal/hdate v0.22.8, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { getBirthdayHD, getYahrzeitHD } from './anniversary.js';\nimport { HDate } from './hdate.js';\n/**\n * Calculates yahrzeit, the anniversary of a death, and returns it as an\n * {@link HDate}.\n *\n * Same calculation as {@link getYahrzeitHD}, but the result comes back\n * as an `HDate` instance rather than a plain `{yy, mm, dd}` object, so it\n * can be rendered (`render`, `renderGematriya`) or used for further\n * Hebrew calendar arithmetic directly.\n *\n * Note that a yahrzeit is *not* calculated the same way as a birthday:\n * when the original date is missing from `hyear` it moves earlier rather\n * than later. See {@link getYahrzeitHD} for the full algorithm and its\n * edge cases (Marcheshvan 30, Kislev 30, Adar I / Adar II).\n *\n * `hyear` must be strictly after the year of death. A yahrzeit is an\n * *anniversary* of a death, so the first one is the earliest that\n * exists — the day of the death itself is not a yahrzeit, and there is\n * no meaningful \"zeroth\" one to return. This is the one place where\n * {@link birthdayOrAnniversary} legitimately accepts a year that this\n * function rejects: a birth date is a real day in its own right.\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear`, or `undefined` when `hyear`\n * is on or before the year of death\n * @see {@link getYahrzeitHD}\n * @see {@link birthdayOrAnniversary}\n * @example\n * import {yahrzeit} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * yahrzeit(5780, dt)?.toString(); // '30 Sh\\'vat 5780'\n * yahrzeit(5780, dt)?.renderGematriya(); // 'ל׳ שְׁבָט תש״פ'\n * yahrzeit(5774, dt); // undefined (year of death)\n */\nexport function yahrzeit(hyear, date) {\n const hd = getYahrzeitHD(hyear, date);\n return hd && new HDate(hd);\n}\n/**\n * Calculates a birthday or anniversary (non-yahrzeit) and returns it as\n * an {@link HDate}.\n *\n * Same calculation as {@link getBirthdayHD}, but the result comes back\n * as an `HDate` instance rather than a plain `{yy, mm, dd}` object, so it\n * can be rendered (`render`, `renderGematriya`) or used for further\n * Hebrew calendar arithmetic directly.\n *\n * Note that a birthday is *not* calculated the same way as a yahrzeit:\n * when the original date is missing from `hyear` it is postponed rather\n * than moved earlier. See {@link getBirthdayHD} for the full algorithm\n * and its edge cases.\n *\n * `hyear` may be the original year, in which case the original date is\n * returned unchanged: someone's birth date is a meaningful day in its\n * own right, not merely the zeroth anniversary of itself. A death has no\n * equivalent — a yahrzeit begins at the first anniversary — which is why\n * {@link yahrzeit} rejects the year of death.\n *\n * The `date` argument is never modified, so a single original date can be\n * reused to generate a run of years.\n * @param hyear Hebrew year in which to find the anniversary\n * @param date Gregorian or Hebrew date of the original event\n * @returns anniversary occurring in `hyear`, or `undefined` when `hyear`\n * precedes the original year\n * @see {@link getBirthdayHD}\n * @see {@link yahrzeit}\n * @example\n * import {birthdayOrAnniversary} from '@hebcal/hdate';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * birthdayOrAnniversary(5780, dt)?.toString(); // '1 Nisan 5780'\n * birthdayOrAnniversary(5774, dt)?.toString(); // '30 Adar I 5774'\n * birthdayOrAnniversary(5773, dt); // undefined\n */\nexport function birthdayOrAnniversary(hyear, date) {\n const hd = getBirthdayHD(hyear, date);\n return hd && new HDate(hd);\n}\n//# sourceMappingURL=anniversaryHDate.js.map","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n > 1);\",\"language\":\"und-x-ashkenaz\"},\"contexts\":{\"\":{\"Shabbat\":[\"Shabbos\"],\"Achrei Mot\":[\"Achrei Mos\"],\"Bechukotai\":[\"Bechukosai\"],\"Beha'alotcha\":[\"Beha’aloscha\"],\"Bereshit\":[\"Bereshis\"],\"Chukat\":[\"Chukas\"],\"Erev Shavuot\":[\"Erev Shavuos\"],\"Erev Sukkot\":[\"Erev Sukkos\"],\"Ki Tavo\":[\"Ki Savo\"],\"Ki Teitzei\":[\"Ki Seitzei\"],\"Ki Tisa\":[\"Ki Sisa\"],\"Matot\":[\"Matos\"],\"Pesach Shabbat Chol ha-Moed\":[\"Pesach Shabbos Chol ha-Moed\"],\"Purim Katan\":[\"Purim Koton\"],\"Rosh Hashana LaBehemot\":[\"Rosh Hashana LaBeheimos\"],\"Shabbat Chazon\":[\"Shabbos Chazon\"],\"Shabbat HaChodesh\":[\"Shabbos HaChodesh\"],\"Shabbat HaGadol\":[\"Shabbos HaGadol\"],\"Shabbat Nachamu\":[\"Shabbos Nachamu\"],\"Shabbat Parah\":[\"Shabbos Parah\"],\"Shabbat Shekalim\":[\"Shabbos Shekalim\"],\"Shabbat Shuva\":[\"Shabbos Shuvah\"],\"Shabbat Zachor\":[\"Shabbos Zachor\"],\"Shavuot\":[\"Shavuos\"],\"Shavuot I\":[\"Shavuos I\"],\"Shavuot II\":[\"Shavuos II\"],\"Shemot\":[\"Shemos\"],\"Shmini Atzeret\":[\"Shmini Atzeres\"],\"Simchat Torah\":[\"Simchas Torah\"],\"Sukkot\":[\"Sukkos\"],\"Sukkot I\":[\"Sukkos I\"],\"Sukkot II\":[\"Sukkos II\"],\"Sukkot II (CH''M)\":[\"Sukkos II (CH’’M)\"],\"Sukkot III (CH''M)\":[\"Sukkos III (CH’’M)\"],\"Sukkot IV (CH''M)\":[\"Sukkos IV (CH’’M)\"],\"Sukkot V (CH''M)\":[\"Sukkos V (CH’’M)\"],\"Sukkot VI (CH''M)\":[\"Sukkos VI (CH’’M)\"],\"Sukkot VII (Hoshana Raba)\":[\"Sukkos VII (Hoshana Raba)\"],\"Sukkot Shabbat Chol ha-Moed\":[\"Sukkos Shabbos Chol ha-Moed\"],\"Ta'anit Bechorot\":[\"Ta’anis Bechoros\"],\"Ta'anit BeHaB\":[\"Ta’anis BeHaB\"],\"Ta'anit Esther\":[\"Ta’anis Esther\"],\"Toldot\":[\"Toldos\"],\"Vaetchanan\":[\"Vaeschanan\"],\"Yitro\":[\"Yisro\"],\"Vezot Haberakhah\":[\"Vezos Haberakhah\"],\"Parashat\":[\"Parshas\"],\"Leil Selichot\":[\"Leil Selichos\"],\"Shabbat Mevarchim Chodesh\":[\"Shabbos Mevorchim Chodesh\"],\"Shabbat Shirah\":[\"Shabbos Shirah\"],\"Asara B'Tevet\":[\"Asara B’Teves\"],\"Birkat Hachamah\":[\"Birkas HaChamah\"],\"Birkat HaChamah\":[\"Birkas HaChamah\"],\"Shushan Purim Katan\":[\"Shushan Purim Koton\"],\"Alot HaShachar\":[\"Alos HaShachar\"],\"Misheyakir\":[\"Misheyakir\"],\"Misheyakir Machmir\":[\"Misheyakir Machmir\"],\"Sunrise\":[\"Sunrise\"],\"Kriat Shema, sof zeman\":[\"Krias Shema, sof zman\"],\"Tefilah, sof zeman\":[\"Tefilah, sof zman\"],\"Kriat Shema, sof zeman (MGA)\":[\"Krias Shema, sof zman (MGA)\"],\"Kriat Shema, sof zeman (GRA)\":[\"Krias Shema, sof zman (GRA)\"],\"Tefilah, sof zeman (MGA)\":[\"Tefilah, sof zman (MGA)\"],\"Tefilah, sof zeman (GRA)\":[\"Tefilah, sof zman (GRA)\"],\"Chatzot HaLailah\":[\"Chatzos HaLailah\"],\"Chatzot HaYom\":[\"Chatzos\"],\"Chatzot hayom\":[\"Chatzos\"],\"Mincha Gedolah\":[\"Mincha Gedolah\"],\"Mincha Ketanah\":[\"Mincha Ketanah\"],\"Plag HaMincha\":[\"Plag HaMincha\"],\"Sunset\":[\"Sunset\"],\"Bein HaShemashot\":[\"Bein HaShemashos\"],\"Tzeit HaKochavim\":[\"Tzeis HaKochavim\"]}}}","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n > 1);\",\"language\":\"he_IL\"},\"contexts\":{\"\":{\"Shabbat\":[\"שַׁבָּת\"],\"Parashat\":[\"פָּרָשַׁת\"],\"Achrei Mot\":[\"אַחֲרֵי מוֹת\"],\"Balak\":[\"בָּלָק\"],\"Bamidbar\":[\"בְּמִדְבַּר\"],\"Bechukotai\":[\"בְּחֻקֹּתַי\"],\"Beha'alotcha\":[\"בְּהַעֲלֹתְךָ\"],\"Behar\":[\"בְּהַר\"],\"Bereshit\":[\"בְּרֵאשִׁית\"],\"Beshalach\":[\"בְּשַׁלַּח\"],\"Bo\":[\"בֹּא\"],\"Chayei Sara\":[\"חַיֵּי שָֹרָה\"],\"Chukat\":[\"חֻקַּת\"],\"Devarim\":[\"דְּבָרִים\"],\"Eikev\":[\"עֵקֶב\"],\"Emor\":[\"אֱמוֹר\"],\"Ha'azinu\":[\"הַאֲזִינוּ\"],\"Kedoshim\":[\"קְדֹשִׁים\"],\"Ki Tavo\":[\"כִּי־תָבוֹא\"],\"Ki Teitzei\":[\"כִּי־תֵצֵא\"],\"Ki Tisa\":[\"כִּי תִשָּׂא\"],\"Korach\":[\"קֹרַח\"],\"Lech-Lecha\":[\"לֶךְ־לְךָ\"],\"Masei\":[\"מַסְעֵי\"],\"Matot\":[\"מַטּוֹת\"],\"Metzora\":[\"מְצֹרָע\"],\"Miketz\":[\"מִקֵּץ\"],\"Mishpatim\":[\"מִשְׁפָּטִים\"],\"Nasso\":[\"נָשׂא\"],\"Nitzavim\":[\"נִצָּבִים\"],\"Noach\":[\"נֹחַ\"],\"Pekudei\":[\"פְקוּדֵי\"],\"Pinchas\":[\"פִּינְחָס\"],\"Re'eh\":[\"רְאֵה\"],\"Sh'lach\":[\"שְׁלַח־לְךָ\"],\"Shemot\":[\"שְׁמוֹת\"],\"Shmini\":[\"שְּׁמִינִי\"],\"Shoftim\":[\"שׁוֹפְטִים\"],\"Tazria\":[\"תַזְרִיעַ\"],\"Terumah\":[\"תְּרוּמָה\"],\"Tetzaveh\":[\"תְּצַוֶּה\"],\"Toldot\":[\"תּוֹלְדוֹת\"],\"Tzav\":[\"צַו\"],\"Vaera\":[\"וָאֵרָא\"],\"Vaetchanan\":[\"וָאֶתְחַנַּן\"],\"Vayakhel\":[\"וַיַּקְהֵל\"],\"Vayechi\":[\"וַיְחִי\"],\"Vayeilech\":[\"וַיֵּלֶךְ\"],\"Vayera\":[\"וַיֵּרָא\"],\"Vayeshev\":[\"וַיֵּשֶׁב\"],\"Vayetzei\":[\"וַיֵּצֵא\"],\"Vayigash\":[\"וַיִּגַּשׁ\"],\"Vayikra\":[\"וַיִּקְרָא\"],\"Vayishlach\":[\"וַיִּשְׁלַח\"],\"Vezot Haberakhah\":[\"וְזֹאת הַבְּרָכָה\"],\"Yitro\":[\"יִתְרוֹ\"],\"Asara B'Tevet\":[\"עֲשָׂרָה בְּטֵבֵת\"],\"Candle lighting\":[\"הַדְלָקַת נֵרוֹת\"],\"Chanukah\":[\"חֲנוּכָּה\"],\"Chanukah: 1 Candle\":[\"חֲנוּכָּה: א׳ נֵר\"],\"Chanukah: 2 Candles\":[\"חֲנוּכָּה: ב׳ נֵרוֹת\"],\"Chanukah: 3 Candles\":[\"חֲנוּכָּה: ג׳ נֵרוֹת\"],\"Chanukah: 4 Candles\":[\"חֲנוּכָּה: ד׳ נֵרוֹת\"],\"Chanukah: 5 Candles\":[\"חֲנוּכָּה: ה׳ נֵרוֹת\"],\"Chanukah: 6 Candles\":[\"חֲנוּכָּה: ו׳ נֵרוֹת\"],\"Chanukah: 7 Candles\":[\"חֲנוּכָּה: ז׳ נֵרוֹת\"],\"Chanukah: 8 Candles\":[\"חֲנוּכָּה: ח׳ נֵרוֹת\"],\"Chanukah: 8th Day\":[\"חֲנוּכָּה: יוֹם ח׳\"],\"Days of the Omer\":[\"סְפִירַת הָעוֹמֶר\"],\"Omer\":[\"עוֹמֶר\"],\"day of the Omer\":[\"בָּעוֹמֶר\"],\"Erev Pesach\":[\"עֶרֶב פֶּסַח\"],\"Erev Purim\":[\"עֶרֶב פּוּרִים\"],\"Erev Rosh Hashana\":[\"עֶרֶב רֹאשׁ הַשָּׁנָה\"],\"Erev Shavuot\":[\"עֶרֶב שָׁבוּעוֹת\"],\"Erev Simchat Torah\":[\"עֶרֶב שִׂמְחַת תּוֹרָה\"],\"Erev Sukkot\":[\"עֶרֶב סֻכּוֹת\"],\"Erev Tish'a B'Av\":[\"עֶרֶב תִּשְׁעָה בְּאָב\"],\"Erev Yom Kippur\":[\"עֶרֶב יוֹם כִּפּוּר\"],\"Havdalah\":[\"הַבְדָּלָה\"],\"Lag BaOmer\":[\"ל״ג בָּעוֹמֶר\"],\"Leil Selichot\":[\"סְלִיחוֹת\"],\"Pesach\":[\"פֶּסַח\"],\"Pesach I\":[\"פֶּסַח א׳\"],\"Pesach II\":[\"פֶּסַח ב׳\"],\"Pesach II (CH''M)\":[\"פֶּסַח ב׳ (חוה״מ)\"],\"Pesach III (CH''M)\":[\"פֶּסַח ג׳ (חוה״מ)\"],\"Pesach IV (CH''M)\":[\"פֶּסַח ד׳ (חוה״מ)\"],\"Pesach Sheni\":[\"פֶּסַח שֵׁנִי\"],\"Pesach V (CH''M)\":[\"פֶּסַח ה׳ (חוה״מ)\"],\"Pesach VI (CH''M)\":[\"פֶּסַח ו׳ (חוה״מ)\"],\"Pesach VII\":[\"פֶּסַח ז׳\"],\"Pesach VIII\":[\"פֶּסַח ח׳\"],\"Pesach Shabbat Chol ha-Moed\":[\"שַׁבַּת חֹל הַמּוֹעֵד פֶּסַח\"],\"Purim\":[\"פּוּרִים\"],\"Purim Katan\":[\"פּוּרִים קָטָן\"],\"Rosh Chodesh\":[\"רֹאשׁ חוֹדֶשׁ\"],\"Rosh Hashana\":[\"רֹאשׁ הַשָּׁנָה\"],\"Rosh Hashana I\":[\"רֹאשׁ הַשָּׁנָה א׳\"],\"Rosh Hashana II\":[\"רֹאשׁ הַשָּׁנָה ב׳\"],\"Shabbat Chazon\":[\"שַׁבַּת חֲזוֹן\"],\"Shabbat HaChodesh\":[\"שַׁבַּת הַחֹדֶשׁ\"],\"Shabbat HaGadol\":[\"שַׁבַּת הַגָּדוֹל\"],\"Shabbat Nachamu\":[\"שַׁבַּת נַחֲמוּ\"],\"Shabbat Parah\":[\"שַׁבַּת פָּרָה\"],\"Shabbat Shekalim\":[\"שַׁבַּת שְׁקָלִים\"],\"Shabbat Shuva\":[\"שַׁבַּת שׁוּבָה\"],\"Shabbat Zachor\":[\"שַׁבַּת זָכוֹר\"],\"Shavuot\":[\"שָׁבוּעוֹת\"],\"Shavuot I\":[\"שָׁבוּעוֹת א׳\"],\"Shavuot II\":[\"שָׁבוּעוֹת ב׳\"],\"Shmini Atzeret\":[\"שְׁמִינִי עֲצֶרֶת\"],\"Shushan Purim\":[\"שׁוּשָׁן פּוּרִים\"],\"Sigd\":[\"חַג הַסִּיגְד\"],\"Simchat Torah\":[\"שִׂמְחַת תּוֹרָה\"],\"Sukkot\":[\"סֻכּוֹת\"],\"Sukkot I\":[\"סֻכּוֹת א׳\"],\"Sukkot II\":[\"סֻכּוֹת ב׳\"],\"Sukkot II (CH''M)\":[\"סֻכּוֹת ב׳ (חוה״מ)\"],\"Sukkot III (CH''M)\":[\"סֻכּוֹת ג׳ (חוה״מ)\"],\"Sukkot IV (CH''M)\":[\"סֻכּוֹת ד׳ (חוה״מ)\"],\"Sukkot V (CH''M)\":[\"סֻכּוֹת ה׳ (חוה״מ)\"],\"Sukkot VI (CH''M)\":[\"סֻכּוֹת ו׳ (חוה״מ)\"],\"Sukkot VII (Hoshana Raba)\":[\"סֻכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)\"],\"Sukkot Shabbat Chol ha-Moed\":[\"שַׁבַּת חֹל הַמּוֹעֵד סֻכּוֹת\"],\"Ta'anit Bechorot\":[\"תַּעֲנִית בְּכוֹרוֹת\"],\"Ta'anit BeHaB\":[\"תַּעֲנִית בה״ב\"],\"Ta'anit Esther\":[\"תַּעֲנִית אֶסְתֵּר\"],\"Tish'a B'Av\":[\"תִּשְׁעָה בְּאָב\"],\"Tu B'Av\":[\"ט״וּ בְּאָב\"],\"Tu BiShvat\":[\"ט״וּ בִּשְׁבָט\"],\"Tu B'Shvat\":[\"ט״וּ בִּשְׁבָט\"],\"Tzom Gedaliah\":[\"צוֹם גְּדַלְיָה\"],\"Tzom Tammuz\":[\"צוֹם י״ז בְּתַמּוּז\"],\"Yom HaAtzma'ut\":[\"יוֹם הָעַצְמָאוּת\"],\"Yom HaShoah\":[\"יוֹם הַשּׁוֹאָה\"],\"Yom HaZikaron\":[\"יוֹם הַזִּכָּרוֹן\"],\"Yom Kippur\":[\"יוֹם כִּפּוּר\"],\"Yom Yerushalayim\":[\"יוֹם יְרוּשָׁלַיִם\"],\"Yom HaAliyah\":[\"יוֹם הַעֲלִיָּה\"],\"Yom HaAliyah School Observance\":[\"שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה\"],\"Rosh Chodesh Adar\":[\"רֹאשׁ חוֹדֶשׁ אֲדָר\"],\"Rosh Chodesh Adar I\":[\"רֹאשׁ חוֹדֶשׁ אֲדָר א׳\"],\"Rosh Chodesh Adar II\":[\"רֹאשׁ חוֹדֶשׁ אֲדָר ב׳\"],\"Rosh Chodesh Av\":[\"רֹאשׁ חוֹדֶשׁ אָב\"],\"Rosh Chodesh Cheshvan\":[\"רֹאשׁ חוֹדֶשׁ חֶשְׁוָן\"],\"Rosh Chodesh Elul\":[\"רֹאשׁ חוֹדֶשׁ אֱלוּל\"],\"Rosh Chodesh Iyyar\":[\"רֹאשׁ חוֹדֶשׁ אִיָּיר\"],\"Rosh Chodesh Kislev\":[\"רֹאשׁ חוֹדֶשׁ כִּסְלֵו\"],\"Rosh Chodesh Nisan\":[\"רֹאשׁ חוֹדֶשׁ נִיסָן\"],\"Rosh Chodesh Sh'vat\":[\"רֹאשׁ חוֹדֶשׁ שְׁבָט\"],\"Rosh Chodesh Sivan\":[\"רֹאשׁ חוֹדֶשׁ סִיוָן\"],\"Rosh Chodesh Tamuz\":[\"רֹאשׁ חוֹדֶשׁ תַּמּוּז\"],\"Rosh Chodesh Tammuz\":[\"רֹאשׁ חוֹדֶשׁ תַּמּוּז\"],\"Rosh Chodesh Tevet\":[\"רֹאשׁ חוֹדֶשׁ טֵבֵת\"],\"min\":[\"דַּקּוֹת\"],\"Fast begins\":[\"תְּחִילַּת הַצוֹם\"],\"Fast ends\":[\"סִיּוּם הַצוֹם\"],\"Rosh Hashana LaBehemot\":[\"רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה\"],\"Tish'a B'Av (observed)\":[\"(תִּשְׁעָה בְּאָב (נִדְחָה\"],\"Shabbat Mevarchim Chodesh\":[\"שַׁבַּת מְבָרְכִים חוֹדֶשׁ\"],\"Shabbat Shirah\":[\"שַׁבַּת שִׁירָה\"],\"Lovingkindness\":[\"חֶסֶד\"],\"Might\":[\"גְּבוּרָה\"],\"Beauty\":[\"תִּפְאֶרֶת\"],\"Eternity\":[\"נֶּצַח\"],\"Splendor\":[\"הוֹד\"],\"Foundation\":[\"יְּסוֹד\"],\"Majesty\":[\"מַּלְכוּת\"],\"day\":[\"יוֹם\"],\"Yom Kippur Katan\":[\"יוֹם כִּפּוּר קָטָן\"],\"Yizkor\":[\"יִזְכּוֹר\"],\"Family Day\":[\"יוֹם הַמִּשׁפָּחָה\"],\"Yitzhak Rabin Memorial Day\":[\"יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין\"],\"Jabotinsky Day\":[\"יוֹם זַ׳בּוֹטִינְסְקִי\"],\"Herzl Day\":[\"יוֹם הֶרְצְל\"],\"Ben-Gurion Day\":[\"יוֹם בֶּן־גּוּרִיּוֹן\"],\"Hebrew Language Day\":[\"יוֹם הַשָׂפָה הַעִברִית\"],\"Birkat Hachamah\":[\"בִּרְכַּת הַחַמָּה\"],\"Birkat HaChamah\":[\"בִּרְכַּת הַחַמָּה\"],\"Shushan Purim Katan\":[\"שׁוּשָׁן פּוּרִים קָטָן\"],\"Purim Meshulash\":[\"פּוּרִים מְשׁוּלָּשׁ\"],\"Chag HaBanot\":[\"חַג הַבָּנוֹת\"],\"Molad\":[\"מוֹלָד הָלְּבָנָה\"],\"chalakim\":[\"חֲלָקִים\"],\"Alot HaShachar\":[\"עֲלוֹת הַשַּׁחַר\"],\"Misheyakir\":[\"מִשֶּׁיַּכִּיר\"],\"Misheyakir Machmir\":[\"מִשֶּׁיַּכִּיר מַחְמִיר\"],\"Sunrise\":[\"נֵץ הַחַמָּה\"],\"Kriat Shema, sof zeman\":[\"סוֹף זְמַן קְרִיאַת שְׁמַע\"],\"Tefilah, sof zeman\":[\"סוֹף זְמַן תְּפִלָּה\"],\"Kriat Shema, sof zeman (MGA)\":[\"סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)\"],\"Kriat Shema, sof zeman (GRA)\":[\"סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)\"],\"Tefilah, sof zeman (MGA)\":[\"סוֹף זְמַן תְּפִלָּה (מג״א)\"],\"Tefilah, sof zeman (GRA)\":[\"סוֹף זְמַן תְּפִלָּה (גְּרָ״א)\"],\"Chatzot HaLailah\":[\"חֲצוֹת הַלַּיְלָה\"],\"Chatzot HaYom\":[\"חֲצוֹת הַיּוֹם\"],\"Chatzot hayom\":[\"חֲצוֹת הַיּוֹם\"],\"Mincha Gedolah\":[\"מִנְחָה גְּדוֹלָה\"],\"Mincha Ketanah\":[\"מִנְחָה קְטַנָּה\"],\"Plag HaMincha\":[\"פְּלַג הַמִּנְחָה\"],\"Sunset\":[\"שְׁקִיעַת הַחַמָּה\"],\"Bein HaShemashot\":[\"בֵּין הַשְּׁמָשׁוֹת\"],\"Tzeit HaKochavim\":[\"צֵאת הַכּוֹכָבִים\"],\"Biur Chametz\":[\"בִּעוּר חָמֵץ\"],\"Finish eating chametz\":[\"סוֹף זְמַן אֲכִילַת חָמֵץ\"]}}}","import {Locale} from '@hebcal/hdate';\nimport poAshkenazi from './ashkenazi.po.js';\nimport poHe from './he.po.js';\nimport noNikudOverride from './he-x-NoNikud.po.js';\n\nLocale.addTranslations('he', poHe);\nLocale.addTranslations('ashkenazi', poAshkenazi);\n\n/* Hebrew without nikkud */\nconst poHeNoNikud = Locale.copyLocaleNoNikud(poHe);\nLocale.addTranslations('he-x-NoNikud', poHeNoNikud);\nLocale.addTranslations('he-x-NoNikud', noNikudOverride);\n\nexport {Locale} from '@hebcal/hdate';\n","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n != 1);\",\"language\":\"he-x-NoNikud\"},\"contexts\":{\"\":{\"Korach\":[\"קורח\"],\"Chukat\":[\"חוקת\"],\"Erev Yom Kippur\":[\"ערב יום כיפור\"],\"Yom Kippur\":[\"יום כיפור\"],\"Yom Kippur Katan\":[\"יום כיפור קטן\"],\"Pesach Shabbat Chol ha-Moed\":[\"שבת חול המועד פסח\"],\"Sukkot Shabbat Chol ha-Moed\":[\"שבת חול המועד סוכות\"],\"Erev Sukkot\":[\"ערב סוכות\"],\"Sukkot\":[\"סוכות\"],\"Sukkot I\":[\"סוכות א׳\"],\"Sukkot II\":[\"סוכות ב׳\"],\"Sukkot II (CH''M)\":[\"סוכות ב׳ (חוה״מ)\"],\"Sukkot III (CH''M)\":[\"סוכות ג׳ (חוה״מ)\"],\"Sukkot IV (CH''M)\":[\"סוכות ד׳ (חוה״מ)\"],\"Sukkot V (CH''M)\":[\"סוכות ה׳ (חוה״מ)\"],\"Sukkot VI (CH''M)\":[\"סוכות ו׳ (חוה״מ)\"],\"Sukkot VII (Hoshana Raba)\":[\"סוכות ז׳ (הושענא רבה)\"]}}}","import {HDate, Locale} from '@hebcal/hdate';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Holiday flags for Event. These flags are typically\n * combined using bitwise arithmetic to form a mask.\n */\nexport const flags = {\n /** Chag, yontiff, yom tov */\n CHAG: 0x000001,\n /** Light candles before sundown */\n LIGHT_CANDLES: 0x000002,\n /** End of holiday (end of Yom Tov) */\n YOM_TOV_ENDS: 0x000004,\n /** Observed only in the Diaspora (chutz l'aretz) */\n CHUL_ONLY: 0x000008,\n /** Observed only in Israel */\n IL_ONLY: 0x000010,\n /** Light candles in the evening at Tzeit time (3 small stars) */\n LIGHT_CANDLES_TZEIS: 0x000020,\n /** Candle-lighting for Chanukah */\n CHANUKAH_CANDLES: 0x000040,\n /** Rosh Chodesh, beginning of a new Hebrew month */\n ROSH_CHODESH: 0x000080,\n /** Minor fasts like Tzom Tammuz, Ta'anit Esther, ... */\n MINOR_FAST: 0x000100,\n /** Shabbat Shekalim, Zachor, ... */\n SPECIAL_SHABBAT: 0x000200,\n /** Weekly sedrot on Saturdays */\n PARSHA_HASHAVUA: 0x000400,\n /** Daily page of Talmud (Bavli) */\n DAF_YOMI: 0x000800,\n /** Days of the Omer */\n OMER_COUNT: 0x001000,\n /** Yom HaShoah, Yom HaAtzma'ut, ... */\n MODERN_HOLIDAY: 0x002000,\n /** Yom Kippur and Tish'a B'Av */\n MAJOR_FAST: 0x004000,\n /** On the Saturday before Rosh Chodesh */\n SHABBAT_MEVARCHIM: 0x008000,\n /** Molad */\n MOLAD: 0x010000,\n /** Yahrzeit or Hebrew Anniversary */\n USER_EVENT: 0x020000,\n /** Daily Hebrew date (\"11th of Sivan, 5780\") */\n HEBREW_DATE: 0x040000,\n /** A holiday that's not major, modern, rosh chodesh, or a fast day */\n MINOR_HOLIDAY: 0x080000,\n /** Evening before a major or minor holiday */\n EREV: 0x100000,\n /** Chol haMoed, intermediate days of Pesach or Sukkot */\n CHOL_HAMOED: 0x200000,\n /** Mishna Yomi */\n MISHNA_YOMI: 0x400000,\n /** Yom Kippur Katan, minor day of atonement on the day preceeding each Rosh Chodesh */\n YOM_KIPPUR_KATAN: 0x800000,\n /** Daily page of Jerusalem Talmud (Yerushalmi) */\n YERUSHALMI_YOMI: 0x1000000,\n /** Nach Yomi */\n NACH_YOMI: 0x2000000,\n /** Daily Learning */\n DAILY_LEARNING: 0x4000000,\n /** Yizkor */\n YIZKOR: 0x8000000,\n /** BeHaB fast days on Monday, Thursday and Monday after Pesach and Sukkot */\n BEHAB: 0x10000000,\n} as const;\n\n/**\n * Name of one of the {@link flags}, such as `'CHAG'` or `'ROSH_CHODESH'`.\n * Used by {@link Event.hasFlag} and {@link Event.flagNames}.\n */\nexport type FlagName = keyof typeof flags;\n\nconst flagEntries = Object.entries(flags) as [FlagName, number][];\n\nfunction flagBit(name: FlagName): number {\n if (!Object.hasOwn(flags, name)) {\n throw new RangeError(`Unknown flag name: ${String(name)}`);\n }\n return flags[name];\n}\n\nconst flagToCategory = [\n [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],\n [flags.CHANUKAH_CANDLES, 'holiday', 'minor'],\n [flags.HEBREW_DATE, 'hebdate'],\n [flags.MINOR_FAST, 'holiday', 'fast'],\n [flags.MINOR_HOLIDAY, 'holiday', 'minor'],\n [flags.MODERN_HOLIDAY, 'holiday', 'modern'],\n [flags.MOLAD, 'molad'],\n [flags.OMER_COUNT, 'omer'],\n [flags.PARSHA_HASHAVUA, 'parashat'], // backwards-compat\n [flags.ROSH_CHODESH, 'roshchodesh'],\n [flags.SHABBAT_MEVARCHIM, 'mevarchim'],\n [flags.SPECIAL_SHABBAT, 'holiday', 'shabbat'],\n [flags.USER_EVENT, 'user'],\n [flags.YIZKOR, 'yizkor'],\n] as const;\n\n/**\n * Represents an Event with a title, date, and flags.\n *\n * Events are used to represent holidays, candle-lighting times,\n * Torah readings, Omer days, Hebrew dates, and more. Most concrete event\n * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent},\n * {@link ParshaEvent}, {@link OmerEvent}) and are produced by\n * {@link calendar}.\n *\n * To get the title of the event in a language other than English with\n * Sephardic transliterations, use the {@link Event.render} method.\n *\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.getDate().toString(); // '6 Sivan 5749'\n * ev.getDesc(); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n */\nexport class Event {\n /** Hebrew date of this event */\n readonly date: HDate;\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n readonly desc: string;\n /** Bitmask of optional event flags. See {@link flags} */\n readonly mask: number;\n /** Optional emoji character such as ✡️, 🕯️, 🕎, 🕍, 🌒 */\n emoji?: string;\n /** Optional longer description or memo text */\n memo?: string;\n /** Alarms are used by iCalendar feeds */\n alarm?: Date | string | boolean;\n /**\n * Constructs Event\n * @param date Hebrew date event occurs\n * @param desc Description (not translated)\n * @param [mask=0] optional bitmask of holiday flags (see {@link flags})\n * @param [attrs={}] optional additional attributes (e.g. `eventTimeStr`, `cholHaMoedDay`)\n */\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n if (!HDate.isHDate(date)) {\n throw new TypeError(`Invalid Event date: ${date}`);\n }\n if (typeof desc !== 'string') {\n throw new TypeError(`Invalid Event description: ${desc}`);\n }\n this.date = date;\n this.desc = desc;\n this.mask = +mask;\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n /**\n * Hebrew date of this event\n */\n getDate(): HDate {\n return this.date;\n }\n /**\n * Gregorian date of this event\n */\n greg(): Date {\n return this.date.greg();\n }\n /**\n * Untranslated title of this event. Note that these description\n * strings are always in English and will remain stable across releases.\n * To get the title of the event in another language, use the\n * `render()` method.\n */\n getDesc(): string {\n return this.desc;\n }\n /**\n * Bitmask of optional event flags. See {@link flags}\n * @deprecated Use {@link Event.hasFlag} to test for a flag, or\n * {@link Event.flagNames} to list them. Code that genuinely needs the\n * raw bitmask can read {@link Event.mask}.\n */\n getFlags(): number {\n return this.mask;\n }\n /**\n * Does this event have the given flag?\n *\n * A readable alternative to testing the bitmask with `&`.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II',\n * flags.CHAG | flags.CHUL_ONLY);\n * ev.hasFlag('CHAG'); // true\n * ev.hasFlag('CHUL_ONLY'); // true\n * ev.hasFlag('MINOR_FAST'); // false\n * @param name flag name, one of the keys of {@link flags}\n * @throws {RangeError} if `name` is not a key of {@link flags}\n */\n hasFlag(name: FlagName): boolean {\n return (this.mask & flagBit(name)) !== 0;\n }\n /**\n * Does this event have at least one of the given flags?\n *\n * Returns `false` when called with no arguments.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur',\n * flags.CHAG | flags.MAJOR_FAST);\n * ev.hasAnyFlag('MAJOR_FAST', 'MINOR_FAST'); // true\n * ev.hasAnyFlag('ROSH_CHODESH', 'MINOR_FAST'); // false\n * @param names flag names, each one of the keys of {@link flags}\n * @throws {RangeError} if any name is not a key of {@link flags}\n */\n hasAnyFlag(...names: FlagName[]): boolean {\n let bits = 0;\n for (const name of names) {\n bits |= flagBit(name);\n }\n return (this.mask & bits) !== 0;\n }\n /**\n * Names of all {@link flags} set on this event, in ascending bit order.\n * Returns an empty array for an event with no flags.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * const ev = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II',\n * flags.CHAG | flags.CHUL_ONLY);\n * ev.flagNames(); // ['CHAG', 'CHUL_ONLY']\n */\n flagNames(): FlagName[] {\n return flagEntries.filter(([, bit]) => this.mask & bit).map(([name]) => name);\n }\n /**\n * Returns (translated) description of this event\n * @example\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.render('en'); // 'Shavuot'\n * ev.render('he'); // 'שָׁבוּעוֹת'\n * ev.render('ashkenazi'); // 'Shavuos'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.desc, locale);\n }\n /**\n * Returns a brief (translated) description of this event.\n *\n * For most events this is the same as {@link render}. Some subclasses\n * (e.g. {@link CandleLightingEvent}, {@link HavdalahEvent},\n * {@link OmerEvent}) produce shorter text without an attached time or\n * extra qualifier — useful for compact UI display.\n * @example\n * import {CandleLightingEvent} from '@hebcal/core';\n * // For a regular Event, renderBrief() == render():\n * const ev = new Event(new HDate(6, 'Sivan', 5749), 'Shavuot', flags.CHAG);\n * ev.renderBrief('en'); // 'Shavuot'\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return this.render(locale);\n }\n /**\n * Returns the event's emoji character (e.g. `🕯️`, `🕎`, `🇮🇱`, `🍏🍯`),\n * or `null` if no emoji is associated with this event.\n * Subclasses override this to provide holiday-specific emoji.\n */\n getEmoji(): string | null {\n return this.emoji || null;\n }\n /**\n * Returns a simplified (untranslated) description for this event, suitable\n * for grouping related events under a single name.\n *\n * For example, {@link HolidayEvent} strips qualifiers so that\n * `\"Erev Pesach\"` → `\"Pesach\"` and `\"Sukkot III (CH''M)\"` → `\"Sukkot\"`.\n * For many events the basename and the event description are identical.\n * @example\n * import {HolidayEvent, HDate, months, flags} from '@hebcal/core';\n * const ev = new HolidayEvent(\n * new HDate(14, months.NISAN, 5784), 'Erev Pesach', flags.EREV);\n * ev.getDesc(); // 'Erev Pesach'\n * ev.basename(); // 'Pesach'\n */\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns a URL to hebcal.com or sefaria.org for more detail on the event,\n * or `undefined` for events with no detail page.\n *\n * Subclasses such as {@link HolidayEvent}, {@link ChanukahEvent},\n * {@link AsaraBTevetEvent}, {@link ParshaEvent}, and {@link OmerEvent}\n * override this with their own URL patterns.\n */\n url(): string | undefined {\n return undefined;\n }\n /**\n * Is this event observed in Israel?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInIsrael(); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInIsrael(); // true\n */\n observedInIsrael(): boolean {\n return !this.hasFlag('CHUL_ONLY');\n }\n /**\n * Is this event observed in the Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedInDiaspora(); // true\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedInDiaspora(); // true\n */\n observedInDiaspora(): boolean {\n return !this.hasFlag('IL_ONLY');\n }\n /**\n * Is this event observed in Israel/Diaspora?\n * @example\n * const ev1 = new Event(new HDate(7, 'Sivan', 5749), 'Shavuot II', flags.CHAG | flags.CHUL_ONLY);\n * ev1.observedIn(false); // true\n * ev1.observedIn(true); // false\n * const ev2 = new Event(new HDate(26, 'Kislev', 5749), 'Chanukah: 3 Candles', 0);\n * ev2.observedIn(false); // true\n * ev2.observedIn(true); // true\n * @param il\n */\n observedIn(il: boolean): boolean {\n return il ? this.observedInIsrael() : this.observedInDiaspora();\n }\n /**\n * Returns an array of category strings classifying this event, derived\n * from its {@link flags} bitmask. The first element is the broad category\n * (e.g. `'holiday'`, `'roshchodesh'`, `'parashat'`, `'omer'`), followed\n * by zero or more refinements (e.g. `'major'`, `'minor'`, `'fast'`).\n *\n * Returns `['unknown']` if no flag maps to a known category.\n * @example\n * import {Event, HDate, flags} from '@hebcal/core';\n * new Event(new HDate(10, 'Tishrei', 5784), 'Yom Kippur', flags.MAJOR_FAST)\n * .getCategories(); // ['holiday', 'major', 'fast']\n * new Event(new HDate(1, 'Shvat', 5784), 'Rosh Chodesh Sh\\'vat', flags.ROSH_CHODESH)\n * .getCategories(); // ['roshchodesh']\n */\n getCategories(): string[] {\n const mask = this.mask;\n for (const attrs of flagToCategory) {\n const attr0 = attrs[0] as number;\n if (mask & attr0) {\n return attrs.slice(1) as string[];\n }\n }\n return ['unknown'];\n }\n}\n","import {HDate, gematriya, months, Locale} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/** Daily Hebrew date (\"11th of Sivan, 5780\") */\nexport class HebrewDateEvent extends Event {\n /**\n * @param date\n */\n constructor(date: HDate) {\n super(date, date.toString(), flags.HEBREW_DATE);\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.render('en')); // '15th of Cheshvan, 5769'\n * console.log(ev.render('he')); // 'ט״ו חֶשְׁוָן תשס״ט'\n */\n render(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n switch (locale0) {\n case 'h':\n case 'he':\n return hd.renderGematriya(false);\n case 'he-x-nonikud':\n return hd.renderGematriya(true);\n default:\n return hd.render(locale0, true);\n }\n }\n /**\n * @private\n * @param locale\n */\n private renderBriefHebrew(locale: string): string {\n const hd = this.getDate();\n const dd = hd.getDate();\n const mm = Locale.gettext(hd.getMonthName(), locale);\n return gematriya(dd) + ' ' + mm;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n * @example\n * import {HDate, HebrewDateEvent, months} from '@hebcal/core';\n *\n * const hd = new HDate(15, months.CHESHVAN, 5769);\n * const ev = new HebrewDateEvent(hd);\n * console.log(ev.renderBrief()); // '15th of Cheshvan'\n * console.log(ev.renderBrief('he')); // 'ט״ו חֶשְׁוָן'\n */\n renderBrief(locale?: string): string {\n const locale1 = locale?.toLowerCase();\n const locale0 = locale1 ?? 'en';\n const hd = this.getDate();\n if (hd.getMonth() === months.TISHREI && hd.getDate() === 1) {\n return this.render(locale0);\n }\n switch (locale0) {\n case 'h':\n case 'he':\n case 'he-x-nonikud':\n return this.renderBriefHebrew(locale0);\n default:\n return hd.render(locale0, false);\n }\n }\n}\n","// Low-Level\nexport const expectedPositive = (entityName, num) => `Non-positive ${entityName}: ${num}`;\nexport const expectedFinite = (entityName, num) => `Non-finite ${entityName}: ${num}`;\nexport const forbiddenBigIntToNumber = (entityName) => `Cannot convert bigint to ${entityName}`;\nexport const invalidObject = 'Invalid object';\nexport const numberOutOfRange = (entityName, val, min, max) => invalidEntity(entityName, val) + `; must be between ${min}-${max}`;\n// Entity/Fields/Bags\nexport const invalidEntity = (fieldName, val) => `Invalid ${fieldName}: ${val}`;\n// Calendar\nexport const unsupportedWeekNumbers = 'Calendar week operations forbidden';\n// Rounding\nexport const nonOneRoundingIncrement = 'Non-1 roundingIncrement not allowed';\n// Options\nexport const invalidOverflowOption = 'Invalid overflow option';\n","import * as errorMessages from './errorMessages.js';\nexport const nanoInMicro = 1_000;\nexport const nanoInMilli = 1_000_000;\nexport const nanoInSec = 1_000_000_000;\nexport const nanoInMinute = 60_000_000_000;\nexport const nanoInHour = 3_600_000_000_000;\nexport function normalizeOptions(options) {\n if (options === undefined) {\n return Object.create(null);\n }\n return requireObjectLike(options);\n}\nexport function toFiniteNumber(arg, entityName = 'number') {\n if (typeof arg === 'bigint') {\n throw new TypeError(errorMessages.forbiddenBigIntToNumber(entityName));\n }\n arg = Number(arg);\n if (!Number.isFinite(arg)) {\n throw new RangeError(errorMessages.expectedFinite(entityName, arg));\n }\n return arg;\n}\nexport function toIntegerWithTrunc(arg, entityName) {\n return Math.trunc(toFiniteNumber(arg, entityName)) || 0; // ensure no -0\n}\nexport function toPositiveIntegerWithTruncation(arg, entityName) {\n return requireNumberIsPositive(toIntegerWithTrunc(arg, entityName), entityName);\n}\n/*\nAlready known to be number.\n*/\nexport function requireNumberIsPositive(num, entityName = 'number') {\n if (num <= 0) {\n throw new RangeError(errorMessages.expectedPositive(entityName, num));\n }\n return num;\n}\n/*\nmin/max are inclusive\n*/\nexport function constrainToRange(num, min, max) {\n return Math.min(Math.max(num, min), max);\n}\nexport function isObjectLike(arg) {\n return arg !== null && (typeof arg === 'object' || typeof arg === 'function');\n}\nexport function requireObjectLike(arg) {\n if (!isObjectLike(arg)) {\n throw new TypeError(errorMessages.invalidObject);\n }\n return arg;\n}\n// Options-bag-parsing-adjacent\n// ----------------------------\n/*\nAlready known to be number\n*/\nexport function normalizeNumberInRange(num, min, max, // inclusive\noptions) {\n const clamped = constrainToRange(num, min, max);\n if (normalizeOverflow(options) === 'reject' && num !== clamped) {\n throw new RangeError(errorMessages.numberOutOfRange('number', num, min, max));\n }\n return clamped;\n}\n/*\nMatch Temporal's field overflow shape without depending on the polyfill's\ninternal option readers. Undefined defaults to constrain; explicit reject asks\nfor exact in-range input.\n*/\nfunction normalizeOverflow(options) {\n options = normalizeOptions(options);\n const overflow = options.overflow;\n if (overflow === undefined) {\n return 'constrain';\n }\n if (overflow === 'constrain' || overflow === 'reject') {\n return overflow;\n }\n throw new RangeError(errorMessages.invalidOverflowOption);\n}\n","import { roundHalfFloor, roundHalfCeil, roundHalfTrunc, roundExpand, roundHalfExpand, roundHalfEven, bindArgs, toString, throwRangeError, invalidEntity, clampEntity, unitNameMap, durationFieldNamesAsc, invalidChoice, nanoInUtcDay, unitNanoMap, unitNamesAsc, flippedSmallestLargestUnit, requirePropDefined, missingSmallestLargestUnit } from \"./internal.js\";\n\nimport { requireObjectLike, toIntegerWithTrunc, normalizeOptions } from \"temporal-utils/protected\";\n\nimport \"temporal-utils/protected-error-messages\";\n\nfunction normalizeOptionsOrString(options, optionName) {\n return \"string\" == typeof options ? ((optionName, optionVal) => {\n const res = Object.create(null);\n return res[optionName] = optionVal, res;\n })(optionName, options) : requireObjectLike(options);\n}\n\nconst smallestUnitStr = \"smallestUnit\";\n\nconst overflowMap = {\n constrain: 0,\n reject: 1\n};\n\nconst epochDisambigMap = {\n compatible: 0,\n reject: 1,\n earlier: 2,\n later: 3\n};\n\nconst offsetDisambigMap = {\n reject: 0,\n use: 1,\n prefer: 2,\n ignore: 3\n};\n\nconst calendarDisplayMap = {\n auto: 0,\n never: 1,\n critical: 2,\n always: 3\n};\n\nconst timeZoneDisplayMap = {\n auto: 0,\n never: 1,\n critical: 2\n};\n\nconst offsetDisplayMap = {\n auto: 0,\n never: 1\n};\n\nconst roundingModeMap = {\n floor: 0,\n halfFloor: 1,\n ceil: 2,\n halfCeil: 3,\n trunc: 4,\n halfTrunc: 5,\n expand: 6,\n halfExpand: 7,\n halfEven: 8\n};\n\nconst roundingModeFuncs = [ Math.floor, roundHalfFloor, Math.ceil, roundHalfCeil, Math.trunc, roundHalfTrunc, roundExpand, roundHalfExpand, roundHalfEven ];\n\nconst directionMap = {\n previous: -1,\n next: 1\n};\n\nfunction coerceRoundingIncInteger(options) {\n const roundingInc = options.roundingIncrement;\n return void 0 === roundingInc ? 1 : toIntegerWithTrunc(roundingInc, \"roundingIncrement\");\n}\n\nfunction coerceFractionalSecondDigits(options) {\n let subsecDigits = options.fractionalSecondDigits;\n if (void 0 !== subsecDigits) {\n if (\"number\" != typeof subsecDigits) {\n if (\"auto\" === toString(subsecDigits)) {\n return;\n }\n throwRangeError(invalidEntity(\"fractionalSecondDigits\", subsecDigits));\n }\n subsecDigits = clampEntity(\"fractionalSecondDigits\", Math.floor(subsecDigits), 0, 9, 1);\n }\n return subsecDigits;\n}\n\nfunction coerceUnitOption(optionName, options, minUnit = 0, ensureDefined) {\n let unitStr = options[optionName];\n if (void 0 === unitStr) {\n return ensureDefined ? minUnit : void 0;\n }\n if (unitStr = toString(unitStr), \"auto\" === unitStr) {\n return ensureDefined ? minUnit : null;\n }\n let unit = unitNameMap[unitStr];\n return void 0 === unit && (unit = durationFieldNamesAsc.indexOf(unitStr)), unit < 0 && throwRangeError(invalidChoice(optionName, unitStr, unitNameMap)), \n unit;\n}\n\nfunction coerceChoiceOption(optionName, enumNameMap, options, defaultChoice = 0) {\n const enumArg = options[optionName];\n if (void 0 === enumArg) {\n return defaultChoice;\n }\n const enumStr = toString(enumArg);\n const enumNum = enumNameMap[enumStr];\n return void 0 === enumNum && throwRangeError(invalidChoice(optionName, enumStr, enumNameMap)), \n enumNum;\n}\n\nconst coerceSmallestUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, smallestUnitStr);\n\nconst coerceLargestUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, \"largestUnit\");\n\nconst coerceTotalUnit = /*@__PURE__*/ bindArgs(coerceUnitOption, \"unit\");\n\nconst coerceOverflow = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"overflow\", overflowMap);\n\nconst coerceEpochDisambig = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"disambiguation\", epochDisambigMap);\n\nconst coerceOffsetDisambig = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"offset\", offsetDisambigMap);\n\nconst coerceCalendarDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"calendarName\", calendarDisplayMap);\n\nconst coerceTimeZoneDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"timeZoneName\", timeZoneDisplayMap);\n\nconst coerceOffsetDisplay = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"offset\", offsetDisplayMap);\n\nconst coerceRoundingMode = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"roundingMode\", roundingModeMap);\n\nconst coerceDirection = /*@__PURE__*/ bindArgs(coerceChoiceOption, \"direction\", directionMap);\n\nfunction validateRoundingInc(roundingInc, smallestUnit, allowManyLargeUnits, solarMode) {\n const upUnitNano = solarMode ? nanoInUtcDay : unitNanoMap[smallestUnit + 1];\n if (upUnitNano) {\n const unitNano = unitNanoMap[smallestUnit];\n upUnitNano % ((roundingInc = clampEntity(\"roundingIncrement\", roundingInc, 1, upUnitNano / unitNano - (solarMode ? 0 : 1), 1)) * unitNano) && throwRangeError(invalidEntity(\"roundingIncrement\", roundingInc));\n } else {\n roundingInc = clampEntity(\"roundingIncrement\", roundingInc, 1, allowManyLargeUnits ? 10 ** 9 : 1, 1);\n }\n return roundingInc;\n}\n\nfunction validateUnitRange(optionName, unit, minUnit, maxUnit) {\n return null != unit && clampEntity(optionName, unit, minUnit, maxUnit, 1, unitNamesAsc), \n unit;\n}\n\nfunction checkLargestSmallestUnit(largestUnit, smallestUnit) {\n smallestUnit > largestUnit && throwRangeError(flippedSmallestLargestUnit);\n}\n\nfunction refineDiffOptions(roundingModeInvert, options, defaultLargestUnit, maxUnit = 9, minUnit = 0, defaultRoundingMode = 4) {\n options = normalizeOptions(options);\n let largestUnit = coerceLargestUnit(options, minUnit);\n let roundingInc = coerceRoundingIncInteger(options);\n let roundingMode = coerceRoundingMode(options, defaultRoundingMode);\n let smallestUnit = coerceSmallestUnit(options, minUnit, 1);\n return largestUnit = validateUnitRange(\"largestUnit\", largestUnit, minUnit, maxUnit), \n smallestUnit = validateUnitRange(smallestUnitStr, smallestUnit, minUnit, maxUnit), \n null == largestUnit ? largestUnit = Math.max(defaultLargestUnit, smallestUnit) : checkLargestSmallestUnit(largestUnit, smallestUnit), \n roundingInc = validateRoundingInc(roundingInc, smallestUnit, 1), roundingModeInvert && (roundingMode = (roundingMode => roundingMode < 4 ? (roundingMode + 2) % 4 : roundingMode)(roundingMode)), \n [ largestUnit, smallestUnit, roundingInc, roundingMode ];\n}\n\nfunction refineDurationRoundOptions(options, defaultLargestUnit, refineRelativeTo) {\n options = normalizeOptionsOrString(options, smallestUnitStr);\n let largestUnit = coerceLargestUnit(options);\n const relativeToInternals = refineRelativeTo(options.relativeTo);\n let roundingInc = coerceRoundingIncInteger(options);\n const roundingMode = coerceRoundingMode(options, 7);\n let smallestUnit = coerceSmallestUnit(options);\n return void 0 === largestUnit && void 0 === smallestUnit && throwRangeError(missingSmallestLargestUnit), \n null == smallestUnit && (smallestUnit = 0), null == largestUnit && (largestUnit = Math.max(smallestUnit, defaultLargestUnit)), \n checkLargestSmallestUnit(largestUnit, smallestUnit), roundingInc = validateRoundingInc(roundingInc, smallestUnit, 1), \n roundingInc > 1 && smallestUnit > 5 && largestUnit !== smallestUnit && throwRangeError(\"For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit\"), \n [ largestUnit, smallestUnit, roundingInc, roundingMode, relativeToInternals ];\n}\n\nfunction refineRoundingOptions(options, maxUnit = 6, solarMode) {\n let roundingInc = coerceRoundingIncInteger(options = normalizeOptionsOrString(options, smallestUnitStr));\n const roundingMode = coerceRoundingMode(options, 7);\n let smallestUnit = coerceSmallestUnit(options);\n return smallestUnit = requirePropDefined(smallestUnitStr, smallestUnit), smallestUnit = validateUnitRange(smallestUnitStr, smallestUnit, 0, maxUnit), \n roundingInc = validateRoundingInc(roundingInc, smallestUnit, void 0, solarMode), \n [ smallestUnit, roundingInc, roundingMode ];\n}\n\nfunction refineUnitDiffOptions(unit, options) {\n return \"string\" == typeof options || Boolean(options && (options.roundingMode || void 0 !== options.roundingIncrement)) ? ((smallestUnit, options, allowManyLargeUnits, defaultRoundingMode = 7) => {\n let roundingInc = coerceRoundingIncInteger(options = normalizeOptionsOrString(options, \"roundingMode\"));\n const roundingMode = coerceRoundingMode(options, defaultRoundingMode);\n return roundingInc = validateRoundingInc(roundingInc, smallestUnit, allowManyLargeUnits), \n [ roundingInc, roundingMode ];\n })(unit, options, 1, 4) : [ 1, void 0 ];\n}\n\nfunction refineUnitRoundOptions(smallestUnit, options, solarMode) {\n let roundingInc = coerceRoundingIncInteger(options = normalizeUnitRoundOptions(options));\n const roundingMode = coerceRoundingMode(options, 7);\n return roundingInc = validateRoundingInc(roundingInc, smallestUnit, void 0, solarMode), \n [ roundingInc, roundingMode ];\n}\n\nfunction normalizeUnitRoundOptions(options) {\n return void 0 === options ? Object.create(null) : normalizeOptionsOrString(options, \"roundingMode\");\n}\n\nfunction refineTotalOptions(options, refineRelativeTo) {\n const relativeToInternals = refineRelativeTo((options = normalizeOptionsOrString(options, \"unit\")).relativeTo);\n let totalUnit = coerceTotalUnit(options);\n return totalUnit = requirePropDefined(\"unit\", totalUnit), [ totalUnit, relativeToInternals ];\n}\n\nfunction refineOverflowOptions(options) {\n return void 0 === options ? 0 : coerceOverflow(requireObjectLike(options));\n}\n\nfunction refineZonedFieldOptions(options, defaultOffsetDisambig = 0) {\n options = normalizeOptions(options);\n const epochDisambig = coerceEpochDisambig(options);\n const offsetDisambig = coerceOffsetDisambig(options, defaultOffsetDisambig);\n return [ coerceOverflow(options), offsetDisambig, epochDisambig ];\n}\n\nfunction refineEpochDisambigOptions(options) {\n return coerceEpochDisambig(normalizeOptions(options));\n}\n\nfunction refineTimeDisplayTuple(options, maxSmallestUnit = 4) {\n const subsecDigits = coerceFractionalSecondDigits(options);\n const roundingMode = coerceRoundingMode(options, 4);\n const smallestUnit = coerceSmallestUnit(options);\n return [ roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, maxSmallestUnit), subsecDigits) ];\n}\n\nfunction refineDateTimeDisplayOptions(options) {\n return options = normalizeOptions(options), [ coerceCalendarDisplay(options), ...refineTimeDisplayTuple(options) ];\n}\n\nfunction refineDateDisplayOptions(options) {\n return coerceCalendarDisplay(normalizeOptions(options));\n}\n\nfunction refineTimeDisplayOptions(options, maxSmallestUnit) {\n return refineTimeDisplayTuple(normalizeOptions(options), maxSmallestUnit);\n}\n\nfunction refineZonedDateTimeDisplayOptions(options) {\n options = normalizeOptions(options);\n const calendarDisplay = coerceCalendarDisplay(options);\n const subsecDigits = coerceFractionalSecondDigits(options);\n const offsetDisplay = coerceOffsetDisplay(options);\n const roundingMode = coerceRoundingMode(options, 4);\n const smallestUnit = coerceSmallestUnit(options);\n return [ calendarDisplay, coerceTimeZoneDisplay(options), offsetDisplay, roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, 4), subsecDigits) ];\n}\n\nfunction refineInstantDisplayOptions(options) {\n const subsecDigits = coerceFractionalSecondDigits(options = normalizeOptions(options));\n const roundingMode = coerceRoundingMode(options, 4);\n const smallestUnit = coerceSmallestUnit(options);\n return [ options.timeZone, roundingMode, ...resolveSmallestUnitAndSubsecDigits(validateUnitRange(smallestUnitStr, smallestUnit, 0, 4), subsecDigits) ];\n}\n\nfunction resolveSmallestUnitAndSubsecDigits(smallestUnit, subsecDigits) {\n return null != smallestUnit ? [ unitNanoMap[smallestUnit], smallestUnit < 4 ? 9 - 3 * smallestUnit : -1 ] : [ void 0 === subsecDigits ? 1 : 10 ** (9 - subsecDigits), subsecDigits ];\n}\n\nfunction refineDirectionOptions(options) {\n const normalizedOptions = normalizeOptionsOrString(options, \"direction\");\n const res = coerceDirection(normalizedOptions, 0);\n return res || throwRangeError(invalidEntity(\"direction\", res)), res;\n}\n\nexport { normalizeUnitRoundOptions, refineDateDisplayOptions, refineDateTimeDisplayOptions, refineDiffOptions, refineDirectionOptions, refineDurationRoundOptions, refineEpochDisambigOptions, refineInstantDisplayOptions, refineOverflowOptions, refineRoundingOptions, refineTimeDisplayOptions, refineTotalOptions, refineUnitDiffOptions, refineUnitRoundOptions, refineZonedDateTimeDisplayOptions, refineZonedFieldOptions, roundingModeFuncs };\n","import * as TemporalUtils from \"temporal-utils/protected\";\n\nimport { toFiniteNumber, isObjectLike as isObjectLike$1, normalizeOptions, toIntegerWithTrunc, toPositiveIntegerWithTruncation, requireObjectLike } from \"temporal-utils/protected\";\n\nimport { roundingModeFuncs, refineDurationRoundOptions, refineInstantDisplayOptions, refineZonedDateTimeDisplayOptions, refineDateTimeDisplayOptions, refineDateDisplayOptions, refineTimeDisplayOptions, refineZonedFieldOptions, refineOverflowOptions, refineTotalOptions } from \"./options.js\";\n\nimport * as baseErrorMessages from \"temporal-utils/protected-error-messages\";\n\nconst invalidEntity = baseErrorMessages.invalidEntity;\n\nconst unsupportedWeekNumbers = baseErrorMessages.unsupportedWeekNumbers;\n\nconst missingField = fieldName => `Missing ${fieldName}`;\n\nconst noValidFields = validFields => \"No valid fields: \" + validFields.join();\n\nconst invalidBag = \"Invalid bag\";\n\nconst invalidChoice = (fieldName, val, choiceMap) => baseErrorMessages.invalidEntity(fieldName, val) + \"; must be \" + Object.keys(choiceMap).join();\n\nconst forbiddenValueOf = \"Cannot use valueOf\";\n\nconst invalidCallingContext = \"Invalid calling context\";\n\nconst missingYear = allowEra => \"Missing year\" + (allowEra ? \"/era/eraYear\" : \"\");\n\nconst invalidLeapMonth = \"Invalid leap month\";\n\nconst invalidCalendar = calendarId => baseErrorMessages.invalidEntity(\"Calendar\", calendarId);\n\nconst exoticCalendarRequired = (calendarId, remedy) => `Unknown calendar ${calendarId}; might need ${remedy}`;\n\nconst invalidTimeZone = calendarId => baseErrorMessages.invalidEntity(\"TimeZone\", calendarId);\n\nconst outOfBoundsDate = \"Out-of-bounds date\";\n\nconst invalidRelativeTo = arg => invalidEntity(\"relativeTo\", arg);\n\nconst missingSmallestLargestUnit = \"Required smallestUnit or largestUnit\";\n\nconst flippedSmallestLargestUnit = \"smallestUnit > largestUnit\";\n\nconst failedParse = s => `Cannot parse: ${s}`;\n\nconst invalidSubstring = substring => `Invalid substring: ${substring}`;\n\nconst invalidFormatType = branding => `Cannot format ${branding}`;\n\nconst mismatchingFormatTypes = \"Mismatching types for formatting\";\n\nconst constrainToRange = TemporalUtils.constrainToRange;\n\nconst isObjectLike = TemporalUtils.isObjectLike;\n\nfunction throwRangeError(message) {\n throw new RangeError(message);\n}\n\nfunction throwTypeError(message) {\n throw new TypeError(message);\n}\n\nfunction clampProp(props, propName, min, max, overflow) {\n return clampEntity(propName, ((props, propName) => {\n const propVal = props[propName];\n return void 0 === propVal && throwTypeError(missingField(propName)), propVal;\n })(props, propName), min, max, overflow);\n}\n\nfunction clampEntity(entityName, num, min, max, overflow, choices) {\n const clamped = constrainToRange(num, min, max);\n return overflow && num !== clamped && throwRangeError(((entityName, val, min, max, choices) => choices ? baseErrorMessages.numberOutOfRange(entityName, choices[val], choices[min], choices[max]) : baseErrorMessages.numberOutOfRange(entityName, val, min, max))(entityName, num, min, max, choices)), \n clamped;\n}\n\nfunction memoize(generator, MapClass = Map) {\n const map = new MapClass;\n return (key, ...otherArgs) => {\n if (map.has(key)) {\n return map.get(key);\n }\n const val = generator(key, ...otherArgs);\n return map.set(key, val), val;\n };\n}\n\nconst createNameDescriptors = name => createPropDescriptors({\n name: name\n}, 1);\n\nconst createPropDescriptors = (propVals, readonly) => mapProps(value => ({\n value: value,\n configurable: 1,\n writable: !readonly\n}), propVals);\n\nconst createStringTagDescriptors = value => ({\n [Symbol.toStringTag]: {\n value: value,\n configurable: 1\n }\n});\n\nfunction mapProps(transformer, props) {\n const res = {};\n for (const propName in props) {\n res[propName] = transformer(props[propName], propName);\n }\n return res;\n}\n\nfunction zipPropsConst(propNames, propVal) {\n const res = {};\n for (const propName of propNames) {\n res[propName] = propVal;\n }\n return res;\n}\n\nfunction createPropGetters(propNames) {\n const getters = {};\n for (const propName of propNames) {\n getters[propName] = slots => slots[propName];\n }\n return getters;\n}\n\nfunction pluckProps(propNames, props, dest = Object.create(null)) {\n for (const propName of propNames) {\n dest[propName] = props[propName];\n }\n return dest;\n}\n\nfunction allPropsEqual(propNames, props0, props1) {\n for (const propName of propNames) {\n if (props0[propName] !== props1[propName]) {\n return 0;\n }\n }\n return 1;\n}\n\nfunction zeroOutProps(propNames, clearUntilI, props) {\n const copy = {\n ...props\n };\n for (let i = 0; i < clearUntilI; i++) {\n copy[propNames[i]] = 0;\n }\n return copy;\n}\n\nfunction bindArgs(f, ...boundArgs) {\n return (...dynamicArgs) => f(...boundArgs, ...dynamicArgs);\n}\n\nfunction identity(arg) {\n return arg;\n}\n\nfunction noop() {}\n\nfunction capitalize(s) {\n return s[0].toUpperCase() + s.substring(1);\n}\n\nfunction sortStrings(...strss) {\n return [].concat(...strss).sort();\n}\n\nfunction createRegExp(meat) {\n return new RegExp(`^${meat}$`, \"i\");\n}\n\nfunction parseSubsecNano(fracStr) {\n return parseInt(fracStr.padEnd(9, \"0\"));\n}\n\nfunction parseSign(s) {\n return s && \"+\" !== s ? -1 : 1;\n}\n\nfunction parseInt0(s) {\n return void 0 === s ? 0 : parseInt(s);\n}\n\nfunction padNumber(digits, num) {\n return String(num).padStart(digits, \"0\");\n}\n\nconst padNumber2 = /*@__PURE__*/ bindArgs(padNumber, 2);\n\nfunction compareNumbers(a, b) {\n return Math.sign(a - b);\n}\n\nfunction compareBigInts(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nfunction divFloorBigInt(num, denom) {\n const whole = num / denom;\n return num % denom < 0n ? whole - 1n : whole;\n}\n\nfunction divModFloorBigInt(num, divisor) {\n const quotient = divFloorBigInt(num, divisor);\n return [ quotient, num - quotient * divisor ];\n}\n\nfunction divModFloor(num, divisor) {\n return [ Math.floor(num / divisor), modFloor(num, divisor) ];\n}\n\nfunction modFloor(num, divisor) {\n return (num % divisor + divisor) % divisor;\n}\n\nfunction divTrunc(num, divisor) {\n return Math.trunc(num / divisor) || 0;\n}\n\nfunction modTrunc(num, divisor) {\n return num % divisor || 0;\n}\n\nfunction roundExpand(num) {\n return num < 0 ? Math.floor(num) : Math.ceil(num);\n}\n\nfunction fabricateNearHalfFraction(halfCompare, sign = 1) {\n return sign * (.5 + halfCompare / 5);\n}\n\nfunction roundHalfExpand(num) {\n return Math.sign(num) * Math.round(Math.abs(num)) || 0;\n}\n\nfunction roundHalfFloor(num) {\n return hasHalf(num) ? Math.floor(num) : Math.round(num);\n}\n\nfunction roundHalfCeil(num) {\n return hasHalf(num) ? Math.ceil(num) : Math.round(num);\n}\n\nfunction roundHalfTrunc(num) {\n return hasHalf(num) ? Math.trunc(num) || 0 : Math.round(num);\n}\n\nfunction roundHalfEven(num) {\n return hasHalf(num) ? (num = Math.trunc(num) || 0) + num % 2 : Math.round(num);\n}\n\nfunction hasHalf(num) {\n return .5 === Math.abs(num % 1);\n}\n\nconst isoCalendarId = \"iso8601\";\n\nconst gregoryCalendarId = \"gregory\";\n\nconst gregoryEraOrigins = {\n \"bce\": -1,\n \"ce\": 0\n};\n\nfunction normalizeEraName(era) {\n const normalized = era.normalize(\"NFD\").toLowerCase().replace(/[^a-z0-9]/g, \"\");\n return \"bc\" === normalized || \"b\" === normalized ? \"bce\" : \"ad\" === normalized || \"a\" === normalized ? \"ce\" : normalized;\n}\n\nconst isoCalendarImpl = void 0;\n\nconst gregoryCalendarImpl = 0;\n\nfunction getCalendarSlotId(calendar) {\n return calendar === isoCalendarImpl ? \"iso8601\" : 0 === calendar ? \"gregory\" : calendar.id;\n}\n\nconst monthCodeRegExp = /^M(\\d{2})(L?)$/;\n\nfunction parseMonthCode(monthCode) {\n const m = monthCodeRegExp.exec(monthCode);\n return m || throwRangeError((monthCode => `Invalid monthCode: ${monthCode}`)(monthCode)), \n [ parseInt(m[1]), Boolean(m[2]) ];\n}\n\nfunction formatMonthCode(monthCodeNumber, isLeapMonth) {\n return \"M\" + padNumber2(monthCodeNumber) + (isLeapMonth ? \"L\" : \"\");\n}\n\nfunction monthCodeNumberToMonth(monthCodeNumber, isLeapMonth, leapMonth) {\n return monthCodeNumber + (isLeapMonth || leapMonth && monthCodeNumber >= leapMonth ? 1 : 0);\n}\n\nfunction monthToMonthCodeNumber(month, leapMonth) {\n return month - (leapMonth && month >= leapMonth ? 1 : 0);\n}\n\nconst unitNameMap = {\n nanosecond: 0,\n microsecond: 1,\n millisecond: 2,\n second: 3,\n minute: 4,\n hour: 5,\n day: 6,\n week: 7,\n month: 8,\n year: 9\n};\n\nconst unitNamesAsc = /*@__PURE__*/ Object.keys(unitNameMap);\n\nconst milliInUtcDay = 864e5;\n\nconst nanoInMicro = TemporalUtils.nanoInMicro;\n\nconst nanoInMilli = TemporalUtils.nanoInMilli;\n\nconst nanoInSec = TemporalUtils.nanoInSec;\n\nconst nanoInMinute = TemporalUtils.nanoInMinute;\n\nconst nanoInHour = TemporalUtils.nanoInHour;\n\nconst nanoInUtcDay = 864e11;\n\nconst unitNanoMap = [ 1, nanoInMicro, nanoInMilli, nanoInSec, nanoInMinute, nanoInHour, nanoInUtcDay ];\n\nconst bigNanoInMicro = /*@__PURE__*/ BigInt(nanoInMicro);\n\nconst bigNanoInMilli = /*@__PURE__*/ BigInt(nanoInMilli);\n\nconst bigNanoInSec = /*@__PURE__*/ BigInt(nanoInSec);\n\nconst bigNanoInMinute = /*@__PURE__*/ BigInt(nanoInMinute);\n\nconst bigNanoInHour = /*@__PURE__*/ BigInt(nanoInHour);\n\nconst bigNanoInUtcDay = /*@__PURE__*/ BigInt(nanoInUtcDay);\n\nfunction divideBigNanoToExactNumber(bigNano, divisorNano) {\n const days = Number(bigNano / bigNanoInUtcDay);\n const timeNano = Number(bigNano % bigNanoInUtcDay);\n return days * (nanoInUtcDay / divisorNano) + (Math.trunc(timeNano / divisorNano) + timeNano % divisorNano / divisorNano);\n}\n\nconst timeFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.slice(0, 6);\n\nconst timeGetters = /*@__PURE__*/ createPropGetters(timeFieldNamesAsc);\n\nconst yearFieldNamesAsc = [ \"year\" ];\n\nconst dayFieldNamesAsc = [ \"day\" ];\n\nconst calendarDateFieldNamesAsc = [ \"day\", \"month\", \"year\" ];\n\nconst offsetFieldNames = [ \"offset\" ];\n\nconst timeZoneFieldNames = [ \"timeZone\" ];\n\nconst eraYearFieldNames = [ \"era\", \"eraYear\" ];\n\nconst allYearFieldNames = [ \"era\", \"eraYear\", \"year\" ];\n\nconst monthFieldNames = [ \"month\", \"monthCode\" ];\n\nconst monthDayFieldNames = [ \"day\", \"month\", \"monthCode\" ];\n\nconst timeFieldNamesAlpha = /*@__PURE__*/ sortStrings(timeFieldNamesAsc);\n\nconst yearFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearFieldNamesAsc);\n\nconst yearMonthFieldNamesAlpha = /*@__PURE__*/ sortStrings(monthFieldNames, yearFieldNamesAsc);\n\nconst yearMonthFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthFieldNamesAlpha);\n\nconst yearMonthCodeFieldNamesAlpha = /*@__PURE__*/ sortStrings([ \"monthCode\" ], yearFieldNamesAsc);\n\nconst yearMonthCodeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(eraYearFieldNames, yearMonthCodeFieldNamesAlpha);\n\nconst monthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, [ \"monthCode\" ]);\n\nconst dateFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthFieldNamesAlpha);\n\nconst dateFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthFieldNamesAlpha);\n\nconst dateTimeFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc);\n\nconst dateTimeFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc);\n\nconst dateTimeAndOffsetFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc, offsetFieldNames);\n\nconst dateTimeAndOffsetFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc, offsetFieldNames);\n\nconst dateTimeAndZoneFieldNamesAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesAlpha, timeFieldNamesAsc, offsetFieldNames, timeZoneFieldNames);\n\nconst dateTimeAndZoneFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dateFieldNamesWithEraAlpha, timeFieldNamesAsc, offsetFieldNames, timeZoneFieldNames);\n\nconst yearMonthCodeDayFieldNamesAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, yearMonthCodeFieldNamesAlpha);\n\nconst yearMonthCodeDayFieldNamesWithEraAlpha = /*@__PURE__*/ sortStrings(dayFieldNamesAsc, eraYearFieldNames, yearMonthCodeFieldNamesAlpha);\n\nconst timeFieldDefaults = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, 0);\n\nfunction validateTimeFields(timeFields) {\n return constrainTimeFields(timeFields, 1), timeFields;\n}\n\nconst maxValues = {\n hour: 23,\n minute: 59,\n second: 59\n};\n\nfunction constrainTimeFields(timeFields, overflow) {\n const constrainedFields = {};\n for (const fieldName of timeFieldNamesAsc) {\n constrainedFields[fieldName] = clampEntity(fieldName, timeFields[fieldName], 0, maxValues[fieldName] || 999, overflow);\n }\n return constrainedFields;\n}\n\nfunction timeFieldsToNano(timeFields) {\n return timeFieldsToSec(timeFields) * nanoInSec + timeFieldsToSubsecNano(timeFields);\n}\n\nfunction timeFieldsToMilli(timeFields) {\n return 1e3 * timeFieldsToSec(timeFields) + timeFields.millisecond;\n}\n\nfunction timeFieldsToSec(timeFields) {\n return 3600 * timeFields.hour + 60 * timeFields.minute + timeFields.second;\n}\n\nfunction timeFieldsToSubsecNano(timeFields) {\n return timeFields.millisecond * nanoInMilli + timeFields.microsecond * nanoInMicro + timeFields.nanosecond;\n}\n\nfunction nanoToTimeAndDay(nano) {\n const [dayDelta, timeNano] = divModFloor(nano, nanoInUtcDay);\n return [ nanoToTimeFields(timeNano), dayDelta ];\n}\n\nfunction nanoToTimeFields(timeNano) {\n const [timeMilli, nanoAfterMilli] = divModFloor(timeNano, nanoInMilli);\n const [microsecond, nanosecond] = divModFloor(nanoAfterMilli, nanoInMicro);\n return milliToTimeFields(timeMilli, microsecond, nanosecond);\n}\n\nfunction milliToTimeFields(timeMilli, microsecond = 0, nanosecond = 0) {\n const [hour, milliAfterHour] = divModFloor(timeMilli, 36e5);\n const [minute, milliAfterMinute] = divModFloor(milliAfterHour, 6e4);\n const [second, millisecond] = divModFloor(milliAfterMinute, 1e3);\n return {\n hour: hour,\n minute: minute,\n second: second,\n millisecond: millisecond,\n microsecond: microsecond,\n nanosecond: nanosecond\n };\n}\n\nfunction epochNanoToSecMod(epochNano) {\n const [epochSec, nano] = divModFloorBigInt(epochNano, bigNanoInSec);\n return [ Number(epochSec), Number(nano) ];\n}\n\nfunction epochNanoToMilli(epochNano) {\n return Number(divFloorBigInt(epochNano, bigNanoInMilli));\n}\n\nfunction isoDateTimeToEpochNano(isoDateTime) {\n return isoDateToEpochNano(isoDateTime) + BigInt(timeFieldsToNano(isoDateTime));\n}\n\nfunction isoDateTimeToEpochMilli(isoDateTime) {\n return isoDateToEpochMilli(isoDateTime) + timeFieldsToMilli(isoDateTime);\n}\n\nfunction isoDateToEpochNano(isoDate) {\n return BigInt(isoDateToEpochDays(isoDate)) * bigNanoInUtcDay;\n}\n\nfunction isoDateToEpochMilli(isoDate) {\n return 864e5 * isoDateToEpochDays(isoDate);\n}\n\nfunction isoDateToEpochDays(isoDate) {\n return isoPartsToEpochDays(isoDate.year, isoDate.month, isoDate.day);\n}\n\nfunction isoPartsToEpochDays(isoYear, isoMonth = 1, isoDay = 1) {\n const monthIndex = isoMonth - 1;\n return isoYear += Math.floor(monthIndex / 12), isoMonth = modFloor(monthIndex, 12), \n Date.UTC(isoYear % 400 - 400, isoMonth, 0) / 864e5 + 146097 * (divTrunc(isoYear, 400) + 1) + isoDay;\n}\n\nfunction epochNanoToIsoDateTime(epochNano) {\n const [epochDays, nanoAfterDay] = divModFloorBigInt(epochNano, bigNanoInUtcDay);\n return {\n ...epochDaysToIsoDate(Number(epochDays)),\n ...nanoToTimeFields(Number(nanoAfterDay))\n };\n}\n\nfunction epochMilliToIsoDateTime(epochMilli, microsecond = 0, nanosecond = 0) {\n const [epochDays, milliAfterDay] = divModFloor(epochMilli, 864e5);\n return {\n ...epochDaysToIsoDate(epochDays),\n ...milliToTimeFields(milliAfterDay, microsecond, nanosecond)\n };\n}\n\nfunction epochDaysToIsoDate(epochDays) {\n const legacyDate = new Date(864e5 * modFloor(epochDays, 146097));\n return {\n year: legacyDate.getUTCFullYear() + 400 * Math.floor(epochDays / 146097),\n month: legacyDate.getUTCMonth() + 1,\n day: legacyDate.getUTCDate()\n };\n}\n\nfunction diffEpochMilliDays(epochMilli0, epochMilli1) {\n return Math.trunc((epochMilli1 - epochMilli0) / 864e5);\n}\n\nconst isoEpochOriginYear = 1970;\n\nconst isoEpochFirstLeapYear = 1972;\n\nconst isoMonthsInYear = 12;\n\nfunction computeIsoMonthCodeParts(month) {\n return [ month, 0 ];\n}\n\nfunction computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth) {\n if (!isLeapMonth) {\n return {\n year: 1972,\n month: monthCodeNumber\n };\n }\n}\n\nfunction computeIsoFieldsFromParts(year, month, day) {\n return {\n year: year,\n month: month,\n day: day\n };\n}\n\nfunction computeIsoDaysInMonth(year, month) {\n switch (month) {\n case 2:\n return computeIsoInLeapYear(year) ? 29 : 28;\n\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n }\n return 31;\n}\n\nfunction computeIsoDaysInYear(year) {\n return computeIsoInLeapYear(year) ? 366 : 365;\n}\n\nfunction computeIsoInLeapYear(year) {\n return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0);\n}\n\nfunction addIsoMonths(year, month, monthDelta) {\n return year += divTrunc(monthDelta, 12), (month += modTrunc(monthDelta, 12)) < 1 ? (year--, \n month += 12) : month > 12 && (year++, month -= 12), {\n year: year,\n month: month\n };\n}\n\nfunction diffIsoMonthSlots(year0, month0, year1, month1) {\n return 12 * (year1 - year0) + month1 - month0;\n}\n\nfunction computeIsoDayOfWeek(isoDate) {\n return modFloor(isoPartsToEpochDays(isoDate.year, isoDate.month, isoDate.day) + 4, 7) || 7;\n}\n\nfunction computeIsoDayOfYear(isoDate) {\n return isoPartsToEpochDays(isoDate.year, isoDate.month, isoDate.day) - isoPartsToEpochDays(isoDate.year) + 1;\n}\n\nfunction computeIsoWeekFields(isoDate) {\n let yearOfWeek = isoDate.year;\n let weekOfYear = Math.floor((computeIsoDayOfYear(isoDate) - computeIsoDayOfWeek(isoDate) + 10) / 7);\n let weeksInYear = computeIsoWeeksInYear(yearOfWeek);\n return weekOfYear < 1 ? weekOfYear = weeksInYear = computeIsoWeeksInYear(--yearOfWeek) : weekOfYear > weeksInYear && (weekOfYear = 1, \n weeksInYear = computeIsoWeeksInYear(++yearOfWeek)), {\n weekOfYear: weekOfYear,\n yearOfWeek: yearOfWeek,\n De: weeksInYear\n };\n}\n\nfunction computeIsoWeeksInYear(year) {\n const y0DayOfWeek = computeIsoDayOfWeek({\n year: year,\n month: 1,\n day: 1\n });\n return 4 === y0DayOfWeek || 3 === y0DayOfWeek && computeIsoInLeapYear(year) ? 53 : 52;\n}\n\nfunction computeGregoryEraFields({year: year}) {\n return year < 1 ? {\n era: \"bce\",\n eraYear: 1 - year\n } : {\n era: \"ce\",\n eraYear: year\n };\n}\n\nfunction validateIsoDateTimeFields(isoDateTime) {\n return validateIsoDateFields(isoDateTime), validateTimeFields(isoDateTime);\n}\n\nfunction validateIsoDateFields(isoInternals) {\n return constrainIsoDateFields(isoInternals, 1), isoInternals;\n}\n\nfunction isIsoDateFieldsValid(isoDate) {\n return allPropsEqual(calendarDateFieldNamesAsc, isoDate, constrainIsoDateFields(isoDate));\n}\n\nfunction constrainIsoDateFields(isoDate, overflow) {\n const {year: year} = isoDate;\n const month = clampProp(isoDate, \"month\", 1, 12, overflow);\n return {\n year: year,\n month: month,\n day: clampProp(isoDate, \"day\", 1, computeIsoDaysInMonth(year, month), overflow)\n };\n}\n\nfunction computeCalendarDateFields(calendar, isoDate) {\n return calendar ? calendar.de(isoDate) : isoDate;\n}\n\nfunction computeCalendarMonthCodeParts(calendar, year, month) {\n return calendar ? calendar.N(year, month) : computeIsoMonthCodeParts(month);\n}\n\nfunction computeCalendarEraFields(calendar, isoDate) {\n return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar && calendar.h?.(isoDate) || {};\n}\n\nfunction computeCalendarIsoFieldsFromParts(calendar, year, month, day) {\n return calendar ? calendar.fe(year, month, day) : computeIsoFieldsFromParts(year, month, day);\n}\n\nfunction computeCalendarMonthsInYearForYear(calendar, year) {\n return calendar ? calendar.j(year) : 12;\n}\n\nfunction computeCalendarDaysInMonthForYearMonth(calendar, year, month) {\n return calendar ? calendar.o(year, month) : computeIsoDaysInMonth(year, month);\n}\n\nfunction computeCalendarMonthCode(calendar, isoDate) {\n const {year: year, month: month} = computeCalendarDateFields(calendar, isoDate);\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n return formatMonthCode(monthCodeNumber, isLeapMonth);\n}\n\nfunction computeCalendarInLeapYear(calendar, isoDate) {\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n return calendar ? calendar.q(year) : computeIsoInLeapYear(year);\n}\n\nfunction computeCalendarMonthsInYear(calendar, isoDate) {\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n return computeCalendarMonthsInYearForYear(calendar, year);\n}\n\nfunction computeCalendarDaysInMonth(calendar, isoDate) {\n const {year: year, month: month} = computeCalendarDateFields(calendar, isoDate);\n return computeCalendarDaysInMonthForYearMonth(calendar, year, month);\n}\n\nfunction computeCalendarDaysInYear(calendar, isoDate) {\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n return calendar ? calendar.i(year) : computeIsoDaysInYear(year);\n}\n\nfunction computeCalendarDayOfYear(calendar, isoDate) {\n if (!calendar) {\n return computeIsoDayOfYear(isoDate);\n }\n const {year: year} = computeCalendarDateFields(calendar, isoDate);\n const yearStartIsoDate = computeCalendarIsoFieldsFromParts(calendar, year, 1, 1);\n return isoDateToEpochDays(isoDate) - isoDateToEpochDays(yearStartIsoDate) + 1;\n}\n\nfunction computeCalendarWeekOfYear(calendar, isoDate) {\n return calendar === isoCalendarImpl ? computeIsoWeekFields(isoDate).weekOfYear : void 0;\n}\n\nfunction computeCalendarYearOfWeek(calendar, isoDate) {\n return calendar === isoCalendarImpl ? computeIsoWeekFields(isoDate).yearOfWeek : void 0;\n}\n\nconst durationFieldNamesAsc = /*@__PURE__*/ unitNamesAsc.map(unitName => unitName + \"s\");\n\nconst durationGetters = /*@__PURE__*/ createPropGetters(durationFieldNamesAsc);\n\nconst durationFieldNamesAlpha = /*@__PURE__*/ sortStrings(durationFieldNamesAsc);\n\nconst durationTimeFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(0, 6);\n\nconst durationDateFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(6);\n\nconst durationCalendarFieldNamesAsc = /*@__PURE__*/ durationDateFieldNamesAsc.slice(1);\n\nconst durationFieldDefaults = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, 0);\n\nconst durationTimeFieldDefaults = /*@__PURE__*/ zipPropsConst(durationTimeFieldNamesAsc, 0);\n\nconst clearDurationFields = /*@__PURE__*/ bindArgs(zeroOutProps, durationFieldNamesAsc);\n\nfunction requirePropDefined(optionName, optionVal) {\n return null == optionVal && throwRangeError(missingField(optionName)), optionVal;\n}\n\nconst requireString = /*@__PURE__*/ bindArgs(requireType, \"string\");\n\nfunction requireType(typeName, arg, entityName = typeName) {\n return typeof arg !== typeName && throwTypeError(invalidEntity(entityName, arg)), \n arg;\n}\n\nfunction requireNumberIsInteger(num, entityName = \"number\") {\n return Number.isInteger(num) || throwRangeError(((entityName, num) => `Non-integer ${entityName}: ${num}`)(entityName, num)), \n num || 0;\n}\n\nfunction toString(arg) {\n return \"symbol\" == typeof arg && throwTypeError(\"Cannot convert Symbol to string\"), \n String(arg);\n}\n\nfunction toPrimitiveWithStringHint(arg) {\n if (!isObjectLike$1(arg)) {\n return arg;\n }\n const exoticToPrimitive = arg[Symbol.toPrimitive];\n if (null != exoticToPrimitive) {\n \"function\" != typeof exoticToPrimitive && throwTypeError();\n const primitive = Reflect.apply(exoticToPrimitive, arg, [ \"string\" ]);\n return isObjectLike$1(primitive) && throwTypeError(), primitive;\n }\n return Date.prototype[Symbol.toPrimitive].call(arg, \"string\");\n}\n\nfunction toBigInt(bi) {\n return \"boolean\" == typeof bi ? BigInt(bi ? 1 : 0) : \"string\" == typeof bi ? BigInt(bi) : (\"bigint\" != typeof bi && throwTypeError(`Invalid bigint: ${bi}`), \n bi);\n}\n\nfunction toStrictInteger(arg, entityName) {\n return requireNumberIsInteger(toFiniteNumber(arg, entityName), entityName);\n}\n\nfunction combineDateAndTime(isoDate, time) {\n return pluckProps(calendarDateFieldNamesAsc, isoDate, pluckProps(timeFieldNamesAsc, time));\n}\n\nconst maxMilli = 864e13;\n\nconst epochNanoMax = /*@__PURE__*/ BigInt(1e8) * bigNanoInUtcDay;\n\nconst epochNanoMin = /*@__PURE__*/ BigInt(-1e8) * bigNanoInUtcDay;\n\nconst plainDateEpochNanoMin = epochNanoMin - bigNanoInUtcDay;\n\nconst isoYearMonthIndexMin = -3261848;\n\nfunction checkIsoYearMonthInBounds(isoDate) {\n const isoYearMonthIndex = 12 * isoDate.year + isoDate.month;\n return (isoYearMonthIndex < isoYearMonthIndexMin || isoYearMonthIndex > 3309129) && throwRangeError(outOfBoundsDate), \n isoDate;\n}\n\nfunction checkIsoDateInBounds(isoDate, allowPlainDateLowerEdge = 1) {\n const epochNano = isoDateToEpochNano(isoDate);\n return (epochNano < (allowPlainDateLowerEdge ? plainDateEpochNanoMin : epochNanoMin) || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate), \n isoDate;\n}\n\nfunction checkIsoDateTimeInBounds(isoDateTime) {\n return checkIsoDateTimeEpochNanoInBounds(isoDateTimeToEpochNano(isoDateTime)), isoDateTime;\n}\n\nfunction checkIsoDateTimeEpochNanoInBounds(epochNano) {\n return (epochNano <= plainDateEpochNanoMin || epochNano >= epochNanoMax + bigNanoInUtcDay) && throwRangeError(outOfBoundsDate), \n epochNano;\n}\n\nfunction checkEpochNanoInBounds(epochNano) {\n return (epochNano < epochNanoMin || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate), \n epochNano;\n}\n\nfunction isoDateTimeAndOffsetToEpochNano(isoDateTime, offsetNano) {\n return checkEpochNanoInBounds(isoDateToEpochNano(isoDateTime) + BigInt(timeFieldsToNano(isoDateTime) - offsetNano));\n}\n\nfunction roundNumberToInc(num, roundingInc, roundingMode) {\n return roundWithMode(num / roundingInc, roundingMode) * roundingInc;\n}\n\nfunction roundWithMode(num, roundingMode) {\n return roundingModeFuncs[roundingMode](num);\n}\n\nfunction totalRelativeUnit(wholeValue, sign, endEpochNano, moveValueToEpochNano) {\n const unitWindow = clampRelativeUnitValue(wholeValue, sign, moveValueToEpochNano, endEpochNano);\n return interpolateRelativeUnitWindow(unitWindow, Number(endEpochNano - unitWindow.I) / Number(unitWindow.O - unitWindow.I));\n}\n\nfunction roundRelativeUnit(wholeValue, sign, endEpochNano, moveValueToEpochNano, roundingInc, roundingMode) {\n return roundRelativeUnitWindow(clampRelativeUnitValue(divTrunc(wholeValue, roundingInc) * roundingInc, roundingInc * sign, moveValueToEpochNano, endEpochNano), endEpochNano, roundingInc, roundingMode);\n}\n\nfunction roundRelativeUnitWindow(unitWindow, endEpochNano, roundingInc, roundingMode) {\n return roundNumberToInc(interpolateRelativeUnitWindow(unitWindow, computeEpochNanoFrac(endEpochNano, unitWindow.I, unitWindow.O)), roundingInc, roundingMode);\n}\n\nfunction clampRelativeUnitValue(startValue, valueDelta, moveValueToEpochNano, epochNanoProgress) {\n let unitWindow = computeRelativeUnitWindow(startValue, valueDelta, moveValueToEpochNano);\n return ((epochNanoProgress, epochNano0, epochNano1, sign) => sign > 0 ? epochNano0 <= epochNanoProgress && epochNanoProgress <= epochNano1 : epochNano1 <= epochNanoProgress && epochNanoProgress <= epochNano0)(epochNanoProgress, unitWindow.I, unitWindow.O, Math.sign(valueDelta)) || (unitWindow = computeRelativeUnitWindow(startValue + valueDelta, valueDelta, moveValueToEpochNano)), \n unitWindow;\n}\n\nfunction computeRelativeUnitWindow(startValue, valueDelta, moveValueToEpochNano) {\n const endValue = startValue + valueDelta;\n return {\n ve: startValue,\n qe: endValue,\n I: moveValueToEpochNano(startValue),\n O: moveValueToEpochNano(endValue)\n };\n}\n\nfunction interpolateRelativeUnitWindow(unitWindow, fraction) {\n return unitWindow.ve + fraction * (unitWindow.qe - unitWindow.ve);\n}\n\nfunction computeEpochNanoFrac(epochNanoProgress, epochNano0, epochNano1) {\n const denomBig = epochNano1 - epochNano0;\n const numeratorBig = epochNanoProgress - epochNano0;\n if (!numeratorBig) {\n return 0;\n }\n const absNumerator = numeratorBig < 0n ? -numeratorBig : numeratorBig;\n const absDenom = denomBig < 0n ? -denomBig : denomBig;\n const fracSign = compareBigInts(numeratorBig, 0n) === compareBigInts(denomBig, 0n) ? 1 : -1;\n return compareBigInts(absNumerator, absDenom) <= 0 ? absNumerator === absDenom ? fracSign : fabricateNearHalfFraction(compareBigInts(2n * absNumerator, absDenom), fracSign) : Number(numeratorBig) / Number(denomBig);\n}\n\nfunction createEpochNanoSlots(epochNano) {\n return {\n epochNanoseconds: epochNano\n };\n}\n\nfunction createZonedEpochNanoSlots(epochNano, timeZone, calendar) {\n return {\n calendar: calendar,\n timeZone: timeZone,\n epochNanoseconds: epochNano\n };\n}\n\nfunction createDateTimeSlots(isoDateTime, calendar) {\n return pluckProps(timeFieldNamesAsc, isoDateTime, createDateSlots(isoDateTime, calendar));\n}\n\nfunction createDateSlots(isoDate, calendar) {\n return pluckProps(calendarDateFieldNamesAsc, isoDate, {\n calendar: calendar\n });\n}\n\nfunction createTimeSlots(time) {\n return pluckProps(timeFieldNamesAsc, time);\n}\n\nfunction createDurationSlots(durationFields) {\n return pluckProps(durationFieldNamesAsc, durationFields, {\n sign: computeDurationSign(durationFields)\n });\n}\n\nfunction roundZonedEpochSlotsToUnit(slots, smallestUnit, roundingInc, roundingMode) {\n return createZonedEpochNanoSlots(6 === smallestUnit ? roundZonedEpochToDay(slots, roundingMode) : roundZonedEpochToTime(slots, smallestUnit, roundingInc, roundingMode), slots.timeZone, slots.calendar);\n}\n\nfunction computeZonedHoursInDay(slots) {\n const [epochNano0, epochNano1] = computeZonedDayEpochInterval(slots);\n return divideBigNanoToExactNumber(epochNano1 - epochNano0, nanoInHour);\n}\n\nfunction computeZonedStartOfDay(slots) {\n const {timeZone: timeZone, calendar: calendar} = slots;\n return createZonedEpochNanoSlots(getStartOfDayInstantFor(timeZone, combineDateAndTime(zonedEpochSlotsToIso(slots), timeFieldDefaults)), timeZone, calendar);\n}\n\nfunction alignZonedEpoch(computeAlignment, slots) {\n const {calendar: calendar, timeZone: timeZone} = slots;\n return getStartOfDayInstantFor(timeZone, computeAlignment(calendar, zonedEpochSlotsToIso(slots)));\n}\n\nfunction roundZonedEpochToInterval(computeInterval, slots, roundingMode) {\n const {calendar: calendar, timeZone: timeZone} = slots;\n const isoSlots = zonedEpochSlotsToIso(slots);\n const [isoDateTime0, isoDateTime1] = computeInterval(calendar, isoSlots);\n return roundZonedEpochToBounds(slots.epochNanoseconds, getStartOfDayInstantFor(timeZone, isoDateTime0), getStartOfDayInstantFor(timeZone, isoDateTime1), roundingMode);\n}\n\nfunction roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps, isZoned) {\n if (0 === smallestUnit && 1 === roundingInc) {\n return durationFields;\n }\n const sign = computeDurationSign(durationFields) || 1;\n const nudgeFunc = isUniformUnit(smallestUnit, isZoned) ? isZoned && smallestUnit < 6 && largestUnit >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;\n let [roundedDurationFields, roundedEpochNano, grewBigUnit] = nudgeFunc(sign, durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps);\n return grewBigUnit && 7 !== smallestUnit && (roundedDurationFields = ((durationFields, endEpochNano, largestUnit, smallestUnit, sign, relativeOps) => {\n for (let currentUnit = smallestUnit + 1; currentUnit <= largestUnit; currentUnit++) {\n if (7 === currentUnit && 7 !== largestUnit) {\n continue;\n }\n const baseDurationFields = clearDurationFields(currentUnit, durationFields);\n baseDurationFields[durationFieldNamesAsc[currentUnit]] += sign;\n const thresholdCompare = compareBigInts(endEpochNano, moveRelativeMarkerToEpochNano(relativeOps, baseDurationFields));\n if (thresholdCompare && thresholdCompare !== sign) {\n break;\n }\n durationFields = baseDurationFields;\n }\n return durationFields;\n })(roundedDurationFields, roundedEpochNano, largestUnit, Math.max(6, smallestUnit), sign, relativeOps)), \n roundedDurationFields;\n}\n\nfunction roundDayTimeDurationByInc(durationFields, nanoInc, roundingMode) {\n const maxUnit = Math.min(getMaxDurationUnit(durationFields), 6);\n return nanoToDurationDayTimeFields(roundBigNanoToInc(durationDayTimeToBigNano(durationFields), BigInt(nanoInc), roundingMode), maxUnit);\n}\n\nfunction roundZonedEpochToDay(slots, roundingMode) {\n const [epochNano0, epochNano1] = computeZonedDayEpochInterval(slots);\n return roundZonedEpochToBounds(slots.epochNanoseconds, epochNano0, epochNano1, roundingMode);\n}\n\nfunction roundZonedEpochToTime(slots, smallestUnit, roundingInc, roundingMode) {\n if (0 === smallestUnit && 1 === roundingInc) {\n return slots.epochNanoseconds;\n }\n const isoDateTime = zonedEpochSlotsToIso(slots);\n return getMatchingInstantFor(slots.timeZone, roundDateTimeToInc(isoDateTime, computeNanoInc(smallestUnit, roundingInc), roundingMode), isoDateTime.offsetNanoseconds, 2, 0, 1);\n}\n\nfunction roundDateTimeToInc(isoDateTime, nanoInc, roundingMode) {\n const [roundedTimeFields, dayDelta] = roundTimeToInc(isoDateTime, nanoInc, roundingMode);\n const roundedIsoDateTime = combineDateAndTime(moveDateByDays(isoDateTime, dayDelta), roundedTimeFields);\n return checkIsoDateTimeInBounds(roundedIsoDateTime), roundedIsoDateTime;\n}\n\nfunction roundTimeToInc(timeFields, nanoInc, roundingMode) {\n return nanoToTimeAndDay(roundNumberToInc(timeFieldsToNano(timeFields), nanoInc, roundingMode));\n}\n\nfunction nudgeRelativeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps) {\n const smallestUnitFieldName = durationFieldNamesAsc[smallestUnit];\n const baseDurationFields = clearDurationFields(smallestUnit, durationFields);\n 7 === smallestUnit && (durationFields = {\n ...durationFields,\n weeks: durationFields.weeks + Math.trunc(durationFields.days / 7)\n });\n const truncedVal = divTrunc(durationFields[smallestUnitFieldName], roundingInc) * roundingInc;\n const nudgeWindow = clampRelativeUnitValue(truncedVal, roundingInc * sign, value => (baseDurationFields[smallestUnitFieldName] = value, \n moveRelativeMarkerToEpochNano(relativeOps, baseDurationFields)), endEpochNano);\n const roundedVal = roundRelativeUnitWindow(nudgeWindow, endEpochNano, roundingInc, roundingMode);\n return baseDurationFields[smallestUnitFieldName] = roundedVal, [ baseDurationFields, roundedVal === nudgeWindow.qe ? nudgeWindow.O : nudgeWindow.I, roundedVal !== truncedVal ];\n}\n\nfunction nudgeZonedTimeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps) {\n const timeNano = Number(durationTimeToBigNano(durationFields));\n const nanoInc = computeNanoInc(smallestUnit, roundingInc);\n let roundedTimeNano = roundNumberToInc(timeNano, nanoInc, roundingMode);\n const dateDurationFields = {\n ...durationFields,\n ...durationTimeFieldDefaults\n };\n const dayWindow = clampRelativeUnitValue(dateDurationFields.days, sign, days => (dateDurationFields.days = days, \n moveRelativeMarkerToEpochNano(relativeOps, dateDurationFields)), endEpochNano);\n const dayEpochNano0 = dayWindow.I;\n const dayEpochNano1 = dayWindow.O;\n const beyondDayNano = roundedTimeNano - Number(dayEpochNano1 - dayEpochNano0);\n let dayDelta = 0;\n beyondDayNano && Math.sign(beyondDayNano) !== sign ? endEpochNano = dayEpochNano0 + BigInt(roundedTimeNano) : (dayDelta += sign, \n roundedTimeNano = roundNumberToInc(beyondDayNano, nanoInc, roundingMode), endEpochNano = dayEpochNano1 + BigInt(roundedTimeNano));\n const durationTimeFields = nanoToDurationTimeFields(roundedTimeNano);\n return [ {\n ...durationFields,\n ...durationTimeFields,\n days: durationFields.days + dayDelta\n }, endEpochNano, Boolean(dayDelta) ];\n}\n\nfunction nudgeDayTimeDuration(sign, durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) {\n const bigNano = durationDayTimeToBigNano(durationFields);\n const roundedBigNano = roundBigNanoToInc(bigNano, computeBigNanoInc(smallestUnit, roundingInc), roundingMode);\n const nanoDiff = roundedBigNano - bigNano;\n const expandedBigUnit = Math.sign(Number(roundedBigNano / bigNanoInUtcDay) - Number(bigNano / bigNanoInUtcDay)) === sign;\n const roundedDayTimeFields = nanoToDurationDayTimeFields(roundedBigNano, Math.min(largestUnit, 6));\n return [ {\n ...durationFields,\n ...roundedDayTimeFields\n }, endEpochNano + nanoDiff, expandedBigUnit ];\n}\n\nfunction computeZonedDayEpochInterval(slots) {\n const {timeZone: timeZone} = slots;\n const isoDateTime0 = combineDateAndTime(zonedEpochSlotsToIso(slots), timeFieldDefaults);\n const isoDateTime1 = combineDateAndTime(moveDateByDays(isoDateTime0, 1), timeFieldDefaults);\n return [ getStartOfDayInstantFor(timeZone, isoDateTime0), getStartOfDayInstantFor(timeZone, isoDateTime1) ];\n}\n\nfunction roundZonedEpochToBounds(epochNano, epochNano0, epochNano1, roundingMode) {\n return roundWithMode(computeEpochNanoFrac(epochNano < epochNano1 ? epochNano : epochNano1 - 1n, epochNano0, epochNano1), roundingMode) ? epochNano1 : epochNano0;\n}\n\nfunction roundToMinute(offsetNano) {\n return roundNumberToInc(offsetNano, nanoInMinute, 7);\n}\n\nfunction roundBigNanoToInc(bigNano, bigNanoInc, roundingMode) {\n return roundBigNanoToIncWithTail(bigNano, bigNanoInc, roundingMode, bigNano / bigNanoInc % 2n);\n}\n\nfunction roundBigNanoToDayOriginInc(bigNano, bigNanoInc, roundingMode) {\n const [day, timeNano] = divModFloorBigInt(bigNano, bigNanoInUtcDay);\n const dayOriginNano = day * bigNanoInUtcDay;\n return dayOriginNano + roundBigNanoToIncWithTail(timeNano, bigNanoInc, roundingMode, (dayOriginNano / bigNanoInc + timeNano / bigNanoInc) % 2n);\n}\n\nfunction roundBigNanoToIncWithTail(bigNano, bigNanoInc, roundingMode, quotientTail) {\n const quotient = bigNano / bigNanoInc;\n const remainder = bigNano % bigNanoInc;\n let fraction = 0;\n remainder && (fraction = fabricateNearHalfFraction(compareBigInts(2n * (remainder < 0n ? -remainder : remainder), bigNanoInc), Math.sign(Number(remainder))));\n const roundedTail = roundWithMode(Number(quotientTail) + fraction, roundingMode);\n return (quotient - quotientTail + BigInt(roundedTail)) * bigNanoInc;\n}\n\nfunction computeNanoInc(smallestUnit, roundingInc) {\n return unitNanoMap[smallestUnit] * roundingInc;\n}\n\nfunction computeBigNanoInc(smallestUnit, roundingInc) {\n return BigInt(unitNanoMap[smallestUnit]) * BigInt(roundingInc);\n}\n\nconst zonedEpochSlotsToIso = /*@__PURE__*/ memoize(_zonedEpochSlotsToIso, WeakMap);\n\nfunction _zonedEpochSlotsToIso(slots) {\n const {epochNanoseconds: epochNanoseconds, timeZone: timeZone} = slots;\n const offsetNanoseconds = timeZone.B(epochNanoseconds);\n return {\n ...epochNanoToIsoDateTime(epochNanoseconds + BigInt(offsetNanoseconds)),\n offsetNanoseconds: offsetNanoseconds\n };\n}\n\nfunction getMatchingInstantFor(timeZone, isoDateTime, offsetNano, offsetDisambig = 0, epochDisambig = 0, epochFuzzy, hasZ) {\n if (void 0 !== offsetNano && 1 === offsetDisambig && (1 === offsetDisambig || hasZ)) {\n return isoDateTimeAndOffsetToEpochNano(isoDateTime, offsetNano);\n }\n 2 !== offsetDisambig && 0 !== offsetDisambig || checkIsoDateInBounds(isoDateTime, 0);\n const possibleEpochNanos = timeZone.R(isoDateTime);\n if (void 0 !== offsetNano && 3 !== offsetDisambig) {\n const matchingEpochNano = ((possibleEpochNanos, isoDateTime, offsetNano, fuzzy) => {\n const zonedEpochNano = isoDateTimeToEpochNano(isoDateTime);\n fuzzy && (offsetNano = roundToMinute(offsetNano));\n for (const possibleEpochNano of possibleEpochNanos) {\n let possibleOffsetNano = Number(zonedEpochNano - possibleEpochNano);\n if (fuzzy && (possibleOffsetNano = roundToMinute(possibleOffsetNano)), possibleOffsetNano === offsetNano) {\n return possibleEpochNano;\n }\n }\n })(possibleEpochNanos, isoDateTime, offsetNano, epochFuzzy);\n if (void 0 !== matchingEpochNano) {\n return matchingEpochNano;\n }\n 0 === offsetDisambig && throwRangeError(\"Invalid TimeZone offset\");\n }\n return hasZ ? isoDateTimeToEpochNano(isoDateTime) : getSingleInstantFor(timeZone, isoDateTime, epochDisambig, possibleEpochNanos);\n}\n\nfunction getSingleInstantFor(timeZone, isoDateTime, disambig = 0, possibleEpochNanos = timeZone.R(isoDateTime)) {\n if (1 === possibleEpochNanos.length) {\n return possibleEpochNanos[0];\n }\n if (1 === disambig && throwRangeError(\"Ambiguous offset\"), possibleEpochNanos.length) {\n return possibleEpochNanos[3 === disambig ? 1 : 0];\n }\n const zonedEpochNano = isoDateTimeToEpochNano(isoDateTime);\n const gapNano = ((timeZone, zonedEpochNano) => {\n const startOffsetNano = timeZone.B(zonedEpochNano - bigNanoInUtcDay);\n return (gapNano => (gapNano > nanoInUtcDay && throwRangeError(\"Out-of-bounds TimeZone gap\"), \n gapNano))(timeZone.B(zonedEpochNano + bigNanoInUtcDay) - startOffsetNano);\n })(timeZone, zonedEpochNano);\n const shiftedIsoDateTime = epochNanoToIsoDateTime(zonedEpochNano + BigInt(gapNano * (2 === disambig ? -1 : 1)));\n return (possibleEpochNanos = timeZone.R(shiftedIsoDateTime))[2 === disambig ? 0 : possibleEpochNanos.length - 1];\n}\n\nfunction getStartOfDayInstantFor(timeZone, isoDateTime) {\n const possibleEpochNanos = timeZone.R(isoDateTime);\n if (possibleEpochNanos.length) {\n return possibleEpochNanos[0];\n }\n const zonedEpochNanoDayBefore = isoDateTimeToEpochNano(isoDateTime) - bigNanoInUtcDay;\n return timeZone.C(zonedEpochNanoDayBefore, 1);\n}\n\nfunction moveYearMonth(calendar, isoDate, durationSlots, overflow = 0) {\n computeDurationSign(durationSlots) && getMaxDurationUnit(durationSlots) < 8 && throwRangeError(\"Cannot use small units\");\n const first = checkIsoDateInBounds(moveToStartOfMonth(calendar, isoDate));\n return moveToStartOfMonth(calendar, moveDate(calendar, first, durationSlots, overflow));\n}\n\nfunction moveYearMonthByUnits(calendar, isoDate, years, months, overflow) {\n const first = checkIsoDateInBounds(moveToStartOfMonth(calendar, isoDate));\n return moveToStartOfMonth(calendar, years || months ? checkIsoDateInBounds(moveDateByCalendarUnits(calendar, first, years, months, overflow)) : first);\n}\n\nfunction moveZonedEpochSlots(slots, durationFields, overflow = 0) {\n const {calendar: calendar, epochNanoseconds: epochNano, timeZone: timeZone} = slots;\n const timeOnlyNano = durationTimeToBigNano(durationFields);\n let movedEpochNano = epochNano;\n if (durationHasDateParts(durationFields)) {\n const isoDateTime = zonedEpochSlotsToIso(slots);\n movedEpochNano = getSingleInstantFor(timeZone, combineDateAndTime(moveDate(calendar, isoDateTime, {\n ...durationFields,\n ...durationTimeFieldDefaults\n }, overflow), isoDateTime)) + timeOnlyNano;\n } else {\n movedEpochNano += timeOnlyNano;\n }\n return {\n ...slots,\n epochNanoseconds: checkEpochNanoInBounds(movedEpochNano)\n };\n}\n\nfunction moveDateTime(calendar, isoDateTime, durationFields, overflow = 0) {\n const [movedTimeFields, dayDelta] = moveTime(isoDateTime, durationFields);\n return checkIsoDateTimeInBounds(combineDateAndTime(moveDate(calendar, isoDateTime, {\n ...durationFields,\n ...durationTimeFieldDefaults,\n days: durationFields.days + dayDelta\n }, overflow), movedTimeFields));\n}\n\nfunction moveDateTimeByNano(fields, delta) {\n const [time, days] = moveTimeByNano(fields, delta);\n return checkIsoDateTimeInBounds(combineDateAndTime(moveDateByDays(fields, days), time));\n}\n\nfunction moveTime(timeFields, durationFields) {\n return moveTimeByNano(timeFields, durationTimeToBigNano(durationFields));\n}\n\nfunction moveEpochNano(epochNano, durationFields) {\n return moveEpochNanoByNano(epochNano, (durationHasDateParts(fields = durationFields) && throwRangeError(\"Cannot use large units\"), \n durationTimeToBigNano(fields)));\n var fields;\n}\n\nfunction moveDate(calendar, isoDate, durationFields, overflow = 0) {\n let {years: years, months: months, weeks: weeks, days: days} = durationFields;\n let movedIsoDate;\n if (days += Number(durationTimeToBigNano(durationFields) / bigNanoInUtcDay), years || months) {\n movedIsoDate = moveDateByCalendarUnits(calendar, isoDate, years, months, overflow);\n } else {\n if (!weeks && !days) {\n return isoDate;\n }\n movedIsoDate = isoDate;\n }\n return (weeks || days) && (movedIsoDate = moveDateByDays(movedIsoDate, 7 * weeks + days)), \n checkIsoDateInBounds(movedIsoDate);\n}\n\nfunction moveToStartOfMonth(calendar, isoDate) {\n return moveDateByDays(isoDate, 1 - computeCalendarDateFields(calendar, isoDate).day);\n}\n\nfunction moveDateByCalendarUnits(calendar, isoDate, years, months, overflow) {\n const dateParts = computeCalendarDateFields(calendar, isoDate);\n let {year: year, month: month, day: day} = dateParts;\n if (years) {\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n year += years, month = resolveMonthInMovedYear(calendar, monthCodeNumber, isLeapMonth, calendar ? calendar.p(year) : void 0, overflow), \n month = clampEntity(\"month\", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);\n }\n if (months) {\n const yearMonthParts = addCalendarMonths(calendar, year, month, months);\n ({year: year, month: month} = yearMonthParts);\n }\n return day = clampEntity(\"day\", day, 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow), \n computeCalendarIsoFieldsFromParts(calendar, year, month, day);\n}\n\nfunction addCalendarMonths(calendar, year, month, monthDelta) {\n return calendar ? calendar.ae(year, month, monthDelta) : addIsoMonths(year, month, monthDelta);\n}\n\nfunction resolveMonthInMovedYear(calendar, monthCodeNumber, isLeapMonth, targetLeapMonth, overflow) {\n if (isLeapMonth) {\n const leapMonthMeta = calendar ? calendar.l : void 0;\n return void 0 !== targetLeapMonth && (leapMonthMeta < 0 || targetLeapMonth === monthCodeNumber + 1) ? targetLeapMonth : (1 === overflow && throwRangeError(invalidLeapMonth), \n leapMonthMeta < 0 ? -leapMonthMeta : monthCodeNumber);\n }\n return monthCodeNumberToMonth(monthCodeNumber, 0, targetLeapMonth);\n}\n\nfunction moveTimeByNano(timeFields, durationBigNano) {\n const durDays = Number(durationBigNano / bigNanoInUtcDay);\n const durTimeNano = Number(durationBigNano % bigNanoInUtcDay);\n const [newTimeFields, overflowDays] = nanoToTimeAndDay(timeFieldsToNano(timeFields) + durTimeNano);\n return [ newTimeFields, durDays + overflowDays ];\n}\n\nfunction moveEpochNanoByNano(epochNano, deltaNano) {\n return checkEpochNanoInBounds(epochNano + deltaNano);\n}\n\nfunction moveDateByDays(isoDate, days) {\n return days ? epochDaysToIsoDate(isoDateToEpochDays(isoDate) + days) : isoDate;\n}\n\nfunction getCommonCalendar(a, b) {\n return getCalendarSlotId(a) !== getCalendarSlotId(b) && throwRangeError(\"Mismatching Calendars\"), \n a;\n}\n\nfunction getCommonTimeZone(a, b) {\n return a.m !== b.m && throwRangeError(\"Mismatching TimeZones\"), \n a;\n}\n\nfunction getZonedTimeZoneId(slots) {\n return slots.timeZone.id;\n}\n\nfunction diffZonedDateTimesRounded(calendar, startZoned, endZoned, largestUnit, smallestUnit, roundingInc, roundingMode) {\n return largestUnit < 6 ? diffEpochNanosRounded(startZoned.epochNanoseconds, endZoned.epochNanoseconds, largestUnit, smallestUnit, roundingInc, roundingMode) : ((calendar, startZoned, endZoned, largestUnit, smallestUnit, roundingInc, roundingMode) => {\n const endEpochNano = endZoned.epochNanoseconds;\n if (endEpochNano === startZoned.epochNanoseconds) {\n return durationFieldDefaults;\n }\n let durationFields;\n const timeZone = getCommonTimeZone(startZoned.timeZone, endZoned.timeZone);\n return durationFields = diffZonedEpochsExact(timeZone, calendar, startZoned, endZoned, largestUnit), \n durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createZonedRelativeOps(calendar, timeZone, startZoned), 1), \n durationFields;\n })(calendar, startZoned, endZoned, largestUnit, smallestUnit, roundingInc, roundingMode);\n}\n\nfunction diffDateTimesRounded(calendar, startIsoDateTime, endIsoDateTime, largestUnit, smallestUnit, roundingInc, roundingMode) {\n return largestUnit <= 6 ? diffEpochNanosRounded(isoDateTimeToEpochNano(startIsoDateTime), isoDateTimeToEpochNano(endIsoDateTime), largestUnit, smallestUnit, roundingInc, roundingMode) : ((calendar, startIsoDateTime, endIsoDateTime, largestUnit, smallestUnit, roundingInc, roundingMode) => {\n const endEpochNano = isoDateTimeToEpochNano(endIsoDateTime);\n const sign = compareBigInts(endEpochNano, isoDateTimeToEpochNano(startIsoDateTime));\n if (!sign) {\n return durationFieldDefaults;\n }\n let durationFields;\n return durationFields = diffDateTimesBig(calendar, startIsoDateTime, endIsoDateTime, sign, largestUnit), \n durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, ((calendar, origin) => ({\n ne: isoDateTimeToEpochNano(origin),\n ke: duration => isoDateTimeToEpochNano(combineDateAndTime(moveDate(calendar, origin, duration), origin))\n }))(calendar, startIsoDateTime)), durationFields;\n })(calendar, startIsoDateTime, endIsoDateTime, largestUnit, smallestUnit, roundingInc, roundingMode);\n}\n\nfunction diffYearMonthsRounded(calendar, startIsoDate, endIsoDate, largestUnit, smallestUnit, roundingInc, roundingMode) {\n const firstOfMonth0 = moveToStartOfMonth(calendar, startIsoDate);\n const firstOfMonth1 = moveToStartOfMonth(calendar, endIsoDate);\n return compareIsoDates(firstOfMonth0, firstOfMonth1) ? diffDateCalendarUnitsRounded(calendar, checkIsoDateInBounds(firstOfMonth0), checkIsoDateInBounds(firstOfMonth1), largestUnit, smallestUnit, roundingInc, roundingMode, 8) : durationFieldDefaults;\n}\n\nfunction diffDatesRounded(calendar, startIsoDate, endIsoDate, largestUnit, smallestUnit, roundingInc, roundingMode, smallestPrecision = 6) {\n return 6 === largestUnit ? diffEpochNanosRounded(isoDateToEpochNano(startIsoDate), isoDateToEpochNano(endIsoDate), largestUnit, smallestUnit, roundingInc, roundingMode) : diffDateCalendarUnitsRounded(calendar, startIsoDate, endIsoDate, largestUnit, smallestUnit, roundingInc, roundingMode, smallestPrecision);\n}\n\nfunction diffTimesRounded(plainTimeSlots0, plainTimeSlots1, largestUnit, smallestUnit, roundingInc, roundingMode) {\n const timeDiffNano = roundNumberToInc(timeFieldsToNano(plainTimeSlots1) - timeFieldsToNano(plainTimeSlots0), computeNanoInc(smallestUnit, roundingInc), roundingMode);\n return {\n ...durationFieldDefaults,\n ...nanoToDurationTimeFields(timeDiffNano, largestUnit)\n };\n}\n\nfunction diffDateCalendarUnitsRounded(calendar, startIsoDate, endIsoDate, largestUnit, smallestUnit, roundingInc, roundingMode, smallestPrecision = 6) {\n const endEpochNano = isoDateToEpochNano(endIsoDate);\n if (!compareIsoDates(startIsoDate, endIsoDate)) {\n return durationFieldDefaults;\n }\n let durationFields;\n return durationFields = diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit), \n smallestUnit === smallestPrecision && 1 === roundingInc || (durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createDateRelativeOps(calendar, startIsoDate))), \n durationFields;\n}\n\nfunction diffEpochNanosRounded(startEpochNano, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) {\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(roundBigNanoToInc(endEpochNano - startEpochNano, computeBigNanoInc(smallestUnit, roundingInc), roundingMode), largestUnit)\n };\n}\n\nfunction diffZonedEpochsExact(timeZone, calendar, startZoned, endZoned, largestUnit) {\n return largestUnit < 6 ? {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(endZoned.epochNanoseconds - startZoned.epochNanoseconds, largestUnit)\n } : ((timeZone, startZoned, endZoned) => {\n const sign = compareBigInts(endZoned.epochNanoseconds, startZoned.epochNanoseconds);\n if (!sign) {\n return durationFieldDefaults;\n }\n if (!compareIsoDates(zonedEpochSlotsToIso(startZoned), zonedEpochSlotsToIso(endZoned))) {\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(endZoned.epochNanoseconds - startZoned.epochNanoseconds, 5)\n };\n }\n const [startIsoDateTime, endIsoDate, remainderNano] = prepareZonedEpochDiff(timeZone, startZoned, endZoned, sign);\n return {\n ...(start = startIsoDateTime, end = endIsoDate, diffCalendarDates(calendar, start, end, largestUnit)),\n ...nanoToDurationTimeFields(remainderNano)\n };\n var start, end;\n })(timeZone, startZoned, endZoned);\n}\n\nfunction diffDateTimesExact(calendar, startIsoDateTime, endIsoDateTime, largestUnit) {\n const startEpochNano = isoDateTimeToEpochNano(startIsoDateTime);\n const endEpochNano = isoDateTimeToEpochNano(endIsoDateTime);\n const sign = compareBigInts(endEpochNano, startEpochNano);\n return sign ? largestUnit <= 6 ? {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(endEpochNano - startEpochNano, largestUnit)\n } : diffDateTimesBig(calendar, startIsoDateTime, endIsoDateTime, sign, largestUnit) : durationFieldDefaults;\n}\n\nfunction diffDateTimesBig(calendar, startIsoDateTime, endIsoDateTime, sign, largestUnit) {\n let diffEndDate = endIsoDateTime;\n let timeNano = timeFieldsToNano(endIsoDateTime) - timeFieldsToNano(startIsoDateTime);\n return Math.sign(timeNano) === -sign && (diffEndDate = moveDateByDays(endIsoDateTime, -sign), \n timeNano += nanoInUtcDay * sign), {\n ...diffCalendarDates(calendar, startIsoDateTime, diffEndDate, largestUnit),\n ...nanoToDurationTimeFields(timeNano)\n };\n}\n\nfunction prepareZonedEpochDiff(timeZone, startZoned, endZoned, sign) {\n const startIsoDate = zonedEpochSlotsToIso(startZoned);\n const endIsoDate = zonedEpochSlotsToIso(endZoned);\n const endEpochNano = endZoned.epochNanoseconds;\n let dayCorrection = 0;\n const timeDiffNano = timeFieldsToNano(endIsoDate) - timeFieldsToNano(startIsoDate);\n Math.sign(timeDiffNano) === -sign && dayCorrection++;\n const maxDayCorrection = dayCorrection + (sign > 0 ? 1 : 0);\n for (;;dayCorrection++) {\n const midIsoDate = moveDateByDays(endIsoDate, dayCorrection * -sign);\n const midEpochNano = getSingleInstantFor(timeZone, combineDateAndTime(midIsoDate, startIsoDate));\n if (dayCorrection === maxDayCorrection || compareBigInts(endEpochNano, midEpochNano) !== -sign) {\n return [ startIsoDate, midIsoDate, Number(endEpochNano - midEpochNano) ];\n }\n }\n}\n\nfunction diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit) {\n if (largestUnit <= 7) {\n return ((asWeeks, start, end) => {\n const days = countIsoDays(start, end);\n return asWeeks ? {\n ...durationFieldDefaults,\n weeks: divTrunc(days, 7),\n days: modTrunc(days, 7)\n } : {\n ...durationFieldDefaults,\n days: days\n };\n })(7 === largestUnit, startIsoDate, endIsoDate);\n }\n const yearMonthDayStart = computeCalendarDateFields(calendar, startIsoDate);\n const yearMonthDayEnd = computeCalendarDateFields(calendar, endIsoDate);\n if (8 === largestUnit) {\n const {year: year0, month: month0, day: day0} = yearMonthDayStart;\n const {year: year1, month: month1, day: day1} = yearMonthDayEnd;\n const sign = Math.sign(compareNumbers(year1, year0) || compareNumbers(month1, month0) || countIsoDays(startIsoDate, endIsoDate));\n let months = 0;\n let days = 0;\n if (sign) {\n months = calendar ? calendar.ee(year0, month0, year1, month1) : diffIsoMonthSlots(year0, month0, year1, month1);\n let anchorIsoDate = moveDateByCalendarUnits(calendar, startIsoDate, 0, months, 0);\n sign * compareNumbers(day0, day1) > 0 && (months -= sign, anchorIsoDate = moveDateByCalendarUnits(calendar, startIsoDate, 0, months, 0)), \n days = countIsoDays(anchorIsoDate, endIsoDate);\n }\n return {\n ...durationFieldDefaults,\n months: months,\n days: days\n };\n }\n const {year: year0, month: month0, day: day0} = yearMonthDayStart;\n let {year: year1, month: month1, day: day1} = yearMonthDayEnd;\n let yearDiff = year1 - year0;\n let monthDiff = month1 - month0;\n let dayDiff = day1 - day0;\n if (yearDiff || monthDiff) {\n const sign = Math.sign(yearDiff || monthDiff);\n let daysInMonth1 = computeCalendarDaysInMonthForYearMonth(calendar, year1, month1);\n let dayCorrect = 0;\n if (Math.sign(day1 - day0) === -sign) {\n const origDaysInMonth1 = daysInMonth1;\n const yearMonthParts = addCalendarMonths(calendar, year1, month1, -sign);\n ({year: year1, month: month1} = yearMonthParts), yearDiff = year1 - year0, monthDiff = month1 - month0, \n daysInMonth1 = computeCalendarDaysInMonthForYearMonth(calendar, year1, month1), \n dayCorrect = sign < 0 ? -origDaysInMonth1 : daysInMonth1;\n }\n if (dayDiff = day1 - Math.min(day0, daysInMonth1) + dayCorrect, yearDiff) {\n const [monthCodeNumber0, isLeapMonth0] = computeCalendarMonthCodeParts(calendar, year0, month0);\n const [monthCodeNumber1, isLeapMonth1] = computeCalendarMonthCodeParts(calendar, year1, month1);\n const leapMonthMeta = calendar ? calendar.l : void 0;\n if (monthDiff = void 0 !== leapMonthMeta && isLeapMonth0 && !isLeapMonth1 && (leapMonthMeta < 0 ? sign > 0 && monthCodeNumber1 === -leapMonthMeta : sign < 0 && monthCodeNumber1 === monthCodeNumber0) ? 0 : monthCodeNumber1 - monthCodeNumber0 || Number(isLeapMonth1) - Number(isLeapMonth0), \n Math.sign(monthDiff) === -sign) {\n const monthCorrect = sign < 0 && -computeCalendarMonthsInYearForYear(calendar, year1);\n year1 -= sign, yearDiff = year1 - year0, monthDiff = month1 - resolveMonthInMovedYear(calendar, monthCodeNumber0, isLeapMonth0, calendar ? calendar.p(year1) : void 0, 0) + (monthCorrect || computeCalendarMonthsInYearForYear(calendar, year1));\n } else if (calendar) {\n const month0Projected = resolveMonthInMovedYear(calendar, monthCodeNumber0, isLeapMonth0, calendar.p(year1), 0);\n monthDiff = calendar.ee(year1, month0Projected, year1, month1);\n }\n }\n }\n return {\n ...durationFieldDefaults,\n years: yearDiff,\n months: monthDiff,\n days: dayDiff\n };\n}\n\nfunction compareIsoDates(isoDate0, isoDate1) {\n return compareNumbers(isoDate0.year, isoDate1.year) || compareNumbers(isoDate0.month, isoDate1.month) || compareNumbers(isoDate0.day, isoDate1.day);\n}\n\nfunction countIsoDays(startIsoDate, endIsoDate) {\n return isoDateToEpochDays(endIsoDate) - isoDateToEpochDays(startIsoDate);\n}\n\nfunction spanRelativeDuration(relativeToSlots, durationFields, largestUnit) {\n return isZonedEpochSlots(relativeToSlots) ? ((relativeToSlots, durationFields, largestUnit) => {\n const {calendar: calendar, timeZone: timeZone} = relativeToSlots;\n const endSlots = moveZonedEpochSlots(relativeToSlots, durationFields);\n return [ diffZonedEpochsExact(timeZone, calendar, relativeToSlots, endSlots, largestUnit), endSlots.epochNanoseconds, createZonedRelativeOps(calendar, timeZone, relativeToSlots) ];\n })(relativeToSlots, durationFields, largestUnit) : ((relativeToSlots, durationFields, largestUnit) => {\n const {calendar: calendar} = relativeToSlots;\n const origin = checkIsoDateTimeInBounds(combineDateAndTime(relativeToSlots, timeFieldDefaults));\n const end = moveDateTime(calendar, origin, durationFields);\n return [ diffDateTimesExact(calendar, origin, end, largestUnit), isoDateTimeToEpochNano(end), createDateRelativeOps(calendar, relativeToSlots) ];\n })(relativeToSlots, durationFields, largestUnit);\n}\n\nfunction moveRelativeEndpointToEpochNano(relativeToSlots, durationFields) {\n return isZonedEpochSlots(relativeToSlots) ? moveZonedEpochSlots(relativeToSlots, durationFields).epochNanoseconds : isoDateTimeToEpochNano(moveDateTime(relativeToSlots.calendar, combineDateAndTime(relativeToSlots, timeFieldDefaults), durationFields));\n}\n\nfunction moveRelativeMarkerToEpochNano(relativeOps, dateDuration) {\n return durationHasDateParts(dateDuration) ? relativeOps.ke(dateDuration) : relativeOps.ne;\n}\n\nfunction createZonedRelativeOps(calendar, timeZone, slots) {\n const origin = zonedEpochSlotsToIso(slots);\n return {\n ne: slots.epochNanoseconds,\n ke: duration => getSingleInstantFor(timeZone, combineDateAndTime(moveDate(calendar, origin, duration), origin))\n };\n}\n\nfunction createDateRelativeOps(calendar, origin) {\n return {\n ne: isoDateToEpochNano(origin),\n ke: duration => isoDateToEpochNano(moveDate(calendar, origin, duration))\n };\n}\n\nfunction isZonedEpochSlots(slots) {\n return \"timeZone\" in slots;\n}\n\nfunction isUniformUnit(unit, isZoned) {\n return unit <= 6 - (isZoned ? 1 : 0);\n}\n\nfunction nanoToGivenFields(nano, largestUnit, fieldNames) {\n const fields = {};\n for (let unit = largestUnit; unit >= 0; unit--) {\n const divisor = unitNanoMap[unit];\n fields[fieldNames[unit]] = divTrunc(nano, divisor), nano = modTrunc(nano, divisor);\n }\n return fields;\n}\n\nconst maxDurationSeconds = 2 ** 53;\n\nfunction addDurationsWithoutRelativeTo(doSubtract, slots, otherSlots) {\n const maxUnit = Math.max(getMaxDurationUnit(slots), getMaxDurationUnit(otherSlots));\n return maxUnit > 6 && throwRangeError(\"Cannot use large units\"), ((doSubtract, slots, otherSlots, maxUnit) => createDurationSlots(validateDurationFields(((a, b, largestUnit, doSubtract) => {\n const combined = durationDayTimeToBigNano(a) + durationDayTimeToBigNano(b) * BigInt(doSubtract ? -1 : 1);\n return Number.isFinite(Number(combined / bigNanoInUtcDay)) || throwRangeError(outOfBoundsDate), \n {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(combined, largestUnit)\n };\n })(slots, otherSlots, maxUnit, doSubtract))))(doSubtract, slots, otherSlots, maxUnit);\n}\n\nfunction roundDuration(refineRelativeTo, slots, options) {\n const durationLargestUnit = getMaxDurationUnit(slots);\n const [largestUnit, smallestUnit, roundingInc, roundingMode, relativeToSlots] = refineDurationRoundOptions(options, durationLargestUnit, refineRelativeTo);\n if (!relativeToSlots && Math.max(durationLargestUnit, largestUnit) <= 6) {\n return createDurationSlots(validateDurationFields(((durationFields, largestUnit, smallestUnit, roundingInc, roundingMode) => {\n const roundedBigNano = roundBigNanoToInc(durationDayTimeToBigNano(durationFields), computeBigNanoInc(smallestUnit, roundingInc), roundingMode);\n return {\n ...durationFieldDefaults,\n ...nanoToDurationDayTimeFields(roundedBigNano, largestUnit)\n };\n })(slots, largestUnit, smallestUnit, roundingInc, roundingMode)));\n }\n relativeToSlots || throwRangeError(\"Missing relativeTo\");\n const isZoned = isZonedEpochSlots(relativeToSlots);\n if (!slots.sign && (!isZoned || largestUnit < 6)) {\n return slots;\n }\n const [balancedDuration, endEpochNano, relativeOps] = spanRelativeDuration(relativeToSlots, slots, largestUnit);\n return createDurationSlots(roundRelativeDuration(balancedDuration, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps, isZoned));\n}\n\nfunction absDuration(slots) {\n return -1 === slots.sign ? negateDuration(slots) : slots;\n}\n\nfunction negateDuration(slots) {\n return createDurationSlots(negateDurationFields(slots));\n}\n\nfunction negateDurationFields(fields) {\n const res = {};\n for (const fieldName of durationFieldNamesAsc) {\n res[fieldName] = -1 * fields[fieldName] || 0;\n }\n return res;\n}\n\nfunction computeDurationSign(fields, fieldNames = durationFieldNamesAsc) {\n let sign = 0;\n for (const fieldName of fieldNames) {\n const fieldSign = Math.sign(fields[fieldName]);\n fieldSign && (sign && sign !== fieldSign && throwRangeError(\"Cannot mix duration signs\"), \n sign = fieldSign);\n }\n return sign;\n}\n\nfunction validateDurationFields(fields) {\n for (const calendarUnit of durationCalendarFieldNamesAsc) {\n validateDurationCalendarUnit(calendarUnit, fields[calendarUnit]);\n }\n const bigNano = durationDayTimeToBigNano(fields);\n return validateDurationTimeUnit(Number(bigNano / bigNanoInSec)), fields;\n}\n\nfunction validateDurationCalendarUnit(unit, value) {\n return clampEntity(unit, value, -4294967295, 4294967295, 1);\n}\n\nfunction validateDurationTimeUnit(n) {\n Number.isSafeInteger(n) || throwRangeError(\"Out-of-bounds duration\");\n}\n\nfunction durationDayTimeToBigNano(fields) {\n return BigInt(fields.days) * bigNanoInUtcDay + durationTimeToBigNano(fields);\n}\n\nfunction durationTimeToBigNano(fields) {\n return BigInt(fields.hours) * bigNanoInHour + BigInt(fields.minutes) * bigNanoInMinute + durationSubMinuteToBigNano(fields);\n}\n\nfunction durationSubMinuteToBigNano(fields) {\n return BigInt(fields.seconds) * bigNanoInSec + BigInt(fields.milliseconds) * bigNanoInMilli + BigInt(fields.microseconds) * bigNanoInMicro + BigInt(fields.nanoseconds);\n}\n\nfunction nanoToDurationDayTimeFields(bigNano, largestUnit = 6) {\n const days = Number(bigNano / bigNanoInUtcDay);\n const timeNano = Number(bigNano % bigNanoInUtcDay);\n const unitNano = unitNanoMap[largestUnit];\n const largestUnitVal = largestUnit <= 3 ? Number(bigNano / BigInt(unitNano)) : days * (nanoInUtcDay / unitNano) + divTrunc(timeNano, unitNano);\n Number.isFinite(largestUnitVal) || throwRangeError(outOfBoundsDate), largestUnit <= 3 && Math.abs(largestUnitVal) / (nanoInSec / unitNanoMap[largestUnit]) >= maxDurationSeconds && throwRangeError(outOfBoundsDate);\n const dayTimeFields = nanoToGivenFields(timeNano, largestUnit, durationFieldNamesAsc);\n return dayTimeFields[durationFieldNamesAsc[largestUnit]] = largestUnitVal, dayTimeFields;\n}\n\nfunction nanoToDurationTimeFields(nano, largestUnit = 5) {\n return nanoToGivenFields(nano, largestUnit, durationFieldNamesAsc);\n}\n\nfunction durationHasDateParts(fields) {\n return Boolean(computeDurationSign(fields, durationDateFieldNamesAsc));\n}\n\nfunction getMaxDurationUnit(fields) {\n let unit = 9;\n for (;unit > 0 && !fields[durationFieldNamesAsc[unit]]; unit--) {}\n return unit;\n}\n\nfunction compareZonedEpochSlots(zonedEpochSlots0, zonedEpochSlots1) {\n return compareBigInts(zonedEpochSlots0.epochNanoseconds, zonedEpochSlots1.epochNanoseconds);\n}\n\nfunction compareDurations(refineRelativeTo, durationSlots0, durationSlots1, options) {\n const relativeToSlots = refineRelativeTo(normalizeOptions(options).relativeTo);\n const maxUnit = Math.max(getMaxDurationUnit(durationSlots0), getMaxDurationUnit(durationSlots1));\n return allPropsEqual(durationFieldNamesAsc, durationSlots0, durationSlots1) ? 0 : isUniformUnit(maxUnit, relativeToSlots && isZonedEpochSlots(relativeToSlots)) ? compareBigInts(durationDayTimeToBigNano(durationSlots0), durationDayTimeToBigNano(durationSlots1)) : (relativeToSlots || throwRangeError(\"Missing relativeTo\"), \n compareBigInts(moveRelativeEndpointToEpochNano(relativeToSlots, durationSlots0), moveRelativeEndpointToEpochNano(relativeToSlots, durationSlots1)));\n}\n\nfunction compareIsoDateTimeFields(isoDateTime0, isoDateTime1) {\n return compareIsoDateFields(isoDateTime0, isoDateTime1) || compareTimeFields(isoDateTime0, isoDateTime1);\n}\n\nfunction compareIsoDateFields(isoDate0, isoDate1) {\n return compareNumbers(isoDateToEpochDays(isoDate0), isoDateToEpochDays(isoDate1));\n}\n\nfunction compareTimeFields(timeFields0, timeFields1) {\n return compareNumbers(timeFieldsToNano(timeFields0), timeFieldsToNano(timeFields1));\n}\n\nfunction instantsEqual(instantSlots0, instantSlots1) {\n return !compareZonedEpochSlots(instantSlots0, instantSlots1);\n}\n\nfunction zonedDateTimesEqual(zonedDateTimeSlots0, zonedDateTimeSlots1) {\n return !compareZonedEpochSlots(zonedDateTimeSlots0, zonedDateTimeSlots1) && zonedDateTimeSlots0.timeZone.m === zonedDateTimeSlots1.timeZone.m && zonedDateTimeSlots0.calendar === zonedDateTimeSlots1.calendar;\n}\n\nfunction plainDateTimesEqual(plainDateTimeSlots0, plainDateTimeSlots1) {\n return !compareIsoDateTimeFields(plainDateTimeSlots0, plainDateTimeSlots1) && plainDateTimeSlots0.calendar === plainDateTimeSlots1.calendar;\n}\n\nfunction plainDatesEqual(plainDateSlots0, plainDateSlots1) {\n return !compareIsoDateFields(plainDateSlots0, plainDateSlots1) && plainDateSlots0.calendar === plainDateSlots1.calendar;\n}\n\nfunction plainYearMonthsEqual(plainYearMonthSlots0, plainYearMonthSlots1) {\n return !compareIsoDateFields(plainYearMonthSlots0, plainYearMonthSlots1) && plainYearMonthSlots0.calendar === plainYearMonthSlots1.calendar;\n}\n\nfunction plainMonthDaysEqual(plainMonthDaySlots0, plainMonthDaySlots1) {\n return !compareIsoDateFields(plainMonthDaySlots0, plainMonthDaySlots1) && plainMonthDaySlots0.calendar === plainMonthDaySlots1.calendar;\n}\n\nfunction plainTimesEqual(plainTimeSlots0, plainTimeSlots1) {\n return !compareTimeFields(plainTimeSlots0, plainTimeSlots1);\n}\n\nfunction getCalendarEraOrigins(calendar) {\n return 0 === calendar ? gregoryEraOrigins : calendar ? calendar.k : void 0;\n}\n\nfunction getCalendarFieldNames(calendar, fieldNames, fieldNamesWithEra = fieldNames) {\n return getCalendarEraOrigins(calendar) ? fieldNamesWithEra : fieldNames;\n}\n\nfunction resolveCalendarYear(fields, calendar) {\n const exoticCalendar = calendar || void 0;\n const eraOrigins = getCalendarEraOrigins(calendar);\n let {era: era, eraYear: eraYear, year: year} = fields;\n if (void 0 !== year && (year = toIntegerWithTrunc(year, \"year\")), void 0 !== eraYear && (eraYear = toIntegerWithTrunc(eraYear, \"eraYear\")), \n void 0 !== era || void 0 !== eraYear) {\n void 0 !== era && void 0 !== eraYear || throwTypeError(\"Mismatching era/eraYear\"), \n eraOrigins || throwRangeError(\"Forbidden era/eraYear\");\n const normalizedEra = normalizeEraName(era);\n const eraOrigin = eraOrigins[normalizedEra];\n void 0 === eraOrigin && throwRangeError((era => `Invalid era: ${era}`)(era));\n const yearByEra = exoticCalendar?._ ? exoticCalendar._(eraYear, normalizedEra, eraOrigin) : eraYearToYear(eraYear, eraOrigin);\n void 0 !== year && year !== yearByEra && throwRangeError(\"Mismatching year/eraYear\"), \n year = yearByEra;\n } else {\n void 0 === year && throwTypeError(missingYear(eraOrigins));\n }\n return year;\n}\n\nfunction resolveCalendarMonth(fields, calendar, year, monthCodeParts, overflow) {\n let {month: month, monthCode: monthCode} = fields;\n if (void 0 !== monthCode) {\n const monthByCode = ((calendar, monthCode, year, overflow, monthCodeParts = parseMonthCode(monthCode)) => {\n const leapMonth = calendar ? calendar.p(year) : void 0;\n const [monthCodeNumber, wantsLeapMonth] = monthCodeParts;\n let month = monthCodeNumberToMonth(monthCodeNumber, wantsLeapMonth, leapMonth);\n if (wantsLeapMonth) {\n const leapMonthMeta = calendar ? calendar.l : void 0;\n void 0 === leapMonthMeta && throwRangeError(invalidLeapMonth), leapMonthMeta > 0 ? (month > leapMonthMeta && throwRangeError(invalidLeapMonth), \n leapMonth !== month && (1 === overflow && throwRangeError(invalidLeapMonth), month = monthCodeNumberToMonth(monthCodeNumber, 0, leapMonth))) : (month !== -leapMonthMeta && throwRangeError(invalidLeapMonth), \n void 0 === leapMonth && 1 === overflow && throwRangeError(invalidLeapMonth));\n }\n return month;\n })(calendar, monthCode, year, overflow, monthCodeParts);\n void 0 !== month && month !== monthByCode && throwRangeError(\"Mismatching month/monthCode\"), \n month = monthByCode, overflow = 1;\n } else {\n void 0 === month && throwTypeError(\"Missing month/monthCode\");\n }\n return clampEntity(\"month\", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);\n}\n\nfunction resolveCalendarDay(fields, calendar, year, month, overflow) {\n return clampProp(fields, \"day\", 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow);\n}\n\nfunction eraYearToYear(eraYear, eraOrigin) {\n return (eraOrigin + eraYear) * (Math.sign(eraOrigin) || 1) || 0;\n}\n\nfunction resolveTimeFields(fields, overflow) {\n return constrainTimeFields(pluckProps(timeFieldNamesAsc, {\n ...timeFieldDefaults,\n ...fields\n }), overflow);\n}\n\nconst offsetRegExp = /*@__PURE__*/ createRegExp(\"([+-])(\\\\d{2})(?::?(\\\\d{2})(?::?(\\\\d{2})(?:[.,](\\\\d{1,9}))?)?)?\");\n\nfunction parseOffsetNano(s) {\n const offsetNano = parseOffsetNanoMaybe(s);\n return void 0 === offsetNano && throwRangeError(failedParse(s)), offsetNano;\n}\n\nfunction parseOffsetNanoMaybe(s, onlyHourMinute) {\n const parts = offsetRegExp.exec(s);\n if (parts && (s => (s => {\n \"T\" !== s[0] && \"t\" !== s[0] || (s = s.slice(1));\n const fractionIndex = s.search(/[.,]/);\n const main = fractionIndex < 0 ? s : s.slice(0, fractionIndex);\n const parts = main.split(\":\");\n return 1 === parts.length ? /^(?:\\d{2}|\\d{4}|\\d{6})$/i.test(main) : (2 === parts.length || 3 === parts.length) && parts.every(part => 2 === part.length && /^\\d{2}$/i.test(part));\n })(s.slice(1)))(parts[0])) {\n return ((parts, onlyHourMinute) => {\n const firstSubMinutePart = parts[4] || parts[5];\n onlyHourMinute && firstSubMinutePart && throwRangeError(invalidSubstring(firstSubMinutePart));\n const offsetNanoPos = parseInt0(parts[2]) * nanoInHour + parseInt0(parts[3]) * nanoInMinute + parseInt0(parts[4]) * nanoInSec + parseSubsecNano(parts[5] || \"\");\n return offsetNano = offsetNanoPos * parseSign(parts[1]), Math.abs(offsetNano) >= nanoInUtcDay && throwRangeError(\"Out-of-bounds offset\"), \n offsetNano;\n var offsetNano;\n })(parts, onlyHourMinute);\n }\n}\n\nconst dateFieldRefiners = {\n era: toString,\n month: toPositiveIntegerWithTruncation,\n monthCode(monthCode, fieldName) {\n return requireString(toPrimitiveWithStringHint(monthCode), fieldName);\n },\n day: toPositiveIntegerWithTruncation\n};\n\nconst timeFieldRefiners = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, toIntegerWithTrunc);\n\nconst durationFieldRefiners = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, toStrictInteger);\n\nconst dateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateFieldRefiners, timeFieldRefiners);\n\nconst zonedDateTimeFieldRefiners = {\n offset(offsetString) {\n return parseOffsetNano(requireString(toPrimitiveWithStringHint(offsetString)));\n },\n ...dateTimeFieldRefiners\n};\n\nfunction readAndRefineBagFields(bag, validFieldNames, fieldRefiners, requiredFieldNames, disallowEmpty = !requiredFieldNames) {\n const res = {};\n let anyMatching = 0;\n for (const fieldName of validFieldNames) {\n let fieldVal = bag[fieldName];\n if (void 0 !== fieldVal) {\n anyMatching = 1;\n const refiner = fieldRefiners[fieldName];\n refiner && (fieldVal = refiner(fieldVal, fieldName)), res[fieldName] = fieldVal;\n } else {\n requiredFieldNames && requiredFieldNames.includes(fieldName) && throwTypeError(missingField(fieldName));\n }\n }\n return disallowEmpty && !anyMatching && throwTypeError(noValidFields(validFieldNames)), \n res;\n}\n\nfunction refineCalendarDateFields(fields, calendar, allowMissingDay) {\n const eraOrigins = getCalendarEraOrigins(calendar);\n void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins)), \n void 0 === fields.monthCode && void 0 === fields.month && throwTypeError(\"Missing month/monthCode\"), \n allowMissingDay || void 0 !== fields.day || throwTypeError(missingField(\"day\"));\n const monthCodeParts = parseMonthCodeField(fields);\n return [ resolveCalendarYear(fields, calendar), monthCodeParts ];\n}\n\nfunction refineMonthDayFields(fields, calendar) {\n const isIso = calendar === isoCalendarImpl;\n const eraOrigins = getCalendarEraOrigins(calendar);\n void 0 === fields.day && throwTypeError(missingField(\"day\")), isIso || void 0 === fields.month || void 0 !== fields.year || void 0 !== fields.era && void 0 !== fields.eraYear || throwTypeError(missingYear(eraOrigins));\n const monthCodeParts = parseMonthCodeField(fields);\n return [ void 0 !== fields.eraYear || void 0 !== fields.year ? resolveCalendarYear(fields, calendar) : void 0, monthCodeParts ];\n}\n\nfunction createDateTimeFromRefinedFields(isoDate, timeFields = timeFieldDefaults, calendar) {\n const isoDateTime = combineDateAndTime(isoDate, timeFields);\n return checkIsoDateTimeInBounds(isoDateTime), createDateTimeSlots(isoDateTime, calendar);\n}\n\nfunction createDateFromRefinedFields(fields, calendar, year, monthCodeParts, overflow) {\n const month = resolveCalendarMonth(fields, calendar, year, monthCodeParts, overflow);\n return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, resolveCalendarDay(fields, calendar, year, month, overflow))), calendar);\n}\n\nfunction createYearMonthFromRefinedFields(fields, calendar, year, monthCodeParts, overflow) {\n return createYearMonthFromCalendarParts(calendar, year, resolveCalendarMonth(fields, calendar, year, monthCodeParts, overflow));\n}\n\nfunction createMonthDayFromRefinedFields(fields, calendar, year, monthCodeParts, overflow) {\n const isIso = calendar === isoCalendarImpl;\n let yearMaybe = year;\n let day;\n let monthCodeNumber;\n let isLeapMonth;\n if (void 0 === yearMaybe && isIso && (yearMaybe = 1972), void 0 !== yearMaybe) {\n isIso || checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, yearMaybe, 1, 1));\n const month = resolveCalendarMonth(fields, calendar, yearMaybe, monthCodeParts, overflow);\n day = resolveCalendarDay(fields, calendar, yearMaybe, month, overflow), [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, yearMaybe, month);\n } else {\n void 0 === fields.monthCode && throwTypeError(\"Missing month/monthCode\"), [monthCodeNumber, isLeapMonth] = monthCodeParts;\n const referenceYear = calendar ? calendar.re : 1972;\n if (void 0 !== referenceYear) {\n day = resolveCalendarDay(fields, calendar, referenceYear, resolveCalendarMonth(fields, calendar, referenceYear, monthCodeParts, overflow), overflow);\n } else {\n const constrainedDay = 0 === overflow && calendar ? calendar.ge?.(monthCodeNumber, isLeapMonth, fields.day) : void 0;\n day = void 0 !== constrainedDay ? constrainedDay : fields.day;\n }\n }\n return createMonthDayFromMonthCodeParts(calendar, monthCodeNumber, isLeapMonth, day, fields.day, overflow);\n}\n\nfunction createYearMonthFromCalendarParts(calendar, year, month) {\n return createDateSlots(checkIsoYearMonthInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, 1)), calendar);\n}\n\nfunction createMonthDayFromCalendarParts(calendar, year, month, day) {\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n return createMonthDayFromMonthCodeParts(calendar, monthCodeNumber, isLeapMonth, day, day, 0);\n}\n\nfunction createMonthDayFromMonthCodeParts(calendar, monthCodeNumber, isLeapMonthArg, day, requestedDay, overflow) {\n let isLeapMonth = isLeapMonthArg;\n isLeapMonth && ((calendar && calendar.V?.[monthCodeNumber]) ?? 1 / 0) < requestedDay && (1 === overflow && throwRangeError(invalidLeapMonth), \n isLeapMonth = 0, day = constrainToRange(requestedDay, 1, (calendar && calendar.U) ?? 1 / 0));\n let res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));\n for (;!res && 0 === overflow && day > 1; ) {\n day--, res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));\n }\n res || throwRangeError(\"Cannot guess year\");\n const {year: finalYear, month: finalMonth} = res;\n return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, finalYear, finalMonth, day)), calendar);\n}\n\nfunction parseMonthCodeField(fields) {\n if (void 0 !== fields.monthCode) {\n return parseMonthCode(fields.monthCode);\n }\n}\n\nconst RawDateTimeFormat = Intl.DateTimeFormat;\n\nfunction formatEpochMilliToPartsRecord(intlFormat, epochMilli) {\n epochMilli < -864e13 && throwRangeError(outOfBoundsDate);\n const parts = intlFormat.formatToParts(epochMilli);\n const hash = {};\n for (const part of parts) {\n hash[part.type] = part.value;\n }\n return hash;\n}\n\nconst utcTimeZoneId = \"UTC\";\n\nconst timeZonePeriodDaysByName = {\n \"El_Aaiun\": 17,\n \"Tucuman\": 12,\n \"Tirane\": 11,\n \"Riga\": 10,\n \"Simferopol\": 9,\n \"Vienna\": 9,\n \"Tunis\": 8,\n \"Boa_Vista\": 6,\n \"Fortaleza\": 6,\n \"Maceio\": 6,\n \"Noronha\": 6,\n \"Recife\": 6,\n \"Gaza\": 6,\n \"Hebron\": 6,\n \"DeNoronha\": 6\n};\n\nconst minPossibleTransitionSec = -388152e4;\n\nfunction formatInstantIso(refineTimeZoneString, instantSlots, options) {\n const [timeZoneArg, roundingMode, nanoInc, subsecDigits] = refineInstantDisplayOptions(options);\n const providedTimeZone = void 0 !== timeZoneArg;\n return ((providedTimeZone, timeZone, epochNano, roundingMode, nanoInc, subsecDigits) => {\n epochNano = roundBigNanoToDayOriginInc(epochNano, BigInt(nanoInc), roundingMode);\n const offsetNano = timeZone.B(epochNano);\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(epochNano + BigInt(offsetNano)), subsecDigits) + (providedTimeZone ? formatOffsetNano(roundToMinute(offsetNano)) : \"Z\");\n })(providedTimeZone, queryTimeZone(providedTimeZone ? refineTimeZoneString(timeZoneArg) : \"UTC\"), instantSlots.epochNanoseconds, roundingMode, nanoInc, subsecDigits);\n}\n\nfunction formatInstantIsoAuto(instantSlots) {\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(instantSlots.epochNanoseconds), void 0) + \"Z\";\n}\n\nfunction formatZonedDateTimeIso(zonedDateTimeSlots0, options) {\n const displayOptions = refineZonedDateTimeDisplayOptions(options);\n return ((calendar, timeZoneId, timeZone, epochNano, calendarDisplay, timeZoneDisplay, offsetDisplay, roundingMode, nanoInc, subsecDigits) => {\n epochNano = roundBigNanoToDayOriginInc(epochNano, BigInt(nanoInc), roundingMode);\n const offsetNano = timeZone.B(epochNano);\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(epochNano + BigInt(offsetNano)), subsecDigits) + formatOffsetNano(roundToMinute(offsetNano), offsetDisplay) + formatTimeZone(timeZoneId, timeZoneDisplay) + formatCalendar(calendar, calendarDisplay);\n })(zonedDateTimeSlots0.calendar, zonedDateTimeSlots0.timeZone.id, zonedDateTimeSlots0.timeZone, zonedDateTimeSlots0.epochNanoseconds, ...displayOptions);\n}\n\nfunction formatZonedDateTimeIsoAuto(zonedDateTimeSlots) {\n const calendar = zonedDateTimeSlots.calendar;\n const timeZone = zonedDateTimeSlots.timeZone;\n const offsetNano = timeZone.B(zonedDateTimeSlots.epochNanoseconds);\n return formatIsoDateTimeFields(epochNanoToIsoDateTime(zonedDateTimeSlots.epochNanoseconds + BigInt(offsetNano)), void 0) + formatOffsetNano(roundToMinute(offsetNano)) + formatTimeZone(timeZone.id, 0) + (calendar === isoCalendarImpl ? \"\" : formatCalendarId(getCalendarSlotId(calendar), 0));\n}\n\nfunction formatPlainDateTimeIso(plainDateTimeSlots0, options) {\n const displayOptions = refineDateTimeDisplayOptions(options);\n return ((calendar, isoDateTime, calendarDisplay, roundingMode, nanoInc, subsecDigits) => formatIsoDateTimeFields(roundDateTimeToInc(isoDateTime, nanoInc, roundingMode), subsecDigits) + formatCalendar(calendar, calendarDisplay))(plainDateTimeSlots0.calendar, plainDateTimeSlots0, ...displayOptions);\n}\n\nfunction formatDateTimeIsoAuto(isoDateTimeSlots) {\n const calendar = isoDateTimeSlots.calendar;\n return formatIsoDateTimeFields(isoDateTimeSlots, void 0) + (calendar === isoCalendarImpl ? \"\" : formatCalendarId(getCalendarSlotId(calendar), 0));\n}\n\nfunction formatPlainDateIso(plainDateSlots, options) {\n return calendar = plainDateSlots.calendar, isoDate = plainDateSlots, calendarDisplay = refineDateDisplayOptions(options), \n formatIsoDateFields(isoDate) + formatCalendar(calendar, calendarDisplay);\n var calendar, isoDate, calendarDisplay;\n}\n\nfunction formatDateIsoAuto(plainDateSlots) {\n return formatIsoDateFields(plainDateSlots) + (plainDateSlots.calendar === isoCalendarImpl ? \"\" : formatCalendarId(getCalendarSlotId(plainDateSlots.calendar), 0));\n}\n\nfunction formatPlainYearMonthIso(plainYearMonthSlots, options) {\n return formatDateLikeIso(plainYearMonthSlots.calendar, formatIsoYearMonthFields, plainYearMonthSlots, refineDateDisplayOptions(options));\n}\n\nfunction formatYearMonthIsoAuto(plainYearMonthSlots) {\n const calendar = plainYearMonthSlots.calendar;\n return calendar !== isoCalendarImpl ? formatIsoDateFields(plainYearMonthSlots) + formatCalendarId(getCalendarSlotId(calendar), 0) : formatIsoYearMonthFields(plainYearMonthSlots);\n}\n\nfunction formatPlainMonthDayIso(plainMonthDaySlots, options) {\n return formatDateLikeIso(plainMonthDaySlots.calendar, formatIsoMonthDayFields, plainMonthDaySlots, refineDateDisplayOptions(options));\n}\n\nfunction formatMonthDayIsoAuto(plainMonthDaySlots) {\n const calendar = plainMonthDaySlots.calendar;\n return calendar !== isoCalendarImpl ? formatIsoDateFields(plainMonthDaySlots) + formatCalendarId(getCalendarSlotId(calendar), 0) : formatIsoMonthDayFields(plainMonthDaySlots);\n}\n\nfunction formatDateLikeIso(calendar, formatSimple, isoDate, calendarDisplay) {\n const showCalendar = calendarDisplay > 1 || 0 === calendarDisplay && calendar !== isoCalendarImpl;\n return 1 === calendarDisplay ? calendar === isoCalendarImpl ? formatSimple(isoDate) : formatIsoDateFields(isoDate) : showCalendar ? formatIsoDateFields(isoDate) + formatCalendarId(getCalendarSlotId(calendar), 2 === calendarDisplay) : formatSimple(isoDate);\n}\n\nfunction formatPlainTimeIso(slots, options) {\n return ((fields, roundingMode, nanoInc, subsecDigits) => formatTimeFields(roundTimeToInc(fields, nanoInc, roundingMode)[0], subsecDigits))(slots, ...refineTimeDisplayOptions(options));\n}\n\nfunction formatTimeIsoAuto(slots) {\n return formatTimeFields(slots, void 0);\n}\n\nfunction formatDurationIso(slots, options) {\n const [roundingMode, nanoInc, subsecDigits] = refineTimeDisplayOptions(options, 3);\n return nanoInc > 1 && validateDurationFields(slots = {\n ...slots,\n ...roundDayTimeDurationByInc(slots, nanoInc, roundingMode)\n }), formatDurationSlots(slots, subsecDigits);\n}\n\nfunction formatDurationIsoAuto(slots) {\n return formatDurationSlots(slots, void 0);\n}\n\nfunction formatDurationSlots(durationSlots, subsecDigits) {\n const {sign: sign} = durationSlots;\n const abs = -1 === sign ? negateDurationFields(durationSlots) : durationSlots;\n const {hours: hours, minutes: minutes} = abs;\n const bigNano = durationSubMinuteToBigNano(abs);\n const wholeSec = Number(bigNano / bigNanoInSec);\n const subsecNano = Number(bigNano % bigNanoInSec);\n validateDurationTimeUnit(wholeSec);\n const subsecNanoString = formatSubsecNano(subsecNano, subsecDigits);\n const forceSec = subsecDigits >= 0 || !sign || subsecNanoString;\n return (sign < 0 ? \"-\" : \"\") + \"P\" + formatDurationFragments({\n \"Y\": formatDurationNumber(abs.years),\n \"M\": formatDurationNumber(abs.months),\n \"W\": formatDurationNumber(abs.weeks),\n \"D\": formatDurationNumber(abs.days)\n }) + (hours || minutes || wholeSec || forceSec ? \"T\" + formatDurationFragments({\n \"H\": formatDurationNumber(hours),\n \"M\": formatDurationNumber(minutes),\n \"S\": formatDurationNumber(wholeSec, forceSec) + subsecNanoString\n }) : \"\");\n}\n\nfunction formatDurationFragments(fragObj) {\n const parts = [];\n for (const fragName in fragObj) {\n const fragVal = fragObj[fragName];\n fragVal && parts.push(fragVal, fragName);\n }\n return parts.join(\"\");\n}\n\nfunction formatDurationNumber(n, force) {\n if (!n && !force) {\n return \"\";\n }\n const options = Object.create(null);\n return options.useGrouping = 0, n.toLocaleString(\"fullwide\", options);\n}\n\nfunction formatIsoDateTimeFields(isoDateTime, subsecDigits) {\n return formatIsoDateFields(isoDateTime) + \"T\" + formatTimeFields(isoDateTime, subsecDigits);\n}\n\nfunction formatIsoDateFields(isoDate) {\n return formatIsoYearMonthFields(isoDate) + \"-\" + padNumber2(isoDate.day);\n}\n\nfunction formatIsoYearMonthFields(isoDate) {\n const {year: year} = isoDate;\n return (year < 0 || year > 9999 ? getSignStr(year) + padNumber(6, Math.abs(year)) : padNumber(4, year)) + \"-\" + padNumber2(isoDate.month);\n}\n\nfunction formatIsoMonthDayFields(isoDate) {\n return padNumber2(isoDate.month) + \"-\" + padNumber2(isoDate.day);\n}\n\nfunction formatTimeFields(timeFields, subsecDigits) {\n const parts = [ padNumber2(timeFields.hour), padNumber2(timeFields.minute) ];\n return -1 !== subsecDigits && parts.push(padNumber2(timeFields.second) + ((millisecond, microsecond, nanosecond, subsecDigits) => formatSubsecNano(millisecond * nanoInMilli + microsecond * nanoInMicro + nanosecond, subsecDigits))(timeFields.millisecond, timeFields.microsecond, timeFields.nanosecond, subsecDigits)), \n parts.join(\":\");\n}\n\nfunction formatOffsetNano(offsetNano, offsetDisplay = 0) {\n if (1 === offsetDisplay) {\n return \"\";\n }\n const [hour, nanoRemainder0] = divModFloor(Math.abs(offsetNano), nanoInHour);\n const [minute, nanoRemainder1] = divModFloor(nanoRemainder0, nanoInMinute);\n const [second, nanoRemainder2] = divModFloor(nanoRemainder1, nanoInSec);\n return getSignStr(offsetNano) + padNumber2(hour) + \":\" + padNumber2(minute) + (second || nanoRemainder2 ? \":\" + padNumber2(second) + formatSubsecNano(nanoRemainder2) : \"\");\n}\n\nfunction formatTimeZone(timeZoneId, timeZoneDisplay) {\n return 1 !== timeZoneDisplay ? \"[\" + (2 === timeZoneDisplay ? \"!\" : \"\") + timeZoneId + \"]\" : \"\";\n}\n\nfunction formatCalendar(calendar, calendarDisplay) {\n return calendarDisplay > 1 || 0 === calendarDisplay && calendar !== isoCalendarImpl ? formatCalendarId(getCalendarSlotId(calendar), 2 === calendarDisplay) : \"\";\n}\n\nfunction formatCalendarId(calendarId, isCritical) {\n return \"[\" + (isCritical ? \"!\" : \"\") + \"u-ca=\" + calendarId + \"]\";\n}\n\nconst trailingZerosRE = /0+$/;\n\nfunction formatSubsecNano(totalNano, subsecDigits) {\n let s = padNumber(9, totalNano);\n return s = void 0 === subsecDigits ? s.replace(trailingZerosRE, \"\") : s.slice(0, subsecDigits), \n s ? \".\" + s : \"\";\n}\n\nfunction getSignStr(num) {\n return num < 0 ? \"-\" : \"+\";\n}\n\nconst icuRegExp = /^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/;\n\nconst badCharactersRegExp = /[^\\w\\/:+-]+/;\n\nfunction refineTimeZoneId(rawId) {\n return resolveTimeZoneId(requireString(rawId));\n}\n\nfunction resolveTimeZoneId(rawId) {\n return resolveTimeZoneRecord(rawId).id;\n}\n\nfunction resolveTimeZoneRecord(rawId) {\n const upperRawId = rawId.toUpperCase();\n const offsetRecord = (upperRawId => {\n const offsetNano = parseOffsetNanoMaybe(upperRawId, 1);\n if (void 0 !== offsetNano) {\n return {\n id: formatOffsetNano(offsetNano),\n Z: offsetNano,\n m: offsetNano\n };\n }\n })(upperRawId);\n if (offsetRecord) {\n return {\n kind: \"fixed\",\n ...offsetRecord\n };\n }\n const normId = \"UTC\" === upperRawId ? \"UTC\" : (rawId => (badCharactersRegExp.test(rawId) && throwRangeError(invalidTimeZone(rawId)), \n icuRegExp.test(rawId) && throwRangeError(\"Forbidden ICU TimeZone\"), rawId.toLowerCase().split(\"/\").map((part, partI) => (part.length <= 3 || /\\d/.test(part)) && !/etc|yap/.test(part) ? part.toUpperCase() : part.replace(/baja|dumont|[a-z]+/g, (a, i) => a.length <= 2 && !partI || \"in\" === a || \"chat\" === a ? a.toUpperCase() : a.length > 2 || !i ? capitalize(a).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : a)).join(\"/\")))(rawId);\n return queryNamedTimeZoneRecord(normId);\n}\n\nconst queryNamedTimeZoneRecord = /*@__PURE__*/ memoize(normId => {\n if (\"UTC\" === normId) {\n return {\n kind: \"utc\",\n id: normId,\n m: normId\n };\n }\n const upperNormId = normId.toUpperCase();\n const format = queryTimeZoneIntlFormat(upperNormId);\n return {\n kind: \"named\",\n id: normId,\n format: format,\n m: format.resolvedOptions().timeZone\n };\n});\n\nconst queryTimeZoneIntlFormat = /*@__PURE__*/ memoize(upperNormId => new RawDateTimeFormat(\"en-u-hc-h23\", {\n calendar: \"iso8601\",\n timeZone: upperNormId,\n era: \"short\",\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n}));\n\nfunction queryTimeZone(rawTimeZoneId) {\n const record = resolveTimeZoneRecord(rawTimeZoneId);\n return queryTimeZoneRecord(record.id, record);\n}\n\nconst queryTimeZoneRecord = /*@__PURE__*/ memoize((normTimeZoneId, record) => \"named\" === record.kind ? new IntlTimeZone(normTimeZoneId, record.m, record.format) : new FixedTimeZone(normTimeZoneId, record.m, \"fixed\" === record.kind ? record.Z : 0));\n\nclass FixedTimeZone {\n constructor(id, compareKey, offsetNano) {\n this.id = id, this.m = compareKey, this.Z = offsetNano;\n }\n B() {\n return this.Z;\n }\n R(isoDateTime) {\n return [ isoDateTimeAndOffsetToEpochNano(isoDateTime, this.Z) ];\n }\n C() {}\n}\n\nclass IntlTimeZone {\n constructor(id, compareKey, format) {\n this.id = id, this.m = compareKey, this.oe = ((computeOffsetSec, periodDays) => {\n const getSample = memoize(computeOffsetSec);\n const getSplit = memoize(createSplitTuple);\n const periodSec = 86400 * periodDays;\n function getOffsetSec(epochSec) {\n const [startEpochSec, endEpochSec] = computePeriod(epochSec, periodSec);\n const clampedStartEpochSec = clampIntlSampleEpochSec(startEpochSec);\n const clampedEndEpochSec = clampIntlSampleEpochSec(endEpochSec);\n const startOffsetSec = getSample(clampedStartEpochSec);\n const endOffsetSec = getSample(clampedEndEpochSec);\n return startOffsetSec === endOffsetSec ? startOffsetSec : pinch(getSplit(clampedStartEpochSec, clampedEndEpochSec), startOffsetSec, endOffsetSec, epochSec);\n }\n function pinch(split, startOffsetSec, endOffsetSec, forEpochSec) {\n let offsetSec;\n let splitDurSec;\n for (;(void 0 === forEpochSec || void 0 === (offsetSec = forEpochSec < split[0] ? startOffsetSec : forEpochSec >= split[1] ? endOffsetSec : void 0)) && (splitDurSec = split[1] - split[0]); ) {\n const middleEpochSec = split[0] + Math.floor(splitDurSec / 2);\n computeOffsetSec(middleEpochSec) === endOffsetSec ? split[1] = middleEpochSec : split[0] = middleEpochSec + 1;\n }\n return offsetSec;\n }\n return {\n Ae(zonedEpochSec) {\n const wideOffsetSec0 = getOffsetSec(zonedEpochSec - 86400);\n const wideOffsetSec1 = getOffsetSec(zonedEpochSec + 86400);\n const wideUtcEpochSec0 = zonedEpochSec - wideOffsetSec0;\n const wideUtcEpochSec1 = zonedEpochSec - wideOffsetSec1;\n if (wideOffsetSec0 === wideOffsetSec1) {\n return [ wideUtcEpochSec0 ];\n }\n const narrowOffsetSec0 = getOffsetSec(wideUtcEpochSec0);\n return narrowOffsetSec0 === getOffsetSec(wideUtcEpochSec1) ? [ zonedEpochSec - narrowOffsetSec0 ] : wideOffsetSec0 > wideOffsetSec1 ? [ wideUtcEpochSec0, wideUtcEpochSec1 ] : [];\n },\n ze: getOffsetSec,\n C: function getTransition(epochSec, direction) {\n if (direction > 0 && epochSec >= 864e10) {\n return;\n }\n if (direction < 0) {\n if (epochSec <= minPossibleTransitionSec) {\n return;\n }\n const lookaheadEpochSec = getCurrentEpochSec() + 94867200;\n if (epochSec > lookaheadEpochSec) {\n return getTransition(lookaheadEpochSec, -1);\n }\n }\n const searchEpochSec = direction > 0 ? Math.max(epochSec, minPossibleTransitionSec) : epochSec;\n let [startEpochSec, endEpochSec] = computePeriod(searchEpochSec, periodSec);\n const inc = periodSec * direction;\n const searchLimit = direction > 0 ? Math.max(epochSec, getCurrentEpochSec()) + 94867200 : minPossibleTransitionSec;\n const inBounds = () => direction < 0 ? endEpochSec > searchLimit : startEpochSec < searchLimit;\n for (;inBounds(); ) {\n const clampedStartEpochSec = clampIntlSampleEpochSec(startEpochSec);\n const clampedEndEpochSec = clampIntlSampleEpochSec(endEpochSec);\n const startOffsetSec = getSample(clampedStartEpochSec);\n const endOffsetSec = getSample(clampedEndEpochSec);\n if (startOffsetSec !== endOffsetSec) {\n const split = getSplit(clampedStartEpochSec, clampedEndEpochSec);\n pinch(split, startOffsetSec, endOffsetSec);\n const transitionEpochSec = split[0];\n if ((compareNumbers(transitionEpochSec, epochSec) || 1) === direction) {\n return transitionEpochSec;\n }\n }\n startEpochSec += inc, endEpochSec += inc;\n }\n }\n };\n })((format => epochSec => {\n const intlParts = formatEpochMilliToPartsRecord(format, 1e3 * epochSec);\n return 86400 * isoPartsToEpochDays((intlParts => {\n const relatedYear = intlParts.relatedYear;\n if (void 0 !== relatedYear) {\n return parseInt(relatedYear);\n }\n const year = parseInt(intlParts.year);\n return void 0 !== intlParts.era && \"bce\" === normalizeEraName(intlParts.era) ? 1 - year : year;\n })(intlParts), parseInt(intlParts.month), parseInt(intlParts.day)) + 3600 * parseInt(intlParts.hour) + 60 * parseInt(intlParts.minute) + parseInt(intlParts.second) - epochSec;\n })(format), (timeZoneId => {\n const timeZoneName = timeZoneId.split(\"/\").pop();\n return timeZonePeriodDaysByName[timeZoneName] || 60;\n })(id));\n }\n B(epochNano) {\n return this.oe.ze((epochNano => epochNanoToSecMod(epochNano)[0])(epochNano)) * nanoInSec;\n }\n R(isoDateTime) {\n const zonedEpochSec = 86400 * isoDateToEpochDays(isoDateTime) + timeFieldsToSec(isoDateTime);\n const subsecNano = timeFieldsToSubsecNano(isoDateTime);\n return this.oe.Ae(zonedEpochSec).map(epochSec => checkEpochNanoInBounds(BigInt(epochSec) * bigNanoInSec + BigInt(subsecNano)));\n }\n C(epochNano, direction) {\n const [epochSec, subsecNano] = epochNanoToSecMod(epochNano);\n const resEpochSec = this.oe.C(epochSec + (direction > 0 || subsecNano ? 1 : 0), direction);\n if (void 0 !== resEpochSec) {\n return BigInt(resEpochSec) * bigNanoInSec;\n }\n }\n}\n\nfunction getCurrentEpochSec() {\n return Math.floor(Date.now() / 1e3);\n}\n\nfunction createSplitTuple(startEpochSec, endEpochSec) {\n return [ startEpochSec, endEpochSec ];\n}\n\nfunction computePeriod(epochSec, periodSec) {\n const startEpochSec = Math.floor(epochSec / periodSec) * periodSec;\n return [ startEpochSec, startEpochSec + periodSec ];\n}\n\nfunction clampIntlSampleEpochSec(epochSec) {\n return constrainToRange(epochSec, -1e10, 864e10);\n}\n\nfunction refineMaybeZonedDateTimeObjectLike(refineTimeZoneString, calendar, bag) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateTimeAndZoneFieldNamesAlpha, dateTimeAndZoneFieldNamesWithEraAlpha), zonedDateTimeFieldRefiners, [], 0);\n const isZoned = void 0 !== fields.timeZone;\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar);\n const isoDate = createDateFromRefinedFields(fields, calendar, year, monthCodeParts, 0);\n if (isZoned) {\n const timeFields = resolveTimeFields(fields);\n const timeZone = queryTimeZone(refineTimeZoneString(fields.timeZone));\n return {\n epochNanoseconds: getMatchingInstantFor(timeZone, combineDateAndTime(isoDate, timeFields), fields.offset),\n timeZone: timeZone,\n calendar: calendar\n };\n }\n return isoDate;\n}\n\nfunction refineZonedDateTimeObjectLike(refineTimeZoneString, calendar, bag, options) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateTimeAndZoneFieldNamesAlpha, dateTimeAndZoneFieldNamesWithEraAlpha), zonedDateTimeFieldRefiners, timeZoneFieldNames, 0);\n const timeZoneId = refineTimeZoneString(fields.timeZone);\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar);\n const [overflow, offsetDisambig, epochDisambig] = refineZonedFieldOptions(options);\n const isoDate = createDateFromRefinedFields(fields, calendar, year, monthCodeParts, overflow);\n const timeFields = resolveTimeFields(fields, overflow);\n const timeZone = queryTimeZone(timeZoneId);\n return createZonedEpochNanoSlots(getMatchingInstantFor(timeZone, combineDateAndTime(isoDate, timeFields), fields.offset, offsetDisambig, epochDisambig), timeZone, calendar);\n}\n\nfunction refinePlainDateTimeObjectLike(calendar, bag, options) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateTimeFieldNamesAlpha, dateTimeFieldNamesWithEraAlpha), dateTimeFieldRefiners, [], 0);\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar);\n const overflow = refineOverflowOptions(options);\n return createDateTimeFromRefinedFields(createDateFromRefinedFields(fields, calendar, year, monthCodeParts, overflow), resolveTimeFields(fields, overflow), calendar);\n}\n\nfunction refinePlainDateObjectLike(calendar, bag, options, requireFields = []) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha), dateFieldRefiners, requireFields);\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar);\n return createDateFromRefinedFields(fields, calendar, year, monthCodeParts, refineOverflowOptions(options));\n}\n\nfunction refinePlainYearMonthObjectLike(calendar, bag, options, requireFields) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, yearMonthFieldNamesAlpha, yearMonthFieldNamesWithEraAlpha), dateFieldRefiners, requireFields);\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar, 1);\n return createYearMonthFromRefinedFields(fields, calendar, year, monthCodeParts, refineOverflowOptions(options));\n}\n\nfunction refinePlainMonthDayObjectLike(calendar, calendarAbsent, bag, options) {\n const fields = readAndRefineBagFields(bag, getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha), dateFieldRefiners, dayFieldNamesAsc, 0);\n calendarAbsent && void 0 !== fields.month && void 0 === fields.monthCode && void 0 === fields.year && (fields.year = 1972);\n const [year, monthCodeParts] = refineMonthDayFields(fields, calendar);\n return createMonthDayFromRefinedFields(fields, calendar, year, monthCodeParts, refineOverflowOptions(options));\n}\n\nfunction refinePlainTimeObjectLike(bag, options) {\n return resolveTimeFields(readAndRefineBagFields(bag, timeFieldNamesAlpha, timeFieldRefiners, [], 1), refineOverflowOptions(options));\n}\n\nfunction refineDurationObjectLike(bag) {\n const durationFields = readAndRefineBagFields(bag, durationFieldNamesAlpha, durationFieldRefiners);\n return createDurationSlots(validateDurationFields({\n ...durationFieldDefaults,\n ...durationFields\n }));\n}\n\nfunction throwFailedParse(s) {\n throwRangeError(failedParse(s));\n}\n\nfunction parseInstant(s) {\n const organized = parseDateTimeLike(s = requireString(toPrimitiveWithStringHint(s)));\n let offsetNano;\n return organized || throwFailedParse(s), organized.F ? offsetNano = 0 : organized.offset ? offsetNano = parseOffsetNano(organized.offset) : throwFailedParse(s), \n organized.timeZoneId && parseOffsetNanoMaybe(organized.timeZoneId, 1), validateIsoDateTimeFields(organized), \n createEpochNanoSlots(isoDateTimeAndOffsetToEpochNano(organized, offsetNano));\n}\n\nfunction parseRelativeToSlots(s, resolveCalendar) {\n const organized = parseDateTimeLike(requireString(s));\n return organized || throwFailedParse(s), organized.timeZoneId ? finalizeZonedDateTime(organized, resolveCalendar, void 0) : (organized.F && throwFailedParse(s), \n finalizeDate(organized, resolveCalendar));\n}\n\nfunction parseZonedDateTime(s, resolveCalendar, options) {\n const organized = parseDateTimeLike(requireString(s));\n return organized && organized.timeZoneId || throwFailedParse(s), finalizeZonedDateTime(organized, resolveCalendar, options);\n}\n\nfunction parsePlainDateTime(s, resolveCalendar) {\n const organized = parseDateTimeLike(requireString(s));\n return organized && !organized.F || throwFailedParse(s), finalizeDateTime(organized, resolveCalendar);\n}\n\nfunction parsePlainDate(s, resolveCalendar) {\n const slots = finalizeDateLike(parsePlainDateLike(requireString(s)), void 0, resolveCalendar);\n return createDateSlots(slots, slots.calendar);\n}\n\nfunction parsePlainYearMonth(s, resolveCalendar) {\n const organized = parseYearMonthOnly(requireString(s));\n if (organized) {\n return requireIsoCalendar(organized), createDateSlots(checkIsoYearMonthInBounds(validateIsoDateFields(organized)), resolveCalendar(organized.calendarId));\n }\n const dateSlots = finalizeDateLike(parsePlainDateLike(s), projectIsoYearMonthDate, resolveCalendar);\n const {calendar: calendar} = dateSlots;\n return createDateSlots(moveToStartOfMonth(calendar, dateSlots), calendar);\n}\n\nfunction requireIsoCalendar(organized) {\n \"iso8601\" !== organized.calendarId && throwRangeError(invalidSubstring(organized.calendarId));\n}\n\nfunction parsePlainMonthDay(s, resolveCalendar) {\n const organized = parseMonthDayOnly(requireString(s));\n if (organized) {\n return requireIsoCalendar(organized), createDateSlots(validateIsoDateFields(organized), resolveCalendar(organized.calendarId));\n }\n const dateSlots = finalizeDateLike(parsePlainDateLike(s), projectIsoMonthDayDate, resolveCalendar);\n const {calendar: calendar} = dateSlots;\n const {year: origYear, month: origMonth, day: day} = computeCalendarDateFields(calendar, dateSlots);\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, origYear, origMonth);\n const {year: year, month: month} = ((calendar, monthCodeNumber, isLeapMonth, day) => {\n const yearMonthFields = calendar ? calendar.u(monthCodeNumber, isLeapMonth, day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth);\n return yearMonthFields || throwRangeError(\"Cannot guess year\"), yearMonthFields;\n })(calendar, monthCodeNumber, isLeapMonth, day);\n return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, day)), calendar);\n}\n\nfunction parsePlainTime(s) {\n let organized = (s => {\n const parts = parseTimeOnlyParts(s);\n return parts ? (organizeAnnotationParts(parts[13]), organizeTimeParts(parts, 1)) : void 0;\n })(s = requireString(s));\n if (!organized) {\n const dateTime = parseDateTimeLike(s);\n dateTime && dateTime.te || throwFailedParse(s), dateTime.F && throwRangeError(invalidSubstring(\"Z\")), \n requireIsoCalendar(dateTime), organized = dateTime;\n }\n let altParsed;\n return (altParsed = parseYearMonthOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s), \n (altParsed = parseMonthDayOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s), \n createTimeSlots(validateTimeFields(organized));\n}\n\nfunction parseDuration(s) {\n const parts = durationRegExp.exec(requireString(s));\n return parts || throwFailedParse(s), createDurationSlots(validateDurationFields((parts => {\n let hasAny = 0;\n let hasAnyFrac = 0;\n let leftoverNano = 0;\n let durationFields = {\n years: parseUnit(parts[2]),\n months: parseUnit(parts[3]),\n weeks: parseUnit(parts[4]),\n days: parseUnit(parts[5]),\n hours: parseUnit(parts[6], parts[7], 5),\n minutes: parseUnit(parts[8], parts[9], 4),\n seconds: parseUnit(parts[10], parts[11], 3),\n ...nanoToGivenFields(leftoverNano, 2, durationFieldNamesAsc)\n };\n return hasAny || throwRangeError(noValidFields(durationFieldNamesAsc)), parseSign(parts[1]) < 0 && (durationFields = negateDurationFields(durationFields)), \n durationFields;\n function parseUnit(wholeStr, fracStr, timeUnit) {\n let leftoverUnits = 0;\n let wholeUnits = 0;\n return timeUnit && ([leftoverUnits, leftoverNano] = divModFloor(leftoverNano, unitNanoMap[timeUnit])), \n void 0 !== wholeStr && (hasAnyFrac && throwRangeError(invalidSubstring(wholeStr)), \n wholeUnits = (s => {\n const n = parseInt(s);\n return Number.isFinite(n) || throwRangeError(invalidSubstring(s)), n;\n })(wholeStr), hasAny = 1, fracStr && (leftoverNano = parseSubsecNano(fracStr) * (unitNanoMap[timeUnit] / nanoInSec), \n hasAnyFrac = 1)), leftoverUnits + wholeUnits;\n }\n })(parts)));\n}\n\nfunction parseCalendarId(s) {\n const res = parseDateTimeLike(s) || parseYearMonthOnly(s) || parseMonthDayOnly(s);\n if (res) {\n return res.calendarId;\n }\n const timeParts = parseTimeOnlyParts(s);\n return timeParts ? organizeAnnotationParts(timeParts[13]).calendarId : s;\n}\n\nfunction parseTimeZoneId(s) {\n const parsed = parseDateTimeLike(s);\n return parsed && (parsed.timeZoneId || parsed.F && \"UTC\" || parsed.offset) || s;\n}\n\nfunction parsePlainDateLike(s) {\n const organized = parseDateTimeLike(s);\n return organized && !organized.F || throwFailedParse(s), organized;\n}\n\nfunction finalizeDateLike(organized, isoDateProjector, resolveCalendar) {\n return isoDateProjector && \"iso8601\" === organized.calendarId ? (validateIsoDateFields(organized), \n organized.te && validateTimeFields(organized), finalizeDate(isoDateProjector(organized), resolveCalendar)) : organized.te ? finalizeDateTime(organized, resolveCalendar) : finalizeDate(organized, resolveCalendar);\n}\n\nfunction projectIsoYearMonthDate(organized) {\n const day = 12 * organized.year + organized.month === isoYearMonthIndexMin ? 20 : 1;\n return {\n ...organized,\n day: day\n };\n}\n\nfunction projectIsoMonthDayDate(organized) {\n return {\n ...organized,\n year: 1972\n };\n}\n\nfunction finalizeZonedDateTime(organized, resolveCalendar, options) {\n const timeZone = queryTimeZone(resolveTimeZoneId(organized.timeZoneId));\n let epochNano;\n if (validateIsoDateTimeFields(organized), organized.te) {\n const offsetNano = organized.offset ? parseOffsetNano(organized.offset) : void 0;\n const [, offsetDisambig, epochDisambig] = refineZonedFieldOptions(options);\n epochNano = getMatchingInstantFor(timeZone, organized, offsetNano, offsetDisambig, epochDisambig, !(timeZone.Z || void 0 === organized.offset || (offset = organized.offset, \n offset.replace(/\\D/g, \"\").length > 4)), organized.F);\n } else {\n refineZonedFieldOptions(options), epochNano = getStartOfDayInstantFor(timeZone, organized);\n }\n var offset;\n return checkEpochNanoInBounds(epochNano), createZonedEpochNanoSlots(epochNano, timeZone, resolveCalendar(organized.calendarId));\n}\n\nfunction finalizeDateTime(organized, resolveCalendar) {\n return validateIsoDateTimeFields(organized), checkIsoDateTimeInBounds(organized), \n {\n ...combineDateAndTime(organized, organized),\n calendar: resolveCalendar(organized.calendarId)\n };\n}\n\nfunction finalizeDate(organized, resolveCalendar) {\n return validateIsoDateFields(organized), checkIsoDateInBounds(organized), {\n calendar: resolveCalendar(organized.calendarId),\n year: organized.year,\n month: organized.month,\n day: organized.day\n };\n}\n\nfunction timeRegExpStr(separatorIndex) {\n return `(\\\\d{2})(?:(:?)(\\\\d{2})(?:\\\\${separatorIndex}(\\\\d{2})(?:[.,](\\\\d{1,9}))?)?)?`;\n}\n\nconst dateTimeRegExpStr = \"(?:(?:([+-])(\\\\d{6}))|(\\\\d{4}))(-?)(\\\\d{2})\\\\4(\\\\d{2})(?:[T ]\" + timeRegExpStr(8) + \"(Z|([+-])\" + timeRegExpStr(15) + \")?)?\";\n\nconst yearMonthRegExp = /*@__PURE__*/ createRegExp(\"(?:(?:([+-])(\\\\d{6}))|(\\\\d{4}))-?(\\\\d{2})((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})\");\n\nconst monthDayRegExp = /*@__PURE__*/ createRegExp(\"(?:--)?(\\\\d{2})-?(\\\\d{2})((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})\");\n\nconst dateTimeRegExp = /*@__PURE__*/ createRegExp(dateTimeRegExpStr + \"((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})\");\n\nconst timeRegExp = /*@__PURE__*/ createRegExp(\"T?\" + timeRegExpStr(2) + `(([+-])${timeRegExpStr(9)})?((?:\\\\[(!?)([^\\\\]]*)\\\\]){0,9})`);\n\nconst annotationRegExp = /*@__PURE__*/ new RegExp(\"\\\\[(!?)([^\\\\]]*)\\\\]\", \"g\");\n\nconst durationRegExp = /*@__PURE__*/ createRegExp(\"([+-])?P(\\\\d+Y)?(\\\\d+M)?(\\\\d+W)?(\\\\d+D)?(?:T(?!$)(?:(\\\\d+)(?:[.,](\\\\d{1,9}))?H)?(?:(\\\\d+)(?:[.,](\\\\d{1,9}))?M)?(?:(\\\\d+)(?:[.,](\\\\d{1,9}))?S)?)?\");\n\nfunction parseDateTimeLike(s) {\n const parts = dateTimeRegExp.exec(s);\n return parts ? (parts => {\n const zOrOffset = parts[12];\n const hasZ = \"Z\" === (zOrOffset || \"\").toUpperCase();\n return {\n year: organizeIsoYearParts(parts),\n month: parseInt(parts[5]),\n day: parseInt(parts[6]),\n ...organizeTimeParts(parts, 7),\n ...organizeAnnotationParts(parts[19]),\n te: Boolean(parts[7]),\n F: hasZ,\n offset: hasZ ? void 0 : zOrOffset\n };\n })(parts) : void 0;\n}\n\nfunction parseYearMonthOnly(s) {\n const parts = yearMonthRegExp.exec(s);\n if (parts) {\n return (parts => ({\n year: organizeIsoYearParts(parts),\n month: parseInt(parts[4]),\n day: 1,\n ...organizeAnnotationParts(parts[5])\n }))(parts);\n }\n}\n\nfunction parseMonthDayOnly(s) {\n const parts = monthDayRegExp.exec(s);\n return parts ? (parts => ({\n year: 1972,\n month: parseInt(parts[1]),\n day: parseInt(parts[2]),\n ...organizeAnnotationParts(parts[3])\n }))(parts) : void 0;\n}\n\nfunction parseTimeOnlyParts(s) {\n const parts = timeRegExp.exec(s);\n if (parts) {\n return parts[6] && parseOffsetNano(parts[6]), parts;\n }\n}\n\nfunction organizeTimeParts(parts, hourIndex) {\n const second = parseInt0(parts[hourIndex + 3]);\n return {\n ...nanoToTimeAndDay(parseSubsecNano(parts[hourIndex + 4] || \"\"))[0],\n hour: parseInt0(parts[hourIndex]),\n minute: parseInt0(parts[hourIndex + 2]),\n second: 60 === second ? 59 : second\n };\n}\n\nfunction organizeIsoYearParts(parts) {\n const yearSign = parseSign(parts[1]);\n const year = parseInt(parts[2] || parts[3]);\n return yearSign < 0 && !year && throwRangeError(invalidSubstring(-0)), yearSign * year;\n}\n\nfunction organizeAnnotationParts(s) {\n let calendarIsCritical;\n let timeZoneId;\n const calendarIds = [];\n return s.replace(annotationRegExp, (whole, criticalStr, mainStr) => {\n const isCritical = Boolean(criticalStr);\n const [val, name] = mainStr.split(\"=\").reverse();\n return name ? \"u-ca\" === name ? (calendarIds.push(val.toLowerCase()), calendarIsCritical || (calendarIsCritical = isCritical)) : (isCritical || /[A-Z]/.test(name)) && throwRangeError(invalidSubstring(whole)) : (timeZoneId && throwRangeError(invalidSubstring(whole)), \n timeZoneId = val), \"\";\n }), calendarIds.length > 1 && calendarIsCritical && throwRangeError(invalidSubstring(s)), \n {\n timeZoneId: timeZoneId,\n calendarId: calendarIds[0] || \"iso8601\"\n };\n}\n\nfunction mergeCalendarFields(calendar, baseFields, additionalFields) {\n const merged = Object.assign(Object.create(null), baseFields);\n return spliceFields(merged, additionalFields, monthFieldNames), getCalendarEraOrigins(calendar) && (spliceFields(merged, additionalFields, allYearFieldNames), \n calendar && calendar.je && spliceFields(merged, additionalFields, monthDayFieldNames, eraYearFieldNames)), \n merged;\n}\n\nfunction spliceFields(dest, additional, allPropNames, deletablePropNames) {\n let anyMatching = 0;\n const nonMatchingPropNames = [];\n for (const propName of allPropNames) {\n void 0 !== additional[propName] ? anyMatching = 1 : nonMatchingPropNames.push(propName);\n }\n if (Object.assign(dest, additional), anyMatching) {\n for (const deletablePropName of deletablePropNames || nonMatchingPropNames) {\n delete dest[deletablePropName];\n }\n }\n}\n\nfunction mergeZonedDateTimeFields(calendar, zonedDateTimeSlots, modFields) {\n const validFieldNames = getCalendarFieldNames(calendar, dateTimeAndOffsetFieldNamesAlpha, dateTimeAndOffsetFieldNamesWithEraAlpha);\n const zonedSlots = zonedEpochSlotsToIso(zonedDateTimeSlots);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, zonedSlots);\n const origFields = {\n year: year,\n monthCode: computeMonthCode(calendar, year, month),\n day: day,\n hour: zonedSlots.hour,\n minute: zonedSlots.minute,\n second: zonedSlots.second,\n millisecond: zonedSlots.millisecond,\n microsecond: zonedSlots.microsecond,\n nanosecond: zonedSlots.nanosecond,\n offset: zonedSlots.offsetNanoseconds\n };\n const partialFields = readAndRefineBagFields(modFields, validFieldNames, zonedDateTimeFieldRefiners);\n const mergedCalendarFields = mergeCalendarFields(calendar, origFields, partialFields);\n return [ {\n ...origFields,\n ...partialFields\n }, mergedCalendarFields ];\n}\n\nfunction mergeDateTimeFields(calendar, plainDateTimeSlots, modFields) {\n const validFieldNames = getCalendarFieldNames(calendar, dateTimeFieldNamesAlpha, dateTimeFieldNamesWithEraAlpha);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, plainDateTimeSlots);\n const origFields = {\n year: year,\n monthCode: computeMonthCode(calendar, year, month),\n day: day,\n hour: plainDateTimeSlots.hour,\n minute: plainDateTimeSlots.minute,\n second: plainDateTimeSlots.second,\n millisecond: plainDateTimeSlots.millisecond,\n microsecond: plainDateTimeSlots.microsecond,\n nanosecond: plainDateTimeSlots.nanosecond\n };\n const partialFields = readAndRefineBagFields(modFields, validFieldNames, dateTimeFieldRefiners);\n const mergedCalendarFields = mergeCalendarFields(calendar, origFields, partialFields);\n return [ {\n ...origFields,\n ...partialFields\n }, mergedCalendarFields ];\n}\n\nfunction mergeDateFields(calendar, plainDateSlots, modFields) {\n const validFieldNames = getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, plainDateSlots);\n return mergeCalendarFields(calendar, {\n year: year,\n monthCode: computeMonthCode(calendar, year, month),\n day: day\n }, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners));\n}\n\nfunction mergeYearMonthFields(calendar, plainYearMonthSlots, modFields) {\n const validFieldNames = getCalendarFieldNames(calendar, yearMonthFieldNamesAlpha, yearMonthFieldNamesWithEraAlpha);\n const {year: year, month: month} = computeCalendarDateFields(calendar, plainYearMonthSlots);\n return mergeCalendarFields(calendar, {\n year: year,\n monthCode: computeMonthCode(calendar, year, month)\n }, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners));\n}\n\nfunction mergeMonthDayFields(calendar, plainMonthDaySlots, modFields) {\n const validFieldNames = getCalendarFieldNames(calendar, dateFieldNamesAlpha, dateFieldNamesWithEraAlpha);\n const {year: year, month: month, day: day} = computeCalendarDateFields(calendar, plainMonthDaySlots);\n return mergeCalendarFields(calendar, {\n monthCode: computeMonthCode(calendar, year, month),\n day: day\n }, readAndRefineBagFields(modFields, validFieldNames, dateFieldRefiners));\n}\n\nfunction createZonedDateTimeFromMergedFields(zonedDateTimeSlots, mergedAllFields, calendarFields, year, monthCodeParts, overflow, offsetDisambig, epochDisambig) {\n const {calendar: calendar, timeZone: timeZone} = zonedDateTimeSlots;\n return createZonedEpochNanoSlots(getMatchingInstantFor(timeZone, combineDateAndTime(createDateFromRefinedFields(calendarFields, calendar, year, monthCodeParts, overflow), constrainTimeFields(mergedAllFields, overflow)), mergedAllFields.offset, offsetDisambig, epochDisambig), timeZone, calendar);\n}\n\nfunction createDateTimeFromMergedFields(mergedAllFields, calendarFields, calendar, year, monthCodeParts, overflow) {\n return createDateTimeFromRefinedFields(createDateFromRefinedFields(calendarFields, calendar, year, monthCodeParts, overflow), constrainTimeFields(mergedAllFields, overflow), calendar);\n}\n\nfunction mergeTimeFields(initialFields, modFields) {\n return {\n ...pluckProps(timeFieldNamesAlpha, initialFields),\n ...readAndRefineBagFields(modFields, timeFieldNamesAlpha, timeFieldRefiners)\n };\n}\n\nfunction mergeDurationFields(slots, fields) {\n return createDurationSlots((initialFields = slots, modFields = fields, validateDurationFields({\n ...initialFields,\n ...readAndRefineBagFields(modFields, durationFieldNamesAlpha, durationFieldRefiners)\n })));\n var initialFields, modFields;\n}\n\nfunction computeMonthCode(calendar, year, month) {\n const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);\n return formatMonthCode(monthCodeNumber, isLeapMonth);\n}\n\nfunction totalDuration(refineRelativeTo, slots, options) {\n const [totalUnit, relativeToSlots] = refineTotalOptions(options, refineRelativeTo);\n const maxDurationUnit = getMaxDurationUnit(slots);\n const maxUnit = Math.max(totalUnit, maxDurationUnit);\n const isZoned = relativeToSlots && isZonedEpochSlots(relativeToSlots);\n if (!relativeToSlots && isUniformUnit(maxUnit, isZoned)) {\n return totalDayTimeDuration(slots, totalUnit);\n }\n if (relativeToSlots || throwRangeError(\"Missing relativeTo\"), !slots.sign && (!isZoned || totalUnit < 6)) {\n return 0;\n }\n const [balancedDuration, endEpochNano, relativeOps] = spanRelativeDuration(relativeToSlots, slots, totalUnit);\n return isUniformUnit(totalUnit, isZoned) ? totalDayTimeDuration(balancedDuration, totalUnit) : ((durationFields, endEpochNano, totalUnit, relativeOps) => {\n const fieldName = durationFieldNamesAsc[totalUnit];\n const baseDurationFields = clearDurationFields(totalUnit, durationFields);\n return totalRelativeUnit(durationFields[fieldName], computeDurationSign(durationFields) || 1, endEpochNano, value => (baseDurationFields[fieldName] = value, \n moveRelativeMarkerToEpochNano(relativeOps, baseDurationFields)));\n })(balancedDuration, endEpochNano, totalUnit, relativeOps);\n}\n\nfunction totalDayTimeDuration(durationFields, totalUnit) {\n return divideBigNanoToExactNumber(durationDayTimeToBigNano(durationFields), unitNanoMap[totalUnit]);\n}\n\nfunction instantToZonedDateTime(instantSlots, timeZone, calendar) {\n return createZonedEpochNanoSlots(instantSlots.epochNanoseconds, timeZone, calendar);\n}\n\nfunction zonedDateTimeToInstant(zonedDateTimeSlots0) {\n return createEpochNanoSlots(zonedDateTimeSlots0.epochNanoseconds);\n}\n\nfunction zonedDateTimeToDateTime(zonedDateTimeSlots0) {\n return createDateTimeSlots(zonedEpochSlotsToIso(zonedDateTimeSlots0), zonedDateTimeSlots0.calendar);\n}\n\nfunction zonedDateTimeToDate(zonedDateTimeSlots0) {\n return createDateSlots(zonedEpochSlotsToIso(zonedDateTimeSlots0), zonedDateTimeSlots0.calendar);\n}\n\nfunction zonedDateTimeToTime(zonedDateTimeSlots0) {\n return createTimeSlots(zonedEpochSlotsToIso(zonedDateTimeSlots0));\n}\n\nfunction dateTimeToZonedDateTime(plainDateTimeSlots, timeZone, epochDisambig) {\n return createZonedEpochNanoSlots(checkEpochNanoInBounds(getSingleInstantFor(timeZone, plainDateTimeSlots, epochDisambig)), timeZone, plainDateTimeSlots.calendar);\n}\n\nfunction dateToZonedDateTime(plainDateSlots, timeZone, timeFields) {\n let epochNano;\n return epochNano = timeFields ? getSingleInstantFor(timeZone, combineDateAndTime(plainDateSlots, timeFields)) : getStartOfDayInstantFor(timeZone, combineDateAndTime(plainDateSlots, timeFieldDefaults)), \n createZonedEpochNanoSlots(epochNano, timeZone, plainDateSlots.calendar);\n}\n\nfunction yearMonthToDate(calendar, input, bag) {\n return mergeFieldsIntoDate(calendar, pluckProps(getCalendarFieldNames(calendar, yearMonthCodeFieldNamesAlpha, yearMonthCodeFieldNamesWithEraAlpha), input), readAndRefineBagFields(requireObjectLike(bag), dayFieldNamesAsc, dateFieldRefiners, []));\n}\n\nfunction monthDayToDate(calendar, input, bag) {\n const extraFieldNames = getCalendarFieldNames(calendar, yearFieldNamesAsc, yearFieldNamesWithEraAlpha);\n return mergeFieldsIntoDate(calendar, pluckProps(monthCodeDayFieldNamesAlpha, input), readAndRefineBagFields(requireObjectLike(bag), extraFieldNames, dateFieldRefiners, []));\n}\n\nfunction fieldsToMonthDay(calendar, input) {\n const refinedFields = readAndRefineBagFields(input, monthCodeDayFieldNamesAlpha, dateFieldRefiners);\n const [year, monthCodeParts] = refineMonthDayFields(refinedFields, calendar);\n return createMonthDayFromRefinedFields(refinedFields, calendar, year, monthCodeParts, 0);\n}\n\nfunction fieldsToYearMonth(calendar, input) {\n const refinedFields = readAndRefineBagFields(input, getCalendarFieldNames(calendar, yearMonthCodeFieldNamesAlpha, yearMonthCodeFieldNamesWithEraAlpha), dateFieldRefiners);\n const [year, monthCodeParts] = refineCalendarDateFields(refinedFields, calendar, 1);\n return createYearMonthFromRefinedFields(refinedFields, calendar, year, monthCodeParts, 0);\n}\n\nfunction mergeFieldsIntoDate(calendar, inputFields, extraFields) {\n const mergedFieldNames = getCalendarFieldNames(calendar, yearMonthCodeDayFieldNamesAlpha, yearMonthCodeDayFieldNamesWithEraAlpha);\n let mergedFields = mergeCalendarFields(calendar, inputFields, extraFields);\n mergedFields = readAndRefineBagFields(mergedFields, mergedFieldNames, dateFieldRefiners, []);\n const [year, monthCodeParts] = refineCalendarDateFields(mergedFields, calendar);\n return createDateFromRefinedFields(mergedFields, calendar, year, monthCodeParts, 0);\n}\n\nfunction epochMilliToInstant(epochMilli) {\n return createEpochNanoSlots(checkEpochNanoInBounds(BigInt(toStrictInteger(epochMilli)) * bigNanoInMilli));\n}\n\nfunction epochNanoToInstant(epochNano) {\n return createEpochNanoSlots(checkEpochNanoInBounds(toBigInt(epochNano)));\n}\n\nfunction applyPlainFormatTimeZone(options) {\n return options.timeZone = \"UTC\", [ \"full\", \"long\" ].includes(options.timeStyle) && (options.timeStyle = \"medium\"), \n options;\n}\n\nfunction applyZonedFormatTimeZone(options, timeZoneId) {\n return void 0 !== options.timeZone && throwTypeError(\"Cannot specify TimeZone\"), \n options.timeZone = timeZoneId, options;\n}\n\nfunction checkResolvedCalendarCompatible(format, slots, strictCalendarCheck) {\n const resolvedCalendarId = format.resolvedOptions().calendar;\n !strictCalendarCheck && slots.calendar === isoCalendarImpl || getCalendarSlotId(slots.calendar) === resolvedCalendarId || throwRangeError(\"Mismatching Calendars\");\n}\n\nfunction createOptionsTransformer(shapeFieldNames, invalidShapeFieldNames, ignoredFieldNames, defaultShapeFields, dateStyleReplacementFields) {\n const shapeFieldNameSet = new Set(shapeFieldNames);\n const invalidShapeFieldNameSet = new Set(invalidShapeFieldNames);\n const ignoredFieldNameSet = new Set(ignoredFieldNames);\n return (options, allowPartialOverlap) => {\n let dateStyle;\n let timeStyle;\n const granularShapeFields = {};\n const modifierFields = {};\n const otherFields = {};\n let hasInvalidGranularShapeFields = 0;\n let hasInvalidStyleFields = 0;\n for (const name of Object.keys(options)) {\n const value = options[name];\n void 0 === value || ignoredFieldNameSet.has(name) || (shapeFieldNameSet.has(name) ? \"dateStyle\" === name ? dateStyle = value : \"timeStyle\" === name ? timeStyle = value : granularShapeFields[name] = value : \"era\" === name ? modifierFields[name] = value : invalidShapeFieldNameSet.has(name) ? \"dateStyle\" === name || \"timeStyle\" === name ? hasInvalidStyleFields = 1 : hasInvalidGranularShapeFields = 1 : otherFields[name] = value);\n }\n const hasDateStyle = void 0 !== dateStyle;\n const hasTimeStyle = void 0 !== timeStyle;\n const hasAnyStyle = hasDateStyle || hasTimeStyle;\n const hasGranularShapeFields = Object.keys(granularShapeFields).length > 0;\n const hasInvalids = hasInvalidGranularShapeFields || hasInvalidStyleFields;\n const hasShapeFields = hasGranularShapeFields || hasDateStyle || hasTimeStyle;\n const hasModifierFields = Object.keys(modifierFields).length > 0;\n (!allowPartialOverlap && hasInvalids || allowPartialOverlap && hasInvalids && !hasShapeFields || hasAnyStyle && (hasGranularShapeFields || hasModifierFields || hasInvalidGranularShapeFields)) && throwTypeError(\"Invalid formatting options\");\n const transformedOptions = {};\n return hasAnyStyle || hasShapeFields || Object.assign(transformedOptions, defaultShapeFields), \n Object.assign(transformedOptions, granularShapeFields, modifierFields, otherFields), \n hasDateStyle && (dateStyleReplacementFields ? Object.assign(transformedOptions, dateStyleReplacementFields[dateStyle]) : transformedOptions.dateStyle = dateStyle), \n hasTimeStyle && (transformedOptions.timeStyle = timeStyle), transformedOptions;\n };\n}\n\nconst dateDefaultShapeFields = {\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\"\n};\n\nconst timeDefaultShapeFields = {\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\"\n};\n\nconst dateTimeDefaultShapeFields = /*@__PURE__*/ Object.assign({}, dateDefaultShapeFields, timeDefaultShapeFields);\n\nconst dateShapeFieldNames = [ \"weekday\", \"year\", \"month\", \"day\", \"dateStyle\" ];\n\nconst timeShapeFieldNames = [ \"dayPeriod\", \"hour\", \"minute\", \"second\", \"fractionalSecondDigits\", \"timeStyle\" ];\n\nconst dateTimeShapeFieldNames = /*@__PURE__*/ dateShapeFieldNames.concat(timeShapeFieldNames);\n\nconst yearMonthIgnoredFieldNames = /*@__PURE__*/ [ \"weekday\", \"day\" ].concat(timeShapeFieldNames);\n\nconst monthDayIgnoredFieldNames = /*@__PURE__*/ [ \"weekday\", \"year\" ].concat(timeShapeFieldNames);\n\nconst transformInstantOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], dateTimeDefaultShapeFields);\n\nconst transformZonedOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], {\n ...dateTimeDefaultShapeFields,\n timeZoneName: \"short\"\n});\n\nconst transformDateTimeOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [ \"timeZoneName\" ], dateTimeDefaultShapeFields);\n\nconst transformDateOptions = /*@__PURE__*/ createOptionsTransformer(dateShapeFieldNames, timeShapeFieldNames, [ \"timeZoneName\" ], dateDefaultShapeFields);\n\nconst transformTimeOptions = /*@__PURE__*/ createOptionsTransformer(timeShapeFieldNames, dateShapeFieldNames, [ \"timeZoneName\", \"era\" ], timeDefaultShapeFields);\n\nconst transformYearMonthOptions = /*@__PURE__*/ createOptionsTransformer([ \"year\", \"month\", \"dateStyle\" ], yearMonthIgnoredFieldNames, [ \"timeZoneName\" ], {\n year: \"numeric\",\n month: \"numeric\"\n}, {\n full: {\n year: \"numeric\",\n month: \"long\"\n },\n long: {\n year: \"numeric\",\n month: \"long\"\n },\n medium: {\n year: \"numeric\",\n month: \"short\"\n },\n short: {\n year: \"2-digit\",\n month: \"numeric\"\n }\n});\n\nconst transformMonthDayOptions = /*@__PURE__*/ createOptionsTransformer([ \"month\", \"day\", \"dateStyle\" ], monthDayIgnoredFieldNames, [ \"timeZoneName\", \"era\" ], {\n month: \"numeric\",\n day: \"numeric\"\n}, {\n full: {\n month: \"long\",\n day: \"numeric\"\n },\n long: {\n month: \"long\",\n day: \"numeric\"\n },\n medium: {\n month: \"short\",\n day: \"numeric\"\n },\n short: {\n month: \"numeric\",\n day: \"numeric\"\n }\n});\n\nfunction zonedDateTimeWithPlainTime(zonedDateTimeSlots, plainTimeFields) {\n const {timeZone: timeZone} = zonedDateTimeSlots;\n const isoDateTime = zonedEpochSlotsToIso(zonedDateTimeSlots);\n const {offsetNanoseconds: offsetNanoseconds} = isoDateTime;\n const time = plainTimeFields || timeFieldDefaults;\n let epochNano;\n return epochNano = plainTimeFields ? getMatchingInstantFor(timeZone, combineDateAndTime(isoDateTime, time), offsetNanoseconds, 2) : getStartOfDayInstantFor(timeZone, combineDateAndTime(isoDateTime, time)), \n createZonedEpochNanoSlots(epochNano, timeZone, zonedDateTimeSlots.calendar);\n}\n\nfunction getCurrentIsoDateTime(timeZone) {\n const epochNano = getCurrentEpochNano();\n const offsetNano = timeZone.B(epochNano);\n return epochNanoToIsoDateTime(epochNano + BigInt(offsetNano));\n}\n\nfunction getCurrentEpochNano() {\n return BigInt(Date.now()) * bigNanoInMilli;\n}\n\nfunction getCurrentTimeZoneId() {\n return (new RawDateTimeFormat).resolvedOptions().timeZone;\n}\n\nfunction createDateTimeFormatShell(createArgsProvider, transformOptions = identity) {\n const internalsMap = new WeakMap;\n function getInternals(format) {\n const internals = internalsMap.get(format);\n return internals || throwTypeError(\"Invalid calling context\"), internals;\n }\n class ShimDateTimeFormat {\n constructor(locales, options = Object.create(null)) {\n const transformedOptions = transformOptions(options);\n const observedOptionNames = [];\n const trackedOptions = new Proxy(Object.create(null), {\n get(_target, name) {\n const value = transformedOptions[name];\n return void 0 !== value && observedOptionNames.push(name), value;\n }\n });\n const baseFormat = new RawDateTimeFormat(locales, trackedOptions);\n const resolvedOptions = baseFormat.resolvedOptions();\n const copiedOptions = pluckProps(observedOptionNames, resolvedOptions);\n internalsMap.set(this, {\n $: createArgsProvider({\n t: baseFormat,\n Ce: resolvedOptions.locale,\n G: copiedOptions,\n Ee: transformedOptions\n }),\n t: baseFormat\n });\n }\n get format() {\n const internals = getInternals(this);\n return internals.we || (internals.we = record => {\n const [format, ...rest] = internals.$.A(record);\n return format.format(...rest);\n });\n }\n formatToParts(record) {\n const {$: argsProvider} = getInternals(this);\n const [format, ...rest] = argsProvider.A(record);\n return format.formatToParts(...rest);\n }\n resolvedOptions() {\n return getInternals(this).t.resolvedOptions();\n }\n }\n const {prototype: prototype} = ShimDateTimeFormat;\n function DateTimeFormat(locales, options) {\n return new ShimDateTimeFormat(locales, options);\n }\n RawDateTimeFormat.prototype.formatRange && Object.defineProperties(prototype, createPropDescriptors({\n formatRange(record0, record1) {\n const {$: argsProvider} = getInternals(this);\n const [format, epochMilli0, epochMilli1] = argsProvider.v(record0, record1);\n return format.formatRange(epochMilli0, epochMilli1);\n },\n formatRangeToParts(record0, record1) {\n const {$: argsProvider} = getInternals(this);\n const [format, epochMilli0, epochMilli1] = argsProvider.v(record0, record1);\n return format.formatRangeToParts(epochMilli0, epochMilli1);\n }\n }));\n const rawStaticDescriptors = Object.getOwnPropertyDescriptors(RawDateTimeFormat);\n return rawStaticDescriptors.prototype.value = prototype, Object.defineProperties(DateTimeFormat, rawStaticDescriptors), \n prototype.constructor = DateTimeFormat, Object.defineProperties(prototype, createStringTagDescriptors(\"Intl.DateTimeFormat\")), \n DateTimeFormat;\n}\n\nfunction countEpochNanoUnit(start, end, unit, [roundingInc, roundingMode]) {\n let diffNano = end - start;\n return void 0 !== roundingMode && (diffNano = roundBigNanoToInc(diffNano, computeBigNanoInc(unit, roundingInc), roundingMode)), \n divideBigNanoToExactNumber(diffNano, unitNanoMap[unit]);\n}\n\nfunction countDateTimeUnit(start, end, unit, rounding) {\n return countEpochNanoUnit(isoDateTimeToEpochNano(start), isoDateTimeToEpochNano(end), unit, rounding);\n}\n\nfunction countTimeUnit(start, end, unit, [roundingInc, roundingMode]) {\n let diffNano = timeFieldsToNano(end) - timeFieldsToNano(start);\n return void 0 !== roundingMode && (diffNano = roundNumberToInc(diffNano, computeNanoInc(unit, roundingInc), roundingMode)), \n divideBigNanoToExactNumber(BigInt(diffNano), unitNanoMap[unit]);\n}\n\nfunction countEpochNanoDays(startEpochNano, endEpochNano, originTimeNano, [roundingInc, roundingMode]) {\n let diffNano = endEpochNano - startEpochNano;\n if (void 0 !== roundingMode) {\n diffNano = roundBigNanoToInc(diffNano, computeBigNanoInc(6, roundingInc), roundingMode);\n } else if (diffNano) {\n const originTimeBigNano = BigInt(originTimeNano);\n checkIsoDateTimeEpochNanoInBounds(startEpochNano - originTimeBigNano), checkIsoDateTimeEpochNanoInBounds(endEpochNano - originTimeBigNano);\n }\n return divideBigNanoToExactNumber(diffNano, unitNanoMap[6]);\n}\n\nfunction countYearMonthUnit(calendar, isoDate0, isoDate1, unit, rounding) {\n const start = moveToStartOfMonth(calendar, isoDate0);\n const end = moveToStartOfMonth(calendar, isoDate1);\n return compareIsoDates(start, end) ? (checkIsoDateInBounds(start), checkIsoDateInBounds(end), \n countRelativeUnit(unit, {\n he: () => diffCalendarDates(calendar, start, end, unit),\n me: createDateRelativeOps(calendar, start),\n ie: isoDateToEpochNano(end)\n }, rounding, 0, 8 === unit)) : 0;\n}\n\nfunction countRelativeUnit(unit, relativeUnitDiff, [roundingInc, roundingMode], isZoned, isPrecisionUnit) {\n const {he: diffExact, me: relativeOps} = relativeUnitDiff;\n const durationFields = diffExact();\n let {ie: endEpochNano} = relativeUnitDiff;\n return computeDurationSign(durationFields) ? void 0 !== roundingMode ? isPrecisionUnit && 1 === roundingInc ? durationFields[durationFieldNamesAsc[unit]] : resolveDurationUnit(unit, durationFields, endEpochNano, relativeOps, roundingInc, roundingMode) : (isZoned ? endEpochNano = checkEpochNanoInBounds(moveRelativeMarkerToEpochNano(relativeOps, {\n ...durationFields,\n ...durationTimeFieldDefaults\n }) + durationTimeToBigNano(durationFields)) : (checkIsoDateTimeEpochNanoInBounds(relativeOps.ne), \n checkIsoDateTimeEpochNanoInBounds(endEpochNano)), resolveDurationUnit(unit, durationFields, endEpochNano, relativeOps, 1, void 0)) : 0;\n}\n\nfunction countDateWeeks(originIsoDate, endEpochNano, [roundingInc, roundingMode]) {\n const originEpochNano = isoDateToEpochNano(originIsoDate);\n const diffNano = endEpochNano - originEpochNano;\n if (!diffNano) {\n return 0;\n }\n void 0 === roundingMode && (checkIsoDateTimeEpochNanoInBounds(originEpochNano), \n checkIsoDateTimeEpochNanoInBounds(endEpochNano));\n const wholeWeeks = Number(diffNano / (7n * bigNanoInUtcDay));\n const sign = diffNano < 0n ? -1 : 1;\n const moveWeeksToEpochNano = weeks => {\n return weeks ? (((epochNano = originEpochNano + BigInt(weeks) * bigNanoInUtcDay * 7n) < plainDateEpochNanoMin || epochNano > epochNanoMax) && throwRangeError(outOfBoundsDate), \n epochNano) : originEpochNano;\n var epochNano;\n };\n return void 0 === roundingMode ? totalRelativeUnit(wholeWeeks, sign, endEpochNano, moveWeeksToEpochNano) : roundRelativeUnit(wholeWeeks, sign, endEpochNano, moveWeeksToEpochNano, roundingInc, roundingMode);\n}\n\nfunction countZonedDayWeekUnit(unit, timeZone, startZoned, endZoned, [roundingInc, roundingMode]) {\n const daysInUnit = 7 === unit ? 7 : 1;\n const startEpochNano = startZoned.epochNanoseconds;\n const sign = endZoned.epochNanoseconds > startEpochNano ? 1 : -1;\n const originIsoDateTime = zonedEpochSlotsToIso(startZoned);\n let deltaDays = 0;\n let remainderNano;\n if (compareIsoDates(originIsoDateTime, zonedEpochSlotsToIso(endZoned))) {\n const [startIsoDateTime, endIsoDate, timeNano] = prepareZonedEpochDiff(timeZone, startZoned, endZoned, sign);\n deltaDays = isoDateToEpochDays(endIsoDate) - isoDateToEpochDays(startIsoDateTime), \n remainderNano = timeNano;\n } else {\n remainderNano = Number(endZoned.epochNanoseconds - startEpochNano);\n }\n const moveByDays = days => days ? getSingleInstantFor(timeZone, combineDateAndTime(checkIsoDateInBounds(moveDateByDays(originIsoDateTime, days)), originIsoDateTime)) : startEpochNano;\n const endEpochNano = void 0 === roundingMode ? checkEpochNanoInBounds(moveByDays(deltaDays) + BigInt(remainderNano)) : endZoned.epochNanoseconds;\n const wholeValue = Math.trunc(deltaDays / daysInUnit);\n const moveValueToEpochNano = value => moveByDays(value * daysInUnit);\n return void 0 === roundingMode ? totalRelativeUnit(wholeValue, sign, endEpochNano, moveValueToEpochNano) : roundRelativeUnit(wholeValue, sign, endEpochNano, moveValueToEpochNano, roundingInc, roundingMode);\n}\n\nfunction resolveDurationUnit(unit, durationFields, endEpochNano, relativeOps, unitWindowInc, roundingMode) {\n const sign = computeDurationSign(durationFields);\n const fieldName = durationFieldNamesAsc[unit];\n const moveValueToEpochNano = value => moveRelativeMarkerToEpochNano(relativeOps, {\n ...durationFieldDefaults,\n [fieldName]: value\n });\n return void 0 === roundingMode ? totalRelativeUnit(durationFields[fieldName], sign, endEpochNano, moveValueToEpochNano) : roundRelativeUnit(durationFields[fieldName], sign, endEpochNano, moveValueToEpochNano, unitWindowInc, roundingMode);\n}\n\nfunction moveToRefinedDayOfYear(calendar, isoDate, dayOfYear, overflow) {\n return moveDateByDays(isoDate, clampEntity(\"dayOfMonth\", dayOfYear, 1, computeCalendarDaysInYear(calendar, isoDate), overflow) - computeCalendarDayOfYear(calendar, isoDate));\n}\n\nfunction moveToRefinedDayOfMonth(calendar, isoDate, day, overflow) {\n return moveDateByDays(isoDate, clampEntity(\"day\", day, 1, computeCalendarDaysInMonth(calendar, isoDate), overflow) - computeCalendarDateFields(calendar, isoDate).day);\n}\n\nfunction moveToRefinedDayOfWeek(isoDate, dayOfWeek, overflow) {\n return moveDateByDays(isoDate, clampEntity(\"dayOfWeek\", dayOfWeek, 1, 7, overflow) - computeIsoDayOfWeek(isoDate));\n}\n\nfunction moveToRefinedWeekOfYear(calendar, isoDate, weekOfYear, overflow) {\n calendar !== isoCalendarImpl && throwRangeError(unsupportedWeekNumbers);\n const {weekOfYear: currentWeekOfYear, De: weeksInYear} = computeIsoWeekFields(isoDate);\n return moveDateByDays(isoDate, 7 * (clampEntity(\"weekOfYear\", weekOfYear, 1, weeksInYear, overflow) - currentWeekOfYear));\n}\n\nfunction computeDayFloor(slots) {\n return combineDateAndTime(slots, timeFieldDefaults);\n}\n\nfunction computeYearFloor(calendar, slots) {\n const {year: year0} = computeCalendarDateFields(calendar, slots);\n return computeCalendarDateTimeFromParts(calendar, year0);\n}\n\nfunction computeMonthFloor(calendar, slots) {\n const {year: year0, month: month0} = computeCalendarDateFields(calendar, slots);\n return computeCalendarDateTimeFromParts(calendar, year0, month0);\n}\n\nfunction computeIsoWeekFloor(_calendar, slots) {\n return combineDateAndTime(moveDateByDays(slots, 1 - computeIsoDayOfWeek(slots)), timeFieldDefaults);\n}\n\nfunction computeYearCeil(calendar, slots) {\n return computeYearInterval(calendar, slots)[1];\n}\n\nfunction computeMonthCeil(calendar, slots) {\n return computeMonthInterval(calendar, slots)[1];\n}\n\nfunction computeIsoWeekCeil(calendar, slots) {\n return combineDateAndTime(moveDateByDays(computeIsoWeekFloor(0, slots), 7), timeFieldDefaults);\n}\n\nfunction computeDayCeil(_calendar, slots) {\n return combineDateAndTime(moveDateByDays(slots, 1), timeFieldDefaults);\n}\n\nfunction computeYearInterval(calendar, slots) {\n return [ computeYearFloor(calendar, slots), computeCalendarDateTimeFromParts(calendar, computeCalendarDateFields(calendar, slots).year + 1) ];\n}\n\nfunction computeMonthInterval(calendar, slots) {\n const isoDateTime0 = computeMonthFloor(calendar, slots);\n const {year: year, month: month} = computeCalendarDateFields(calendar, slots);\n const {year: year1, month: month1} = addCalendarMonths(calendar, year, month, 1);\n return [ isoDateTime0, computeCalendarDateTimeFromParts(calendar, year1, month1) ];\n}\n\nfunction computeIsoWeekInterval(calendar, slots) {\n const isoDateTime0 = computeIsoWeekFloor(0, slots);\n return [ isoDateTime0, combineDateAndTime(moveDateByDays(isoDateTime0, 7), timeFieldDefaults) ];\n}\n\nfunction roundDateToInterval(computeInterval, calendar, slots, roundingMode) {\n return roundEpochNanoToInterval(computeInterval, calendar, slots, isoDateToEpochNano(slots), roundingMode);\n}\n\nfunction computeCalendarDateTimeFromParts(calendar, year, month = 1) {\n return combineDateAndTime(computeCalendarIsoFieldsFromParts(calendar, year, month, 1), timeFieldDefaults);\n}\n\nfunction roundDateTimeToInterval(computeInterval, calendar, slots, roundingMode) {\n return roundEpochNanoToInterval(computeInterval, calendar, slots, isoDateTimeToEpochNano(slots), roundingMode);\n}\n\nfunction roundEpochNanoToInterval(computeInterval, calendar, slots, epochNano, roundingMode) {\n const [isoDateTime0, isoDateTime1] = computeInterval(calendar, slots);\n return roundWithMode(computeEpochNanoFrac(epochNano, isoDateTimeToEpochNano(isoDateTime0), isoDateTimeToEpochNano(isoDateTime1)), roundingMode) ? isoDateTime1 : isoDateTime0;\n}\n\nexport { RawDateTimeFormat, absDuration, addDurationsWithoutRelativeTo, addIsoMonths, alignZonedEpoch, applyPlainFormatTimeZone, applyZonedFormatTimeZone, bigNanoInHour, bigNanoInMicro, bigNanoInMilli, bigNanoInMinute, bigNanoInSec, bindArgs, checkEpochNanoInBounds, checkIsoDateInBounds, checkIsoDateTimeInBounds, checkIsoYearMonthInBounds, checkResolvedCalendarCompatible, clampEntity, combineDateAndTime, compareDurations, compareIsoDateFields, compareIsoDateTimeFields, compareNumbers, compareTimeFields, compareZonedEpochSlots, computeBigNanoInc, computeCalendarDateFields, computeCalendarDayOfYear, computeCalendarDaysInMonth, computeCalendarDaysInYear, computeCalendarEraFields, computeCalendarInLeapYear, computeCalendarMonthCode, computeCalendarMonthsInYear, computeCalendarWeekOfYear, computeCalendarYearOfWeek, computeDayCeil, computeDayFloor, computeGregoryEraFields, computeIsoDayOfWeek, computeIsoDaysInMonth, computeIsoDaysInYear, computeIsoFieldsFromParts, computeIsoInLeapYear, computeIsoMonthCodeParts, computeIsoWeekCeil, computeIsoWeekFloor, computeIsoWeekInterval, computeIsoYearMonthFieldsForMonthDay, computeMonthCeil, computeMonthFloor, computeMonthInterval, computeNanoInc, computeYearCeil, computeYearFloor, computeYearInterval, computeZonedHoursInDay, computeZonedStartOfDay, constrainToRange, countDateTimeUnit, countDateWeeks, countEpochNanoDays, countEpochNanoUnit, countRelativeUnit, countTimeUnit, countYearMonthUnit, countZonedDayWeekUnit, createDateFromRefinedFields, createDateRelativeOps, createDateSlots, createDateTimeFormatShell, createDateTimeFromMergedFields, createDateTimeFromRefinedFields, createDateTimeSlots, createDurationSlots, createEpochNanoSlots, createMonthDayFromCalendarParts, createMonthDayFromRefinedFields, createNameDescriptors, createPropDescriptors, createPropGetters, createStringTagDescriptors, createTimeSlots, createYearMonthFromCalendarParts, createYearMonthFromRefinedFields, createZonedDateTimeFromMergedFields, createZonedEpochNanoSlots, createZonedRelativeOps, dateTimeToZonedDateTime, dateToZonedDateTime, diffCalendarDates, diffDateTimesExact, diffDateTimesRounded, diffDatesRounded, diffEpochMilliDays, diffEpochNanosRounded, diffIsoMonthSlots, diffTimesRounded, diffYearMonthsRounded, diffZonedDateTimesRounded, diffZonedEpochsExact, durationFieldNamesAsc, durationGetters, epochDaysToIsoDate, epochMilliToInstant, epochMilliToIsoDateTime, epochNanoToInstant, epochNanoToIsoDateTime, epochNanoToMilli, eraYearToYear, exoticCalendarRequired, fieldsToMonthDay, fieldsToYearMonth, flippedSmallestLargestUnit, forbiddenValueOf, formatDateIsoAuto, formatDateTimeIsoAuto, formatDurationIso, formatDurationIsoAuto, formatEpochMilliToPartsRecord, formatInstantIso, formatInstantIsoAuto, formatMonthDayIsoAuto, formatOffsetNano, formatPlainDateIso, formatPlainDateTimeIso, formatPlainMonthDayIso, formatPlainTimeIso, formatPlainYearMonthIso, formatTimeIsoAuto, formatYearMonthIsoAuto, formatZonedDateTimeIso, formatZonedDateTimeIsoAuto, getCalendarSlotId, getCommonCalendar, getCommonTimeZone, getCurrentEpochNano, getCurrentIsoDateTime, getCurrentTimeZoneId, getMatchingInstantFor, getSingleInstantFor, getZonedTimeZoneId, gregoryCalendarId, gregoryCalendarImpl, gregoryEraOrigins, instantToZonedDateTime, instantsEqual, invalidBag, invalidCalendar, invalidCallingContext, invalidChoice, invalidEntity, invalidFormatType, invalidRelativeTo, invalidTimeZone, isObjectLike, isoCalendarId, isoCalendarImpl, isoDateTimeToEpochMilli, isoDateTimeToEpochNano, isoDateToEpochDays, isoDateToEpochMilli, isoDateToEpochNano, isoEpochFirstLeapYear, isoEpochOriginYear, isoMonthsInYear, isoPartsToEpochDays, mapProps, maxMilli, memoize, mergeDateFields, mergeDateTimeFields, mergeDurationFields, mergeMonthDayFields, mergeTimeFields, mergeYearMonthFields, mergeZonedDateTimeFields, milliInUtcDay, mismatchingFormatTypes, missingSmallestLargestUnit, modFloor, monthCodeNumberToMonth, monthDayToDate, monthToMonthCodeNumber, moveDate, moveDateByCalendarUnits, moveDateByDays, moveDateTime, moveDateTimeByNano, moveEpochNano, moveEpochNanoByNano, moveTime, moveTimeByNano, moveToRefinedDayOfMonth, moveToRefinedDayOfWeek, moveToRefinedDayOfYear, moveToRefinedWeekOfYear, moveYearMonth, moveYearMonthByUnits, moveZonedEpochSlots, nanoInHour, nanoInMicro, nanoInMilli, nanoInMinute, nanoInSec, nanoInUtcDay, negateDuration, negateDurationFields, noop, outOfBoundsDate, parseCalendarId, parseDuration, parseInstant, parsePlainDate, parsePlainDateTime, parsePlainMonthDay, parsePlainTime, parsePlainYearMonth, parseRelativeToSlots, parseTimeZoneId, parseZonedDateTime, plainDateTimesEqual, plainDatesEqual, plainMonthDaysEqual, plainTimesEqual, plainYearMonthsEqual, queryTimeZone, refineCalendarDateFields, refineDurationObjectLike, refineMaybeZonedDateTimeObjectLike, refineMonthDayFields, refinePlainDateObjectLike, refinePlainDateTimeObjectLike, refinePlainMonthDayObjectLike, refinePlainTimeObjectLike, refinePlainYearMonthObjectLike, refineTimeZoneId, refineZonedDateTimeObjectLike, requireNumberIsInteger, requirePropDefined, requireString, resolveTimeFields, resolveTimeZoneId, roundBigNanoToDayOriginInc, roundDateTimeToInc, roundDateTimeToInterval, roundDateToInterval, roundDuration, roundExpand, roundHalfCeil, roundHalfEven, roundHalfExpand, roundHalfFloor, roundHalfTrunc, roundTimeToInc, roundZonedEpochSlotsToUnit, roundZonedEpochToDay, roundZonedEpochToInterval, roundZonedEpochToTime, throwRangeError, throwTypeError, timeFieldDefaults, timeFieldsToMilli, timeFieldsToNano, timeGetters, toBigInt, toStrictInteger, toString, totalDuration, transformDateOptions, transformDateTimeOptions, transformInstantOptions, transformMonthDayOptions, transformTimeOptions, transformYearMonthOptions, transformZonedOptions, unitNameMap, unitNamesAsc, unitNanoMap, utcTimeZoneId, validateDurationCalendarUnit, validateDurationFields, validateIsoDateFields, validateIsoDateTimeFields, validateTimeFields, yearMonthToDate, zonedDateTimeToDate, zonedDateTimeToDateTime, zonedDateTimeToInstant, zonedDateTimeToTime, zonedDateTimeWithPlainTime, zonedDateTimesEqual, zonedEpochSlotsToIso };\n","const NativeTemporal = globalThis.Temporal;\n\nexport { NativeTemporal };\n","import { createNameDescriptors, createStringTagDescriptors, mapProps, noop, throwTypeError, invalidCallingContext, forbiddenValueOf as forbiddenValueOf$1, computeCalendarEraFields, computeCalendarDateFields, computeCalendarMonthCode, computeCalendarDaysInMonth, computeCalendarDaysInYear, computeCalendarMonthsInYear, computeCalendarInLeapYear, computeIsoDayOfWeek, computeCalendarDayOfYear, computeCalendarWeekOfYear, computeCalendarYearOfWeek, diffEpochNanosRounded, getCommonCalendar, diffZonedDateTimesRounded, diffDateTimesRounded, diffDatesRounded, diffYearMonthsRounded, diffTimesRounded, createDurationSlots, negateDurationFields, mergeDateFields, refineCalendarDateFields, createDateFromRefinedFields, mergeDateTimeFields, createDateTimeFromMergedFields, mergeYearMonthFields, createYearMonthFromRefinedFields, mergeMonthDayFields, refineMonthDayFields, createMonthDayFromRefinedFields, mergeTimeFields, resolveTimeFields, mergeZonedDateTimeFields, createZonedDateTimeFromMergedFields, createPropGetters, durationGetters as durationGetters$1, timeGetters as timeGetters$1, bindArgs, getCommonTimeZone, countRelativeUnit, diffZonedEpochsExact, createZonedRelativeOps, countZonedDayWeekUnit, createDateRelativeOps, diffDateTimesExact, countDateWeeks, countEpochNanoDays, timeFieldsToNano, isoDateTimeToEpochNano, isoDateToEpochNano, diffCalendarDates, countYearMonthUnit, countDateTimeUnit, countTimeUnit, countEpochNanoUnit, moveDateByCalendarUnits, toStrictInteger, moveToRefinedDayOfYear, moveToRefinedDayOfMonth, moveToRefinedDayOfWeek, moveToRefinedWeekOfYear } from \"./internal.js\";\n\nimport { refineDiffOptions, refineOverflowOptions, refineZonedFieldOptions, refineUnitDiffOptions } from \"./options.js\";\n\nimport { toIntegerWithTrunc } from \"temporal-utils/protected\";\n\nimport \"temporal-utils/protected-error-messages\";\n\nconst PlainYearMonthBranding = \"PlainYearMonth\";\n\nconst PlainMonthDayBranding = \"PlainMonthDay\";\n\nconst PlainDateBranding = \"PlainDate\";\n\nconst PlainDateTimeBranding = \"PlainDateTime\";\n\nconst PlainTimeBranding = \"PlainTime\";\n\nconst ZonedDateTimeBranding = \"ZonedDateTime\";\n\nconst InstantBranding = \"Instant\";\n\nconst DurationBranding = \"Duration\";\n\nconst CalendarBranding = \"Calendar\";\n\nfunction defineTemporalClass(branding, cls, getSlots, ...getterMaps) {\n return Object.defineProperties(cls, createNameDescriptors(branding)), Object.defineProperties(cls.prototype, createStringTagDescriptors(\"Temporal.\" + branding)), \n Object.defineProperties(cls.prototype, mapProps(getter => ({\n get() {\n return getter(getSlots(this));\n },\n configurable: 1\n }), Object.assign({}, ...getterMaps))), cls;\n}\n\nconst attachDebugString = \"noop\" === noop.name ? instance => {\n Object.defineProperty(instance, \"_str_\", {\n value: instance.toJSON()\n });\n} : noop;\n\nfunction invalidRecordType() {\n throwTypeError(invalidCallingContext);\n}\n\nfunction forbiddenValueOf() {\n throwTypeError(forbiddenValueOf$1);\n}\n\nconst yearMonthFieldGetters$1 = {\n era(slots) {\n return computeCalendarEraFields(slots.calendar, slots).era;\n },\n eraYear(slots) {\n return computeCalendarEraFields(slots.calendar, slots).eraYear;\n },\n year(slots) {\n return computeCalendarDateFields(slots.calendar, slots).year;\n },\n month(slots) {\n return computeCalendarDateFields(slots.calendar, slots).month;\n },\n monthCode(slots) {\n return computeCalendarMonthCode(slots.calendar, slots);\n }\n};\n\nconst dateFieldGetters$1 = {\n era(slots) {\n return computeCalendarEraFields(slots.calendar, slots).era;\n },\n eraYear(slots) {\n return computeCalendarEraFields(slots.calendar, slots).eraYear;\n },\n year(slots) {\n return computeCalendarDateFields(slots.calendar, slots).year;\n },\n month(slots) {\n return computeCalendarDateFields(slots.calendar, slots).month;\n },\n monthCode(slots) {\n return computeCalendarMonthCode(slots.calendar, slots);\n },\n day(slots) {\n return computeCalendarDateFields(slots.calendar, slots).day;\n }\n};\n\nconst monthDayFieldGetters$1 = {\n monthCode(slots) {\n return computeCalendarMonthCode(slots.calendar, slots);\n },\n day(slots) {\n return computeCalendarDateFields(slots.calendar, slots).day;\n }\n};\n\nconst yearMonthDerivedGetters = {\n daysInMonth(slots) {\n return computeCalendarDaysInMonth(slots.calendar, slots);\n },\n daysInYear(slots) {\n return computeCalendarDaysInYear(slots.calendar, slots);\n },\n monthsInYear(slots) {\n return computeCalendarMonthsInYear(slots.calendar, slots);\n },\n inLeapYear(slots) {\n return computeCalendarInLeapYear(slots.calendar, slots);\n }\n};\n\nconst dateDerivedGetters = {\n dayOfWeek(slots) {\n return computeIsoDayOfWeek(slots);\n },\n dayOfYear(slots) {\n return computeCalendarDayOfYear(slots.calendar, slots);\n },\n weekOfYear(slots) {\n return computeCalendarWeekOfYear(slots.calendar, slots);\n },\n yearOfWeek(slots) {\n return computeCalendarYearOfWeek(slots.calendar, slots);\n },\n daysInWeek() {\n return 7;\n },\n daysInMonth(slots) {\n return computeCalendarDaysInMonth(slots.calendar, slots);\n },\n daysInYear(slots) {\n return computeCalendarDaysInYear(slots.calendar, slots);\n },\n monthsInYear(slots) {\n return computeCalendarMonthsInYear(slots.calendar, slots);\n },\n inLeapYear(slots) {\n return computeCalendarInLeapYear(slots.calendar, slots);\n }\n};\n\nfunction diffInstants(invert, instantSlots0, instantSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 3, 5);\n return createDiffDurationSlots(invert, diffEpochNanosRounded(instantSlots0.epochNanoseconds, instantSlots1.epochNanoseconds, largestUnit, smallestUnit, roundingInc, roundingMode));\n}\n\nfunction diffZonedDateTimes(invert, slots0, slots1, options) {\n const calendar = getCommonCalendar(slots0.calendar, slots1.calendar);\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 5);\n return createDiffDurationSlots(invert, diffZonedDateTimesRounded(calendar, slots0, slots1, largestUnit, smallestUnit, roundingInc, roundingMode));\n}\n\nfunction diffDateTimes(invert, plainDateTimeSlots0, plainDateTimeSlots1, options) {\n const calendar = getCommonCalendar(plainDateTimeSlots0.calendar, plainDateTimeSlots1.calendar);\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 6);\n return createDiffDurationSlots(invert, diffDateTimesRounded(calendar, plainDateTimeSlots0, plainDateTimeSlots1, largestUnit, smallestUnit, roundingInc, roundingMode));\n}\n\nfunction diffDates(invert, plainDateSlots0, plainDateSlots1, options) {\n const calendar = getCommonCalendar(plainDateSlots0.calendar, plainDateSlots1.calendar);\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 6, 9, 6);\n return createDiffDurationSlots(invert, diffDatesRounded(calendar, plainDateSlots0, plainDateSlots1, largestUnit, smallestUnit, roundingInc, roundingMode));\n}\n\nfunction diffYearMonths(invert, plainYearMonthSlots0, plainYearMonthSlots1, options) {\n const calendar = getCommonCalendar(plainYearMonthSlots0.calendar, plainYearMonthSlots1.calendar);\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 9, 9, 8);\n return createDiffDurationSlots(invert, diffYearMonthsRounded(calendar, plainYearMonthSlots0, plainYearMonthSlots1, largestUnit, smallestUnit, roundingInc, roundingMode));\n}\n\nfunction diffTimes(invert, plainTimeSlots0, plainTimeSlots1, options) {\n const [largestUnit, smallestUnit, roundingInc, roundingMode] = refineDiffOptions(invert, options, 5, 5);\n return createDiffDurationSlots(invert, diffTimesRounded(plainTimeSlots0, plainTimeSlots1, largestUnit, smallestUnit, roundingInc, roundingMode));\n}\n\nfunction createDiffDurationSlots(invert, durationFields) {\n return createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);\n}\n\nfunction withDateFields(slots, modFields, options) {\n const {calendar: calendar} = slots;\n const fields = mergeDateFields(calendar, slots, modFields);\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar);\n const overflow = refineOverflowOptions(options);\n return createDateFromRefinedFields(fields, calendar, year, monthCodeParts, overflow);\n}\n\nfunction withDateTimeFields(slots, modFields, options) {\n const {calendar: calendar} = slots;\n const [mergedFields, calendarFields] = mergeDateTimeFields(calendar, slots, modFields);\n const [year, monthCodeParts] = refineCalendarDateFields(calendarFields, calendar);\n const overflow = refineOverflowOptions(options);\n return createDateTimeFromMergedFields(mergedFields, calendarFields, calendar, year, monthCodeParts, overflow);\n}\n\nfunction withYearMonthFields(slots, modFields, options) {\n const {calendar: calendar} = slots;\n const fields = mergeYearMonthFields(calendar, slots, modFields);\n const [year, monthCodeParts] = refineCalendarDateFields(fields, calendar, 1);\n const overflow = refineOverflowOptions(options);\n return createYearMonthFromRefinedFields(fields, calendar, year, monthCodeParts, overflow);\n}\n\nfunction withMonthDayFields(slots, modFields, options) {\n const {calendar: calendar} = slots;\n const fields = mergeMonthDayFields(calendar, slots, modFields);\n const [year, monthCodeParts] = refineMonthDayFields(fields, calendar);\n const overflow = refineOverflowOptions(options);\n return createMonthDayFromRefinedFields(fields, calendar, year, monthCodeParts, overflow);\n}\n\nfunction withTimeFields(slots, modFields, options) {\n const refinedFields = mergeTimeFields(slots, modFields);\n const overflow = refineOverflowOptions(options);\n return resolveTimeFields(refinedFields, overflow);\n}\n\nfunction withZonedDateTimeFields(slots, modFields, options) {\n const {calendar: calendar} = slots;\n const [mergedFields, calendarFields] = mergeZonedDateTimeFields(calendar, slots, modFields);\n const [year, monthCodeParts] = refineCalendarDateFields(calendarFields, calendar);\n const [overflow, offsetDisambig, epochDisambig] = refineZonedFieldOptions(options, 2);\n return createZonedDateTimeFromMergedFields(slots, mergedFields, calendarFields, year, monthCodeParts, overflow, offsetDisambig, epochDisambig);\n}\n\nfunction createNativeGetters(shimGetters) {\n return createPropGetters(Object.keys(shimGetters));\n}\n\nconst durationGetters = /*@__PURE__*/ createNativeGetters(durationGetters$1);\n\nconst timeGetters = /*@__PURE__*/ createNativeGetters(timeGetters$1);\n\nconst yearMonthFieldGetters = /*@__PURE__*/ createNativeGetters(yearMonthFieldGetters$1);\n\nconst dateFieldGetters = /*@__PURE__*/ createNativeGetters(dateFieldGetters$1);\n\nconst monthDayFieldGetters = /*@__PURE__*/ createNativeGetters(monthDayFieldGetters$1);\n\nconst diffZonedYears = /*@__PURE__*/ bindArgs(diffZonedCalendarUnit, 9);\n\nconst diffZonedMonths = /*@__PURE__*/ bindArgs(diffZonedCalendarUnit, 8);\n\nconst diffZonedWeeks = /*@__PURE__*/ bindArgs(diffZonedDayWeekUnit, 7);\n\nconst diffZonedDays = /*@__PURE__*/ bindArgs(diffZonedDayWeekUnit, 6);\n\nconst diffInstantEpochNanoTimeUnit = diffInstantTimeUnit;\n\nconst diffDateYears = /*@__PURE__*/ bindArgs(diffDateCalendarUnit, 9);\n\nconst diffDateMonths = /*@__PURE__*/ bindArgs(diffDateCalendarUnit, 8);\n\nconst diffDateTimeYears = /*@__PURE__*/ bindArgs(diffDateTimeCalendarUnit, 9);\n\nconst diffDateTimeMonths = /*@__PURE__*/ bindArgs(diffDateTimeCalendarUnit, 8);\n\nconst diffYearMonthYears = /*@__PURE__*/ bindArgs(diffYearMonthUnit, 9);\n\nconst diffYearMonthMonths = /*@__PURE__*/ bindArgs(diffYearMonthUnit, 8);\n\nfunction diffZonedEpochNanoTimeUnit(unit, slots0, slots1, options) {\n return getCommonCalendar(slots0.calendar, slots1.calendar), diffInstantTimeUnit(unit, slots0, slots1, options);\n}\n\nfunction diffDateTimeEpochNanoTimeUnit(unit, slots0, slots1, options) {\n return getCommonCalendar(slots0.calendar, slots1.calendar), countDateTimeUnit(slots0, slots1, unit, refineUnitDiffOptions(unit, options));\n}\n\nfunction diffTimeNanoOfDayTimeUnit(unit, slots0, slots1, options) {\n return countTimeUnit(slots0, slots1, unit, refineUnitDiffOptions(unit, options));\n}\n\nfunction adaptRecordTimeUnitDiff(diffSlots, getSlots) {\n return (unit, record0, record1, options) => diffSlots(unit, getSlots(record0), getSlots(record1), options);\n}\n\nfunction diffInstantTimeUnit(unit, slots0, slots1, options) {\n return countEpochNanoUnit(slots0.epochNanoseconds, slots1.epochNanoseconds, unit, refineUnitDiffOptions(unit, options));\n}\n\nfunction diffZonedCalendarUnit(unit, slots0, slots1, options) {\n const calendar = getCommonCalendar(slots0.calendar, slots1.calendar);\n const rounding = refineUnitDiffOptions(unit, options);\n if (slots0.epochNanoseconds === slots1.epochNanoseconds) {\n return 0;\n }\n const timeZone = getCommonTimeZone(slots0.timeZone, slots1.timeZone);\n return countRelativeUnit(unit, {\n he: () => diffZonedEpochsExact(timeZone, calendar, slots0, slots1, unit),\n me: createZonedRelativeOps(calendar, timeZone, slots0),\n ie: slots1.epochNanoseconds\n }, rounding, 1);\n}\n\nfunction diffZonedDayWeekUnit(unit, slots0, slots1, options) {\n getCommonCalendar(slots0.calendar, slots1.calendar);\n const rounding = refineUnitDiffOptions(unit, options);\n return slots0.epochNanoseconds === slots1.epochNanoseconds ? 0 : countZonedDayWeekUnit(unit, getCommonTimeZone(slots0.timeZone, slots1.timeZone), slots0, slots1, rounding);\n}\n\nfunction diffDateTimeCalendarUnit(unit, slots0, slots1, options) {\n const calendar = getCommonCalendar(slots0.calendar, slots1.calendar);\n return diffPlainRelativeUnit(unit, options, () => diffDateTimesExact(calendar, slots0, slots1, unit), createDateRelativeOps(calendar, slots0), computeEndEpochNanoFromMidnight(slots0, slots1));\n}\n\nfunction diffDateTimeWeeks(slots0, slots1, options) {\n return getCommonCalendar(slots0.calendar, slots1.calendar), countDateWeeks(slots0, computeEndEpochNanoFromMidnight(slots0, slots1), refineUnitDiffOptions(7, options));\n}\n\nfunction diffDateTimeDays(slots0, slots1, options) {\n return getCommonCalendar(slots0.calendar, slots1.calendar), countEpochNanoDays(isoDateTimeToEpochNano(slots0), isoDateTimeToEpochNano(slots1), timeFieldsToNano(slots0), refineUnitDiffOptions(6, options));\n}\n\nfunction computeEndEpochNanoFromMidnight(isoDateTime0, isoDateTime1) {\n return isoDateTimeToEpochNano(isoDateTime1) - BigInt(timeFieldsToNano(isoDateTime0));\n}\n\nfunction diffDateCalendarUnit(unit, slots0, slots1, options) {\n const calendar = getCommonCalendar(slots0.calendar, slots1.calendar);\n return diffPlainRelativeUnit(unit, options, () => diffCalendarDates(calendar, slots0, slots1, unit), createDateRelativeOps(calendar, slots0), isoDateToEpochNano(slots1));\n}\n\nfunction diffDateWeeks(slots0, slots1, options) {\n return getCommonCalendar(slots0.calendar, slots1.calendar), countDateWeeks(slots0, isoDateToEpochNano(slots1), refineUnitDiffOptions(7, options));\n}\n\nfunction diffDateDays(slots0, slots1, options) {\n return getCommonCalendar(slots0.calendar, slots1.calendar), countEpochNanoDays(isoDateToEpochNano(slots0), isoDateToEpochNano(slots1), 0, refineUnitDiffOptions(6, options));\n}\n\nfunction diffYearMonthUnit(unit, slots0, slots1, options) {\n const calendar = getCommonCalendar(slots0.calendar, slots1.calendar);\n return countYearMonthUnit(calendar, slots0, slots1, unit, refineUnitDiffOptions(unit, options));\n}\n\nfunction diffPlainRelativeUnit(unit, options, diffExact, relativeOps, endEpochNano) {\n return countRelativeUnit(unit, {\n he: diffExact,\n me: relativeOps,\n ie: endEpochNano\n }, refineUnitDiffOptions(unit, options));\n}\n\nfunction reversedMove(f) {\n return (slots, units, options) => f(slots, -units, options);\n}\n\nfunction moveDateByYears(calendar, isoDate, years, options) {\n const overflow = refineOverflowOptions(options);\n return years ? moveDateByCalendarUnits(calendar, isoDate, toStrictInteger(years), 0, overflow) : isoDate;\n}\n\nfunction moveDateByMonths(calendar, isoDate, months, options) {\n const overflow = refineOverflowOptions(options);\n return months ? moveDateByCalendarUnits(calendar, isoDate, 0, toStrictInteger(months), overflow) : isoDate;\n}\n\nfunction moveToDayOfYear(calendar, isoDate, dayOfYear, options) {\n const overflow = refineOverflowOptions(options);\n return moveToRefinedDayOfYear(calendar, isoDate, toIntegerWithTrunc(dayOfYear), overflow);\n}\n\nfunction moveToDayOfMonth(calendar, isoDate, day, options) {\n const overflow = refineOverflowOptions(options);\n return moveToRefinedDayOfMonth(calendar, isoDate, toIntegerWithTrunc(day), overflow);\n}\n\nfunction moveToDayOfWeek(_calendar, isoDate, dayOfWeek, options) {\n const overflow = refineOverflowOptions(options);\n return moveToRefinedDayOfWeek(isoDate, toIntegerWithTrunc(dayOfWeek), overflow);\n}\n\nfunction moveToWeekOfYear(calendar, isoDate, weekOfYear, options) {\n const overflow = refineOverflowOptions(options);\n return moveToRefinedWeekOfYear(calendar, isoDate, toIntegerWithTrunc(weekOfYear), overflow);\n}\n\nexport { CalendarBranding, DurationBranding, InstantBranding, PlainDateBranding, PlainDateTimeBranding, PlainMonthDayBranding, PlainTimeBranding, PlainYearMonthBranding, ZonedDateTimeBranding, adaptRecordTimeUnitDiff, attachDebugString, dateDerivedGetters, dateFieldGetters$1 as dateFieldGetters, dateFieldGetters as dateFieldGetters$1, defineTemporalClass, diffDateDays, diffDateMonths, diffDateTimeDays, diffDateTimeEpochNanoTimeUnit, diffDateTimeMonths, diffDateTimeWeeks, diffDateTimeYears, diffDateTimes, diffDateWeeks, diffDateYears, diffDates, diffInstantEpochNanoTimeUnit, diffInstants, diffTimeNanoOfDayTimeUnit, diffTimes, diffYearMonthMonths, diffYearMonthYears, diffYearMonths, diffZonedDateTimes, diffZonedDays, diffZonedEpochNanoTimeUnit, diffZonedMonths, diffZonedWeeks, diffZonedYears, durationGetters, forbiddenValueOf, invalidRecordType, monthDayFieldGetters$1 as monthDayFieldGetters, monthDayFieldGetters as monthDayFieldGetters$1, moveDateByMonths, moveDateByYears, moveToDayOfMonth, moveToDayOfWeek, moveToDayOfYear, moveToWeekOfYear, reversedMove, timeGetters, withDateFields, withDateTimeFields, withMonthDayFields, withTimeFields, withYearMonthFields, withZonedDateTimeFields, yearMonthDerivedGetters, yearMonthFieldGetters$1 as yearMonthFieldGetters, yearMonthFieldGetters as yearMonthFieldGetters$1 };\n","import { createPropDescriptors, createDateTimeFormatShell, memoize, throwTypeError, invalidFormatType, applyPlainFormatTimeZone, transformMonthDayOptions, transformYearMonthOptions, transformTimeOptions, transformDateOptions, transformDateTimeOptions, transformInstantOptions, RawDateTimeFormat, mismatchingFormatTypes, checkResolvedCalendarCompatible, timeFieldsToMilli, isoDateToEpochMilli, isoDateTimeToEpochMilli, epochNanoToMilli } from \"./internal.js\";\n\nimport { PlainMonthDayBranding, PlainYearMonthBranding, PlainTimeBranding, PlainDateBranding, PlainDateTimeBranding, InstantBranding } from \"./apiHelpers.js\";\n\nfunction createIntlExtended(DateTimeFormat) {\n return Object.defineProperties(Object.create(Intl), createPropDescriptors({\n DateTimeFormat: DateTimeFormat\n }));\n}\n\nfunction createDateTimeFormatClass(getTemporalBrandingAndSlots) {\n return createDateTimeFormatShell(internals => {\n const getTemporalFormat = memoize(branding => {\n let options;\n switch (branding) {\n case InstantBranding:\n options = transformInstantOptions(internals.G, 1);\n break;\n\n case PlainDateTimeBranding:\n options = applyPlainFormatTimeZone(transformDateTimeOptions(internals.G, 1));\n break;\n\n case PlainDateBranding:\n options = applyPlainFormatTimeZone(transformDateOptions(internals.G, 1));\n break;\n\n case PlainTimeBranding:\n options = applyPlainFormatTimeZone(transformTimeOptions(internals.G, 1));\n break;\n\n case PlainYearMonthBranding:\n options = applyPlainFormatTimeZone(transformYearMonthOptions(internals.G, 1));\n break;\n\n case PlainMonthDayBranding:\n options = applyPlainFormatTimeZone(transformMonthDayOptions(internals.G, 1));\n break;\n\n default:\n throwTypeError(invalidFormatType(branding));\n }\n return new RawDateTimeFormat(internals.Ce, options);\n });\n return {\n A(formattable) {\n if (void 0 === formattable) {\n return [ internals.t ];\n }\n const brandingAndSlots = getTemporalBrandingAndSlots(formattable);\n if (!brandingAndSlots) {\n return [ internals.t, Number(formattable) ];\n }\n const [branding, slots] = brandingAndSlots;\n const format = getTemporalFormat(branding);\n return checkTemporalDateTimeFormatCompatible(format, branding, slots), [ format, temporalDateTimeToEpochMilli(branding, slots) ];\n },\n v(start, end) {\n void 0 !== start && void 0 !== end || throwTypeError(mismatchingFormatTypes);\n const startBrandingAndSlots = getTemporalBrandingAndSlots(start);\n const startEpochMilli = startBrandingAndSlots ? void 0 : Number(start);\n const endBrandingAndSlots = getTemporalBrandingAndSlots(end);\n const endEpochMilli = endBrandingAndSlots ? void 0 : Number(end);\n if (!startBrandingAndSlots && !endBrandingAndSlots) {\n return [ internals.t, startEpochMilli, endEpochMilli ];\n }\n startBrandingAndSlots && endBrandingAndSlots || throwTypeError(mismatchingFormatTypes);\n const [startBranding, startSlots] = startBrandingAndSlots;\n const [endBranding, endSlots] = endBrandingAndSlots;\n startBranding !== endBranding && throwTypeError(mismatchingFormatTypes);\n const format = getTemporalFormat(startBranding);\n return checkTemporalDateTimeFormatCompatible(format, startBranding, startSlots), \n checkTemporalDateTimeFormatCompatible(format, startBranding, endSlots), [ format, temporalDateTimeToEpochMilli(startBranding, startSlots), temporalDateTimeToEpochMilli(startBranding, endSlots) ];\n }\n };\n });\n}\n\nfunction checkTemporalDateTimeFormatCompatible(format, branding, slots) {\n switch (branding) {\n case InstantBranding:\n case PlainTimeBranding:\n return;\n\n case PlainDateTimeBranding:\n case PlainDateBranding:\n return void checkResolvedCalendarCompatible(format, slots);\n\n case PlainYearMonthBranding:\n case PlainMonthDayBranding:\n return void checkResolvedCalendarCompatible(format, slots, 1);\n\n default:\n throwTypeError(invalidFormatType(branding));\n }\n}\n\nfunction temporalDateTimeToEpochMilli(branding, slots) {\n switch (branding) {\n case InstantBranding:\n return epochNanoToMilli(slots.epochNanoseconds);\n\n case PlainDateTimeBranding:\n return isoDateTimeToEpochMilli(slots);\n\n case PlainDateBranding:\n case PlainYearMonthBranding:\n case PlainMonthDayBranding:\n return isoDateToEpochMilli(slots);\n\n case PlainTimeBranding:\n return timeFieldsToMilli(slots);\n\n default:\n throwTypeError(invalidFormatType(branding));\n }\n}\n\nexport { createDateTimeFormatClass, createIntlExtended };\n","import { requireString, isoCalendarId, isoCalendarImpl, gregoryCalendarId, gregoryCalendarImpl, throwRangeError, exoticCalendarRequired, timeGetters, checkEpochNanoInBounds, toBigInt, queryTimeZone, refineTimeZoneId, compareZonedEpochSlots, getCalendarSlotId, epochNanoToMilli, formatOffsetNano, zonedEpochSlotsToIso, computeZonedHoursInDay, zonedDateTimeWithPlainTime, moveZonedEpochSlots, negateDurationFields, roundZonedEpochSlotsToUnit, computeZonedStartOfDay, zonedDateTimesEqual, zonedDateTimeToInstant, zonedDateTimeToDateTime, zonedDateTimeToDate, zonedDateTimeToTime, RawDateTimeFormat, applyZonedFormatTimeZone, getZonedTimeZoneId, transformZonedOptions, checkResolvedCalendarCompatible, formatZonedDateTimeIso, isObjectLike, refineZonedDateTimeObjectLike, parseZonedDateTime, createZonedEpochNanoSlots, throwTypeError, invalidTimeZone, resolveTimeZoneId, parseTimeZoneId, epochMilliToInstant, epochNanoToInstant, createEpochNanoSlots, moveEpochNano, roundBigNanoToDayOriginInc, computeBigNanoInc, instantsEqual, instantToZonedDateTime, transformInstantOptions, formatInstantIso, parseInstant, requireNumberIsInteger, bigNanoInMilli, isoEpochFirstLeapYear, checkIsoDateInBounds, validateIsoDateFields, createDateSlots, plainMonthDaysEqual, monthDayToDate, applyPlainFormatTimeZone, transformMonthDayOptions, isoDateToEpochMilli, formatPlainMonthDayIso, refinePlainMonthDayObjectLike, parsePlainMonthDay, checkIsoYearMonthInBounds, compareIsoDateFields, moveYearMonth, plainYearMonthsEqual, yearMonthToDate, transformYearMonthOptions, formatPlainYearMonthIso, refinePlainYearMonthObjectLike, parsePlainYearMonth, invalidBag, validateTimeFields, mapProps, createTimeSlots, compareTimeFields, moveTime, roundTimeToInc, plainTimesEqual, transformTimeOptions, timeFieldsToMilli, formatPlainTimeIso, refinePlainTimeObjectLike, parsePlainTime, computeNanoInc, checkIsoDateTimeInBounds, validateIsoDateTimeFields, createDateTimeSlots, compareIsoDateTimeFields, createDateTimeFromRefinedFields, moveDateTime, roundDateTimeToInc, plainDateTimesEqual, dateTimeToZonedDateTime, transformDateTimeOptions, isoDateTimeToEpochMilli, formatPlainDateTimeIso, combineDateAndTime, refinePlainDateTimeObjectLike, parsePlainDateTime, timeFieldDefaults, moveDate, plainDatesEqual, dateToZonedDateTime, fieldsToYearMonth, fieldsToMonthDay, transformDateOptions, formatPlainDateIso, refinePlainDateObjectLike, parsePlainDate, invalidCalendar, parseCalendarId, durationGetters, validateDurationFields, toStrictInteger, createDurationSlots, compareDurations, mergeDurationFields, negateDuration, absDuration, addDurationsWithoutRelativeTo, roundDuration, totalDuration, formatDurationIso, refineDurationObjectLike, parseDuration, refineMaybeZonedDateTimeObjectLike, parseRelativeToSlots, createStringTagDescriptors, createPropDescriptors, getCurrentTimeZoneId, getCurrentEpochNano, getCurrentIsoDateTime } from \"./internal.js\";\n\nimport { createDateTimeFormatClass, createIntlExtended } from \"./classApi.js\";\n\nimport { defineTemporalClass, dateDerivedGetters, dateFieldGetters, withZonedDateTimeFields, diffZonedDateTimes, forbiddenValueOf, ZonedDateTimeBranding, invalidRecordType, attachDebugString, diffInstants, InstantBranding, monthDayFieldGetters, withMonthDayFields, PlainMonthDayBranding, yearMonthDerivedGetters, yearMonthFieldGetters, withYearMonthFields, diffYearMonths, PlainYearMonthBranding, PlainDateTimeBranding, PlainDateBranding, PlainTimeBranding, DurationBranding, withTimeFields, diffTimes, withDateTimeFields, diffDateTimes, withDateFields, diffDates } from \"./apiHelpers.js\";\n\nimport \"temporal-utils/protected-error-messages\";\n\nimport { toIntegerWithTrunc } from \"temporal-utils/protected\";\n\nimport { refineOverflowOptions, refineRoundingOptions, refineDirectionOptions, refineZonedFieldOptions, refineEpochDisambigOptions } from \"./options.js\";\n\nfunction resolveBasicCalendarId(rawCalendarId) {\n const lowerRawCalendarId = requireString(rawCalendarId).toLowerCase();\n return lowerRawCalendarId === isoCalendarId ? isoCalendarImpl : lowerRawCalendarId === gregoryCalendarId ? gregoryCalendarImpl : void throwRangeError(exoticCalendarRequired(rawCalendarId, \"temporal-polyfill/full\"));\n}\n\nfunction resolveBasicCalendarArg(rawCalendarId = isoCalendarId) {\n return resolveBasicCalendarId(rawCalendarId);\n}\n\nconst zonedDateTimeSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst ZonedDateTime = /*@__PURE__*/ defineTemporalClass(ZonedDateTimeBranding, class {\n constructor(epochNanoseconds, timeZoneId, calendar = void 0) {\n const epochNano = checkEpochNanoInBounds(toBigInt(epochNanoseconds));\n const timeZone = queryTimeZone(refineTimeZoneId(timeZoneId));\n const calendarImpl = resolveBasicCalendarArg(calendar);\n initZonedDateTime(this, createZonedEpochNanoSlots(epochNano, timeZone, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createZonedDateTime(toZonedDateTimeSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareZonedEpochSlots(toZonedDateTimeSlots(arg0), toZonedDateTimeSlots(arg1));\n }\n get calendarId() {\n return getCalendarSlotId(getZonedDateTimeSlots(this).calendar);\n }\n get timeZoneId() {\n return getZonedDateTimeSlots(this).timeZone.id;\n }\n get epochMilliseconds() {\n return epochNanoToMilli(getZonedDateTimeSlots(this).epochNanoseconds);\n }\n get epochNanoseconds() {\n return getZonedDateTimeSlots(this).epochNanoseconds;\n }\n get offset() {\n return formatOffsetNano(zonedEpochSlotsToIso(getZonedDateTimeSlots(this)).offsetNanoseconds);\n }\n get offsetNanoseconds() {\n return zonedEpochSlotsToIso(getZonedDateTimeSlots(this)).offsetNanoseconds;\n }\n get hoursInDay() {\n return computeZonedHoursInDay(getZonedDateTimeSlots(this));\n }\n with(mod, options = void 0) {\n return createZonedDateTime(withZonedDateTimeFields(getZonedDateTimeSlots(this), validateBag(mod), options));\n }\n withCalendar(calendarArg) {\n return createZonedDateTime({\n ...getZonedDateTimeSlots(this),\n calendar: refineCalendarArg(calendarArg)\n });\n }\n withTimeZone(timeZoneArg) {\n return createZonedDateTime({\n ...getZonedDateTimeSlots(this),\n timeZone: queryTimeZone(refineTimeZoneArg(timeZoneArg))\n });\n }\n withPlainTime(plainTimeArg = void 0) {\n return createZonedDateTime(zonedDateTimeWithPlainTime(getZonedDateTimeSlots(this), optionalToPlainTimeFields(plainTimeArg)));\n }\n add(durationArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n return createZonedDateTime(moveZonedEpochSlots(slots, toDurationSlots(durationArg), refineOverflowOptions(options)));\n }\n subtract(durationArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n return createZonedDateTime(moveZonedEpochSlots(slots, negateDurationFields(toDurationSlots(durationArg)), refineOverflowOptions(options)));\n }\n until(otherArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n const other = toZonedDateTimeSlots(otherArg);\n return createDuration(diffZonedDateTimes(0, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getZonedDateTimeSlots(this);\n const other = toZonedDateTimeSlots(otherArg);\n return createDuration(diffZonedDateTimes(1, slots, other, options));\n }\n round(options) {\n const slots = getZonedDateTimeSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options);\n return createZonedDateTime(roundZonedEpochSlotsToUnit(slots, smallestUnit, roundingInc, roundingMode));\n }\n startOfDay() {\n return createZonedDateTime(computeZonedStartOfDay(getZonedDateTimeSlots(this)));\n }\n equals(otherArg) {\n return zonedDateTimesEqual(getZonedDateTimeSlots(this), toZonedDateTimeSlots(otherArg));\n }\n toInstant() {\n return createInstant(zonedDateTimeToInstant(getZonedDateTimeSlots(this)));\n }\n toPlainDateTime() {\n return createPlainDateTime(zonedDateTimeToDateTime(getZonedDateTimeSlots(this)));\n }\n toPlainDate() {\n return createPlainDate(zonedDateTimeToDate(getZonedDateTimeSlots(this)));\n }\n toPlainTime() {\n return createPlainTime(zonedDateTimeToTime(getZonedDateTimeSlots(this)));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getZonedDateTimeSlots(this);\n const format = new RawDateTimeFormat(locales, applyZonedFormatTimeZone(transformZonedOptions(options), getZonedTimeZoneId(slots)));\n return checkResolvedCalendarCompatible(format, slots), format.format(epochNanoToMilli(slots.epochNanoseconds));\n }\n toString(options = void 0) {\n return formatZonedDateTimeIso(getZonedDateTimeSlots(this), options);\n }\n toJSON() {\n return formatZonedDateTimeIso(getZonedDateTimeSlots(this));\n }\n getTimeZoneTransition(options) {\n const slots = getZonedDateTimeSlots(this);\n const newEpochNano = slots.timeZone.C(slots.epochNanoseconds, refineDirectionOptions(options));\n return void 0 !== newEpochNano ? createZonedDateTime({\n ...slots,\n epochNanoseconds: newEpochNano\n }) : null;\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getZonedDateTimeIsoSlots, dateFieldGetters, dateDerivedGetters, timeGetters);\n\nfunction createZonedDateTime(slots) {\n return initZonedDateTime(Object.create(ZonedDateTime.prototype), slots);\n}\n\nfunction getZonedDateTimeSlots(obj) {\n return getZonedDateTimeSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getZonedDateTimeIsoSlots(obj) {\n const slots = getZonedDateTimeSlots(obj);\n return {\n ...zonedEpochSlotsToIso(slots),\n calendar: slots.calendar\n };\n}\n\nfunction getZonedDateTimeSlotsIfPresent(obj) {\n return zonedDateTimeSlotsMap.get(obj);\n}\n\nfunction toZonedDateTimeSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (ownSlots) {\n return refineZonedFieldOptions(options), ownSlots;\n }\n const calendar = getCalendarFromBag(arg);\n return refineZonedDateTimeObjectLike(refineTimeZoneArg, calendar, arg, options);\n }\n return parseZonedDateTime(arg, resolveBasicCalendarId, options);\n}\n\nfunction initZonedDateTime(instance, slots) {\n return zonedDateTimeSlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nfunction refineTimeZoneArg(arg) {\n if (isObjectLike(arg)) {\n const slots = getZonedDateTimeSlotsIfPresent(arg);\n return slots || throwTypeError(invalidTimeZone(arg)), slots.timeZone.id;\n }\n return (arg => resolveTimeZoneId(parseTimeZoneId(requireString(arg))))(arg);\n}\n\nconst instantSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst Instant = /*@__PURE__*/ defineTemporalClass(InstantBranding, class {\n constructor(epochNanoseconds) {\n const epochNano = checkEpochNanoInBounds(toBigInt(epochNanoseconds));\n initInstant(this, createEpochNanoSlots(epochNano));\n }\n static from(arg) {\n return createInstant(toInstantSlots(arg));\n }\n static fromEpochMilliseconds(epochMilli) {\n return createInstant(epochMilliToInstant(epochMilli));\n }\n static fromEpochNanoseconds(epochNano) {\n return createInstant(epochNanoToInstant(epochNano));\n }\n static compare(a, b) {\n return compareZonedEpochSlots(toInstantSlots(a), toInstantSlots(b));\n }\n get epochMilliseconds() {\n return epochNanoToMilli(getInstantSlots(this).epochNanoseconds);\n }\n get epochNanoseconds() {\n return getInstantSlots(this).epochNanoseconds;\n }\n add(durationArg) {\n const slots = getInstantSlots(this);\n return createInstant(createEpochNanoSlots(moveEpochNano(slots.epochNanoseconds, toDurationSlots(durationArg))));\n }\n subtract(durationArg) {\n const slots = getInstantSlots(this);\n return createInstant(createEpochNanoSlots(moveEpochNano(slots.epochNanoseconds, negateDurationFields(toDurationSlots(durationArg)))));\n }\n until(otherArg, options = void 0) {\n return createDuration(diffInstants(0, getInstantSlots(this), toInstantSlots(otherArg), options));\n }\n since(otherArg, options = void 0) {\n return createDuration(diffInstants(1, getInstantSlots(this), toInstantSlots(otherArg), options));\n }\n round(options) {\n const slots = getInstantSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options, 5, 1);\n return createInstant(createEpochNanoSlots(roundBigNanoToDayOriginInc(slots.epochNanoseconds, computeBigNanoInc(smallestUnit, roundingInc), roundingMode)));\n }\n equals(otherArg) {\n return instantsEqual(getInstantSlots(this), toInstantSlots(otherArg));\n }\n toZonedDateTimeISO(timeZoneArg) {\n return createZonedDateTime(instantToZonedDateTime(getInstantSlots(this), queryTimeZone(refineTimeZoneArg(timeZoneArg))));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getInstantSlots(this);\n return new RawDateTimeFormat(locales, transformInstantOptions(options)).format(epochNanoToMilli(slots.epochNanoseconds));\n }\n toString(options = void 0) {\n return formatInstantIso(refineTimeZoneArg, getInstantSlots(this), options);\n }\n toJSON() {\n return formatInstantIso(refineTimeZoneArg, getInstantSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n});\n\nfunction createInstant(slots) {\n return initInstant(Object.create(Instant.prototype), slots);\n}\n\nfunction getInstantSlots(obj) {\n return getInstantSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getInstantSlotsIfPresent(obj) {\n return instantSlotsMap.get(obj);\n}\n\nfunction toInstantSlots(arg) {\n if (isObjectLike(arg)) {\n const ownSlots = getInstantSlotsIfPresent(arg);\n if (ownSlots) {\n return ownSlots;\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (zonedDateTimeSlots) {\n return createEpochNanoSlots(zonedDateTimeSlots.epochNanoseconds);\n }\n }\n return parseInstant(arg);\n}\n\nconst {toTemporalInstant: toTemporalInstant} = {\n toTemporalInstant() {\n const epochMilli = Date.prototype.valueOf.call(this);\n return createInstant(createEpochNanoSlots(BigInt(requireNumberIsInteger(epochMilli)) * bigNanoInMilli));\n }\n};\n\nfunction initInstant(instance, slots) {\n return instantSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nconst plainMonthDaySlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainMonthDay = /*@__PURE__*/ defineTemporalClass(PlainMonthDayBranding, class {\n constructor(isoMonth, isoDay, calendar = void 0, referenceIsoYear) {\n const isoMonthInt = toIntegerWithTrunc(isoMonth);\n const isoDayInt = toIntegerWithTrunc(isoDay);\n const calendarImpl = resolveBasicCalendarArg(calendar);\n const isoYearInt = toIntegerWithTrunc(referenceIsoYear ?? isoEpochFirstLeapYear);\n const fields = checkIsoDateInBounds(validateIsoDateFields({\n year: isoYearInt,\n month: isoMonthInt,\n day: isoDayInt\n }));\n initPlainMonthDay(this, createDateSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainMonthDay(toPlainMonthDaySlots(arg, options));\n }\n get calendarId() {\n return getCalendarSlotId(getPlainMonthDaySlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainMonthDay(withMonthDayFields(getPlainMonthDaySlots(this), validateBag(mod), options));\n }\n equals(otherArg) {\n return plainMonthDaysEqual(getPlainMonthDaySlots(this), toPlainMonthDaySlots(otherArg));\n }\n toPlainDate(bag) {\n const slots = getPlainMonthDaySlots(this);\n return createPlainDate(monthDayToDate(slots.calendar, this, bag));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainMonthDaySlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformMonthDayOptions(options)));\n return checkResolvedCalendarCompatible(format, slots, 1), format.format(isoDateToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainMonthDayIso(getPlainMonthDaySlots(this), options);\n }\n toJSON() {\n return formatPlainMonthDayIso(getPlainMonthDaySlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainMonthDaySlots, monthDayFieldGetters);\n\nfunction createPlainMonthDay(slots) {\n return initPlainMonthDay(Object.create(PlainMonthDay.prototype), slots);\n}\n\nfunction getPlainMonthDaySlots(obj) {\n return getPlainMonthDaySlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainMonthDaySlotsIfPresent(obj) {\n return plainMonthDaySlotsMap.get(obj);\n}\n\nfunction toPlainMonthDaySlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainMonthDaySlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const calendarMaybe = extractCalendarFromBag(arg);\n return refinePlainMonthDayObjectLike(void 0 === calendarMaybe ? isoCalendarImpl : calendarMaybe, void 0 === calendarMaybe, arg, options);\n }\n const res = parsePlainMonthDay(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainMonthDay(instance, slots) {\n return plainMonthDaySlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nconst plainYearMonthSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainYearMonth = /*@__PURE__*/ defineTemporalClass(PlainYearMonthBranding, class {\n constructor(isoYear, isoMonth, calendar = void 0, referenceIsoDay) {\n const isoYearInt = toIntegerWithTrunc(isoYear);\n const isoMonthInt = toIntegerWithTrunc(isoMonth);\n const calendarImpl = resolveBasicCalendarArg(calendar);\n const isoDayInt = toIntegerWithTrunc(referenceIsoDay ?? 1);\n const fields = checkIsoYearMonthInBounds(validateIsoDateFields({\n year: isoYearInt,\n month: isoMonthInt,\n day: isoDayInt\n }));\n initPlainYearMonth(this, createDateSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainYearMonth(toPlainYearMonthSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareIsoDateFields(toPlainYearMonthSlots(arg0), toPlainYearMonthSlots(arg1));\n }\n get calendarId() {\n return getCalendarSlotId(getPlainYearMonthSlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainYearMonth(withYearMonthFields(getPlainYearMonthSlots(this), validateBag(mod), options));\n }\n add(durationArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n return createPlainYearMonth(createDateSlots(moveYearMonth(slots.calendar, slots, toDurationSlots(durationArg), refineOverflowOptions(options)), slots.calendar));\n }\n subtract(durationArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n return createPlainYearMonth(createDateSlots(moveYearMonth(slots.calendar, slots, negateDurationFields(toDurationSlots(durationArg)), refineOverflowOptions(options)), slots.calendar));\n }\n until(otherArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n const other = toPlainYearMonthSlots(otherArg);\n return createDuration(diffYearMonths(0, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getPlainYearMonthSlots(this);\n const other = toPlainYearMonthSlots(otherArg);\n return createDuration(diffYearMonths(1, slots, other, options));\n }\n equals(otherArg) {\n return plainYearMonthsEqual(getPlainYearMonthSlots(this), toPlainYearMonthSlots(otherArg));\n }\n toPlainDate(bag) {\n const slots = getPlainYearMonthSlots(this);\n return createPlainDate(yearMonthToDate(slots.calendar, this, bag));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainYearMonthSlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformYearMonthOptions(options)));\n return checkResolvedCalendarCompatible(format, slots, 1), format.format(isoDateToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainYearMonthIso(getPlainYearMonthSlots(this), options);\n }\n toJSON() {\n return formatPlainYearMonthIso(getPlainYearMonthSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainYearMonthSlots, yearMonthFieldGetters, yearMonthDerivedGetters);\n\nfunction createPlainYearMonth(slots) {\n return initPlainYearMonth(Object.create(PlainYearMonth.prototype), slots);\n}\n\nfunction getPlainYearMonthSlots(obj) {\n return getPlainYearMonthSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainYearMonthSlotsIfPresent(obj) {\n return plainYearMonthSlotsMap.get(obj);\n}\n\nfunction toPlainYearMonthSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainYearMonthSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const calendar = getCalendarFromBag(arg);\n return refinePlainYearMonthObjectLike(calendar, arg, options);\n }\n const res = parsePlainYearMonth(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainYearMonth(instance, slots) {\n return plainYearMonthSlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nfunction getTemporalBrandingAndSlots(obj) {\n if (!isObjectLike(obj)) {\n return;\n }\n let slots = getInstantSlotsIfPresent(obj);\n return slots ? [ InstantBranding, slots ] : (slots = getZonedDateTimeSlotsIfPresent(obj), \n slots ? [ ZonedDateTimeBranding, slots ] : (slots = getPlainDateTimeSlotsIfPresent(obj), \n slots ? [ PlainDateTimeBranding, slots ] : (slots = getPlainDateSlotsIfPresent(obj), \n slots ? [ PlainDateBranding, slots ] : (slots = getPlainTimeSlotsIfPresent(obj), \n slots ? [ PlainTimeBranding, slots ] : (slots = getPlainYearMonthSlotsIfPresent(obj), \n slots ? [ PlainYearMonthBranding, slots ] : (slots = getPlainMonthDaySlotsIfPresent(obj), \n slots ? [ PlainMonthDayBranding, slots ] : (slots = getDurationSlotsIfPresent(obj), \n slots ? [ DurationBranding, slots ] : void 0)))))));\n}\n\nfunction validateBag(bag) {\n return (getTemporalBrandingAndSlots(bag) || void 0 !== bag.calendar || void 0 !== bag.timeZone) && throwTypeError(invalidBag), \n bag;\n}\n\nconst plainTimeSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainTime = /*@__PURE__*/ defineTemporalClass(PlainTimeBranding, class {\n constructor(hour = 0, minute = 0, second = 0, millisecond = 0, microsecond = 0, nanosecond = 0) {\n const fields = validateTimeFields(mapProps(toIntegerWithTrunc, {\n hour: hour,\n minute: minute,\n second: second,\n millisecond: millisecond,\n microsecond: microsecond,\n nanosecond: nanosecond\n }));\n initPlainTime(this, createTimeSlots(fields));\n }\n static from(arg, options = void 0) {\n return createPlainTime(toPlainTimeSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareTimeFields(toPlainTimeSlots(arg0), toPlainTimeSlots(arg1));\n }\n with(mod, options = void 0) {\n return createPlainTime(withTimeFields(getPlainTimeSlots(this), validateBag(mod), options));\n }\n add(durationArg) {\n const slots = getPlainTimeSlots(this);\n return createPlainTime(moveTime(slots, toDurationSlots(durationArg))[0]);\n }\n subtract(durationArg) {\n const slots = getPlainTimeSlots(this);\n return createPlainTime(moveTime(slots, negateDurationFields(toDurationSlots(durationArg)))[0]);\n }\n until(otherArg, options = void 0) {\n return createDuration(diffTimes(0, getPlainTimeSlots(this), toPlainTimeSlots(otherArg), options));\n }\n since(otherArg, options = void 0) {\n return createDuration(diffTimes(1, getPlainTimeSlots(this), toPlainTimeSlots(otherArg), options));\n }\n round(options) {\n const slots = getPlainTimeSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options, 5);\n return createPlainTime(roundTimeToInc(slots, computeNanoInc(smallestUnit, roundingInc), roundingMode)[0]);\n }\n equals(other) {\n return plainTimesEqual(getPlainTimeSlots(this), toPlainTimeSlots(other));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainTimeSlots(this);\n return new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformTimeOptions(options))).format(timeFieldsToMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainTimeIso(getPlainTimeSlots(this), options);\n }\n toJSON() {\n return formatPlainTimeIso(getPlainTimeSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainTimeSlots, timeGetters);\n\nfunction createPlainTime(slots) {\n return initPlainTime(Object.create(PlainTime.prototype), slots);\n}\n\nfunction getPlainTimeSlots(obj) {\n return getPlainTimeSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainTimeSlotsIfPresent(obj) {\n return plainTimeSlotsMap.get(obj);\n}\n\nfunction toPlainTimeSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainTimeSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const dateTimeSlots = getPlainDateTimeSlotsIfPresent(arg);\n if (dateTimeSlots) {\n return refineOverflowOptions(options), createTimeSlots(dateTimeSlots);\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n return zonedDateTimeSlots ? (refineOverflowOptions(options), zonedDateTimeToTime(zonedDateTimeSlots)) : refinePlainTimeObjectLike(arg, options);\n }\n const timeSlots = parsePlainTime(arg);\n return refineOverflowOptions(options), timeSlots;\n}\n\nfunction optionalToPlainTimeFields(timeArg) {\n return void 0 === timeArg ? void 0 : toPlainTimeSlots(timeArg);\n}\n\nfunction initPlainTime(instance, slots) {\n return plainTimeSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nconst plainDateTimeSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainDateTime = /*@__PURE__*/ defineTemporalClass(PlainDateTimeBranding, class {\n constructor(isoYear, isoMonth, isoDay, hour = 0, minute = 0, second = 0, millisecond = 0, microsecond = 0, nanosecond = 0, calendar = void 0) {\n const fields = checkIsoDateTimeInBounds(validateIsoDateTimeFields(mapProps(toIntegerWithTrunc, {\n year: isoYear,\n month: isoMonth,\n day: isoDay,\n hour: hour,\n minute: minute,\n second: second,\n millisecond: millisecond,\n microsecond: microsecond,\n nanosecond: nanosecond\n })));\n const calendarImpl = resolveBasicCalendarArg(calendar);\n initPlainDateTime(this, createDateTimeSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainDateTime(toPlainDateTimeSlots(arg, options));\n }\n static compare(arg0, arg1) {\n const slots0 = toPlainDateTimeSlots(arg0);\n const slots1 = toPlainDateTimeSlots(arg1);\n return compareIsoDateTimeFields(slots0, slots1);\n }\n get calendarId() {\n return getCalendarSlotId(getPlainDateTimeSlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainDateTime(withDateTimeFields(getPlainDateTimeSlots(this), validateBag(mod), options));\n }\n withCalendar(calendarArg) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeSlots(slots, refineCalendarArg(calendarArg)));\n }\n withPlainTime(plainTimeArg = void 0) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeFromRefinedFields(slots, optionalToPlainTimeFields(plainTimeArg), slots.calendar));\n }\n add(durationArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeSlots(moveDateTime(slots.calendar, slots, toDurationSlots(durationArg), refineOverflowOptions(options)), slots.calendar));\n }\n subtract(durationArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDateTime(createDateTimeSlots(moveDateTime(slots.calendar, slots, negateDurationFields(toDurationSlots(durationArg)), refineOverflowOptions(options)), slots.calendar));\n }\n until(otherArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n const other = toPlainDateTimeSlots(otherArg);\n return createDuration(diffDateTimes(0, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getPlainDateTimeSlots(this);\n const other = toPlainDateTimeSlots(otherArg);\n return createDuration(diffDateTimes(1, slots, other, options));\n }\n round(options) {\n const slots = getPlainDateTimeSlots(this);\n const [smallestUnit, roundingInc, roundingMode] = refineRoundingOptions(options);\n return createPlainDateTime(createDateTimeSlots(roundDateTimeToInc(slots, computeNanoInc(smallestUnit, roundingInc), roundingMode), slots.calendar));\n }\n equals(otherArg) {\n return plainDateTimesEqual(getPlainDateTimeSlots(this), toPlainDateTimeSlots(otherArg));\n }\n toZonedDateTime(timeZoneArg, options = void 0) {\n return createZonedDateTime(dateTimeToZonedDateTime(getPlainDateTimeSlots(this), queryTimeZone(refineTimeZoneArg(timeZoneArg)), refineEpochDisambigOptions(options)));\n }\n toPlainDate() {\n const slots = getPlainDateTimeSlots(this);\n return createPlainDate(createDateSlots(slots, slots.calendar));\n }\n toPlainTime() {\n return createPlainTime(createTimeSlots(getPlainDateTimeSlots(this)));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainDateTimeSlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformDateTimeOptions(options)));\n return checkResolvedCalendarCompatible(format, slots), format.format(isoDateTimeToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainDateTimeIso(getPlainDateTimeSlots(this), options);\n }\n toJSON() {\n return formatPlainDateTimeIso(getPlainDateTimeSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainDateTimeSlots, dateFieldGetters, dateDerivedGetters, timeGetters);\n\nfunction createPlainDateTime(slots) {\n return initPlainDateTime(Object.create(PlainDateTime.prototype), slots);\n}\n\nfunction getPlainDateTimeSlots(obj) {\n return getPlainDateTimeSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainDateTimeSlotsIfPresent(obj) {\n return plainDateTimeSlotsMap.get(obj);\n}\n\nfunction toPlainDateTimeSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainDateTimeSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const dateSlots = getPlainDateSlotsIfPresent(arg);\n if (dateSlots) {\n return refineOverflowOptions(options), createDateTimeSlots(combineDateAndTime(dateSlots, timeFieldDefaults), dateSlots.calendar);\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (zonedDateTimeSlots) {\n return refineOverflowOptions(options), zonedDateTimeToDateTime(zonedDateTimeSlots);\n }\n const calendar = getCalendarFromBag(arg);\n return refinePlainDateTimeObjectLike(calendar, arg, options);\n }\n const res = parsePlainDateTime(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainDateTime(instance, slots) {\n return plainDateTimeSlotsMap.set(instance, slots), attachDebugString(instance), \n instance;\n}\n\nconst plainDateSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst PlainDate = /*@__PURE__*/ defineTemporalClass(PlainDateBranding, class {\n constructor(isoYear, isoMonth, isoDay, calendar = void 0) {\n const fields = checkIsoDateInBounds(validateIsoDateFields(mapProps(toIntegerWithTrunc, {\n year: isoYear,\n month: isoMonth,\n day: isoDay\n })));\n const calendarImpl = resolveBasicCalendarArg(calendar);\n initPlainDate(this, createDateSlots(fields, calendarImpl));\n }\n static from(arg, options = void 0) {\n return createPlainDate(toPlainDateSlots(arg, options));\n }\n static compare(arg0, arg1) {\n return compareIsoDateFields(toPlainDateSlots(arg0), toPlainDateSlots(arg1));\n }\n get calendarId() {\n return getCalendarSlotId(getPlainDateSlots(this).calendar);\n }\n with(mod, options = void 0) {\n return createPlainDate(withDateFields(getPlainDateSlots(this), validateBag(mod), options));\n }\n withCalendar(calendarArg) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(createDateSlots(slots, refineCalendarArg(calendarArg)));\n }\n add(durationArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(createDateSlots(moveDate(slots.calendar, slots, toDurationSlots(durationArg), refineOverflowOptions(options)), slots.calendar));\n }\n subtract(durationArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDate(createDateSlots(moveDate(slots.calendar, slots, negateDurationFields(toDurationSlots(durationArg)), refineOverflowOptions(options)), slots.calendar));\n }\n until(otherArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n const other = toPlainDateSlots(otherArg);\n return createDuration(diffDates(0, slots, other, options));\n }\n since(otherArg, options = void 0) {\n const slots = getPlainDateSlots(this);\n const other = toPlainDateSlots(otherArg);\n return createDuration(diffDates(1, slots, other, options));\n }\n equals(otherArg) {\n return plainDatesEqual(getPlainDateSlots(this), toPlainDateSlots(otherArg));\n }\n toZonedDateTime(options) {\n const optionsObj = isObjectLike(options) ? {\n timeZone: options.timeZone,\n plainTime: options.plainTime\n } : {\n timeZone: options\n };\n const slots = getPlainDateSlots(this);\n const timeZoneId = refineTimeZoneArg(optionsObj.timeZone);\n const plainTimeArg = optionsObj.plainTime;\n const timeFields = void 0 !== plainTimeArg ? toPlainTimeSlots(plainTimeArg) : void 0;\n return createZonedDateTime(dateToZonedDateTime(slots, queryTimeZone(timeZoneId), timeFields));\n }\n toPlainDateTime(plainTimeArg = void 0) {\n const slots = getPlainDateSlots(this);\n return createPlainDateTime(createDateTimeFromRefinedFields(slots, optionalToPlainTimeFields(plainTimeArg), slots.calendar));\n }\n toPlainYearMonth() {\n const slots = getPlainDateSlots(this);\n return createPlainYearMonth(fieldsToYearMonth(slots.calendar, this));\n }\n toPlainMonthDay() {\n const slots = getPlainDateSlots(this);\n return createPlainMonthDay(fieldsToMonthDay(slots.calendar, this));\n }\n toLocaleString(locales = void 0, options = {}) {\n const slots = getPlainDateSlots(this);\n const format = new RawDateTimeFormat(locales, applyPlainFormatTimeZone(transformDateOptions(options)));\n return checkResolvedCalendarCompatible(format, slots), format.format(isoDateToEpochMilli(slots));\n }\n toString(options = void 0) {\n return formatPlainDateIso(getPlainDateSlots(this), options);\n }\n toJSON() {\n return formatPlainDateIso(getPlainDateSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getPlainDateSlots, dateFieldGetters, dateDerivedGetters);\n\nfunction createPlainDate(slots) {\n return initPlainDate(Object.create(PlainDate.prototype), slots);\n}\n\nfunction getPlainDateSlots(obj) {\n return getPlainDateSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getPlainDateSlotsIfPresent(obj) {\n return plainDateSlotsMap.get(obj);\n}\n\nfunction toPlainDateSlots(arg, options) {\n if (isObjectLike(arg)) {\n const ownSlots = getPlainDateSlotsIfPresent(arg);\n if (ownSlots) {\n return refineOverflowOptions(options), ownSlots;\n }\n const dateTimeSlots = getPlainDateTimeSlotsIfPresent(arg);\n if (dateTimeSlots) {\n return refineOverflowOptions(options), createDateSlots(dateTimeSlots, dateTimeSlots.calendar);\n }\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(arg);\n if (zonedDateTimeSlots) {\n return refineOverflowOptions(options), zonedDateTimeToDate(zonedDateTimeSlots);\n }\n const calendar = getCalendarFromBag(arg);\n return refinePlainDateObjectLike(calendar, arg, options);\n }\n const res = parsePlainDate(arg, resolveBasicCalendarId);\n return refineOverflowOptions(options), res;\n}\n\nfunction initPlainDate(instance, slots) {\n return plainDateSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nfunction getCalendarFromBag(bag) {\n const calendar = extractCalendarFromBag(bag);\n return void 0 === calendar ? isoCalendarImpl : calendar;\n}\n\nfunction extractCalendarFromBag(bag) {\n const {calendar: calendarArg} = bag;\n if (void 0 !== calendarArg) {\n return refineCalendarArg(calendarArg);\n }\n}\n\nfunction refineCalendarArg(arg) {\n if (isObjectLike(arg)) {\n const slots = getPlainDateSlotsIfPresent(arg) || getPlainDateTimeSlotsIfPresent(arg) || getZonedDateTimeSlotsIfPresent(arg) || getPlainMonthDaySlotsIfPresent(arg) || getPlainYearMonthSlotsIfPresent(arg);\n return slots || throwTypeError(invalidCalendar(arg)), slots.calendar;\n }\n return (arg => resolveBasicCalendarId(parseCalendarId(requireString(arg))))(arg);\n}\n\nconst durationSlotsMap = /*@__PURE__*/ new WeakMap;\n\nconst Duration = /*@__PURE__*/ defineTemporalClass(DurationBranding, class {\n constructor(years = 0, months = 0, weeks = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0, microseconds = 0, nanoseconds = 0) {\n const fields = validateDurationFields(mapProps(toStrictInteger, {\n years: years,\n months: months,\n weeks: weeks,\n days: days,\n hours: hours,\n minutes: minutes,\n seconds: seconds,\n milliseconds: milliseconds,\n microseconds: microseconds,\n nanoseconds: nanoseconds\n }));\n initDuration(this, createDurationSlots(fields));\n }\n static from(arg) {\n return createDuration(toDurationSlots(arg));\n }\n static compare(durationArg0, durationArg1, options = void 0) {\n return compareDurations(refinePublicRelativeTo, toDurationSlots(durationArg0), toDurationSlots(durationArg1), options);\n }\n get sign() {\n return getDurationSlots(this).sign;\n }\n get blank() {\n return !getDurationSlots(this).sign;\n }\n with(mod) {\n return createDuration(mergeDurationFields(getDurationSlots(this), mod));\n }\n negated() {\n return createDuration(negateDuration(getDurationSlots(this)));\n }\n abs() {\n return createDuration(absDuration(getDurationSlots(this)));\n }\n add(otherArg) {\n return createDuration(addDurationsWithoutRelativeTo(0, getDurationSlots(this), toDurationSlots(otherArg)));\n }\n subtract(otherArg) {\n return createDuration(addDurationsWithoutRelativeTo(1, getDurationSlots(this), toDurationSlots(otherArg)));\n }\n round(roundTo) {\n return createDuration(roundDuration(refinePublicRelativeTo, getDurationSlots(this), roundTo));\n }\n total(totalOf) {\n return totalDuration(refinePublicRelativeTo, getDurationSlots(this), totalOf);\n }\n toLocaleString(locales = void 0, options) {\n const slots = getDurationSlots(this);\n return Intl.DurationFormat ? new Intl.DurationFormat(locales, options).format(slots) : formatDurationIso(slots, options);\n }\n toString(options = void 0) {\n return formatDurationIso(getDurationSlots(this), options);\n }\n toJSON() {\n return formatDurationIso(getDurationSlots(this));\n }\n valueOf() {\n return forbiddenValueOf();\n }\n}, getDurationSlots, durationGetters);\n\nfunction createDuration(slots) {\n return initDuration(Object.create(Duration.prototype), slots);\n}\n\nfunction getDurationSlots(obj) {\n return getDurationSlotsIfPresent(obj) || invalidRecordType();\n}\n\nfunction getDurationSlotsIfPresent(obj) {\n return durationSlotsMap.get(obj);\n}\n\nfunction toDurationSlots(arg) {\n if (isObjectLike(arg)) {\n return getDurationSlotsIfPresent(arg) || refineDurationObjectLike(arg);\n }\n return parseDuration(arg);\n}\n\nfunction refinePublicRelativeTo(relativeTo) {\n if (void 0 !== relativeTo) {\n if (isObjectLike(relativeTo)) {\n const zonedDateTimeSlots = getZonedDateTimeSlotsIfPresent(relativeTo);\n if (zonedDateTimeSlots) {\n return zonedDateTimeSlots;\n }\n const dateSlots = getPlainDateSlotsIfPresent(relativeTo);\n if (dateSlots) {\n return dateSlots;\n }\n const dateTimeSlots = getPlainDateTimeSlotsIfPresent(relativeTo);\n if (dateTimeSlots) {\n return createDateSlots(dateTimeSlots, dateTimeSlots.calendar);\n }\n const calendar = getCalendarFromBag(relativeTo);\n return refineMaybeZonedDateTimeObjectLike(refineTimeZoneArg, calendar, relativeTo);\n }\n return parseRelativeToSlots(relativeTo, resolveBasicCalendarId);\n }\n}\n\nfunction initDuration(instance, slots) {\n return durationSlotsMap.set(instance, slots), attachDebugString(instance), instance;\n}\n\nconst Now = /*@__PURE__*/ Object.defineProperties({}, {\n ...createStringTagDescriptors(\"Temporal.Now\"),\n ...createPropDescriptors({\n timeZoneId() {\n return getCurrentTimeZoneId();\n },\n instant() {\n return createInstant(createEpochNanoSlots(getCurrentEpochNano()));\n },\n zonedDateTimeISO(timeZoneArg = getCurrentTimeZoneId()) {\n const timeZone = queryTimeZone(refineTimeZoneArg(timeZoneArg));\n return createZonedDateTime(createZonedEpochNanoSlots(getCurrentEpochNano(), timeZone));\n },\n plainDateTimeISO(timeZoneArg = getCurrentTimeZoneId()) {\n const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneArg(timeZoneArg)));\n return createPlainDateTime(createDateTimeSlots(isoDateTime));\n },\n plainDateISO(timeZoneArg = getCurrentTimeZoneId()) {\n const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneArg(timeZoneArg)));\n return createPlainDate(createDateSlots(isoDateTime));\n },\n plainTimeISO(timeZoneArg = getCurrentTimeZoneId()) {\n const isoDateTime = getCurrentIsoDateTime(queryTimeZone(refineTimeZoneArg(timeZoneArg)));\n return createPlainTime(createTimeSlots(isoDateTime));\n }\n })\n});\n\nconst Temporal = /*@__PURE__*/ Object.defineProperties({}, {\n ...createStringTagDescriptors(\"Temporal\"),\n ...createPropDescriptors({\n PlainYearMonth: PlainYearMonth,\n PlainMonthDay: PlainMonthDay,\n PlainDate: PlainDate,\n PlainTime: PlainTime,\n PlainDateTime: PlainDateTime,\n ZonedDateTime: ZonedDateTime,\n Instant: Instant,\n Duration: Duration,\n Now: Now\n })\n});\n\nconst DateTimeFormat = /*@__PURE__*/ createDateTimeFormatClass(getTemporalBrandingAndSlots);\n\nconst IntlExtended = /*@__PURE__*/ createIntlExtended(DateTimeFormat);\n\nexport { DateTimeFormat, IntlExtended, Temporal, toTemporalInstant };\n","import 'temporal-polyfill/global';\n/**\n * java.lang.Math.toRadians\n * @private\n * @param degrees\n */\nfunction degreesToRadians(degrees) {\n return (degrees * Math.PI) / 180;\n}\n/**\n * java.lang.Math.toDegrees\n * @private\n * @param radians\n */\nfunction radiansToDegrees(radians) {\n return (radians * 180) / Math.PI;\n}\n/**\n * A class that contains location information such as latitude and longitude required for astronomical calculations. The\n * elevation field may not be used by some calculation engines and would be ignored if set.\n *\n * @author &copy; Eliyahu Hershfeld 2004 - 2016\n * @version 1.1\n */\nexport class GeoLocation {\n /**\n * GeoLocation constructor with parameters for all required fields.\n *\n * @param {string} name\n * The location name for display use such as &quot;Lakewood, NJ&quot;\n * @param {number} latitude\n * the latitude in a double format such as 40.095965 for Lakewood, NJ.\n * <b>Note: </b> For latitudes south of the equator, a negative value should be used.\n * @param {number} longitude\n * double the longitude in a double format such as -74.222130 for Lakewood, NJ.\n * <b>Note: </b> For longitudes west of the <a href=\"http://en.wikipedia.org/wiki/Prime_Meridian\">Prime\n * Meridian </a> (Greenwich), a negative value should be used.\n * @param {number} elevation\n * the elevation above sea level in Meters. Elevation is not used in most algorithms used for calculating\n * sunrise and set.\n * @param {string} timeZoneId\n * the <code>TimeZone</code> for the location.\n */\n constructor(name, latitude, longitude, elevation, timeZoneId) {\n this.setLocationName(name);\n this.setLatitude(latitude);\n this.setLongitude(longitude);\n this.setElevation(elevation);\n this.setTimeZone(timeZoneId);\n }\n latitude;\n longitude;\n locationName = null;\n timeZoneId;\n elevation;\n /**\n * Method to get the elevation in Meters.\n *\n * @return {number} Returns the elevation in Meters.\n */\n getElevation() {\n return this.elevation;\n }\n /**\n * Method to set the elevation in Meters <b>above </b> sea level.\n *\n * @param {number} elevation\n * The elevation to set in Meters. An Error will be thrown if the value is a negative.\n */\n setElevation(elevation) {\n if (typeof elevation !== 'number')\n throw new TypeError('Invalid elevation');\n if (elevation < 0) {\n throw new RangeError(`elevation ${elevation} must be zero or positive`);\n }\n this.elevation = elevation;\n }\n setLatitude(latitude) {\n if (typeof latitude !== 'number')\n throw new TypeError('Invalid latitude');\n if (latitude < -90 || latitude > 90) {\n throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);\n }\n this.latitude = latitude;\n }\n /**\n * @return {number} Returns the latitude.\n */\n getLatitude() {\n return this.latitude;\n }\n setLongitude(longitude) {\n if (typeof longitude !== 'number')\n throw new TypeError('Invalid longitude');\n if (longitude < -180 || longitude > 180) {\n throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);\n }\n this.longitude = longitude;\n }\n /**\n * @return {number} Returns the longitude.\n */\n getLongitude() {\n return this.longitude;\n }\n /**\n * @return {string|null} Returns the location name.\n */\n getLocationName() {\n return this.locationName;\n }\n /**\n * @param {string|null} name\n * The setter method for the display name.\n */\n setLocationName(name) {\n this.locationName = name;\n }\n /**\n * @return {string} Returns the timeZone.\n */\n getTimeZone() {\n return this.timeZoneId;\n }\n /**\n * Method to set the TimeZone.\n * @param {string} timeZoneId\n * The timeZone to set.\n */\n setTimeZone(timeZoneId) {\n if (!timeZoneId) {\n throw new RangeError('Invalid timeZoneId');\n }\n this.timeZoneId = timeZoneId;\n }\n}\n/**\n * The commonly used average solar refraction. Calendrical Calculations lists a more accurate global average of\n * 34.478885263888294\n * @private\n */\nconst refraction = 34 / 60;\n// private double refraction = 34.478885263888294 / 60d;\n/**\n * The commonly used average solar radius in minutes of a degree.\n * @private\n */\nconst solarRadius = 16 / 60;\n/**\n * The commonly used average earth radius in KM. At this time, this only affects elevation adjustment and not the\n * sunrise and sunset calculations. The value currently defaults to 6356.9 KM.\n * @private\n */\nconst earthRadius = 6356.9; // in KM\n/**\n * Implementation of sunrise and sunset methods to calculate astronomical times based on the <a\n * href=\"http://noaa.gov\">NOAA</a> algorithm. This calculator uses the Java algorithm based on the implementation by <a\n * href=\"http://noaa.gov\">NOAA - National Oceanic and Atmospheric Administration</a>'s <a href =\n * \"http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html\">Surface Radiation Research Branch</a>. NOAA's <a\n * href=\"http://www.srrb.noaa.gov/highlights/sunrise/solareqns.PDF\">implementation</a> is based on equations from <a\n * href=\"http://www.willbell.com/math/mc1.htm\">Astronomical Algorithms</a> by <a\n * href=\"http://en.wikipedia.org/wiki/Jean_Meeus\">Jean Meeus</a>. Added to the algorithm is an adjustment of the zenith\n * to account for elevation. The algorithm can be found in the <a\n * href=\"http://en.wikipedia.org/wiki/Sunrise_equation\">Wikipedia Sunrise Equation</a> article.\n *\n * @author &copy; Eliyahu Hershfeld 2011 - 2019\n */\nexport class NOAACalculator {\n /**\n * A constructor that takes in <a href=\"http://en.wikipedia.org/wiki/Geolocation\">geolocation</a> information as a\n * parameter.\n *\n * @param {GeoLocation} geoLocation\n * The location information used for calculating astronomical sun times.\n * @param {Temporal.PlainDate} date\n */\n constructor(geoLocation, date) {\n this.date = date;\n this.geoLocation = geoLocation;\n }\n /**\n * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;\n * @private\n */\n static GEOMETRIC_ZENITH = 90;\n /**\n * Default value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle that the\n * center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the Earth\n * were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun is not\n * a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to true\n * sunset or sunrise, instead the center of the Sun's disk must lie just below the horizon for the upper edge to be\n * obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16 minutes of\n * arc, and atmospheric refraction accounts for\n * 34 minutes or so, giving a total of 50\n * arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset.\n */\n // const ZENITH: number = GEOMETRIC_ZENITH + 5.0 / 6.0;\n /** Sun's zenith at civil twilight (96&deg;). */\n static CIVIL_ZENITH = 96;\n /** Sun's zenith at nautical twilight (102&deg;). */\n static NAUTICAL_ZENITH = 102;\n /** Sun's zenith at astronomical twilight (108&deg;). */\n static ASTRONOMICAL_ZENITH = 108;\n /**\n * The Java Calendar encapsulated by this class to track the current date used by the class\n * @private\n */\n date;\n /**\n * the {@link GeoLocation} used for calculations.\n * @private\n */\n geoLocation;\n /**\n * The getSunrise method Returns a `Date` representing the\n * {@link getElevationAdjustment elevation adjusted} sunrise time. The zenith used\n * for the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus\n * {@link getElevationAdjustment}. This is adjusted\n * to add approximately 50/60 of a degree to account for 34 archminutes of refraction\n * and 16 archminutes for the sun's radius for a total of {@link adjustZenith 90.83333&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} the `Date` representing the exact sunrise time. If the calculation can't be computed such as\n * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it\n * does not set, a null will be returned. See detailed explanation on top of the page.\n * @see adjustZenith\n * @see getSeaLevelSunrise()\n * @see getUTCSunrise\n */\n getSunrise() {\n const sunrise = this.getUTCSunrise0(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunrise))\n return null;\n return this.getDateFromTime(sunrise, true);\n }\n /**\n * A method that returns the sunrise without {@link getElevationAdjustment elevation\n * adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,\n * something that is not affected by elevation. This method returns sunrise calculated at sea level. This forms the\n * base for dawn calculations that are calculated as a dip below the horizon before sunrise.\n *\n * @return {Temporal.ZonedDateTime | null} the `Date` representing the exact sea-level sunrise time. If the calculation can't be computed\n * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, a null will be returned. See detailed explanation on top of the page.\n * @see getSunrise\n * @see getUTCSeaLevelSunrise\n * @see getSeaLevelSunset()\n */\n getSeaLevelSunrise() {\n const sunrise = this.getUTCSeaLevelSunrise(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunrise))\n return null;\n return this.getDateFromTime(sunrise, true);\n }\n /**\n * A method that returns the beginning of civil twilight (dawn) using a zenith of {@link CIVIL_ZENITH 96&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of civil twilight using a zenith of 96&deg;. If the calculation\n * can't be computed, null will be returned. See detailed explanation on top of the page.\n * @see CIVIL_ZENITH\n */\n getBeginCivilTwilight() {\n return this.getSunriseOffsetByDegrees(NOAACalculator.CIVIL_ZENITH);\n }\n /**\n * A method that returns the beginning of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of nautical twilight using a zenith of 102&deg;. If the\n * calculation can't be computed null will be returned. See detailed explanation on top of the page.\n * @see NAUTICAL_ZENITH\n */\n getBeginNauticalTwilight() {\n return this.getSunriseOffsetByDegrees(NOAACalculator.NAUTICAL_ZENITH);\n }\n /**\n * A method that returns the beginning of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH\n * 108&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the beginning of astronomical twilight using a zenith of 108&deg;. If the\n * calculation can't be computed, null will be returned. See detailed explanation on top of the page.\n * @see ASTRONOMICAL_ZENITH\n */\n getBeginAstronomicalTwilight() {\n return this.getSunriseOffsetByDegrees(NOAACalculator.ASTRONOMICAL_ZENITH);\n }\n /**\n * The getSunset method Returns a `Date` representing the\n * {@link getElevationAdjustment elevation adjusted} sunset time. The zenith used for\n * the calculation uses {@link GEOMETRIC_ZENITH geometric zenith} of 90&deg; plus\n * {@link getElevationAdjustment}. This is adjusted\n * to add approximately 50/60 of a degree to account for 34 archminutes of refraction\n * and 16 archminutes for the sun's radius for a total of {@link adjustZenith 90.83333&deg;}.\n * Note:\n * In certain cases the calculates sunset will occur before sunrise. This will typically happen when a timezone\n * other than the local timezone is used (calculating Los Angeles sunset using a GMT timezone for example). In this\n * case the sunset date will be incremented to the following date.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` representing the exact sunset time. If the calculation can't be computed such as in\n * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it\n * does not set, a null will be returned. See detailed explanation on top of the page.\n * @see adjustZenith\n * @see getSeaLevelSunset()\n * @see getUTCSunset\n */\n getSunset() {\n const sunset = this.getUTCSunset0(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunset))\n return null;\n return this.getDateFromTime(sunset, false);\n }\n /**\n * A method that returns the sunset without {@link getElevationAdjustment elevation\n * adjustment}. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible light,\n * something that is not affected by elevation. This method returns sunset calculated at sea level. This forms the\n * base for dusk calculations that are calculated as a dip below the horizon after sunset.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` representing the exact sea-level sunset time. If the calculation can't be computed\n * such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, a null will be returned. See detailed explanation on top of the page.\n * @see getSunset\n * @see getUTCSeaLevelSunset\n */\n getSeaLevelSunset() {\n const sunset = this.getUTCSeaLevelSunset(NOAACalculator.GEOMETRIC_ZENITH);\n if (isNaN(sunset))\n return null;\n return this.getDateFromTime(sunset, false);\n }\n /**\n * A method that returns the end of civil twilight using a zenith of {@link CIVIL_ZENITH 96&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the end of civil twilight using a zenith of {@link CIVIL_ZENITH 96&deg;}. If\n * the calculation can't be computed, null will be returned. See detailed explanation on top of the page.\n * @see CIVIL_ZENITH\n */\n getEndCivilTwilight() {\n return this.getSunsetOffsetByDegrees(NOAACalculator.CIVIL_ZENITH);\n }\n /**\n * A method that returns the end of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the end of nautical twilight using a zenith of {@link NAUTICAL_ZENITH 102&deg;}\n * . If the calculation can't be computed, null will be returned. See detailed explanation on top of the\n * page.\n * @see NAUTICAL_ZENITH\n */\n getEndNauticalTwilight() {\n return this.getSunsetOffsetByDegrees(NOAACalculator.NAUTICAL_ZENITH);\n }\n /**\n * A method that returns the end of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH 108&deg;}.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` of the end of astronomical twilight using a zenith of {@link ASTRONOMICAL_ZENITH\n * 108&deg;}. If the calculation can't be computed, null will be returned. See detailed explanation on top\n * of the page.\n * @see ASTRONOMICAL_ZENITH\n */\n getEndAstronomicalTwilight() {\n return this.getSunsetOffsetByDegrees(NOAACalculator.ASTRONOMICAL_ZENITH);\n }\n /**\n * A utility method that returns a date offset by the offset time passed in. Please note that the level of light\n * during twilight is not affected by elevation, so if this is being used to calculate an offset before sunrise or\n * after sunset with the intent of getting a rough \"level of light\" calculation, the sunrise or sunset time passed\n * to this method should be sea level sunrise and sunset.\n *\n * @param {Temporal.ZonedDateTime | null} time\n * the start time\n * @param {number} offset\n * the offset in milliseconds to add to the time.\n * @return {Temporal.ZonedDateTime | null} the `Date` with the offset in milliseconds added to it\n */\n static getTimeOffset(time, offset) {\n if (time === null || isNaN(offset)) {\n return null;\n }\n return time.add({ milliseconds: offset });\n }\n /**\n * A utility method that returns the time of an offset by degrees below or above the horizon of\n * {@link getSunrise() sunrise}. Note that the degree offset is from the vertical, so for a calculation of 14&deg;\n * before sunrise, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.\n *\n * @param {number} offsetZenith\n * the degrees before {@link getSunrise} to use in the calculation. For time after sunrise use\n * negative numbers. Note that the degree offset is from the vertical, so for a calculation of 14&deg;\n * before sunrise, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a\n * parameter.\n * @return {Temporal.ZonedDateTime | null} The `Date` of the offset after (or before) {@link getSunrise}. If the calculation\n * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise, and one where it does not set, a null will be returned. See detailed explanation on top of the\n * page.\n */\n getSunriseOffsetByDegrees(offsetZenith) {\n const dawn = this.getUTCSunrise0(offsetZenith);\n if (isNaN(dawn))\n return null;\n return this.getDateFromTime(dawn, true);\n }\n /**\n * A utility method that returns the time of an offset by degrees below or above the horizon of {@link getSunset()\n * sunset}. Note that the degree offset is from the vertical, so for a calculation of 14&deg; after sunset, an\n * offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.\n *\n * @param {number} offsetZenith\n * the degrees after {@link getSunset} to use in the calculation. For time before sunset use negative\n * numbers. Note that the degree offset is from the vertical, so for a calculation of 14&deg; after\n * sunset, an offset of 14 + {@link GEOMETRIC_ZENITH} = 104 would have to be passed as a parameter.\n * @return {Temporal.ZonedDateTime | null} The `Date`of the offset after (or before) {@link getSunset}. If the calculation can't\n * be computed such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise, and one where it does not set, a null will be returned. See detailed explanation on top of the\n * page.\n */\n getSunsetOffsetByDegrees(offsetZenith) {\n const sunset = this.getUTCSunset0(offsetZenith);\n if (isNaN(sunset))\n return null;\n return this.getDateFromTime(sunset, false);\n }\n /**\n * A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using\n * daylight savings time.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time after sunrise use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n */\n getUTCSunrise0(zenith) {\n return this.getUTCSunrise(this.getAdjustedDate(), this.geoLocation, zenith, true);\n }\n /**\n * A method that returns the sunrise in UTC time without correction for time zone offset from GMT and without using\n * daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the amount of visible\n * light, something that is not affected by elevation. This method returns UTC sunrise calculated at sea level. This\n * forms the base for dawn calculations that are calculated as a dip below the horizon before sunrise.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time after sunrise use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n * @see getUTCSunrise\n * @see getUTCSeaLevelSunset\n */\n getUTCSeaLevelSunrise(zenith) {\n return this.getUTCSunrise(this.getAdjustedDate(), this.geoLocation, zenith, false);\n }\n /**\n * A method that returns the sunset in UTC time without correction for time zone offset from GMT and without using\n * daylight savings time.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time after sunset use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n * @see getUTCSeaLevelSunset\n */\n getUTCSunset0(zenith) {\n return this.getUTCSunset(this.getAdjustedDate(), this.geoLocation, zenith, true);\n }\n /**\n * A method that returns the sunset in UTC time without correction for elevation, time zone offset from GMT and\n * without using daylight savings time. Non-sunrise and sunset calculations such as dawn and dusk, depend on the\n * amount of visible light, something that is not affected by elevation. This method returns UTC sunset calculated\n * at sea level. This forms the base for dusk calculations that are calculated as a dip below the horizon after\n * sunset.\n *\n * @param {number} zenith\n * the degrees below the horizon. For time before sunset use negative numbers.\n * @return {number} The time in the format: 18.75 for 18:45:00 UTC/GMT. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, `NaN` will be returned. See detailed explanation on top of the page.\n * @see getUTCSunset\n * @see getUTCSeaLevelSunrise\n */\n getUTCSeaLevelSunset(zenith) {\n return this.getUTCSunset(this.getAdjustedDate(), this.geoLocation, zenith, false);\n }\n /**\n * Adjusts the <code>Calendar</code> to deal with edge cases where the location crosses the antimeridian.\n * @private\n * @see GeoLocation#getAntimeridianAdjustment()\n * @return the adjusted Calendar\n */\n getAdjustedDate() {\n return this.date;\n }\n /**\n * Method to return the adjustment to the zenith required to account for the elevation. Since a person at a higher\n * elevation can see farther below the horizon, the calculation for sunrise / sunset is calculated below the horizon\n * used at sea level. This is only used for sunrise and sunset and not times before or after it such as\n * {@link getBeginNauticalTwilight() nautical twilight} since those\n * calculations are based on the level of available light at the given dip below the horizon, something that is not\n * affected by elevation, the adjustment should only made if the zenith == 90&deg; {@link adjustZenith adjusted}\n * for refraction and solar radius. The algorithm used is\n *\n * <pre>\n * elevationAdjustment = Math.toDegrees(Math.acos(earthRadiusInMeters / (earthRadiusInMeters + elevationMeters)));\n * </pre>\n *\n * The source of this algorithm is <a href=\"http://www.calendarists.com\">Calendrical Calculations</a> by Edward M.\n * Reingold and Nachum Dershowitz. An alternate algorithm that produces an almost identical (but not accurate)\n * result found in Ma'aglay Tzedek by Moishe Kosower and other sources is:\n *\n * <pre>\n * elevationAdjustment = 0.0347 * Math.sqrt(elevationMeters);\n * </pre>\n *\n * @param {number} elevation\n * elevation in Meters.\n * @return {number} the adjusted zenith\n */\n getElevationAdjustment(elevation) {\n // double elevationAdjustment = 0.0347 * Math.sqrt(elevation);\n const elevationAdjustment = radiansToDegrees(Math.acos(earthRadius / (earthRadius + elevation / 1000)));\n return elevationAdjustment;\n }\n /**\n * Adjusts the zenith of astronomical sunrise and sunset to account for solar refraction, solar radius and\n * elevation. The value for Sun's zenith and true rise/set Zenith (used in this class and subclasses) is the angle\n * that the center of the Sun makes to a line perpendicular to the Earth's surface. If the Sun were a point and the\n * Earth were without an atmosphere, true sunset and sunrise would correspond to a 90&deg; zenith. Because the Sun\n * is not a point, and because the atmosphere refracts light, this 90&deg; zenith does not, in fact, correspond to\n * true sunset or sunrise, instead the centre of the Sun's disk must lie just below the horizon for the upper edge\n * to be obscured. This means that a zenith of just above 90&deg; must be used. The Sun subtends an angle of 16\n * minutes of arc, and atmospheric refraction\n * accounts for 34 minutes or so, giving a total\n * of 50 arcminutes. The total value for ZENITH is 90+(5/6) or 90.8333333&deg; for true sunrise/sunset. Since a\n * person at an elevation can see blow the horizon of a person at sea level, this will also adjust the zenith to\n * account for elevation if available. Note that this will only adjust the value if the zenith is exactly 90 degrees.\n * For values below and above this no correction is done. As an example, astronomical twilight is when the sun is\n * 18&deg; below the horizon or {@link ASTRONOMICAL_ZENITH 108&deg;\n * below the zenith}. This is traditionally calculated with none of the above mentioned adjustments. The same goes\n * for various <em>tzais</em> and <em>alos</em> times such as the\n * {@link ZmanimCalendar#ZENITH_16_POINT_1 16.1&deg;} dip used in\n * {@link ComplexZmanimCalendar#getAlos16Point1Degrees}.\n *\n * @param {number} zenith\n * the azimuth below the vertical zenith of 90&deg;. For sunset typically the {@link adjustZenith\n * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link adjustZenith adjusts}\n * this slightly to account for solar refraction and the sun's radius. Another example would be\n * {@link getEndNauticalTwilight} that passes\n * {@link NAUTICAL_ZENITH} to this method.\n * @param {number} elevation\n * elevation in Meters.\n * @return {number} The zenith adjusted to include the sun's radius, refracton\n * and {@link getElevationAdjustment elevation} adjustment. This will only be adjusted for\n * sunrise and sunset (if the zenith == 90&deg;)\n * @see getElevationAdjustment\n */\n adjustZenith(zenith, elevation) {\n let adjustedZenith = zenith;\n if (zenith === NOAACalculator.GEOMETRIC_ZENITH) {\n // only adjust if it is exactly sunrise or sunset\n adjustedZenith =\n zenith +\n (solarRadius + refraction + this.getElevationAdjustment(elevation));\n }\n return adjustedZenith;\n }\n /**\n * The <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a> of January 1, 2000\n * @private\n */\n static JULIAN_DAY_JAN_1_2000 = 2451545;\n /**\n * Julian days per century\n * @private\n */\n static JULIAN_DAYS_PER_CENTURY = 36525;\n /**\n * A method that calculates UTC sunrise as well as any time based on an angle above or below sunrise.\n * @param date\n * Used to calculate day of year.\n * @param geoLocation\n * The location information used for astronomical calculating sun times.\n * @param zenith\n * the azimuth below the vertical zenith of 90 degrees. for sunrise typically the {@link adjustZenith\n * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link adjustZenith adjusts}\n * this slightly to account for solar refraction and the sun's radius. Another example would be\n * {@link getBeginNauticalTwilight} that passes\n * {@link NAUTICAL_ZENITH} to this method.\n * @param adjustForElevation\n * Should the time be adjusted for elevation\n * @return The UTC time of sunrise in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in\n * the calculation (expected behavior for some locations such as near the poles,\n * `NaN` will be returned.\n */\n getUTCSunrise(date, geoLocation, zenith, adjustForElevation) {\n const elevation = adjustForElevation\n ? geoLocation.getElevation()\n : 0;\n const adjustedZenith = this.adjustZenith(zenith, elevation);\n let sunrise = NOAACalculator.getSunriseUTC(NOAACalculator.getJulianDay(date), geoLocation.getLatitude(), -geoLocation.getLongitude(), adjustedZenith);\n sunrise = sunrise / 60;\n // ensure that the time is >= 0 and < 24\n while (sunrise < 0) {\n sunrise += 24;\n }\n while (sunrise >= 24) {\n sunrise -= 24;\n }\n return sunrise;\n }\n /**\n * A method that calculates UTC sunset as well as any time based on an angle above or below sunset.\n * @param date\n * Used to calculate day of year.\n * @param geoLocation\n * The location information used for astronomical calculating sun times.\n * @param zenith\n * the azimuth below the vertical zenith of 90&deg;. For sunset typically the {@link adjustZenith\n * zenith} used for the calculation uses geometric zenith of 90&deg; and {@link adjustZenith adjusts}\n * this slightly to account for solar refraction and the sun's radius. Another example would be\n * {@link getEndNauticalTwilight} that passes\n * {@link NAUTICAL_ZENITH} to this method.\n * @param adjustForElevation\n * Should the time be adjusted for elevation\n * @return The UTC time of sunset in 24 hour format. 5:45:00 AM will return 5.75.0. If an error was encountered in\n * the calculation (expected behavior for some locations such as near the poles,\n * `NaN` will be returned.\n */\n getUTCSunset(date, geoLocation, zenith, adjustForElevation) {\n const elevation = adjustForElevation\n ? geoLocation.getElevation()\n : 0;\n const adjustedZenith = this.adjustZenith(zenith, elevation);\n let sunset = NOAACalculator.getSunsetUTC(NOAACalculator.getJulianDay(date), geoLocation.getLatitude(), -geoLocation.getLongitude(), adjustedZenith);\n sunset = sunset / 60;\n // ensure that the time is >= 0 and < 24\n while (sunset < 0) {\n sunset += 24;\n }\n while (sunset >= 24) {\n sunset -= 24;\n }\n return sunset;\n }\n /**\n * A utility method that will allow the calculation of a temporal (solar) hour based on the sunrise and sunset\n * passed as parameters to this method. An example of the use of this method would be the calculation of a\n * non-elevation adjusted temporal hour by passing in {@link getSeaLevelSunrise() sea level sunrise} and\n * {@link getSeaLevelSunset() sea level sunset} as parameters.\n *\n * @param {Temporal.ZonedDateTime | null} startOfDay\n * The start of the day.\n * @param {Temporal.ZonedDateTime | null} endOfDay\n * The end of the day.\n *\n * @return {number} the <code>long</code> millisecond length of the temporal hour. If the calculation can't be computed a\n * `NaN` will be returned. See detailed explanation on top of the page.\n *\n * @see getTemporalHour()\n */\n getTemporalHour(startOfDay = this.getSeaLevelSunrise(), endOfDay = this.getSeaLevelSunset()) {\n if (startOfDay === null || endOfDay === null) {\n return NaN;\n }\n const delta = endOfDay.epochMilliseconds - startOfDay.epochMilliseconds;\n return Math.floor(delta / 12);\n }\n /**\n * A method that returns sundial or solar noon. It occurs when the Sun is <a href\n * =\"http://en.wikipedia.org/wiki/Transit_%28astronomy%29\">transiting</a> the <a\n * href=\"http://en.wikipedia.org/wiki/Meridian_%28astronomy%29\">celestial meridian</a>. In this class it is\n * calculated as halfway between the sunrise and sunset passed to this method. This time can be slightly off the\n * real transit time due to changes in declination (the lengthening or shortening day).\n *\n * @param {Temporal.ZonedDateTime | null} startOfDay\n * the start of day for calculating the sun's transit. This can be sea level sunrise, visual sunrise (or\n * any arbitrary start of day) passed to this method.\n * @param {Temporal.ZonedDateTime | null} endOfDay\n * the end of day for calculating the sun's transit. This can be sea level sunset, visual sunset (or any\n * arbitrary end of day) passed to this method.\n *\n * @return {Temporal.ZonedDateTime | null} The `Date` representing Sun's transit. If the calculation can't be computed such as in the\n * Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does\n * not set, null will be returned. See detailed explanation on top of the page.\n */\n getSunTransit(startOfDay = this.getSeaLevelSunrise(), endOfDay = this.getSeaLevelSunset()) {\n const temporalHour = this.getTemporalHour(startOfDay, endOfDay);\n return NOAACalculator.getTimeOffset(startOfDay, temporalHour * 6);\n }\n /**\n * A method that returns a `Date` from the time passed in as a parameter.\n * @protected\n * @param {number} time\n * The time to be set as the time for the `Date`. The time expected is in the format: 18.75\n * for 6:45:00 PM.\n * @param {boolean} isSunrise true if the time is sunrise, and false if it is sunset\n * @return {Temporal.ZonedDateTime | null} The Date.\n */\n getDateFromTime(time, isSunrise) {\n const epochMillis = this.getEpochMillisFromTime(time, isSunrise);\n if (isNaN(epochMillis)) {\n return null;\n }\n return Temporal.Instant.fromEpochMilliseconds(epochMillis).toZonedDateTimeISO(this.geoLocation.getTimeZone());\n }\n /**\n * The instant that {@link getDateFromTime} describes, as milliseconds since\n * the epoch, without building a `Temporal.ZonedDateTime`.\n *\n * Constructing a `ZonedDateTime` costs roughly 750ns because the IANA zone\n * has to be resolved, and that dominates this calculation. Callers that only\n * want an instant — a `Date`, or the difference between two times — can skip\n * it. Deriving the instant arithmetically also avoids a `PlainTime`\n * allocation and turns the day rollover into a subtraction rather than a\n * ~610ns `PlainDate.add({days})`.\n *\n * @param {number} time\n * The time in the format 18.75 for 6:45:00 PM, as returned by\n * {@link getUTCSunrise} / {@link getUTCSunset}, i.e. already\n * normalized to `[0, 24)`.\n * @param {boolean} isSunrise true if the time is sunrise, and false if it is sunset\n * @return {number} milliseconds since the epoch, or `NaN` if `time` is `NaN`\n */\n getEpochMillisFromTime(time, isSunrise) {\n if (isNaN(time)) {\n return NaN;\n }\n let calculatedTime = time;\n const cal = this.getAdjustedDate();\n const hours = Math.trunc(calculatedTime); // retain only the hours\n calculatedTime -= hours;\n const minutes = Math.trunc((calculatedTime *= 60)); // retain only the minutes\n calculatedTime -= minutes;\n const seconds = Math.trunc((calculatedTime *= 60)); // retain only the seconds\n calculatedTime -= seconds; // remaining milliseconds\n // Check if a date transition has occurred, or is about to occur - this indicates the date of the event is\n // actually not the target date, but the day prior or after\n const localTimeHours = Math.trunc(this.geoLocation.getLongitude() / 15);\n let dayOffset = 0;\n if (isSunrise && localTimeHours + hours > 18) {\n dayOffset = -1;\n }\n else if (!isSunrise && localTimeHours + hours < 6) {\n dayOffset = 1;\n }\n const year = cal.year;\n let millis = Date.UTC(year, cal.month - 1, cal.day, hours, minutes, seconds, Math.trunc(calculatedTime * 1000));\n if (year >= 0 && year < 100) {\n // Date.UTC() maps years 0-99 onto 1900-1999; setUTCFullYear() does not.\n // Worth the branch (about 3ns): @hebcal/core computes candle-lighting\n // times for early historical years rather than suppressing them.\n const d = new Date(millis);\n d.setUTCFullYear(year);\n millis = d.getTime();\n }\n return millis + dayOffset * 86400000;\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a> from a Java Calendar\n * @private\n * @param {Temporal.ZonedDateTime} date\n * The Java Calendar\n * @return the Julian day corresponding to the date Note: Number is returned for start of day. Fractional days\n * should be added later.\n */\n static getJulianDay(date) {\n let { year, month } = date;\n const { day } = date;\n if (month <= 2) {\n year -= 1;\n month += 12;\n }\n const a = Math.trunc(year / 100);\n const b = Math.trunc(2 - a + a / 4);\n return (Math.floor(365.25 * (year + 4716)) +\n Math.floor(30.6001 * (month + 1)) +\n day +\n b -\n 1524.5);\n }\n /**\n * Convert <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a> to centuries since J2000.0.\n * @private\n * @param julianDay\n * the Julian Day to convert\n * @return the centuries since 2000 Julian corresponding to the Julian Day\n */\n static getJulianCenturiesFromJulianDay(julianDay) {\n return ((julianDay - NOAACalculator.JULIAN_DAY_JAN_1_2000) /\n NOAACalculator.JULIAN_DAYS_PER_CENTURY);\n }\n /**\n * Convert centuries since J2000.0 to <a href=\"http://en.wikipedia.org/wiki/Julian_day\">Julian day</a>.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the Julian Day corresponding to the Julian centuries passed in\n */\n static getJulianDayFromJulianCenturies(julianCenturies) {\n return (julianCenturies * NOAACalculator.JULIAN_DAYS_PER_CENTURY +\n NOAACalculator.JULIAN_DAY_JAN_1_2000);\n }\n /**\n * Returns the Geometric <a href=\"http://en.wikipedia.org/wiki/Mean_longitude\">Mean Longitude</a> of the Sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the Geometric Mean Longitude of the Sun in degrees\n */\n static getSunGeometricMeanLongitude(julianCenturies) {\n let longitude = 280.46646 + julianCenturies * (36000.76983 + 0.0003032 * julianCenturies);\n while (longitude > 360) {\n longitude -= 360;\n }\n while (longitude < 0) {\n longitude += 360;\n }\n return longitude; // in degrees\n }\n /**\n * Returns the Geometric <a href=\"http://en.wikipedia.org/wiki/Mean_anomaly\">Mean Anomaly</a> of the Sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the Geometric Mean Anomaly of the Sun in degrees\n */\n static getSunGeometricMeanAnomaly(julianCenturies) {\n return (357.52911 + julianCenturies * (35999.05029 - 0.0001537 * julianCenturies)); // in degrees\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Eccentricity_%28orbit%29\">eccentricity of earth's orbit</a>.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the unitless eccentricity\n */\n static getEarthOrbitEccentricity(julianCenturies) {\n return (0.016708634 -\n julianCenturies * (0.000042037 + 0.0000001267 * julianCenturies)); // unitless\n }\n /**\n * Returns the <a href=\"http://en.wikipedia.org/wiki/Equation_of_the_center\">equation of center</a> for the sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the equation of center for the sun in degrees\n */\n static getSunEquationOfCenter(julianCenturies) {\n const m = NOAACalculator.getSunGeometricMeanAnomaly(julianCenturies);\n const mrad = degreesToRadians(m);\n const sinm = Math.sin(mrad);\n const sin2m = Math.sin(mrad + mrad);\n const sin3m = Math.sin(mrad + mrad + mrad);\n return (sinm *\n (1.914602 - julianCenturies * (0.004817 + 0.000014 * julianCenturies)) +\n sin2m * (0.019993 - 0.000101 * julianCenturies) +\n sin3m * 0.000289); // in degrees\n }\n /**\n * Return the true longitude of the sun\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the sun's true longitude in degrees\n */\n static getSunTrueLongitude(julianCenturies) {\n const sunLongitude = NOAACalculator.getSunGeometricMeanLongitude(julianCenturies);\n const center = NOAACalculator.getSunEquationOfCenter(julianCenturies);\n return sunLongitude + center; // in degrees\n }\n /**\n * Return the apparent longitude of the sun\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return sun's apparent longitude in degrees\n */\n static getSunApparentLongitude(julianCenturies) {\n const sunTrueLongitude = NOAACalculator.getSunTrueLongitude(julianCenturies);\n const omega = 125.04 - 1934.136 * julianCenturies;\n const lambda = sunTrueLongitude - 0.00569 - 0.00478 * Math.sin(degreesToRadians(omega));\n return lambda; // in degrees\n }\n /**\n * Returns the mean <a href=\"http://en.wikipedia.org/wiki/Axial_tilt\">obliquity of the ecliptic</a> (Axial tilt).\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the mean obliquity in degrees\n */\n static getMeanObliquityOfEcliptic(julianCenturies) {\n const seconds = 21.448 -\n julianCenturies *\n (46.815 + julianCenturies * (0.00059 - julianCenturies * 0.001813));\n return 23 + (26 + seconds / 60) / 60; // in degrees\n }\n /**\n * Returns the corrected <a href=\"http://en.wikipedia.org/wiki/Axial_tilt\">obliquity of the ecliptic</a> (Axial\n * tilt).\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return the corrected obliquity in degrees\n */\n static getObliquityCorrection(julianCenturies) {\n const obliquityOfEcliptic = NOAACalculator.getMeanObliquityOfEcliptic(julianCenturies);\n const omega = 125.04 - 1934.136 * julianCenturies;\n return obliquityOfEcliptic + 0.00256 * Math.cos(degreesToRadians(omega)); // in degrees\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Declination\">declination</a> of the sun.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return\n * the sun's declination in degrees\n */\n static getSunDeclination(julianCenturies) {\n const obliquityCorrection = NOAACalculator.getObliquityCorrection(julianCenturies);\n const lambda = NOAACalculator.getSunApparentLongitude(julianCenturies);\n const sint = Math.sin(degreesToRadians(obliquityCorrection)) *\n Math.sin(degreesToRadians(lambda));\n const theta = radiansToDegrees(Math.asin(sint));\n return theta; // in degrees\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Equation_of_time\">Equation of Time</a> - the difference between\n * true solar time and mean solar time\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @return equation of time in minutes of time\n */\n static getEquationOfTime(julianCenturies) {\n const epsilon = NOAACalculator.getObliquityCorrection(julianCenturies);\n const geomMeanLongSun = NOAACalculator.getSunGeometricMeanLongitude(julianCenturies);\n const eccentricityEarthOrbit = NOAACalculator.getEarthOrbitEccentricity(julianCenturies);\n const geomMeanAnomalySun = NOAACalculator.getSunGeometricMeanAnomaly(julianCenturies);\n let y = Math.tan(degreesToRadians(epsilon) / 2);\n y *= y;\n const sin2l0 = Math.sin(2 * degreesToRadians(geomMeanLongSun));\n const sinm = Math.sin(degreesToRadians(geomMeanAnomalySun));\n const cos2l0 = Math.cos(2 * degreesToRadians(geomMeanLongSun));\n const sin4l0 = Math.sin(4 * degreesToRadians(geomMeanLongSun));\n const sin2m = Math.sin(2 * degreesToRadians(geomMeanAnomalySun));\n const equationOfTime = y * sin2l0 -\n 2 * eccentricityEarthOrbit * sinm +\n 4 * eccentricityEarthOrbit * y * sinm * cos2l0 -\n 0.5 * y * y * sin4l0 -\n 1.25 * eccentricityEarthOrbit * eccentricityEarthOrbit * sin2m;\n return radiansToDegrees(equationOfTime) * 4; // in minutes of time\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Hour_angle\">hour angle</a> of the sun at sunrise for the\n * latitude.\n * @private\n * @param {number} lat\n * , the latitude of observer in degrees\n * @param solarDec\n * the declination angle of sun in degrees\n * @param {number} zenith\n * the zenith\n * @return hour angle of sunrise in radians\n */\n static getSunHourAngleAtSunrise(lat, solarDec, zenith) {\n const latRad = degreesToRadians(lat);\n const sdRad = degreesToRadians(solarDec);\n return Math.acos(Math.cos(degreesToRadians(zenith)) /\n (Math.cos(latRad) * Math.cos(sdRad)) -\n Math.tan(latRad) * Math.tan(sdRad)); // in radians\n }\n /**\n * Returns the <a href=\"http://en.wikipedia.org/wiki/Hour_angle\">hour angle</a> of the sun at sunset for the\n * latitude.\n * @private\n * @param {number} lat\n * the latitude of observer in degrees\n * @param solarDec\n * the declination angle of sun in degrees\n * @param {number} zenith\n * the zenith\n * @return the hour angle of sunset in radians\n */\n static getSunHourAngleAtSunset(lat, solarDec, zenith) {\n const latRad = degreesToRadians(lat);\n const sdRad = degreesToRadians(solarDec);\n const hourAngle = Math.acos(Math.cos(degreesToRadians(zenith)) /\n (Math.cos(latRad) * Math.cos(sdRad)) -\n Math.tan(latRad) * Math.tan(sdRad));\n return -hourAngle; // in radians\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Celestial_coordinate_system\">Solar Elevation</a> for the\n * horizontal coordinate system at the given location at the given time. Can be negative if the sun is below the\n * horizon. Not corrected for altitude.\n *\n * @param {Temporal.ZonedDateTime} date\n * time of calculation\n * @param {number} lat\n * latitude of location for calculation\n * @param {number} lon\n * longitude of location for calculation\n * @return {number} solar elevation in degrees - horizon is 0 degrees, civil twilight is -6 degrees\n */\n static getSolarElevation(date, lat, lon) {\n const julianDay = NOAACalculator.getJulianDay(date.toPlainDate());\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n const equationOfTime = NOAACalculator.getEquationOfTime(julianCenturies);\n let longitude = date.hour + 12 + (date.minute + equationOfTime + date.second / 60) / 60;\n longitude = -((longitude * 360) / 24) % 360;\n const hourAngleRad = degreesToRadians(lon - longitude);\n const declination = NOAACalculator.getSunDeclination(julianCenturies);\n const decRad = degreesToRadians(declination);\n const latRad = degreesToRadians(lat);\n return radiansToDegrees(Math.asin(Math.sin(latRad) * Math.sin(decRad) +\n Math.cos(latRad) * Math.cos(decRad) * Math.cos(hourAngleRad)));\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Celestial_coordinate_system\">Solar Azimuth</a> for the\n * horizontal coordinate system at the given location at the given time. Not corrected for altitude. True south is 0\n * degrees.\n *\n * @param {Temporal.ZonedDateTime} date\n * time of calculation\n * @param {number} latitude\n * latitude of location for calculation\n * @param {number} lon\n * longitude of location for calculation\n * @return {number}\n */\n static getSolarAzimuth(date, latitude, lon) {\n const julianDay = NOAACalculator.getJulianDay(date.toPlainDate());\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n const equationOfTime = NOAACalculator.getEquationOfTime(julianCenturies);\n let longitude = date.hour + 12 + (date.minute + equationOfTime + date.second / 60) / 60;\n longitude = -((longitude * 360) / 24) % 360;\n const hourAngleRad = degreesToRadians(lon - longitude);\n const declination = NOAACalculator.getSunDeclination(julianCenturies);\n const decRad = degreesToRadians(declination);\n const latRad = degreesToRadians(latitude);\n return (radiansToDegrees(Math.atan(Math.sin(hourAngleRad) /\n (Math.cos(hourAngleRad) * Math.sin(latRad) -\n Math.tan(decRad) * Math.cos(latRad)))) + 180);\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Universal_Coordinated_Time\">Universal Coordinated Time</a> (UTC)\n * of sunrise for the given day at the given location on earth\n * @private\n * @param julianDay\n * the Julian day\n * @param {number} latitude\n * the latitude of observer in degrees\n * @param {number} longitude\n * the longitude of observer in degrees\n * @param {number} zenith\n * the zenith\n * @return the time in minutes from zero UTC\n */\n static getSunriseUTC(julianDay, latitude, longitude, zenith) {\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n // Find the time of solar noon at the location, and use that declination. This is better than start of the\n // Julian day\n const noonmin = NOAACalculator.getSolarNoonUTC(julianCenturies, longitude);\n const tnoon = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay + noonmin / 1440);\n // First pass to approximate sunrise (using solar noon)\n let eqTime = NOAACalculator.getEquationOfTime(tnoon);\n let solarDec = NOAACalculator.getSunDeclination(tnoon);\n let hourAngle = NOAACalculator.getSunHourAngleAtSunrise(latitude, solarDec, zenith);\n let delta = longitude - radiansToDegrees(hourAngle);\n let timeDiff = 4 * delta; // in minutes of time\n let timeUTC = 720 + timeDiff - eqTime; // in minutes\n // Second pass includes fractional Julian Day in gamma calc\n const newt = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) +\n timeUTC / 1440);\n eqTime = NOAACalculator.getEquationOfTime(newt);\n solarDec = NOAACalculator.getSunDeclination(newt);\n hourAngle = NOAACalculator.getSunHourAngleAtSunrise(latitude, solarDec, zenith);\n delta = longitude - radiansToDegrees(hourAngle);\n timeDiff = 4 * delta;\n timeUTC = 720 + timeDiff - eqTime; // in minutes\n return timeUTC;\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Universal_Coordinated_Time\">Universal Coordinated Time</a> (UTC)\n * of <a href=\"http://en.wikipedia.org/wiki/Noon#Solar_noon\">solar noon</a> for the given day at the given location\n * on earth.\n * @private\n * @param julianCenturies\n * the number of Julian centuries since J2000.0\n * @param {number} longitude\n * the longitude of observer in degrees\n * @return the time in minutes from zero UTC\n */\n static getSolarNoonUTC(julianCenturies, longitude) {\n // First pass uses approximate solar noon to calculate eqtime\n const tnoon = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) +\n longitude / 360);\n let eqTime = NOAACalculator.getEquationOfTime(tnoon);\n const solNoonUTC = 720 + longitude * 4 - eqTime; // min\n const newt = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) -\n 0.5 +\n solNoonUTC / 1440);\n eqTime = NOAACalculator.getEquationOfTime(newt);\n return 720 + longitude * 4 - eqTime; // min\n }\n /**\n * Return the <a href=\"http://en.wikipedia.org/wiki/Universal_Coordinated_Time\">Universal Coordinated Time</a> (UTC)\n * of sunset for the given day at the given location on earth\n * @private\n * @param julianDay\n * the Julian day\n * @param {number} latitude\n * the latitude of observer in degrees\n * @param {number} longitude\n * : longitude of observer in degrees\n * @param {number} zenith\n * the zenith\n * @return the time in minutes from zero Universal Coordinated Time (UTC)\n */\n static getSunsetUTC(julianDay, latitude, longitude, zenith) {\n const julianCenturies = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay);\n // Find the time of solar noon at the location, and use that declination. This is better than start of the\n // Julian day\n const noonmin = NOAACalculator.getSolarNoonUTC(julianCenturies, longitude);\n const tnoon = NOAACalculator.getJulianCenturiesFromJulianDay(julianDay + noonmin / 1440);\n // First calculates sunrise and approx length of day\n let eqTime = NOAACalculator.getEquationOfTime(tnoon);\n let solarDec = NOAACalculator.getSunDeclination(tnoon);\n let hourAngle = NOAACalculator.getSunHourAngleAtSunset(latitude, solarDec, zenith);\n let delta = longitude - radiansToDegrees(hourAngle);\n let timeDiff = 4 * delta;\n let timeUTC = 720 + timeDiff - eqTime;\n // Second pass includes fractional Julian Day in gamma calc\n const newt = NOAACalculator.getJulianCenturiesFromJulianDay(NOAACalculator.getJulianDayFromJulianCenturies(julianCenturies) +\n timeUTC / 1440);\n eqTime = NOAACalculator.getEquationOfTime(newt);\n solarDec = NOAACalculator.getSunDeclination(newt);\n hourAngle = NOAACalculator.getSunHourAngleAtSunset(latitude, solarDec, zenith);\n delta = longitude - radiansToDegrees(hourAngle);\n timeDiff = 4 * delta;\n timeUTC = 720 + timeDiff - eqTime; // in minutes\n return timeUTC;\n }\n}\n","import { createPropDescriptors } from \"./chunks/internal.js\";\n\nimport { NativeTemporal } from \"./chunks/root.js\";\n\nimport { Temporal, DateTimeFormat, toTemporalInstant } from \"./chunks/classApi-basic.js\";\n\nfunction installImplementation() {\n Object.defineProperties(globalThis, createPropDescriptors({\n Temporal: Temporal\n })), Object.defineProperties(Intl, createPropDescriptors({\n DateTimeFormat: DateTimeFormat\n })), Object.defineProperties(Date.prototype, createPropDescriptors({\n toTemporalInstant: toTemporalInstant\n }));\n}\n\nfunction install() {\n NativeTemporal || installImplementation();\n}\n\nexport { install, installImplementation };\n","export default\n[\n \"Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27\",\n \"Atlanta|US|33.749|-84.38798|America/New_York|336\",\n \"Austin|US|30.26715|-97.74306|America/Chicago|165\",\n \"Baghdad|IQ|33.34058|44.40088|Asia/Baghdad|41\",\n \"Beer Sheva|IL|31.25181|34.7913|Asia/Jerusalem|285\",\n \"Berlin|DE|52.52437|13.41053|Europe/Berlin|43\",\n \"Baltimore|US|39.29038|-76.61219|America/New_York|35\",\n \"Bogota|CO|4.60971|-74.08175|America/Bogota|2582\",\n \"Boston|US|42.35843|-71.05977|America/New_York|38\",\n \"Budapest|HU|47.49801|19.03991|Europe/Budapest|104\",\n \"Buenos Aires|AR|-34.61315|-58.37723|America/Argentina/Buenos_Aires|31\",\n \"Buffalo|US|42.88645|-78.87837|America/New_York|191\",\n \"Chicago|US|41.85003|-87.65005|America/Chicago|180\",\n \"Cincinnati|US|39.162|-84.45689|America/New_York|267\",\n \"Cleveland|US|41.4995|-81.69541|America/New_York|204\",\n \"Dallas|US|32.78306|-96.80667|America/Chicago|139\",\n \"Denver|US|39.73915|-104.9847|America/Denver|1636\",\n \"Detroit|US|42.33143|-83.04575|America/Detroit|192\",\n \"Eilat|IL|29.55805|34.94821|Asia/Jerusalem|63\",\n \"Gibraltar|GI|36.14474|-5.35257|Europe/Gibraltar|11\",\n \"Haifa|IL|32.81841|34.9885|Asia/Jerusalem|40\",\n \"Hawaii|US|21.30694|-157.85833|Pacific/Honolulu|18\",\n \"Helsinki|FI|60.16952|24.93545|Europe/Helsinki|26\",\n \"Houston|US|29.76328|-95.36327|America/Chicago|30\",\n \"Jerusalem|IL|31.76904|35.21633|Asia/Jerusalem|786\",\n \"Johannesburg|ZA|-26.20227|28.04363|Africa/Johannesburg|1767\",\n \"Kiev|UA|50.45466|30.5238|Europe/Kiev|187\",\n \"La Paz|BO|-16.5|-68.15|America/La_Paz|3782\",\n \"Livingston|US|40.79593|-74.31487|America/New_York|98\",\n \"Las Vegas|US|36.17497|-115.13722|America/Los_Angeles|613\",\n \"London|GB|51.50853|-0.12574|Europe/London|25\",\n \"Los Angeles|US|34.05223|-118.24368|America/Los_Angeles|96\",\n \"Marseilles|FR|43.29695|5.38107|Europe/Paris|28\",\n \"Miami|US|25.77427|-80.19366|America/New_York|25\",\n \"Minneapolis|US|44.97997|-93.26384|America/Chicago|262\",\n \"Melbourne|AU|-37.814|144.96332|Australia/Melbourne|25\",\n \"Mexico City|MX|19.42847|-99.12766|America/Mexico_City|2240\",\n \"Montreal|CA|45.50884|-73.58781|America/Toronto|216\",\n \"Moscow|RU|55.75222|37.61556|Europe/Moscow|144\",\n \"New York|US|40.71427|-74.00597|America/New_York|57\",\n \"Omaha|US|41.25861|-95.93779|America/Chicago|315\",\n \"Ottawa|CA|45.41117|-75.69812|America/Toronto|71\",\n \"Panama City|PA|8.9936|-79.51973|America/Panama|17\",\n \"Paris|FR|48.85341|2.3488|Europe/Paris|42\",\n \"Pawtucket|US|41.87871|-71.38256|America/New_York|0\",\n \"Petach Tikvah|IL|32.08707|34.88747|Asia/Jerusalem|54\",\n \"Philadelphia|US|39.95233|-75.16379|America/New_York|8\",\n \"Phoenix|US|33.44838|-112.07404|America/Phoenix|366\",\n \"Pittsburgh|US|40.44062|-79.99589|America/New_York|239\",\n \"Providence|US|41.82399|-71.41283|America/New_York|0\",\n \"Portland|US|45.52345|-122.67621|America/Los_Angeles|15\",\n \"Saint Louis|US|38.62727|-90.19789|America/Chicago|149\",\n \"Saint Petersburg|RU|59.93863|30.31413|Europe/Moscow|11\",\n \"San Diego|US|32.71533|-117.15726|America/Los_Angeles|20\",\n \"San Francisco|US|37.77493|-122.41942|America/Los_Angeles|28\",\n \"Sao Paulo|BR|-23.5475|-46.63611|America/Sao_Paulo|769\",\n \"Seattle|US|47.60621|-122.33207|America/Los_Angeles|56\",\n \"Sydney|AU|-33.86785|151.20732|Australia/Sydney|58\",\n \"Tel Aviv|IL|32.08088|34.78057|Asia/Jerusalem|15\",\n \"Tiberias|IL|32.79221|35.53124|Asia/Jerusalem|0\",\n \"Toronto|CA|43.70011|-79.4163|America/Toronto|175\",\n \"Vancouver|CA|49.24966|-123.11934|America/Vancouver|70\",\n \"White Plains|US|41.03399|-73.76291|America/New_York|82\",\n \"Washington DC|US|38.89511|-77.03637|America/New_York|6\",\n \"Worcester|US|42.26259|-71.80229|America/New_York|164\"\n]\n","export default class QuickLRU extends Map {\n\t#size = 0;\n\t#cache = new Map();\n\t#oldCache = new Map();\n\t#maxSize;\n\t#maxAge;\n\t#onEviction;\n\n\tconstructor(options = {}) {\n\t\tsuper();\n\n\t\tif (!(options.maxSize && options.maxSize > 0)) {\n\t\t\tthrow new TypeError('`maxSize` must be a number greater than 0');\n\t\t}\n\n\t\tif (typeof options.maxAge === 'number' && options.maxAge === 0) {\n\t\t\tthrow new TypeError('`maxAge` must be a number greater than 0');\n\t\t}\n\n\t\tthis.#maxSize = options.maxSize;\n\t\tthis.#maxAge = options.maxAge || Number.POSITIVE_INFINITY;\n\t\tthis.#onEviction = options.onEviction;\n\t}\n\n\t// For tests.\n\tget __oldCache() {\n\t\treturn this.#oldCache;\n\t}\n\n\t#emitEvictions(cache) {\n\t\tif (typeof this.#onEviction !== 'function') {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const [key, item] of cache) {\n\t\t\tthis.#onEviction(key, item.value);\n\t\t}\n\t}\n\n\t#deleteIfExpired(key, item) {\n\t\tif (typeof item.expiry === 'number' && item.expiry <= Date.now()) {\n\t\t\tif (typeof this.#onEviction === 'function') {\n\t\t\t\tthis.#onEviction(key, item.value);\n\t\t\t}\n\n\t\t\treturn this.delete(key);\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t#getOrDeleteIfExpired(key, item) {\n\t\tconst deleted = this.#deleteIfExpired(key, item);\n\t\tif (deleted === false) {\n\t\t\treturn item.value;\n\t\t}\n\t}\n\n\t#getItemValue(key, item) {\n\t\treturn item.expiry ? this.#getOrDeleteIfExpired(key, item) : item.value;\n\t}\n\n\t#peek(key, cache) {\n\t\tconst item = cache.get(key);\n\t\treturn this.#getItemValue(key, item);\n\t}\n\n\t#set(key, value) {\n\t\tthis.#cache.set(key, value);\n\t\tthis.#size++;\n\n\t\tif (this.#size >= this.#maxSize) {\n\t\t\tthis.#size = 0;\n\t\t\tthis.#emitEvictions(this.#oldCache);\n\t\t\tthis.#oldCache = this.#cache;\n\t\t\tthis.#cache = new Map();\n\t\t}\n\t}\n\n\t#moveToRecent(key, item) {\n\t\tthis.#oldCache.delete(key);\n\t\tthis.#set(key, item);\n\t}\n\n\t* #entriesAscending() {\n\t\tfor (const item of this.#oldCache) {\n\t\t\tconst [key, value] = item;\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\t\tif (deleted === false) {\n\t\t\t\t\tyield item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const item of this.#cache) {\n\t\t\tconst [key, value] = item;\n\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\tif (deleted === false) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\tget(key) {\n\t\tif (this.#cache.has(key)) {\n\t\t\tconst item = this.#cache.get(key);\n\t\t\treturn this.#getItemValue(key, item);\n\t\t}\n\n\t\tif (this.#oldCache.has(key)) {\n\t\t\tconst item = this.#oldCache.get(key);\n\t\t\tif (this.#deleteIfExpired(key, item) === false) {\n\t\t\t\tthis.#moveToRecent(key, item);\n\t\t\t\treturn item.value;\n\t\t\t}\n\t\t}\n\t}\n\n\tset(key, value, {maxAge = this.#maxAge} = {}) {\n\t\tconst expiry = typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY\n\t\t\t? (Date.now() + maxAge)\n\t\t\t: undefined;\n\n\t\tif (this.#cache.has(key)) {\n\t\t\tthis.#cache.set(key, {\n\t\t\t\tvalue,\n\t\t\t\texpiry,\n\t\t\t});\n\t\t} else {\n\t\t\tthis.#set(key, {value, expiry});\n\t\t}\n\n\t\treturn this;\n\t}\n\n\thas(key) {\n\t\tif (this.#cache.has(key)) {\n\t\t\treturn !this.#deleteIfExpired(key, this.#cache.get(key));\n\t\t}\n\n\t\tif (this.#oldCache.has(key)) {\n\t\t\treturn !this.#deleteIfExpired(key, this.#oldCache.get(key));\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tpeek(key) {\n\t\tif (this.#cache.has(key)) {\n\t\t\treturn this.#peek(key, this.#cache);\n\t\t}\n\n\t\tif (this.#oldCache.has(key)) {\n\t\t\treturn this.#peek(key, this.#oldCache);\n\t\t}\n\t}\n\n\texpiresIn(key) {\n\t\tconst item = this.#cache.get(key) ?? this.#oldCache.get(key);\n\t\tif (item) {\n\t\t\treturn item.expiry ? item.expiry - Date.now() : Number.POSITIVE_INFINITY;\n\t\t}\n\t}\n\n\tdelete(key) {\n\t\tconst deleted = this.#cache.delete(key);\n\t\tif (deleted) {\n\t\t\tthis.#size--;\n\t\t}\n\n\t\treturn this.#oldCache.delete(key) || deleted;\n\t}\n\n\tclear() {\n\t\tthis.#cache.clear();\n\t\tthis.#oldCache.clear();\n\t\tthis.#size = 0;\n\t}\n\n\tresize(newSize) {\n\t\tif (!(newSize && newSize > 0)) {\n\t\t\tthrow new TypeError('`maxSize` must be a number greater than 0');\n\t\t}\n\n\t\tconst items = [...this.#entriesAscending()];\n\t\tconst removeCount = items.length - newSize;\n\t\tif (removeCount < 0) {\n\t\t\tthis.#cache = new Map(items);\n\t\t\tthis.#oldCache = new Map();\n\t\t\tthis.#size = items.length;\n\t\t} else {\n\t\t\tif (removeCount > 0) {\n\t\t\t\tthis.#emitEvictions(items.slice(0, removeCount));\n\t\t\t}\n\n\t\t\tthis.#oldCache = new Map(items.slice(removeCount));\n\t\t\tthis.#cache = new Map();\n\t\t\tthis.#size = 0;\n\t\t}\n\n\t\tthis.#maxSize = newSize;\n\t}\n\n\tevict(count = 1) {\n\t\tconst requested = Number(count);\n\t\tif (!requested || requested <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst items = [...this.#entriesAscending()];\n\t\tconst evictCount = Math.trunc(Math.min(requested, Math.max(items.length - 1, 0)));\n\t\tif (evictCount <= 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#emitEvictions(items.slice(0, evictCount));\n\t\tthis.#oldCache = new Map(items.slice(evictCount));\n\t\tthis.#cache = new Map();\n\t\tthis.#size = 0;\n\t}\n\n\t* keys() {\n\t\tfor (const [key] of this) {\n\t\t\tyield key;\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const [, value] of this) {\n\t\t\tyield value;\n\t\t}\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tfor (const item of this.#cache) {\n\t\t\tconst [key, value] = item;\n\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\tif (deleted === false) {\n\t\t\t\tyield [key, value.value];\n\t\t\t}\n\t\t}\n\n\t\tfor (const item of this.#oldCache) {\n\t\t\tconst [key, value] = item;\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\t\tif (deleted === false) {\n\t\t\t\t\tyield [key, value.value];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t* entriesDescending() {\n\t\tlet items = [...this.#cache];\n\t\tfor (let i = items.length - 1; i >= 0; --i) {\n\t\t\tconst item = items[i];\n\t\t\tconst [key, value] = item;\n\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\tif (deleted === false) {\n\t\t\t\tyield [key, value.value];\n\t\t\t}\n\t\t}\n\n\t\titems = [...this.#oldCache];\n\t\tfor (let i = items.length - 1; i >= 0; --i) {\n\t\t\tconst item = items[i];\n\t\t\tconst [key, value] = item;\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\tconst deleted = this.#deleteIfExpired(key, value);\n\t\t\t\tif (deleted === false) {\n\t\t\t\t\tyield [key, value.value];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t* entriesAscending() {\n\t\tfor (const [key, value] of this.#entriesAscending()) {\n\t\t\tyield [key, value.value];\n\t\t}\n\t}\n\n\tget size() {\n\t\tif (!this.#size) {\n\t\t\treturn this.#oldCache.size;\n\t\t}\n\n\t\tlet oldCacheSize = 0;\n\t\tfor (const key of this.#oldCache.keys()) {\n\t\t\tif (!this.#cache.has(key)) {\n\t\t\t\toldCacheSize++;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.min(this.#size + oldCacheSize, this.#maxSize);\n\t}\n\n\tget maxSize() {\n\t\treturn this.#maxSize;\n\t}\n\n\tget maxAge() {\n\t\treturn this.#maxAge;\n\t}\n\n\tentries() {\n\t\treturn this.entriesAscending();\n\t}\n\n\tforEach(callbackFunction, thisArgument = this) {\n\t\tfor (const [key, value] of this.entriesAscending()) {\n\t\t\tcallbackFunction.call(thisArgument, value, key, this);\n\t\t}\n\t}\n\n\tget [Symbol.toStringTag]() {\n\t\treturn 'QuickLRU';\n\t}\n\n\ttoString() {\n\t\treturn `QuickLRU(${this.size}/${this.maxSize})`;\n\t}\n\n\t[Symbol.for('nodejs.util.inspect.custom')]() {\n\t\treturn this.toString();\n\t}\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {GeoLocation} from '@hebcal/noaa';\nimport citiesJson from './cities.json.js';\nimport QuickLRU from 'quick-lru';\n\nconst classicCities = new Map<string, Location>();\n\n// Zip-Codes.com TimeZone IDs\nconst ZIPCODES_TZ_MAP: Record<string, string> = {\n '0': 'UTC',\n '4': 'America/Puerto_Rico', // Atlantic (GMT -04:00)\n '5': 'America/New_York', // Eastern (GMT -05:00)\n '6': 'America/Chicago', // Central (GMT -06:00)\n '7': 'America/Denver', // Mountain (GMT -07:00)\n '8': 'America/Los_Angeles', // Pacific (GMT -08:00)\n '9': 'America/Anchorage', // Alaska (GMT -09:00)\n '10': 'Pacific/Honolulu', // Hawaii-Aleutian Islands (GMT -10:00)\n '11': 'Pacific/Pago_Pago', // American Samoa (GMT -11:00)\n '13': 'Pacific/Funafuti', // Marshall Islands (GMT +12:00)\n '14': 'Pacific/Guam', // Guam (GMT +10:00)\n '15': 'Pacific/Palau', // Palau (GMT +9:00)\n '16': 'Pacific/Chuuk', // Micronesia (GMT +11:00)\n} as const;\n\n/** @private */\nconst timeFormatCache = new QuickLRU<string, Intl.DateTimeFormat>({\n maxSize: 120,\n});\n\n/**\n * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) from cache\n * or makes a new one if needed\n * @private\n */\nfunction getFormatter(tzid: string): Intl.DateTimeFormat {\n const fmt = timeFormatCache.get(tzid);\n if (fmt) return fmt;\n const f = new Intl.DateTimeFormat('en-US', {\n timeZone: tzid,\n hour: 'numeric',\n minute: 'numeric',\n hour12: false,\n });\n timeFormatCache.set(tzid, f);\n return f;\n}\n\nfunction initClassicCities() {\n for (const entry of citiesJson) {\n const [cityName, cc, lat, lng, tzid, elev] = entry.split('|');\n const location = new Location(\n +lat,\n +lng,\n cc === 'IL',\n tzid,\n cityName,\n cc,\n undefined,\n +elev\n );\n Location.addLocation(cityName, location);\n }\n}\n\n/**\n * Class representing a geographic location for use with candle-lighting,\n * havdalah, and zmanim calculations.\n *\n * Extends {@link GeoLocation} from `@hebcal/noaa` with Jewish-calendar\n * specific data: an Israel/Diaspora flag, ISO country code, and an optional\n * geographic identifier. Also provides {@link Location.lookup} for the 65\n * built-in \"classic\" Hebcal cities.\n *\n * @example\n * import {Location} from '@hebcal/core';\n *\n * // Create a location for a custom address\n * const loc = new Location(\n * 41.85003, // latitude\n * -87.65005, // longitude\n * false, // not in Israel\n * 'America/Chicago',\n * 'Chicago, Illinois, USA',\n * 'US'\n * );\n *\n * // Or look up a built-in classic city\n * const tlv = Location.lookup('Tel Aviv');\n */\nexport class Location extends GeoLocation {\n private readonly il: boolean;\n private readonly cc?: string;\n private readonly geoid?: string | number;\n /**\n * First-level administrative division (e.g. a US state or a French\n * region) as an abbreviation, such as `\"CA\"`. Not set by this package;\n * populated by callers that hydrate a `Location` from a geo database.\n */\n admin1?: string;\n /**\n * Full name of the first-level administrative division, such as\n * `\"California\"`. Not set by this package.\n */\n stateName?: string;\n /**\n * Which kind of lookup produced this location: `'zip'` for a US Zip Code\n * or `'geoname'` for a GeoNames city. Not set by this package.\n */\n geo?: 'zip' | 'geoname';\n /** US Zip Code, such as `\"02912\"`. Not set by this package. */\n zip?: string;\n /** Approximate population of the city. Not set by this package. */\n population?: number;\n /** City name in plain ASCII, for sorting or URL generation. Not set by this package. */\n asciiname?: string;\n\n /**\n * Initialize a Location instance\n * @param latitude - Latitude as a decimal, valid range -90 thru +90 (e.g. 41.85003)\n * @param longitude - Longitude as a decimal, valid range -180 thru +180 (e.g. -87.65005)\n * @param il - in Israel (true) or Diaspora (false)\n * @param tzid - Olson timezone ID, e.g. \"America/Chicago\"\n * @param [cityName] - optional descriptive city name\n * @param [countryCode] - ISO 3166 alpha-2 country code (e.g. \"FR\")\n * @param [geoid] - optional string or numeric geographic ID\n * @param [elevation] - in meters (default `0`)\n */\n constructor(\n latitude: number,\n longitude: number,\n il: boolean,\n tzid: string,\n cityName?: string,\n countryCode?: string,\n geoid?: string | number,\n elevation?: number\n ) {\n const lat = typeof latitude === 'number' ? latitude : parseFloat(latitude);\n if (isNaN(lat) || lat < -90 || lat > 90) {\n throw new RangeError(`Latitude ${latitude} out of range [-90,90]`);\n }\n const long = typeof longitude === 'number' ? longitude : parseFloat(longitude);\n if (isNaN(long) || long < -180 || long > 180) {\n throw new RangeError(`Longitude ${longitude} out of range [-180,180]`);\n }\n if (!tzid) {\n throw new RangeError('Invalid timezone');\n }\n const elev = typeof elevation === 'number' && elevation > 0 ? elevation : 0;\n if (cityName && typeof cityName !== 'string') {\n cityName = String(cityName);\n }\n super(cityName || null, lat, long, elev, tzid);\n this.il = Boolean(il);\n this.cc = countryCode;\n if (countryCode === 'IL') {\n this.il = true;\n }\n this.geoid = geoid;\n }\n\n /**\n * Returns `true` if this location is in Israel (uses the Israeli holiday\n * and Torah-reading schedule), `false` for the Diaspora.\n */\n getIsrael(): boolean {\n return this.il;\n }\n\n /**\n * Returns the full descriptive location name passed to the constructor,\n * or `null` if no name was provided.\n *\n * Note that the built-in classic cities are named by city alone, so\n * `getName()` and {@link getShortName} return the same string for them.\n * @example\n * const loc = new Location(41.85003, -87.65005, false,\n * 'America/Chicago', 'Chicago, Illinois, USA', 'US');\n * loc.getName(); // 'Chicago, Illinois, USA'\n * Location.lookup('San Francisco')?.getName(); // 'San Francisco'\n */\n getName(): string | null {\n return this.getLocationName();\n }\n\n /**\n * Returns the location name truncated at the first comma. Useful for\n * compact display where only the city name is desired.\n *\n * Special-cased so that US locations of the form `\"Washington, DC ...\"` or\n * `\"Washington, D.C., ...\"` keep the `DC` / `D.C.` suffix attached.\n * @example\n * const chi = new Location(41.85003, -87.65005, false,\n * 'America/Chicago', 'Chicago, Illinois, USA', 'US');\n * chi.getShortName(); // 'Chicago'\n * const dc = new Location(38.89511, -77.03637, false,\n * 'America/New_York', 'Washington, D.C., USA', 'US');\n * dc.getShortName(); // 'Washington, D.C.'\n */\n getShortName(): string | null {\n const name = this.getLocationName();\n if (!name) return name;\n const comma = name.indexOf(', ');\n if (comma === -1) return name;\n if (this.cc === 'US' && name[comma + 2] === 'D') {\n if (name[comma + 3] === 'C') {\n return name.substring(0, comma + 4);\n }\n if (name[comma + 3] === '.' && name[comma + 4] === 'C') {\n return name.substring(0, comma + 6);\n }\n }\n return name.substring(0, comma);\n }\n\n /**\n * Returns the ISO 3166 alpha-2 country code (e.g. `\"US\"`, `\"IL\"`, `\"FR\"`)\n * passed to the constructor, or `undefined` if none was provided.\n */\n getCountryCode(): string | undefined {\n return this.cc;\n }\n\n /**\n * Returns the Olson timezone identifier (e.g. `\"America/Chicago\"`).\n * Alias for `getTimeZone()` from the parent `GeoLocation` class.\n */\n getTzid(): string {\n return this.getTimeZone();\n }\n\n /**\n * Returns a cached 24-hour `Intl.DateTimeFormat` (e.g. `07:41` or `20:03`)\n * configured for this location's timezone. Formatters are memoized by\n * timezone so repeated calls do not allocate.\n * @example\n * const loc = Location.lookup('Tel Aviv')!;\n * const fmt = loc.getTimeFormatter();\n * fmt.format(new Date()); // e.g. '18:42'\n */\n getTimeFormatter(): Intl.DateTimeFormat {\n return getFormatter(this.getTimeZone());\n }\n\n /**\n * Returns the optional geographic identifier passed to the constructor\n * (typically a GeoNames numeric ID or a US Zip Code string), or\n * `undefined` if none was provided.\n */\n getGeoId(): string | number | undefined {\n return this.geoid;\n }\n\n /**\n * Creates a location object from one of 65 \"classic\" Hebcal city names.\n * The following city names are supported:\n * 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',\n * 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',\n * 'Buenos Aires', 'Buffalo', 'Chicago', 'Cincinnati', 'Cleveland',\n * 'Dallas', 'Denver', 'Detroit', 'Eilat', 'Gibraltar', 'Haifa',\n * 'Hawaii', 'Helsinki', 'Houston', 'Jerusalem', 'Johannesburg',\n * 'Kiev', 'La Paz', 'Livingston', 'Las Vegas', 'London', 'Los Angeles',\n * 'Marseilles', 'Miami', 'Minneapolis', 'Melbourne', 'Mexico City',\n * 'Montreal', 'Moscow', 'New York', 'Omaha', 'Ottawa', 'Panama City',\n * 'Paris', 'Pawtucket', 'Petach Tikvah', 'Philadelphia', 'Phoenix',\n * 'Pittsburgh', 'Providence', 'Portland', 'Saint Louis', 'Saint Petersburg',\n * 'San Diego', 'San Francisco', 'Sao Paulo', 'Seattle', 'Sydney',\n * 'Tel Aviv', 'Tiberias', 'Toronto', 'Vancouver', 'White Plains',\n * 'Washington DC', 'Worcester'\n *\n * Lookups are case-insensitive. Returns `undefined` if the name is not\n * recognized. The list can be extended with {@link Location.addLocation}.\n * @example\n * const loc = Location.lookup('San Francisco');\n * console.log(loc?.getTzid()); // 'America/Los_Angeles'\n * @param name case-insensitive classic city name\n */\n static lookup(name: string): Location | undefined {\n if (classicCities.size === 0) {\n initClassicCities();\n }\n return classicCities.get(name.toLowerCase());\n }\n\n /**\n * Returns a JSON-serialized representation of this Location.\n * Useful for debugging and structured logging.\n */\n toString(): string {\n return JSON.stringify(this);\n }\n\n /**\n * Converts a legacy Hebcal-style timezone (a numeric GMT offset plus a\n * coarse DST region) to a standard IANA/Olson timezone ID.\n *\n * This exists to migrate data from older Hebcal versions that stored\n * timezones as GMT offset + DST scheme rather than as a full tzid.\n * @example\n * Location.legacyTzToTzid(2, 'israel'); // 'Asia/Jerusalem'\n * Location.legacyTzToTzid(0, 'eu'); // 'Europe/London'\n * Location.legacyTzToTzid(0, 'none'); // 'UTC'\n * Location.legacyTzToTzid(-5, 'none'); // 'Etc/GMT-5'\n * @param tz integer, GMT offset in hours\n * @param dst 'none', 'eu', 'usa', or 'israel'\n */\n static legacyTzToTzid(tz: number, dst: string): string | undefined {\n tz = +tz;\n if (dst === 'none') {\n if (tz === 0) {\n return 'UTC';\n }\n const plus = tz > 0 ? '+' : '';\n return `Etc/GMT${plus}${tz}`;\n }\n if (tz === 2 && dst === 'israel') {\n return 'Asia/Jerusalem';\n }\n if (dst === 'eu') {\n switch (tz) {\n case -2:\n return 'Atlantic/Cape_Verde';\n case -1:\n return 'Atlantic/Azores';\n case 0:\n return 'Europe/London';\n case 1:\n return 'Europe/Paris';\n case 2:\n return 'Europe/Athens';\n default:\n break;\n }\n }\n if (dst === 'usa') {\n return ZIPCODES_TZ_MAP[String(tz * -1)];\n }\n return undefined;\n }\n\n /**\n * Converts timezone info from Zip-Codes.com to a standard Olson tzid.\n * @example\n * Location.getUsaTzid('AZ', 7, 'Y') // 'America/Denver'\n * @param state two-letter all-caps US state abbreviation like 'CA'\n * @param tz positive number, 5=America/New_York, 8=America/Los_Angeles\n * @param dst single char 'Y' or 'N'\n */\n static getUsaTzid(state: string, tz: number, dst: string): string {\n tz = +tz;\n if (tz === 10 && state === 'AK') {\n return 'America/Adak';\n }\n if (tz === 7 && state === 'AZ') {\n return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';\n }\n return ZIPCODES_TZ_MAP[tz];\n }\n\n /**\n * Registers a new named location with the built-in `Location.lookup()`\n * registry. Names are stored case-insensitively. Returns `false` if a\n * location with the same (lower-cased) name is already registered, and\n * `true` if successfully added.\n *\n * Use this to extend the built-in set of 65 classic Hebcal cities with\n * your own custom locations.\n * @example\n * const tlv = new Location(32.0853, 34.7818, true,\n * 'Asia/Jerusalem', 'My Office, Tel Aviv', 'IL');\n * Location.addLocation('My Office', tlv); // true\n * Location.lookup('my office')?.getTzid(); // 'Asia/Jerusalem'\n * @param cityName name to register the location under (case insensitive)\n * @param location the `Location` instance to register\n */\n static addLocation(cityName: string, location: Location): boolean {\n const name = cityName.toLowerCase();\n if (classicCities.has(name)) {\n return false;\n }\n classicCities.set(name, location);\n return true;\n }\n}\n","import {CalOptions} from './CalOptions.js';\n\nconst hour12cc: Record<string, number> = {\n US: 1,\n CA: 1,\n BR: 1,\n AU: 1,\n NZ: 1,\n DO: 1,\n PR: 1,\n GR: 1,\n IN: 1,\n KR: 1,\n NP: 1,\n ZA: 1,\n} as const;\n\n/**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {reformatTimeStr, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string') throw new TypeError(`Bad timeStr: ${timeStr}`);\n const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');\n const hour12 = options?.hour12;\n if (hour12 !== undefined && !hour12) {\n return timeStr;\n }\n if (!hour12 && hour12cc[cc] === undefined) {\n return timeStr;\n }\n const hm = timeStr.split(':');\n let hour: string | number = parseInt(hm[0], 10);\n if (hour < 12 && suffix) {\n suffix = suffix.replace('p', 'a').replace('P', 'A');\n if (hour === 0) {\n hour = 12;\n }\n } else if (hour > 12) {\n hour = hour % 12;\n } else if (hour === 0) {\n hour = '00';\n }\n return `${hour}:${hm[1]}${suffix}`;\n}\n","import {HDate, isLeapYear} from '@hebcal/hdate';\n\n/**\n * Represents a molad, the moment when the new moon is \"born\"\n */\nexport type MoladBase = {\n /** Hebrew date */\n readonly hdate: HDate;\n /** hour of day (0-23) */\n readonly hour: number;\n /** minutes past hour (0-59) */\n readonly minutes: number;\n /** parts of a minute (0-17) */\n readonly chalakim: number;\n};\n\n/*\n * Includes code ported from KosherJava, copyright 2004 Eliyahu Hershfeld,\n * released under LGPL 2.1.\n */\n\n/**\n * the Jewish epoch using the RD (Rata Die/Fixed Date or Reingold Dershowitz) day used in Calendrical Calculations.\n * Day 1 is January 1, 0001 of the Gregorian calendar\n */\nconst JEWISH_EPOCH: number = -1373429;\n\n/** The number of _chalakim_ (18) in a minute. */\nconst CHALAKIM_PER_MINUTE: number = 18;\n\n/** The number of _chalakim_ (1080) in an hour. */\nconst CHALAKIM_PER_HOUR: number = 1080;\n\n/** The number of _chalakim_ (25,920) in a 24-hour day. */\nconst CHALAKIM_PER_DAY: number = 25920; // 24 * 1080\n\n/** The number of _chalakim_ in an average Jewish month. A month has 29 days, 12 hours and 793\n * _chalakim_ (44 minutes and 3.3 seconds) for a total of 765,433 _chalakim_ */\nconst CHALAKIM_PER_MONTH: number = 765433; // (29 * 24 + 12) * 1080 + 793\n\n/**\n * Days from the beginning of Sunday till _molad BaHaRaD_. Calculated as 1 day, 5 hours and 204 _chalakim_ =\n * (24 + 5) * 1080 + 204 = 31524\n */\nconst CHALAKIM_MOLAD_TOHU: number = 31524;\n\n/**\n * Converts the NISSAN-based constants used by this class to numeric month starting from\n * TISHREI. This is required for _molad_ calculations.\n */\nfunction getJewishMonthOfYear(year: number, month: number): number {\n const leap: boolean = isLeapYear(year);\n return ((month + (leap ? 6 : 5)) % (leap ? 13 : 12)) + 1;\n}\n\n/**\n * Returns the number of _chalakim_ (parts - 1080 to the hour) from\n * the original hypothetical _Molad Tohu_ to the year and month\n * passed in.\n */\nfunction getChalakimSinceMoladTohu(year: number, month: number): number {\n // Jewish lunar month = 29 days, 12 hours and 793 chalakim\n // chalakim since Molad Tohu BeHaRaD - 1 day, 5 hours and 204 chalakim\n const monthOfYear: number = getJewishMonthOfYear(year, month);\n const monthsElapsed: number =\n 235 * Math.trunc((year - 1) / 19) + // Months in complete 19-year lunar (Metonic) cycles so far\n 12 * ((year - 1) % 19) + // Regular months in this cycle\n Math.trunc((7 * ((year - 1) % 19) + 1) / 19) + // Leap months this cycle\n (monthOfYear - 1); // add elapsed months till the start of the molad of the month\n // return chalakim prior to BeHaRaD + number of chalakim since\n return CHALAKIM_MOLAD_TOHU + CHALAKIM_PER_MONTH * monthsElapsed;\n}\n\n/**\n * Returns the number of days from the Jewish epoch from the number of chalakim from the epoch passed in.\n * @param chalakim the number of _chalakim_ since the beginning of Sunday prior to BaHaRaD\n * @return the number of days from the Jewish epoch\n */\nfunction moladToAbsDate(chalakim: number): number {\n return Math.trunc(chalakim / CHALAKIM_PER_DAY) + JEWISH_EPOCH;\n}\n\n/**\n * Calculates the molad (birth of the new moon) for a Hebrew month using\n * traditional chalakim arithmetic.\n *\n * Returns the raw components — day of week, hour, minutes and chalakim. Use\n * {@link Molad} for a higher-level interface with rendering and Kiddush Levana\n * times.\n * @param year Hebrew year\n * @param month Hebrew month (see `months` from `@hebcal/hdate`)\n * @return the components of the molad for that month\n */\nexport function calculateMolad(year: number, month: number): MoladBase {\n const chalakim = getChalakimSinceMoladTohu(year, month);\n const absDate = moladToAbsDate(chalakim);\n let hd = new HDate(absDate);\n const conjunctionDay: number = Math.trunc(chalakim / CHALAKIM_PER_DAY);\n const conjunctionParts: number = Math.trunc(\n chalakim - conjunctionDay * CHALAKIM_PER_DAY\n );\n\n let adjustedChalakim: number = conjunctionParts;\n let hour = Math.trunc(adjustedChalakim / CHALAKIM_PER_HOUR);\n adjustedChalakim = adjustedChalakim - hour * CHALAKIM_PER_HOUR;\n const minutes = Math.trunc(adjustedChalakim / CHALAKIM_PER_MINUTE);\n\n if (hour >= 6) {\n hd = hd.next();\n }\n hour = (hour + 18) % 24;\n\n const m: MoladBase = {\n hdate: hd,\n hour,\n minutes,\n chalakim: adjustedChalakim - minutes * CHALAKIM_PER_MINUTE,\n };\n\n return m;\n}\n","import 'temporal-polyfill/global';\nimport {getTimezoneOffset} from '@hebcal/hdate';\nimport {MoladBase} from './moladBase.js';\n\n/** constant for milliseconds in a minute (60,000) */\nconst MINUTE_MILLIS: number = 60 * 1000;\n\n/**\n * A method that will return the location's local mean time offset in milliseconds from local\n * [standard time](https://en.wikipedia.org/wiki/Standard_time). The globe is split into 360°, with\n * 15° per hour of the day. For a locale that is at a longitude that is evenly divisible by 15\n * (longitude % 15 == 0), at solar noon (with adjustment for the\n * [equation of time](https://en.wikipedia.org/wiki/Equation_of_time)) the sun should be directly overhead,\n * so a user who is 1° west of this will have noon at 4 minutes after standard time noon, and conversely, a user\n * who is 1° east of the 15° longitude will have noon at 11:56 AM. Lakewood, N.J., whose longitude is\n * -74.222, is 0.778 away from the closest multiple of 15 at -75°. This is multiplied by 4 to yield 3 minutes\n * and 10 seconds earlier than standard time. The offset returned does not account for the\n * [Daylight saving time](https://en.wikipedia.org/wiki/Daylight_saving_time) offset since this function is\n * unaware of dates.\n *\n * @param dt the date used to resolve the timezone offset\n * @param longitude the location's longitude\n * @param tzid IANA timezone identifier\n * @return the offset in milliseconds not accounting for Daylight saving time. A positive value will be returned\n * East of the 15° timezone line, and a negative value West of it.\n */\nfunction getLocalMeanTimeOffset(dt: Date, longitude: number, tzid: string): number {\n const offset: number = -1 * getTimezoneOffset(tzid, dt);\n const d = longitude * 4 * MINUTE_MILLIS - offset * MINUTE_MILLIS;\n return Math.trunc(d);\n}\n\n/**\n * Returns the moment of the molad as a `Temporal.ZonedDateTime` in the `UTC` zone.\n *\n * The molad is computed in Jerusalem *standard* time and then converted, so the\n * returned instant is correct year-round; only the zone of the returned object\n * is `UTC`. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds)\n * from the computed time — Har Habayis, at longitude 35.2354°, is 5.2354° away\n * from the multiple-of-15 timezone longitude — to get to standard time. Daylight\n * savings time is intentionally not applied; adjust when formatting for display.\n *\n * @param molad the molad to convert\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad\n */\nexport function getMoladAsDate(molad: MoladBase): Temporal.ZonedDateTime {\n const moladSeconds: number = (molad.chalakim * 10) / 3;\n const millis: number = Math.trunc(\n 1000 * (moladSeconds - Math.trunc(moladSeconds))\n );\n\n const dt = molad.hdate.greg();\n\n // The raw molad Date (point in time) must be generated using standard time. Using \"Asia/Jerusalem\" timezone will result in the time\n // being incorrectly off by an hour in the summer due to DST. Proper adjustment for the actual time in DST will be done by the date\n // formatter class used to display the Date.\n const tzid: string = 'Etc/GMT+2';\n const zdt = Temporal.ZonedDateTime.from({\n year: dt.getFullYear(),\n month: dt.getMonth() + 1,\n day: dt.getDate(),\n hour: molad.hour,\n minute: molad.minutes,\n second: Math.trunc(moladSeconds),\n millisecond: millis,\n timeZone: tzid,\n });\n\n const longitude: number = 35.2354; // Har Habayis longitude\n const offset = getLocalMeanTimeOffset(dt, longitude, tzid);\n // subtract local time difference of 20.94 minutes (20 minutes and 56.496 seconds) to get to Standard time\n const zdt2 = zdt.subtract({milliseconds: offset});\n return zdt2.withTimeZone('UTC');\n}\n","export function smartApostrophe(str: string): string {\n return str.replaceAll(\"'\", '’');\n}\n\nexport function urlFriendly(str: string): string {\n return str.toLowerCase().replaceAll(\"'\", '').replaceAll(' ', '-');\n}\n","import 'temporal-polyfill/global';\nimport {Event, flags} from './event.js';\nimport {CalOptions} from './CalOptions.js';\nimport {HDate, Locale, pad2} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {MoladBase, calculateMolad} from './moladBase.js';\nimport {getMoladAsDate} from './moladDate.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst enDoW = [\n 'Sunday',\n 'Monday',\n 'Tuesday',\n 'Wednesday',\n 'Thursday',\n 'Friday',\n 'Saturday',\n] as const;\n\nconst heDayNames = [\n 'רִאשׁוֹן',\n 'שֵׁנִי',\n 'שְׁלִישִׁי',\n 'רְבִיעִי',\n 'חֲמִישִׁי',\n 'שִׁישִּׁי',\n 'שַׁבָּת',\n] as const;\n\nconst frDoW = [\n 'Dimanche',\n 'Lundi',\n 'Mardi',\n 'Mercredi',\n 'Jeudi',\n 'Vendredi',\n 'Samedi',\n] as const;\nconst night = 'בַּלַּ֥יְלָה';\n\nfunction getDayNames(locale?: string): readonly string[] {\n if (Locale.isHebrewLocale(locale)) {\n return heDayNames;\n }\n if (locale === 'fr') {\n return frDoW;\n }\n return enDoW;\n}\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n if (hour < 12) return 'בַּבֹּקֶר';\n if (hour < 17) return 'בַּצׇּהֳרַיִים';\n if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a *molad* — the calculated moment when the new moon is \"born\"\n * for a given Hebrew month.\n *\n * The molad is announced in synagogue on Shabbat Mevarchim (the Shabbat\n * before Rosh Chodesh) and is the anchor point for Kiddush Levana zmanim.\n * Calculations use the traditional chalakim arithmetic\n * (1 hour = 1080 chalakim) anchored to *Molad Tohu BaHaRaD*.\n *\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * console.log(m.getMonthName()); // 'Nisan'\n * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // 22 57 7\n * console.log(m.render('en')); // 'Molad Nisan: Monday, 10:57pm and 7 chalakim'\n */\nexport class Molad {\n private readonly m: MoladBase;\n private readonly year: number;\n private readonly month: number;\n private instant?: Temporal.ZonedDateTime;\n\n /**\n * Calculates the molad for a given Hebrew year and month.\n * @param year Hebrew year\n * @param month 1=NISAN, 7=TISHREI (uses Nisan-based numbering)\n */\n constructor(year: number, month: number) {\n this.m = calculateMolad(year, month);\n this.year = year;\n this.month = month;\n }\n /**\n * The exact Hebrew date of the molad, which often falls on the\n * 28th or 30th of the preceeding month, occasionally on the first of the\n * month, and in extremely rare circumstances the 27th of the month.\n * - Molad Shevat 5541 occured on 27 Tevet / 1781-01-24T19:57:20.170Z\n * - Molad Shevat 5788 will occur on 27 Tevet / 2028-01-26T19:07:03.504Z\n * - Molad Nissan 5866 will occur on 27 Adar II / 2106-04-03T21:08:46.837Z\n */\n getMoladDate(): HDate {\n return this.m.hdate;\n }\n /**\n * The year of the molad (as constructed)\n */\n getYear(): number {\n return this.year;\n }\n /**\n * The month (1=NISSAN, 7=TISHREI) as constructed\n */\n getMonth(): number {\n return this.month;\n }\n /**\n * Returns a transliterated string name of the molad's Hebrew month,\n * for example 'Elul' or 'Cheshvan'.\n */\n getMonthName(): string {\n return HDate.getMonthName(this.month, this.year);\n }\n /**\n * @returns Day of Week (0=Sunday, 6=Saturday)\n */\n getDow(): number {\n return this.m.hdate.getDay();\n }\n /**\n * @returns hour of day (0-23)\n */\n getHour(): number {\n return this.m.hour;\n }\n /**\n * @returns minutes past hour (0-59)\n */\n getMinutes(): number {\n return this.m.minutes;\n }\n /**\n * @returns parts of a minute (0-17)\n */\n getChalakim(): number {\n return this.m.chalakim;\n }\n /**\n * Returns the moment of the molad as a `Temporal.ZonedDateTime` in the `UTC` zone.\n *\n * The molad is computed in Jerusalem *standard* time and then converted, so the\n * returned instant is correct year-round; only the zone of the returned object\n * is `UTC`. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds)\n * from the computed time — Har Habayis, at longitude 35.2354°, is 5.2354° away\n * from the multiple-of-15 timezone longitude — to get to standard time. Daylight\n * savings time is intentionally not applied; adjust when formatting for display.\n *\n * The returned value is cached after the first call.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * const zdt = m.getInstant();\n * console.log(zdt.toString()); // '2024-04-08T20:36:26.837+00:00[UTC]'\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad\n */\n getInstant(): Temporal.ZonedDateTime {\n this.instant ??= getMoladAsDate(this.m);\n return this.instant;\n }\n /**\n * Returns the earliest time of _Kiddush Levana_ calculated as 3 days after the molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 3 days after the molad.\n */\n getTchilasZmanKidushLevana3Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 72});\n }\n\n /**\n * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the\n * [Mechaber](https://en.wikipedia.org/wiki/Yosef_Karo). See the\n * [Bach's](https://en.wikipedia.org/wiki/Yoel_Sirkis) opinion on this time. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 7 days after the molad.\n */\n getTchilasZmanKidushLevana7Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n return zdt.add({hours: 168});\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as\n * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and\n * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time\n * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider\n * displaying _alos_ before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment halfway between molad and molad.\n */\n getSofZmanKidushLevanaBetweenMoldos(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // add half the time between molad and molad (half of 29 days, 12 hours and 793 chalakim (44 minutes, 3.3\n // seconds), or 14 days, 18 hours, 22 minutes and 666 milliseconds). Add it as hours, not days, to avoid\n // DST/ST crossover issues.\n return zdt.add({\n hours: 24 * 14 + 18,\n minutes: 22,\n seconds: 1,\n milliseconds: 666,\n });\n }\n\n /**\n * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down\n * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles) who brings down the opinion of the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating\n * {@link Molad.getSofZmanKidushLevanaBetweenMoldos | half way between molad and molad} is of the opinion that Mechaber\n * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid\n * Heber's very detailed writeup in Siman Daled (chapter 4) of\n * [Shaarei Zmanim](https://www.worldcat.org/oclc/461326125). This method returns the time even if it is during\n * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_\n * before this time if the zman is between _alos_ and _tzais_.\n *\n * @return the Temporal.ZonedDateTime representing the moment 15 days after the molad.\n */\n getSofZmanKidushLevana15Days(): Temporal.ZonedDateTime {\n const zdt = this.getInstant();\n // 15 days after the molad. Add it as hours, not days, to avoid DST/ST crossover issues.\n return zdt.add({hours: 24 * 15});\n }\n\n /**\n * Returns a human-readable, localized string announcing the molad —\n * suitable for use on Shabbat Mevarchim. The format includes the Hebrew\n * month name, day of week, hour : minute, and chalakim if non-zero.\n *\n * Time format honors `options.hour12` and `options.location` (12-hour vs.\n * 24-hour); see {@link reformatTimeStr}.\n * @example\n * import {Molad, months} from '@hebcal/core';\n * const m = new Molad(5784, months.NISAN);\n * m.render('en', {hour12: true});\n * // => 'Molad Nisan: Monday, 10:57pm and 7 chalakim'\n * m.render('en', {hour12: false});\n * // => 'Molad Nisan: Monday, 22:57 and 7 chalakim'\n * m.render('he');\n * // => 'מוֹלָד הָלְּבָנָה נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …'\n * @param [locale] Optional locale name (defaults to empty locale)\n * @param options used for time formatting (12-hour vs 24-hour)\n */\n render(locale?: string, options?: CalOptions): string {\n const monthName = Locale.gettext(this.getMonthName(), locale);\n const dayNames = getDayNames(locale);\n const dow = dayNames[this.getDow()];\n const minutes = this.getMinutes();\n const hour = this.getHour();\n const chalakim = this.getChalakim();\n const moladStr = Locale.gettext('Molad', locale);\n const minutesStr = Locale.lookupTranslation('min', locale) ?? 'minutes';\n const chalakimStr = Locale.gettext('chalakim', locale);\n const and = Locale.gettext('and', locale);\n if (Locale.isHebrewLocale(locale)) {\n const ampm = getHebrewTimeOfDay(hour);\n let result =\n `${moladStr} ${monthName} יִהְיֶה בַּיּוֹם ${dow} בשָׁבוּעַ, ` +\n `בְּשָׁעָה ${hour} ${ampm}, ` +\n `ו-${minutes} ${minutesStr}`;\n if (chalakim !== 0) {\n result += ` ו-${chalakim} ${chalakimStr}`;\n }\n if (locale!.toLocaleLowerCase() === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(result);\n }\n return result;\n }\n const fmtTime = reformatTimeStr(`${hour}:${pad2(minutes)}`, 'pm', options);\n const month = smartApostrophe(monthName);\n const result = `${moladStr} ${month}: ${dow}, ${fmtTime}`;\n if (chalakim === 0) {\n return result;\n }\n return result + ` ${and} ${chalakim} ${chalakimStr}`;\n }\n}\n\n/** Represents a Molad announcement on Shabbat Mevarchim */\nexport class MoladEvent extends Event {\n readonly molad: Molad;\n private readonly options: CalOptions;\n /**\n * @param date Hebrew date event occurs\n * @param hyear molad year\n * @param hmonth molad month\n * @param options\n */\n constructor(date: HDate, hyear: number, hmonth: number, options: CalOptions) {\n const m = new Molad(hyear, hmonth);\n const monthName = m.getMonthName();\n super(date, `Molad ${monthName} ${hyear}`, flags.MOLAD);\n this.molad = m;\n this.options = options;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.molad.render(locale, this.options);\n }\n}\n","import 'temporal-polyfill/global';\nimport {GeoLocation, NOAACalculator} from '@hebcal/noaa';\nimport {HDate, getPseudoISO, getTimezoneOffset, isDate, pad2} from '@hebcal/hdate';\nimport {Molad} from './molad.js';\n\n/**\n * Converts an instant to a `Date`, discarding milliseconds.\n *\n * Zmanim are read out to the minute, and every accessor here reduces to an\n * instant, so we ask `@hebcal/noaa` for epoch milliseconds rather than a\n * `Temporal.ZonedDateTime`. Resolving the IANA zone to build a\n * `ZonedDateTime` costs roughly 750ns and nothing downstream uses it, which\n * made it the single most expensive step in a sunrise/sunset calculation.\n * @private\n */\nfunction millisToDate(millis: number): Date {\n const res = new Date(millis);\n res.setMilliseconds(0);\n return res;\n}\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°\n */\nconst GEOMETRIC_ZENITH: number = 90;\n\n/**\n * The zenith of 1.583° below geometric zenith (90°). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).\n *\n * @see Zmanim.sunriseBaalHatanya\n * @see Zmanim.sunsetBaalHatanya\n */\nconst ZENITH_1_POINT_583: number = GEOMETRIC_ZENITH + 1.583;\n\n/**\n * The zenith of civil twilight; the sun is 6° below the horizon.\n * Matches `NOAACalculator.CIVIL_ZENITH`.\n */\nconst CIVIL_ZENITH: number = GEOMETRIC_ZENITH + 6;\n\n/**\n * Length of one temporal (halachic) hour in milliseconds, i.e. one twelfth of\n * the day. Mirrors `NOAACalculator.getTemporalHour()`, including its floor, so\n * that results stay identical to the `ZonedDateTime` code path.\n * @private\n */\nfunction temporalHourMillis(startOfDay: number, endOfDay: number): number {\n return Math.floor((endOfDay - startOfDay) / 12);\n}\n\n/**\n * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.\n * Calculations are available for tzeit / tzais (nightfall),\n * shkiah (sunset) and more.\n *\n * Zmanim are estimated using an algorithm published by the US National Oceanic\n * and Atmospheric Administration. The NOAA solar calculator is based on equations\n * from _Astronomical Algorithms_ by Jean Meeus.\n *\n * The sunrise and sunset results are theoretically accurate to within a minute for\n * locations between +/- 72° latitude, and within 10 minutes outside of those latitudes.\n * However, due to variations in atmospheric composition, temperature, pressure and\n * conditions, observed values may vary from calculations.\n * https://gml.noaa.gov/grad/solcalc/calcdetails.html\n *\n * @example\n * import {GeoLocation, Zmanim} from '@hebcal/core';\n * const latitude = 41.822232;\n * const longitude = -71.448292;\n * const tzid = 'America/New_York';\n * const friday = new Date(2023, 8, 8);\n * const gloc = new GeoLocation(null, latitude, longitude, 0, tzid);\n * const zmanim = new Zmanim(gloc, friday, false);\n * const candleLighting = zmanim.sunsetOffset(-18, true);\n * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);\n * // '2023-09-08T18:49:00-04:00'\n */\nexport class Zmanim {\n private readonly hdate: HDate;\n private readonly plainDate: Temporal.PlainDate;\n private readonly gloc: GeoLocation;\n private readonly noaa: NOAACalculator;\n private useElevation: boolean;\n /**\n * Initialize a Zmanim instance.\n * @param gloc GeoLocation including latitude, longitude, and timezone\n * @param date Regular or Hebrew Date. If `date` is a regular `Date`,\n * hours, minutes, seconds and milliseconds are ignored.\n * @param useElevation use elevation for calculations (default `false`).\n * If `true`, use elevation to affect the calculation of all sunrise/sunset based\n * zmanim. Note: there are some zmanim such as degree-based zmanim that are driven\n * by the amount of light in the sky and are not impacted by elevation.\n * These zmanim intentionally do not support elevation adjustment.\n */\n constructor(gloc: GeoLocation, date: Date | HDate, useElevation: boolean) {\n this.hdate = new HDate(date);\n const dt = isDate(date) ? date : this.hdate.greg();\n // The constructor is ~1.8x cheaper than PlainDate.from(), which has to\n // walk a property bag and apply overflow handling. The fields come from a\n // real Date, so they are always in range and never need constraining.\n this.plainDate = new Temporal.PlainDate(\n dt.getFullYear(),\n dt.getMonth() + 1,\n dt.getDate()\n );\n this.gloc = gloc;\n this.noaa = new NOAACalculator(gloc, this.plainDate);\n this.useElevation = Boolean(useElevation);\n }\n /**\n * Returns `true` if this instance uses the location's elevation when\n * calculating sunrise/sunset-based zmanim.\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for sunrise/sunset-based zmanim.\n *\n * Degree-based zmanim (such as {@link alotHaShachar} or {@link tzeit})\n * estimate the amount of light in the sky and are never affected by this\n * setting.\n * @param useElevation `true` to include the location's elevation\n */\n setUseElevation(useElevation: boolean) {\n this.useElevation = useElevation;\n }\n /**\n * Convenience function to get the time when sun is above or below the horizon\n * for a certain angle (in degrees).\n * This function does not support elevation adjustment.\n * @param angle degrees of solar depression below the horizon; for example\n * `8.5` means the center of the sun is 8.5° below the horizon\n * @param rising `true` for the morning (before sunrise), `false` for the\n * evening (after sunset)\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = GEOMETRIC_ZENITH + angle;\n return millisToDate(\n rising\n ? this.sunriseMillis(offsetZenith, true)\n : this.sunsetMillis(offsetZenith, true)\n );\n }\n /**\n * Sunrise for a given zenith as epoch milliseconds, mirroring what\n * `NOAACalculator.getSunrise()` / `getSeaLevelSunrise()` /\n * `getSunriseOffsetByDegrees()` compute, minus the `ZonedDateTime`.\n *\n * Note that noaa's degree-based accessors pass `adjustForElevation = true`\n * as well; the adjustment is a no-op unless the zenith is exactly\n * {@link GEOMETRIC_ZENITH}, which is why degree-based zmanim are unaffected\n * by elevation.\n * @private\n */\n private sunriseMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunrise0(zenith)\n : this.noaa.getUTCSeaLevelSunrise(zenith);\n return this.noaa.getEpochMillisFromTime(utc, true);\n }\n /**\n * Sunset counterpart of {@link sunriseMillis}.\n * @private\n */\n private sunsetMillis(zenith: number, useElevation: boolean): number {\n const utc = useElevation\n ? this.noaa.getUTCSunset0(zenith)\n : this.noaa.getUTCSeaLevelSunset(zenith);\n return this.noaa.getEpochMillisFromTime(utc, false);\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunrise(): Date {\n return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation));\n }\n /**\n * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).\n * This function does not support elevation adjustment.\n */\n seaLevelSunset(): Date {\n return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, false));\n }\n /**\n * Civil dawn; Sun is 6° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dawn(): Date {\n return millisToDate(this.sunriseMillis(CIVIL_ZENITH, true));\n }\n /**\n * Civil dusk; Sun is 6° below the horizon in the evening.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n dusk(): Date {\n return millisToDate(this.sunsetMillis(CIVIL_ZENITH, true));\n }\n /**\n * Returns sunset for the previous day.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n gregEve(): Date {\n const prev0 = this.plainDate.subtract({days: 1});\n const prev = new Date(prev0.year, prev0.month - 1, prev0.day);\n const zman = new Zmanim(this.gloc, prev, this.useElevation);\n return zman.sunset();\n }\n /**\n * Length in milliseconds of one halachic hour of the night, calculated as\n * one twelfth of the time between the previous day's sunset and this\n * day's sunrise. Used internally by {@link chatzotNight}.\n */\n nightHour(): number {\n return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour\n }\n /**\n * Midday – Chatzot; Sunrise plus 6 halachic hours.\n *\n * Unlike most sunrise/sunset-based zmanim, this is always computed from\n * sea-level sunrise and sunset, so it is not affected by the\n * `useElevation` setting.\n */\n chatzot(): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, false);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, false);\n // NOAACalculator.getSunTransit(): sunrise plus 6 temporal hours\n return millisToDate(startOfDay + temporalHourMillis(startOfDay, endOfDay) * 6);\n }\n /**\n * Midnight – Chatzot; Sunset plus 6 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n chatzotNight(): Date {\n return new Date(this.sunrise().getTime() - this.nightHour() * 6);\n }\n /**\n * Dawn – Alot haShachar; Sun is 16.1° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n alotHaShachar(): Date {\n return this.timeAtAngle(16.1, true);\n }\n /**\n * Dawn – Alot haShachar; calculated as 72 minutes before sunrise or\n * sea level sunrise.\n */\n alotHaShachar72(): Date {\n return this.sunriseOffset(-72, false, false);\n }\n /**\n * Same as {@link alotHaShachar72}, but returns a `Temporal.ZonedDateTime`\n * with seconds precision (instead of a `Date` rounded to the minute), or\n * `null` if sunrise cannot be calculated for this date and location.\n */\n alotHaShachar72zdt(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n if (!zdt) {\n return null;\n }\n return zdt.subtract({minutes: 72});\n }\n\n /**\n * Earliest talis & tefillin – Misheyakir; Sun is 11.5° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakir(): Date {\n return this.timeAtAngle(11.5, true);\n }\n /**\n * Earliest talis & tefillin – Misheyakir Machmir; Sun is 10.2° below the horizon in the morning.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n misheyakirMachmir(): Date {\n return this.timeAtAngle(10.2, true);\n }\n private getShaahZmanisBasedZmanMillis(\n startOfDay: number,\n endOfDay: number,\n hours: number\n ): number {\n const offset = Math.trunc(temporalHourMillis(startOfDay, endOfDay) * hours);\n return startOfDay + offset;\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @param hours number of _shaos zmaniyos_ (solar hours) after sunrise\n */\n private getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation);\n const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation);\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(startOfDay, endOfDay, hours)\n );\n }\n /**\n * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanShma(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(3);\n }\n /**\n * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.\n *\n * This method returns the latest *zman tfila* (time to recite the morning prayers)\n * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n sofZmanTfilla(): Date {\n // Gra\n return this.getShaahZmanisBasedZman(4);\n }\n /**\n * This method returns the latest time for burning _chametz_ on _Erev Pesach_ according to the opinion\n * of the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon). This time is 5 halachic hours into the day, based on\n * the opinion of the GRA that the day is calculated from sunrise to sunset.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n * @return the `Date` of the latest time for burning _chametz_ on _Erev Pesach_. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise and one where it does not set, an `Invalid Date` will be returned.\n */\n sofZmanBiurChametzGRA(): Date {\n return this.getShaahZmanisBasedZman(5);\n }\n /**\n * Returns a 2-element array with alot (a `Date`, 72 minutes before sunrise)\n * and the length in milliseconds of one halachic hour of the resulting day.\n * Used internally by the Magen Avraham zmanim.\n * @param forceSeaLevel ignore the `useElevation` setting and use sea-level\n * sunrise and sunset\n */\n getTemporalHour72(forceSeaLevel: boolean): [Date, number] {\n const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);\n const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);\n const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;\n return [alot72, temporalHour];\n }\n /**\n * Returns a 2-element array with alot (a `Date`, when the sun is `angle`\n * degrees below the horizon in the morning) and the length in milliseconds\n * of one halachic hour of the resulting day. Used internally by the\n * degree-based Magen Avraham zmanim.\n * @param angle degrees of solar depression below the horizon\n */\n getTemporalHourByDeg(angle: number): [Date, number] {\n const alot = this.timeAtAngle(angle, true);\n const tzeit = this.timeAtAngle(angle, false);\n const temporalHour = (tzeit.getTime() - alot.getTime()) / 12;\n return [alot, temporalHour];\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn being fixed 72 minutes before sea-level sunrise, and nightfall is fixed\n * 72 minutes after sea-level sunset.\n */\n sofZmanShmaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanShmaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanShmaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(3 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham\n */\n sofZmanTfillaMGA(): Date {\n // Magen Avraham\n const [alot72, temporalHour] = this.getTemporalHour72(true);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 16.1° below the horizon.\n */\n sofZmanTfillaMGA16Point1(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.\n * Based on the opinion of the MGA that the day is calculated from\n * dawn to nightfall with both being 19.8° below the horizon.\n *\n * This calculation is based on the position of the sun 90 minutes after sunset in Jerusalem\n * around the equinox / equilux which calculates to 19.8° below geometric zenith.\n * https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\n */\n sofZmanTfillaMGA19Point8(): Date {\n const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);\n const offset = Math.floor(4 * temporalHour);\n return new Date(alot.getTime() + offset);\n }\n /**\n * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha gedola*, the earliest time one can pray mincha,\n * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n *\n * The Ramba\"m is of the opinion that it is better to delay *mincha* until\n * *mincha ketana* while the Ra\"sh, Tur, GRA and others are of the\n * opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.\n */\n minchaGedola(): Date {\n return this.getShaahZmanisBasedZman(6.5);\n }\n /**\n * Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns the time of *mincha gedola* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the earliest time to pray *mincha*.\n */\n minchaGedolaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n const offset = Math.floor(6.5 * temporalHour);\n return new Date(alot72.getTime() + offset);\n }\n /**\n * Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n *\n * This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the\n * opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,\n * that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise\n * (depending on the `useElevation` setting), according\n * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).\n */\n minchaKetana(): Date {\n return this.getShaahZmanisBasedZman(9.5);\n }\n /**\n * This method returns the time of *mincha ketana* according to the Magen Avraham\n * with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.\n * This is the preferred earliest time to pray *mincha* according to the opinion of\n * the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n *\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n minchaKetanaMGA(): Date {\n const [alot72, temporalHour] = this.getTemporalHour72(false);\n return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));\n }\n /**\n * Plag haMincha; Sunrise plus 10.75 halachic hours.\n * If elevation is enabled, this function will include elevation in the calculation.\n */\n plagHaMincha(): Date {\n return this.getShaahZmanisBasedZman(10.75);\n }\n /**\n * Nightfall – Tzeit HaKochavim; the sun is `angle` degrees below the\n * horizon in the evening.\n *\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n * @param [angle=8.5] optional time for solar depression.\n * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\n }\n /**\n * Nightfall – Tzeit HaKochavim; calculated as 72 minutes after sunset\n * (or sea-level sunset, depending on the `useElevation` setting).\n *\n * Returns a `Temporal.ZonedDateTime` with seconds precision, or `null` if\n * sunset cannot be calculated for this date and location.\n */\n tzeit72(): Temporal.ZonedDateTime | null {\n const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n if (!zdt) {\n return null;\n }\n return zdt.add({minutes: 72});\n }\n /**\n * Alias for sunrise\n */\n neitzHaChama(): Date {\n return this.sunrise();\n }\n /**\n * Alias for sunset\n */\n shkiah(): Date {\n return this.sunset();\n }\n /**\n * Rabbeinu Tam holds that bein hashmashos is a specific time\n * between sunset and tzeis hakochavim.\n * One opinion on how to calculate this time is that\n * it is 13.5 minutes before tzies 7.083.\n * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n beinHaShmashos(): Date {\n const tzeit = this.tzeit(7.083);\n const millis = tzeit.getTime();\n if (isNaN(millis)) {\n return tzeit;\n }\n return new Date(millis - 13.5 * 60 * 1000);\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return previous midnight\n */\n private getMidnightLastNight(): Temporal.ZonedDateTime {\n // reset hour, minutes, seconds and millis\n return this.plainDate.toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Used by Molad based _zmanim_ to determine if _zmanim_ occur during the current day.\n * @return following midnight\n */\n private getMidnightTonight(): Temporal.ZonedDateTime {\n return this.plainDate.add({days: 1}).toZonedDateTime({\n timeZone: this.gloc.getTimeZone(),\n });\n }\n\n /**\n * Returns the Date of the _molad_ based time if it occurs on the current date. Since _Kiddush Levana_\n * can only be said during the day, there are parameters to limit it to between _alos_ and _tzais_. If\n * the time occurs between _alos_ and _tzais_, _tzais_ will be returned.\n *\n * @param moladBasedTime\n * the _molad_ based time such as _molad_, _tchilas_ and _sof zman Kiddush Levana_\n * @param alos\n * optional start of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _alos_ or _tzais_ are null.\n * @param tzais\n * optional end of day to limit _molad_ times to the end of the night before or beginning of the next night.\n * Ignored if either _tzais_ or _alos_ are null\n * @param techila\n * is it the start of _Kiddush Levana_ time or the end? If it is start roll it to the next _tzais_,\n * and if it is the end, return the end of the previous night (_alos_ passed in). Ignored if either\n * _alos_ or _tzais_ are null.\n * @return the _molad_ based time. If the _zman_ does not occur during the current date, `null` will be\n * returned.\n */\n private getMoladBasedTime(\n moladBasedTime: Temporal.ZonedDateTime,\n alos: Temporal.ZonedDateTime | null,\n tzais: Temporal.ZonedDateTime | null,\n techila: boolean\n ): Temporal.ZonedDateTime | null {\n const lastMidnight: Temporal.ZonedDateTime = this.getMidnightLastNight();\n const midnightTonight: Temporal.ZonedDateTime = this.getMidnightTonight();\n\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, lastMidnight) < 0 ||\n Temporal.ZonedDateTime.compare(moladBasedTime, midnightTonight) > 0\n ) {\n return null; // Invalid time, bailout\n }\n if (alos === null || tzais === null) {\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone()); // Not enough info to adjust\n }\n if (\n Temporal.ZonedDateTime.compare(moladBasedTime, alos) > 0 &&\n Temporal.ZonedDateTime.compare(moladBasedTime, tzais) < 0\n ) {\n // It's the daytime (after alos but before tzais)\n // get the next/prev night\n return techila ? tzais : alos;\n }\n // It's the night, the provided time is valid\n return moladBasedTime.withTimeZone(this.gloc.getTimeZone());\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the\n * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as\n * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between\n * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be alos. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at\n * tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment halfway between molad and molad. If the time\n * occurs between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this\n * day, `null` will be returned.\n */\n public getSofZmanKidushLevanaBetweenMoldos(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in French\n // Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush Levana\n // will be on the 12th of the Teves. In the case of Anadyr, Russia on Jan, 2071, sof zman Kiddush Levana between the\n // moldos will occur is on the night of 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 16) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevanaBetweenMoldos(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of\n * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the\n * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles), who brings down the opinion of the\n * [Maharil](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating\n * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_}, is of\n * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on\n * the subject, see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of\n * [Shaarei Zmanim](https://hebrewbooks.org/53000).\n *\n * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and\n * `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 15 days after the _molad_. If the time occurs\n * between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n public getSofZmanKidushLevana15Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. In the extreme case of Rapa Iti in\n // French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on _Rosh Chodesh_, the sof zman Kiddush\n // Levana will be on the 12th of the Teves. in the case of Anadyr, Russia on Jan, 2071, sof zman kiddush levana will\n // occur after midnight on the 17th of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 11 || hd.getDate() > 17) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getSofZmanKidushLevana15Days(),\n alos,\n tzais,\n false\n );\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to\n * [Rabbeinu Yonah](https://en.wikipedia.org/wiki/Yonah_Gerondi)'s opinion that it can be said 3 days after the _molad_.\n * If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to\n * this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual\n * _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.\n *\n * @param alos\n * the beginning of the Jewish day. If Kidush Levana occurs during the day (starting at _alos_ and ending\n * at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and ending at\n * _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment 3 days after the molad. If the time occurs\n * between _alos_ and _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,\n * `null` will be returned.\n */\n public getTchilasZmanKidushLevana3Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Do not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 3 days for\n // the extreme case of Rapa Iti in French Polynesia on Dec 2027 when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh. The 3rd day after the _molad_ will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 3rd day\n // from the molad will be on the 5th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() > 5 && hd.getDate() < 30) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana3Days(),\n alos,\n tzais,\n true\n );\n\n // Get the following month's zman kiddush Levana for the extreme case of Rapa Iti in French Polynesia on Dec 2027 when\n // kiddush Levana can be said on Rosh Chodesh (the evening of the 30th). See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (page 32)\n if (zman === null && hd.getDate() === 30) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(\n molad2.getTchilasZmanKidushLevana3Days(),\n null,\n null,\n true\n );\n }\n\n return zman;\n }\n\n /**\n * Returns the point in time of the _Molad_, if it occurs on this date. For the traditional day of week, hour,\n * minute and chalakim, see {@link Molad} and its {@link Molad.render} method.\n *\n * @return the `Temporal.ZonedDateTime` representing the moment of the molad. If the _molad_ does not occur on\n * this day, `null` will be returned.\n */\n public getZmanMolad(): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. The molad in the extreme case of Rapa\n // Iti in French Polynesia on Dec 2027 occurs on the night of the 27th of Kislev. In the case of Anadyr, Russia on\n // Jan 2071, the molad will be on the 2nd day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() > 2 && hd.getDate() < 27) {\n return null;\n }\n\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n let zman: Temporal.ZonedDateTime | null = this.getMoladBasedTime(\n molad.getInstant(),\n null,\n null,\n true\n );\n\n // deal with molad that happens on the end of the previous month\n if (zman === null && hd.getDate() > 26) {\n const hd2 = hd.add(1, 'week');\n const molad2 = new Molad(hd2.getFullYear(), hd2.getMonth());\n zman = this.getMoladBasedTime(molad2.getInstant(), null, null, true);\n }\n return zman;\n }\n\n /**\n * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7\n * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_\n * can't be recited, unless both `alos` and `tzais` are supplied.\n *\n * @param alos\n * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and\n * ending at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters\n * are null, no daytime adjustment will be made.\n * @param tzais\n * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime\n * adjustment will be made.\n * @return the `Temporal.ZonedDateTime` representing the moment 7 days after the molad. If the _zman_\n * will not occur on this day, `null` will be returned.\n */\n public getTchilasZmanKidushLevana7Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.hdate;\n\n // Optimize to not calculate for impossible dates, but account for extreme cases. Tchilas zman kiddush Levana 7 days for\n // the extreme case of Rapa Iti in French Polynesia on Jan 2028 (when kiddush Levana 3 days can be said on the evening\n // of the 30th, the second night of Rosh Chodesh), the 7th day after the molad will be on the 4th of the month.\n // In the case of Anadyr, Russia on Jan, 2071, when sof zman kiddush levana is on the 17th of the month, the 7th day\n // from the molad will be on the 9th day of Shevat. See Rabbi Dovid Heber's Shaarei Zmanim chapter 4 (pages 28 and 32).\n if (hd.getDate() < 4 || hd.getDate() > 9) {\n return null;\n }\n const molad = new Molad(hd.getFullYear(), hd.getMonth());\n return this.getMoladBasedTime(\n molad.getTchilasZmanKidushLevana7Days(),\n alos,\n tzais,\n true\n );\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _netz amiti_ (sunrise) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are\n * calculated as a dip below the horizon before sunrise.\n *\n * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's\n * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which\n * the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom\n * DovBer Levine's commentary on\n * [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).\n * From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),\n * the sun disappears when it is 1° 35' or 1.583° below the sea level horizon. This in turn is based on the Gemara\n * [Shabbos 35a](https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35). There are other opinions brought down by\n * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after\n * sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' _zman_\n * and is probably a typo and should be 1.683°. These calculations are used by most\n * [Chabad](https://en.wikipedia.org/wiki/Chabad) calendars that use the Baal Hatanya's _zmanim_. See\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the\n * published time for _netz_ / sunrise.\n *\n * @return the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be\n * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one\n * where it does not set, `null` will be returned.\n */\n private getSunriseBaalHatanya(): number {\n return this.sunriseMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s\n * _shkiah amiti_ (sunset) without\n * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated\n * as a dip below the horizon after sunset.\n *\n * According to the Baal Hatanya, _shkiah amiti_, true (_halachic_) sunset, is when the top of the\n * sun's disk disappears from view at an elevation similar to the mountains of _Eretz Yisrael_.\n * This time is calculated as the point at which the center of the sun's disk is 1.583 degrees below the horizon.\n *\n * Note: _shkiah amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For\n * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.\n *\n * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see\n * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).\n *\n * @return the exact sea level _shkiah amiti_ (sunset) time. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not\n * rise, and one where it does not set, `null` will be returned.\n */\n private getSunsetBaalHatanya(): number {\n return this.sunsetMillis(ZENITH_1_POINT_583, true);\n }\n\n /**\n * Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_\n * (dawn) calculated as the time when the sun is 16.9° below the eastern geometric horizon\n * before {@link sunrise}.\n *\n * The zenith of 16.9° below is based on the calculation that the time between dawn\n * and _netz amiti_ (sunrise) is 72 minutes, the time that it takes to walk 4 mil at 18 minutes\n * a mil ([Rambam](https://en.wikipedia.org/wiki/Maimonides) and others). The sun's position at 72\n * minutes before _netz amiti_ (sunrise) in Jerusalem\n * [around the equinox / equilux](https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/)\n * is 16.9° below geometric zenith.\n *\n * @return the `Date` of dawn. If the calculation can't be computed, such as in northern and southern\n * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach\n * low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n public alosBaalHatanya(): Date {\n return this.timeAtAngle(16.9, true);\n }\n\n private getShaahZmanisBaalHatanya(hours: number): Date {\n return millisToDate(\n this.getShaahZmanisBasedZmanMillis(\n this.getSunriseBaalHatanya(),\n this.getSunsetBaalHatanya(),\n hours\n )\n );\n }\n\n /**\n * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3\n * _shaos zmaniyos_ (solar hours) after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya\n * that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman shema_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n public sofZmanShmaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(3);\n }\n\n /**\n * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4\n * halachic hours into the day, based on the opinion of the Baal Hatanya that the day is\n * calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the latest _zman tfilah_. If the calculation can't be computed, such as in\n * the Arctic Circle where there is at least one day a year where the sun does not rise and one where it does\n * not set, an `Invalid Date` will be returned.\n */\n public sofZmanTfilaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(4);\n }\n\n /**\n * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray\n * _mincha_. The [Rambam](https://en.wikipedia.org/wiki/Maimonides) is of the opinion that it is\n * better to delay _mincha_ until {@link minchaKetanaBaalHatanya | _mincha ketana_} while the\n * [Ra\"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),\n * [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),\n * [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed\n * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 sea level solar hours after\n * _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated from\n * _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n * @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise\n * and one where it does not set, an `Invalid Date` will be returned.\n */\n public minchaGedolaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(6.5);\n }\n\n /**\n * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray\n * _mincha_ in the opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.\n * For more information on this see the documentation on {@link minchaGedolaBaalHatanya | _mincha gedola_}.\n * This is calculated as 9.5 sea level solar hours after _netz amiti_ (sunrise), based on the opinion of\n * the Baal Hatanya that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _mincha ketana_. If the calculation can't be computed, such as\n * in the Arctic Circle where there is at least one day a year where the sun does not rise and one where it\n * does not set, an `Invalid Date` will be returned.\n */\n public minchaKetanaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(9.5);\n }\n\n /**\n * This method returns the time of _plag hamincha_. This is calculated as 10.75 sea level solar hours\n * after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated\n * from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).\n *\n * @return the `Date` of the time of _plag hamincha_ according to the Baal Hatanya. If the calculation\n * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does\n * not rise and one where it does not set, an `Invalid Date` will be returned.\n */\n public plagHaminchaBaalHatanya(): Date {\n return this.getShaahZmanisBaalHatanya(10.75);\n }\n\n /**\n * A method that returns _tzais_ (nightfall) when the sun is 6° below the western geometric horizon\n * (90°) after {@link sunset}. This is the time the Baal Hatanya calls _shkiah amiti_ plus the\n * interval it takes the sun to descend a further 6°.\n *\n * @return the `Date` of nightfall. If the calculation can't be computed, such as in northern and southern\n * locations — even south of the Arctic Circle and north of the Antarctic Circle — where the sun may not\n * reach low enough below the horizon for this calculation, an `Invalid Date` will be returned.\n */\n public tzaisBaalHatanya(): Date {\n return this.timeAtAngle(6, false);\n }\n\n /**\n * Uses timeFormat to return a date like '20:34'.\n * Returns `XX:XX` if the date is invalid.\n * @param dt the time to format\n * @param timeFormat formatter to use, e.g. from\n * {@link Location.getTimeFormatter}\n */\n static formatTime(dt: Date, timeFormat: Intl.DateTimeFormat): string {\n if (isNaN(dt.getTime())) {\n return 'XX:XX'; // Invalid Date\n }\n const time = timeFormat.format(dt);\n // Rewrite the h24 midnight (\"24:15\") that some locales produce. Checking\n // the two leading characters avoids the throwaway array that split(':')\n // allocated on every event; this runs once per timed event, and the\n // Intl.format() call above is already the expensive part.\n if (\n time.charCodeAt(0) === 0x32 && // '2'\n time.charCodeAt(1) === 0x34 && // '4'\n time.charCodeAt(2) === 0x3a // ':'\n ) {\n return '00' + time.substring(2);\n }\n return time;\n }\n\n /**\n * Discards seconds, rounding to nearest minute.\n * @param dt\n */\n static roundTime(dt: Date): Date {\n const millis = dt.getTime();\n if (isNaN(millis)) {\n return dt;\n }\n // Round up to next minute if needed\n const millisOnly = dt.getMilliseconds();\n const seconds = dt.getSeconds();\n if (seconds === 0 && millisOnly === 0) {\n return dt;\n }\n const secAndMillis = seconds * 1000 + millisOnly;\n const delta = secAndMillis >= 30000 ? 60000 - secAndMillis : -1 * secAndMillis;\n return new Date(millis + delta);\n }\n\n /**\n * Get offset string (like \"+05:00\" or \"-08:00\") from tzid (like \"Europe/Moscow\")\n * @param tzid\n * @param date\n */\n static timeZoneOffset(tzid: string, date: Date): string {\n const offset = getTimezoneOffset(tzid, date);\n const offsetAbs = Math.abs(offset);\n const hours = Math.floor(offsetAbs / 60);\n const minutes = offsetAbs % 60;\n return (offset < 0 ? '+' : '-') + pad2(hours) + ':' + pad2(minutes);\n }\n\n /**\n * Returns a string like \"2022-04-01T13:06:00-11:00\"\n * @param tzid\n * @param date\n */\n static formatISOWithTimeZone(tzid: string, date: Date): string {\n if (isNaN(date.getTime())) {\n return '0000-00-00T00:00:00Z';\n }\n return (\n getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date)\n );\n }\n\n /**\n * Returns sunrise + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunrise (default false)\n */\n sunriseOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunrise = forceSeaLevel ? this.seaLevelSunrise() : this.sunrise();\n if (isNaN(sunrise.getTime())) {\n return sunrise;\n }\n if (roundMinute) {\n // For positive offsets only, round up to next minute if needed\n if (offset > 0 && sunrise.getSeconds() >= 30) {\n offset++;\n }\n sunrise.setSeconds(0, 0);\n }\n return new Date(sunrise.getTime() + offset * 60 * 1000);\n }\n\n /**\n * Returns sunset + `offset` minutes (either positive or negative).\n * If elevation is enabled, this function will include elevation in the calculation\n * unless `forceSeaLevel` is `true`.\n * @param offset minutes\n * @param roundMinute round time to nearest minute (default true)\n * @param forceSeaLevel use sea-level sunset (default false)\n */\n sunsetOffset(offset: number, roundMinute = true, forceSeaLevel = false): Date {\n const sunset = forceSeaLevel ? this.seaLevelSunset() : this.sunset();\n if (isNaN(sunset.getTime())) {\n return sunset;\n }\n if (roundMinute) {\n // For Havdalah only, round up to next minute if needed\n if (offset > 0 && sunset.getSeconds() >= 30) {\n offset++;\n }\n sunset.setSeconds(0, 0);\n }\n return new Date(sunset.getTime() + offset * 60 * 1000);\n }\n /**\n * Returns the Hebrew date relative to the specified location and Gregorian date,\n * taking into consideration whether the time is before or after sunset.\n *\n * For example, if the given date and is `2024-09-22T10:35` (before sunset), and\n * sunset for the specified location is **19:04**, then this function would\n * return a Hebrew date of `19th of Elul, 5784`.\n * If the given date is the same Gregorian day after sunset\n * (for example `2024-09-22T20:07`), this function would return a\n * Hebrew date of `20th of Elul, 5784`.\n * @example\n * import {GeoLocation, Zmanim, HDate} from '@hebcal/core';\n * const latitude = 48.85341;\n * const longitude = 2.3488;\n * const timezone = 'Europe/Paris';\n * const gloc = new GeoLocation(null, latitude, longitude, 0, timezone);\n * const before = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T17:38:46.123Z'), false);\n * console.log(before.toString()); // '19 Elul 5784'\n * const after = Zmanim.makeSunsetAwareHDate(gloc, new Date('2024-09-22T23:45:18.345Z'), false);\n * console.log(after.toString()); // '20 Elul 5784'\n */\n static makeSunsetAwareHDate(\n gloc: GeoLocation,\n date: Date,\n useElevation: boolean\n ): HDate {\n const zmanim = new Zmanim(gloc, date, useElevation);\n const sunset = zmanim.sunset();\n let hd = new HDate(date);\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n return hd;\n }\n if (date.getTime() >= sunsetMillis) {\n hd = hd.next();\n }\n return hd;\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\n\nconst SUN = 0;\nconst TUE = 2;\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst IYYAR = months.IYYAR;\n\n/**\n * Yom HaShoah first observed in 1951.\n * When the actual date of Yom Hashoah falls on a Friday, the\n * state of Israel observes Yom Hashoah on the preceding\n * Thursday. When it falls on a Sunday, Yom Hashoah is observed\n * on the following Monday.\n * http://www.ushmm.org/remembrance/dor/calendar/\n * @private\n * @param year\n */\nexport function dateYomHaShoah(year: number): HDate | null {\n if (year < 5711) {\n return null;\n }\n let nisan27dt = new HDate(27, NISAN, year);\n if (nisan27dt.getDay() === FRI) {\n nisan27dt = new HDate(26, NISAN, year);\n } else if (nisan27dt.getDay() === SUN) {\n nisan27dt = new HDate(28, NISAN, year);\n }\n return nisan27dt;\n}\n\n/**\n * Yom HaAtzma'ut only celebrated after 1948\n * @private\n * @param year\n */\nexport function dateYomHaZikaron(year: number): HDate | null {\n if (year < 5708) {\n return null;\n }\n let day;\n const pesach = new HDate(15, NISAN, year);\n const pdow = pesach.getDay();\n if (pdow === SUN) {\n day = 2;\n } else if (pdow === SAT) {\n day = 3;\n } else if (year < 5764) {\n day = 4;\n } else if (pdow === TUE) {\n day = 5;\n } else {\n day = 4;\n }\n return new HDate(day, IYYAR, year);\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n }\n if (!longC && shortK) {\n return INCOMPLETE;\n }\n return REGULAR;\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Vayera']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '6 Cheshvan 5784'\n * sedra.find(1)?.toString(); // '6 Cheshvan 5784', by 0-based index\n * // Matot and Masei are doubled in 5784, so the pair has a date...\n * sedra.find('Matot-Masei')?.toString(); // '28 Tamuz 5784'\n * sedra.find(['Matot', 'Masei'])?.toString(); // '28 Tamuz 5784'\n * // ...but neither half is read on its own that year:\n * sedra.find('Matot'); // null\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei).\n * Note that this index is 0-based, unlike {@link SedraResult.num} which\n * is 1-based.\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n }\n if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n }\n if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n }\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * // Matot and Masei are doubled in 5784, so each half resolves to the\n * // date of the combined reading:\n * const sedra = new Sedra(5784, false);\n * sedra.findContaining('Matot')?.toString(); // '28 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5784'\n * @example\n * import {Sedra} from '@hebcal/core';\n * // They are read separately in 5795, so each half has its own date, and\n * // asking for the doubled name returns the date of the first half:\n * const sedra = new Sedra(5795, false);\n * sedra.findContaining('Matot')?.toString(); // '21 Tamuz 5795'\n * sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5795'\n * sedra.findContaining('Matot-Masei')?.toString(); // '21 Tamuz 5795'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A Friday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(12, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '13 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Monday 8 Cheshvan — begins the upcoming Shabbat's parsha\n * sedra.lookupWeekday(new HDate(8, months.CHESHVAN, 5784))?.parsha; // ['Lech-Lecha']\n * // Tuesday is neither Monday nor Thursday\n * sedra.lookupWeekday(new HDate(9, months.CHESHVAN, 5784)); // undefined\n * // Thursday 17 Nisan — the upcoming Shabbat is Chol ha-Moed Pesach,\n * // so the next regular parsha is returned instead\n * sedra.lookupWeekday(new HDate(17, months.NISAN, 5784))?.parsha; // ['Achrei Mot']\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n }\n if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\n/**\n * An entry in the array returned by {@link Sedra.getSedraArray}: either a\n * `number` identifying a parsha (or, when negative, a doubled parsha) or a\n * `string` naming the holiday that displaces the weekly reading.\n */\nexport type NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n","import {months} from '@hebcal/hdate';\nimport {flags} from './event.js';\n\nconst Nisan = months.NISAN;\nconst Iyyar = months.IYYAR;\nconst Sivan = months.SIVAN;\nconst Tamuz = months.TAMUZ;\nconst Av = months.AV;\nconst Elul = months.ELUL;\nconst Tishrei = months.TISHREI;\nconst Cheshvan = months.CHESHVAN;\nconst Kislev = months.KISLEV;\nconst Shvat = months.SHVAT;\nconst Adar2 = months.ADAR_II;\n\nconst CHAG = flags.CHAG;\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES;\nconst YOM_TOV_ENDS = flags.YOM_TOV_ENDS;\nconst CHUL_ONLY = flags.CHUL_ONLY;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\nconst CHOL_HAMOED = flags.CHOL_HAMOED;\n\nconst emojiPesach = '🫓';\nconst emojiSukkot = '🌿🍋';\n\nconst ROSH_HASHANA_II = 'Rosh Hashana II';\nconst EREV_YOM_KIPPUR = 'Erev Yom Kippur';\nconst YOM_KIPPUR = 'Yom Kippur';\nconst EREV_SUKKOT = 'Erev Sukkot';\nconst SUKKOT_I = 'Sukkot I';\nconst SUKKOT_II = 'Sukkot II';\nconst SUKKOT_III_CHM = \"Sukkot III (CH''M)\";\nconst SUKKOT_IV_CHM = \"Sukkot IV (CH''M)\";\nconst SUKKOT_V_CHM = \"Sukkot V (CH''M)\";\nconst SUKKOT_VI_CHM = \"Sukkot VI (CH''M)\";\nconst SHMINI_ATZERET = 'Shmini Atzeret';\nconst SIMCHAT_TORAH = 'Simchat Torah';\nconst SUKKOT_II_CHM = \"Sukkot II (CH''M)\";\nconst SUKKOT_VII_HOSHANA_RABA = 'Sukkot VII (Hoshana Raba)';\nconst CHANUKAH_1_CANDLE = 'Chanukah: 1 Candle';\nconst TU_BISHVAT = 'Tu BiShvat';\nconst EREV_PURIM = 'Erev Purim';\nconst PURIM = 'Purim';\nconst SHUSHAN_PURIM = 'Shushan Purim';\nconst EREV_PESACH = 'Erev Pesach';\nconst PESACH_I = 'Pesach I';\nconst PESACH_II = 'Pesach II';\nconst PESACH_II_CHM = \"Pesach II (CH''M)\";\nconst PESACH_III_CHM = \"Pesach III (CH''M)\";\nconst PESACH_IV_CHM = \"Pesach IV (CH''M)\";\nconst PESACH_V_CHM = \"Pesach V (CH''M)\";\nconst PESACH_VI_CHM = \"Pesach VI (CH''M)\";\nconst PESACH_VII = 'Pesach VII';\nconst PESACH_VIII = 'Pesach VIII';\nconst PESACH_SHENI = 'Pesach Sheni';\nconst LAG_BAOMER = 'Lag BaOmer';\nconst EREV_SHAVUOT = 'Erev Shavuot';\nconst SHAVUOT = 'Shavuot';\nconst SHAVUOT_I = 'Shavuot I';\nconst SHAVUOT_II = 'Shavuot II';\nconst TU_BAV = \"Tu B'Av\";\nconst ROSH_HASHANA_LABEHEMOT = 'Rosh Hashana LaBehemot';\nconst EREV_ROSH_HASHANA = 'Erev Rosh Hashana';\nconst YOM_YERUSHALAYIM = 'Yom Yerushalayim';\nconst BEN_GURION_DAY = 'Ben-Gurion Day';\nconst FAMILY_DAY = 'Family Day';\nconst YITZHAK_RABIN_MEMORIAL_DAY = 'Yitzhak Rabin Memorial Day';\nconst HERZL_DAY = 'Herzl Day';\nconst JABOTINSKY_DAY = 'Jabotinsky Day';\nconst SIGD = 'Sigd';\nconst YOM_HAALIYAH = 'Yom HaAliyah';\nconst YOM_HAALIYAH_SCHOOL_OBSERVANCE = 'Yom HaAliyah School Observance';\nconst HEBREW_LANGUAGE_DAY = 'Hebrew Language Day';\nconst CANDLE_LIGHTING = 'Candle lighting';\nconst HAVDALAH = 'Havdalah';\nconst FAST_BEGINS = 'Fast begins';\nconst FAST_ENDS = 'Fast ends';\nconst BIUR_CHAMETZ = 'Biur Chametz';\nconst SOF_ZMAN_ACHILAT_CHAMETZ = 'Finish eating chametz';\nconst YIZKOR = 'Yizkor';\n\n/**\n * Transliterated names of holidays, used by `Event.getDesc()`\n */\nexport const holidayDesc = {\n /** Asara B'Tevet */\n ASARA_BTEVET: \"Asara B'Tevet\",\n /** Birkat Hachamah */\n BIRKAT_HACHAMAH: 'Birkat Hachamah',\n /** Chag HaBanot */\n CHAG_HABANOT: 'Chag HaBanot',\n /** Chanukah: 8th Day */\n CHANUKAH_8TH_DAY: 'Chanukah: 8th Day',\n /** Erev Tish'a B'Av */\n EREV_TISHA_BAV: \"Erev Tish'a B'Av\",\n /** Leil Selichot */\n LEIL_SELICHOT: 'Leil Selichot',\n /** Purim Katan */\n PURIM_KATAN: 'Purim Katan',\n /** Purim Meshulash */\n PURIM_MESHULASH: 'Purim Meshulash',\n /** Shabbat Chazon */\n SHABBAT_CHAZON: 'Shabbat Chazon',\n /** Shabbat HaChodesh */\n SHABBAT_HACHODESH: 'Shabbat HaChodesh',\n /** Shabbat HaGadol */\n SHABBAT_HAGADOL: 'Shabbat HaGadol',\n /** Shabbat Nachamu */\n SHABBAT_NACHAMU: 'Shabbat Nachamu',\n /** Shabbat Parah */\n SHABBAT_PARAH: 'Shabbat Parah',\n /** Shabbat Shekalim */\n SHABBAT_SHEKALIM: 'Shabbat Shekalim',\n /** Shabbat Shirah */\n SHABBAT_SHIRAH: 'Shabbat Shirah',\n /** Shabbat Shuva */\n SHABBAT_SHUVA: 'Shabbat Shuva',\n /** Shabbat Zachor */\n SHABBAT_ZACHOR: 'Shabbat Zachor',\n /** Shushan Purim Katan */\n SHUSHAN_PURIM_KATAN: 'Shushan Purim Katan',\n /** Ta'anit Bechorot */\n TAANIT_BECHOROT: \"Ta'anit Bechorot\",\n /** Ta'anit BeHaB */\n TAANIT_BEHAB: \"Ta'anit BeHaB\",\n /** Ta'anit Esther */\n TAANIT_ESTHER: \"Ta'anit Esther\",\n /** Tish'a B'Av */\n TISHA_BAV: \"Tish'a B'Av\",\n /** Tzom Gedaliah */\n TZOM_GEDALIAH: 'Tzom Gedaliah',\n /** Tzom Tammuz */\n TZOM_TAMMUZ: 'Tzom Tammuz',\n /** Yom HaAtzma'ut */\n YOM_HAATZMA_UT: \"Yom HaAtzma'ut\",\n /** Yom HaShoah */\n YOM_HASHOAH: 'Yom HaShoah',\n /** Yom HaZikaron */\n YOM_HAZIKARON: 'Yom HaZikaron',\n\n /** Ben-Gurion Day */\n BEN_GURION_DAY,\n /** Chanukah: 1 Candle */\n CHANUKAH_1_CANDLE,\n /** Erev Pesach */\n EREV_PESACH,\n /** Erev Purim */\n EREV_PURIM,\n /** Erev Rosh Hashana */\n EREV_ROSH_HASHANA,\n /** Erev Shavuot */\n EREV_SHAVUOT,\n /** Erev Sukkot */\n EREV_SUKKOT,\n /** Erev Yom Kippur */\n EREV_YOM_KIPPUR,\n /** Family Day */\n FAMILY_DAY,\n /** Hebrew Language Day */\n HEBREW_LANGUAGE_DAY,\n /** Herzl Day */\n HERZL_DAY,\n /** Jabotinsky Day */\n JABOTINSKY_DAY,\n /** Lag BaOmer */\n LAG_BAOMER,\n /** Pesach I */\n PESACH_I,\n /** Pesach II */\n PESACH_II,\n /** Pesach III (CH''M) */\n PESACH_III_CHM,\n /** Pesach II (CH''M) */\n PESACH_II_CHM,\n /** Pesach IV (CH''M) */\n PESACH_IV_CHM,\n /** Pesach Sheni */\n PESACH_SHENI,\n /** Pesach VII */\n PESACH_VII,\n /** Pesach VIII */\n PESACH_VIII,\n /** Pesach VI (CH''M) */\n PESACH_VI_CHM,\n /** Pesach V (CH''M) */\n PESACH_V_CHM,\n /** Purim */\n PURIM,\n /** Rosh Hashana II */\n ROSH_HASHANA_II,\n /** Rosh Hashana LaBehemot */\n ROSH_HASHANA_LABEHEMOT,\n /** Shavuot */\n SHAVUOT,\n /** Shavuot I */\n SHAVUOT_I,\n /** Shavuot II */\n SHAVUOT_II,\n /** Shmini Atzeret */\n SHMINI_ATZERET,\n /** Shushan Purim */\n SHUSHAN_PURIM,\n /** Sigd */\n SIGD,\n /** Simchat Torah */\n SIMCHAT_TORAH,\n /** Sukkot I */\n SUKKOT_I,\n /** Sukkot II */\n SUKKOT_II,\n /** Sukkot III (CH''M) */\n SUKKOT_III_CHM,\n /** Sukkot II (CH''M) */\n SUKKOT_II_CHM,\n /** Sukkot IV (CH''M) */\n SUKKOT_IV_CHM,\n /** Sukkot VII (Hoshana Raba) */\n SUKKOT_VII_HOSHANA_RABA,\n /** Sukkot VI (CH''M) */\n SUKKOT_VI_CHM,\n /** Sukkot V (CH''M) */\n SUKKOT_V_CHM,\n /** Tu B\\'Av */\n TU_BAV,\n /** Tu BiShvat */\n TU_BISHVAT,\n /** Yitzhak Rabin Memorial Day */\n YITZHAK_RABIN_MEMORIAL_DAY,\n /** Yom HaAliyah */\n YOM_HAALIYAH,\n /** Yom HaAliyah School Observance */\n YOM_HAALIYAH_SCHOOL_OBSERVANCE,\n /** Yom Kippur */\n YOM_KIPPUR,\n /** Yom Yerushalayim */\n YOM_YERUSHALAYIM,\n /** Candle lighting */\n CANDLE_LIGHTING,\n /** Havdalah */\n HAVDALAH,\n /** Fast begins */\n FAST_BEGINS,\n /** Fast ends */\n FAST_ENDS,\n /** Biur Chametz */\n BIUR_CHAMETZ,\n /** Finish eating chametz */\n SOF_ZMAN_ACHILAT_CHAMETZ,\n /** Yizkor */\n YIZKOR,\n} as const;\n\nexport interface Holiday {\n mm: number; // This should be an enum `Month` eventually\n dd: number;\n desc: string;\n flags: number;\n chmDay?: number;\n emoji?: string;\n}\n\nexport const staticHolidays: Holiday[] = [\n {\n mm: Tishrei,\n dd: 2,\n desc: ROSH_HASHANA_II,\n flags: CHAG | YOM_TOV_ENDS,\n emoji: '🍏🍯',\n },\n {mm: Tishrei, dd: 9, desc: EREV_YOM_KIPPUR, flags: EREV | LIGHT_CANDLES},\n {\n mm: Tishrei,\n dd: 10,\n desc: YOM_KIPPUR,\n flags: CHAG | MAJOR_FAST | YOM_TOV_ENDS,\n },\n\n {\n mm: Tishrei,\n dd: 14,\n desc: EREV_SUKKOT,\n flags: CHUL_ONLY | EREV | LIGHT_CANDLES,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 15,\n desc: SUKKOT_I,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 16,\n desc: SUKKOT_II,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 17,\n desc: SUKKOT_III_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 18,\n desc: SUKKOT_IV_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 19,\n desc: SUKKOT_V_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 20,\n desc: SUKKOT_VI_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 4,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 22,\n desc: SHMINI_ATZERET,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n },\n {\n mm: Tishrei,\n dd: 23,\n desc: SIMCHAT_TORAH,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n },\n\n {\n mm: Tishrei,\n dd: 14,\n desc: EREV_SUKKOT,\n flags: IL_ONLY | EREV | LIGHT_CANDLES,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 15,\n desc: SUKKOT_I,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 16,\n desc: SUKKOT_II_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 17,\n desc: SUKKOT_III_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 18,\n desc: SUKKOT_IV_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 19,\n desc: SUKKOT_V_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 4,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 20,\n desc: SUKKOT_VI_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 5,\n emoji: emojiSukkot,\n },\n {\n mm: Tishrei,\n dd: 22,\n desc: SHMINI_ATZERET,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n },\n\n {\n mm: Tishrei,\n dd: 21,\n desc: SUKKOT_VII_HOSHANA_RABA,\n flags: LIGHT_CANDLES | CHOL_HAMOED,\n chmDay: -1,\n emoji: emojiSukkot,\n },\n {mm: Shvat, dd: 15, desc: TU_BISHVAT, flags: MINOR_HOLIDAY, emoji: '🌳'},\n {\n mm: Adar2,\n dd: 13,\n desc: EREV_PURIM,\n flags: EREV | MINOR_HOLIDAY,\n emoji: '🎭️📜',\n },\n {mm: Adar2, dd: 14, desc: PURIM, flags: MINOR_HOLIDAY, emoji: '🎭️📜'},\n {\n mm: Adar2,\n dd: 15,\n desc: SHUSHAN_PURIM,\n flags: MINOR_HOLIDAY,\n emoji: '🎭️📜',\n },\n // Pesach Israel\n {\n mm: Nisan,\n dd: 14,\n desc: EREV_PESACH,\n flags: IL_ONLY | EREV | LIGHT_CANDLES,\n emoji: '🫓🍷',\n },\n {\n mm: Nisan,\n dd: 15,\n desc: PESACH_I,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 16,\n desc: PESACH_II_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 17,\n desc: PESACH_III_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 18,\n desc: PESACH_IV_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 19,\n desc: PESACH_V_CHM,\n flags: IL_ONLY | CHOL_HAMOED,\n chmDay: 4,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 20,\n desc: PESACH_VI_CHM,\n flags: IL_ONLY | CHOL_HAMOED | LIGHT_CANDLES,\n chmDay: 5,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 21,\n desc: PESACH_VII,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n // Pesach chutz l'aretz\n {\n mm: Nisan,\n dd: 14,\n desc: EREV_PESACH,\n flags: CHUL_ONLY | EREV | LIGHT_CANDLES,\n emoji: '🫓🍷',\n },\n {\n mm: Nisan,\n dd: 15,\n desc: PESACH_I,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: '🫓🍷',\n },\n {\n mm: Nisan,\n dd: 16,\n desc: PESACH_II,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 17,\n desc: PESACH_III_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 1,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 18,\n desc: PESACH_IV_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 2,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 19,\n desc: PESACH_V_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED,\n chmDay: 3,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 20,\n desc: PESACH_VI_CHM,\n flags: CHUL_ONLY | CHOL_HAMOED | LIGHT_CANDLES,\n chmDay: 4,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 21,\n desc: PESACH_VII,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: emojiPesach,\n },\n {\n mm: Nisan,\n dd: 22,\n desc: PESACH_VIII,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: emojiPesach,\n },\n\n {mm: Iyyar, dd: 14, desc: PESACH_SHENI, flags: MINOR_HOLIDAY},\n {mm: Iyyar, dd: 18, desc: LAG_BAOMER, flags: MINOR_HOLIDAY, emoji: '🔥'},\n {\n mm: Sivan,\n dd: 5,\n desc: EREV_SHAVUOT,\n flags: EREV | LIGHT_CANDLES,\n emoji: '⛰️🌸',\n },\n {\n mm: Sivan,\n dd: 6,\n desc: SHAVUOT,\n flags: IL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: '⛰️🌸',\n },\n {\n mm: Sivan,\n dd: 6,\n desc: SHAVUOT_I,\n flags: CHUL_ONLY | CHAG | LIGHT_CANDLES_TZEIS,\n emoji: '⛰️🌸',\n },\n {\n mm: Sivan,\n dd: 7,\n desc: SHAVUOT_II,\n flags: CHUL_ONLY | CHAG | YOM_TOV_ENDS,\n emoji: '⛰️🌸',\n },\n {mm: Av, dd: 15, desc: TU_BAV, flags: MINOR_HOLIDAY, emoji: '❤️'},\n {\n mm: Elul,\n dd: 1,\n desc: ROSH_HASHANA_LABEHEMOT,\n flags: MINOR_HOLIDAY,\n emoji: '🐑',\n },\n {\n mm: Elul,\n dd: 29,\n desc: EREV_ROSH_HASHANA,\n flags: EREV | LIGHT_CANDLES,\n emoji: '🍏🍯',\n },\n] as const;\n\nexport interface ModernHoliday {\n firstYear: number;\n mm: number; // This should be an enum `Month` eventually\n dd: number;\n desc: string;\n chul?: boolean;\n suppressEmoji?: boolean;\n satPostponeToSun?: boolean;\n friPostponeToSun?: boolean;\n friSatMovetoThu?: boolean;\n}\n\nexport const staticModernHolidays: ModernHoliday[] = [\n {firstYear: 5727, mm: Iyyar, dd: 28, desc: YOM_YERUSHALAYIM, chul: true},\n {\n firstYear: 5737,\n mm: Kislev,\n dd: 6,\n desc: BEN_GURION_DAY,\n satPostponeToSun: true,\n friPostponeToSun: true,\n },\n {firstYear: 5750, mm: Shvat, dd: 30, desc: FAMILY_DAY},\n {\n firstYear: 5758,\n mm: Cheshvan,\n dd: 12,\n desc: YITZHAK_RABIN_MEMORIAL_DAY,\n friSatMovetoThu: true,\n },\n {firstYear: 5764, mm: Iyyar, dd: 10, desc: HERZL_DAY, satPostponeToSun: true},\n {\n firstYear: 5765,\n mm: Tamuz,\n dd: 29,\n desc: JABOTINSKY_DAY,\n satPostponeToSun: true,\n },\n {\n firstYear: 5769,\n mm: Cheshvan,\n dd: 29,\n desc: SIGD,\n chul: true,\n suppressEmoji: true,\n friSatMovetoThu: true,\n },\n {firstYear: 5777, mm: Nisan, dd: 10, desc: YOM_HAALIYAH, chul: true},\n {firstYear: 5777, mm: Cheshvan, dd: 7, desc: YOM_HAALIYAH_SCHOOL_OBSERVANCE},\n // https://www.gov.il/he/departments/policies/2012_des5234\n {\n firstYear: 5773,\n mm: months.TEVET,\n dd: 21,\n desc: HEBREW_LANGUAGE_DAY,\n friSatMovetoThu: true,\n },\n] as const;\n","import {HDate, Locale, isoDateString} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport {smartApostrophe, urlFriendly} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.\n *\n * Most holiday-related events emitted by {@link calendar}\n * are instances of `HolidayEvent` or one of its subclasses\n * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},\n * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).\n *\n * Adds two notable behaviors over the base {@link Event}:\n *\n * - {@link HolidayEvent.basename} strips qualifiers like `Erev `, ` I`/`II`,\n * `(CH''M)`, `(observed)`, candle counts, etc. (e.g. `\"Erev Pesach\"` →\n * `\"Pesach\"`).\n * - {@link HolidayEvent.url} returns a `https://www.hebcal.com/holidays/...`\n * link for the holiday.\n */\nexport class HolidayEvent extends Event {\n /** During Sukkot or Pesach */\n readonly cholHaMoedDay?: number;\n /**\n * `true` if the fast day was postponed a day to avoid Shabbat.\n * - Tish'a B'Av postponed from the 9th to the 10th\n * - Tzom Tammuz postponed from the 17th to the 18th\n */\n readonly observed?: boolean;\n constructor(date: HDate, desc: string, mask = 0, attrs?: object) {\n super(date, desc, mask, attrs);\n if (typeof attrs === 'object' && attrs !== null) {\n Object.assign(this, attrs);\n }\n }\n\n /**\n * Returns a simplified (untranslated) name for this holiday, stripping\n * qualifiers so that related events group under one name.\n *\n * Strips trailing 4-digit years, `(CH''M)`, `(observed)`, `(Hoshana Raba)`,\n * Roman-numeral day numbers (` I`, ` II`, ...), Chanukah candle counts,\n * `: 8th Day`, and a leading `\"Erev \"`.\n * @example\n * // 'Erev Pesach' => 'Pesach'\n * // 'Sukkot III (CH''M)' => 'Sukkot'\n * // 'Chanukah: 5 Candles' => 'Chanukah'\n * // 'Rosh Hashana 5784' => 'Rosh Hashana'\n */\n basename(): string {\n return this.getDesc()\n .replace(/ \\d{4}$/, '')\n .replace(/ \\(CH''M\\)$/, '')\n .replace(/ \\(observed\\)$/, '')\n .replace(/ \\(Hoshana Raba\\)$/, '')\n .replace(/ [IV]+$/, '')\n .replace(/: \\d Candles?$/, '')\n .replace(/: 8th Day$/, '')\n .replace(/^Erev /, '');\n }\n\n /**\n * Returns a `https://www.hebcal.com/holidays/...` URL for more detail on\n * this holiday. Israel-only holidays get an `?i=on` query parameter.\n * Returns `undefined` for years outside `[100, 2999]`.\n */\n url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const url =\n 'https://www.hebcal.com/holidays/' +\n urlFriendly(this.basename()) +\n '-' +\n this.urlDateSuffix();\n return this.hasFlag('IL_ONLY') ? url + '?i=on' : url;\n }\n\n /**\n * The date portion of {@link url}. For most holidays this is just the\n * Gregorian year; subclasses override it when a year alone is ambiguous.\n */\n urlDateSuffix(): string {\n const year = this.greg().getFullYear();\n return String(year);\n }\n\n getEmoji(): string {\n if (this.emoji) {\n return this.emoji;\n }\n if (this.hasFlag('SPECIAL_SHABBAT')) {\n return '🕍';\n }\n return '✡️';\n }\n\n getCategories(): string[] {\n if (this.cholHaMoedDay) {\n return ['holiday', 'major', 'cholhamoed'];\n }\n const cats = super.getCategories();\n if (cats[0] !== 'unknown') {\n return cats;\n }\n // Don't depend on flags.MINOR_HOLIDAY always being set. Look for minor holidays.\n const desc = this.getDesc();\n switch (desc) {\n case hdesc.LAG_BAOMER:\n case hdesc.LEIL_SELICHOT:\n case hdesc.PESACH_SHENI:\n case hdesc.EREV_PURIM:\n case hdesc.PURIM_KATAN:\n case hdesc.SHUSHAN_PURIM:\n case hdesc.TU_BAV:\n case hdesc.TU_BISHVAT:\n case hdesc.ROSH_HASHANA_LABEHEMOT:\n return ['holiday', 'minor'];\n }\n\n return ['holiday', 'major'];\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const str = super.render(locale);\n return smartApostrophe(str);\n }\n /**\n * Returns a brief (translated) description of this event.\n * For most events, this is the same as render(). For some events, it procudes\n * a shorter text (e.g. without a time or added description).\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n const str = super.renderBrief(locale);\n return smartApostrophe(str);\n }\n}\n\n/**\n * Because Asara B'Tevet often occurs twice in the same Gregorian year,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class AsaraBTevetEvent extends HolidayEvent {\n /** Full `YYYYMMDD` date, since the Gregorian year alone is ambiguous here */\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n}\n\nconst chanukahEmoji = '🕎';\nconst KEYCAP_DIGITS = [\n '0️⃣',\n '1️⃣',\n '2️⃣',\n '3️⃣',\n '4️⃣',\n '5️⃣',\n '6️⃣',\n '7️⃣',\n '8️⃣',\n '9️⃣',\n] as const;\n\n/**\n * Because Chanukah sometimes starts in December and ends in January,\n * we subclass HolidayEvent to generate the correct URL.\n */\nexport class ChanukahEvent extends HolidayEvent {\n readonly chanukahDay?: number;\n /**\n * @param chanukahDay should be undefined for 1st night of Chanukah\n */\n constructor(date: HDate, desc: string, mask: number, chanukahDay?: number) {\n super(date, desc, mask);\n this.chanukahDay = chanukahDay;\n this.emoji = chanukahEmoji;\n if (chanukahDay !== 8) {\n const candles = chanukahDay ? chanukahDay + 1 : 1;\n this.emoji += KEYCAP_DIGITS[candles];\n }\n }\n urlDateSuffix(): string {\n const dt = this.greg();\n let year = dt.getFullYear();\n if (dt.getMonth() === 0) {\n year--;\n }\n return String(year);\n }\n}\n\n/** Represents Rosh Hashana, the Jewish New Year */\nexport class RoshHashanaEvent extends HolidayEvent {\n private readonly hyear: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date event occurs\n * @param hyear Hebrew year\n * @param mask optional holiday flags\n */\n constructor(date: HDate, hyear: number, mask: number) {\n super(date, `Rosh Hashana ${hyear}`, mask);\n this.hyear = hyear;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext('Rosh Hashana', locale) + ' ' + this.hyear;\n }\n\n getEmoji(): string {\n return '🍏🍯';\n }\n}\n\nconst roshChodeshStr = 'Rosh Chodesh';\n\n/** Represents Rosh Chodesh, the beginning of a new month */\nexport class RoshChodeshEvent extends HolidayEvent {\n /**\n * Constructs Rosh Chodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n */\n constructor(date: HDate, monthName: string) {\n super(date, `${roshChodeshStr} ${monthName}`, flags.ROSH_CHODESH);\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName = this.getDesc().substring(roshChodeshStr.length + 1);\n const monthName0 = Locale.gettext(monthName, locale);\n const monthName1 = smartApostrophe(monthName0);\n return Locale.gettext(roshChodeshStr, locale) + ' ' + monthName1;\n }\n\n basename(): string {\n return this.getDesc();\n }\n\n getEmoji(): string {\n return this.emoji || '🌒';\n }\n}\n","import {HDate, Locale} from '@hebcal/hdate';\nimport {flags} from './event.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst ykk = 'Yom Kippur Katan';\n\n/** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */\nexport class YomKippurKatanEvent extends HolidayEvent {\n private readonly nextMonthName: string;\n /**\n * Normally created by {@link calendar} (via\n * `options.yomKippurKatan`) rather than directly.\n * @param date Hebrew date event occurs\n * @param nextMonthName name of the upcoming month\n */\n constructor(date: HDate, nextMonthName: string) {\n super(\n date,\n `${ykk} ${nextMonthName}`,\n flags.MINOR_FAST | flags.YOM_KIPPUR_KATAN\n );\n this.nextMonthName = nextMonthName;\n this.memo = `Minor Day of Atonement on the day preceeding Rosh Chodesh ${nextMonthName}`;\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.nextMonthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(ykk, locale) + ' ' + monthName;\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(ykk, locale);\n }\n\n url(): string | undefined {\n return undefined;\n }\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport {flags} from './event.js';\nimport {dateYomHaShoah, dateYomHaZikaron} from './modern.js';\nimport {getSedra} from './sedra.js';\nimport {\n staticHolidays,\n staticModernHolidays,\n holidayDesc as hdesc,\n} from './staticHolidays.js';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent.js';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent.js';\n\n/**\n * Returns an array of holiday Events that occur on the given date, or\n * `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned (e.g. on the second day of a Yom Tov, both `\"Pesach II\"` for\n * Diaspora and any Israel-only events). Pass `true` or `false` to filter\n * to a single schedule.\n * @example\n * import {getHolidaysOnDate, HDate, months} from '@hebcal/core';\n * const events = getHolidaysOnDate(new HDate(15, months.NISAN, 5784), false);\n * events?.map(ev => ev.getDesc()); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\nexport function getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n): HolidayEvent[] | undefined {\n const hd = HDate.isHDate(date) ? (date as HDate) : new HDate(date);\n const hdStr = hd.toString();\n const yearMap = getHolidaysForYear_(hd.getFullYear());\n const events = yearMap.get(hdStr);\n // if il isn't a boolean return both diaspora + IL for day\n if (il === undefined || events === undefined) {\n return events;\n }\n const filtered = events.filter(ev => ev.observedIn(il));\n return filtered;\n}\n\nconst CHAG = flags.CHAG;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;\nconst BEHAB = flags.BEHAB;\nconst MINOR_FAST = flags.MINOR_FAST;\nconst SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;\nconst MODERN_HOLIDAY = flags.MODERN_HOLIDAY;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\n\nconst SUN = 0;\nconst TUE = 2;\nconst THU = 4;\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst IYYAR = months.IYYAR;\nconst TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\nconst CHESHVAN = months.CHESHVAN;\nconst KISLEV = months.KISLEV;\nconst TEVET = months.TEVET;\nconst ADAR_I = months.ADAR_I;\nconst ADAR_II = months.ADAR_II;\n\nconst emojiIsraelFlag = {emoji: '🇮🇱'} as const;\n/**\n * Holidays for an entire Hebrew year, indexed by `HDate.toString()`\n * (e.g. `'15 Nisan 5784'`). Returned by\n * {@link HebrewCalendar.getHolidaysForYear}. Because a single date can carry\n * more than one event, each key maps to an array. Entries are *not* filtered\n * by Israel vs. Diaspora — inspect `flags.IL_ONLY` / `flags.CHUL_ONLY`.\n */\nexport type HolidayYearMap = Map<string, HolidayEvent[]>;\nconst yearCache = new QuickLRU<number, HolidayYearMap>({maxSize: 120});\n\n/**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events must filtered especially for `flags.IL_ONLY`\n * or `flags.CHUL_ONLY` depending on Israel vs. Diaspora holiday scheme.\n * @private\n */\nexport function getHolidaysForYear_(year: number): HolidayYearMap {\n if (typeof year !== 'number') {\n throw new TypeError(`bad Hebrew year: ${year}`);\n }\n if (year < 1 || year > 32658) {\n throw new RangeError(`Hebrew year ${year} out of range 1-32658`);\n }\n const cached = yearCache.get(year);\n if (cached) {\n return cached;\n }\n\n const RH = new HDate(1, TISHREI, year);\n const pesach = new HDate(15, NISAN, year);\n\n const map = new Map<string, HolidayEvent[]>();\n function add(...events: HolidayEvent[]) {\n for (const ev of events) {\n const key = ev.date.toString();\n const arr = map.get(key);\n if (typeof arr === 'object') {\n if (arr[0].hasFlag('EREV')) {\n arr.unshift(ev);\n } else {\n arr.push(ev);\n }\n } else {\n map.set(key, [ev]);\n }\n }\n }\n\n for (const h of staticHolidays) {\n const hd = new HDate(h.dd, h.mm, year);\n const attrs: any = {};\n if (h.emoji) attrs.emoji = h.emoji;\n if (h.chmDay) attrs.cholHaMoedDay = h.chmDay;\n const ev = new HolidayEvent(hd, h.desc, h.flags, attrs);\n add(ev);\n }\n\n // standard holidays that don't shift based on year\n add(new RoshHashanaEvent(RH, year, CHAG | LIGHT_CANDLES_TZEIS));\n\n // Variable date holidays\n const tzomGedaliahDay: number = RH.getDay() === THU ? 4 : 3;\n add(\n new HolidayEvent(\n new HDate(tzomGedaliahDay, TISHREI, year),\n hdesc.TZOM_GEDALIAH,\n MINOR_FAST\n )\n );\n // first SAT after RH\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, 7 + RH.abs())),\n hdesc.SHABBAT_SHUVA,\n SPECIAL_SHABBAT\n )\n );\n const rchTevet = HDate.shortKislev(year)\n ? new HDate(1, TEVET, year)\n : new HDate(30, KISLEV, year);\n add(new HolidayEvent(rchTevet, hdesc.CHAG_HABANOT, MINOR_HOLIDAY));\n add(\n new ChanukahEvent(\n new HDate(24, KISLEV, year),\n hdesc.CHANUKAH_1_CANDLE,\n EREV | MINOR_HOLIDAY | CHANUKAH_CANDLES,\n undefined\n )\n );\n // yes, we know Kislev 30-32 are wrong\n // HDate() corrects the month automatically\n for (let candles = 2; candles <= 8; candles++) {\n const hd = new HDate(23 + candles, KISLEV, year);\n add(\n new ChanukahEvent(\n hd,\n `Chanukah: ${candles} Candles`,\n MINOR_HOLIDAY | CHANUKAH_CANDLES,\n candles - 1\n )\n );\n }\n add(\n new ChanukahEvent(\n new HDate(32, KISLEV, year),\n hdesc.CHANUKAH_8TH_DAY,\n MINOR_HOLIDAY,\n 8\n )\n );\n add(\n new AsaraBTevetEvent(new HDate(10, TEVET, year), hdesc.ASARA_BTEVET, MINOR_FAST)\n );\n const pesachAbs = pesach.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 43)),\n hdesc.SHABBAT_SHEKALIM,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 30)),\n hdesc.SHABBAT_ZACHOR,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(pesachAbs - (pesach.getDay() === TUE ? 33 : 31)),\n hdesc.TAANIT_ESTHER,\n MINOR_FAST\n )\n );\n const haChodeshAbs = HDate.dayOnOrBefore(SAT, pesachAbs - 14);\n add(\n new HolidayEvent(\n new HDate(haChodeshAbs - 7),\n hdesc.SHABBAT_PARAH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(haChodeshAbs),\n hdesc.SHABBAT_HACHODESH,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, pesachAbs - 1)),\n hdesc.SHABBAT_HAGADOL,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n // if the fast falls on Shabbat, move to Thursday\n pesach.prev().getDay() === SAT\n ? pesach.onOrBefore(THU)\n : new HDate(14, NISAN, year),\n hdesc.TAANIT_BECHOROT,\n MINOR_FAST\n )\n );\n add(\n new HolidayEvent(\n new HDate(\n HDate.dayOnOrBefore(SAT, new HDate(1, TISHREI, year + 1).abs() - 4)\n ),\n hdesc.LEIL_SELICHOT,\n MINOR_HOLIDAY,\n {emoji: '🕍'}\n )\n );\n\n if (pesach.getDay() === SUN) {\n add(\n new HolidayEvent(\n new HDate(16, ADAR_II, year),\n hdesc.PURIM_MESHULASH,\n MINOR_HOLIDAY\n )\n );\n }\n\n if (HDate.isLeapYear(year)) {\n add(\n new HolidayEvent(\n new HDate(14, ADAR_I, year),\n hdesc.PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n add(\n new HolidayEvent(\n new HDate(15, ADAR_I, year),\n hdesc.SHUSHAN_PURIM_KATAN,\n MINOR_HOLIDAY,\n {emoji: '🎭️'}\n )\n );\n }\n\n const nisan27dt = dateYomHaShoah(year);\n if (nisan27dt) {\n add(new HolidayEvent(nisan27dt, hdesc.YOM_HASHOAH, MODERN_HOLIDAY));\n }\n\n const yomHaZikaronDt = dateYomHaZikaron(year);\n if (yomHaZikaronDt) {\n add(\n new HolidayEvent(\n yomHaZikaronDt,\n hdesc.YOM_HAZIKARON,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n ),\n new HolidayEvent(\n yomHaZikaronDt.next(),\n hdesc.YOM_HAATZMA_UT,\n MODERN_HOLIDAY,\n emojiIsraelFlag\n )\n );\n }\n\n for (const h of staticModernHolidays) {\n if (year >= h.firstYear) {\n let hd = new HDate(h.dd, h.mm, year);\n const dow = hd.getDay();\n if (h.friSatMovetoThu && (dow === FRI || dow === SAT)) {\n hd = hd.onOrBefore(THU);\n } else if (h.friPostponeToSun && dow === FRI) {\n hd = new HDate(hd.abs() + 2);\n } else if (h.satPostponeToSun && dow === SAT) {\n hd = hd.next();\n }\n const mask = h.chul ? MODERN_HOLIDAY : MODERN_HOLIDAY | IL_ONLY;\n const ev = new HolidayEvent(hd, h.desc, mask);\n if (!h.suppressEmoji) {\n ev.emoji = '🇮🇱';\n }\n add(ev);\n }\n }\n\n let tamuz17 = new HDate(17, TAMUZ, year);\n let tamuz17attrs;\n if (tamuz17.getDay() === SAT) {\n tamuz17 = new HDate(18, TAMUZ, year);\n tamuz17attrs = {observed: true};\n }\n add(new HolidayEvent(tamuz17, hdesc.TZOM_TAMMUZ, MINOR_FAST, tamuz17attrs));\n\n let av9dt = new HDate(9, AV, year);\n let av9title = hdesc.TISHA_BAV;\n let av9attrs;\n if (av9dt.getDay() === SAT) {\n av9dt = av9dt.next();\n av9attrs = {observed: true};\n av9title += ' (observed)';\n }\n const av9abs = av9dt.abs();\n add(\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs)),\n hdesc.SHABBAT_CHAZON,\n SPECIAL_SHABBAT\n ),\n new HolidayEvent(\n av9dt.prev(),\n hdesc.EREV_TISHA_BAV,\n EREV | MAJOR_FAST,\n av9attrs\n ),\n new HolidayEvent(av9dt, av9title, MAJOR_FAST, av9attrs),\n new HolidayEvent(\n new HDate(HDate.dayOnOrBefore(SAT, av9abs + 7)),\n hdesc.SHABBAT_NACHAMU,\n SPECIAL_SHABBAT\n )\n );\n\n const monthsInYear = HDate.monthsInYear(year);\n for (let month = 1; month <= monthsInYear; month++) {\n const monthName = HDate.getMonthName(month, year);\n if (\n (month === NISAN\n ? HDate.daysInMonth(HDate.monthsInYear(year - 1), year - 1)\n : HDate.daysInMonth(month - 1, year)) === 30\n ) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n add(new RoshChodeshEvent(new HDate(30, month - 1, year), monthName));\n } else if (month !== TISHREI) {\n add(new RoshChodeshEvent(new HDate(1, month, year), monthName));\n }\n }\n\n // Begin: Yom Kippur Katan\n // start at Iyyar because one may not fast during Nisan\n for (let month = months.IYYAR; month <= monthsInYear; month++) {\n const nextMonth = month + 1;\n // Yom Kippur Katan is not observed on the day before Rosh Hashanah.\n // Not observed prior to Rosh Chodesh Cheshvan because Yom Kippur has just passed.\n // Not observed before Rosh Chodesh Tevet, because that day is Hanukkah.\n if (\n nextMonth === TISHREI ||\n nextMonth === months.CHESHVAN ||\n nextMonth === TEVET\n ) {\n continue;\n }\n let ykk = new HDate(29, month, year);\n const dow = ykk.getDay();\n if (dow === FRI || dow === SAT) {\n ykk = ykk.onOrBefore(THU);\n }\n\n const nextMonthName = HDate.getMonthName(nextMonth, year);\n const ev = new YomKippurKatanEvent(ykk, nextMonthName);\n add(ev);\n }\n\n for (const month of [CHESHVAN, IYYAR]) {\n const roshChodesh = new HDate(1, month, year);\n let shabbos = new HDate(HDate.dayOnOrBefore(SAT, roshChodesh.abs() + 6));\n if (shabbos.abs() === roshChodesh.abs()) {\n shabbos = new HDate(shabbos.abs() + 7);\n }\n const fastDays = [2, 5, 9].map(offset => new HDate(shabbos.abs() + offset));\n if (month === IYYAR && fastDays[2].getDate() === 14) {\n fastDays[2] = new HDate(17, IYYAR, year);\n }\n for (const hd of fastDays) {\n add(new HolidayEvent(hd, hdesc.TAANIT_BEHAB, MINOR_FAST | BEHAB));\n }\n }\n\n const sedra = getSedra(year, false);\n const beshalachHd = sedra.find(15) as HDate;\n add(new HolidayEvent(beshalachHd, hdesc.SHABBAT_SHIRAH, SPECIAL_SHABBAT));\n\n // Birkat Hachamah appears only once every 28 years\n const birkatHaChama = getBirkatHaChama(year);\n if (birkatHaChama) {\n const hd = new HDate(birkatHaChama);\n add(new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'}));\n }\n\n yearCache.set(year, map);\n return map;\n}\n\n/**\n * Birkat Hachamah appears only once every 28 years.\n * Although almost always in Nisan, it can occur in Adar II.\n * - 27 Adar II 5461 (Gregorian year 1701)\n * - 29 Adar II 5993 (Gregorian year 2233)\n *\n * Due to drift, this will eventually slip into Iyyar\n * - 2 Iyyar 7141 (Gregorian year 3381)\n * @private\n */\nfunction getBirkatHaChama(year: number): number {\n const leap = HDate.isLeapYear(year);\n const startMonth = leap ? ADAR_II : NISAN;\n const startDay = leap ? 20 : 1;\n const baseRd = HDate.hebrew2abs(year, startMonth, startDay);\n for (let day = 0; day <= 40; day++) {\n const abs = baseRd + day;\n const elapsed = abs + 1373429;\n if (elapsed % 10227 === 172) {\n return abs;\n }\n }\n return 0;\n}\n\n/**\n * Returns a sorted array of holidays observed during the given Hebrew year,\n * filtered by Israel vs. Diaspora schedule.\n *\n * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * Use {@link calendar} for those.\n * @example\n * import {getHolidaysForYearArray} from '@hebcal/core';\n * const events = getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n const yearMap = getHolidaysForYear_(year);\n const startAbs = HDate.hebrew2abs(year, TISHREI, 1);\n const endAbs = HDate.hebrew2abs(year + 1, TISHREI, 1) - 1;\n let events: HolidayEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt++) {\n const hd = new HDate(absDt);\n const holidays = yearMap.get(hd.toString());\n if (holidays) {\n const filtered: HolidayEvent[] = holidays.filter(ev => ev.observedIn(il));\n events = events.concat(filtered);\n }\n }\n return events;\n}\n","import {HDate, months} from '@hebcal/hdate';\n\nconst NISAN = months.NISAN;\nconst SIVAN = months.SIVAN;\nconst TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst SAT = 6;\n\nfunction getHDate(date: HDate | Date | number): HDate {\n return HDate.isHDate(date) ? (date as HDate) : new HDate(date);\n}\n\nfunction isSefiratHaOmer(hd: HDate): boolean {\n const hyear = hd.getFullYear();\n const beginOmer = new HDate(16, NISAN, hyear).abs();\n const endOmer = new HDate(5, SIVAN, hyear).abs();\n const abs = hd.abs();\n return abs >= beginOmer && abs <= endOmer;\n}\n\nfunction isBeinHaMetzarim(hd: HDate): boolean {\n const hyear = hd.getFullYear();\n const begin = new HDate(17, TAMUZ, hyear).abs();\n const tishaBav = new HDate(9, AV, hyear);\n const end =\n tishaBav.getDay() === SAT ? new HDate(10, AV, hyear).abs() : tishaBav.abs();\n const abs = hd.abs();\n return abs >= begin && abs <= end;\n}\n\n/**\n * Returns `true` if the given date falls within a public period of communal\n * mourning — specifically:\n *\n * - **Sefirat HaOmer**: 16 Nisan through 5 Sivan (the 49 days of the Omer).\n * - **Bein HaMetzarim** (\"between the straits\"): 17 Tammuz through 9 Av\n * (10 Av when 9 Av is postponed because it falls on Shabbat).\n *\n * This is a broad helper — it does not attempt to model minhag-specific\n * exceptions within those periods (e.g. Lag BaOmer, Rosh Chodesh Iyar,\n * the distinction between Sephardic and Ashkenazic customs on which\n * portion of the Omer is observed as mourning, etc.).\n * @example\n * import {isAveilut, HDate, months} from '@hebcal/core';\n * isAveilut(new HDate(20, months.NISAN, 5784)); // true (Omer)\n * isAveilut(new HDate(25, months.TAMUZ, 5784)); // true (Three Weeks)\n * isAveilut(new HDate(15, months.AV, 5784)); // false\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @return `true` if the date is during a mourning period\n */\nexport function isAveilut(date: HDate | Date | number): boolean {\n const hd = getHDate(date);\n return isSefiratHaOmer(hd) || isBeinHaMetzarim(hd);\n}\n","import {HDate, Locale} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event} from './event.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {Zmanim} from './zmanim.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst HAVDALAH = hdesc.HAVDALAH;\nconst CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;\n\n/**\n * Base class for events that have an associated wall-clock time and\n * geographic location — for example, candle lighting, havdalah, and\n * fast begin/end times.\n *\n * Stores both a `Date` (`eventTime`) and pre-formatted 24-hour\n * (`eventTimeStr`) and locale-aware (`fmtTime`) strings. May reference a\n * \"linked\" event such as the holiday whose candle-lighting time this\n * represents.\n */\nexport class TimedEvent extends Event {\n /** The exact moment of the event, rounded to the nearest minute */\n readonly eventTime: Date;\n /** Geographic location used to compute `eventTime` */\n readonly location: Location;\n /** 24-hour formatted time string in the location's timezone (e.g. `\"19:42\"`) */\n readonly eventTimeStr: string;\n /** Locale-aware formatted time string (e.g. `\"7:42pm\"` in US locale) */\n readonly fmtTime: string;\n /** Optional event this time is associated with (e.g. the Yom Tov being lit for) */\n readonly linkedEvent?: Event;\n /**\n * Optional length of the event in minutes. Not computed or validated by\n * this class; it's a plain count of minutes for downstream renderers\n * (e.g. `@hebcal/icalendar`) to add to the event's start wall-clock time\n * when producing a non-zero-duration `DTEND`. Undefined means no\n * duration was specified.\n */\n duration?: number;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param date Hebrew date the event occurs\n * @param desc Description (not translated)\n * @param mask optional holiday flags\n * @param eventTime the exact moment of the event\n * @param location geographic location used to format the time\n * @param linkedEvent optional event this time is associated with\n * @param options optional; `locale` and `hour12` affect {@link fmtTime}\n */\n constructor(\n date: HDate,\n desc: string,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, desc, mask);\n this.eventTime = Zmanim.roundTime(eventTime);\n this.location = location;\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n const opts = {...options, location};\n this.fmtTime = reformatTimeStr(this.eventTimeStr, 'pm', opts);\n if (linkedEvent !== undefined) {\n this.linkedEvent = linkedEvent;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Candle lighting\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return Locale.gettext(this.getDesc(), locale);\n }\n\n getCategories(): string[] {\n const desc = this.getDesc();\n switch (desc) {\n // LIGHT_CANDLES or LIGHT_CANDLES_TZEIS\n case CANDLE_LIGHTING:\n return ['candles'];\n // YOM_TOV_ENDS\n case HAVDALAH:\n return ['havdalah'];\n // flags.MINOR_FAST or flags.MAJOR_FAST\n case hdesc.FAST_BEGINS:\n case hdesc.FAST_ENDS:\n return ['zmanim', 'fast'];\n case hdesc.SOF_ZMAN_ACHILAT_CHAMETZ:\n return ['zmanim', 'achilasChametz'];\n case hdesc.BIUR_CHAMETZ:\n return ['zmanim', 'biurChametz'];\n }\n /* NOTREACHED */\n return ['unknown'];\n }\n}\n\n/**\n * Candle-lighting event for the eve of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default candle lighting\n * occurs 18 minutes before sundown in the Diaspora and 20 minutes before\n * sundown in Israel (40 minutes in Jerusalem; 30 minutes in Haifa and\n * Zikhron Ya'akov), configurable via `options.candleLightingMins`.\n */\nexport class CandleLightingEvent extends TimedEvent {\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, CANDLE_LIGHTING, mask, eventTime, location, linkedEvent, options);\n }\n\n getEmoji(): string {\n return '🕯️';\n }\n}\n\n/**\n * Havdalah event marking the end of Shabbat or a Yom Tov.\n *\n * Generated by {@link calendar} when `options.candlelighting`\n * is `true` and `options.location` is provided. By default Havdalah is\n * calculated by *tzeit hakochavim* (8.5° solar depression); pass\n * `options.havdalahMins` to use a fixed minute offset instead, or\n * `options.havdalahDeg` to use a different degree.\n */\nexport class HavdalahEvent extends TimedEvent {\n private readonly havdalahMins?: number;\n constructor(\n date: HDate,\n mask: number,\n eventTime: Date,\n location: Location,\n havdalahMins?: number,\n linkedEvent?: Event,\n options?: CalOptions\n ) {\n super(date, HAVDALAH, mask, eventTime, location, linkedEvent, options);\n if (havdalahMins) {\n this.havdalahMins = havdalahMins;\n }\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n return this.renderBrief(locale) + ': ' + this.fmtTime;\n }\n /**\n * Returns translation of \"Havdalah\" without the time.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n let str = Locale.gettext(this.getDesc(), locale);\n if (this.havdalahMins) {\n const min = Locale.gettext('min', locale);\n str += ` (${this.havdalahMins} ${min})`;\n }\n return str;\n }\n\n getEmoji(): string {\n return '✨';\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\nimport {Location} from './location.js';\nimport {Event, flags} from './event.js';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent.js';\nimport {Zmanim} from './zmanim.js';\nimport {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\n\n/**\n * @private\n */\nexport function makeCandleEvent(\n ev: Event | undefined,\n hd: HDate,\n options: CalOptions,\n isFriday: boolean,\n isSaturday: boolean\n): TimedEvent | undefined {\n let havdalahTitle = false;\n let useHavdalahOffset = isSaturday;\n let mask = ev ? ev.mask : LIGHT_CANDLES;\n if (ev !== undefined) {\n // if linked event && dow == FRI, use Candle lighting time & title\n if (!isFriday) {\n if (ev.hasAnyFlag('LIGHT_CANDLES_TZEIS', 'CHANUKAH_CANDLES')) {\n useHavdalahOffset = true;\n } else if (ev.hasFlag('YOM_TOV_ENDS')) {\n havdalahTitle = true;\n useHavdalahOffset = true;\n }\n }\n } else if (isSaturday) {\n havdalahTitle = true;\n mask = LIGHT_CANDLES_TZEIS;\n }\n // if Havdalah offset is 0 or undefined, we'll use tzeit time\n const offset = useHavdalahOffset\n ? Number(options.havdalahMins)\n : Number(options.candleLightingMins);\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd, useElevation);\n const time =\n useHavdalahOffset && !offset\n ? zmanim.tzeit(options.havdalahDeg)\n : zmanim.sunsetOffset(offset, true);\n if (isNaN(time.getTime())) {\n return undefined; // no sunset\n }\n if (havdalahTitle) {\n return new HavdalahEvent(\n hd,\n mask,\n time,\n location,\n options.havdalahMins,\n ev,\n options\n );\n } else {\n mask |= LIGHT_CANDLES;\n return new CandleLightingEvent(hd, mask, time, location, ev, options);\n }\n}\n\nconst FAST_BEGINS = hdesc.FAST_BEGINS;\nconst FAST_ENDS = hdesc.FAST_ENDS;\n\n/**\n * Tzeit HaKochavim as calculated by Rabbi Yechiel Michel Tucazinsky,\n * 6.45° below geometric zenith. Default end time for Tish'a B'Av.\n * @private\n */\nconst TZEIT_TUCAZINSKY = 6.45;\n\n/**\n * Observation of 3 medium-sized stars, 7.0833333° below geometric zenith.\n * Default end time for minor fasts in the Diaspora.\n * @private\n */\nconst TZEIT_3MEDIUM_STARS = 7.0833333;\n\n/**\n * Minutes after sunset that minor fasts (including Yom Kippur Katan) end in\n * Israel by default, following Rabbi Deblitzky's practice.\n * @see {https://www.yeshiva.org.il/calendar/timeprinciples}\n * @private\n */\nconst MINOR_FAST_END_MINUTES_IL = 15;\n\n/**\n * Computes the \"Fast ends\" time for a fast day.\n *\n * Tish'a B'Av always ends at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky),\n * regardless of `options`.\n *\n * For minor fasts: when `options.fastEndMins` is a nonzero number, the fast\n * ends that many minutes after sunset; otherwise, when `options.fastEndDeg` is\n * a nonzero number, the fast ends at tzeit for that solar depression angle.\n * When neither is specified, the default depends on `options.il`:\n * - In Israel, minor fasts end 15 minutes after sunset (Rabbi Deblitzky's practice).\n * - Elsewhere, minor fasts end at tzeit 7.083° (3 medium-sized stars).\n * @private\n */\nfunction makeFastEndTime(\n zmanim: Zmanim,\n isTishaBav: boolean,\n options: CalOptions\n): Date {\n if (isTishaBav) {\n return zmanim.tzeit(TZEIT_TUCAZINSKY);\n }\n const fastEndMins = options.fastEndMins;\n if (typeof fastEndMins === 'number' && fastEndMins !== 0) {\n return zmanim.sunsetOffset(Math.abs(fastEndMins), true);\n }\n const fastEndDeg = options.fastEndDeg;\n if (typeof fastEndDeg === 'number' && fastEndDeg !== 0) {\n return zmanim.tzeit(Math.abs(fastEndDeg));\n }\n if (options.il) {\n return zmanim.sunsetOffset(MINOR_FAST_END_MINUTES_IL, true);\n }\n return zmanim.tzeit(TZEIT_3MEDIUM_STARS);\n}\n\n/**\n * A fast day holiday with attached start and end time events.\n *\n * Wraps an underlying fast-day {@link HolidayEvent} and (when computable\n * for the given location) exposes a \"Fast begins\" and \"Fast ends\"\n * {@link TimedEvent}. Generated by {@link calendar} when\n * `options.candlelighting` is `true` and `options.location` is provided.\n *\n * - Minor fasts (including Yom Kippur Katan) begin at *Alot HaShachar*\n * (16.1° below horizon in the morning). By default they end at tzeit\n * 7.083° (3 medium-sized stars) in the Diaspora, or 15 minutes after\n * sunset in Israel (Rabbi Deblitzky's practice). This can be overridden\n * via `options.fastEndDeg` or `options.fastEndMins`.\n * - Tish'a B'Av begins at sunset on the previous day and always ends at tzeit\n * 6.45° below horizon (Rabbi Yechiel Michel Tucazinsky), regardless of\n * `options.fastEndDeg` / `options.fastEndMins`.\n * - When a minor fast falls on a Friday, the end time is suppressed\n * (Shabbat begins before nightfall).\n */\nexport class FastDayEvent extends HolidayEvent {\n /** original event */\n readonly linkedEvent: HolidayEvent;\n /** this will be a \"Fast begins\" event */\n readonly startEvent?: TimedEvent;\n /** this will be a \"Fast ends\" event */\n readonly endEvent?: TimedEvent;\n constructor(\n linkedEvent: HolidayEvent,\n startEvent?: TimedEvent,\n endEvent?: TimedEvent\n ) {\n super(linkedEvent.getDate(), linkedEvent.getDesc(), linkedEvent.mask);\n this.linkedEvent = linkedEvent;\n this.startEvent = startEvent;\n this.endEvent = endEvent;\n }\n render(locale?: string): string {\n return this.linkedEvent.render(locale);\n }\n renderBrief(locale?: string): string {\n return this.linkedEvent.renderBrief(locale);\n }\n urlDateSuffix(): string {\n return this.linkedEvent.urlDateSuffix();\n }\n url(): string | undefined {\n return this.linkedEvent.url();\n }\n getEmoji(): string {\n return this.linkedEvent.getEmoji();\n }\n getCategories(): string[] {\n return this.linkedEvent.getCategories();\n }\n}\n\n/**\n * Makes a pair of events representing fast start and end times\n * @private\n */\nexport function makeFastStartEnd(\n ev: HolidayEvent,\n options: CalOptions\n): FastDayEvent {\n const desc = ev.getDesc();\n if (desc === 'Yom Kippur') {\n throw new RangeError('YK does not require this function');\n }\n const hd = ev.getDate();\n const dt = hd.greg();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, dt, useElevation);\n let startEvent;\n let endEvent;\n if (desc === \"Erev Tish'a B'Av\") {\n const sunset = zmanim.sunset();\n if (!isNaN(sunset.getTime())) {\n startEvent = makeTimedEvent(ev, sunset, FAST_BEGINS, options);\n }\n } else if (desc.startsWith(\"Tish'a B'Av\")) {\n const fastEnd = makeFastEndTime(zmanim, true, options);\n if (!isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n } else {\n const dawn = zmanim.alotHaShachar();\n if (!isNaN(dawn.getTime())) {\n startEvent = makeTimedEvent(ev, dawn, FAST_BEGINS, options);\n }\n if (\n dt.getDay() !== 5 &&\n !(hd.getDate() === 14 && hd.getMonth() === months.NISAN)\n ) {\n const fastEnd = makeFastEndTime(zmanim, false, options);\n if (!isNaN(fastEnd.getTime())) {\n endEvent = makeTimedEvent(ev, fastEnd, FAST_ENDS, options);\n }\n }\n }\n const ev2 = new FastDayEvent(ev, startEvent, endEvent);\n // copy properties such as memo or emoji\n Object.assign(ev2, ev);\n return ev2;\n}\n\n/**\n * @private\n */\nfunction makeTimedEvent(\n ev: Event,\n time: Date,\n desc: string,\n options: CalOptions\n): TimedEvent {\n const location = options.location as Location;\n const hd = ev.getDate();\n return new TimedEvent(hd, desc, ev.mask, time, location, ev, options);\n}\n\n/**\n * A Chanukah candle-lighting event that carries a specific time of day.\n *\n * Generated by {@link calendar} when both `options.candlelighting`\n * and `options.location` are set. On weekdays the time is Bein HaShmashos\n * (13.5 minutes before the sun is 7.083° below the horizon in the evening);\n * on Friday it is regular candle-lighting time, and on Saturday night it is\n * regular Havdalah time.\n */\nexport class TimedChanukahEvent extends ChanukahEvent {\n /** Time at which candles are lit, rounded to the nearest minute */\n eventTime: Date;\n /** {@link eventTime} formatted for the event's location, e.g. `'4:31pm'` */\n eventTimeStr: string;\n /** Location used to calculate {@link eventTime} */\n readonly location: Location;\n /**\n * Normally created by {@link calendar} rather than directly.\n * @param ev the untimed Chanukah event this is derived from\n * @param eventTime time at which candles are lit\n * @param location location used to format the time\n */\n constructor(ev: ChanukahEvent, eventTime: Date, location: Location) {\n super(ev.getDate(), ev.getDesc(), ev.mask, ev.chanukahDay);\n this.eventTime = Zmanim.roundTime(eventTime);\n const timeFormat = location.getTimeFormatter();\n this.eventTimeStr = Zmanim.formatTime(this.eventTime, timeFormat);\n this.location = location;\n this.emoji = ev.emoji;\n }\n}\n\n/**\n * Makes a candle-lighting event for Chankah (not on Friday/Saturday).\n * At one point this used civil dusk (6 degrees below horizon).\n * Another source suggests 4.6667 degrees below horizon.\n * @private\n */\nexport function makeWeekdayChanukahCandleLighting(\n ev: ChanukahEvent,\n options: CalOptions\n): TimedChanukahEvent | null {\n const hd = ev.getDate();\n const location = options.location as Location;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd.greg(), useElevation);\n const candleLightingTime = zmanim.beinHaShmashos();\n if (isNaN(candleLightingTime.getTime())) {\n return null;\n }\n return new TimedChanukahEvent(ev, candleLightingTime, location);\n}\n","export default\n{\n \"ps67lines\": [\n \"אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה\",\n \"לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ\",\n \"יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם\",\n \"יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה\",\n \"יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם\",\n \"אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ\",\n \"יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ\"\n ],\n \"lamnatzeachLetters\": \"ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה\",\n \"anaBekoach\": [\n \"אָנָּא\",\n \"בְּכֹחַ\",\n \"גְּדֻלַּת\",\n \"יְמִינְךָ\",\n \"תַּתִּיר\",\n \"צְרוּרָה\",\n \"אב״ג ית״ץ\",\n\n \"קַבֵּל\",\n \"רִנַּת\",\n \"עַמְּךָ\",\n \"שַׂגְּבֵנוּ\",\n \"טַהֲרֵנוּ\",\n \"נוֹרָא\",\n \"קר״ע שט״ן\",\n\n \"נָא\",\n \"גִבּוֹר\",\n \"דּוֹרְשֵׁי\",\n \"יִחוּדְךָ\",\n \"כְּבָבַת\",\n \"שָׁמְרֵם\",\n \"נג״ד יכ״ש\",\n\n \"בָּרְכֵם\",\n \"טַהֲרֵם\",\n \"רַחֲמֵי\",\n \"צִדְקָתְךָ\",\n \"תָּמִיד\",\n \"גָּמְלֵם\",\n \"בט״ר צת״ג\",\n\n \"חֲסִין\",\n \"קָדוֹשׁ\",\n \"בְּרֹב\",\n \"טוּבְךָ\",\n \"נַהֵל\",\n \"עֲדָתֶךָ\",\n \"חק״ב תנ״ע\",\n\n \"יָחִיד\",\n \"גֵּאֶה\",\n \"לְעַמְּךָ\",\n \"פְּנֵה\",\n \"זוֹכְרֵי\",\n \"קְדֻשָּׁתֶךָ\",\n \"יג״ל פז״ק\",\n\n \"שַׁוְעָתֵנוּ\",\n \"קַבֵּל\",\n \"וּשְׁמַע\",\n \"צַעֲקָתֵנוּ\",\n \"יוֹדֵעַ\",\n \"תַּעֲלוּמוֹת\",\n \"שק״ו צי״ת\"\n ]\n}\n","import {HDate, Locale, gematriya} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\nimport sefira from './sefira.json.js';\n\n/**\n * Language for counting the Omer can be English or Hebrew.\n * Lang for the Sefira can be English, Hebrew, or Hebrew in Sephardic transliteration.\n */\nexport type OmerLang = 'en' | 'he' | 'translit';\n\nconst sefirot = {\n en: {\n infix: 'within ',\n infix26: 'within ',\n words: [\n '',\n 'Lovingkindness',\n 'Might',\n 'Beauty',\n 'Eternity',\n 'Splendor',\n 'Foundation',\n 'Majesty',\n ],\n pfxWords: null,\n },\n he: {\n infix: null,\n infix26: null,\n words: [\n '',\n 'חֶֽסֶד',\n 'גְּבוּרָה',\n 'תִּפְאֶֽרֶת',\n 'נֶּֽצַח',\n 'הוֹד',\n 'יְּסוֹד',\n 'מַלְכוּת',\n ],\n pfxWords: [\n '',\n 'שֶׁבְּחֶֽסֶד',\n 'שֶׁבִּגְבוּרָה',\n 'שֶׁבְּתִפְאֶֽרֶת',\n 'שֶׁבְּנֶֽצַח',\n 'שֶׁבְּהוֹד',\n 'שֶׁבִּיְסוֹד',\n 'שֶׁבְּמַלְכוּת',\n ],\n },\n translit: {\n infix: \"sheb'\",\n infix26: 'shebi',\n words: [\n '',\n 'Chesed',\n 'Gevurah',\n 'Tiferet',\n 'Netzach',\n 'Hod',\n 'Yesod',\n 'Malkhut',\n ],\n pfxWords: null,\n },\n} as const;\n\nfunction checkDay(omerDay: number): void {\n if (omerDay < 1 || omerDay > 49) {\n throw new RangeError(`Invalid Omer day ${omerDay}`);\n }\n}\n\nfunction getWeeks(omerDay: number): number[] {\n const weekNum: number = Math.floor((omerDay - 1) / 7) + 1;\n const daysWithinWeeks: number = omerDay % 7 || 7;\n return [weekNum, daysWithinWeeks];\n}\n\nfunction omerTodayIsEn(omerDay: number): string {\n const [weekNumber, daysWithinWeeks]: number[] = getWeeks(omerDay);\n\n const totalDaysStr: string = omerDay === 1 ? 'day' : 'days';\n let str = `Today is ${omerDay} ${totalDaysStr}`;\n\n if (weekNumber > 1 || omerDay === 7) {\n const day7: boolean = daysWithinWeeks === 7;\n const numWeeks: number = day7 ? weekNumber : weekNumber - 1;\n const weeksStr: string = numWeeks === 1 ? 'week' : 'weeks';\n str += `, which are ${numWeeks} ${weeksStr}`;\n if (!day7) {\n const daysStr: string = daysWithinWeeks === 1 ? 'day' : 'days';\n str += ` and ${daysWithinWeeks} ${daysStr}`;\n }\n }\n return str + ' of the Omer';\n}\n\n// adapted from pip hdate package (GPL)\n// https://github.com/py-libhdate/py-libhdate/blob/master/hdate/date.py\n\nconst tens = ['', 'עֲשָׂרָה', 'עֶשְׂרִים', 'שְׁלוֹשִׁים', 'אַרְבָּעִים'];\nconst ones = [\n '',\n 'אֶחָד',\n 'שְׁנַיִם',\n 'שְׁלוֹשָׁה',\n 'אַרְבָּעָה',\n 'חֲמִשָּׁה',\n 'שִׁשָּׁה',\n 'שִׁבְעָה',\n 'שְׁמוֹנָה',\n 'תִּשְׁעָה',\n];\n\nconst shnei = 'שְׁנֵי';\nconst yamim = 'יָמִים';\nconst shneiYamim = shnei + ' ' + yamim;\nconst shavuot = 'שָׁבוּעוֹת';\nconst yom = 'יוֹם';\nconst yomEchad = yom + ' ' + ones[1];\nconst asar = 'עָשָׂר';\n\nfunction omerTodayIsHe(omerDay: number): string {\n const ten: number = Math.floor(omerDay / 10);\n const one: number = omerDay % 10;\n let str = 'הַיּוֹם ';\n if (omerDay === 11) {\n str += 'אַחַד ' + asar;\n } else if (omerDay === 12) {\n str += 'שְׁנֵים ' + asar;\n } else if (12 < omerDay && omerDay < 20) {\n str += ones[one] + ' ' + asar;\n } else if (omerDay > 9) {\n str += ones[one];\n if (one) {\n str += ' ';\n str += ten === 3 ? 'וּ' : 'וְ';\n }\n }\n if (omerDay > 2) {\n if (omerDay > 20 || omerDay === 10 || omerDay === 20) {\n str += tens[ten];\n }\n if (omerDay < 11) {\n str += ones[one] + ' ' + yamim + ' ';\n } else {\n str += ' ' + yom + ' ';\n }\n } else if (omerDay === 1) {\n str += yomEchad + ' ';\n } else {\n // omer == 2\n str += shneiYamim + ' ';\n }\n if (omerDay > 6) {\n str = str.trim(); // remove trailing space before comma\n str += ', שֶׁהֵם ';\n const weeks: number = Math.floor(omerDay / 7);\n const days: number = omerDay % 7;\n if (weeks > 2) {\n str += ones[weeks] + ' ' + shavuot + ' ';\n } else if (weeks === 1) {\n str += 'שָׁבֽוּעַ' + ' ' + ones[1] + ' ';\n } else {\n // weeks == 2\n str += shnei + ' ' + shavuot + ' ';\n }\n if (days) {\n if (days === 2 || days === 3) {\n str += 'וּ';\n } else if (days === 5) {\n str += 'וַ';\n } else {\n str += 'וְ';\n }\n if (days > 2) {\n str += ones[days] + ' ' + yamim + ' ';\n } else if (days === 1) {\n str += yomEchad + ' ';\n } else {\n // days == 2\n str += shneiYamim + ' ';\n }\n }\n }\n str += 'לָעֽוֹמֶר';\n return str.normalize();\n}\n\nconst anaBekoach = sefira.anaBekoach;\n\nconst ps67lines = sefira.ps67lines;\n\nconst lamnatzeach = ps67lines.flatMap((x: string) => x.split(/[ ־]/));\n\nconst lamnatzeachLetters = sefira.lamnatzeachLetters.split('');\n\n/**\n * Represents one of the 49 days of counting the Omer between Pesach and\n * Shavuot (16 Nisan through 5 Sivan).\n *\n * Each day has an associated Sefirah pairing (e.g. *Chesed shebiGevurah*),\n * a word from Psalm 67 (Lamnatzeach), a letter from verse 5 of Psalm 67,\n * and a word/acrostic from the Ana BeKoach prayer — all accessible via\n * the methods on this class.\n *\n * @example\n * import {OmerEvent, HDate, months} from '@hebcal/core';\n * const ev = new OmerEvent(new HDate(16, months.NISAN, 5784), 1);\n * ev.render('en'); // '1st day of the Omer'\n * ev.render('he'); // 'א׳ בָּעוֹמֶר'\n * ev.sefira('translit'); // \"Chesed sheb'Chesed\"\n * ev.getTodayIs('en'); // 'Today is 1 day of the Omer'\n */\nexport class OmerEvent extends Event {\n private readonly weekNumber: number;\n private readonly daysWithinWeeks: number;\n readonly omer: number;\n\n /**\n * Constructs an Omer event for a given day (1–49).\n *\n * Throws `RangeError` if `omerDay` is outside 1–49.\n * @param date Hebrew date this Omer day is counted on (the evening of)\n * @param omerDay day of the Omer, 1 through 49\n */\n constructor(date: HDate, omerDay: number) {\n super(date, `Omer ${omerDay}`, flags.OMER_COUNT);\n checkDay(omerDay);\n this.weekNumber = Math.floor((omerDay - 1) / 7) + 1;\n this.daysWithinWeeks = omerDay % 7 || 7;\n this.omer = omerDay;\n }\n\n /**\n * Returns the Sefirah pairing associated with this Omer day —\n * one of the seven lower Sefirot within another, calculated as\n * `day-within-week` of `week-within-cycle`. For example, on day 8\n * (week 2, day 1):\n * * חֶֽסֶד שֶׁבִּגְבוּרָה\n * * Chesed shebiGevurah\n * * Lovingkindness within Might\n * @example\n * import {OmerEvent, HDate, months} from '@hebcal/core';\n * const day8 = new OmerEvent(new HDate(23, months.NISAN, 5784), 8);\n * day8.sefira('en'); // 'Lovingkindness within Might'\n * day8.sefira('he'); // 'חֶֽסֶד שֶׁבִּגְבוּרָה'\n * day8.sefira('translit'); // 'Chesed shebiGevurah'\n * @param lang `en` (English), `he` (Hebrew with nikud), or `translit` (Hebrew in Sephardic transliteration)\n * @returns a string such as `Lovingkindness within Might` or `חֶֽסֶד שֶׁבִּגְבוּרָה`\n */\n sefira(lang: OmerLang = 'en'): string {\n if (lang !== 'he' && lang !== 'translit') {\n lang = 'en';\n }\n const [weekNum, daysWithinWeeks]: number[] = getWeeks(this.omer);\n const config = sefirot[lang as OmerLang];\n const pfxWords = config.pfxWords;\n const words = config.words;\n const week = pfxWords ? pfxWords[weekNum] : words[weekNum];\n const dayWithinWeek = words[daysWithinWeeks];\n const infix = pfxWords\n ? ''\n : weekNum === 2 || weekNum === 6\n ? config.infix26\n : config.infix;\n return (dayWithinWeek + ' ' + infix + week).normalize();\n }\n /**\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const isHebrewLocale = Locale.isHebrewLocale(locale);\n const omer = this.omer;\n const nth = isHebrewLocale ? gematriya(omer) : Locale.ordinal(omer, locale);\n return nth + ' ' + Locale.gettext('day of the Omer', locale);\n }\n /**\n * Returns translation of \"Omer day 22\" without ordinal numbers.\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n return (\n Locale.gettext('Omer', locale) +\n ' ' +\n Locale.gettext('day', locale) +\n ' ' +\n this.omer\n );\n }\n /**\n * Returns an emoji number symbol with a circle, for example `㊲`\n * from the “Enclosed CJK Letters and Months” block of the Unicode standard\n * @returns a single Unicode character from `①` through `㊾`\n */\n getEmoji(): string {\n if (typeof this.emoji === 'string') return this.emoji;\n let codePoint: number;\n const omerDay = this.omer;\n if (omerDay <= 20) {\n codePoint = 9312 + omerDay - 1;\n } else if (omerDay <= 35) {\n // between 21 and 35 inclusive\n codePoint = 12881 + omerDay - 21;\n } else {\n // between 36 and 49 inclusive\n codePoint = 12977 + omerDay - 36;\n }\n return String.fromCodePoint(codePoint);\n }\n\n /**\n * Number of *completed* weeks of the Omer. On day 7 this returns `1`; on\n * day 8 it also returns `1`, because the second week is still in progress.\n * Pair with {@link getDaysWithinWeeks} to render \"N weeks and M days\".\n */\n getWeeks(): number {\n const day7 = this.daysWithinWeeks === 7;\n return day7 ? this.weekNumber : this.weekNumber - 1;\n }\n\n /**\n * Day within the current week, from `1` through `7`.\n */\n getDaysWithinWeeks(): number {\n return this.daysWithinWeeks;\n }\n /**\n * Returns a sentence with that evening's omer count\n * @example\n * import {OmerEvent, HDate, months} from '@hebcal/core';\n * const ev = new OmerEvent(new HDate(25, months.NISAN, 5784), 10);\n * ev.getTodayIs('en');\n * // => 'Today is 10 days, which are 1 week and 3 days of the Omer'\n * ev.getTodayIs('he');\n * // => 'הַיּוֹם עֲשָׂרָה יָמִים, שֶׁהֵם שָׁבֽוּעַ אֶחָד וּשְׁלוֹשָׁה יָמִים לָעֽוֹמֶר'\n * @param locale locale name; Hebrew locales (`he`, `he-x-NoNikud`) produce\n * the Hebrew formula, anything else produces English. Defaults to `en`\n * when empty.\n */\n getTodayIs(locale: string): string {\n locale = (locale || 'en').toLowerCase();\n const isHebrew = Locale.isHebrewLocale(locale);\n const str = isHebrew ? omerTodayIsHe(this.omer) : omerTodayIsEn(this.omer);\n if (locale === 'he-x-nonikud') {\n return Locale.hebrewStripNikkud(str);\n }\n return str;\n }\n\n url(): string | undefined {\n const year = this.getDate().getFullYear();\n if (year < 5000 || year > 6759) {\n return undefined;\n }\n return `https://www.hebcal.com/omer/${year}/${this.omer}`;\n }\n\n /**\n * Returns the word from Psalm 67 (לַמְנַצֵּחַ, \"Lamnatzeach\") corresponding\n * to this Omer day. Psalm 67 contains 49 words (excluding its opening verse),\n * one for each day of the Omer. The words are taken from verses 2–8, split on\n * spaces and maqef (־).\n * @returns a Hebrew word from Psalm 67\n * @example\n * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);\n * ev.getLamnatzeachWord(); // 'אֱלֹהִים' (day 1, first word of verse 2)\n * @example\n * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);\n * ev.getLamnatzeachWord(); // 'אָרֶץ' (day 49, last word of verse 8)\n */\n getLamnatzeachWord(): string {\n return lamnatzeach[this.omer - 1];\n }\n\n /**\n * Returns the letter from verse 5 of Psalm 67 corresponding to this Omer day.\n * Verse 5 (יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים…) contains exactly 49 letters,\n * one for each day of the Omer, and is used as a Kabbalistic meditation during\n * the counting.\n * @returns a single Hebrew letter from verse 5 of Psalm 67\n * @example\n * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);\n * ev.getLamnatzeachLetter(); // 'י' (day 1, first letter of verse 5)\n * @example\n * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);\n * ev.getLamnatzeachLetter(); // 'ה' (day 49, last letter of verse 5)\n */\n getLamnatzeachLetter(): string {\n return lamnatzeachLetters[this.omer - 1];\n }\n\n /**\n * Returns the word from the Ana BeKoach prayer (אָנָּא בְּכֹחַ) corresponding\n * to this Omer day. Ana BeKoach is a 42-word Kabbalistic prayer whose initial\n * letters spell out the 42-letter name of God. The prayer has 7 verses of\n * 6 words each; the 7th entry of each group is the abbreviation of the acrostic\n * letters for that verse (e.g. `אב״ג ית״ץ` for verse 1). Together the 49\n * entries (7 verses × 7 entries) align with the 49 days of the Omer, connecting\n * each day to one of the lower seven Sefirot within a Sefirah.\n * @returns a Hebrew word or verse-abbreviation string from Ana BeKoach\n * @example\n * const ev = new OmerEvent(new HDate(16, 'Nisan', 5785), 1);\n * ev.getAnaBekoachWord(); // 'אָנָּא' (day 1, first word of verse 1)\n * @example\n * const ev = new OmerEvent(new HDate(22, 'Nisan', 5785), 7);\n * ev.getAnaBekoachWord(); // 'אב״ג ית״ץ' (day 7, acrostic abbreviation for verse 1)\n * @example\n * const ev = new OmerEvent(new HDate(3, 'Sivan', 5785), 49);\n * ev.getAnaBekoachWord(); // 'שק״ו צי״ת' (day 49, acrostic abbreviation for verse 7)\n */\n getAnaBekoachWord(): string {\n return anaBekoach[this.omer - 1].normalize();\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern.js';\n\nfunction range(start: number, end: number): readonly number[] {\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/**\n * Is *tachanun* said today?\n */\nexport type TachanunResult = {\n /** Tachanun is said at Shacharit */\n shacharit: boolean;\n /** Tachanun is said at Mincha */\n mincha: boolean;\n /** All congregations say Tachanun on the day */\n allCongs: boolean;\n};\n\nconst NONE: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n} as const;\n\n/**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n */\nexport function tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun0(hdate, il, true);\n}\n\nfunction tachanun0(hdate: HDate, il: boolean, checkNext: boolean): TachanunResult {\n const year = hdate.yy;\n const dates = tachanunYear(year, il);\n const abs = hdate.abs();\n if (dates.none.includes(abs)) {\n return NONE;\n }\n const dow = hdate.getDay();\n const ret: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n };\n if (!dates.some.includes(abs)) {\n ret.allCongs = true;\n }\n if (dow !== 6) {\n ret.shacharit = true;\n }\n const tomorrow = abs + 1;\n if (checkNext && !dates.yesPrev.includes(tomorrow)) {\n const tmp = tachanun0(new HDate(tomorrow), il, false);\n ret.mincha = tmp.shacharit;\n } else {\n ret.mincha = dow !== 5;\n }\n if (ret.allCongs && !ret.mincha && !ret.shacharit) {\n return NONE;\n }\n return ret;\n}\n\ntype TachanunYear = {\n none: number[];\n some: number[];\n yesPrev: number[];\n};\n\nfunction tachanunYear(year: number, il: boolean): TachanunYear {\n const leap = HDate.isLeapYear(year);\n const monthsInYear = HDate.monthsInYear(year);\n let av9dt = new HDate(9, months.AV, year);\n if (av9dt.getDay() === 6) {\n av9dt = av9dt.next();\n }\n let shushPurim = new HDate(15, months.ADAR_II, year);\n if (shushPurim.getDay() === 6) {\n shushPurim = shushPurim.next();\n }\n const none: readonly HDate[] = [\n new HDate(2, months.TISHREI, year), // Rosh Hashana II\n ].concat(\n // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)\n range(1, monthsInYear).map(month => new HDate(1, month, year)),\n // Rosh Chodesh - 30th of months that have one\n range(1, monthsInYear)\n .filter(month => HDate.daysInMonth(month, year) === 30)\n .map(month => new HDate(30, month, year)),\n // entire month of Nisan\n range(1, HDate.daysInMonth(months.NISAN, year)).map(\n mday => new HDate(mday, months.NISAN, year)\n ),\n new HDate(18, months.IYYAR, year), // Lag BaOmer\n // Rosh Chodesh Sivan thru Isru Chag\n range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)),\n av9dt, // Tisha B'Av\n new HDate(15, months.AV, year), // Tu B'Av\n new HDate(29, months.ELUL, year), // Erev Rosh Hashanah\n // Erev Yom Kippur thru Isru Chag\n range(9, 24 - (il ? 1 : 0)).map(mday => new HDate(mday, months.TISHREI, year)),\n // Chanukah\n range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)),\n new HDate(15, months.SHVAT, year), // Tu BiShvat\n new HDate(14, months.ADAR_II, year), // Purim\n shushPurim,\n leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan\n );\n const some: readonly HDate[] = [\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ].concat(\n // Until 14 Sivan\n range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),\n // Until after Rosh Chodesh Cheshvan\n range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),\n // Yom HaAtzma'ut, which changes based on day of week\n year >= 5708 ? (dateYomHaZikaron(year) as HDate).next() : [],\n // Yom Yerushalayim\n year >= 5727 ? new HDate(28, months.IYYAR, year) : []\n );\n const yesPrev: readonly HDate[] = [\n new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah\n new HDate(9, months.TISHREI, year), // Erev Yom Kippur\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ];\n return {\n none: none.map(hd => hd.abs()).sort((a, b) => a - b),\n some: some.map(hd => hd.abs()).sort((a, b) => a - b),\n yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),\n };\n}\n","import {Event, flags} from './event.js';\nimport {HDate, isoDateString} from '@hebcal/hdate';\nimport {renderParshaName} from './parshaName.js';\nimport {urlFriendly} from './string.js';\nimport {SedraResult} from './sedra.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents one of 54 weekly Torah portions, always on a Saturday.\n *\n * `ParshaEvent` is for regular Parashat HaShavua readings. For Shabbatot\n * with holiday readings such as Shabbat Chol ha-Moed, use\n * `getHolidaysOnDate()` from `@hebcal/core`, or `getLeyningOnDate()` from\n * `@hebcal/leyning` when the display title and exact Torah readings are needed.\n */\nexport class ParshaEvent extends Event {\n /** The parsha name(s) and date this event was constructed from */\n readonly p: SedraResult;\n /**\n * Normally created by {@link calendar} (via `options.sedrot`)\n * rather than directly.\n * @param parsha result from {@link Sedra.lookup}\n * @throws {TypeError} if called with anything other than exactly one argument\n * @throws {TypeError} if `parsha` is not a valid {@link SedraResult} — it must\n * have an `HDate` and one or two parsha names\n */\n constructor(parsha: SedraResult) {\n // eslint-disable-next-line prefer-rest-params\n if (arguments.length !== 1) {\n throw new TypeError(\n `ParshaEvent constructor takes a single SedraResult argument; ` +\n `got ${arguments.length} arguments`\n );\n }\n if (\n typeof parsha !== 'object' ||\n parsha === null ||\n !Array.isArray(parsha.parsha) ||\n parsha.parsha.length === 0 ||\n parsha.parsha.length > 2 ||\n !HDate.isHDate(parsha.hdate)\n ) {\n throw new TypeError(\n `Invalid SedraResult argument: ${JSON.stringify(parsha)}`\n );\n }\n const desc = 'Parashat ' + parsha.parsha.join('-');\n super(parsha.hdate, desc, flags.PARSHA_HASHAVUA);\n this.p = parsha;\n }\n /**\n * @param [locale] Optional locale name (i.e: `'he'`, `'fr'`). Defaults to empty locale.\n */\n render(locale?: string): string {\n return renderParshaName(this.p.parsha, locale);\n }\n\n basename(): string {\n return this.p.parsha.join('-');\n }\n\n url(): string | undefined {\n const year = this.greg().getFullYear();\n if (year < 100 || year > 2999) {\n return undefined;\n }\n const dt = this.urlDateSuffix();\n const url =\n 'https://www.hebcal.com/sedrot/' + urlFriendly(this.basename()) + '-' + dt;\n return this.p.il ? url + '?i=on' : url;\n }\n\n /**\n * The date portion of {@link url}, as `YYYYMMDD` — a parsha name recurs every\n * year, so the full date is needed to identify the reading.\n */\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replaceAll('-', '');\n }\n\n /** convenience function for compatibility with previous implementation */\n get parsha(): string[] {\n return this.p.parsha;\n }\n}\n","import {Locale} from './locale.js';\nimport {smartApostrophe} from './string.js';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n let name = Locale.gettext(parsha[0], locale);\n if (parsha.length === 2) {\n const hyphen = Locale.isHebrewLocale(locale) ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale);\n }\n name = smartApostrophe(name);\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n","import {greg2abs, isDate, daysInGregMonth, HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions.js';\n\nconst TISHREI = months.TISHREI;\n\n/**\n * Gets the R.D. days for a number, Date, or HDate\n * @private\n */\nfunction getAbs(d: Date | HDate | number): number {\n if (typeof d === 'number') return d;\n if (isDate(d)) return greg2abs(d as Date);\n if (HDate.isHDate(d)) return (d as HDate).abs();\n throw new TypeError(`Invalid date type: ${d}`);\n}\n\nfunction getYear(options: CalOptions): number {\n if (options.year !== undefined) {\n return Number(options.year);\n }\n return options.isHebrewYear\n ? new HDate().getFullYear()\n : new Date().getFullYear();\n}\n\nconst MAX_NUM_YEARS = 2000;\n\n/**\n * Parse options object to determine start & end days\n * @private\n */\nexport function getStartAndEnd(options: CalOptions): number[] {\n const hasStart = options.start !== undefined;\n const hasEnd = options.end !== undefined;\n if (hasStart !== hasEnd) {\n throw new TypeError('options.start requires options.end');\n }\n if (hasStart && hasEnd) {\n const start = getAbs(options.start!),\n end = getAbs(options.end!);\n if (end - start > 365 * MAX_NUM_YEARS) {\n throw new RangeError(`Date range exceeds ${MAX_NUM_YEARS} years`);\n }\n return [start, end];\n }\n const isHebrewYear = Boolean(options.isHebrewYear);\n const theYear = getYear(options);\n if (isNaN(theYear)) {\n throw new RangeError(`Invalid year ${options.year}`);\n }\n if (isHebrewYear && theYear < 1) {\n throw new RangeError(`Invalid Hebrew year ${theYear}`);\n }\n const theMonth = getMonth(options);\n const numYears = Number(options.numYears) || 1;\n if (numYears > MAX_NUM_YEARS) {\n throw new RangeError(`options.numYears exceeds ${MAX_NUM_YEARS}`);\n }\n if (isHebrewYear) {\n return startEndHebrew(theMonth, theYear, numYears);\n } else {\n return startEndGregorian(theMonth, theYear, numYears);\n }\n}\n\nfunction getMonth(options: CalOptions): number {\n if (options.month) {\n if (options.isHebrewYear) {\n return HDate.monthNum(options.month);\n }\n if (typeof options.month === 'number') {\n return options.month;\n }\n }\n return NaN;\n}\n\nfunction startEndGregorian(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const gregMonth = theMonth ? theMonth - 1 : 0;\n const startGreg = new Date(theYear, gregMonth, 1);\n if (theYear < 100) {\n startGreg.setFullYear(theYear);\n }\n const startAbs = greg2abs(startGreg);\n let endAbs;\n if (theMonth) {\n endAbs = startAbs + daysInGregMonth(theMonth, theYear) - 1;\n } else {\n const endYear = theYear + numYears;\n const endGreg = new Date(endYear, 0, 1);\n if (endYear < 100) {\n endGreg.setFullYear(endYear);\n }\n endAbs = greg2abs(endGreg) - 1;\n }\n return [startAbs, endAbs];\n}\n\nfunction startEndHebrew(\n theMonth: number,\n theYear: number,\n numYears: number\n): number[] {\n const startDate = new HDate(1, theMonth || TISHREI, theYear);\n let startAbs = startDate.abs();\n const endAbs = theMonth\n ? startAbs + startDate.daysInMonth()\n : new HDate(1, TISHREI, theYear + numYears).abs() - 1;\n // for full Hebrew year, start on Erev Rosh Hashana which\n // is technically in the previous Hebrew year\n // (but conveniently lets us get candle-lighting time for Erev)\n if (!theMonth && theYear > 1) {\n startAbs--;\n }\n return [startAbs, endAbs];\n}\n","import {HDate} from '@hebcal/hdate';\nimport {Event} from './event.js';\n\ntype LearningCalendar = {\n fn: (hd: HDate, il: boolean) => Event | null;\n startDate?: HDate;\n};\nconst cals = new Map<string, LearningCalendar>();\n\n/**\n * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),\n * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.\n *\n * `@hebcal/core` itself contains no learning schedules — they are provided\n * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}\n * package, which calls {@link DailyLearning.addCalendar} on import. After\n * `@hebcal/learning` is loaded, `calendar()` will emit\n * learning events when the corresponding `options.dailyLearning` flag is set.\n *\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate} from '@hebcal/core';\n *\n * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);\n * console.log(ev?.render('en')); // e.g. 'Daf Yomi: Berakhot 2'\n */\nexport class DailyLearning {\n /**\n * Registers a new learning calendar.\n *\n * The provided function is called whenever a caller asks for an event\n * from this calendar; if no learning occurs that day (e.g. the date is\n * before the cycle's start) it should return `null`.\n * @example\n * DailyLearning.addCalendar(\n * 'myCalendar',\n * (hd, il) => new Event(hd, 'Today\\'s learning', 0),\n * new HDate(1, 'Tishrei', 5780),\n * );\n * @param name case insensitive\n * @param calendar a function that returns an `Event` or `null`\n * @param startDate the first date for which this calendar is valid\n */\n static addCalendar(\n name: string,\n calendar: (hd: HDate, il: boolean) => Event | null,\n startDate?: HDate\n ) {\n if (typeof calendar !== 'function') {\n throw new TypeError(`Invalid calendar function: ${calendar}`);\n }\n cals.set(name.toLowerCase(), {\n fn: calendar,\n startDate: startDate,\n });\n }\n\n /**\n * Returns the learning event for the given date from the named calendar,\n * or `null` if there is no learning that day (or the named calendar is\n * not registered).\n * @example\n * import '@hebcal/learning';\n * import {DailyLearning, HDate, months} from '@hebcal/core';\n * DailyLearning.lookup('dafYomi', new HDate(15, months.CHESHVAN, 5784), false);\n * @param name case insensitive\n * @param hd Hebrew Date\n * @param il true for Israel, false for Diaspora\n */\n static lookup(name: string, hd: HDate, il: boolean): Event | null {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.fn(hd, il);\n }\n return null;\n }\n\n /**\n * Returns the first Hebrew date for which the named learning calendar\n * is valid (as registered by {@link addCalendar}), or `undefined` if the\n * calendar was not registered with a start date or is not registered at all.\n * @param name case insensitive\n */\n static getStartDate(name: string): HDate | undefined {\n const cal = cals.get(name.toLowerCase());\n if (typeof cal === 'object') {\n return cal.startDate;\n }\n return undefined;\n }\n\n /**\n * Returns `true` if a learning calendar with the given name has been\n * registered via {@link addCalendar}.\n * @param name case insensitive\n */\n static has(name: string): boolean {\n return cals.has(name.toLowerCase());\n }\n\n /**\n * Returns the (lower-cased) names of all currently-registered learning\n * calendars.\n */\n static getCalendars(): string[] {\n return Array.from(cals.keys());\n }\n}\n","import {HDate, Locale, months} from '@hebcal/hdate';\nimport {Event, flags} from './event.js';\nimport {Molad} from './molad.js';\nimport {smartApostrophe} from './string.js';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\n\nconst mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';\n\n/** Represents Mevarchim haChodesh, the announcement of the new month */\nexport class MevarchimChodeshEvent extends Event {\n readonly monthName: string;\n /**\n * Constructs Mevarchim haChodesh event\n * @param date Hebrew date event occurs\n * @param monthName Hebrew month name (not translated)\n * @param memo text for the event memo. When falsy, a memo announcing the\n * molad of the upcoming month is generated automatically\n * @param locale Optional locale name\n */\n constructor(date: HDate, monthName: string, memo: string, locale?: string) {\n super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);\n this.monthName = Locale.gettext(monthName, locale);\n if (memo) {\n this.memo = memo;\n } else {\n const hyear = date.getFullYear();\n const hmonth = date.getMonth();\n const monNext =\n hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;\n const molad = new Molad(hyear, monNext);\n this.memo = molad.render('en', {hour12: false});\n }\n }\n\n basename(): string {\n return this.getDesc();\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n render(locale?: string): string {\n const monthName0 = Locale.gettext(this.monthName, locale);\n const monthName = smartApostrophe(monthName0);\n return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;\n }\n /**\n * Returns (translated) description of this event\n * @param [locale] Optional locale name (defaults to empty locale)\n */\n renderBrief(locale?: string): string {\n const str = this.render(locale);\n const space = str.indexOf(' ');\n return str.substring(space + 1);\n }\n}\n","import {Locale} from './locale.js';\nimport {abs2greg, HDate, months} from '@hebcal/hdate';\nimport {CalOptions, DailyLearningValue} from './CalOptions.js';\nimport {\n makeCandleEvent,\n makeFastStartEnd,\n makeWeekdayChanukahCandleLighting,\n} from './candles.js';\nimport {Event, flags} from './event.js';\nimport {getStartAndEnd} from './getStartAndEnd.js';\nimport {HebrewDateEvent} from './HebrewDateEvent.js';\nimport {HolidayYearMap, getHolidaysForYear_} from './holidays.js';\nimport {ParshaEvent} from './ParshaEvent.js';\nimport {Sedra, getSedra} from './sedra.js';\nimport {TimedEvent, HavdalahEvent} from './TimedEvent.js';\nimport {DailyLearning} from './DailyLearning.js';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent.js';\nimport {MevarchimChodeshEvent} from './MevarchimChodeshEvent.js';\nimport {MoladEvent, Molad} from './molad.js';\nimport {OmerEvent} from './omer.js';\nimport {Zmanim} from './zmanim.js';\nimport {Location} from './location.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\n/**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * The date range returned by this function can be controlled by:\n * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)\n * * `options.isHebrewYear` - to interpret `year` as Hebrew year\n * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)\n * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)\n *\n * Alternatively, specify start and end days with `Date` or {@link HDate} instances:\n * * `options.start` - use specific start date (requires `end` date)\n * * `options.end` - use specific end date (requires `start` date)\n *\n * Unless `options.noHolidays == true`, default holidays include:\n * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.\n * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.\n * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)\n * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)\n * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)\n * * Rosh Chodesh (unless `options.noRoshChodesh`)\n *\n * Holiday and Torah reading schedules differ between Israel and the Disapora.\n * Set `options.il=true` to use the Israeli schedule.\n *\n * Additional non-default event types can be specified:\n * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)\n * * Counting of the Omer (`options.omer`)\n * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)\n * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)\n * * Yom Kippur Katan (`options.yomKippurKatan`)\n * * BeHaB fast days after Pesach and Sukkot (`options.behab`)\n * * Yizkor (`options.yizkor`)\n *\n * Daily Study of texts are supported by the\n * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,\n * for example:\n * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)\n * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)\n * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)\n * * Nach Yomi (`options.dailyLearning.nachYomi`)\n *\n * Candle-lighting and Havdalah times are approximated using latitude and longitude\n * specified by the {@link Location} class. The `Location` class contains a small\n * database of cities with their associated geographic information and time-zone information.\n * If you ever have any doubts about Hebcal's times, consult your local halachic authority.\n * If you enter geographic coordinates above the arctic circle or antarctic circle,\n * the times are guaranteed to be wrong.\n *\n * To add candle-lighting options, set `options.candlelighting=true` and set\n * `options.location` to an instance of `Location`. By default, candle lighting\n * time is 18 minutes before sundown in the Diaspora and 20 minutes before\n * sundown in Israel (40 minutes for Jerusalem,\n * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is\n * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars\n * are observable in the night time sky with the naked eye). The default Havdalah\n * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.\n * These defaults can be changed using these options:\n * * `options.candleLightingMins` - minutes before sundown to light candles\n * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).\n * Havdalah times are suppressed when `options.havdalahMins=0`.\n * * `options.havdalahDeg` - degrees for solar depression for Havdalah.\n * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.\n * Havdalah times are suppressed when `options.havdalahDeg=0`.\n *\n * If both `options.candlelighting=true` and `options.location` is specified,\n * Chanukah candle-lighting times and minor fast start/end times will also be generated.\n * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before\n * the sun is 7.083° below the horizon in the evening)\n * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on\n * Saturday night (see above).\n *\n * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning).\n * They end when 3 medium-sized stars are observable in the night sky (sun is 7.083°\n * below the horizon in the evening) in the Diaspora, or 15 minutes after sunset in\n * Israel (Rabbi Deblitzky's practice). Override with:\n * * `options.fastEndDeg` - degrees of solar depression for the end of a minor fast\n * * `options.fastEndMins` - minutes after sunset for the end of a minor fast\n * (mutually exclusive with `options.fastEndDeg`)\n *\n * Tish'a B'Av is different: it begins at sunset on the previous day and always ends\n * at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring `options.fastEndDeg`\n * and `options.fastEndMins`. When a minor fast falls on a Friday the end time is\n * suppressed, because Shabbat begins before nightfall.\n *\n * Two options also exist for generating an Event with the Hebrew date:\n * * `options.addHebrewDates` - print the Hebrew date for the entire date range\n * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events\n *\n * Lastly, translation and transliteration of event titles is controlled by\n * `options.locale` and the {@link Locale} API.\n * `@hebcal/core` supports three locales by default:\n * * `en` - default, Sephardic transliterations (e.g. \"Shabbat\")\n * * `ashkenazi` - Ashkenazi transliterations (e.g. \"Shabbos\")\n * * `he` - Hebrew (e.g. \"שַׁבָּת\")\n *\n * Additional locales (such as `ru` or `fr`) are supported by the\n * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package\n *\n * @example\n * import {calendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\nexport function calendar(options: CalOptions = {}): Event[] {\n options = {...options}; // so we can modify freely\n checkCandleOptions(options);\n const location = (options.location = options.location || defaultLocation);\n const il = (options.il = options.il || location.getIsrael() || false);\n const hasUserMask = typeof options.mask === 'number';\n options.mask = getMaskFromOptions(options);\n if (options.locale) {\n const locale = options.locale;\n if (locale && typeof locale !== 'string') {\n throw new TypeError(`Invalid options.locale: ${locale}`);\n }\n if (!Locale.hasLocale(locale)) {\n throw new TypeError(\n `Locale '${locale}' not found; did you forget to import @hebcal/locales?`\n );\n }\n } else if (options.ashkenazi) {\n options.locale = 'ashkenazi';\n } else {\n options.locale = 'en';\n }\n\n const evts: Event[] = [];\n let sedra: Sedra | undefined;\n let holidaysYear: HolidayYearMap | undefined;\n let beginOmer = -1;\n let endOmer = -1;\n let currentYear = -1;\n const startAndEnd = getStartAndEnd(options);\n warnUnrecognizedOptions(options);\n const startAbs = startAndEnd[0];\n const endAbs = startAndEnd[1];\n const startGreg = abs2greg(startAbs);\n const startGregYear = startGreg.getFullYear();\n if (startGregYear < 100 || startGregYear > 9999) {\n options.candlelighting = false;\n options.sedrot = false;\n options.dailyLearning = {};\n }\n for (let abs = startAbs; abs <= endAbs; abs++) {\n const hd = new HDate(abs);\n const hyear = hd.getFullYear();\n if (hyear !== currentYear) {\n currentYear = hyear;\n holidaysYear = getHolidaysForYear_(currentYear);\n if (options.sedrot) {\n sedra = getSedra(currentYear, il);\n }\n if (options.omer) {\n beginOmer = HDate.hebrew2abs(currentYear, NISAN, 16);\n endOmer = HDate.hebrew2abs(currentYear, SIVAN, 5);\n }\n }\n const prevEventsLength = evts.length;\n const dow = hd.getDay();\n const isFriday = dow === FRI;\n const isSaturday = dow === SAT;\n let candlesEv: TimedEvent | undefined;\n const holidays0 = holidaysYear!.get(hd.toString()) || [];\n const holidays = holidays0.filter(ev => ev.observedIn(il));\n for (const ev of holidays) {\n candlesEv = appendHolidayAndRelated(\n candlesEv,\n evts,\n ev,\n options,\n isFriday,\n isSaturday,\n hasUserMask\n );\n }\n const mm = hd.getMonth();\n const dd = hd.getDate();\n // When Erev Pesach falls on Shabbat, burning chametz is moved to Friday.\n if (isFriday && options.candlelighting && mm === months.NISAN && dd === 13) {\n const biurEv = makeBiurChametzEvent(hd, options);\n if (biurEv) {\n evts.push(biurEv);\n }\n }\n if (options.sedrot && isSaturday) {\n const parsha0 = sedra!.lookup(abs);\n if (!parsha0.chag) {\n evts.push(new ParshaEvent(parsha0));\n }\n }\n if (options.yizkor) {\n if (\n (mm === months.TISHREI && (dd === 10 || dd === 22)) ||\n (mm === NISAN && dd === (il ? 21 : 22)) ||\n (mm === SIVAN && dd === (il ? 6 : 7))\n ) {\n const linkedEvent = holidays[0];\n const ev = new Event(hd, hdesc.YIZKOR, flags.YIZKOR, {\n emoji: '🕯️',\n linkedEvent,\n });\n evts.push(ev);\n }\n }\n const dailyLearning = options.dailyLearning;\n let numDailyLearning = 0;\n if (typeof dailyLearning === 'object' && dailyLearning !== null) {\n const events = makeDailyLearning(hd, dailyLearning, il);\n numDailyLearning = events.length;\n if (numDailyLearning) {\n evts.push(...events);\n }\n }\n if (options.omer && abs >= beginOmer && abs <= endOmer) {\n const omer = abs - beginOmer + 1;\n const omerEv = makeOmerEvent(hd, omer, options);\n evts.push(omerEv);\n }\n if (isSaturday && (options.molad || options.shabbatMevarchim)) {\n const events = makeMoladAndMevarchimChodesh(hd, options);\n evts.push(...events);\n }\n if (!candlesEv && options.candlelighting && (isFriday || isSaturday)) {\n candlesEv = makeCandleEvent(undefined, hd, options, isFriday, isSaturday);\n if (isFriday && candlesEv && sedra) {\n const parsha = sedra.lookup(abs);\n if (!parsha.chag) {\n const pe = new ParshaEvent(parsha);\n candlesEv.memo = pe.render(options.locale);\n } else {\n candlesEv.memo = Locale.gettext(parsha.parsha[0], options.locale);\n }\n }\n }\n // suppress Havdalah when options.havdalahMins=0 or options.havdalahDeg=0\n if (\n candlesEv instanceof HavdalahEvent &&\n (options.havdalahMins === 0 || options.havdalahDeg === 0)\n ) {\n candlesEv = undefined;\n }\n if (candlesEv) {\n evts.push(candlesEv);\n }\n if (\n options.addHebrewDates ||\n (options.addHebrewDatesForEvents &&\n prevEventsLength !== evts.length - numDailyLearning)\n ) {\n const e2 = new HebrewDateEvent(hd);\n if (prevEventsLength === evts.length) {\n evts.push(e2);\n } else {\n evts.splice(prevEventsLength, 0, e2);\n }\n }\n }\n return evts;\n}\n\nconst FRI = 5;\nconst SAT = 6;\n\nconst NISAN = months.NISAN;\nconst SIVAN = months.SIVAN;\nconst ELUL = months.ELUL;\n\nconst LIGHT_CANDLES = flags.LIGHT_CANDLES;\nconst YOM_TOV_ENDS = flags.YOM_TOV_ENDS;\nconst CHUL_ONLY = flags.CHUL_ONLY;\nconst IL_ONLY = flags.IL_ONLY;\nconst LIGHT_CANDLES_TZEIS = flags.LIGHT_CANDLES_TZEIS;\nconst CHANUKAH_CANDLES = flags.CHANUKAH_CANDLES;\nconst MINOR_FAST = flags.MINOR_FAST;\nconst SPECIAL_SHABBAT = flags.SPECIAL_SHABBAT;\nconst MODERN_HOLIDAY = flags.MODERN_HOLIDAY;\nconst MAJOR_FAST = flags.MAJOR_FAST;\nconst ROSH_CHODESH = flags.ROSH_CHODESH;\nconst PARSHA_HASHAVUA = flags.PARSHA_HASHAVUA;\nconst DAF_YOMI = flags.DAF_YOMI;\nconst MISHNA_YOMI = flags.MISHNA_YOMI;\nconst NACH_YOMI = flags.NACH_YOMI;\nconst YERUSHALMI_YOMI = flags.YERUSHALMI_YOMI;\nconst OMER_COUNT = flags.OMER_COUNT;\nconst SHABBAT_MEVARCHIM = flags.SHABBAT_MEVARCHIM;\nconst MINOR_HOLIDAY = flags.MINOR_HOLIDAY;\nconst EREV = flags.EREV;\nconst CHOL_HAMOED = flags.CHOL_HAMOED;\nconst YOM_KIPPUR_KATAN = flags.YOM_KIPPUR_KATAN;\nconst YIZKOR = flags.YIZKOR;\nconst BEHAB = flags.BEHAB;\n\ntype StringIntMap = Record<string, number>;\n\nconst unrecognizedAlreadyWarned = new Set<string>();\nconst RECOGNIZED_OPTIONS: StringIntMap = {\n location: 1,\n year: 1,\n isHebrewYear: 1,\n month: 1,\n numYears: 1,\n start: 1,\n end: 1,\n candlelighting: 1,\n candleLightingMins: 1,\n havdalahMins: 1,\n havdalahDeg: 1,\n fastEndDeg: 1,\n fastEndMins: 1,\n sedrot: 1,\n il: 1,\n noMinorFast: 1,\n noModern: 1,\n shabbatMevarchim: 1,\n noRoshChodesh: 1,\n noSpecialShabbat: 1,\n noHolidays: 1,\n omer: 1,\n molad: 1,\n ashkenazi: 1,\n locale: 1,\n addHebrewDates: 1,\n addHebrewDatesForEvents: 1,\n mask: 1,\n yomKippurKatan: 1,\n behab: 1,\n hour12: 1,\n dailyLearning: 1,\n useElevation: 1,\n yizkor: 1,\n} as const satisfies Record<keyof CalOptions, 1>;\n\n/**\n * @private\n */\nfunction warnUnrecognizedOptions(options: CalOptions) {\n for (const k of Object.keys(options)) {\n if (RECOGNIZED_OPTIONS[k] === undefined && !unrecognizedAlreadyWarned.has(k)) {\n console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);\n unrecognizedAlreadyWarned.add(k);\n }\n }\n if (options.dailyLearning) {\n for (const [k, val] of Object.entries(options.dailyLearning)) {\n // Resolve aliases (e.g. `yerushalmi` -> `yerushalmi-vilna`) the same way\n // makeDailyLearning() does, so a valid option doesn't warn spuriously.\n const name = dailyLearningName(k, val);\n if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(name)) {\n console.warn(`Ignoring unrecognized DailyLearning calendar: ${k}`);\n unrecognizedAlreadyWarned.add(k);\n }\n }\n }\n}\n\nconst israelCityOffset: StringIntMap = {\n Jerusalem: 40,\n Haifa: 30,\n \"Zikhron Ya'aqov\": 30,\n \"Zikhron Ya'akov\": 30,\n 'Zikhron Yaakov': 30,\n \"Zichron Ya'akov\": 30,\n 'Zichron Yaakov': 30,\n} as const;\n\nconst geoIdCandleOffset: StringIntMap = {\n '281184': 40, // Jerusalem\n '294801': 30, // Haifa\n '293067': 30, // Zikhron Yaakov\n} as const;\n\n/**\n * @private\n * @constant\n * This calculation is based on the position of the sun 36 minutes after sunset in Jerusalem\n * around the equinox / equilux, which is 8.5° below geometric zenith.\n * The Ohr Meir considers this the time that 3 small stars are visible,\n * which is later than the required 3 medium stars.\n * @see {https://kosherjava.com/zmanim/docs/api/com/kosherjava/zmanim/ZmanimCalendar.html#ZENITH_8_POINT_5}\n */\nconst TZEIT_3SMALL_STARS = 8.5;\n\n/**\n * Modifies options in-place\n * @private\n */\nfunction checkCandleOptions(options: CalOptions) {\n if (!options.candlelighting) {\n return;\n }\n const location = options.location;\n if (location === undefined || !(location instanceof Location)) {\n throw new TypeError('options.candlelighting requires valid options.location');\n }\n if (\n typeof options.havdalahMins === 'number' &&\n typeof options.havdalahDeg === 'number'\n ) {\n throw new TypeError(\n 'options.havdalahMins and options.havdalahDeg are mutually exclusive'\n );\n }\n if (\n typeof options.fastEndDeg === 'number' &&\n typeof options.fastEndMins === 'number'\n ) {\n throw new TypeError(\n 'options.fastEndDeg and options.fastEndMins are mutually exclusive'\n );\n }\n\n const min0 = options.candleLightingMins;\n let min = typeof min0 === 'number' && !isNaN(min0) ? Math.trunc(min0) : 18;\n if (location.getIsrael() && Math.abs(min) === 18) {\n min = overrideIsraelCandleMins(location);\n }\n options.candleLightingMins = -1 * Math.abs(min);\n\n if (typeof options.havdalahMins === 'number') {\n options.havdalahMins = Math.trunc(Math.abs(options.havdalahMins));\n } else if (typeof options.havdalahDeg === 'number') {\n options.havdalahDeg = Math.abs(options.havdalahDeg);\n } else {\n options.havdalahDeg = TZEIT_3SMALL_STARS;\n }\n if (typeof options.fastEndDeg === 'number') {\n options.fastEndDeg = Math.abs(options.fastEndDeg);\n }\n if (typeof options.fastEndMins === 'number') {\n options.fastEndMins = Math.trunc(Math.abs(options.fastEndMins));\n }\n}\n\nfunction overrideIsraelCandleMins(location: Location) {\n const geoid = location.getGeoId();\n if (geoid) {\n const offset = geoIdCandleOffset[geoid];\n if (typeof offset === 'number') {\n return offset;\n }\n }\n const shortName = location.getShortName();\n if (shortName) {\n const offset = israelCityOffset[shortName];\n if (typeof offset === 'number') {\n return offset;\n }\n }\n return 20;\n}\n\n/**\n * Mask to filter Holiday array\n * @private\n */\nfunction getMaskFromOptions(options: CalOptions): number {\n if (typeof options.mask === 'number') {\n return setOptionsFromMask(options);\n }\n const il = options.il || options.location?.getIsrael() || false;\n let mask = 0;\n\n // default options\n if (!options.noHolidays) {\n mask |=\n ROSH_CHODESH |\n YOM_TOV_ENDS |\n MINOR_FAST |\n SPECIAL_SHABBAT |\n MODERN_HOLIDAY |\n MAJOR_FAST |\n MINOR_HOLIDAY |\n EREV |\n CHOL_HAMOED |\n LIGHT_CANDLES |\n LIGHT_CANDLES_TZEIS |\n CHANUKAH_CANDLES;\n }\n if (options.candlelighting) {\n mask |= LIGHT_CANDLES | LIGHT_CANDLES_TZEIS | YOM_TOV_ENDS;\n }\n // suppression of defaults\n if (options.noRoshChodesh) {\n mask &= ~ROSH_CHODESH;\n }\n if (options.noModern) {\n mask &= ~MODERN_HOLIDAY;\n }\n if (options.noMinorFast) {\n mask &= ~MINOR_FAST;\n }\n if (options.noSpecialShabbat) {\n mask &= ~SPECIAL_SHABBAT;\n mask &= ~SHABBAT_MEVARCHIM;\n }\n if (il) {\n mask |= IL_ONLY;\n } else {\n mask |= CHUL_ONLY;\n }\n // non-default options\n if (options.sedrot) {\n mask |= PARSHA_HASHAVUA;\n }\n if (options.omer) {\n mask |= OMER_COUNT;\n }\n if (options.shabbatMevarchim) {\n mask |= SHABBAT_MEVARCHIM;\n }\n if (options.yomKippurKatan) {\n mask |= YOM_KIPPUR_KATAN;\n }\n if (options.behab) {\n mask |= BEHAB;\n }\n if (options.yizkor) {\n mask |= YIZKOR;\n }\n const dailyLearning = options.dailyLearning;\n if (typeof dailyLearning === 'object' && dailyLearning !== null) {\n if (dailyLearning.dafYomi) {\n mask |= DAF_YOMI;\n }\n if (dailyLearning.mishnaYomi) {\n mask |= MISHNA_YOMI;\n }\n if (dailyLearning.nachYomi) {\n mask |= NACH_YOMI;\n }\n if (dailyLearning.yerushalmi) {\n mask |= YERUSHALMI_YOMI;\n }\n }\n\n return mask;\n}\n\nconst defaultLocation = new Location(0, 0, false, 'UTC');\n\n/**\n * @private\n */\nfunction setOptionsFromMask(options: CalOptions): number {\n const m = options.mask || 0;\n if (m & ROSH_CHODESH) delete options.noRoshChodesh;\n if (m & MODERN_HOLIDAY) delete options.noModern;\n if (m & MINOR_FAST) delete options.noMinorFast;\n if (m & SPECIAL_SHABBAT) delete options.noSpecialShabbat;\n if (m & PARSHA_HASHAVUA) options.sedrot = true;\n if (m & (DAF_YOMI | MISHNA_YOMI | NACH_YOMI | YERUSHALMI_YOMI)) {\n options.dailyLearning = options.dailyLearning || {};\n if (m & DAF_YOMI) {\n options.dailyLearning.dafYomi = true;\n }\n if (m & MISHNA_YOMI) {\n options.dailyLearning.mishnaYomi = true;\n }\n if (m & NACH_YOMI) {\n options.dailyLearning.nachYomi = true;\n }\n if (m & YERUSHALMI_YOMI) {\n options.dailyLearning.yerushalmi = 1;\n }\n }\n if (m & OMER_COUNT) options.omer = true;\n if (m & SHABBAT_MEVARCHIM) options.shabbatMevarchim = true;\n if (m & YOM_KIPPUR_KATAN) options.yomKippurKatan = true;\n if (m & BEHAB) options.behab = true;\n if (m & YIZKOR) options.yizkor = true;\n return m;\n}\n\n/**\n * Appends the Event `ev` to the `events` array. Also may add related\n * timed events like candle-lighting or fast start/end\n * @private\n */\nfunction appendHolidayAndRelated(\n candlesEv: TimedEvent | undefined,\n events: Event[],\n ev: HolidayEvent,\n options: CalOptions,\n isFriday: boolean,\n isSaturday: boolean,\n hasUserMask: boolean\n): TimedEvent | undefined {\n const il = options.il || false;\n if (!ev.observedIn(il)) {\n return candlesEv; // holiday isn't observed here; bail out early\n }\n const eFlags = ev.mask;\n const isYomKippurKatan = ev.hasFlag('YOM_KIPPUR_KATAN');\n const isBehab = ev.hasFlag('BEHAB');\n if (\n (!options.yomKippurKatan && isYomKippurKatan) ||\n (!options.behab && isBehab) ||\n (options.noModern && ev.hasFlag('MODERN_HOLIDAY'))\n ) {\n return candlesEv; // bail out early\n }\n if (options.candlelighting && ev.getDesc() === hdesc.EREV_PESACH) {\n const evts = makeErevPesachChametzEvents(ev, options);\n if (evts.length) {\n events.push(...evts);\n }\n }\n const isMajorFast = ev.hasFlag('MAJOR_FAST');\n const isMinorFast = ev.hasFlag('MINOR_FAST');\n const isChanukah = ev.hasFlag('CHANUKAH_CANDLES');\n const hasCandles = ev.hasAnyFlag(\n 'LIGHT_CANDLES',\n 'LIGHT_CANDLES_TZEIS',\n 'CHANUKAH_CANDLES',\n 'YOM_TOV_ENDS'\n );\n let fastEv;\n if (\n options.candlelighting &&\n (isMajorFast || isMinorFast) &&\n ev.getDesc() !== hdesc.YOM_KIPPUR\n ) {\n ev = fastEv = makeFastStartEnd(ev, options);\n if (\n fastEv.startEvent &&\n (isMajorFast || (isMinorFast && !options.noMinorFast))\n ) {\n events.push(fastEv.startEvent);\n }\n }\n if (eFlags & Number(options.mask) || (!eFlags && !hasUserMask)) {\n if (options.candlelighting && hasCandles) {\n const hd = ev.getDate();\n candlesEv = makeCandleEvent(ev, hd, options, isFriday, isSaturday);\n if (isChanukah && candlesEv && !options.noHolidays) {\n // Replace Chanukah event with a clone that includes candle lighting time.\n // For clarity, allow a \"duplicate\" candle lighting event to remain for Shabbat\n const chanukahEv = makeWeekdayChanukahCandleLighting(\n ev as ChanukahEvent,\n options\n );\n if (chanukahEv) {\n if (isFriday || isSaturday) {\n chanukahEv.eventTime = candlesEv.eventTime;\n chanukahEv.eventTimeStr = candlesEv.eventTimeStr;\n }\n ev = chanukahEv;\n }\n candlesEv = undefined;\n }\n }\n if (\n !options.noHolidays ||\n (options.yomKippurKatan && isYomKippurKatan) ||\n (options.behab && isBehab)\n ) {\n events.push(ev); // the original event itself\n }\n }\n if ((isMajorFast || (isMinorFast && !options.noMinorFast)) && fastEv?.endEvent) {\n events.push(fastEv.endEvent);\n }\n return candlesEv;\n}\n\nfunction makeMoladAndMevarchimChodesh(hd: HDate, options: CalOptions): Event[] {\n const evts: Event[] = [];\n const hmonth = hd.getMonth();\n const hdate = hd.getDate();\n if (hmonth !== ELUL && hdate >= 23 && hdate <= 29) {\n const hyear = hd.getFullYear();\n const monNext = hmonth === HDate.monthsInYear(hyear) ? NISAN : hmonth + 1;\n if (options.molad) {\n evts.push(new MoladEvent(hd, hyear, monNext, options));\n }\n if (options.shabbatMevarchim) {\n const nextMonthName = HDate.getMonthName(monNext, hyear);\n const molad = new Molad(hyear, monNext);\n const memo = molad.render(options.locale, options);\n evts.push(new MevarchimChodeshEvent(hd, nextMonthName, memo, options.locale));\n }\n }\n return evts;\n}\n\nfunction dailyLearningName(key: string, val: DailyLearningValue): string {\n if (key === 'yerushalmi') {\n return val === 2 ? 'yerushalmi-schottenstein' : 'yerushalmi-vilna';\n }\n return key;\n}\n\nfunction makeDailyLearning(\n hd: HDate,\n dailyLearning: Record<string, DailyLearningValue>,\n il: boolean\n): Event[] {\n const evts: Event[] = [];\n for (const [key, val] of Object.entries(dailyLearning)) {\n if (val) {\n const name = dailyLearningName(key, val);\n const learningEv = DailyLearning.lookup(name, hd, il);\n if (learningEv) {\n evts.push(learningEv);\n }\n }\n }\n return evts;\n}\n\nfunction makeOmerEvent(hd: HDate, omerDay: number, options: CalOptions) {\n const omerEv = new OmerEvent(hd, omerDay);\n if (options.candlelighting) {\n const location = options.location!;\n const zmanim = new Zmanim(location, hd.prev(), false);\n const tzeit = zmanim.tzeit(7.0833);\n if (!isNaN(tzeit.getTime())) {\n omerEv.alarm = tzeit;\n }\n }\n return omerEv;\n}\n\nfunction makeErevPesachChametzEvents(\n erevPesachEv: Event,\n options: CalOptions\n): TimedEvent[] {\n const evts: TimedEvent[] = [];\n const location = options.location!;\n const useElevation = Boolean(options.useElevation);\n const hd = erevPesachEv.getDate();\n const zmanim = new Zmanim(location, hd, useElevation);\n const zmanAchilas = zmanim.sofZmanTfilla(); // Gra\n if (isNaN(zmanAchilas.getTime())) {\n return [];\n }\n const zmanAchilasEv = new TimedEvent(\n hd,\n hdesc.SOF_ZMAN_ACHILAT_CHAMETZ,\n 0,\n zmanAchilas,\n location,\n undefined,\n options\n );\n zmanAchilasEv.emoji = '🍞';\n evts.push(zmanAchilasEv);\n // When Erev Pesach falls on Shabbat, chametz cannot be burned on Shabbat,\n // so Biur Chametz is emitted on the Friday before (see makeBiurChametzEvent\n // called from the main calendar loop). Skip it here in that case.\n if (hd.getDay() !== SAT) {\n const biurEv = makeBiurChametzEvent(hd, options);\n if (biurEv) {\n evts.push(biurEv);\n }\n }\n return evts;\n}\n\nfunction makeBiurChametzEvent(\n hd: HDate,\n options: CalOptions\n): TimedEvent | undefined {\n const location = options.location!;\n const useElevation = Boolean(options.useElevation);\n const zmanim = new Zmanim(location, hd, useElevation);\n const time = zmanim.sofZmanBiurChametzGRA();\n if (isNaN(time.getTime())) {\n return undefined;\n }\n const biurChametzEv = new TimedEvent(\n hd,\n hdesc.BIUR_CHAMETZ,\n 0,\n time,\n location,\n undefined,\n options\n );\n biurChametzEv.emoji = '🔥';\n return biurChametzEv;\n}\n","/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport {birthdayOrAnniversary, yahrzeit, HDate} from '@hebcal/hdate';\nimport './locale.js'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions.js';\nimport {version as pkgVersion} from './pkgVersion.js';\nimport {Event} from './event.js';\nimport {Sedra, getSedra} from './sedra.js';\nimport {hallel_} from './hallel.js';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays.js';\nimport {HolidayEvent} from './HolidayEvent.js';\nimport {reformatTimeStr} from './reformatTimeStr.js';\nimport {TachanunResult, tachanun} from './tachanun.js';\nimport {calendar} from './calendar.js';\n\n/**\n * HebrewCalendar is the main interface to the `@hebcal/core` library.\n * This namespace is used to calculate holidays, rosh chodesh, candle lighting & havdalah times,\n * Parashat HaShavua, Daf Yomi, days of the omer, and the molad.\n * Event names can be rendered in several languges using the `locale` option.\n */\nexport class HebrewCalendar {\n private constructor() {}\n /**\n * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.\n *\n * Each holiday is represented by an {@link Event} object which includes a date,\n * a description, flags and optional attributes.\n * If given no options, returns holidays for the Diaspora for the current Gregorian year.\n *\n * This is a convenience wrapper around the standalone {@link calendar} function.\n * See {@link calendar} for the complete list of supported options, the\n * candle-lighting and Havdalah defaults, and notes on locales.\n *\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const options: CalOptions = {\n * year: 1981,\n * isHebrewYear: false,\n * candlelighting: true,\n * location: Location.lookup('San Francisco'),\n * sedrot: true,\n * omer: true,\n * };\n * const events = HebrewCalendar.calendar(options);\n * for (const ev of events) {\n * const hd = ev.getDate();\n * const date = hd.greg();\n * console.log(date.toLocaleDateString(), ev.render('en'), hd.toString());\n * }\n */\n static calendar(options: CalOptions = {}): Event[] {\n return calendar(options);\n }\n\n /**\n * Calculates a birthday or anniversary (non-yahrzeit).\n * Returns `undefined` when `hyear` precedes the original year of `gdate`.\n *\n * When `hyear` is the original year, the original date is returned unchanged —\n * a \"0th birthday\" is a meaningful thing to ask for. This differs from\n * {@link getYahrzeit}, which returns `undefined` for the original year,\n * because a yahrzeit only has meaning from the first anniversary onward.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The birthday of someone born in Adar of an ordinary year or Adar II of\n * a leap year is also always in the last month of the year, be that Adar\n * or Adar II. The birthday in an ordinary year of someone born during the\n * first 29 days of Adar I in a leap year is on the corresponding day of Adar;\n * in a leap year, the birthday occurs in Adar I, as expected.\n *\n * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I\n * has his birthday postponed until the first of the following month in\n * years where that day does not occur. [Calendrical Calculations p. 111]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getBirthdayOrAnniversary(5780, dt); // '1 Nisan 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '3/26/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\n static getBirthdayOrAnniversary(\n hyear: number,\n gdate: Date | HDate\n ): HDate | undefined {\n return birthdayOrAnniversary(hyear, gdate);\n }\n\n /**\n * Calculates yahrzeit.\n * `hyear` must be after original `gdate` of death.\n * Returns `undefined` when requested year preceeds or is same as original year.\n *\n * Hebcal uses the algorithm defined in \"Calendrical Calculations\"\n * by Edward M. Reingold and Nachum Dershowitz.\n *\n * The customary anniversary date of a death is more complicated and depends\n * also on the character of the year in which the first anniversary occurs.\n * There are several cases:\n *\n * * If the date of death is Marcheshvan 30, the anniversary in general depends\n * on the first anniversary; if that first anniversary was not Marcheshvan 30,\n * use the day before Kislev 1.\n * * If the date of death is Kislev 30, the anniversary in general again depends\n * on the first anniversary — if that was not Kislev 30, use the day before\n * Tevet 1.\n * * If the date of death is Adar II, the anniversary is the same day in the\n * last month of the Hebrew year (Adar or Adar II).\n * * If the date of death is Adar I 30, the anniversary in a Hebrew year that\n * is not a leap year (in which Adar only has 29 days) is the last day in\n * Shevat.\n * * In all other cases, use the normal (that is, same month number) anniversary\n * of the date of death. [Calendrical Calculations p. 113]\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'\n * const hd = HebrewCalendar.getYahrzeit(5780, dt); // '30 Sh\\'vat 5780'\n * console.log(hd.greg().toLocaleDateString('en-US')); // '2/25/2020'\n * @param hyear Hebrew year\n * @param gdate Gregorian or Hebrew date of death\n * @returns anniversary occurring in hyear\n */\n static getYahrzeit(hyear: number, gdate: Date | HDate): HDate | undefined {\n return yahrzeit(hyear, gdate);\n }\n\n /**\n * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by\n * `HDate.toString()`. These events are not filtered by Israel vs. Diaspora\n * holiday scheme; use {@link Event.observedIn} to do that.\n *\n * Includes Rosh Chodesh, fasts, Yom Kippur Katan, Special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * The result is cached in an internal LRU.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const map = HebrewCalendar.getHolidaysForYear(5784);\n * for (const [hdStr, events] of map.entries()) {\n * for (const ev of events) {\n * console.log(hdStr, ev.getDesc());\n * }\n * }\n * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns a sorted array of holidays observed during the given Hebrew year.\n *\n * Events are pre-filtered by Israel vs. Diaspora schedule, so callers do not\n * need to inspect `flags.IL_ONLY` / `flags.CHUL_ONLY` themselves.\n * Includes Rosh Chodesh, fasts, modern holidays, special Shabbatot, etc.,\n * but does not generate candle-lighting times, Torah readings, or Omer days.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * const events = HebrewCalendar.getHolidaysForYearArray(5784, false);\n * console.log(events[0].getDesc()); // 'Rosh Hashana 5784'\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\n static getHolidaysForYearArray(year: number, il: boolean): HolidayEvent[] {\n return getHolidaysForYearArray(year, il);\n }\n\n /**\n * Returns an array of holiday Events that occur on the given date,\n * or `undefined` if no holidays occur that day.\n *\n * When `il` is omitted, both Diaspora-only and Israel-only events are\n * returned; pass `true` or `false` to filter to a single schedule.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * const hd = new HDate(15, months.NISAN, 5784);\n * const events = HebrewCalendar.getHolidaysOnDate(hd, false);\n * console.log(events?.map(ev => ev.getDesc())); // ['Pesach I']\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param [il] use the Israeli schedule for holidays\n */\n static getHolidaysOnDate(\n date: HDate | Date | number,\n il?: boolean\n ): HolidayEvent[] | undefined {\n return getHolidaysOnDate(date, il);\n }\n\n /**\n * Returns `true` if Eruv Tavshilin should be prepared on the given date.\n *\n * Eruv Tavshilin is prepared when a Yom Tov falls on Friday (so cooking\n * for Shabbat that begins Friday night may continue from Yom Tov into\n * Shabbat). This requires the day before to be a weekday (Wednesday or\n * Thursday), the following Friday to be Yom Tov, and the day after Friday\n * (Shabbat) to also be a sacred day.\n * @example\n * import {HebrewCalendar} from '@hebcal/core';\n * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,\n * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv\n * // Tavshilin is prepared on Wednesday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true\n * // In Israel there is only one day of Yom Tov, so Friday is a weekday:\n * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false\n * @param date Gregorian or Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static eruvTavshilin(date: Date | HDate, il: boolean): boolean {\n if (date.getDay() < 3 || date.getDay() > 4) {\n return false;\n }\n const today = new HDate(date);\n const friday = today.after(5);\n const tomorrow = today.next();\n if (!isChag(friday, il) || isChag(today, il) || !isChag(tomorrow, il)) {\n return false;\n }\n return true;\n }\n\n /**\n * Helper function to format a 24-hour (00:00-23:59) time string in either\n * 12-hour US format (e.g. `\"8:13pm\"`) or keep it in 24-hour format (e.g.\n * `\"20:13\"`) for any other locale or country.\n *\n * The locale (and therefore default behavior) is derived from\n * `options.location` / `options.locale`. The `options.hour12` override\n * takes precedence: if `false`, locale is ignored and the result is always\n * 24-hour; if `true`, locale is ignored and the result is always 12-hour.\n * @example\n * import {HebrewCalendar, Location} from '@hebcal/core';\n * const opts = {location: Location.lookup('Chicago')};\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', opts); // '8:30pm'\n * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options optional; `location`, `locale` and `hour12` are consulted\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n /**\n * Returns the semantic version string of the `@hebcal/core` package\n * (e.g. `\"6.8.2\"`). Useful for logging or feature detection.\n */\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year + schedule.\n *\n * Use this in preference to `new Sedra(...)` when calling repeatedly,\n * since an internal LRU cache (~120 entries) avoids recomputing the\n * keviyah-specific reading pattern.\n * @example\n * import {HebrewCalendar, HDate} from '@hebcal/core';\n * const sedra = HebrewCalendar.getSedra(5784, false);\n * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));\n * console.log(result.parsha); // ['Vayera']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Determines which form of Hallel (if any) is recited\n * on a given Hebrew date.\n *\n * Returns 0 (none), 1 (half Hallel), or 2 (whole Hallel).\n *\n * Whole Hallel is said on Chanukah, the first Yom Tov of Pesach, Shavuot, Sukkot,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)\n * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)\n * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysOnDate(hdate, il);\n if (!events) {\n return 0;\n }\n return hallel_(events, hdate);\n }\n\n /**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n * @example\n * import {HebrewCalendar, HDate, months} from '@hebcal/core';\n * // Regular weekday — Tachanun is said at both services\n * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: true, allCongs: true }\n *\n * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)\n * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);\n * // => { shacharit: true, mincha: false, allCongs: true }\n *\n * // Rosh Chodesh — no Tachanun\n * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);\n * // => { shacharit: false, mincha: false, allCongs: false }\n * @param hdate Hebrew date to test\n * @param il use the Israeli holiday schedule\n */\n static tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun(hdate, il);\n }\n}\n\n/**\n * @private\n */\nfunction isChag(date: HDate, il: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const chag = events.filter(ev => ev.hasFlag('CHAG'));\n return chag.length !== 0;\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {Event} from './event.js';\nimport {holidayDesc as hdesc} from './staticHolidays.js';\n\nconst NONE = 0;\nconst HALF = 1;\nconst WHOLE = 2;\n\n/**\n * @private\n */\nexport function hallel_(events: Event[], hdate: HDate): number {\n const abs = hdate.abs();\n for (const ev of events) {\n const hd: HDate = ev.getDate();\n if (hd.abs() !== abs) {\n continue;\n }\n const desc = ev.getDesc();\n const month = hd.getMonth();\n const mday = hd.getDate();\n if (\n desc.startsWith('Chanukah') ||\n desc.startsWith('Shavuot') ||\n desc.startsWith('Sukkot') ||\n (month === months.NISAN &&\n (mday === 15 || mday === 16) &&\n ev.hasFlag('CHAG')) || // Pesach\n desc === hdesc.YOM_HAATZMA_UT ||\n desc === hdesc.YOM_YERUSHALAYIM\n ) {\n return WHOLE;\n }\n\n if (\n ev.hasFlag('ROSH_CHODESH') ||\n (desc.startsWith('Pesach') &&\n desc !== hdesc.PESACH_I &&\n desc !== hdesc.PESACH_II)\n ) {\n return HALF;\n }\n }\n\n return NONE;\n}\n","import {HDate, getPseudoISO} from '@hebcal/hdate';\nimport {Zmanim} from './zmanim.js';\nimport {Location} from './location.js';\nimport {getHolidaysOnDate} from './holidays.js';\nimport {Event} from './event.js';\n\nfunction isTomorrowShabbosOrYomTov(dow: number, events: Event[]): boolean {\n if (dow === 5) {\n return true;\n }\n const erev = events.find(ev =>\n ev.hasAnyFlag('LIGHT_CANDLES', 'LIGHT_CANDLES_TZEIS')\n );\n if (erev) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns true if it is _Shabbos_ or if it is a _Yom Tov_ day that has a\n * _melacha_ (work) prohibition.\n *\n * @param dow day of week, where `6` is Shabbos\n * @param events events occurring on the day\n * @return `true` if the day is a _Yom Tov_ that is _assur bemlacha_, or _Shabbos_\n */\nfunction isTodayAssurBemelacha(dow: number, events: Event[]): boolean {\n if (dow === 6) {\n return true;\n }\n const chag = events.find(ev => ev.hasFlag('CHAG'));\n if (chag) {\n return true;\n }\n return false;\n}\n\n/**\n * Returns `true` if the given moment (date + time) falls within a period\n * when *melacha* (work) is prohibited — i.e. Shabbat or a Yom Tov.\n *\n * The Shabbat/Yom Tov window is taken to begin at sunset (shkiah) on the\n * preceding day (Erev Shabbat / Erev Yom Tov / Yom Tov sheni) and to end\n * at *tzais* (nightfall) on the day itself. *Tzais* is calculated using a\n * solar depression of 8.5° for simplicity; consult a halachic authority\n * for more stringent opinions.\n *\n * `useElevation` controls whether the location's elevation is taken into\n * account when computing sunset (it has no effect on the degree-based\n * tzais calculation). The Israel/Diaspora schedule comes from\n * `location.getIsrael()`.\n *\n * Throws if sunset cannot be calculated for the given location\n * (e.g. polar regions).\n * @example\n * import {isAssurBemlacha, Location} from '@hebcal/core';\n * const loc = Location.lookup('Jerusalem')!;\n * // Friday after sunset:\n * isAssurBemlacha(new Date('2024-04-26T18:00:00Z'), loc, false); // true\n * @param currentTime the moment to test (with hour/minute)\n * @param location geographic location (also supplies Israel/Diaspora flag and tzid)\n * @param useElevation include elevation when computing sunset\n * @return `true` if *melacha* is prohibited, `false` if it is not\n */\nexport function isAssurBemlacha(\n currentTime: Date,\n location: Location,\n useElevation: boolean\n): boolean {\n // Determine the calendar date in the location's timezone, not the\n // timezone of the computer running this code. Otherwise the day-of-week,\n // Hebrew date and sunset/tzais times would depend on the machine's\n // local timezone, giving different (incorrect) results near midnight.\n const isoDate = getPseudoISO(location.getTzid(), currentTime);\n const year = parseInt(isoDate.substring(0, 4), 10);\n const month = parseInt(isoDate.substring(5, 7), 10);\n const day = parseInt(isoDate.substring(8, 10), 10);\n const hd = new HDate(new Date(year, month - 1, day));\n const zmanim = new Zmanim(location, hd, useElevation);\n // erev shabbos, YT or YT sheni and after shkiah\n const sunset = zmanim.sunset();\n const sunsetMillis = sunset.getTime();\n if (isNaN(sunsetMillis)) {\n throw new Error('Could not determine sunset');\n }\n // erev shabbos, YT or YT sheni and after shkiah\n const il = location.getIsrael();\n const currentMillis = currentTime.getTime();\n const dow = hd.getDay();\n const events = getHolidaysOnDate(hd, il) || [];\n if (isTomorrowShabbosOrYomTov(dow, events) && currentMillis >= sunsetMillis) {\n return true;\n }\n // is shabbos or YT and it is before tzais\n if (isTodayAssurBemelacha(dow, events)) {\n const tzais = zmanim.tzeit();\n const tzaisMillis = tzais.getTime();\n return currentMillis <= tzaisMillis;\n }\n return false;\n}\n","import {HDate} from '@hebcal/hdate';\nimport {getHolidaysOnDate} from './holidays.js';\n\n/**\n * Returns `true` if the given date is observed as a major or minor fast day.\n *\n * Major fasts: Yom Kippur, Tish'a B'Av.\n * Minor fasts: Tzom Gedaliah, Asara B'Tevet, Ta'anit Esther, Ta'anit\n * Bechorot, Tzom Tammuz (plus BeHaB fasts when enabled).\n *\n * Erev Tish'a B'Av — even though the fast begins at sunset — is *not*\n * counted here: only the actual fast day itself returns `true`.\n * Postponed fasts return `true` on the actual observed date (e.g. when\n * 17 Tammuz falls on Shabbat and is observed on the 18th).\n * @example\n * import {isFastDay, HDate, months} from '@hebcal/core';\n * isFastDay(new HDate(10, months.TISHREI, 5784)); // true (Yom Kippur)\n * isFastDay(new HDate(11, months.TISHREI, 5784)); // false\n * @param date Hebrew Date, Gregorian date, or absolute R.D. day number\n * @param il optional; use the Israeli schedule for holidays (default Diaspora)\n * @return `true` if the date is a major or minor fast day\n */\nexport function isFastDay(date: HDate | Date | number, il?: boolean): boolean {\n const events = getHolidaysOnDate(date, il) || [];\n const fastDay = events.find(\n ev => ev.hasAnyFlag('MAJOR_FAST', 'MINOR_FAST') && !ev.hasFlag('EREV')\n );\n return Boolean(fastDay);\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {ParshaEvent} from './ParshaEvent.js';\nimport {getSedra} from './sedra.js';\n\n/**\n * Calculates the weekly Torah Reading (Parashat HaShavua) on Saturdays for\n * an entire Hebrew year.\n *\n * Saturdays on which a Yom Tov reading displaces the regular parsha\n * (e.g. Shabbat Chol ha-Moed Pesach/Sukkot, Yom Kippur on Shabbat) are\n * skipped — for those use {@link getHolidaysOnDate} or\n * {@link Sedra.lookup}.\n * @example\n * import {parshaYear} from '@hebcal/core';\n * const events = parshaYear(5784, false);\n * events[0].render('en'); // 'Parashat Ha’azinu'\n * events[0].getDate().toString(); // '8 Tishrei 5784'\n * @param year Hebrew year\n * @param il Israel (false for Diaspora)\n * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular\n * (non-holiday) Parashat HaShavua\n */\nexport function parshaYear(year: number, il: boolean): ParshaEvent[] {\n const sedra = getSedra(year, il);\n const startAbs = sedra.getFirstSaturday();\n const endAbs = HDate.hebrew2abs(year, months.ELUL, 29);\n const events: ParshaEvent[] = [];\n for (let absDt = startAbs; absDt <= endAbs; absDt += 7) {\n const parsha = sedra.lookup(absDt);\n if (!parsha.chag) {\n const ev = new ParshaEvent(parsha);\n events.push(ev);\n }\n }\n return events;\n}\n"],"names":["version","lengths","monthLengths","slice","mod","x","y","Math","floor","quotient","isGregLeapYear","year","daysInGregMonth","month","isDate","obj","Date","prototype","isPrototypeOf","toFixed","day","py","greg2abs","date","TypeError","isNaN","getTime","RangeError","getFullYear","getMonth","getDate","abs2greg","abs","l0","n400","d1","n100","d2","n4","n1","yearFromFixed","trunc","dt","setFullYear","hebrewStripNikkud","str","normalize","replace","greg","daysInMonth","isLeapYear","months","NISAN","IYYAR","SIVAN","TAMUZ","AV","ELUL","TISHREI","CHESHVAN","KISLEV","TEVET","SHVAT","ADAR_I","ADAR_II","NISAN_STR","monthNames0","monthNames","ED_CACHE_MIN","edCache","Int32Array","ED_CACHE_MAX","EPOCH","assertNumber","n","name","hebrew2abs","tempabs","endMonth","monthsInYear","m","elapsedDays","newYear","abs2hebrew","yy","mm","dd","STATIC_DAYS_IN_MONTH","d","longCheshvan","shortKislev","getMonthName","idx","elapsed","elapsedDays0","prevYear","mElapsed","pElapsed","hElapsed","parts","altDay","daysInYear","monthFromName","monthName","c","trim","toLowerCase","startsWith","substring","test","toSimpleHebrewDate","obj0","isSimpleHebrewDate","hd","heb2num","num2heb","key","val","Object","entries","num2digits","num","digits","push","i","incr","gematriya","num1","parseInt","thousands","tdigits","tdig","length","gematriyaStrToNum","gereshIdx","indexOf","ch","pad4","String","pad2","_formatters","Map","dateFormatRegex","getPseudoISO","tzid","fmt","get","f","Intl","DateTimeFormat","hour","minute","second","hour12","timeZone","set","getFormatter","format","exec","Error","getTimezoneOffset","utcStr","localStr","diffMs","ceil","isoDateString","poHe$1","headers","language","contexts","Adar","Av","Cheshvan","Elul","Iyyar","Kislev","Nisan","Sivan","Tamuz","Tammuz","Tevet","Tishrei","noopLocale","alias","h","a","s","locales","checkLocale","locale","getExistingLocale","locale1","loc","Locale","lookupTranslation","id","array","gettext","text","this","undefined","addLocale","data","ctx","addTranslation","translation","isArray","Array","t0","addTranslations","assign","getLocaleNames","from","keys","sort","b","localeCompare","hasLocale","has","ordinal","v","getEnOrdinal","isHebrewLocale","copyLocaleNoNikud","strs","poHe","poHeNoNikud","UNITS_DAY","UNITS_WEEK","UNITS_MONTH","UNITS_YEAR","HDate","rd","constructor","arguments","monthNum","fix","setMonth","abs0","isNumber","getTishreiMonth","nummonths","getDay","render","showYear","locale0","nth","dayOf","ofStr","getDayOfTranslation","dateStr","renderGematriya","suppressNikud","suppressYear","prefix","before","dayOfWeek","onOrBefore","nearest","onOrAfter","after","next","prev","add","amount","units","standardizeUnits","sign","subtract","deltaDays","other","isSameDate","toString","fullYear","charCodeAt","dayOnOrBefore","absdate","isHDate","fromGematriyaString","currentThousands","split","filter","numParts","fixMonth","fixDate","t","offset","yahrzeit","hyear","hDeath","getYahrzeitHD","birthdayOrAnniversary","orig","origYear","isOrigLeap","getBirthdayHD","Shabbat","Parashat","Balak","Bamidbar","Bechukotai","Behar","Bereshit","Beshalach","Bo","Chukat","Devarim","Eikev","Emor","Kedoshim","Korach","Masei","Matot","Metzora","Miketz","Mishpatim","Nasso","Nitzavim","Noach","Pekudei","Pinchas","Shemot","Shmini","Shoftim","Tazria","Terumah","Tetzaveh","Toldot","Tzav","Vaera","Vaetchanan","Vayakhel","Vayechi","Vayeilech","Vayera","Vayeshev","Vayetzei","Vayigash","Vayikra","Vayishlach","Yitro","Chanukah","Omer","Havdalah","Pesach","Purim","Shavuot","Sigd","Sukkot","min","Lovingkindness","Might","Beauty","Eternity","Splendor","Foundation","Majesty","Yizkor","Molad","chalakim","Misheyakir","Sunrise","Sunset","flags","CHAG","LIGHT_CANDLES","YOM_TOV_ENDS","CHUL_ONLY","IL_ONLY","LIGHT_CANDLES_TZEIS","CHANUKAH_CANDLES","ROSH_CHODESH","MINOR_FAST","SPECIAL_SHABBAT","PARSHA_HASHAVUA","DAF_YOMI","OMER_COUNT","MODERN_HOLIDAY","MAJOR_FAST","SHABBAT_MEVARCHIM","MOLAD","USER_EVENT","HEBREW_DATE","MINOR_HOLIDAY","EREV","CHOL_HAMOED","MISHNA_YOMI","YOM_KIPPUR_KATAN","YERUSHALMI_YOMI","NACH_YOMI","DAILY_LEARNING","YIZKOR","BEHAB","flagEntries","flagBit","hasOwn","flagToCategory","Event","desc","mask","attrs","getDesc","getFlags","hasFlag","hasAnyFlag","names","bits","flagNames","bit","map","renderBrief","getEmoji","emoji","basename","url","observedInIsrael","observedInDiaspora","observedIn","il","getCategories","HebrewDateEvent","super","renderBriefHebrew","numberOutOfRange","entityName","max","invalidEntity","fieldName","normalizeOptions","options","create","requireObjectLike","toFiniteNumber","arg","errorMessages.forbiddenBigIntToNumber","Number","isFinite","errorMessages.expectedFinite","toIntegerWithTrunc","toPositiveIntegerWithTruncation","errorMessages.expectedPositive","requireNumberIsPositive","isObjectLike","normalizeOptionsOrString","optionName","optionVal","res","smallestUnitStr","overflowMap","constrain","reject","epochDisambigMap","compatible","earlier","later","offsetDisambigMap","use","prefer","ignore","calendarDisplayMap","auto","never","critical","always","timeZoneDisplayMap","offsetDisplayMap","roundingModeMap","halfFloor","halfCeil","halfTrunc","expand","halfExpand","halfEven","roundingModeFuncs","hasHalf","round","directionMap","previous","coerceRoundingIncInteger","roundingInc","roundingIncrement","coerceFractionalSecondDigits","subsecDigits","fractionalSecondDigits","throwRangeError","clampEntity","coerceUnitOption","minUnit","ensureDefined","unitStr","unit","unitNameMap","durationFieldNamesAsc","invalidChoice","coerceChoiceOption","enumNameMap","defaultChoice","enumArg","enumStr","enumNum","coerceSmallestUnit","bindArgs","coerceLargestUnit","coerceTotalUnit","coerceOverflow","coerceEpochDisambig","coerceOffsetDisambig","coerceCalendarDisplay","coerceTimeZoneDisplay","coerceOffsetDisplay","coerceRoundingMode","coerceDirection","validateRoundingInc","smallestUnit","allowManyLargeUnits","solarMode","upUnitNano","nanoInUtcDay","unitNanoMap","unitNano","validateUnitRange","maxUnit","unitNamesAsc","checkLargestSmallestUnit","largestUnit","flippedSmallestLargestUnit","refineDiffOptions","roundingModeInvert","defaultLargestUnit","defaultRoundingMode","roundingMode","refineRoundingOptions","requirePropDefined","refineOverflowOptions","refineZonedFieldOptions","defaultOffsetDisambig","epochDisambig","offsetDisambig","refineTimeDisplayTuple","maxSmallestUnit","resolveSmallestUnitAndSubsecDigits","refineDateDisplayOptions","refineTimeDisplayOptions","baseErrorMessages.invalidEntity","missingField","noValidFields","validFields","join","choiceMap","missingYear","allowEra","invalidLeapMonth","invalidTimeZone","calendarId","outOfBoundsDate","missingSmallestLargestUnit","failedParse","invalidSubstring","invalidFormatType","branding","mismatchingFormatTypes","constrainToRange","TemporalUtils.isObjectLike","message","throwTypeError","clampProp","props","propName","overflow","propVal","choices","clamped","baseErrorMessages.numberOutOfRange","memoize","generator","MapClass","otherArgs","createPropDescriptors","propVals","readonly","mapProps","value","configurable","writable","createStringTagDescriptors","Symbol","toStringTag","transformer","zipPropsConst","propNames","createPropGetters","getters","slots","pluckProps","dest","allPropsEqual","props0","props1","zeroOutProps","clearUntilI","copy","boundArgs","dynamicArgs","identity","noop","capitalize","toUpperCase","sortStrings","strss","concat","createRegExp","meat","RegExp","parseSubsecNano","fracStr","padEnd","parseSign","parseInt0","padNumber","padStart","padNumber2","compareNumbers","compareBigInts","divFloorBigInt","denom","whole","divModFloorBigInt","divisor","divModFloor","modFloor","divTrunc","modTrunc","fabricateNearHalfFraction","halfCompare","isoCalendarId","gregoryEraOrigins","bce","ce","normalizeEraName","era","normalized","isoCalendarImpl","getCalendarSlotId","calendar","monthCodeRegExp","parseMonthCode","monthCode","Boolean","formatMonthCode","monthCodeNumber","isLeapMonth","monthCodeNumberToMonth","leapMonth","nanosecond","microsecond","millisecond","week","nanoInMicro","nanoInMilli","nanoInSec","nanoInMinute","nanoInHour","bigNanoInMicro","BigInt","bigNanoInMilli","bigNanoInSec","bigNanoInMinute","bigNanoInHour","bigNanoInUtcDay","divideBigNanoToExactNumber","bigNano","divisorNano","days","timeNano","timeFieldNamesAsc","timeGetters","yearFieldNamesAsc","dayFieldNamesAsc","calendarDateFieldNamesAsc","offsetFieldNames","timeZoneFieldNames","eraYearFieldNames","allYearFieldNames","monthFieldNames","monthDayFieldNames","timeFieldNamesAlpha","yearFieldNamesWithEraAlpha","yearMonthFieldNamesAlpha","yearMonthFieldNamesWithEraAlpha","yearMonthCodeFieldNamesAlpha","yearMonthCodeFieldNamesWithEraAlpha","monthCodeDayFieldNamesAlpha","dateFieldNamesAlpha","dateFieldNamesWithEraAlpha","dateTimeFieldNamesAlpha","dateTimeFieldNamesWithEraAlpha","dateTimeAndOffsetFieldNamesAlpha","dateTimeAndOffsetFieldNamesWithEraAlpha","dateTimeAndZoneFieldNamesAlpha","dateTimeAndZoneFieldNamesWithEraAlpha","yearMonthCodeDayFieldNamesAlpha","yearMonthCodeDayFieldNamesWithEraAlpha","timeFieldDefaults","validateTimeFields","timeFields","constrainTimeFields","maxValues","constrainedFields","timeFieldsToNano","timeFieldsToSec","timeFieldsToSubsecNano","timeFieldsToMilli","nanoToTimeAndDay","nano","dayDelta","nanoToTimeFields","timeMilli","nanoAfterMilli","milliAfterHour","milliAfterMinute","milliToTimeFields","epochNanoToSecMod","epochNano","epochSec","epochNanoToMilli","isoDateTimeToEpochNano","isoDateTime","isoDateToEpochNano","isoDateTimeToEpochMilli","isoDateToEpochMilli","isoDate","isoDateToEpochDays","isoPartsToEpochDays","isoYear","isoMonth","isoDay","monthIndex","UTC","epochNanoToIsoDateTime","epochDays","nanoAfterDay","epochDaysToIsoDate","legacyDate","getUTCFullYear","getUTCMonth","getUTCDate","computeIsoYearMonthFieldsForMonthDay","computeIsoDaysInMonth","computeIsoInLeapYear","computeIsoDayOfWeek","computeIsoDayOfYear","computeIsoWeekFields","yearOfWeek","weekOfYear","weeksInYear","computeIsoWeeksInYear","De","y0DayOfWeek","validateIsoDateTimeFields","validateIsoDateFields","isoInternals","constrainIsoDateFields","isIsoDateFieldsValid","computeCalendarDateFields","de","computeCalendarMonthCodeParts","N","computeIsoMonthCodeParts","computeCalendarEraFields","eraYear","computeGregoryEraFields","computeCalendarIsoFieldsFromParts","fe","computeIsoFieldsFromParts","computeCalendarMonthsInYearForYear","j","computeCalendarDaysInMonthForYearMonth","o","computeCalendarMonthCode","computeCalendarInLeapYear","q","computeCalendarMonthsInYear","computeCalendarDaysInMonth","computeCalendarDaysInYear","computeIsoDaysInYear","unitName","durationGetters","durationFieldNamesAlpha","durationTimeFieldNamesAsc","durationDateFieldNamesAsc","durationCalendarFieldNamesAsc","durationFieldDefaults","durationTimeFieldDefaults","clearDurationFields","requireString","requireType","typeName","requireNumberIsInteger","isInteger","toPrimitiveWithStringHint","isObjectLike$1","exoticToPrimitive","toPrimitive","primitive","Reflect","apply","call","toBigInt","bi","toStrictInteger","combineDateAndTime","time","epochNanoMax","epochNanoMin","plainDateEpochNanoMin","isoYearMonthIndexMin","checkIsoYearMonthInBounds","isoYearMonthIndex","checkIsoDateInBounds","allowPlainDateLowerEdge","checkIsoDateTimeInBounds","checkEpochNanoInBounds","isoDateTimeAndOffsetToEpochNano","offsetNano","roundNumberToInc","roundWithMode","clampRelativeUnitValue","startValue","valueDelta","moveValueToEpochNano","epochNanoProgress","unitWindow","computeRelativeUnitWindow","epochNano0","epochNano1","I","O","endValue","ve","qe","interpolateRelativeUnitWindow","fraction","computeEpochNanoFrac","denomBig","numeratorBig","absNumerator","absDenom","fracSign","createEpochNanoSlots","epochNanoseconds","createZonedEpochNanoSlots","createDateTimeSlots","createDateSlots","createTimeSlots","createDurationSlots","durationFields","computeDurationSign","roundZonedEpochSlotsToUnit","computeZonedDayEpochInterval","roundZonedEpochToBounds","roundZonedEpochToDay","zonedEpochSlotsToIso","getMatchingInstantFor","roundDateTimeToInc","computeNanoInc","offsetNanoseconds","roundZonedEpochToTime","roundRelativeDuration","endEpochNano","relativeOps","isZoned","nudgeFunc","isUniformUnit","nudgeZonedTimeDuration","nudgeDayTimeDuration","nudgeRelativeDuration","roundedDurationFields","roundedEpochNano","grewBigUnit","currentUnit","baseDurationFields","thresholdCompare","moveRelativeMarkerToEpochNano","roundDayTimeDurationByInc","nanoInc","getMaxDurationUnit","nanoToDurationDayTimeFields","roundBigNanoToInc","durationDayTimeToBigNano","roundedTimeFields","roundTimeToInc","roundedIsoDateTime","moveDateByDays","_largestUnit","smallestUnitFieldName","weeks","truncedVal","nudgeWindow","roundedVal","roundRelativeUnitWindow","durationTimeToBigNano","roundedTimeNano","dateDurationFields","dayWindow","dayEpochNano0","dayEpochNano1","beyondDayNano","durationTimeFields","nanoToDurationTimeFields","roundedBigNano","computeBigNanoInc","nanoDiff","expandedBigUnit","roundedDayTimeFields","isoDateTime0","isoDateTime1","getStartOfDayInstantFor","roundToMinute","bigNanoInc","roundBigNanoToIncWithTail","roundBigNanoToDayOriginInc","dayOriginNano","quotientTail","remainder","roundedTail","_zonedEpochSlotsToIso","WeakMap","B","epochFuzzy","hasZ","possibleEpochNanos","R","matchingEpochNano","fuzzy","zonedEpochNano","possibleEpochNano","possibleOffsetNano","getSingleInstantFor","disambig","gapNano","startOffsetNano","shiftedIsoDateTime","zonedEpochNanoDayBefore","C","moveYearMonth","durationSlots","first","moveToStartOfMonth","moveDate","moveZonedEpochSlots","timeOnlyNano","movedEpochNano","durationHasDateParts","moveDateTime","movedTimeFields","moveTime","durationBigNano","durDays","durTimeNano","newTimeFields","overflowDays","moveTimeByNano","moveEpochNano","deltaNano","moveEpochNanoByNano","fields","movedIsoDate","years","moveDateByCalendarUnits","dateParts","resolveMonthInMovedYear","p","yearMonthParts","addCalendarMonths","monthDelta","ae","addIsoMonths","targetLeapMonth","leapMonthMeta","l","getCommonCalendar","diffZonedDateTimesRounded","startZoned","endZoned","diffEpochNanosRounded","diffZonedEpochsExact","createZonedRelativeOps","diffDateCalendarUnitsRounded","startIsoDate","endIsoDate","smallestPrecision","compareIsoDates","diffCalendarDates","createDateRelativeOps","startEpochNano","startIsoDateTime","remainderNano","dayCorrection","timeDiffNano","maxDayCorrection","midIsoDate","midEpochNano","prepareZonedEpochDiff","start","end","diffDateTimesExact","endIsoDateTime","diffDateTimesBig","diffEndDate","asWeeks","countIsoDays","yearMonthDayStart","yearMonthDayEnd","year0","month0","day0","year1","month1","day1","ee","diffIsoMonthSlots","anchorIsoDate","yearDiff","monthDiff","dayDiff","daysInMonth1","dayCorrect","origDaysInMonth1","monthCodeNumber0","isLeapMonth0","monthCodeNumber1","isLeapMonth1","monthCorrect","month0Projected","isoDate0","isoDate1","spanRelativeDuration","relativeToSlots","isZonedEpochSlots","endSlots","origin","moveRelativeEndpointToEpochNano","dateDuration","ke","ne","duration","nanoToGivenFields","fieldNames","maxDurationSeconds","addDurationsWithoutRelativeTo","doSubtract","otherSlots","validateDurationFields","combined","roundDuration","refineRelativeTo","durationLargestUnit","relativeToInternals","relativeTo","refineDurationRoundOptions","balancedDuration","negateDuration","negateDurationFields","fieldSign","calendarUnit","validateDurationCalendarUnit","validateDurationTimeUnit","isSafeInteger","hours","minutes","durationSubMinuteToBigNano","seconds","milliseconds","microseconds","nanoseconds","largestUnitVal","dayTimeFields","compareZonedEpochSlots","zonedEpochSlots0","zonedEpochSlots1","compareIsoDateTimeFields","compareIsoDateFields","compareTimeFields","timeFields0","timeFields1","getCalendarEraOrigins","k","getCalendarFieldNames","fieldNamesWithEra","resolveCalendarYear","exoticCalendar","eraOrigins","normalizedEra","eraOrigin","yearByEra","_","eraYearToYear","resolveCalendarMonth","monthCodeParts","monthByCode","wantsLeapMonth","resolveCalendarDay","resolveTimeFields","offsetRegExp","parseOffsetNano","parseOffsetNanoMaybe","onlyHourMinute","fractionIndex","search","main","every","part","firstSubMinutePart","dateFieldRefiners","timeFieldRefiners","durationFieldRefiners","dateTimeFieldRefiners","zonedDateTimeFieldRefiners","offsetString","readAndRefineBagFields","bag","validFieldNames","fieldRefiners","requiredFieldNames","disallowEmpty","anyMatching","fieldVal","refiner","includes","refineCalendarDateFields","allowMissingDay","parseMonthCodeField","refineMonthDayFields","isIso","createDateTimeFromRefinedFields","createDateFromRefinedFields","createYearMonthFromRefinedFields","createYearMonthFromCalendarParts","createMonthDayFromRefinedFields","yearMaybe","referenceYear","re","constrainedDay","ge","isLeapMonthArg","requestedDay","V","U","u","finalYear","finalMonth","createMonthDayFromMonthCodeParts","RawDateTimeFormat","timeZonePeriodDaysByName","El_Aaiun","Tucuman","Tirane","Riga","Simferopol","Vienna","Tunis","Boa_Vista","Fortaleza","Maceio","Noronha","Recife","Gaza","Hebron","DeNoronha","minPossibleTransitionSec","formatInstantIso","refineTimeZoneString","instantSlots","timeZoneArg","refineInstantDisplayOptions","providedTimeZone","formatIsoDateTimeFields","formatOffsetNano","queryTimeZone","formatZonedDateTimeIso","zonedDateTimeSlots0","displayOptions","calendarDisplay","offsetDisplay","refineZonedDateTimeDisplayOptions","timeZoneId","timeZoneDisplay","formatTimeZone","formatCalendar","formatPlainDateTimeIso","plainDateTimeSlots0","refineDateTimeDisplayOptions","formatPlainDateIso","plainDateSlots","formatIsoDateFields","formatPlainYearMonthIso","plainYearMonthSlots","formatDateLikeIso","formatIsoYearMonthFields","formatPlainMonthDayIso","plainMonthDaySlots","formatIsoMonthDayFields","formatSimple","showCalendar","formatCalendarId","formatPlainTimeIso","formatTimeFields","formatDurationIso","wholeSec","subsecNano","subsecNanoString","formatSubsecNano","forceSec","formatDurationFragments","Y","formatDurationNumber","M","W","D","H","S","formatDurationSlots","fragObj","fragName","fragVal","force","useGrouping","toLocaleString","getSignStr","nanoRemainder0","nanoRemainder1","nanoRemainder2","isCritical","trailingZerosRE","totalNano","icuRegExp","badCharactersRegExp","resolveTimeZoneId","rawId","resolveTimeZoneRecord","upperRawId","offsetRecord","Z","kind","normId","partI","queryNamedTimeZoneRecord","upperNormId","queryTimeZoneIntlFormat","resolvedOptions","rawTimeZoneId","record","queryTimeZoneRecord","normTimeZoneId","IntlTimeZone","FixedTimeZone","compareKey","oe","computeOffsetSec","periodDays","getSample","getSplit","createSplitTuple","periodSec","getOffsetSec","startEpochSec","endEpochSec","computePeriod","clampedStartEpochSec","clampIntlSampleEpochSec","clampedEndEpochSec","startOffsetSec","endOffsetSec","pinch","forEpochSec","offsetSec","splitDurSec","middleEpochSec","Ae","zonedEpochSec","wideOffsetSec0","wideOffsetSec1","wideUtcEpochSec0","wideUtcEpochSec1","narrowOffsetSec0","ze","getTransition","direction","lookaheadEpochSec","getCurrentEpochSec","searchEpochSec","inc","searchLimit","inBounds","transitionEpochSec","intlParts","intlFormat","epochMilli","formatToParts","hash","type","formatEpochMilliToPartsRecord","relatedYear","timeZoneName","pop","resEpochSec","now","throwFailedParse","requireIsoCalendar","organized","parsePlainDateLike","parseDateTimeLike","F","finalizeDateLike","isoDateProjector","resolveCalendar","te","finalizeDate","finalizeDateTime","projectIsoYearMonthDate","projectIsoMonthDayDate","finalizeZonedDateTime","timeRegExpStr","separatorIndex","dateTimeRegExpStr","yearMonthRegExp","monthDayRegExp","dateTimeRegExp","timeRegExp","annotationRegExp","durationRegExp","zOrOffset","organizeIsoYearParts","organizeTimeParts","organizeAnnotationParts","parseYearMonthOnly","parseMonthDayOnly","parseTimeOnlyParts","hourIndex","yearSign","calendarIsCritical","calendarIds","criticalStr","mainStr","reverse","mergeCalendarFields","baseFields","additionalFields","merged","spliceFields","je","additional","allPropNames","deletablePropNames","nonMatchingPropNames","deletablePropName","computeMonthCode","totalDuration","totalUnit","refineTotalOptions","maxDurationUnit","totalDayTimeDuration","wholeValue","totalRelativeUnit","zonedDateTimeToDateTime","zonedDateTimeToDate","zonedDateTimeToTime","mergeFieldsIntoDate","inputFields","extraFields","mergedFieldNames","mergedFields","applyPlainFormatTimeZone","timeStyle","checkResolvedCalendarCompatible","strictCalendarCheck","resolvedCalendarId","createOptionsTransformer","shapeFieldNames","invalidShapeFieldNames","ignoredFieldNames","defaultShapeFields","dateStyleReplacementFields","shapeFieldNameSet","Set","invalidShapeFieldNameSet","ignoredFieldNameSet","allowPartialOverlap","dateStyle","granularShapeFields","modifierFields","otherFields","hasInvalidGranularShapeFields","hasInvalidStyleFields","hasDateStyle","hasTimeStyle","hasAnyStyle","hasGranularShapeFields","hasInvalids","hasShapeFields","hasModifierFields","transformedOptions","dateDefaultShapeFields","timeDefaultShapeFields","dateTimeDefaultShapeFields","dateShapeFieldNames","timeShapeFieldNames","dateTimeShapeFieldNames","yearMonthIgnoredFieldNames","monthDayIgnoredFieldNames","transformInstantOptions","transformZonedOptions","transformDateTimeOptions","transformDateOptions","transformTimeOptions","transformYearMonthOptions","full","long","medium","short","transformMonthDayOptions","getCurrentIsoDateTime","getCurrentEpochNano","getCurrentTimeZoneId","NativeTemporal","globalThis","Temporal","PlainYearMonthBranding","PlainMonthDayBranding","PlainDateBranding","PlainDateTimeBranding","PlainTimeBranding","ZonedDateTimeBranding","InstantBranding","DurationBranding","defineTemporalClass","cls","getSlots","getterMaps","defineProperties","getter","attachDebugString","instance","defineProperty","toJSON","invalidRecordType","forbiddenValueOf","yearMonthFieldGetters$1","dateFieldGetters$1","monthDayFieldGetters$1","yearMonthDerivedGetters","inLeapYear","dateDerivedGetters","dayOfYear","yearStartIsoDate","computeCalendarDayOfYear","computeCalendarWeekOfYear","computeCalendarYearOfWeek","daysInWeek","diffInstants","invert","instantSlots0","instantSlots1","createDiffDurationSlots","diffZonedDateTimes","slots0","slots1","diffDateTimes","plainDateTimeSlots1","diffDateTimesRounded","diffDates","plainDateSlots0","plainDateSlots1","diffDatesRounded","diffYearMonths","plainYearMonthSlots0","plainYearMonthSlots1","firstOfMonth0","firstOfMonth1","diffYearMonthsRounded","diffTimes","plainTimeSlots0","plainTimeSlots1","diffTimesRounded","withDateFields","modFields","mergeDateFields","withDateTimeFields","calendarFields","plainDateTimeSlots","origFields","partialFields","mergedCalendarFields","mergeDateTimeFields","mergedAllFields","createDateTimeFromMergedFields","withYearMonthFields","mergeYearMonthFields","withMonthDayFields","mergeMonthDayFields","withTimeFields","refinedFields","initialFields","mergeTimeFields","withZonedDateTimeFields","zonedDateTimeSlots","zonedSlots","mergeZonedDateTimeFields","createZonedDateTimeFromMergedFields","createDateTimeFormatClass","getTemporalBrandingAndSlots","createArgsProvider","transformOptions","internalsMap","getInternals","internals","ShimDateTimeFormat","observedOptionNames","trackedOptions","Proxy","_target","baseFormat","copiedOptions","$","Ce","G","Ee","we","rest","A","argsProvider","formatRange","record0","record1","epochMilli0","epochMilli1","formatRangeToParts","rawStaticDescriptors","getOwnPropertyDescriptors","createDateTimeFormatShell","getTemporalFormat","formattable","brandingAndSlots","checkTemporalDateTimeFormatCompatible","temporalDateTimeToEpochMilli","startBrandingAndSlots","startEpochMilli","endBrandingAndSlots","endEpochMilli","startBranding","startSlots","endBranding","resolveBasicCalendarId","rawCalendarId","lowerRawCalendarId","remedy","resolveBasicCalendarArg","zonedDateTimeSlotsMap","ZonedDateTime","initZonedDateTime","createZonedDateTime","toZonedDateTimeSlots","compare","arg0","arg1","getZonedDateTimeSlots","epochMilliseconds","hoursInDay","computeZonedHoursInDay","validateBag","withCalendar","calendarArg","refineCalendarArg","withTimeZone","refineTimeZoneArg","withPlainTime","plainTimeArg","plainTimeFields","zonedDateTimeWithPlainTime","optionalToPlainTimeFields","durationArg","toDurationSlots","until","otherArg","createDuration","since","startOfDay","computeZonedStartOfDay","equals","zonedDateTimeSlots1","toInstant","createInstant","toPlainDateTime","createPlainDateTime","toPlainDate","createPlainDate","toPlainTime","createPlainTime","applyZonedFormatTimeZone","getZonedTimeZoneId","getTimeZoneTransition","newEpochNano","normalizedOptions","refineDirectionOptions","valueOf","getZonedDateTimeIsoSlots","dateFieldGetters","getZonedDateTimeSlotsIfPresent","ownSlots","refineZonedDateTimeObjectLike","getCalendarFromBag","parseZonedDateTime","parsed","parseTimeZoneId","instantSlotsMap","Instant","initInstant","toInstantSlots","fromEpochMilliseconds","epochMilliToInstant","fromEpochNanoseconds","epochNanoToInstant","getInstantSlots","toZonedDateTimeISO","instantToZonedDateTime","getInstantSlotsIfPresent","parseInstant","toTemporalInstant","plainMonthDaySlotsMap","PlainMonthDay","referenceIsoYear","isoMonthInt","isoDayInt","calendarImpl","initPlainMonthDay","createPlainMonthDay","toPlainMonthDaySlots","getPlainMonthDaySlots","plainMonthDaySlots0","plainMonthDaySlots1","input","extraFieldNames","monthDayToDate","monthDayFieldGetters","getPlainMonthDaySlotsIfPresent","calendarMaybe","extractCalendarFromBag","calendarAbsent","refinePlainMonthDayObjectLike","dateSlots","origMonth","yearMonthFields","parsePlainMonthDay","plainYearMonthSlotsMap","PlainYearMonth","referenceIsoDay","isoYearInt","initPlainYearMonth","createPlainYearMonth","toPlainYearMonthSlots","getPlainYearMonthSlots","yearMonthToDate","yearMonthFieldGetters","getPlainYearMonthSlotsIfPresent","requireFields","refinePlainYearMonthObjectLike","parsePlainYearMonth","getPlainDateTimeSlotsIfPresent","getPlainDateSlotsIfPresent","getPlainTimeSlotsIfPresent","getDurationSlotsIfPresent","plainTimeSlotsMap","PlainTime","initPlainTime","toPlainTimeSlots","getPlainTimeSlots","dateTimeSlots","refinePlainTimeObjectLike","timeSlots","altParsed","dateTime","parsePlainTime","timeArg","plainDateTimeSlotsMap","PlainDateTime","initPlainDateTime","toPlainDateTimeSlots","getPlainDateTimeSlots","toZonedDateTime","refineEpochDisambigOptions","refinePlainDateTimeObjectLike","parsePlainDateTime","plainDateSlotsMap","PlainDate","initPlainDate","toPlainDateSlots","getPlainDateSlots","optionsObj","plainTime","dateToZonedDateTime","toPlainYearMonth","fieldsToYearMonth","toPlainMonthDay","fieldsToMonthDay","refinePlainDateObjectLike","parsePlainDate","timeParts","parseCalendarId","durationSlotsMap","Duration","initDuration","durationArg0","durationArg1","durationSlots0","durationSlots1","compareDurations","refinePublicRelativeTo","getDurationSlots","blank","negated","roundTo","total","totalOf","DurationFormat","refineDurationObjectLike","hasAny","hasAnyFrac","leftoverNano","parseUnit","wholeStr","timeUnit","leftoverUnits","wholeUnits","parseDuration","refineMaybeZonedDateTimeObjectLike","parseRelativeToSlots","Now","instant","zonedDateTimeISO","plainDateTimeISO","plainDateISO","plainTimeISO","degreesToRadians","degrees","PI","radiansToDegrees","radians","GeoLocation","latitude","longitude","elevation","setLocationName","setLatitude","setLongitude","setElevation","setTimeZone","locationName","getElevation","getLatitude","getLongitude","getLocationName","getTimeZone","earthRadius","NOAACalculator","geoLocation","static","getSunrise","sunrise","getUTCSunrise0","GEOMETRIC_ZENITH","getDateFromTime","getSeaLevelSunrise","getUTCSeaLevelSunrise","getBeginCivilTwilight","getSunriseOffsetByDegrees","CIVIL_ZENITH","getBeginNauticalTwilight","NAUTICAL_ZENITH","getBeginAstronomicalTwilight","ASTRONOMICAL_ZENITH","getSunset","sunset","getUTCSunset0","getSeaLevelSunset","getUTCSeaLevelSunset","getEndCivilTwilight","getSunsetOffsetByDegrees","getEndNauticalTwilight","getEndAstronomicalTwilight","getTimeOffset","offsetZenith","dawn","zenith","getUTCSunrise","getAdjustedDate","getUTCSunset","getElevationAdjustment","acos","adjustZenith","adjustedZenith","solarRadius","adjustForElevation","getSunriseUTC","getJulianDay","getSunsetUTC","getTemporalHour","endOfDay","NaN","delta","getSunTransit","temporalHour","isSunrise","epochMillis","getEpochMillisFromTime","calculatedTime","cal","localTimeHours","dayOffset","millis","setUTCFullYear","getJulianCenturiesFromJulianDay","julianDay","JULIAN_DAY_JAN_1_2000","JULIAN_DAYS_PER_CENTURY","getJulianDayFromJulianCenturies","julianCenturies","getSunGeometricMeanLongitude","getSunGeometricMeanAnomaly","getEarthOrbitEccentricity","getSunEquationOfCenter","mrad","sin","getSunTrueLongitude","getSunApparentLongitude","omega","getMeanObliquityOfEcliptic","getObliquityCorrection","cos","getSunDeclination","obliquityCorrection","lambda","sint","asin","getEquationOfTime","epsilon","geomMeanLongSun","eccentricityEarthOrbit","geomMeanAnomalySun","tan","sin2l0","sinm","getSunHourAngleAtSunrise","lat","solarDec","latRad","sdRad","getSunHourAngleAtSunset","getSolarElevation","lon","equationOfTime","hourAngleRad","decRad","getSolarAzimuth","atan","noonmin","getSolarNoonUTC","tnoon","eqTime","hourAngle","timeDiff","timeUTC","newt","solNoonUTC","citiesJson","QuickLRU","size","cache","oldCache","maxSize","maxAge","onEviction","POSITIVE_INFINITY","__oldCache","emitEvictions","item","deleteIfExpired","expiry","delete","getOrDeleteIfExpired","getItemValue","peek","moveToRecent","entriesAscending","expiresIn","deleted","clear","resize","newSize","items","removeCount","evict","count","requested","evictCount","values","iterator","entriesDescending","oldCacheSize","forEach","callbackFunction","thisArgument","for","classicCities","ZIPCODES_TZ_MAP","timeFormatCache","Location","cityName","countryCode","geoid","parseFloat","elev","cc","getIsrael","getName","getShortName","comma","getCountryCode","getTzid","getTimeFormatter","getGeoId","lookup","entry","lng","location","addLocation","initClassicCities","JSON","stringify","legacyTzToTzid","tz","dst","getUsaTzid","state","hour12cc","US","CA","BR","AU","NZ","DO","PR","GR","IN","KR","NP","ZA","reformatTimeStr","timeStr","suffix","hm","CHALAKIM_PER_DAY","getChalakimSinceMoladTohu","monthOfYear","leap","getJewishMonthOfYear","calculateMolad","absDate","moladToAbsDate","conjunctionDay","adjustedChalakim","hdate","getMoladAsDate","molad","moladSeconds","zdt","getLocalMeanTimeOffset","smartApostrophe","replaceAll","urlFriendly","enDoW","heDayNames","frDoW","night","getMoladDate","getYear","getDow","getHour","getMinutes","getChalakim","getInstant","getTchilasZmanKidushLevana3Days","getTchilasZmanKidushLevana7Days","getSofZmanKidushLevanaBetweenMoldos","getSofZmanKidushLevana15Days","dayNames","getDayNames","dow","moladStr","minutesStr","chalakimStr","and","ampm","getHebrewTimeOfDay","result","toLocaleLowerCase","fmtTime","MoladEvent","hmonth","millisToDate","setMilliseconds","ZENITH_1_POINT_583","temporalHourMillis","Zmanim","gloc","useElevation","plainDate","noaa","getUseElevation","setUseElevation","timeAtAngle","angle","rising","sunriseMillis","sunsetMillis","utc","seaLevelSunrise","seaLevelSunset","dusk","gregEve","prev0","nightHour","chatzot","chatzotNight","alotHaShachar","alotHaShachar72","sunriseOffset","alotHaShachar72zdt","misheyakir","misheyakirMachmir","getShaahZmanisBasedZmanMillis","getShaahZmanisBasedZman","sofZmanShma","sofZmanTfilla","sofZmanBiurChametzGRA","getTemporalHour72","forceSeaLevel","alot72","sunsetOffset","getTemporalHourByDeg","alot","sofZmanShmaMGA","sofZmanShmaMGA16Point1","sofZmanShmaMGA19Point8","sofZmanTfillaMGA","sofZmanTfillaMGA16Point1","sofZmanTfillaMGA19Point8","minchaGedola","minchaGedolaMGA","minchaKetana","minchaKetanaMGA","plagHaMincha","tzeit","tzeit72","neitzHaChama","shkiah","beinHaShmashos","getMidnightLastNight","getMidnightTonight","getMoladBasedTime","moladBasedTime","alos","tzais","techila","lastMidnight","midnightTonight","zman","hd2","molad2","getZmanMolad","getSunriseBaalHatanya","getSunsetBaalHatanya","alosBaalHatanya","getShaahZmanisBaalHatanya","sofZmanShmaBaalHatanya","sofZmanTfilaBaalHatanya","minchaGedolaBaalHatanya","minchaKetanaBaalHatanya","plagHaminchaBaalHatanya","tzaisBaalHatanya","formatTime","timeFormat","roundTime","millisOnly","getMilliseconds","getSeconds","secAndMillis","timeZoneOffset","offsetAbs","formatISOWithTimeZone","roundMinute","setSeconds","makeSunsetAwareHDate","dateYomHaZikaron","pdow","Sedra","rh0","rh","rhDay","firstSaturday","longC","shortK","yearType","types","theSedraArray","yearKey","find","parsha","parshiot","isValidDouble","findInternal","parsha2id","CHMPESACH","CHMSUKOT","plen","p1","p2","num2","findContaining","getSedraArray","getFirstSaturday","saturday","weekNum","index","getSedra","chag","lookupWeekday","findWeekdayParsha","sedra","endOfYear","endAbs","sat2","parsha2","doubles","PESACH","PESACH1","PESACH7","PESACH8","SHAVUOT","range","stop","yearStartVayeilech","yearStartHaazinu","yearStartRH","r020","r027","r3340","r4349","r4350","sedraCache","cacheKey","Shvat","Adar2","emojiPesach","emojiSukkot","ROSH_HASHANA_II","EREV_YOM_KIPPUR","YOM_KIPPUR","EREV_SUKKOT","SUKKOT_I","SUKKOT_II","SUKKOT_III_CHM","SUKKOT_IV_CHM","SUKKOT_V_CHM","SUKKOT_VI_CHM","SHMINI_ATZERET","SIMCHAT_TORAH","SUKKOT_II_CHM","SUKKOT_VII_HOSHANA_RABA","TU_BISHVAT","EREV_PURIM","PURIM","SHUSHAN_PURIM","EREV_PESACH","PESACH_I","PESACH_II","PESACH_II_CHM","PESACH_III_CHM","PESACH_IV_CHM","PESACH_V_CHM","PESACH_VI_CHM","PESACH_VII","PESACH_VIII","PESACH_SHENI","LAG_BAOMER","EREV_SHAVUOT","SHAVUOT_I","SHAVUOT_II","TU_BAV","ROSH_HASHANA_LABEHEMOT","EREV_ROSH_HASHANA","YOM_YERUSHALAYIM","BEN_GURION_DAY","FAMILY_DAY","YITZHAK_RABIN_MEMORIAL_DAY","HERZL_DAY","JABOTINSKY_DAY","SIGD","YOM_HAALIYAH","YOM_HAALIYAH_SCHOOL_OBSERVANCE","HEBREW_LANGUAGE_DAY","holidayDesc","ASARA_BTEVET","BIRKAT_HACHAMAH","CHAG_HABANOT","CHANUKAH_8TH_DAY","EREV_TISHA_BAV","LEIL_SELICHOT","PURIM_KATAN","PURIM_MESHULASH","SHABBAT_CHAZON","SHABBAT_HACHODESH","SHABBAT_HAGADOL","SHABBAT_NACHAMU","SHABBAT_PARAH","SHABBAT_SHEKALIM","SHABBAT_SHIRAH","SHABBAT_SHUVA","SHABBAT_ZACHOR","SHUSHAN_PURIM_KATAN","TAANIT_BECHOROT","TAANIT_BEHAB","TAANIT_ESTHER","TISHA_BAV","TZOM_GEDALIAH","TZOM_TAMMUZ","YOM_HAATZMA_UT","YOM_HASHOAH","YOM_HAZIKARON","CHANUKAH_1_CANDLE","BIUR_CHAMETZ","SOF_ZMAN_ACHILAT_CHAMETZ","staticHolidays","chmDay","staticModernHolidays","firstYear","chul","satPostponeToSun","friPostponeToSun","friSatMovetoThu","suppressEmoji","HolidayEvent","urlDateSuffix","cholHaMoedDay","cats","hdesc","AsaraBTevetEvent","KEYCAP_DIGITS","ChanukahEvent","chanukahDay","candles","RoshHashanaEvent","roshChodeshStr","RoshChodeshEvent","monthName1","ykk","YomKippurKatanEvent","nextMonthName","memo","getHolidaysOnDate","hdStr","events","getHolidaysForYear_","ev","SUN","TUE","THU","FRI","SAT","emojiIsraelFlag","yearCache","cached","RH","pesach","arr","unshift","tzomGedaliahDay","rchTevet","pesachAbs","haChodeshAbs","nisan27dt","dateYomHaShoah","yomHaZikaronDt","tamuz17attrs","tamuz17","observed","av9attrs","av9dt","av9title","av9abs","nextMonth","roshChodesh","shabbos","fastDays","beshalachHd","birkatHaChama","startMonth","startDay","baseRd","getBirkatHaChama","HAVDALAH","CANDLE_LIGHTING","TimedEvent","eventTime","linkedEvent","eventTimeStr","opts","FAST_BEGINS","FAST_ENDS","CandleLightingEvent","HavdalahEvent","havdalahMins","makeCandleEvent","isFriday","isSaturday","havdalahTitle","useHavdalahOffset","candleLightingMins","zmanim","havdalahDeg","makeFastEndTime","isTishaBav","fastEndMins","fastEndDeg","FastDayEvent","startEvent","endEvent","makeTimedEvent","TimedChanukahEvent","sefira","ps67lines","lamnatzeachLetters","anaBekoach","sefirot","en","infix","infix26","words","pfxWords","he","translit","getWeeks","omerDay","tens","ones","shnei","yamim","shneiYamim","shavuot","yom","yomEchad","asar","lamnatzeach","flatMap","OmerEvent","checkDay","weekNumber","daysWithinWeeks","omer","lang","config","codePoint","fromCodePoint","getDaysWithinWeeks","getTodayIs","ten","one","omerTodayIsHe","day7","numWeeks","omerTodayIsEn","getLamnatzeachWord","getLamnatzeachLetter","getAnaBekoachWord","NONE","shacharit","mincha","allCongs","tachanun","tachanun0","checkNext","dates","shushPurim","none","mday","some","yesPrev","tachanunYear","ret","tomorrow","tmp","ParshaEvent","renderParshaName","getAbs","MAX_NUM_YEARS","getStartAndEnd","hasStart","hasEnd","isHebrewYear","theYear","theMonth","numYears","startDate","startAbs","startEndHebrew","gregMonth","startGreg","endYear","endGreg","startEndGregorian","cals","DailyLearning","addCalendar","fn","getStartDate","getCalendars","mevarchimChodeshStr","MevarchimChodeshEvent","monNext","space","candlelighting","min0","geoIdCandleOffset","shortName","israelCityOffset","overrideIsraelCandleMins","TZEIT_3SMALL_STARS","checkCandleOptions","defaultLocation","hasUserMask","noRoshChodesh","noModern","noMinorFast","noSpecialShabbat","sedrot","dailyLearning","dafYomi","mishnaYomi","nachYomi","yerushalmi","shabbatMevarchim","yomKippurKatan","behab","yizkor","setOptionsFromMask","noHolidays","getMaskFromOptions","ashkenazi","evts","holidaysYear","beginOmer","endOmer","currentYear","startAndEnd","RECOGNIZED_OPTIONS","unrecognizedAlreadyWarned","console","warn","dailyLearningName","warnUnrecognizedOptions","startGregYear","prevEventsLength","candlesEv","holidays","appendHolidayAndRelated","biurEv","makeBiurChametzEvent","parsha0","numDailyLearning","makeDailyLearning","omerEv","makeOmerEvent","makeMoladAndMevarchimChodesh","pe","addHebrewDates","addHebrewDatesForEvents","e2","splice","Jerusalem","Haifa","eFlags","isYomKippurKatan","isBehab","erevPesachEv","zmanAchilas","zmanAchilasEv","makeErevPesachChametzEvents","isMajorFast","isMinorFast","isChanukah","hasCandles","fastEv","fastEnd","ev2","makeFastStartEnd","chanukahEv","candleLightingTime","makeWeekdayChanukahCandleLighting","learningEv","alarm","biurChametzEv","isChag","getBirthdayOrAnniversary","gdate","getYahrzeit","getHolidaysForYear","getHolidaysForYearArray","yearMap","absDt","filtered","eruvTavshilin","today","friday","pkgVersion","hallel","hallel_","currentTime","currentMillis","isTomorrowShabbosOrYomTov","isTodayAssurBemelacha","getHDate","isSefiratHaOmer","begin","tishaBav","isBeinHaMetzarim","fastDay"],"mappings":";oCACO,MAAMA,EAAU,SCCjBC,EAAU,CAAC,EAAG,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,GAAI,IAE1DC,EAAe,CAACD,EAASA,EAAQE;8FAKvC,SAASC,EAAIC,EAAGC,GACZ,OAAOD,EAAIC,EAAIC,KAAKC,MAAMH,EAAIC,EAClC,CAIA,SAASG,EAASJ,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AAx+D,CAAYu/D,EAAmBwC,EAAiB3X,GAC9Cx+C,MAAM2zD,EAAGlsE,UAAWksE,EAAG/0D,UAAW+0D,EAAGj1D,KAAMi1D,EAAGd,aAC9C3gE,KAAKikE,UAAY5S,GAAO+E,UAAU6N,GAClC,MAAM9N,EAAa7J,EAASL,mBAC5BjsD,KAAKmkE,aAAe9S,GAAO6E,WAAWl2D,KAAKikE,UAAW9N,GACtDn2D,KAAKssD,SAAWA,EAChBtsD,KAAKqN,MAAQo0D,EAAGp0D,KAClB,ECvRF,IAAAs4D,GACA,CACEC,UAAa,CACX,gEACA,0DACA,qDACA,sGACA,qDACA,0DACA,6DAEFC,mBAAsB,oDACtBC,WAAc,CACZ,SACA,UACA,YACA,YACA,WACA,WACA,YAEA,SACA,SACA,UACA,cACA,YACA,SACA,YAEA,MACA,UACA,aACA,YACA,WACA,WACA,YAEA,WACA,UACA,UACA,aACA,UACA,WACA,YAEA,SACA,UACA,SACA,UACA,QACA,WACA,YAEA,SACA,SACA,YACA,SACA,WACA,eACA,YAEA,eACA,SACA,WACA,cACA,UACA,eACA,cCxDJ,MAAMC,GAAU,CACdC,GAAI,CACFC,MAAO,UACPC,QAAS,UACTC,MAAO,CACL,GACA,iBACA,QACA,SACA,WACA,WACA,aACA,WAEFC,SAAU,MAEZC,GAAI,CACFJ,MAAO,KACPC,QAAS,KACTC,MAAO,CACL,GACA,SACA,YACA,cACA,UACA,OACA,UACA,YAEFC,SAAU,CACR,GACA,eACA,iBACA,mBACA,eACA,aACA,eACA,mBAGJE,SAAU,CACRL,MAAO,QACPC,QAAS,QACTC,MAAO,CACL,GACA,SACA,UACA,UACA,UACA,MACA,QACA,WAEFC,SAAU,OAUd,SAASG,GAASC,GAGhB,MAAO,CAFiBxyE,KAAKC,OAAOuyE,EAAU,GAAK,GAAK,EACxBA,EAAU,GAAK,EAEjD,CAwBA,MAAMC,GAAO,CAAC,GAAI,WAAY,YAAa,cAAe,eACpDC,GAAO,CACX,GACA,QACA,WACA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