@hebcal/core 6.3.0 → 6.3.1

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 (69) hide show
  1. package/dist/bundle.js +62 -41
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +6 -6
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/DailyLearning.js +1 -1
  6. package/dist/esm/HebrewDateEvent.js +1 -1
  7. package/dist/esm/HolidayEvent.js +1 -1
  8. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  9. package/dist/esm/ParshaEvent.js +1 -1
  10. package/dist/esm/TimedEvent.js +13 -8
  11. package/dist/esm/TimedEvent.js.map +1 -1
  12. package/dist/esm/YomKippurKatanEvent.js +1 -1
  13. package/dist/esm/ashkenazi.po.js +1 -1
  14. package/dist/esm/calendar.js +17 -10
  15. package/dist/esm/calendar.js.map +1 -1
  16. package/dist/esm/candles.js +4 -3
  17. package/dist/esm/candles.js.map +1 -1
  18. package/dist/esm/event.js +1 -1
  19. package/dist/esm/getStartAndEnd.js +1 -1
  20. package/dist/esm/hallel.js +1 -1
  21. package/dist/esm/he-x-NoNikud.po.js +1 -1
  22. package/dist/esm/he.po.d.ts +2 -0
  23. package/dist/esm/he.po.js +2 -2
  24. package/dist/esm/he.po.js.map +1 -1
  25. package/dist/esm/hebcal.js +1 -1
  26. package/dist/esm/holidays.js +1 -1
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/isAssurBemlacha.js +1 -1
  29. package/dist/esm/locale.js +1 -1
  30. package/dist/esm/location.d.ts +7 -0
  31. package/dist/esm/location.js +8 -1
  32. package/dist/esm/location.js.map +1 -1
  33. package/dist/esm/modern.js +1 -1
  34. package/dist/esm/molad.js +1 -1
  35. package/dist/esm/moladBase.js +1 -1
  36. package/dist/esm/moladDate.js +1 -1
  37. package/dist/esm/omer.js +3 -3
  38. package/dist/esm/omer.js.map +1 -1
  39. package/dist/esm/parshaName.js +1 -1
  40. package/dist/esm/parshaYear.js +1 -1
  41. package/dist/esm/pkgVersion.d.ts +1 -1
  42. package/dist/esm/pkgVersion.js +2 -2
  43. package/dist/esm/pkgVersion.js.map +1 -1
  44. package/dist/esm/reformatTimeStr.js +1 -1
  45. package/dist/esm/sedra.js +1 -1
  46. package/dist/esm/sefira.json.js +2 -2
  47. package/dist/esm/staticHolidays.d.ts +14 -0
  48. package/dist/esm/staticHolidays.js +22 -1
  49. package/dist/esm/staticHolidays.js.map +1 -1
  50. package/dist/esm/tachanun.js +1 -1
  51. package/dist/esm/zmanim.d.ts +1 -1
  52. package/dist/esm/zmanim.js +10 -19
  53. package/dist/esm/zmanim.js.map +1 -1
  54. package/dist/src/TimedEvent.js +12 -7
  55. package/dist/src/calendar.js +16 -9
  56. package/dist/src/candles.js +3 -2
  57. package/dist/src/he.po.d.ts +2 -0
  58. package/dist/src/he.po.js +1 -1
  59. package/dist/src/location.d.ts +7 -0
  60. package/dist/src/location.js +7 -0
  61. package/dist/src/omer.js +2 -2
  62. package/dist/src/pkgVersion.d.ts +1 -1
  63. package/dist/src/pkgVersion.js +1 -1
  64. package/dist/src/sefira.json +1 -9
  65. package/dist/src/staticHolidays.d.ts +14 -0
  66. package/dist/src/staticHolidays.js +21 -0
  67. package/dist/src/zmanim.d.ts +1 -1
  68. package/dist/src/zmanim.js +8 -17
  69. package/package.json +3 -3
@@ -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","../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-polyfill/chunks/internal.js","../node_modules/temporal-polyfill/chunks/classApi.js","../node_modules/@hebcal/noaa/dist/index.js","../node_modules/temporal-polyfill/global.esm.js","../src/location.ts","../src/reformatTimeStr.ts","../src/moladBase.ts","../src/moladDate.ts","../src/molad.ts","../src/zmanim.ts","../node_modules/quick-lru/index.js","../src/modern.ts","../src/sedra.ts","../src/staticHolidays.ts","../src/HolidayEvent.ts","../src/YomKippurKatanEvent.ts","../src/holidays.ts","../src/isAssurBemlacha.ts","../src/TimedEvent.ts","../src/candles.ts","../src/omer.ts","../src/ParshaEvent.ts","../src/parshaName.ts","../src/MevarchimChodeshEvent.ts","../src/DailyLearning.ts","../src/tachanun.ts","../src/getStartAndEnd.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.3.0';\n","/*! @hebcal/hdate v0.22.0, 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 * @param year Gregorian year\n */\nfunction 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 */\nfunction 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 */\nfunction 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 * @param date Gregorian date\n */\nfunction 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 * @param abs - R.D. number of days\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 */\nfunction 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\nexport { abs2greg, daysInGregMonth, greg2abs, isDate, isGregLeapYear };\n//# sourceMappingURL=greg.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/**\n * Removes niqqud from Hebrew string\n */\nfunction hebrewStripNikkud(str) {\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\nexport { hebrewStripNikkud };\n//# sourceMappingURL=hebrewStripNikkud.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { abs2greg, daysInGregMonth, greg2abs, isDate, isGregLeapYear } from './greg.js';\n\n/* eslint-disable @typescript-eslint/no-namespace */\n/**\n * Gregorian date helper functions\n */\nvar greg;\n(function (greg) {\n})(greg || (greg = {}));\ngreg.abs2greg = abs2greg;\ngreg.daysInMonth = daysInGregMonth;\ngreg.greg2abs = greg2abs;\ngreg.isDate = isDate;\ngreg.isLeapYear = isGregLeapYear;\n\nexport { greg };\n//# sourceMappingURL=gregNamespace.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { hebrewStripNikkud } from './hebrewStripNikkud.js';\n\n/*\n * More minimal HDate\n */\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 * @readonly\n * @enum {number}\n */\nconst 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];\nconst edCache = new Map();\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 Gregorian\n * Calendar.\n * @param year Hebrew year\n * @param month Hebrew month\n * @param day Hebrew date (1-30)\n * @example\n * const abs = hebrew2abs(5769, months.CHESHVAN, 15);\n */\nfunction 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 for (let m = TISHREI; m <= monthsInYear(year); 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 * 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 */\nfunction 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 */\nfunction 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 * @param year Hebrew year\n */\nfunction 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 * @param year Hebrew year\n */\nfunction monthsInYear(year) {\n return 12 + +isLeapYear(year); // boolean is cast to 1 or 0\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 */\nfunction daysInMonth(month, year) {\n switch (month) {\n case IYYAR:\n case TAMUZ:\n case ELUL:\n case TEVET:\n case ADAR_II:\n return 29;\n }\n if ((month === ADAR_I && !isLeapYear(year)) ||\n (month === CHESHVAN && !longCheshvan(year)) ||\n (month === KISLEV && shortKislev(year))) {\n return 29;\n }\n else {\n return 30;\n }\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 */\nfunction 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\n * @param year Hebrew year\n */\nfunction elapsedDays(year) {\n const n = edCache.get(year);\n if (typeof n === 'number') {\n return n;\n }\n const elapsed = elapsedDays0(year);\n edCache.set(year, elapsed);\n return elapsed;\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 * @param year Hebrew year\n */\nfunction daysInYear(year) {\n return elapsedDays(year + 1) - elapsedDays(year);\n}\n/**\n * true if Cheshvan is long in Hebrew year\n * @param year Hebrew year\n */\nfunction longCheshvan(year) {\n return daysInYear(year) % 10 === 5;\n}\n/**\n * true if Kislev is short in Hebrew year\n * @param year Hebrew year\n */\nfunction shortKislev(year) {\n return daysInYear(year) % 10 === 3;\n}\n/**\n * Converts Hebrew month string name to numeric\n * @param monthName monthName\n */\nfunction 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 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 }\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 }\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 }\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 }\n break;\n case 'ת':\n switch (c[1]) {\n case 'מ':\n return TAMUZ;\n case 'ש':\n return TISHREI;\n }\n break;\n }\n throw new RangeError(`bad monthName: ${monthName}`);\n}\n\nexport { abs2hebrew, daysInMonth, daysInYear, elapsedDays, getMonthName, hd2abs, hebrew2abs, isLeapYear, longCheshvan, monthFromName, months, monthsInYear, shortKislev };\n//# sourceMappingURL=hdateBase.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { monthsInYear, longCheshvan, months, shortKislev, isLeapYear, hebrew2abs, abs2hebrew } from './hdateBase.js';\nimport { abs2greg, isDate, greg2abs } from './greg.js';\n\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 * @private\n */\nfunction toSimpleHebrewDate(obj) {\n if (isSimpleHebrewDate(obj)) {\n return obj;\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.\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 * 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 {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 * @param hyear Hebrew year\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear`\n */\nfunction 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}\nfunction 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).\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 * 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 {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\n * @param date Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\nfunction 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}\nfunction 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\nexport { getBirthdayHD, getBirthdayOrAnniversary, getYahrzeit, getYahrzeitHD };\n//# sourceMappingURL=anniversary.js.map\n","/*! @hebcal/hdate v0.22.0, 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);\n digits.push(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 */\nfunction 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 */\nfunction gematriyaStrToNum(str) {\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\nexport { gematriya, gematriyaStrToNum };\n//# sourceMappingURL=gematriya.js.map\n","/*! @hebcal/hdate v0.22.0, 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 */\nfunction 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 */\nfunction pad2(num) {\n if (num >= 0 && num < 10) {\n return '0' + num;\n }\n return String(num);\n}\n\nexport { pad2, pad4 };\n//# sourceMappingURL=pad.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { pad4, pad2 } from './pad.js';\n\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 */\nfunction 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 */\nfunction 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 * Returns YYYY-MM-DD in the local timezone\n */\nfunction isoDateString(dt) {\n return (pad4(dt.getFullYear()) +\n '-' +\n pad2(dt.getMonth() + 1) +\n '-' +\n pad2(dt.getDate()));\n}\n\nexport { getPseudoISO, getTimezoneOffset, isoDateString };\n//# sourceMappingURL=dateFormat.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nvar poAshkenazi = { \"headers\": { \"plural-forms\": \"nplurals=2; plural=(n > 1);\", \"language\": \"en_CA@ashkenazi\" }, \"contexts\": { \"\": { \"Tevet\": [\"Teves\"] } } };\n\nexport { poAshkenazi as default };\n//# sourceMappingURL=ashkenazi.po.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nvar poHe = { \"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\nexport { poHe as default };\n//# sourceMappingURL=he.po.js.map\n","/*! @hebcal/hdate v0.22.0, 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';\n\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 */\nclass 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 */\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 */\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.\n * @param locale Locale name (i.e.: `'he'`, `'fr'`)\n * @param data parsed data from a `.po` file.\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 */\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 * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @param data parsed data from a `.po` file.\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 */\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 */\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 */\n static ordinal(n, locale) {\n let locale0 = locale?.toLowerCase();\n if (!locale0) {\n return getEnOrdinal(n);\n }\n locale0 = alias[locale0] || locale0;\n switch (locale0) {\n case 'en':\n case 'ashkenazi':\n return getEnOrdinal(n);\n case 'es':\n return n + 'º';\n case 'he':\n case 'he-x-nonikud':\n return String(n);\n }\n if (locale0.startsWith('ashkenazi')) {\n return getEnOrdinal(n);\n }\n return n + '.';\n }\n /**\n * Removes nekudot from Hebrew string\n */\n static hebrewStripNikkud(str) {\n return hebrewStripNikkud(str);\n }\n /**\n * Makes a copy of entire Hebrew locale with no niqqud\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}\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\nexport { Locale };\n//# sourceMappingURL=locale.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { abs2hebrew, isLeapYear, monthsInYear, daysInMonth, hebrew2abs, getMonthName, monthFromName, daysInYear, longCheshvan, shortKislev, months } from './hdateBase.js';\nimport { isDate, greg2abs, abs2greg } from './greg.js';\nimport { gematriya, gematriyaStrToNum } from './gematriya.js';\nimport { Locale } from './locale.js';\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 */\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 */\nclass 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.getDate(); // 4\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 * @example\n * new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014\n * new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * @example\n * new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * @example\n * new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014\n * new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n */\n after(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 7);\n }\n /**\n * Returns the next Hebrew date\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.next(); // '16 Cheshvan 5769'\n */\n next() {\n return new HDate(this.abs() + 1);\n }\n /**\n * Returns the previous Hebrew date\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.prev(); // '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 */\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 * const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769\n * const hd3 = hd1.add(-3, 'M'); // 30 Av 5768\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 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 * @param dayOfWeek day of week: Sunday=0, Saturday=6\n */\n static dayOnOrBefore(dayOfWeek, absdate) {\n return absdate - ((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 * @example\n * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783\n * HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704\n * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708\n */\n static fromGematriyaString(str, currentThousands = 5000) {\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 }\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\nexport { HDate };\n//# sourceMappingURL=hdate.js.map\n","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n > 1);\",\"language\":\"en_CA@ashkenazi\"},\"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\"],\"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 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 %s\":[\"רֹאשׁ חוֹדֶשׁ %s\"],\"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 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\":[\"צֵאת הַכּוֹכָבִים\"]}}}","import {Locale} from '@hebcal/hdate';\nimport poAshkenazi from './ashkenazi.po';\nimport poHe from './he.po';\nimport noNikudOverride from './he-x-NoNikud.po';\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'; // 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 * @readonly\n * @enum {number}\n */\nexport const flags = {\n /** Chag, yontiff, yom tov */\n CHAG: 0x000001,\n /** Light candles 18 minutes 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} as const;\n\nconst flagToCategory = [\n [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],\n [flags.CHANUKAH_CANDLES, 'holiday', 'major'],\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, and more.\n *\n * To get the title of the event a language other than English\n * with Sephardic transliterations, use the `render()` method.\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 } else 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 * 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 return this.render(locale);\n }\n /**\n * Optional holiday-specific Emoji or `null`.\n */\n getEmoji(): string | null {\n return this.emoji || null;\n }\n /**\n * Returns a simplified (untranslated) description for this event. For example,\n * the `HolidayEvent` class supports\n * \"Erev Pesach\" => \"Pesach\", and \"Sukkot III (CH''M)\" => \"Sukkot\".\n * For many holidays the basename and the event description are the same.\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 * Returns `undefined` for events with no detail page.\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 a list of event categories\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';\nimport './locale'; // 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","function clampProp(e, n, t, o, r) {\n return ba(n, ((e, n) => {\n const t = e[n];\n if (void 0 === t) {\n throw new TypeError(missingField(n));\n }\n return t;\n })(e, n), t, o, r);\n}\n\nfunction ba(e, n, t, o, r, i) {\n const a = clampNumber(n, t, o);\n if (r && n !== a) {\n throw new RangeError(numberOutOfRange(e, n, t, o, i));\n }\n return a;\n}\n\nfunction s(e) {\n return null !== e && /object|function/.test(typeof e);\n}\n\nfunction on(e, n = Map) {\n const t = new n;\n return (n, ...o) => {\n if (t.has(n)) {\n return t.get(n);\n }\n const r = e(n, ...o);\n return t.set(n, r), r;\n };\n}\n\nfunction r(e) {\n return n({\n name: e\n }, 1);\n}\n\nfunction n(n, t) {\n return e((e => ({\n value: e,\n configurable: 1,\n writable: !t\n })), n);\n}\n\nfunction t(n) {\n return e((e => ({\n get: e,\n configurable: 1\n })), n);\n}\n\nfunction o(e) {\n return {\n [Symbol.toStringTag]: {\n value: e,\n configurable: 1\n }\n };\n}\n\nfunction zipProps(e, n) {\n const t = {};\n let o = e.length;\n for (const r of n) {\n t[e[--o]] = r;\n }\n return t;\n}\n\nfunction e(e, n, t) {\n const o = {};\n for (const r in n) {\n o[r] = e(n[r], r, t);\n }\n return o;\n}\n\nfunction P(e, n, t) {\n const o = {};\n for (let r = 0; r < n.length; r++) {\n const i = n[r];\n o[i] = e(i, r, t);\n }\n return o;\n}\n\nfunction remapProps(e, n, t) {\n const o = {};\n for (let r = 0; r < e.length; r++) {\n o[n[r]] = t[e[r]];\n }\n return o;\n}\n\nfunction nn(e, n) {\n const t = Object.create(null);\n for (const o of e) {\n t[o] = n[o];\n }\n return t;\n}\n\nfunction hasAnyPropsByName(e, n) {\n for (const t of n) {\n if (t in e) {\n return 1;\n }\n }\n return 0;\n}\n\nfunction allPropsEqual(e, n, t) {\n for (const o of e) {\n if (n[o] !== t[o]) {\n return 0;\n }\n }\n return 1;\n}\n\nfunction zeroOutProps(e, n, t) {\n const o = {\n ...t\n };\n for (let t = 0; t < n; t++) {\n o[e[t]] = 0;\n }\n return o;\n}\n\nfunction gt(e, ...n) {\n return (...t) => e(...n, ...t);\n}\n\nfunction Io(e) {\n return e;\n}\n\nfunction noop() {}\n\nfunction capitalize(e) {\n return e[0].toUpperCase() + e.substring(1);\n}\n\nfunction sortStrings(e) {\n return e.slice().sort();\n}\n\nfunction padNumber(e, n) {\n return String(n).padStart(e, \"0\");\n}\n\nfunction compareNumbers(e, n) {\n return Math.sign(e - n);\n}\n\nfunction clampNumber(e, n, t) {\n return Math.min(Math.max(e, n), t);\n}\n\nfunction divModFloor(e, n) {\n return [ Math.floor(e / n), modFloor(e, n) ];\n}\n\nfunction modFloor(e, n) {\n return (e % n + n) % n;\n}\n\nfunction divModTrunc(e, n) {\n return [ divTrunc(e, n), modTrunc(e, n) ];\n}\n\nfunction divTrunc(e, n) {\n return Math.trunc(e / n) || 0;\n}\n\nfunction modTrunc(e, n) {\n return e % n || 0;\n}\n\nfunction hasHalf(e) {\n return .5 === Math.abs(e % 1);\n}\n\nfunction givenFieldsToBigNano(e, n, t) {\n let o = 0, r = 0;\n for (let i = 0; i <= n; i++) {\n const n = e[t[i]], a = Zu[i], s = go / a, [c, u] = divModTrunc(n, s);\n o += u * a, r += c;\n }\n const [i, a] = divModTrunc(o, go);\n return [ r + i, a ];\n}\n\nfunction nanoToGivenFields(e, n, t) {\n const o = {};\n for (let r = n; r >= 0; r--) {\n const n = Zu[r];\n o[t[r]] = divTrunc(e, n), e = modTrunc(e, n);\n }\n return o;\n}\n\nfunction m(e) {\n if (void 0 !== e) {\n return d(e);\n }\n}\n\nfunction g(e) {\n if (void 0 !== e) {\n return h(e);\n }\n}\n\nfunction S(e) {\n if (void 0 !== e) {\n return T(e);\n }\n}\n\nfunction h(e) {\n return requireNumberIsPositive(T(e));\n}\n\nfunction T(e) {\n return _e(rl(e));\n}\n\nfunction requirePropDefined(e, n) {\n if (null == n) {\n throw new RangeError(missingField(e));\n }\n return n;\n}\n\nfunction oa(e) {\n if (!s(e)) {\n throw new TypeError(ru);\n }\n return e;\n}\n\nfunction requireType(e, n, t = e) {\n if (typeof n !== e) {\n throw new TypeError(invalidEntity(t, n));\n }\n return n;\n}\n\nfunction _e(e, n = \"number\") {\n if (!Number.isInteger(e)) {\n throw new RangeError(expectedInteger(n, e));\n }\n return e || 0;\n}\n\nfunction requireNumberIsPositive(e, n = \"number\") {\n if (e <= 0) {\n throw new RangeError(expectedPositive(n, e));\n }\n return e;\n}\n\nfunction tu(e) {\n if (\"symbol\" == typeof e) {\n throw new TypeError(ou);\n }\n return String(e);\n}\n\nfunction toStringViaPrimitive(e, n) {\n return s(e) ? String(e) : d(e, n);\n}\n\nfunction toBigInt(e) {\n if (\"string\" == typeof e) {\n return BigInt(e);\n }\n if (\"bigint\" != typeof e) {\n throw new TypeError(invalidBigInt(e));\n }\n return e;\n}\n\nfunction toNumber(e, n = \"number\") {\n if (\"bigint\" == typeof e) {\n throw new TypeError(forbiddenBigIntToNumber(n));\n }\n if (e = Number(e), !Number.isFinite(e)) {\n throw new RangeError(expectedFinite(n, e));\n }\n return e;\n}\n\nfunction Za(e, n) {\n return Math.trunc(toNumber(e, n)) || 0;\n}\n\nfunction Ba(e, n) {\n return _e(toNumber(e, n), n);\n}\n\nfunction toPositiveInteger(e, n) {\n return requireNumberIsPositive(Za(e, n), n);\n}\n\nfunction createBigNano(e, n) {\n let [t, o] = divModTrunc(n, go), r = e + t;\n const i = Math.sign(r);\n return i && i === -Math.sign(o) && (r -= i, o += i * go), [ r, o ];\n}\n\nfunction so(e, n, t = 1) {\n return createBigNano(e[0] + n[0] * t, e[1] + n[1] * t);\n}\n\nfunction Ta(e, n) {\n return createBigNano(e[0], e[1] + n);\n}\n\nfunction va(e, n) {\n return so(n, e, -1);\n}\n\nfunction pa(e, n) {\n return compareNumbers(e[0], n[0]) || compareNumbers(e[1], n[1]);\n}\n\nfunction bigNanoOutside(e, n, t) {\n return -1 === pa(e, n) || 1 === pa(e, t);\n}\n\nfunction bigIntToBigNano(e, n = 1) {\n const t = BigInt(go / n);\n return [ Number(e / t), Number(e % t) * n ];\n}\n\nfunction Ge(e, n = 1) {\n const t = go / n, [o, r] = divModTrunc(e, t);\n return [ o, r * n ];\n}\n\nfunction bigNanoToBigInt(e, n = 1) {\n const [t, o] = e, r = Math.floor(o / n), i = go / n;\n return BigInt(t) * BigInt(i) + BigInt(r);\n}\n\nfunction La(e, n = 1, t) {\n const [o, r] = e, [i, a] = divModTrunc(r, n);\n return o * (go / n) + (i + (t ? a / n : 0));\n}\n\nfunction Oa(e) {\n return e[0] + e[1] / go;\n}\n\nfunction divModBigNano(e, n, t = divModFloor) {\n const [o, r] = e, [i, a] = t(r, n);\n return [ o * (go / n) + i, a ];\n}\n\nfunction checkIsoYearMonthInBounds(e) {\n return clampProp(e, \"isoYear\", Nl, yl, 1), e.isoYear === Nl ? clampProp(e, \"isoMonth\", 4, 12, 1) : e.isoYear === yl && clampProp(e, \"isoMonth\", 1, 9, 1), \n e;\n}\n\nfunction To(e) {\n return Do({\n ...e,\n ...At,\n isoHour: 12\n }), e;\n}\n\nfunction Do(e) {\n const n = clampProp(e, \"isoYear\", Nl, yl, 1), t = n === Nl ? 1 : n === yl ? -1 : 0;\n return t && io(ma({\n ...e,\n isoDay: e.isoDay + t,\n isoNanosecond: e.isoNanosecond - t\n })), e;\n}\n\nfunction io(e) {\n if (!e || bigNanoOutside(e, Ml, Tl)) {\n throw new RangeError(Mu);\n }\n return e;\n}\n\nfunction isoTimeFieldsToNano(e) {\n return givenFieldsToBigNano(e, 5, w)[1];\n}\n\nfunction nanoToIsoTimeAndDay(e) {\n const [n, t] = divModFloor(e, go);\n return [ nanoToGivenFields(t, 5, w), n ];\n}\n\nfunction epochNanoToSec(e) {\n return epochNanoToSecMod(e)[0];\n}\n\nfunction epochNanoToSecMod(e) {\n return divModBigNano(e, oo);\n}\n\nfunction isoToEpochMilli(e) {\n return isoArgsToEpochMilli(e.isoYear, e.isoMonth, e.isoDay, e.isoHour, e.isoMinute, e.isoSecond, e.isoMillisecond);\n}\n\nfunction ma(e) {\n const n = isoToEpochMilli(e);\n if (void 0 !== n) {\n const [t, o] = divModTrunc(n, Cu);\n return [ t, o * Ke + (e.isoMicrosecond || 0) * ro + (e.isoNanosecond || 0) ];\n }\n}\n\nfunction isoToEpochNanoWithOffset(e, n) {\n const [t, o] = nanoToIsoTimeAndDay(isoTimeFieldsToNano(e) - n);\n return io(ma({\n ...e,\n isoDay: e.isoDay + o,\n ...t\n }));\n}\n\nfunction isoArgsToEpochSec(...e) {\n return isoArgsToEpochMilli(...e) / ku;\n}\n\nfunction isoArgsToEpochMilli(...e) {\n const [n, t] = isoToLegacyDate(...e), o = n.valueOf();\n if (!isNaN(o)) {\n return o - t * Cu;\n }\n}\n\nfunction isoToLegacyDate(e, n = 1, t = 1, o = 0, r = 0, i = 0, a = 0) {\n const s = e === Nl ? 1 : e === yl ? -1 : 0, c = new Date;\n return c.setUTCHours(o, r, i, a), c.setUTCFullYear(e, n - 1, t + s), [ c, s ];\n}\n\nfunction So(e, n) {\n let [t, o] = Ta(e, n);\n o < 0 && (o += go, t -= 1);\n const [r, i] = divModFloor(o, Ke), [a, s] = divModFloor(i, ro);\n return Pa(t * Cu + r, a, s);\n}\n\nfunction Pa(e, n = 0, t = 0) {\n const o = Math.ceil(Math.max(0, Math.abs(e) - gl) / Cu) * Math.sign(e), r = new Date(e - o * Cu);\n return zipProps(pl, [ r.getUTCFullYear(), r.getUTCMonth() + 1, r.getUTCDate() + o, r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds(), r.getUTCMilliseconds(), n, t ]);\n}\n\nfunction hashIntlFormatParts(e, n) {\n if (n < -gl) {\n throw new RangeError(Mu);\n }\n const t = e.formatToParts(n), o = {};\n for (const e of t) {\n o[e.type] = e.value;\n }\n return o;\n}\n\nfunction computeIsoDay(e) {\n return e.isoDay;\n}\n\nfunction computeIsoDateParts(e) {\n return [ e.isoYear, e.isoMonth, e.isoDay ];\n}\n\nfunction computeIsoMonthCodeParts(e, n) {\n return [ n, 0 ];\n}\n\nfunction computeIsoYearMonthForMonthDay(e, n) {\n if (!n) {\n return [ Pl, e ];\n }\n}\n\nfunction computeIsoFieldsFromParts(e, n, t) {\n return {\n isoYear: e,\n isoMonth: n,\n isoDay: t\n };\n}\n\nfunction fo() {\n return 7;\n}\n\nfunction computeIsoMonthsInYear() {\n return Fl;\n}\n\nfunction computeIsoDaysInMonth(e, n) {\n switch (n) {\n case 2:\n return computeIsoInLeapYear(e) ? 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(e) {\n return computeIsoInLeapYear(e) ? 366 : 365;\n}\n\nfunction computeIsoInLeapYear(e) {\n return e % 4 == 0 && (e % 100 != 0 || e % 400 == 0);\n}\n\nfunction Ha(e) {\n const [n, t] = isoToLegacyDate(e.isoYear, e.isoMonth, e.isoDay);\n return modFloor(n.getUTCDay() - t, 7) || 7;\n}\n\nfunction computeIsoEraParts(e) {\n return this.id === Xu ? (({isoYear: e}) => e < 1 ? [ \"gregory-inverse\", 1 - e ] : [ \"gregory\", e ])(e) : this.id === el ? Ol(e) : [];\n}\n\nfunction computeJapaneseEraParts(e) {\n const n = isoToEpochMilli(e);\n if (n < El) {\n const {isoYear: n} = e;\n return n < 1 ? [ \"japanese-inverse\", 1 - n ] : [ \"japanese\", n ];\n }\n const t = hashIntlFormatParts(bf(el), n), {era: o, eraYear: r} = parseIntlYear(t, el);\n return [ o, r ];\n}\n\nfunction checkIsoDateTimeFields(e) {\n return checkIsoDateFields(e), constrainIsoTimeFields(e, 1), e;\n}\n\nfunction checkIsoDateFields(e) {\n return constrainIsoDateFields(e, 1), e;\n}\n\nfunction isIsoDateFieldsValid(e) {\n return allPropsEqual(ml, e, constrainIsoDateFields(e));\n}\n\nfunction constrainIsoDateFields(e, n) {\n const {isoYear: t} = e, o = clampProp(e, \"isoMonth\", 1, computeIsoMonthsInYear(), n);\n return {\n isoYear: t,\n isoMonth: o,\n isoDay: clampProp(e, \"isoDay\", 1, computeIsoDaysInMonth(t, o), n)\n };\n}\n\nfunction constrainIsoTimeFields(e, n) {\n return zipProps(w, [ clampProp(e, \"isoHour\", 0, 23, n), clampProp(e, \"isoMinute\", 0, 59, n), clampProp(e, \"isoSecond\", 0, 59, n), clampProp(e, \"isoMillisecond\", 0, 999, n), clampProp(e, \"isoMicrosecond\", 0, 999, n), clampProp(e, \"isoNanosecond\", 0, 999, n) ]);\n}\n\nfunction dt(e) {\n return void 0 === e ? 0 : Gl(oa(e));\n}\n\nfunction je(e, n = 0) {\n e = normalizeOptions(e);\n const t = Vl(e), o = _l(e, n);\n return [ Gl(e), o, t ];\n}\n\nfunction refineDiffOptions(e, n, t, o = 9, r = 0, i = 4) {\n n = normalizeOptions(n);\n let a = $l(n, o, r), s = parseRoundingIncInteger(n), c = Xl(n, i);\n const u = xl(n, o, r, 1);\n return null == a ? a = Math.max(t, u) : checkLargestSmallestUnit(a, u), s = refineRoundingInc(s, u, 1), \n e && (c = (e => e < 4 ? (e + 2) % 4 : e)(c)), [ a, u, s, c ];\n}\n\nfunction refineRoundingOptions(e, n = 6, t) {\n let o = parseRoundingIncInteger(e = normalizeOptionsOrString(e, bl));\n const r = Xl(e, 7);\n let i = xl(e, n);\n return i = requirePropDefined(bl, i), o = refineRoundingInc(o, i, void 0, t), [ i, o, r ];\n}\n\nfunction refineRoundingMathOptions(e, n, t) {\n let o = parseRoundingIncInteger(n = normalizeOptionsOrString(n, wl));\n const r = Xl(n, 7);\n return o = refineRoundingInc(o, e, t), [ o, r ];\n}\n\nfunction Ma(e, n) {\n return void 0 !== n ? refineRoundingMathOptions(e, n, 1) : [];\n}\n\nfunction co(e, n) {\n return void 0 !== n ? refineRoundingMathOptions(e, n) : [ 1, 7 ];\n}\n\nfunction refineDateDisplayOptions(e) {\n return Jl(normalizeOptions(e));\n}\n\nfunction refineTimeDisplayOptions(e, n) {\n return refineTimeDisplayTuple(normalizeOptions(e), n);\n}\n\nfunction Ze(e) {\n const n = normalizeOptionsOrString(e, kl), t = refineChoiceOption(kl, Wl, n, 0);\n if (!t) {\n throw new RangeError(invalidEntity(kl, t));\n }\n return t;\n}\n\nfunction refineTimeDisplayTuple(e, n = 4) {\n const t = refineSubsecDigits(e);\n return [ Xl(e, 4), ...refineSmallestUnitAndSubsecDigits(xl(e, n), t) ];\n}\n\nfunction refineSmallestUnitAndSubsecDigits(e, n) {\n return null != e ? [ Zu[e], e < 4 ? 9 - 3 * e : -1 ] : [ void 0 === n ? 1 : 10 ** (9 - n), n ];\n}\n\nfunction parseRoundingIncInteger(e) {\n const n = e[Bl];\n return void 0 === n ? 1 : Za(n, Bl);\n}\n\nfunction refineRoundingInc(e, n, t, o) {\n const r = o ? go : Zu[n + 1];\n if (r) {\n const t = Zu[n];\n if (r % ((e = ba(Bl, e, 1, r / t - (o ? 0 : 1), 1)) * t)) {\n throw new RangeError(invalidEntity(Bl, e));\n }\n } else {\n e = ba(Bl, e, 1, t ? 10 ** 9 : 1, 1);\n }\n return e;\n}\n\nfunction refineSubsecDigits(e) {\n let n = e[Yl];\n if (void 0 !== n) {\n if (\"number\" != typeof n) {\n if (\"auto\" === tu(n)) {\n return;\n }\n throw new RangeError(invalidEntity(Yl, n));\n }\n n = ba(Yl, Math.floor(n), 0, 9, 1);\n }\n return n;\n}\n\nfunction normalizeOptions(e) {\n return void 0 === e ? {} : oa(e);\n}\n\nfunction normalizeOptionsOrString(e, n) {\n return \"string\" == typeof e ? {\n [n]: e\n } : oa(e);\n}\n\nfunction fabricateOverflowOptions(e) {\n return {\n overflow: Rl[e]\n };\n}\n\nfunction refineUnitOption(e, n, t = 9, o = 0, r) {\n let i = n[e];\n if (void 0 === i) {\n return r ? o : void 0;\n }\n if (i = tu(i), \"auto\" === i) {\n return r ? o : null;\n }\n let a = Bu[i];\n if (void 0 === a && (a = ul[i]), void 0 === a) {\n throw new RangeError(invalidChoice(e, i, Bu));\n }\n return ba(e, a, o, t, 1, Yu), a;\n}\n\nfunction refineChoiceOption(e, n, t, o = 0) {\n const r = t[e];\n if (void 0 === r) {\n return o;\n }\n const i = tu(r), a = n[i];\n if (void 0 === a) {\n throw new RangeError(invalidChoice(e, i, n));\n }\n return a;\n}\n\nfunction checkLargestSmallestUnit(e, n) {\n if (n > e) {\n throw new RangeError(Eu);\n }\n}\n\nfunction xe(e) {\n return {\n branding: Re,\n epochNanoseconds: e\n };\n}\n\nfunction Xe(e, n, t) {\n return {\n branding: _,\n calendar: t,\n timeZone: n,\n epochNanoseconds: e\n };\n}\n\nfunction jt(e, n = e.calendar) {\n return {\n branding: x,\n calendar: n,\n ...nn(Il, e)\n };\n}\n\nfunction W(e, n = e.calendar) {\n return {\n branding: G,\n calendar: n,\n ...nn(Ca, e)\n };\n}\n\nfunction createPlainYearMonthSlots(e, n = e.calendar) {\n return {\n branding: Qt,\n calendar: n,\n ...nn(Ca, e)\n };\n}\n\nfunction createPlainMonthDaySlots(e, n = e.calendar) {\n return {\n branding: qt,\n calendar: n,\n ...nn(Ca, e)\n };\n}\n\nfunction St(e) {\n return {\n branding: ft,\n ...nn(hl, e)\n };\n}\n\nfunction pe(e) {\n return {\n branding: A,\n sign: computeDurationSign(e),\n ...nn(il, e)\n };\n}\n\nfunction ta(e) {\n return epochNanoToSec(e.epochNanoseconds);\n}\n\nfunction I(e) {\n return divModBigNano(e.epochNanoseconds, Ke)[0];\n}\n\nfunction aa(e) {\n return bigNanoToBigInt(e.epochNanoseconds, ro);\n}\n\nfunction b(e) {\n return bigNanoToBigInt(e.epochNanoseconds);\n}\n\nfunction fa(e) {\n return e.epochNanoseconds;\n}\n\nfunction J(e, n, t, o, r) {\n const i = getMaxDurationUnit(o), [a, s] = ((e, n) => {\n const t = n((e = normalizeOptionsOrString(e, Sl))[Cl]);\n let o = Hl(e);\n return o = requirePropDefined(Sl, o), [ o, t ];\n })(r, e), c = Math.max(a, i);\n if (!s && isUniformUnit(c, s)) {\n return totalDayTimeDuration(o, a);\n }\n if (!s) {\n throw new RangeError(vu);\n }\n if (!o.sign) {\n return 0;\n }\n const [u, l, f] = createMarkerSystem(n, t, s), d = createMarkerToEpochNano(f), m = createMoveMarker(f), p = createDiffMarkers(f), h = m(l, u, o);\n isZonedEpochSlots(s) || (Do(u), Do(h));\n const I = p(l, u, h, a);\n return isUniformUnit(a, s) ? totalDayTimeDuration(I, a) : ya(I, d(h), a, l, u, d, m);\n}\n\nfunction ya(e, n, t, o, r, i, a) {\n const s = computeDurationSign(e), [c, u] = clampRelativeDuration(o, dl(t, e), t, s, r, i, a), l = ja(n, c, u);\n return e[O[t]] + l * s;\n}\n\nfunction totalDayTimeDuration(e, n) {\n return La(durationFieldsToBigNano(e), Zu[n], 1);\n}\n\nfunction clampRelativeDuration(e, n, t, o, r, i, a) {\n const s = O[t], c = {\n ...n,\n [s]: n[s] + o\n }, u = a(e, r, n), l = a(e, r, c);\n return [ i(u), i(l) ];\n}\n\nfunction ja(e, n, t) {\n const o = La(va(n, t));\n if (!o) {\n throw new RangeError(du);\n }\n return La(va(n, e)) / o;\n}\n\nfunction Le(e, n) {\n const [t, o, r] = refineRoundingOptions(n, 5, 1);\n return xe(roundBigNano(e.epochNanoseconds, t, o, r, 1));\n}\n\nfunction Ie(e, n, t) {\n let {epochNanoseconds: o, timeZone: r, calendar: i} = n;\n const [a, s, c] = refineRoundingOptions(t);\n if (0 === a && 1 === s) {\n return n;\n }\n const u = e(r);\n if (6 === a) {\n o = uo(computeDayInterval, u, n, c);\n } else {\n const e = u.N(o);\n o = getMatchingInstantFor(u, roundDateTime(So(o, e), a, s, c), e, 2, 0, 1);\n }\n return Xe(o, r, i);\n}\n\nfunction bt(e, n) {\n return jt(roundDateTime(e, ...refineRoundingOptions(n)), e.calendar);\n}\n\nfunction lt(e, n) {\n const [t, o, r] = refineRoundingOptions(n, 5);\n var i;\n return St((i = r, roundTimeToNano(e, computeNanoInc(t, o), i)[0]));\n}\n\nfunction Te(e, n) {\n const t = e(n.timeZone), o = he(n, t), [r, i] = computeDayInterval(o), a = La(va(getStartOfDayInstantFor(t, r), getStartOfDayInstantFor(t, i)), no, 1);\n if (a <= 0) {\n throw new RangeError(du);\n }\n return a;\n}\n\nfunction be(e, n) {\n const {timeZone: t, calendar: o} = n;\n return Xe(lo(ho, e(t), n), t, o);\n}\n\nfunction lo(e, n, t) {\n return getStartOfDayInstantFor(n, e(he(t, n)));\n}\n\nfunction uo(e, n, t, o) {\n const r = he(t, n), [i, a] = e(r), s = t.epochNanoseconds, c = getStartOfDayInstantFor(n, i), u = getStartOfDayInstantFor(n, a);\n if (bigNanoOutside(s, c, u)) {\n throw new RangeError(du);\n }\n return Ea(ja(s, c, u), o) ? u : c;\n}\n\nfunction roundDateTime(e, n, t, o) {\n return roundDateTimeToNano(e, computeNanoInc(n, t), o);\n}\n\nfunction roundDateTimeToNano(e, n, t) {\n const [o, r] = roundTimeToNano(e, n, t);\n return Do({\n ...Ua(e, r),\n ...o\n });\n}\n\nfunction roundTimeToNano(e, n, t) {\n return nanoToIsoTimeAndDay(Da(isoTimeFieldsToNano(e), n, t));\n}\n\nfunction roundToMinute(e) {\n return Da(e, ao, 7);\n}\n\nfunction computeNanoInc(e, n) {\n return Zu[e] * n;\n}\n\nfunction computeDayInterval(e) {\n const n = ho(e);\n return [ n, Ua(n, 1) ];\n}\n\nfunction ho(e) {\n return Ra(6, e);\n}\n\nfunction roundDayTimeDurationByInc(e, n, t) {\n const o = Math.min(getMaxDurationUnit(e), 6);\n return nanoToDurationDayTimeFields(Ya(durationFieldsToBigNano(e, o), n, t), o);\n}\n\nfunction roundRelativeDuration(e, n, t, o, r, i, a, s, c, u) {\n if (0 === o && 1 === r) {\n return e;\n }\n const l = isUniformUnit(o, s) ? isZonedEpochSlots(s) && o < 6 && t >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;\n let [f, d, m] = l(e, n, t, o, r, i, a, s, c, u);\n return m && 7 !== o && (f = ((e, n, t, o, r, i, a, s) => {\n const c = computeDurationSign(e);\n for (let u = o + 1; u <= t; u++) {\n if (7 === u && 7 !== t) {\n continue;\n }\n const o = dl(u, e);\n o[O[u]] += c;\n const l = La(va(a(s(r, i, o)), n));\n if (l && Math.sign(l) !== c) {\n break;\n }\n e = o;\n }\n return e;\n })(f, d, t, Math.max(6, o), a, s, c, u)), f;\n}\n\nfunction roundBigNano(e, n, t, o, r) {\n return 6 === n ? [ Da(Oa(e), t, o), 0 ] : Ya(e, computeNanoInc(n, t), o, r);\n}\n\nfunction Ya(e, n, t, o) {\n let [r, i] = e;\n o && i < 0 && (i += go, r -= 1);\n const [a, s] = divModFloor(Da(i, n, t), go);\n return createBigNano(r + a, s);\n}\n\nfunction Da(e, n, t) {\n return Ea(e / n, t) * n;\n}\n\nfunction Ea(e, n) {\n return ef[n](e);\n}\n\nfunction nudgeDayTimeDuration(e, n, t, o, r, i) {\n const a = computeDurationSign(e), s = durationFieldsToBigNano(e), c = roundBigNano(s, o, r, i), u = va(s, c), l = Math.sign(c[0] - s[0]) === a, f = nanoToDurationDayTimeFields(c, Math.min(t, 6));\n return [ {\n ...e,\n ...f\n }, so(n, u), l ];\n}\n\nfunction nudgeZonedTimeDuration(e, n, t, o, r, i, a, s, c, u) {\n const l = computeDurationSign(e) || 1, f = La(durationFieldsToBigNano(e, 5)), d = computeNanoInc(o, r);\n let m = Da(f, d, i);\n const [p, h] = clampRelativeDuration(a, {\n ...e,\n ...fl\n }, 6, l, s, c, u), I = m - La(va(p, h));\n let D = 0;\n I && Math.sign(I) !== l ? n = Ta(p, m) : (D += l, m = Da(I, d, i), n = Ta(h, m));\n const g = nanoToDurationTimeFields(m);\n return [ {\n ...e,\n ...g,\n days: e.days + D\n }, n, Boolean(D) ];\n}\n\nfunction nudgeRelativeDuration(e, n, t, o, r, i, a, s, c, u) {\n const l = computeDurationSign(e), f = O[o], d = dl(o, e);\n 7 === o && (e = {\n ...e,\n weeks: e.weeks + Math.trunc(e.days / 7)\n });\n const m = divTrunc(e[f], r) * r;\n d[f] = m;\n const [p, h] = clampRelativeDuration(a, d, o, r * l, s, c, u), I = m + ja(n, p, h) * l * r, D = Da(I, r, i), g = Math.sign(D - I) === l;\n return d[f] = D, [ d, g ? h : p, g ];\n}\n\nfunction ke(e, n, t, o) {\n const [r, i, a, s] = (e => {\n const n = refineTimeDisplayTuple(e = normalizeOptions(e));\n return [ e.timeZone, ...n ];\n })(o), c = void 0 !== r;\n return ((e, n, t, o, r, i) => {\n t = Ya(t, r, o, 1);\n const a = n.N(t);\n return formatIsoDateTimeFields(So(t, a), i) + (e ? Se(roundToMinute(a)) : \"Z\");\n })(c, n(c ? e(r) : nf), t.epochNanoseconds, i, a, s);\n}\n\nfunction Fe(e, n, t) {\n const [o, r, i, a, s, c] = (e => {\n e = normalizeOptions(e);\n const n = Jl(e), t = refineSubsecDigits(e), o = Ql(e), r = Xl(e, 4), i = xl(e, 4);\n return [ n, Kl(e), o, r, ...refineSmallestUnitAndSubsecDigits(i, t) ];\n })(t);\n return ((e, n, t, o, r, i, a, s, c, u) => {\n o = Ya(o, c, s, 1);\n const l = e(t).N(o);\n return formatIsoDateTimeFields(So(o, l), u) + Se(roundToMinute(l), a) + ((e, n) => 1 !== n ? \"[\" + (2 === n ? \"!\" : \"\") + e + \"]\" : \"\")(t, i) + formatCalendar(n, r);\n })(e, n.calendar, n.timeZone, n.epochNanoseconds, o, r, i, a, s, c);\n}\n\nfunction Ft(e, n) {\n const [t, o, r, i] = (e => (e = normalizeOptions(e), [ Jl(e), ...refineTimeDisplayTuple(e) ]))(n);\n return a = e.calendar, s = t, c = i, formatIsoDateTimeFields(roundDateTimeToNano(e, r, o), c) + formatCalendar(a, s);\n var a, s, c;\n}\n\nfunction ce(e, n) {\n return t = e.calendar, o = e, r = refineDateDisplayOptions(n), formatIsoDateFields(o) + formatCalendar(t, r);\n var t, o, r;\n}\n\nfunction Ht(e, n) {\n return formatDateLikeIso(e.calendar, formatIsoYearMonthFields, e, refineDateDisplayOptions(n));\n}\n\nfunction Jt(e, n) {\n return formatDateLikeIso(e.calendar, formatIsoMonthDayFields, e, refineDateDisplayOptions(n));\n}\n\nfunction ct(e, n) {\n const [t, o, r] = refineTimeDisplayOptions(n);\n return i = r, formatIsoTimeFields(roundTimeToNano(e, o, t)[0], i);\n var i;\n}\n\nfunction k(e, n) {\n const [t, o, r] = refineTimeDisplayOptions(n, 3);\n return o > 1 && checkDurationUnits(e = {\n ...e,\n ...roundDayTimeDurationByInc(e, o, t)\n }), ((e, n) => {\n const {sign: t} = e, o = -1 === t ? negateDurationFields(e) : e, {hours: r, minutes: i} = o, [a, s] = divModBigNano(durationFieldsToBigNano(o, 3), oo, divModTrunc);\n checkDurationTimeUnit(a);\n const c = formatSubsecNano(s, n), u = n >= 0 || !t || c;\n return (t < 0 ? \"-\" : \"\") + \"P\" + formatDurationFragments({\n Y: formatDurationNumber(o.years),\n M: formatDurationNumber(o.months),\n W: formatDurationNumber(o.weeks),\n D: formatDurationNumber(o.days)\n }) + (r || i || a || u ? \"T\" + formatDurationFragments({\n H: formatDurationNumber(r),\n M: formatDurationNumber(i),\n S: formatDurationNumber(a, u) + c\n }) : \"\");\n })(e, r);\n}\n\nfunction formatDateLikeIso(e, n, t, o) {\n const r = o > 1 || 0 === o && e !== l;\n return 1 === o ? e === l ? n(t) : formatIsoDateFields(t) : r ? formatIsoDateFields(t) + formatCalendarId(e, 2 === o) : n(t);\n}\n\nfunction formatDurationFragments(e) {\n const n = [];\n for (const t in e) {\n const o = e[t];\n o && n.push(o, t);\n }\n return n.join(\"\");\n}\n\nfunction formatIsoDateTimeFields(e, n) {\n return formatIsoDateFields(e) + \"T\" + formatIsoTimeFields(e, n);\n}\n\nfunction formatIsoDateFields(e) {\n return formatIsoYearMonthFields(e) + \"-\" + wu(e.isoDay);\n}\n\nfunction formatIsoYearMonthFields(e) {\n const {isoYear: n} = e;\n return (n < 0 || n > 9999 ? getSignStr(n) + padNumber(6, Math.abs(n)) : padNumber(4, n)) + \"-\" + wu(e.isoMonth);\n}\n\nfunction formatIsoMonthDayFields(e) {\n return wu(e.isoMonth) + \"-\" + wu(e.isoDay);\n}\n\nfunction formatIsoTimeFields(e, n) {\n const t = [ wu(e.isoHour), wu(e.isoMinute) ];\n return -1 !== n && t.push(wu(e.isoSecond) + ((e, n, t, o) => formatSubsecNano(e * Ke + n * ro + t, o))(e.isoMillisecond, e.isoMicrosecond, e.isoNanosecond, n)), \n t.join(\":\");\n}\n\nfunction Se(e, n = 0) {\n if (1 === n) {\n return \"\";\n }\n const [t, o] = divModFloor(Math.abs(e), no), [r, i] = divModFloor(o, ao), [a, s] = divModFloor(i, oo);\n return getSignStr(e) + wu(t) + \":\" + wu(r) + (a || s ? \":\" + wu(a) + formatSubsecNano(s) : \"\");\n}\n\nfunction formatCalendar(e, n) {\n return 1 !== n && (n > 1 || 0 === n && e !== l) ? formatCalendarId(e, 2 === n) : \"\";\n}\n\nfunction formatCalendarId(e, n) {\n return \"[\" + (n ? \"!\" : \"\") + \"u-ca=\" + e + \"]\";\n}\n\nfunction formatSubsecNano(e, n) {\n let t = padNumber(9, e);\n return t = void 0 === n ? t.replace(af, \"\") : t.slice(0, n), t ? \".\" + t : \"\";\n}\n\nfunction getSignStr(e) {\n return e < 0 ? \"-\" : \"+\";\n}\n\nfunction formatDurationNumber(e, n) {\n return e || n ? e.toLocaleString(\"fullwide\", {\n useGrouping: 0\n }) : \"\";\n}\n\nfunction _zonedEpochSlotsToIso(e, n) {\n const {epochNanoseconds: t} = e, o = (n.N ? n : n(e.timeZone)).N(t), r = So(t, o);\n return {\n calendar: e.calendar,\n ...r,\n offsetNanoseconds: o\n };\n}\n\nfunction Ja(e, n) {\n const t = he(n, e);\n return {\n calendar: n.calendar,\n ...nn(Il, t),\n offset: Se(t.offsetNanoseconds),\n timeZone: n.timeZone\n };\n}\n\nfunction getMatchingInstantFor(e, n, t, o = 0, r = 0, i, a) {\n if (void 0 !== t && 1 === o && (1 === o || a)) {\n return isoToEpochNanoWithOffset(n, t);\n }\n const s = e.v(n);\n if (void 0 !== t && 3 !== o) {\n const e = ((e, n, t, o) => {\n const r = ma(n);\n o && (t = roundToMinute(t));\n for (const n of e) {\n let e = La(va(n, r));\n if (o && (e = roundToMinute(e)), e === t) {\n return n;\n }\n }\n })(s, n, t, i);\n if (void 0 !== e) {\n return e;\n }\n if (0 === o) {\n throw new RangeError(gu);\n }\n }\n return a ? ma(n) : $o(e, n, r, s);\n}\n\nfunction $o(e, n, t = 0, o = e.v(n)) {\n if (1 === o.length) {\n return o[0];\n }\n if (1 === t) {\n throw new RangeError(Tu);\n }\n if (o.length) {\n return o[3 === t ? 1 : 0];\n }\n const r = ma(n), i = ((e, n) => {\n const t = e.N(Ta(n, -go));\n return (e => {\n if (e > go) {\n throw new RangeError(Du);\n }\n return e;\n })(e.N(Ta(n, go)) - t);\n })(e, r), a = i * (2 === t ? -1 : 1);\n return (o = e.v(So(r, a)))[2 === t ? 0 : o.length - 1];\n}\n\nfunction getStartOfDayInstantFor(e, n) {\n const t = e.v(n);\n if (t.length) {\n return t[0];\n }\n const o = Ta(ma(n), -go);\n return e.l(o, 1);\n}\n\nfunction Ye(e, n, t) {\n return xe(io(so(n.epochNanoseconds, (e => {\n if (durationHasDateParts(e)) {\n throw new RangeError(Pu);\n }\n return durationFieldsToBigNano(e, 5);\n })(e ? negateDurationFields(t) : t))));\n}\n\nfunction Oe(e, n, t, o, r, i = Object.create(null)) {\n const a = n(o.timeZone), s = e(o.calendar);\n return {\n ...o,\n ...Fa(a, s, o, t ? negateDurationFields(r) : r, i)\n };\n}\n\nfunction wt(e, n, t, o, r = Object.create(null)) {\n const {calendar: i} = t;\n return jt(ka(e(i), t, n ? negateDurationFields(o) : o, r), i);\n}\n\nfunction ne(e, n, t, o, r) {\n const {calendar: i} = t;\n return W(moveDate(e(i), t, n ? negateDurationFields(o) : o, r), i);\n}\n\nfunction Gt(e, n, t, o, r) {\n const i = t.calendar, a = e(i);\n let s = To(Na(a, t));\n n && (o = B(o)), o.sign < 0 && (s = a.P(s, {\n ...ll,\n months: 1\n }), s = Ua(s, -1));\n const c = a.P(s, o, r);\n return createPlainYearMonthSlots(Na(a, c), i);\n}\n\nfunction at(e, n, t) {\n return St(moveTime(n, e ? negateDurationFields(t) : t)[0]);\n}\n\nfunction Fa(e, n, t, o, r) {\n const i = durationFieldsToBigNano(o, 5);\n let a = t.epochNanoseconds;\n if (durationHasDateParts(o)) {\n const s = he(t, e);\n a = so($o(e, {\n ...moveDate(n, s, {\n ...o,\n ...fl\n }, r),\n ...nn(w, s)\n }), i);\n } else {\n a = so(a, i), dt(r);\n }\n return {\n epochNanoseconds: io(a)\n };\n}\n\nfunction ka(e, n, t, o) {\n const [r, i] = moveTime(n, t);\n return Do({\n ...moveDate(e, n, {\n ...t,\n ...fl,\n days: t.days + i\n }, o),\n ...r\n });\n}\n\nfunction moveDate(e, n, t, o) {\n if (t.years || t.months || t.weeks) {\n return e.P(n, t, o);\n }\n dt(o);\n const r = t.days + durationFieldsToBigNano(t, 5)[0];\n return r ? To(Ua(n, r)) : n;\n}\n\nfunction Na(e, n, t = 1) {\n return Ua(n, t - e.day(n));\n}\n\nfunction moveTime(e, n) {\n const [t, o] = durationFieldsToBigNano(n, 5), [r, i] = nanoToIsoTimeAndDay(isoTimeFieldsToNano(e) + o);\n return [ r, t + i ];\n}\n\nfunction nativeDateAdd(e, n, t) {\n const o = dt(t);\n let r, {years: i, months: a, weeks: s, days: c} = n;\n if (c += durationFieldsToBigNano(n, 5)[0], i || a) {\n r = wa(this, e, i, a, o);\n } else {\n if (!s && !c) {\n return e;\n }\n r = isoToEpochMilli(e);\n }\n if (void 0 === r) {\n throw new RangeError(Mu);\n }\n return r += (7 * s + c) * Cu, To(Pa(r));\n}\n\nfunction wa(e, n, t, o, r) {\n let [i, a, s] = e.u(n);\n if (t) {\n const [n, o] = e.m(i, a);\n i += t, a = monthCodeNumberToMonth(n, o, e.F(i)), a = ba(\"month\", a, 1, e.O(i), r);\n }\n return o && ([i, a] = e.p(i, a, o)), s = ba(\"day\", s, 1, e.B(i, a), r), e.M(i, a, s);\n}\n\nfunction isoMonthAdd(e, n, t) {\n return e += divTrunc(t, Fl), (n += modTrunc(t, Fl)) < 1 ? (e--, n += Fl) : n > Fl && (e++, \n n -= Fl), [ e, n ];\n}\n\nfunction intlMonthAdd(e, n, t) {\n if (t) {\n if (n += t, !Number.isSafeInteger(n)) {\n throw new RangeError(Mu);\n }\n if (t < 0) {\n for (;n < 1; ) {\n n += computeIntlMonthsInYear.call(this, --e);\n }\n } else {\n let t;\n for (;n > (t = computeIntlMonthsInYear.call(this, e)); ) {\n n -= t, e++;\n }\n }\n }\n return [ e, n ];\n}\n\nfunction Ua(e, n) {\n return n ? {\n ...e,\n ...Pa(isoToEpochMilli(e) + n * Cu)\n } : e;\n}\n\nfunction createMarkerSystem(e, n, t) {\n const o = e(t.calendar);\n return isZonedEpochSlots(t) ? [ t, o, n(t.timeZone) ] : [ {\n ...t,\n ...At\n }, o ];\n}\n\nfunction createMarkerToEpochNano(e) {\n return e ? fa : ma;\n}\n\nfunction createMoveMarker(e) {\n return e ? gt(Fa, e) : ka;\n}\n\nfunction createDiffMarkers(e) {\n return e ? gt(diffZonedEpochsExact, e) : diffDateTimesExact;\n}\n\nfunction isZonedEpochSlots(e) {\n return e && e.epochNanoseconds;\n}\n\nfunction isUniformUnit(e, n) {\n return e <= 6 - (isZonedEpochSlots(n) ? 1 : 0);\n}\n\nfunction E(e, n, t, o, r, i, a) {\n const s = e(normalizeOptions(a).relativeTo), c = Math.max(getMaxDurationUnit(r), getMaxDurationUnit(i));\n if (isUniformUnit(c, s)) {\n return pe(checkDurationUnits(((e, n, t, o) => {\n const r = so(durationFieldsToBigNano(e), durationFieldsToBigNano(n), o ? -1 : 1);\n if (!Number.isFinite(r[0])) {\n throw new RangeError(Mu);\n }\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(r, t)\n };\n })(r, i, c, o)));\n }\n if (!s) {\n throw new RangeError(vu);\n }\n o && (i = negateDurationFields(i));\n const [u, l, f] = createMarkerSystem(n, t, s), d = createMoveMarker(f), m = createDiffMarkers(f), p = d(l, u, r);\n return pe(m(l, u, d(l, p, i), c));\n}\n\nfunction V(e, n, t, o, r) {\n const i = getMaxDurationUnit(o), [a, s, c, u, l] = ((e, n, t) => {\n e = normalizeOptionsOrString(e, bl);\n let o = $l(e);\n const r = t(e[Cl]);\n let i = parseRoundingIncInteger(e);\n const a = Xl(e, 7);\n let s = xl(e);\n if (void 0 === o && void 0 === s) {\n throw new RangeError(Fu);\n }\n if (null == s && (s = 0), null == o && (o = Math.max(s, n)), checkLargestSmallestUnit(o, s), \n i = refineRoundingInc(i, s, 1), i > 1 && s > 5 && o !== s) {\n throw new RangeError(\"For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit\");\n }\n return [ o, s, i, a, r ];\n })(r, i, e), f = Math.max(i, a);\n if (!l && f <= 6) {\n return pe(checkDurationUnits(((e, n, t, o, r) => {\n const i = roundBigNano(durationFieldsToBigNano(e), t, o, r);\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(i, n)\n };\n })(o, a, s, c, u)));\n }\n if (!isZonedEpochSlots(l) && !o.sign) {\n return o;\n }\n if (!l) {\n throw new RangeError(vu);\n }\n const [d, m, p] = createMarkerSystem(n, t, l), h = createMarkerToEpochNano(p), I = createMoveMarker(p), D = createDiffMarkers(p), g = I(m, d, o);\n isZonedEpochSlots(l) || (Do(d), Do(g));\n let T = D(m, d, g, a);\n const M = o.sign, y = computeDurationSign(T);\n if (M && y && M !== y) {\n throw new RangeError(du);\n }\n return T = roundRelativeDuration(T, h(g), a, s, c, u, m, d, h, I), pe(T);\n}\n\nfunction Y(e) {\n return -1 === e.sign ? B(e) : e;\n}\n\nfunction B(e) {\n return pe(negateDurationFields(e));\n}\n\nfunction negateDurationFields(e) {\n const n = {};\n for (const t of O) {\n n[t] = -1 * e[t] || 0;\n }\n return n;\n}\n\nfunction y(e) {\n return !e.sign;\n}\n\nfunction computeDurationSign(e, n = O) {\n let t = 0;\n for (const o of n) {\n const n = Math.sign(e[o]);\n if (n) {\n if (t && t !== n) {\n throw new RangeError(Nu);\n }\n t = n;\n }\n }\n return t;\n}\n\nfunction checkDurationUnits(e) {\n for (const n of cl) {\n ba(n, e[n], -sf, sf, 1);\n }\n return checkDurationTimeUnit(La(durationFieldsToBigNano(e), oo)), e;\n}\n\nfunction checkDurationTimeUnit(e) {\n if (!Number.isSafeInteger(e)) {\n throw new RangeError(yu);\n }\n}\n\nfunction durationFieldsToBigNano(e, n = 6) {\n return givenFieldsToBigNano(e, n, O);\n}\n\nfunction nanoToDurationDayTimeFields(e, n = 6) {\n const [t, o] = e, r = nanoToGivenFields(o, n, O);\n if (r[O[n]] += t * (go / Zu[n]), !Number.isFinite(r[O[n]])) {\n throw new RangeError(Mu);\n }\n return r;\n}\n\nfunction nanoToDurationTimeFields(e, n = 5) {\n return nanoToGivenFields(e, n, O);\n}\n\nfunction durationHasDateParts(e) {\n return Boolean(computeDurationSign(e, sl));\n}\n\nfunction getMaxDurationUnit(e) {\n let n = 9;\n for (;n > 0 && !e[O[n]]; n--) {}\n return n;\n}\n\nfunction createSplitTuple(e, n) {\n return [ e, n ];\n}\n\nfunction computePeriod(e) {\n const n = Math.floor(e / tf) * tf;\n return [ n, n + tf ];\n}\n\nfunction We(e) {\n const n = parseDateTimeLike(e = toStringViaPrimitive(e));\n if (!n) {\n throw new RangeError(failedParse(e));\n }\n let t;\n if (n.C) {\n t = 0;\n } else {\n if (!n.offset) {\n throw new RangeError(failedParse(e));\n }\n t = parseOffsetNano(n.offset);\n }\n return n.timeZone && parseOffsetNanoMaybe(n.timeZone, 1), xe(isoToEpochNanoWithOffset(checkIsoDateTimeFields(n), t));\n}\n\nfunction $(e) {\n const n = parseDateTimeLike(d(e));\n if (!n) {\n throw new RangeError(failedParse(e));\n }\n if (n.timeZone) {\n return finalizeZonedDateTime(n, n.offset ? parseOffsetNano(n.offset) : void 0);\n }\n if (n.C) {\n throw new RangeError(failedParse(e));\n }\n return finalizeDate(n);\n}\n\nfunction Ne(e, n) {\n const t = parseDateTimeLike(d(e));\n if (!t || !t.timeZone) {\n throw new RangeError(failedParse(e));\n }\n const {offset: o} = t, r = o ? parseOffsetNano(o) : void 0, [, i, a] = je(n);\n return finalizeZonedDateTime(t, r, i, a);\n}\n\nfunction parseOffsetNano(e) {\n const n = parseOffsetNanoMaybe(e);\n if (void 0 === n) {\n throw new RangeError(failedParse(e));\n }\n return n;\n}\n\nfunction Bt(e) {\n const n = parseDateTimeLike(d(e));\n if (!n || n.C) {\n throw new RangeError(failedParse(e));\n }\n return jt(finalizeDateTime(n));\n}\n\nfunction me(e, n, t) {\n let o = parseDateTimeLike(d(e));\n if (!o || o.C) {\n throw new RangeError(failedParse(e));\n }\n return n ? o.calendar === l && (o = -271821 === o.isoYear && 4 === o.isoMonth ? {\n ...o,\n isoDay: 20,\n ...At\n } : {\n ...o,\n isoDay: 1,\n ...At\n }) : t && o.calendar === l && (o = {\n ...o,\n isoYear: Pl\n }), W(o.k ? finalizeDateTime(o) : finalizeDate(o));\n}\n\nfunction Xt(e, n) {\n const t = parseYearMonthOnly(d(n));\n if (t) {\n return requireIsoCalendar(t), createPlainYearMonthSlots(checkIsoYearMonthInBounds(checkIsoDateFields(t)));\n }\n const o = me(n, 1);\n return createPlainYearMonthSlots(Na(e(o.calendar), o));\n}\n\nfunction requireIsoCalendar(e) {\n if (e.calendar !== l) {\n throw new RangeError(invalidSubstring(e.calendar));\n }\n}\n\nfunction xt(e, n) {\n const t = parseMonthDayOnly(d(n));\n if (t) {\n return requireIsoCalendar(t), createPlainMonthDaySlots(checkIsoDateFields(t));\n }\n const o = me(n, 0, 1), {calendar: r} = o, i = e(r), [a, s, c] = i.u(o), [u, l] = i.m(a, s), [f, m] = i.R(u, l, c);\n return createPlainMonthDaySlots(To(i.U(f, m, c)), r);\n}\n\nfunction ht(e) {\n let n, t = (e => {\n const n = Tf.exec(e);\n return n ? (organizeAnnotationParts(n[10]), organizeTimeParts(n)) : void 0;\n })(d(e));\n if (!t) {\n if (t = parseDateTimeLike(e), !t) {\n throw new RangeError(failedParse(e));\n }\n if (!t.k) {\n throw new RangeError(failedParse(e));\n }\n if (t.C) {\n throw new RangeError(invalidSubstring(\"Z\"));\n }\n requireIsoCalendar(t);\n }\n if ((n = parseYearMonthOnly(e)) && isIsoDateFieldsValid(n)) {\n throw new RangeError(failedParse(e));\n }\n if ((n = parseMonthDayOnly(e)) && isIsoDateFieldsValid(n)) {\n throw new RangeError(failedParse(e));\n }\n return St(constrainIsoTimeFields(t, 1));\n}\n\nfunction R(e) {\n const n = (e => {\n const n = Nf.exec(e);\n return n ? (e => {\n function parseUnit(e, r, i) {\n let a = 0, s = 0;\n if (i && ([a, o] = divModFloor(o, Zu[i])), void 0 !== e) {\n if (t) {\n throw new RangeError(invalidSubstring(e));\n }\n s = (e => {\n const n = parseInt(e);\n if (!Number.isFinite(n)) {\n throw new RangeError(invalidSubstring(e));\n }\n return n;\n })(e), n = 1, r && (o = parseSubsecNano(r) * (Zu[i] / oo), t = 1);\n }\n return a + s;\n }\n let n = 0, t = 0, o = 0, r = {\n ...zipProps(O, [ parseUnit(e[2]), parseUnit(e[3]), parseUnit(e[4]), parseUnit(e[5]), parseUnit(e[6], e[7], 5), parseUnit(e[8], e[9], 4), parseUnit(e[10], e[11], 3) ]),\n ...nanoToGivenFields(o, 2, O)\n };\n if (!n) {\n throw new RangeError(noValidFields(O));\n }\n return parseSign(e[1]) < 0 && (r = negateDurationFields(r)), r;\n })(n) : void 0;\n })(d(e));\n if (!n) {\n throw new RangeError(failedParse(e));\n }\n return pe(checkDurationUnits(n));\n}\n\nfunction f(e) {\n const n = parseDateTimeLike(e) || parseYearMonthOnly(e) || parseMonthDayOnly(e);\n return n ? n.calendar : e;\n}\n\nfunction M(e) {\n const n = parseDateTimeLike(e);\n return n && (n.timeZone || n.C && nf || n.offset) || e;\n}\n\nfunction finalizeZonedDateTime(e, n, t = 0, o = 0) {\n const r = Z(e.timeZone), i = L(r);\n let a;\n return checkIsoDateTimeFields(e), a = e.k ? getMatchingInstantFor(i, e, n, t, o, !i.j, e.C) : getStartOfDayInstantFor(i, e), \n Xe(a, r, u(e.calendar));\n}\n\nfunction finalizeDateTime(e) {\n return resolveSlotsCalendar(Do(checkIsoDateTimeFields(e)));\n}\n\nfunction finalizeDate(e) {\n return resolveSlotsCalendar(To(checkIsoDateFields(e)));\n}\n\nfunction resolveSlotsCalendar(e) {\n return {\n ...e,\n calendar: u(e.calendar)\n };\n}\n\nfunction parseDateTimeLike(e) {\n const n = gf.exec(e);\n return n ? (e => {\n const n = e[10], t = \"Z\" === (n || \"\").toUpperCase();\n return {\n isoYear: organizeIsoYearParts(e),\n isoMonth: parseInt(e[4]),\n isoDay: parseInt(e[5]),\n ...organizeTimeParts(e.slice(5)),\n ...organizeAnnotationParts(e[16]),\n k: Boolean(e[6]),\n C: t,\n offset: t ? void 0 : n\n };\n })(n) : void 0;\n}\n\nfunction parseYearMonthOnly(e) {\n const n = If.exec(e);\n return n ? (e => ({\n isoYear: organizeIsoYearParts(e),\n isoMonth: parseInt(e[4]),\n isoDay: 1,\n ...organizeAnnotationParts(e[5])\n }))(n) : void 0;\n}\n\nfunction parseMonthDayOnly(e) {\n const n = Df.exec(e);\n return n ? (e => ({\n isoYear: Pl,\n isoMonth: parseInt(e[1]),\n isoDay: parseInt(e[2]),\n ...organizeAnnotationParts(e[3])\n }))(n) : void 0;\n}\n\nfunction parseOffsetNanoMaybe(e, n) {\n const t = Mf.exec(e);\n return t ? ((e, n) => {\n const t = e[4] || e[5];\n if (n && t) {\n throw new RangeError(invalidSubstring(t));\n }\n return (e => {\n if (Math.abs(e) >= go) {\n throw new RangeError(Iu);\n }\n return e;\n })((parseInt0(e[2]) * no + parseInt0(e[3]) * ao + parseInt0(e[4]) * oo + parseSubsecNano(e[5] || \"\")) * parseSign(e[1]));\n })(t, n) : void 0;\n}\n\nfunction organizeIsoYearParts(e) {\n const n = parseSign(e[1]), t = parseInt(e[2] || e[3]);\n if (n < 0 && !t) {\n throw new RangeError(invalidSubstring(-0));\n }\n return n * t;\n}\n\nfunction organizeTimeParts(e) {\n const n = parseInt0(e[3]);\n return {\n ...nanoToIsoTimeAndDay(parseSubsecNano(e[4] || \"\"))[0],\n isoHour: parseInt0(e[1]),\n isoMinute: parseInt0(e[2]),\n isoSecond: 60 === n ? 59 : n\n };\n}\n\nfunction organizeAnnotationParts(e) {\n let n, t;\n const o = [];\n if (e.replace(yf, ((e, r, i) => {\n const a = Boolean(r), [s, c] = i.split(\"=\").reverse();\n if (c) {\n if (\"u-ca\" === c) {\n o.push(s), n || (n = a);\n } else if (a || /[A-Z]/.test(c)) {\n throw new RangeError(invalidSubstring(e));\n }\n } else {\n if (t) {\n throw new RangeError(invalidSubstring(e));\n }\n t = s;\n }\n return \"\";\n })), o.length > 1 && n) {\n throw new RangeError(invalidSubstring(e));\n }\n return {\n timeZone: t,\n calendar: o[0] || l\n };\n}\n\nfunction parseSubsecNano(e) {\n return parseInt(e.padEnd(9, \"0\"));\n}\n\nfunction createRegExp(e) {\n return new RegExp(`^${e}$`, \"i\");\n}\n\nfunction parseSign(e) {\n return e && \"+\" !== e ? -1 : 1;\n}\n\nfunction parseInt0(e) {\n return void 0 === e ? 0 : parseInt(e);\n}\n\nfunction Me(e) {\n return Z(d(e));\n}\n\nfunction Z(e) {\n const n = getTimeZoneEssence(e);\n return \"number\" == typeof n ? Se(n) : n ? (e => {\n if (Ff.test(e)) {\n throw new RangeError(F(e));\n }\n if (Pf.test(e)) {\n throw new RangeError(hu);\n }\n return e.toLowerCase().split(\"/\").map(((e, n) => (e.length <= 3 || /\\d/.test(e)) && !/etc|yap/.test(e) ? e.toUpperCase() : e.replace(/baja|dumont|[a-z]+/g, ((e, t) => e.length <= 2 && !n || \"in\" === e || \"chat\" === e ? e.toUpperCase() : e.length > 2 || !t ? capitalize(e).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : e)))).join(\"/\");\n })(e) : nf;\n}\n\nfunction getTimeZoneAtomic(e) {\n const n = getTimeZoneEssence(e);\n return \"number\" == typeof n ? n : n ? n.resolvedOptions().timeZone : nf;\n}\n\nfunction getTimeZoneEssence(e) {\n const n = parseOffsetNanoMaybe(e = e.toUpperCase(), 1);\n return void 0 !== n ? n : e !== nf ? vf(e) : void 0;\n}\n\nfunction He(e, n) {\n return pa(e.epochNanoseconds, n.epochNanoseconds);\n}\n\nfunction Be(e, n) {\n return pa(e.epochNanoseconds, n.epochNanoseconds);\n}\n\nfunction H(e, n, t, o, r, i) {\n const a = e(normalizeOptions(i).relativeTo), s = Math.max(getMaxDurationUnit(o), getMaxDurationUnit(r));\n if (allPropsEqual(O, o, r)) {\n return 0;\n }\n if (isUniformUnit(s, a)) {\n return pa(durationFieldsToBigNano(o), durationFieldsToBigNano(r));\n }\n if (!a) {\n throw new RangeError(vu);\n }\n const [c, u, l] = createMarkerSystem(n, t, a), f = createMarkerToEpochNano(l), d = createMoveMarker(l);\n return pa(f(d(u, c, o)), f(d(u, c, r)));\n}\n\nfunction Yt(e, n) {\n return te(e, n) || Dt(e, n);\n}\n\nfunction te(e, n) {\n return compareNumbers(isoToEpochMilli(e), isoToEpochMilli(n));\n}\n\nfunction Dt(e, n) {\n return compareNumbers(isoTimeFieldsToNano(e), isoTimeFieldsToNano(n));\n}\n\nfunction Ve(e, n) {\n return !He(e, n);\n}\n\nfunction ve(e, n) {\n return !Be(e, n) && !!isTimeZoneIdsEqual(e.timeZone, n.timeZone) && e.calendar === n.calendar;\n}\n\nfunction vt(e, n) {\n return !Yt(e, n) && e.calendar === n.calendar;\n}\n\nfunction re(e, n) {\n return !te(e, n) && e.calendar === n.calendar;\n}\n\nfunction zt(e, n) {\n return !te(e, n) && e.calendar === n.calendar;\n}\n\nfunction Lt(e, n) {\n return !te(e, n) && e.calendar === n.calendar;\n}\n\nfunction st(e, n) {\n return !Dt(e, n);\n}\n\nfunction isTimeZoneIdsEqual(e, n) {\n if (e === n) {\n return 1;\n }\n try {\n return getTimeZoneAtomic(e) === getTimeZoneAtomic(n);\n } catch (e) {}\n}\n\nfunction Ee(e, n, t, o) {\n const r = refineDiffOptions(e, o, 3, 5), i = diffEpochNanos(n.epochNanoseconds, t.epochNanoseconds, ...r);\n return pe(e ? negateDurationFields(i) : i);\n}\n\nfunction we(e, n, t, o, r, i) {\n const a = ha(o.calendar, r.calendar), [s, c, u, l] = refineDiffOptions(t, i, 5), f = o.epochNanoseconds, d = r.epochNanoseconds, m = pa(d, f);\n let p;\n if (m) {\n if (s < 6) {\n p = diffEpochNanos(f, d, s, c, u, l);\n } else {\n const t = n(ga(o.timeZone, r.timeZone)), f = e(a);\n p = diffZonedEpochsBig(f, t, o, r, m, s, i), p = roundRelativeDuration(p, d, s, c, u, l, f, o, fa, gt(Fa, t));\n }\n } else {\n p = ll;\n }\n return pe(t ? negateDurationFields(p) : p);\n}\n\nfunction It(e, n, t, o, r) {\n const i = ha(t.calendar, o.calendar), [a, s, c, u] = refineDiffOptions(n, r, 6), l = ma(t), f = ma(o), d = pa(f, l);\n let m;\n if (d) {\n if (a <= 6) {\n m = diffEpochNanos(l, f, a, s, c, u);\n } else {\n const n = e(i);\n m = diffDateTimesBig(n, t, o, d, a, r), m = roundRelativeDuration(m, f, a, s, c, u, n, t, ma, ka);\n }\n } else {\n m = ll;\n }\n return pe(n ? negateDurationFields(m) : m);\n}\n\nfunction oe(e, n, t, o, r) {\n const i = ha(t.calendar, o.calendar);\n return diffDateLike(n, (() => e(i)), t, o, ...refineDiffOptions(n, r, 6, 9, 6));\n}\n\nfunction _t(e, n, t, o, r) {\n const i = ha(t.calendar, o.calendar), a = refineDiffOptions(n, r, 9, 9, 8), s = e(i), c = Na(s, t), u = Na(s, o);\n return c.isoYear === u.isoYear && c.isoMonth === u.isoMonth && c.isoDay === u.isoDay ? pe(ll) : diffDateLike(n, (() => s), To(c), To(u), ...a, 8);\n}\n\nfunction diffDateLike(e, n, t, o, r, i, a, s, c = 6) {\n const u = ma(t), l = ma(o);\n if (void 0 === u || void 0 === l) {\n throw new RangeError(Mu);\n }\n let f;\n if (pa(l, u)) {\n if (6 === r) {\n f = diffEpochNanos(u, l, r, i, a, s);\n } else {\n const e = n();\n f = e.h(t, o, r), i === c && 1 === a || (f = roundRelativeDuration(f, l, r, i, a, s, e, t, ma, moveDate));\n }\n } else {\n f = ll;\n }\n return pe(e ? negateDurationFields(f) : f);\n}\n\nfunction it(e, n, t, o) {\n const [r, i, a, s] = refineDiffOptions(e, o, 5, 5), c = Da(diffTimes(n, t), computeNanoInc(i, a), s), u = {\n ...ll,\n ...nanoToDurationTimeFields(c, r)\n };\n return pe(e ? negateDurationFields(u) : u);\n}\n\nfunction diffZonedEpochsExact(e, n, t, o, r, i) {\n const a = pa(o.epochNanoseconds, t.epochNanoseconds);\n return a ? r < 6 ? diffEpochNanosExact(t.epochNanoseconds, o.epochNanoseconds, r) : diffZonedEpochsBig(n, e, t, o, a, r, i) : ll;\n}\n\nfunction diffDateTimesExact(e, n, t, o, r) {\n const i = ma(n), a = ma(t), s = pa(a, i);\n return s ? o <= 6 ? diffEpochNanosExact(i, a, o) : diffDateTimesBig(e, n, t, s, o, r) : ll;\n}\n\nfunction diffZonedEpochsBig(e, n, t, o, r, i, a) {\n const [s, c, u] = Sa(n, t, o, r);\n var l, f;\n return {\n ...6 === i ? (l = s, f = c, {\n ...ll,\n days: td(l, f)\n }) : e.h(s, c, i, a),\n ...nanoToDurationTimeFields(u)\n };\n}\n\nfunction diffDateTimesBig(e, n, t, o, r, i) {\n const [a, s, c] = ((e, n, t) => {\n let o = n, r = diffTimes(e, n);\n return Math.sign(r) === -t && (o = Ua(n, -t), r += go * t), [ e, o, r ];\n })(n, t, o);\n return {\n ...e.h(a, s, r, i),\n ...nanoToDurationTimeFields(c)\n };\n}\n\nfunction Sa(e, n, t, o) {\n function updateMid() {\n return l = {\n ...Ua(a, c++ * -o),\n ...i\n }, f = $o(e, l), pa(s, f) === -o;\n }\n const r = he(n, e), i = nn(w, r), a = he(t, e), s = t.epochNanoseconds;\n let c = 0;\n const u = diffTimes(r, a);\n let l, f;\n if (Math.sign(u) === -o && c++, updateMid() && (-1 === o || updateMid())) {\n throw new RangeError(du);\n }\n const d = La(va(f, s));\n return [ r, l, d ];\n}\n\nfunction diffEpochNanos(e, n, t, o, r, i) {\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(roundBigNano(va(e, n), o, r, i), t)\n };\n}\n\nfunction diffEpochNanosExact(e, n, t) {\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(va(e, n), t)\n };\n}\n\nfunction td(e, n) {\n return diffEpochMilliByDay(isoToEpochMilli(e), isoToEpochMilli(n));\n}\n\nfunction diffEpochMilliByDay(e, n) {\n return Math.trunc((n - e) / Cu);\n}\n\nfunction diffTimes(e, n) {\n return isoTimeFieldsToNano(n) - isoTimeFieldsToNano(e);\n}\n\nfunction nativeDateUntil(e, n, t) {\n if (t <= 7) {\n let o = 0, r = td({\n ...e,\n ...At\n }, {\n ...n,\n ...At\n });\n return 7 === t && ([o, r] = divModTrunc(r, 7)), {\n ...ll,\n weeks: o,\n days: r\n };\n }\n const o = this.u(e), r = this.u(n);\n let [i, a, s] = ((e, n, t, o, r, i, a) => {\n let s = r - n, c = i - t, u = a - o;\n if (s || c) {\n const l = Math.sign(s || c);\n let f = e.B(r, i), d = 0;\n if (Math.sign(u) === -l) {\n const o = f;\n [r, i] = e.p(r, i, -l), s = r - n, c = i - t, f = e.B(r, i), d = l < 0 ? -o : f;\n }\n if (u = a - Math.min(o, f) + d, s) {\n const [o, a] = e.m(n, t), [u, f] = e.m(r, i);\n if (c = u - o || Number(f) - Number(a), Math.sign(c) === -l) {\n const t = l < 0 && -e.O(r);\n s = (r -= l) - n, c = i - monthCodeNumberToMonth(o, a, e.F(r)) + (t || e.O(r));\n }\n }\n }\n return [ s, c, u ];\n })(this, ...o, ...r);\n return 8 === t && (a += this.q(i, o[0]), i = 0), {\n ...ll,\n years: i,\n months: a,\n days: s\n };\n}\n\nfunction computeIsoMonthsInYearSpan(e) {\n return e * Fl;\n}\n\nfunction computeIntlMonthsInYearSpan(e, n) {\n const t = n + e, o = Math.sign(e), r = o < 0 ? -1 : 0;\n let i = 0;\n for (let e = n; e !== t; e += o) {\n i += computeIntlMonthsInYear.call(this, e + r);\n }\n return i;\n}\n\nfunction ha(e, n) {\n if (e !== n) {\n throw new RangeError(mu);\n }\n return e;\n}\n\nfunction ga(e, n) {\n if (!isTimeZoneIdsEqual(e, n)) {\n throw new RangeError(pu);\n }\n return e;\n}\n\nfunction computeNativeWeekOfYear(e) {\n return this.I(e)[0];\n}\n\nfunction computeNativeYearOfWeek(e) {\n return this.I(e)[1];\n}\n\nfunction computeNativeInLeapYear(e) {\n const [n] = this.u(e);\n return this.L(n);\n}\n\nfunction computeNativeMonthsInYear(e) {\n const [n] = this.u(e);\n return this.O(n);\n}\n\nfunction computeNativeDaysInMonth(e) {\n const [n, t] = this.u(e);\n return this.B(n, t);\n}\n\nfunction computeNativeDaysInYear(e) {\n const [n] = this.u(e);\n return this.G(n);\n}\n\nfunction computeNativeDayOfYear(e) {\n const [n] = this.u(e);\n return diffEpochMilliByDay(this.M(n), isoToEpochMilli(e)) + 1;\n}\n\nfunction parseMonthCode(e) {\n const n = Ef.exec(e);\n if (!n) {\n throw new RangeError(invalidMonthCode(e));\n }\n return [ parseInt(n[1]), Boolean(n[2]) ];\n}\n\nfunction sa(e, n) {\n return \"M\" + wu(e) + (n ? \"L\" : \"\");\n}\n\nfunction monthCodeNumberToMonth(e, n, t) {\n return e + (n || t && e >= t ? 1 : 0);\n}\n\nfunction monthToMonthCodeNumber(e, n) {\n return e - (n && e >= n ? 1 : 0);\n}\n\nfunction eraYearToYear(e, n) {\n return (n + e) * (Math.sign(n) || 1) || 0;\n}\n\nfunction getCalendarEraOrigins(e) {\n return nl[getCalendarIdBase(e)];\n}\n\nfunction getCalendarLeapMonthMeta(e) {\n return ol[getCalendarIdBase(e)];\n}\n\nfunction getCalendarIdBase(e) {\n return computeCalendarIdBase(e.id || l);\n}\n\nfunction createIntlCalendar(e) {\n function epochMilliToIntlFields(e) {\n return ((e, n) => ({\n ...parseIntlYear(e, n),\n V: e.month,\n day: parseInt(e.day)\n }))(hashIntlFormatParts(n, e), t);\n }\n const n = bf(e), t = computeCalendarIdBase(e);\n return {\n id: e,\n _: createIntlFieldCache(epochMilliToIntlFields),\n J: createIntlYearDataCache(epochMilliToIntlFields)\n };\n}\n\nfunction createIntlFieldCache(e) {\n return on((n => {\n const t = isoToEpochMilli(n);\n return e(t);\n }), WeakMap);\n}\n\nfunction createIntlYearDataCache(e) {\n const n = e(0).year - vl;\n return on((t => {\n let o, r = isoArgsToEpochMilli(t - n), i = 0;\n const a = [], s = [];\n do {\n r += 400 * Cu;\n } while ((o = e(r)).year <= t);\n do {\n if (r += (1 - o.day) * Cu, o.year === t && (a.push(r), s.push(o.V)), r -= Cu, ++i > 100 || r < -gl) {\n throw new RangeError(du);\n }\n } while ((o = e(r)).year >= t);\n return {\n K: a.reverse(),\n X: bu(s.reverse())\n };\n }));\n}\n\nfunction parseIntlYear(e, n) {\n let t, o, r = parseIntlPartsYear(e);\n if (e.era) {\n const i = nl[n], a = tl[n] || {};\n void 0 !== i && (t = \"islamic\" === n ? \"ah\" : e.era.normalize(\"NFD\").toLowerCase().replace(/[^a-z0-9]/g, \"\"), \n \"bc\" === t || \"b\" === t ? t = \"bce\" : \"ad\" === t || \"a\" === t ? t = \"ce\" : \"beforeroc\" === t && (t = \"broc\"), \n t = a[t] || t, o = r, r = eraYearToYear(o, i[t] || 0));\n }\n return {\n era: t,\n eraYear: o,\n year: r\n };\n}\n\nfunction parseIntlPartsYear(e) {\n return parseInt(e.relatedYear || e.year);\n}\n\nfunction computeIntlDay(e) {\n return this._(e).day;\n}\n\nfunction computeIntlDateParts(e) {\n const {year: n, V: t, day: o} = this._(e), {X: r} = this.J(n);\n return [ n, r[t] + 1, o ];\n}\n\nfunction computeIsoFieldsFromIntlParts(e, n, t) {\n return Pa(computeIntlEpochMilli.call(this, e, n, t));\n}\n\nfunction computeIntlEpochMilli(e, n = 1, t = 1) {\n return this.J(e).K[n - 1] + (t - 1) * Cu;\n}\n\nfunction computeIntlMonthCodeParts(e, n) {\n const t = computeIntlLeapMonth.call(this, e);\n return [ monthToMonthCodeNumber(n, t), t === n ];\n}\n\nfunction computeIntlLeapMonth(e) {\n const n = queryMonthStrings(this, e), t = queryMonthStrings(this, e - 1), o = n.length;\n if (o > t.length) {\n const e = getCalendarLeapMonthMeta(this);\n if (e < 0) {\n return -e;\n }\n for (let e = 0; e < o; e++) {\n if (n[e] !== t[e]) {\n return e + 1;\n }\n }\n }\n}\n\nfunction computeIntlInLeapYear(e) {\n const n = computeIntlDaysInYear.call(this, e);\n return n > computeIntlDaysInYear.call(this, e - 1) && n > computeIntlDaysInYear.call(this, e + 1);\n}\n\nfunction computeIntlDaysInYear(e) {\n return diffEpochMilliByDay(computeIntlEpochMilli.call(this, e), computeIntlEpochMilli.call(this, e + 1));\n}\n\nfunction computeIntlDaysInMonth(e, n) {\n const {K: t} = this.J(e);\n let o = n + 1, r = t;\n return o > t.length && (o = 1, r = this.J(e + 1).K), diffEpochMilliByDay(t[n - 1], r[o - 1]);\n}\n\nfunction computeIntlMonthsInYear(e) {\n return this.J(e).K.length;\n}\n\nfunction computeIntlEraParts(e) {\n const n = this._(e);\n return [ n.era, n.eraYear ];\n}\n\nfunction computeIntlYearMonthForMonthDay(e, n, t) {\n const o = this.id && \"chinese\" === computeCalendarIdBase(this.id) ? ((e, n, t) => {\n if (n) {\n switch (e) {\n case 1:\n return 1651;\n\n case 2:\n return t < 30 ? 1947 : 1765;\n\n case 3:\n return t < 30 ? 1966 : 1955;\n\n case 4:\n return t < 30 ? 1963 : 1944;\n\n case 5:\n return t < 30 ? 1971 : 1952;\n\n case 6:\n return t < 30 ? 1960 : 1941;\n\n case 7:\n return t < 30 ? 1968 : 1938;\n\n case 8:\n return t < 30 ? 1957 : 1718;\n\n case 9:\n return 1832;\n\n case 10:\n return 1870;\n\n case 11:\n return 1814;\n\n case 12:\n return 1890;\n }\n }\n return 1972;\n })(e, n, t) : Pl;\n let [r, i, a] = computeIntlDateParts.call(this, {\n isoYear: o,\n isoMonth: Fl,\n isoDay: 31\n });\n const s = computeIntlLeapMonth.call(this, r), c = i === s;\n 1 === (compareNumbers(e, monthToMonthCodeNumber(i, s)) || compareNumbers(Number(n), Number(c)) || compareNumbers(t, a)) && r--;\n for (let o = 0; o < 100; o++) {\n const i = r - o, a = computeIntlLeapMonth.call(this, i), s = monthCodeNumberToMonth(e, n, a);\n if (n === (s === a) && t <= computeIntlDaysInMonth.call(this, i, s)) {\n return [ i, s ];\n }\n }\n}\n\nfunction queryMonthStrings(e, n) {\n return Object.keys(e.J(n).X);\n}\n\nfunction Zt(e) {\n return u(d(e));\n}\n\nfunction u(e) {\n if ((e = e.toLowerCase()) !== l && e !== Xu) {\n const n = bf(e).resolvedOptions().calendar;\n if (computeCalendarIdBase(e) !== computeCalendarIdBase(n)) {\n throw new RangeError(c(e));\n }\n return n;\n }\n return e;\n}\n\nfunction computeCalendarIdBase(e) {\n return \"islamicc\" === e && (e = \"islamic\"), e.split(\"-\")[0];\n}\n\nfunction createNativeOpsCreator(e, n) {\n return t => t === l ? e : t === Xu || t === el ? Object.assign(Object.create(e), {\n id: t\n }) : Object.assign(Object.create(n), Of(t));\n}\n\nfunction z(e, n, t, o) {\n const r = refineCalendarFields(t, o, _u, [], ju);\n if (void 0 !== r.timeZone) {\n const o = t.ee(r), i = refineTimeBag(r), a = e(r.timeZone);\n return {\n epochNanoseconds: getMatchingInstantFor(n(a), {\n ...o,\n ...i\n }, void 0 !== r.offset ? parseOffsetNano(r.offset) : void 0),\n timeZone: a\n };\n }\n return {\n ...t.ee(r),\n ...At\n };\n}\n\nfunction Ae(e, n, t, o, r, i) {\n const a = refineCalendarFields(t, r, _u, Au, ju), s = e(a.timeZone), [c, u, l] = je(i), f = t.ee(a, fabricateOverflowOptions(c)), d = refineTimeBag(a, c);\n return Xe(getMatchingInstantFor(n(s), {\n ...f,\n ...d\n }, void 0 !== a.offset ? parseOffsetNano(a.offset) : void 0, u, l), s, o);\n}\n\nfunction Nt(e, n, t) {\n const o = refineCalendarFields(e, n, _u, [], p), r = dt(t);\n return jt(Do({\n ...e.ee(o, fabricateOverflowOptions(r)),\n ...refineTimeBag(o, r)\n }));\n}\n\nfunction de(e, n, t, o = []) {\n const r = refineCalendarFields(e, n, _u, o);\n return e.ee(r, t);\n}\n\nfunction Ut(e, n, t, o) {\n const r = refineCalendarFields(e, n, Gu, o);\n return e.ne(r, t);\n}\n\nfunction Rt(e, n, t, o) {\n const r = refineCalendarFields(e, t, _u, Hu);\n return n && void 0 !== r.month && void 0 === r.monthCode && void 0 === r.year && (r.year = Pl), \n e.te(r, o);\n}\n\nfunction Tt(e, n) {\n return St(refineTimeBag(refineFields(e, Ru, [], 1), dt(n)));\n}\n\nfunction q(e) {\n const n = refineFields(e, il);\n return pe(checkDurationUnits({\n ...ll,\n ...n\n }));\n}\n\nfunction refineCalendarFields(e, n, t, o = [], r = []) {\n return refineFields(n, [ ...e.fields(t), ...r ].sort(), o);\n}\n\nfunction refineFields(e, n, t, o = !t) {\n const r = {};\n let i, a = 0;\n for (const o of n) {\n if (o === i) {\n throw new RangeError(duplicateFields(o));\n }\n if (\"constructor\" === o || \"__proto__\" === o) {\n throw new RangeError(forbiddenField(o));\n }\n let n = e[o];\n if (void 0 !== n) {\n a = 1, Rm[o] && (n = Rm[o](n, o)), r[o] = n;\n } else if (t) {\n if (t.includes(o)) {\n throw new TypeError(missingField(o));\n }\n r[o] = Qu[o];\n }\n i = o;\n }\n if (o && !a) {\n throw new TypeError(noValidFields(n));\n }\n return r;\n}\n\nfunction refineTimeBag(e, n) {\n return constrainIsoTimeFields(zm({\n ...Qu,\n ...e\n }), n);\n}\n\nfunction De(e, n, t, o, r) {\n const {calendar: i, timeZone: a} = t, s = e(i), c = n(a), u = [ ...s.fields(_u), ...Uu ].sort(), l = (e => {\n const n = he(e, L), t = Se(n.offsetNanoseconds), o = ra(e.calendar), [r, i, a] = o.u(n), [s, c] = o.m(r, i), u = sa(s, c);\n return {\n ...Ga(n),\n year: r,\n monthCode: u,\n day: a,\n offset: t\n };\n })(t), f = refineFields(o, u), d = s.oe(l, f), m = {\n ...l,\n ...f\n }, [p, h, I] = je(r, 2);\n return Xe(getMatchingInstantFor(c, {\n ...s.ee(d, fabricateOverflowOptions(p)),\n ...constrainIsoTimeFields(zm(m), p)\n }, parseOffsetNano(m.offset), h, I), a, i);\n}\n\nfunction Pt(e, n, t, o) {\n const r = e(n.calendar), i = [ ...r.fields(_u), ...p ].sort(), a = {\n ...computeDateEssentials(s = n),\n hour: s.isoHour,\n minute: s.isoMinute,\n second: s.isoSecond,\n millisecond: s.isoMillisecond,\n microsecond: s.isoMicrosecond,\n nanosecond: s.isoNanosecond\n };\n var s;\n const c = refineFields(t, i), u = dt(o), l = r.oe(a, c), f = {\n ...a,\n ...c\n };\n return jt(Do({\n ...r.ee(l, fabricateOverflowOptions(u)),\n ...constrainIsoTimeFields(zm(f), u)\n }));\n}\n\nfunction ee(e, n, t, o) {\n const r = e(n.calendar), i = r.fields(_u).sort(), a = computeDateEssentials(n), s = refineFields(t, i), c = r.oe(a, s);\n return r.ee(c, o);\n}\n\nfunction Wt(e, n, t, o) {\n const r = e(n.calendar), i = r.fields(Gu).sort(), a = (e => {\n const n = ra(e.calendar), [t, o] = n.u(e), [r, i] = n.m(t, o);\n return {\n year: t,\n monthCode: sa(r, i)\n };\n })(n), s = refineFields(t, i), c = r.oe(a, s);\n return r.ne(c, o);\n}\n\nfunction Et(e, n, t, o) {\n const r = e(n.calendar), i = r.fields(_u).sort(), a = (e => {\n const n = ra(e.calendar), [t, o, r] = n.u(e), [i, a] = n.m(t, o);\n return {\n monthCode: sa(i, a),\n day: r\n };\n })(n), s = refineFields(t, i), c = r.oe(a, s);\n return r.te(c, o);\n}\n\nfunction rt(e, n, t) {\n return St(((e, n, t) => refineTimeBag({\n ...nn(Ru, e),\n ...refineFields(n, Ru)\n }, dt(t)))(e, n, t));\n}\n\nfunction N(e, n) {\n return pe((t = e, o = n, checkDurationUnits({\n ...t,\n ...refineFields(o, il)\n })));\n var t, o;\n}\n\nfunction convertToPlainMonthDay(e, n) {\n const t = refineCalendarFields(e, n, Ku);\n return e.te(t);\n}\n\nfunction convertToPlainYearMonth(e, n, t) {\n const o = refineCalendarFields(e, n, Vu);\n return e.ne(o, t);\n}\n\nfunction convertToIso(e, n, t, o, r) {\n n = nn(t = e.fields(t), n), o = refineFields(o, r = e.fields(r), []);\n let i = e.oe(n, o);\n return i = refineFields(i, [ ...t, ...r ].sort(), []), e.ee(i);\n}\n\nfunction nativeDateFromFields(e, n) {\n const t = dt(n), o = refineYear(this, e), r = refineMonth(this, e, o, t), i = refineDay(this, e, r, o, t);\n return W(To(this.U(o, r, i)), this.id || l);\n}\n\nfunction nativeYearMonthFromFields(e, n) {\n const t = dt(n), o = refineYear(this, e), r = refineMonth(this, e, o, t);\n return createPlainYearMonthSlots(checkIsoYearMonthInBounds(this.U(o, r, 1)), this.id || l);\n}\n\nfunction nativeMonthDayFromFields(e, n) {\n const t = dt(n);\n let o, r, i, a = void 0 !== e.eraYear || void 0 !== e.year ? refineYear(this, e) : void 0;\n const s = !this.id;\n if (void 0 === a && s && (a = Pl), void 0 !== a) {\n const n = refineMonth(this, e, a, t);\n o = refineDay(this, e, n, a, t);\n const s = this.F(a);\n r = monthToMonthCodeNumber(n, s), i = n === s;\n } else {\n if (void 0 === e.monthCode) {\n throw new TypeError(lu);\n }\n if ([r, i] = parseMonthCode(e.monthCode), this.id && this.id !== Xu && this.id !== el) {\n if (this.id && \"coptic\" === computeCalendarIdBase(this.id) && 0 === t) {\n const n = i || 13 !== r ? 30 : 6;\n o = e.day, o = clampNumber(o, 1, n);\n } else if (this.id && \"chinese\" === computeCalendarIdBase(this.id) && 0 === t) {\n const n = !i || 1 !== r && 9 !== r && 10 !== r && 11 !== r && 12 !== r ? 30 : 29;\n o = e.day, o = clampNumber(o, 1, n);\n } else {\n o = e.day;\n }\n } else {\n o = refineDay(this, e, refineMonth(this, e, Pl, t), Pl, t);\n }\n }\n const c = this.R(r, i, o);\n if (!c) {\n throw new RangeError(\"Cannot guess year\");\n }\n const [u, f] = c;\n return createPlainMonthDaySlots(To(this.U(u, f, o)), this.id || l);\n}\n\nfunction nativeFieldsMethod(e) {\n return getCalendarEraOrigins(this) && e.includes(\"year\") ? [ ...e, ...qu ] : e;\n}\n\nfunction nativeMergeFields(e, n) {\n const t = Object.assign(Object.create(null), e);\n return spliceFields(t, n, $u), getCalendarEraOrigins(this) && (spliceFields(t, n, Lu), \n this.id === el && spliceFields(t, n, Ju, qu)), t;\n}\n\nfunction refineYear(e, n) {\n const t = getCalendarEraOrigins(e), o = tl[e.id || \"\"] || {};\n let {era: r, eraYear: i, year: a} = n;\n if (void 0 !== r || void 0 !== i) {\n if (void 0 === r || void 0 === i) {\n throw new TypeError(su);\n }\n if (!t) {\n throw new RangeError(iu);\n }\n const e = t[o[r] || r];\n if (void 0 === e) {\n throw new RangeError(invalidEra(r));\n }\n const n = eraYearToYear(i, e);\n if (void 0 !== a && a !== n) {\n throw new RangeError(cu);\n }\n a = n;\n } else if (void 0 === a) {\n throw new TypeError(missingYear(t));\n }\n return a;\n}\n\nfunction refineMonth(e, n, t, o) {\n let {month: r, monthCode: i} = n;\n if (void 0 !== i) {\n const n = ((e, n, t, o) => {\n const r = e.F(t), [i, a] = parseMonthCode(n);\n let s = monthCodeNumberToMonth(i, a, r);\n if (a) {\n const n = getCalendarLeapMonthMeta(e);\n if (void 0 === n) {\n throw new RangeError(fu);\n }\n if (n > 0) {\n if (s > n) {\n throw new RangeError(fu);\n }\n if (void 0 === r) {\n if (1 === o) {\n throw new RangeError(fu);\n }\n s--;\n }\n } else {\n if (s !== -n) {\n throw new RangeError(fu);\n }\n if (void 0 === r && 1 === o) {\n throw new RangeError(fu);\n }\n }\n }\n return s;\n })(e, i, t, o);\n if (void 0 !== r && r !== n) {\n throw new RangeError(uu);\n }\n r = n, o = 1;\n } else if (void 0 === r) {\n throw new TypeError(lu);\n }\n return ba(\"month\", r, 1, e.O(t), o);\n}\n\nfunction refineDay(e, n, t, o, r) {\n return clampProp(n, \"day\", 1, e.B(o, t), r);\n}\n\nfunction spliceFields(e, n, t, o) {\n let r = 0;\n const i = [];\n for (const e of t) {\n void 0 !== n[e] ? r = 1 : i.push(e);\n }\n if (Object.assign(e, n), r) {\n for (const n of o || i) {\n delete e[n];\n }\n }\n}\n\nfunction computeDateEssentials(e) {\n const n = ra(e.calendar), [t, o, r] = n.u(e), [i, a] = n.m(t, o);\n return {\n year: t,\n monthCode: sa(i, a),\n day: r\n };\n}\n\nfunction qe(e) {\n return xe(io(bigIntToBigNano(toBigInt(e))));\n}\n\nfunction ye(e, n, t, o, r = l) {\n return Xe(io(bigIntToBigNano(toBigInt(t))), n(o), e(r));\n}\n\nfunction Mt(n, t, o, r, i = 0, a = 0, s = 0, c = 0, u = 0, f = 0, d = l) {\n return jt(Do(checkIsoDateTimeFields(e(Za, zipProps(pl, [ t, o, r, i, a, s, c, u, f ])))), n(d));\n}\n\nfunction ue(n, t, o, r, i = l) {\n return W(To(checkIsoDateFields(e(Za, {\n isoYear: t,\n isoMonth: o,\n isoDay: r\n }))), n(i));\n}\n\nfunction Kt(e, n, t, o = l, r = 1) {\n const i = Za(n), a = Za(t), s = e(o);\n return createPlainYearMonthSlots(checkIsoYearMonthInBounds(checkIsoDateFields({\n isoYear: i,\n isoMonth: a,\n isoDay: Za(r)\n })), s);\n}\n\nfunction kt(e, n, t, o = l, r = Pl) {\n const i = Za(n), a = Za(t), s = e(o);\n return createPlainMonthDaySlots(To(checkIsoDateFields({\n isoYear: Za(r),\n isoMonth: i,\n isoDay: a\n })), s);\n}\n\nfunction ut(n = 0, t = 0, o = 0, r = 0, i = 0, a = 0) {\n return St(constrainIsoTimeFields(e(Za, zipProps(w, [ n, t, o, r, i, a ])), 1));\n}\n\nfunction j(n = 0, t = 0, o = 0, r = 0, i = 0, a = 0, s = 0, c = 0, u = 0, l = 0) {\n return pe(checkDurationUnits(e(Ba, zipProps(O, [ n, t, o, r, i, a, s, c, u, l ]))));\n}\n\nfunction Je(e, n, t = l) {\n return Xe(e.epochNanoseconds, n, t);\n}\n\nfunction Ce(e) {\n return xe(e.epochNanoseconds);\n}\n\nfunction yt(e, n) {\n return jt(he(n, e));\n}\n\nfunction fe(e, n) {\n return W(he(n, e));\n}\n\nfunction Qa(e, n, t) {\n return convertToPlainYearMonth(e(n.calendar), t);\n}\n\nfunction Xa(e, n, t) {\n return convertToPlainMonthDay(e(n.calendar), t);\n}\n\nfunction mt(e, n) {\n return St(he(n, e));\n}\n\nfunction Ct(e, n, t, o) {\n const r = ((e, n, t, o) => {\n const r = (e => Vl(normalizeOptions(e)))(o);\n return $o(e(n), t, r);\n })(e, t, n, o);\n return Xe(io(r), t, n.calendar);\n}\n\nfunction po(e, n, t) {\n const o = e(n.calendar);\n return createPlainYearMonthSlots({\n ...n,\n ...convertToPlainYearMonth(o, t)\n });\n}\n\nfunction yo(e, n, t) {\n return convertToPlainMonthDay(e(n.calendar), t);\n}\n\nfunction ae(e, n, t, o, r) {\n const i = e(r.timeZone), a = r.plainTime, s = void 0 !== a ? n(a) : void 0, c = t(i);\n let u;\n return u = s ? $o(c, {\n ...o,\n ...s\n }) : getStartOfDayInstantFor(c, {\n ...o,\n ...At\n }), Xe(u, i, o.calendar);\n}\n\nfunction ie(e, n = At) {\n return jt(Do({\n ...e,\n ...n\n }));\n}\n\nfunction le(e, n, t) {\n return convertToPlainYearMonth(e(n.calendar), t);\n}\n\nfunction se(e, n, t) {\n return convertToPlainMonthDay(e(n.calendar), t);\n}\n\nfunction $t(e, n, t, o) {\n return ((e, n, t) => convertToIso(e, n, Vu, oa(t), Hu))(e(n.calendar), t, o);\n}\n\nfunction Vt(e, n, t, o) {\n return ((e, n, t) => convertToIso(e, n, Ku, oa(t), Wu))(e(n.calendar), t, o);\n}\n\nfunction vo(e, n, t, o, r) {\n const i = oa(r), a = n(i.re), s = e(i.timeZone);\n return Xe($o(t(s), {\n ...a,\n ...o\n }), s, a.calendar);\n}\n\nfunction Oo(e, n) {\n return jt(Do({\n ...e,\n ...n\n }));\n}\n\nfunction ea(e) {\n return xe(io(Ge(Ba(e), oo)));\n}\n\nfunction ze(e) {\n return xe(io(Ge(Ba(e), Ke)));\n}\n\nfunction na(e) {\n return xe(io(bigIntToBigNano(toBigInt(e), ro)));\n}\n\nfunction $e(e) {\n return xe(io(bigIntToBigNano(toBigInt(e))));\n}\n\nfunction createOptionsTransformer(e, n, t) {\n const o = new Set(t);\n return (r, i) => {\n const a = t && hasAnyPropsByName(r, t);\n if (!hasAnyPropsByName(r = ((e, n) => {\n const t = {};\n for (const o in n) {\n e.has(o) || (t[o] = n[o]);\n }\n return t;\n })(o, r), e)) {\n if (i && a) {\n throw new TypeError(\"Invalid formatting options\");\n }\n r = {\n ...n,\n ...r\n };\n }\n return t && (r.timeZone = nf, [ \"full\", \"long\" ].includes(r.ie) && (r.ie = \"medium\")), \n r;\n };\n}\n\nfunction K(e, n = an, t = 0) {\n const [o, , , r] = e;\n return (i, a = mp, ...s) => {\n const c = n(r && r(...s), i, a, o, t), u = c.resolvedOptions();\n return [ c, ...toEpochMillis(e, u, s) ];\n };\n}\n\nfunction an(e, n, t, o, r) {\n if (t = o(t, r), e) {\n if (void 0 !== t.timeZone) {\n throw new TypeError(Ou);\n }\n t.timeZone = e;\n }\n return new en(n, t);\n}\n\nfunction computeNonBuggyIsoResolve() {\n return new en(void 0, {\n calendar: l\n }).resolvedOptions().calendar === l;\n}\n\nfunction toEpochMillis(e, n, t) {\n const [, o, r] = e;\n return t.map((e => (e.calendar && ((e, n, t) => {\n if ((t || e !== l) && e !== n) {\n throw new RangeError(mu);\n }\n })(e.calendar, n.calendar, r), o(e, n))));\n}\n\nfunction Pe(e, n, t) {\n const o = n.timeZone, r = e(o), i = {\n ...he(n, r),\n ...t || At\n };\n let a;\n return a = t ? getMatchingInstantFor(r, i, i.offsetNanoseconds, 2) : getStartOfDayInstantFor(r, i), \n Xe(a, o, n.calendar);\n}\n\nfunction Ka(e, n, t) {\n const o = n.timeZone, r = e(o), i = {\n ...he(n, r),\n ...t\n }, a = getPreferredCalendarId(n.calendar, t.calendar);\n return Xe(getMatchingInstantFor(r, i, i.offsetNanoseconds, 2), o, a);\n}\n\nfunction pt(e, n = At) {\n return jt(Do({\n ...e,\n ...n\n }));\n}\n\nfunction Mo(e, n) {\n return jt({\n ...e,\n ...n\n }, getPreferredCalendarId(e.calendar, n.calendar));\n}\n\nfunction Ot(e, n) {\n return {\n ...e,\n calendar: n\n };\n}\n\nfunction ge(e, n) {\n return {\n ...e,\n timeZone: n\n };\n}\n\nfunction getPreferredCalendarId(e, n) {\n if (e === n) {\n return e;\n }\n if (e === n || e === l) {\n return n;\n }\n if (n === l) {\n return e;\n }\n throw new RangeError(mu);\n}\n\nfunction tn(e) {\n const n = Ue();\n return So(n, e.N(n));\n}\n\nfunction Ue() {\n return Ge(Date.now(), Ke);\n}\n\nfunction Qe() {\n return (new en).resolvedOptions().timeZone;\n}\n\nconst expectedInteger = (e, n) => `Non-integer ${e}: ${n}`, expectedPositive = (e, n) => `Non-positive ${e}: ${n}`, expectedFinite = (e, n) => `Non-finite ${e}: ${n}`, forbiddenBigIntToNumber = e => `Cannot convert bigint to ${e}`, invalidBigInt = e => `Invalid bigint: ${e}`, ou = \"Cannot convert Symbol to string\", ru = \"Invalid object\", numberOutOfRange = (e, n, t, o, r) => r ? numberOutOfRange(e, r[n], r[t], r[o]) : invalidEntity(e, n) + `; must be between ${t}-${o}`, invalidEntity = (e, n) => `Invalid ${e}: ${n}`, missingField = e => `Missing ${e}`, forbiddenField = e => `Invalid field ${e}`, duplicateFields = e => `Duplicate field ${e}`, noValidFields = e => \"No valid fields: \" + e.join(), i = \"Invalid bag\", invalidChoice = (e, n, t) => invalidEntity(e, n) + \"; must be \" + Object.keys(t).join(), C = \"Cannot use valueOf\", a = \"Invalid calling context\", iu = \"Forbidden era/eraYear\", su = \"Mismatching era/eraYear\", cu = \"Mismatching year/eraYear\", invalidEra = e => `Invalid era: ${e}`, missingYear = e => \"Missing year\" + (e ? \"/era/eraYear\" : \"\"), invalidMonthCode = e => `Invalid monthCode: ${e}`, uu = \"Mismatching month/monthCode\", lu = \"Missing month/monthCode\", fu = \"Invalid leap month\", du = \"Invalid protocol results\", c = e => invalidEntity(\"Calendar\", e), mu = \"Mismatching Calendars\", qa = \"Calendar week operations forbidden\", F = e => invalidEntity(\"TimeZone\", e), pu = \"Mismatching TimeZones\", hu = \"Forbidden ICU TimeZone\", Iu = \"Out-of-bounds offset\", Du = \"Out-of-bounds TimeZone gap\", gu = \"Invalid TimeZone offset\", Tu = \"Ambiguous offset\", Mu = \"Out-of-bounds date\", yu = \"Out-of-bounds duration\", Nu = \"Cannot mix duration signs\", vu = \"Missing relativeTo\", Pu = \"Cannot use large units\", Fu = \"Required smallestUnit or largestUnit\", Eu = \"smallestUnit > largestUnit\", failedParse = e => `Cannot parse: ${e}`, invalidSubstring = e => `Invalid substring: ${e}`, rn = e => `Cannot format ${e}`, ln = \"Mismatching types for formatting\", Ou = \"Cannot specify TimeZone\", bu = /*@__PURE__*/ gt(P, ((e, n) => n)), Su = /*@__PURE__*/ gt(P, ((e, n, t) => t)), wu = /*@__PURE__*/ gt(padNumber, 2), Bu = {\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}, Yu = /*@__PURE__*/ Object.keys(Bu), Cu = 864e5, ku = 1e3, ro = 1e3, Ke = 1e6, oo = 1e9, ao = 6e10, no = 36e11, go = 864e11, Zu = [ 1, ro, Ke, oo, ao, no, go ], p = /*@__PURE__*/ Yu.slice(0, 6), Ru = /*@__PURE__*/ sortStrings(p), zu = [ \"offset\" ], Au = [ \"timeZone\" ], Uu = /*@__PURE__*/ p.concat(zu), ju = /*@__PURE__*/ Uu.concat(Au), qu = [ \"era\", \"eraYear\" ], Lu = /*@__PURE__*/ qu.concat([ \"year\" ]), Wu = [ \"year\" ], xu = [ \"monthCode\" ], $u = /*@__PURE__*/ [ \"month\" ].concat(xu), Hu = [ \"day\" ], Gu = /*@__PURE__*/ $u.concat(Wu), Vu = /*@__PURE__*/ xu.concat(Wu), _u = /*@__PURE__*/ Hu.concat(Gu), Ju = /*@__PURE__*/ Hu.concat($u), Ku = /*@__PURE__*/ Hu.concat(xu), Qu = /*@__PURE__*/ Su(p, 0), l = \"iso8601\", Xu = \"gregory\", el = \"japanese\", nl = {\n [Xu]: {\n \"gregory-inverse\": -1,\n gregory: 0\n },\n [el]: {\n \"japanese-inverse\": -1,\n japanese: 0,\n meiji: 1867,\n taisho: 1911,\n showa: 1925,\n heisei: 1988,\n reiwa: 2018\n },\n ethiopic: {\n ethioaa: 0,\n ethiopic: 5500\n },\n coptic: {\n \"coptic-inverse\": -1,\n coptic: 0\n },\n roc: {\n \"roc-inverse\": -1,\n roc: 0\n },\n buddhist: {\n be: 0\n },\n islamic: {\n ah: 0\n },\n indian: {\n saka: 0\n },\n persian: {\n ap: 0\n }\n}, tl = {\n [Xu]: {\n bce: \"gregory-inverse\",\n ce: \"gregory\"\n },\n [el]: {\n bce: \"japanese-inverse\",\n ce: \"japanese\"\n },\n ethiopic: {\n era0: \"ethioaa\",\n era1: \"ethiopic\"\n },\n coptic: {\n era0: \"coptic-inverse\",\n era1: \"coptic\"\n },\n roc: {\n broc: \"roc-inverse\",\n minguo: \"roc\"\n }\n}, ol = {\n chinese: 13,\n dangi: 13,\n hebrew: -6\n}, d = /*@__PURE__*/ gt(requireType, \"string\"), D = /*@__PURE__*/ gt(requireType, \"boolean\"), rl = /*@__PURE__*/ gt(requireType, \"number\"), O = /*@__PURE__*/ Yu.map((e => e + \"s\")), il = /*@__PURE__*/ sortStrings(O), al = /*@__PURE__*/ O.slice(0, 6), sl = /*@__PURE__*/ O.slice(6), cl = /*@__PURE__*/ sl.slice(1), ul = /*@__PURE__*/ bu(O), ll = /*@__PURE__*/ Su(O, 0), fl = /*@__PURE__*/ Su(al, 0), dl = /*@__PURE__*/ gt(zeroOutProps, O), w = [ \"isoNanosecond\", \"isoMicrosecond\", \"isoMillisecond\", \"isoSecond\", \"isoMinute\", \"isoHour\" ], ml = [ \"isoDay\", \"isoMonth\", \"isoYear\" ], pl = /*@__PURE__*/ w.concat(ml), Ca = /*@__PURE__*/ sortStrings(ml), hl = /*@__PURE__*/ sortStrings(w), Il = /*@__PURE__*/ sortStrings(pl), At = /*@__PURE__*/ Su(hl, 0), Ra = /*@__PURE__*/ gt(zeroOutProps, pl), Dl = 1e8, gl = Dl * Cu, Tl = [ Dl, 0 ], Ml = [ -Dl, 0 ], yl = 275760, Nl = -271821, en = Intl.DateTimeFormat, vl = 1970, Pl = 1972, Fl = 12, El = /*@__PURE__*/ isoArgsToEpochMilli(1868, 9, 8), Ol = /*@__PURE__*/ on(computeJapaneseEraParts, WeakMap), bl = \"smallestUnit\", Sl = \"unit\", wl = \"roundingMode\", Bl = \"roundingIncrement\", Yl = \"fractionalSecondDigits\", Cl = \"relativeTo\", kl = \"direction\", Zl = {\n constrain: 0,\n reject: 1\n}, Rl = /*@__PURE__*/ Object.keys(Zl), zl = {\n compatible: 0,\n reject: 1,\n earlier: 2,\n later: 3\n}, Al = {\n reject: 0,\n use: 1,\n prefer: 2,\n ignore: 3\n}, Ul = {\n auto: 0,\n never: 1,\n critical: 2,\n always: 3\n}, jl = {\n auto: 0,\n never: 1,\n critical: 2\n}, ql = {\n auto: 0,\n never: 1\n}, Ll = {\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}, Wl = {\n previous: -1,\n next: 1\n}, xl = /*@__PURE__*/ gt(refineUnitOption, bl), $l = /*@__PURE__*/ gt(refineUnitOption, \"largestUnit\"), Hl = /*@__PURE__*/ gt(refineUnitOption, Sl), Gl = /*@__PURE__*/ gt(refineChoiceOption, \"overflow\", Zl), Vl = /*@__PURE__*/ gt(refineChoiceOption, \"disambiguation\", zl), _l = /*@__PURE__*/ gt(refineChoiceOption, \"offset\", Al), Jl = /*@__PURE__*/ gt(refineChoiceOption, \"calendarName\", Ul), Kl = /*@__PURE__*/ gt(refineChoiceOption, \"timeZoneName\", jl), Ql = /*@__PURE__*/ gt(refineChoiceOption, \"offset\", ql), Xl = /*@__PURE__*/ gt(refineChoiceOption, wl, Ll), Qt = \"PlainYearMonth\", qt = \"PlainMonthDay\", G = \"PlainDate\", x = \"PlainDateTime\", ft = \"PlainTime\", _ = \"ZonedDateTime\", Re = \"Instant\", A = \"Duration\", ef = [ Math.floor, e => hasHalf(e) ? Math.floor(e) : Math.round(e), Math.ceil, e => hasHalf(e) ? Math.ceil(e) : Math.round(e), Math.trunc, e => hasHalf(e) ? Math.trunc(e) || 0 : Math.round(e), e => e < 0 ? Math.floor(e) : Math.ceil(e), e => Math.sign(e) * Math.round(Math.abs(e)) || 0, e => hasHalf(e) ? (e = Math.trunc(e) || 0) + e % 2 : Math.round(e) ], nf = \"UTC\", tf = 5184e3, of = /*@__PURE__*/ isoArgsToEpochSec(1847), rf = /*@__PURE__*/ isoArgsToEpochSec((() => {\n const e = new Date;\n return (0 === e.getTime() ? 2040 : e.getUTCFullYear()) + 10;\n})()), af = /0+$/, he = /*@__PURE__*/ on(_zonedEpochSlotsToIso, WeakMap), sf = 2 ** 32 - 1, L = /*@__PURE__*/ on((e => {\n const n = getTimeZoneEssence(e);\n return \"object\" == typeof n ? new IntlTimeZone(n) : new FixedTimeZone(n || 0);\n}));\n\nclass FixedTimeZone {\n constructor(e) {\n this.j = e;\n }\n N() {\n return this.j;\n }\n v(e) {\n return (e => {\n const n = ma({\n ...e,\n ...At\n });\n if (!n || Math.abs(n[0]) > 1e8) {\n throw new RangeError(Mu);\n }\n })(e), [ isoToEpochNanoWithOffset(e, this.j) ];\n }\n l() {}\n}\n\nclass IntlTimeZone {\n constructor(e) {\n this.ae = (e => {\n function getOffsetSec(e) {\n const i = clampNumber(e, o, r), [a, s] = computePeriod(i), c = n(a), u = n(s);\n return c === u ? c : pinch(t(a, s), c, u, e);\n }\n function pinch(n, t, o, r) {\n let i, a;\n for (;(void 0 === r || void 0 === (i = r < n[0] ? t : r >= n[1] ? o : void 0)) && (a = n[1] - n[0]); ) {\n const t = n[0] + Math.floor(a / 2);\n e(t) === o ? n[1] = t : n[0] = t + 1;\n }\n return i;\n }\n const n = on(e), t = on(createSplitTuple);\n let o = of, r = rf;\n return {\n se(e) {\n const n = getOffsetSec(e - 86400), t = getOffsetSec(e + 86400), o = e - n, r = e - t;\n if (n === t) {\n return [ o ];\n }\n const i = getOffsetSec(o);\n return i === getOffsetSec(r) ? [ e - i ] : n > t ? [ o, r ] : [];\n },\n ue: getOffsetSec,\n l(e, i) {\n const a = clampNumber(e, o, r);\n let [s, c] = computePeriod(a);\n const u = tf * i, l = i < 0 ? () => c > o || (o = a, 0) : () => s < r || (r = a, \n 0);\n for (;l(); ) {\n const o = n(s), r = n(c);\n if (o !== r) {\n const n = t(s, c);\n pinch(n, o, r);\n const a = n[0];\n if ((compareNumbers(a, e) || 1) === i) {\n return a;\n }\n }\n s += u, c += u;\n }\n }\n };\n })((e => n => {\n const t = hashIntlFormatParts(e, n * ku);\n return isoArgsToEpochSec(parseIntlPartsYear(t), parseInt(t.month), parseInt(t.day), parseInt(t.hour), parseInt(t.minute), parseInt(t.second)) - n;\n })(e));\n }\n N(e) {\n return this.ae.ue(epochNanoToSec(e)) * oo;\n }\n v(e) {\n const [n, t] = [ isoArgsToEpochSec((o = e).isoYear, o.isoMonth, o.isoDay, o.isoHour, o.isoMinute, o.isoSecond), o.isoMillisecond * Ke + o.isoMicrosecond * ro + o.isoNanosecond ];\n var o;\n return this.ae.se(n).map((e => io(Ta(Ge(e, oo), t))));\n }\n l(e, n) {\n const [t, o] = epochNanoToSecMod(e), r = this.ae.l(t + (n > 0 || o ? 1 : 0), n);\n if (void 0 !== r) {\n return Ge(r, oo);\n }\n }\n}\n\nconst cf = \"([+-])\", uf = \"(?:[.,](\\\\d{1,9}))?\", lf = `(?:(?:${cf}(\\\\d{6}))|(\\\\d{4}))-?(\\\\d{2})`, ff = \"(\\\\d{2})(?::?(\\\\d{2})(?::?(\\\\d{2})\" + uf + \")?)?\", df = cf + ff, mf = lf + \"-?(\\\\d{2})(?:[T ]\" + ff + \"(Z|\" + df + \")?)?\", pf = \"\\\\[(!?)([^\\\\]]*)\\\\]\", hf = `((?:${pf}){0,9})`, If = /*@__PURE__*/ createRegExp(lf + hf), Df = /*@__PURE__*/ createRegExp(\"(?:--)?(\\\\d{2})-?(\\\\d{2})\" + hf), gf = /*@__PURE__*/ createRegExp(mf + hf), Tf = /*@__PURE__*/ createRegExp(\"T?\" + ff + \"(?:\" + df + \")?\" + hf), Mf = /*@__PURE__*/ createRegExp(df), yf = /*@__PURE__*/ new RegExp(pf, \"g\"), Nf = /*@__PURE__*/ createRegExp(`${cf}?P(\\\\d+Y)?(\\\\d+M)?(\\\\d+W)?(\\\\d+D)?(?:T(?:(\\\\d+)${uf}H)?(?:(\\\\d+)${uf}M)?(?:(\\\\d+)${uf}S)?)?`), vf = /*@__PURE__*/ on((e => new en(\"en\", {\n calendar: l,\n timeZone: e,\n era: \"short\",\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n hour12: 0\n}))), Pf = /^(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$/, Ff = /[^\\w\\/:+-]+/, Ef = /^M(\\d{2})(L?)$/, Of = /*@__PURE__*/ on(createIntlCalendar), bf = /*@__PURE__*/ on((e => new en(\"en\", {\n calendar: e,\n timeZone: nf,\n era: \"short\",\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour12: 0\n}))), Sf = {\n ne: nativeYearMonthFromFields,\n fields: nativeFieldsMethod\n}, wf = {\n ee: nativeDateFromFields,\n fields: nativeFieldsMethod\n}, Bf = {\n te: nativeMonthDayFromFields,\n fields: nativeFieldsMethod\n}, Yf = {\n P: nativeDateAdd\n}, Cf = {\n P: nativeDateAdd,\n h: nativeDateUntil\n}, kf = {\n P: nativeDateAdd,\n h: nativeDateUntil,\n ee: nativeDateFromFields,\n ne: nativeYearMonthFromFields,\n te: nativeMonthDayFromFields,\n fields: nativeFieldsMethod,\n oe: nativeMergeFields,\n inLeapYear: computeNativeInLeapYear,\n monthsInYear: computeNativeMonthsInYear,\n daysInMonth: computeNativeDaysInMonth,\n daysInYear: computeNativeDaysInYear,\n dayOfYear: computeNativeDayOfYear,\n era(e) {\n return this.$(e)[0];\n },\n eraYear(e) {\n return this.$(e)[1];\n },\n monthCode(e) {\n const [n, t] = this.u(e), [o, r] = this.m(n, t);\n return sa(o, r);\n },\n dayOfWeek: Ha,\n daysInWeek: fo\n}, Zf = {\n F: noop,\n O: computeIsoMonthsInYear,\n U: computeIsoFieldsFromParts\n}, Rf = /*@__PURE__*/ Object.assign({}, Zf, {\n B: computeIsoDaysInMonth\n}), zf = /*@__PURE__*/ Object.assign({}, Rf, {\n R: computeIsoYearMonthForMonthDay\n}), Af = /*@__PURE__*/ Object.assign({}, Sf, Zf), Uf = /*@__PURE__*/ Object.assign({}, wf, zf), jf = /*@__PURE__*/ Object.assign({}, Bf, zf), qf = /*@__PURE__*/ Object.assign({}, Af, {\n oe: nativeMergeFields\n}), Lf = /*@__PURE__*/ Object.assign({}, Uf, {\n oe: nativeMergeFields\n}), Wf = /*@__PURE__*/ Object.assign({}, jf, {\n oe: nativeMergeFields\n}), xf = {\n u: computeIsoDateParts,\n M: isoArgsToEpochMilli,\n p: isoMonthAdd\n}, $f = /*@__PURE__*/ Object.assign({}, xf, {\n m: computeIsoMonthCodeParts,\n O: computeIsoMonthsInYear,\n B: computeIsoDaysInMonth,\n F: noop\n}), Hf = /*@__PURE__*/ Object.assign({}, Yf, $f), Gf = /*@__PURE__*/ Object.assign({}, Cf, $f, {\n q: computeIsoMonthsInYearSpan\n}), Vf = {\n day: computeIsoDay\n}, _f = /*@__PURE__*/ Object.assign({}, Hf, Vf), Jf = /*@__PURE__*/ Object.assign({}, Gf, Vf), Kf = {\n u: computeIsoDateParts,\n $: computeIsoEraParts,\n m: computeIsoMonthCodeParts\n}, Qf = {\n inLeapYear: computeNativeInLeapYear,\n u: computeIsoDateParts,\n L: computeIsoInLeapYear\n}, Xf = {\n monthsInYear: computeNativeMonthsInYear,\n u: computeIsoDateParts,\n O: computeIsoMonthsInYear\n}, em = {\n daysInMonth: computeNativeDaysInMonth,\n u: computeIsoDateParts,\n B: computeIsoDaysInMonth\n}, nm = {\n daysInYear: computeNativeDaysInYear,\n u: computeIsoDateParts,\n G: computeIsoDaysInYear\n}, tm = {\n dayOfYear: computeNativeDayOfYear,\n u: computeIsoDateParts,\n M: isoArgsToEpochMilli\n}, om = /*@__PURE__*/ Object.assign({}, tm, {\n weekOfYear: computeNativeWeekOfYear,\n yearOfWeek: computeNativeYearOfWeek,\n I(e) {\n function computeWeekShift(e) {\n return (7 - e < n ? 7 : 0) - e;\n }\n function computeWeeksInYear(e) {\n const n = computeIsoDaysInYear(l + e), t = e || 1, o = computeWeekShift(modFloor(a + n * t, 7));\n return c = (n + (o - s) * t) / 7;\n }\n const n = this.id ? 1 : 4, t = Ha(e), o = this.dayOfYear(e), r = modFloor(t - 1, 7), i = o - 1, a = modFloor(r - i, 7), s = computeWeekShift(a);\n let c, u = Math.floor((i - s) / 7) + 1, l = e.isoYear;\n return u ? u > computeWeeksInYear(0) && (u = 1, l++) : (u = computeWeeksInYear(-1), \n l--), [ u, l, c ];\n }\n}), rm = {\n u: computeIsoDateParts,\n m: computeIsoMonthCodeParts,\n R: computeIsoYearMonthForMonthDay,\n U: computeIsoFieldsFromParts\n}, im = /*@__PURE__*/ Object.assign({}, kf, om, {\n u: computeIsoDateParts,\n $: computeIsoEraParts,\n m: computeIsoMonthCodeParts,\n R: computeIsoYearMonthForMonthDay,\n L: computeIsoInLeapYear,\n F: noop,\n O: computeIsoMonthsInYear,\n q: computeIsoMonthsInYearSpan,\n B: computeIsoDaysInMonth,\n G: computeIsoDaysInYear,\n U: computeIsoFieldsFromParts,\n M: isoArgsToEpochMilli,\n p: isoMonthAdd,\n year(e) {\n return e.isoYear;\n },\n month(e) {\n return e.isoMonth;\n },\n day: computeIsoDay\n}), am = {\n F: computeIntlLeapMonth,\n O: computeIntlMonthsInYear,\n U: computeIsoFieldsFromIntlParts\n}, sm = /*@__PURE__*/ Object.assign({}, am, {\n B: computeIntlDaysInMonth\n}), cm = /*@__PURE__*/ Object.assign({}, sm, {\n R: computeIntlYearMonthForMonthDay\n}), um = /*@__PURE__*/ Object.assign({}, Sf, am), lm = /*@__PURE__*/ Object.assign({}, wf, sm), fm = /*@__PURE__*/ Object.assign({}, Bf, cm), dm = /*@__PURE__*/ Object.assign({}, um, {\n oe: nativeMergeFields\n}), mm = /*@__PURE__*/ Object.assign({}, lm, {\n oe: nativeMergeFields\n}), pm = /*@__PURE__*/ Object.assign({}, fm, {\n oe: nativeMergeFields\n}), hm = {\n u: computeIntlDateParts,\n M: computeIntlEpochMilli,\n p: intlMonthAdd\n}, Im = /*@__PURE__*/ Object.assign({}, hm, {\n m: computeIntlMonthCodeParts,\n O: computeIntlMonthsInYear,\n B: computeIntlDaysInMonth,\n F: computeIntlLeapMonth\n}), Dm = /*@__PURE__*/ Object.assign({}, Yf, Im), gm = /*@__PURE__*/ Object.assign({}, Cf, Im, {\n q: computeIntlMonthsInYearSpan\n}), Tm = {\n day: computeIntlDay\n}, Mm = /*@__PURE__*/ Object.assign({}, Dm, Tm), ym = /*@__PURE__*/ Object.assign({}, gm, Tm), Nm = {\n u: computeIntlDateParts,\n $: computeIntlEraParts,\n m: computeIntlMonthCodeParts\n}, vm = {\n inLeapYear: computeNativeInLeapYear,\n u: computeIntlDateParts,\n L: computeIntlInLeapYear\n}, Pm = {\n monthsInYear: computeNativeMonthsInYear,\n u: computeIntlDateParts,\n O: computeIntlMonthsInYear\n}, Fm = {\n daysInMonth: computeNativeDaysInMonth,\n u: computeIntlDateParts,\n B: computeIntlDaysInMonth\n}, Em = {\n daysInYear: computeNativeDaysInYear,\n u: computeIntlDateParts,\n G: computeIntlDaysInYear\n}, Om = {\n dayOfYear: computeNativeDayOfYear,\n u: computeIntlDateParts,\n M: computeIntlEpochMilli\n}, bm = {\n I() {\n return [];\n }\n}, Sm = /*@__PURE__*/ Object.assign({}, Om, bm, {\n weekOfYear: computeNativeWeekOfYear,\n yearOfWeek: computeNativeYearOfWeek\n}), wm = {\n u: computeIntlDateParts,\n m: computeIntlMonthCodeParts,\n R: computeIntlYearMonthForMonthDay,\n U: computeIsoFieldsFromIntlParts\n}, Bm = /*@__PURE__*/ Object.assign({}, kf, Sm, {\n u: computeIntlDateParts,\n $: computeIntlEraParts,\n m: computeIntlMonthCodeParts,\n R: computeIntlYearMonthForMonthDay,\n L: computeIntlInLeapYear,\n F: computeIntlLeapMonth,\n O: computeIntlMonthsInYear,\n q: computeIntlMonthsInYearSpan,\n B: computeIntlDaysInMonth,\n G: computeIntlDaysInYear,\n U: computeIsoFieldsFromIntlParts,\n M: computeIntlEpochMilli,\n p: intlMonthAdd,\n year(e) {\n return this._(e).year;\n },\n month(e) {\n const {year: n, V: t} = this._(e), {X: o} = this.J(n);\n return o[t] + 1;\n },\n day: computeIntlDay\n}), Va = /*@__PURE__*/ createNativeOpsCreator(Af, um), Aa = /*@__PURE__*/ createNativeOpsCreator(Uf, lm), _a = /*@__PURE__*/ createNativeOpsCreator(jf, fm), Fo = /*@__PURE__*/ createNativeOpsCreator(qf, dm), mo = /*@__PURE__*/ createNativeOpsCreator(Lf, mm), Wo = /*@__PURE__*/ createNativeOpsCreator(Wf, pm), xa = /*@__PURE__*/ createNativeOpsCreator(xf, hm), Wa = /*@__PURE__*/ createNativeOpsCreator(Hf, Dm), Ia = /*@__PURE__*/ createNativeOpsCreator(Gf, gm), za = /*@__PURE__*/ createNativeOpsCreator(Vf, Tm), Yo = /*@__PURE__*/ createNativeOpsCreator(_f, Mm), Lo = /*@__PURE__*/ createNativeOpsCreator(Jf, ym), ra = /*@__PURE__*/ createNativeOpsCreator(Kf, Nm), ia = /*@__PURE__*/ createNativeOpsCreator(Qf, vm), ca = /*@__PURE__*/ createNativeOpsCreator(Xf, Pm), da = /*@__PURE__*/ createNativeOpsCreator(em, Fm), ua = /*@__PURE__*/ createNativeOpsCreator(nm, Em), la = /*@__PURE__*/ createNativeOpsCreator(tm, Om), $a = /*@__PURE__*/ createNativeOpsCreator(om, Sm), ko = /*@__PURE__*/ createNativeOpsCreator(rm, wm), v = /*@__PURE__*/ createNativeOpsCreator(im, Bm), Ym = {\n era: toStringViaPrimitive,\n eraYear: Za,\n year: Za,\n month: toPositiveInteger,\n monthCode(e) {\n const n = toStringViaPrimitive(e);\n return parseMonthCode(n), n;\n },\n day: toPositiveInteger\n}, Cm = /*@__PURE__*/ Su(p, Za), km = /*@__PURE__*/ Su(O, Ba), Zm = {\n offset(e) {\n const n = toStringViaPrimitive(e);\n return parseOffsetNano(n), n;\n }\n}, Rm = /*@__PURE__*/ Object.assign({}, Ym, Cm, km, Zm), zm = /*@__PURE__*/ gt(remapProps, p, w), Ga = /*@__PURE__*/ gt(remapProps, w, p), Am = \"numeric\", Um = [ \"timeZoneName\" ], jm = {\n month: Am,\n day: Am\n}, qm = {\n year: Am,\n month: Am\n}, Lm = /*@__PURE__*/ Object.assign({}, qm, {\n day: Am\n}), Wm = {\n hour: Am,\n minute: Am,\n second: Am\n}, xm = /*@__PURE__*/ Object.assign({}, Lm, Wm), $m = /*@__PURE__*/ Object.assign({}, xm, {\n timeZoneName: \"short\"\n}), Hm = /*@__PURE__*/ Object.keys(qm), Gm = /*@__PURE__*/ Object.keys(jm), Vm = /*@__PURE__*/ Object.keys(Lm), _m = /*@__PURE__*/ Object.keys(Wm), Jm = [ \"dateStyle\" ], Km = /*@__PURE__*/ Hm.concat(Jm), Qm = /*@__PURE__*/ Gm.concat(Jm), Xm = /*@__PURE__*/ Vm.concat(Jm, [ \"weekday\" ]), ep = /*@__PURE__*/ _m.concat([ \"dayPeriod\", \"timeStyle\", \"fractionalSecondDigits\" ]), np = /*@__PURE__*/ Xm.concat(ep), tp = /*@__PURE__*/ Um.concat(ep), op = /*@__PURE__*/ Um.concat(Xm), rp = /*@__PURE__*/ Um.concat([ \"day\", \"weekday\" ], ep), ip = /*@__PURE__*/ Um.concat([ \"year\", \"weekday\" ], ep), ap = /*@__PURE__*/ createOptionsTransformer(np, xm), sp = /*@__PURE__*/ createOptionsTransformer(np, $m), cp = /*@__PURE__*/ createOptionsTransformer(np, xm, Um), up = /*@__PURE__*/ createOptionsTransformer(Xm, Lm, tp), lp = /*@__PURE__*/ createOptionsTransformer(ep, Wm, op), fp = /*@__PURE__*/ createOptionsTransformer(Km, qm, rp), dp = /*@__PURE__*/ createOptionsTransformer(Qm, jm, ip), mp = {}, pp = /*@__PURE__*/ computeNonBuggyIsoResolve(), Q = [ ap, I ], ot = [ sp, I, 0, (e, n) => {\n const t = e.timeZone;\n if (n && n.timeZone !== t) {\n throw new RangeError(pu);\n }\n return t;\n} ], U = [ cp, isoToEpochMilli ], X = [ up, isoToEpochMilli ], tt = [ lp, e => isoTimeFieldsToNano(e) / Ke ], et = [ fp, isoToEpochMilli, pp ], nt = [ dp, isoToEpochMilli, pp ];\n\nexport { A as DurationBranding, Re as InstantBranding, G as PlainDateBranding, x as PlainDateTimeBranding, qt as PlainMonthDayBranding, ft as PlainTimeBranding, Qt as PlainYearMonthBranding, en as RawDateTimeFormat, _ as ZonedDateTimeBranding, Y as absDuration, so as addBigNanos, E as addDurations, lo as alignZonedEpoch, Oa as bigNanoToExactDays, La as bigNanoToNumber, gt as bindArgs, Ja as buildZonedIsoFields, io as checkEpochNanoInBounds, To as checkIsoDateInBounds, Do as checkIsoDateTimeInBounds, ba as clampEntity, Ra as clearIsoFields, pa as compareBigNanos, H as compareDurations, He as compareInstants, te as compareIsoDateFields, Yt as compareIsoDateTimeFields, Dt as compareIsoTimeFields, Be as compareZonedDateTimes, ho as computeDayFloor, ja as computeEpochNanoFrac, Ha as computeIsoDayOfWeek, fo as computeIsoDaysInWeek, Te as computeZonedHoursInDay, be as computeZonedStartOfDay, j as constructDurationSlots, qe as constructInstantSlots, ue as constructPlainDateSlots, Mt as constructPlainDateTimeSlots, kt as constructPlainMonthDaySlots, ut as constructPlainTimeSlots, Kt as constructPlainYearMonthSlots, ye as constructZonedDateTimeSlots, pe as createDurationSlots, an as createFormatForPrep, K as createFormatPrepper, t as createGetterDescriptors, xe as createInstantSlots, r as createNameDescriptors, xa as createNativeConvertOps, mo as createNativeDateModOps, Aa as createNativeDateRefineOps, la as createNativeDayOfYearOps, za as createNativeDayOps, da as createNativeDaysInMonthOps, ua as createNativeDaysInYearOps, Ia as createNativeDiffOps, ia as createNativeInLeapYearOps, Wo as createNativeMonthDayModOps, ko as createNativeMonthDayParseOps, _a as createNativeMonthDayRefineOps, ca as createNativeMonthsInYearOps, Wa as createNativeMoveOps, ra as createNativePartOps, v as createNativeStandardOps, $a as createNativeWeekOps, Lo as createNativeYearMonthDiffOps, Fo as createNativeYearMonthModOps, Yo as createNativeYearMonthMoveOps, Va as createNativeYearMonthRefineOps, W as createPlainDateSlots, jt as createPlainDateTimeSlots, St as createPlainTimeSlots, n as createPropDescriptors, o as createStringTagDescriptors, Xe as createZonedDateTimeSlots, X as dateConfig, U as dateTimeConfig, va as diffBigNanos, Ee as diffInstants, It as diffPlainDateTimes, oe as diffPlainDates, it as diffPlainTimes, _t as diffPlainYearMonth, we as diffZonedDateTimes, O as durationFieldNamesAsc, N as durationWithFields, na as epochMicroToInstant, ze as epochMilliToInstant, Pa as epochMilliToIso, $e as epochNanoToInstant, So as epochNanoToIso, ea as epochSecToInstant, fa as extractEpochNano, C as forbiddenValueOf, k as formatDurationIso, ke as formatInstantIso, sa as formatMonthCode, Se as formatOffsetNano, ce as formatPlainDateIso, Ft as formatPlainDateTimeIso, Jt as formatPlainMonthDayIso, ct as formatPlainTimeIso, Ht as formatPlainYearMonthIso, Fe as formatZonedDateTimeIso, ha as getCommonCalendarId, ga as getCommonTimeZoneId, Ue as getCurrentEpochNano, tn as getCurrentIsoDateTime, Qe as getCurrentTimeZoneId, y as getDurationBlank, aa as getEpochMicro, I as getEpochMilli, b as getEpochNano, ta as getEpochSec, $o as getSingleInstantFor, Io as identity, Q as instantConfig, Je as instantToZonedDateTime, Ve as instantsEqual, i as invalidBag, c as invalidCalendar, a as invalidCallingContext, rn as invalidFormatType, F as invalidTimeZone, s as isObjectLike, l as isoCalendarId, Ca as isoDateFieldNamesAlpha, At as isoTimeFieldDefaults, w as isoTimeFieldNamesAsc, Ga as isoTimeFieldsToCal, ma as isoToEpochNano, P as mapPropNames, e as mapProps, on as memoize, ln as mismatchingFormatTypes, nt as monthDayConfig, Ta as moveBigNano, Ua as moveByDays, ka as moveDateTime, Ye as moveInstant, ne as movePlainDate, wt as movePlainDateTime, at as movePlainTime, Gt as movePlainYearMonth, Na as moveToDayOfMonthUnsafe, Oe as moveZonedDateTime, Fa as moveZonedEpochs, no as nanoInHour, ro as nanoInMicro, Ke as nanoInMilli, ao as nanoInMinute, oo as nanoInSec, go as nanoInUtcDay, wa as nativeYearMonthAdd, B as negateDuration, Ge as numberToBigNano, f as parseCalendarId, R as parseDuration, We as parseInstant, me as parsePlainDate, Bt as parsePlainDateTime, xt as parsePlainMonthDay, ht as parsePlainTime, Xt as parsePlainYearMonth, $ as parseRelativeToSlots, M as parseTimeZoneId, Ne as parseZonedDateTime, yo as plainDateTimeToPlainMonthDay, po as plainDateTimeToPlainYearMonth, Ct as plainDateTimeToZonedDateTime, Pt as plainDateTimeWithFields, Mo as plainDateTimeWithPlainDate, pt as plainDateTimeWithPlainTime, vt as plainDateTimesEqual, ie as plainDateToPlainDateTime, se as plainDateToPlainMonthDay, le as plainDateToPlainYearMonth, ae as plainDateToZonedDateTime, ee as plainDateWithFields, re as plainDatesEqual, Vt as plainMonthDayToPlainDate, Et as plainMonthDayWithFields, Lt as plainMonthDaysEqual, Oo as plainTimeToPlainDateTime, vo as plainTimeToZonedDateTime, rt as plainTimeWithFields, st as plainTimesEqual, $t as plainYearMonthToPlainDate, Wt as plainYearMonthWithFields, zt as plainYearMonthsEqual, nn as pluckProps, Sa as prepareZonedEpochDiff, L as queryNativeTimeZone, Zt as refineCalendarId, Ze as refineDirectionOptions, q as refineDurationBag, z as refineMaybeZonedDateTimeBag, dt as refineOverflowOptions, de as refinePlainDateBag, Nt as refinePlainDateTimeBag, Rt as refinePlainMonthDayBag, Tt as refinePlainTimeBag, Ut as refinePlainYearMonthBag, Me as refineTimeZoneId, Ma as refineUnitDiffOptions, co as refineUnitRoundOptions, Ae as refineZonedDateTimeBag, je as refineZonedFieldOptions, D as requireBoolean, T as requireInteger, S as requireIntegerOrUndefined, _e as requireNumberIsInteger, oa as requireObjectLike, h as requirePositiveInteger, g as requirePositiveIntegerOrUndefined, d as requireString, m as requireStringOrUndefined, u as resolveCalendarId, Z as resolveTimeZoneId, Ya as roundBigNanoByInc, Da as roundByInc, V as roundDuration, Le as roundInstant, bt as roundPlainDateTime, lt as roundPlainTime, Ea as roundWithMode, Ie as roundZonedDateTime, uo as roundZonedEpochToInterval, Ot as slotsWithCalendarId, ge as slotsWithTimeZoneId, tt as timeConfig, p as timeFieldNamesAsc, Za as toInteger, Ba as toStrictInteger, J as totalDuration, ya as totalRelativeDuration, qa as unsupportedWeekNumbers, et as yearMonthConfig, ot as zonedConfig, Ce as zonedDateTimeToInstant, fe as zonedDateTimeToPlainDate, yt as zonedDateTimeToPlainDateTime, Xa as zonedDateTimeToPlainMonthDay, mt as zonedDateTimeToPlainTime, Qa as zonedDateTimeToPlainYearMonth, De as zonedDateTimeWithFields, Ka as zonedDateTimeWithPlainDate, Pe as zonedDateTimeWithPlainTime, ve as zonedDateTimesEqual, he as zonedEpochSlotsToIso };\n","function createSlotClass(i, l, s, c, u, f) {\n function Class(...t) {\n if (!(this instanceof Class)) {\n throw new TypeError(a);\n }\n {\n const e = l(...t);\n un(this, e), dbg(this, e, f);\n }\n }\n function bindMethod(t, e) {\n return Object.defineProperties((function(...e) {\n return t.call(this, getSpecificSlots(this), ...e);\n }), r(e));\n }\n function getSpecificSlots(t) {\n const e = cn(t);\n if (!e || e.branding !== i) {\n throw new TypeError(a);\n }\n return e;\n }\n return Object.defineProperties(Class.prototype, {\n ...t(e(bindMethod, s)),\n ...n(e(bindMethod, c)),\n ...o(\"Temporal.\" + i)\n }), Object.defineProperties(Class, {\n ...n(u),\n ...r(i)\n }), [ Class, t => {\n const e = Object.create(Class.prototype);\n return un(e, t), dbg(e, t, f), e;\n }, getSpecificSlots ];\n}\n\nfunction rejectInvalidBag(t) {\n if (cn(t) || void 0 !== t.calendar || void 0 !== t.timeZone) {\n throw new TypeError(i);\n }\n return t;\n}\n\nfunction dbg(t, e, n) {\n \"dbg\" === dbg.name && Object.defineProperty(t, \"o\", {\n value: n(e),\n writable: 0,\n enumerable: 0,\n configurable: 0\n });\n}\n\nfunction getCalendarIdFromBag(t) {\n return extractCalendarIdFromBag(t) || l;\n}\n\nfunction extractCalendarIdFromBag(t) {\n const {calendar: e} = t;\n if (void 0 !== e) {\n return refineCalendarArg(e);\n }\n}\n\nfunction refineCalendarArg(t) {\n if (s(t)) {\n const {calendar: e} = cn(t) || {};\n if (!e) {\n throw new TypeError(c(t));\n }\n return e;\n }\n return (t => u(f(d(t))))(t);\n}\n\nfunction createCalendarGetters(t) {\n const e = {};\n for (const n in t) {\n e[n] = t => {\n const {calendar: e} = t;\n return v(e)[n](t);\n };\n }\n return e;\n}\n\nfunction neverValueOf() {\n throw new TypeError(C);\n}\n\nfunction refineTimeZoneArg(t) {\n if (s(t)) {\n const {timeZone: e} = cn(t) || {};\n if (!e) {\n throw new TypeError(F(t));\n }\n return e;\n }\n return (t => Z(M(d(t))))(t);\n}\n\nfunction toDurationSlots(t) {\n if (s(t)) {\n const e = cn(t);\n return e && e.branding === A ? e : q(t);\n }\n return R(t);\n}\n\nfunction refinePublicRelativeTo(t) {\n if (void 0 !== t) {\n if (s(t)) {\n const e = cn(t) || {};\n switch (e.branding) {\n case _:\n case G:\n return e;\n\n case x:\n return W(e);\n }\n const n = getCalendarIdFromBag(t);\n return {\n ...z(refineTimeZoneArg, L, v(n), t),\n calendar: n\n };\n }\n return $(t);\n }\n}\n\nfunction toPlainTimeSlots(t, e) {\n if (s(t)) {\n const n = cn(t) || {};\n switch (n.branding) {\n case ft:\n return dt(e), n;\n\n case x:\n return dt(e), St(n);\n\n case _:\n return dt(e), mt(L, n);\n }\n return Tt(t, e);\n }\n const n = ht(t);\n return dt(e), n;\n}\n\nfunction optionalToPlainTimeFields(t) {\n return void 0 === t ? void 0 : toPlainTimeSlots(t);\n}\n\nfunction toPlainDateTimeSlots(t, e) {\n if (s(t)) {\n const n = cn(t) || {};\n switch (n.branding) {\n case x:\n return dt(e), n;\n\n case G:\n return dt(e), jt({\n ...n,\n ...At\n });\n\n case _:\n return dt(e), yt(L, n);\n }\n return Nt(v(getCalendarIdFromBag(t)), t, e);\n }\n const n = Bt(t);\n return dt(e), n;\n}\n\nfunction toPlainMonthDaySlots(t, e) {\n if (s(t)) {\n const n = cn(t);\n if (n && n.branding === qt) {\n return dt(e), n;\n }\n const o = extractCalendarIdFromBag(t);\n return Rt(v(o || l), !o, t, e);\n }\n const n = xt(v, t);\n return dt(e), n;\n}\n\nfunction toPlainYearMonthSlots(t, e) {\n if (s(t)) {\n const n = cn(t);\n return n && n.branding === Qt ? (dt(e), n) : Ut(v(getCalendarIdFromBag(t)), t, e);\n }\n const n = Xt(v, t);\n return dt(e), n;\n}\n\nfunction toPlainDateSlots(t, e) {\n if (s(t)) {\n const n = cn(t) || {};\n switch (n.branding) {\n case G:\n return dt(e), n;\n\n case x:\n return dt(e), W(n);\n\n case _:\n return dt(e), fe(L, n);\n }\n return de(v(getCalendarIdFromBag(t)), t, e);\n }\n const n = me(t);\n return dt(e), n;\n}\n\nfunction toZonedDateTimeSlots(t, e) {\n if (s(t)) {\n const n = cn(t);\n if (n && n.branding === _) {\n return je(e), n;\n }\n const o = getCalendarIdFromBag(t);\n return Ae(refineTimeZoneArg, L, v(o), o, t, e);\n }\n return Ne(t, e);\n}\n\nfunction adaptDateMethods(t) {\n return e((t => e => t(slotsToIso(e))), t);\n}\n\nfunction slotsToIso(t) {\n return he(t, L);\n}\n\nfunction toInstantSlots(t) {\n if (s(t)) {\n const e = cn(t);\n if (e) {\n switch (e.branding) {\n case Re:\n return e;\n\n case _:\n return xe(e.epochNanoseconds);\n }\n }\n }\n return We(t);\n}\n\nfunction toTemporalInstant() {\n const t = Date.prototype.valueOf.call(this);\n return Hn(xe(Ge(_e(t), Ke)));\n}\n\nfunction createDateTimeFormatClass() {\n function DateTimeFormatFunc(t, e) {\n return new DateTimeFormatNew(t, e);\n }\n function DateTimeFormatNew(t, e = Object.create(null)) {\n to.set(this, ((t, e) => {\n const n = new en(t, e), o = n.resolvedOptions(), r = o.locale, a = nn(Object.keys(e), o), i = on(createFormatPrepperForBranding), prepFormat = (t, ...e) => {\n if (t) {\n if (2 !== e.length) {\n throw new TypeError(ln);\n }\n for (const t of e) {\n if (void 0 === t) {\n throw new TypeError(ln);\n }\n }\n }\n t || void 0 !== e[0] || (e = []);\n const o = e.map((t => cn(t) || Number(t)));\n let l, s = 0;\n for (const t of o) {\n const e = \"object\" == typeof t ? t.branding : void 0;\n if (s++ && e !== l) {\n throw new TypeError(ln);\n }\n l = e;\n }\n return l ? i(l)(r, a, ...o) : [ n, ...o ];\n };\n return prepFormat.i = n, prepFormat;\n })(t, e));\n }\n const t = en.prototype, e = Object.getOwnPropertyDescriptors(t), n = Object.getOwnPropertyDescriptors(en);\n for (const t in e) {\n const n = e[t], o = t.startsWith(\"format\") && createFormatMethod(t);\n \"function\" == typeof n.value ? n.value = \"constructor\" === t ? DateTimeFormatFunc : o || createProxiedMethod(t) : o && (n.get = function() {\n if (!to.has(this)) {\n throw new TypeError(a);\n }\n return (...t) => o.apply(this, t);\n }, Object.defineProperties(n.get, r(`get ${t}`)));\n }\n return n.prototype.value = DateTimeFormatNew.prototype = Object.create({}, e), Object.defineProperties(DateTimeFormatFunc, n), \n DateTimeFormatFunc;\n}\n\nfunction createFormatMethod(t) {\n return Object.defineProperties((function(...e) {\n const n = to.get(this), [o, ...r] = n(t.includes(\"Range\"), ...e);\n return o[t](...r);\n }), r(t));\n}\n\nfunction createProxiedMethod(t) {\n return Object.defineProperties((function(...e) {\n return to.get(this).i[t](...e);\n }), r(t));\n}\n\nfunction createFormatPrepperForBranding(t) {\n const e = vn[t];\n if (!e) {\n throw new TypeError(rn(t));\n }\n return K(e, on(an), 1);\n}\n\nimport { createGetterDescriptors as t, mapProps as e, createPropDescriptors as n, createStringTagDescriptors as o, createNameDescriptors as r, invalidCallingContext as a, invalidBag as i, isoCalendarId as l, isObjectLike as s, invalidCalendar as c, resolveCalendarId as u, parseCalendarId as f, requireString as d, requireStringOrUndefined as m, requireIntegerOrUndefined as S, requireInteger as T, requirePositiveInteger as h, requireBoolean as D, requirePositiveIntegerOrUndefined as g, mapPropNames as P, durationFieldNamesAsc as O, timeFieldNamesAsc as p, isoTimeFieldNamesAsc as w, getEpochMilli as I, getEpochNano as b, createNativeStandardOps as v, forbiddenValueOf as C, invalidTimeZone as F, resolveTimeZoneId as Z, parseTimeZoneId as M, getDurationBlank as y, constructDurationSlots as j, DurationBranding as A, durationWithFields as N, negateDuration as B, absDuration as Y, addDurations as E, queryNativeTimeZone as L, roundDuration as V, totalDuration as J, formatDurationIso as k, refineDurationBag as q, parseDuration as R, PlainDateTimeBranding as x, createPlainDateSlots as W, PlainDateBranding as G, ZonedDateTimeBranding as _, refineMaybeZonedDateTimeBag as z, parseRelativeToSlots as $, compareDurations as H, createFormatPrepper as K, instantConfig as Q, dateTimeConfig as U, dateConfig as X, timeConfig as tt, yearMonthConfig as et, monthDayConfig as nt, zonedConfig as ot, plainTimeWithFields as rt, movePlainTime as at, diffPlainTimes as it, roundPlainTime as lt, plainTimesEqual as st, formatPlainTimeIso as ct, constructPlainTimeSlots as ut, PlainTimeBranding as ft, refineOverflowOptions as dt, zonedDateTimeToPlainTime as mt, createPlainTimeSlots as St, refinePlainTimeBag as Tt, parsePlainTime as ht, compareIsoTimeFields as Dt, bindArgs as gt, plainDateTimeWithFields as Pt, slotsWithCalendarId as Ot, plainDateTimeWithPlainTime as pt, movePlainDateTime as wt, diffPlainDateTimes as It, roundPlainDateTime as bt, plainDateTimesEqual as vt, plainDateTimeToZonedDateTime as Ct, formatPlainDateTimeIso as Ft, refineCalendarId as Zt, constructPlainDateTimeSlots as Mt, zonedDateTimeToPlainDateTime as yt, createPlainDateTimeSlots as jt, isoTimeFieldDefaults as At, refinePlainDateTimeBag as Nt, parsePlainDateTime as Bt, compareIsoDateTimeFields as Yt, plainMonthDayWithFields as Et, plainMonthDaysEqual as Lt, plainMonthDayToPlainDate as Vt, formatPlainMonthDayIso as Jt, constructPlainMonthDaySlots as kt, PlainMonthDayBranding as qt, refinePlainMonthDayBag as Rt, parsePlainMonthDay as xt, plainYearMonthWithFields as Wt, movePlainYearMonth as Gt, diffPlainYearMonth as _t, plainYearMonthsEqual as zt, plainYearMonthToPlainDate as $t, formatPlainYearMonthIso as Ht, constructPlainYearMonthSlots as Kt, PlainYearMonthBranding as Qt, refinePlainYearMonthBag as Ut, parsePlainYearMonth as Xt, compareIsoDateFields as te, plainDateWithFields as ee, movePlainDate as ne, diffPlainDates as oe, plainDatesEqual as re, plainDateToZonedDateTime as ae, plainDateToPlainDateTime as ie, plainDateToPlainYearMonth as le, plainDateToPlainMonthDay as se, formatPlainDateIso as ce, constructPlainDateSlots as ue, zonedDateTimeToPlainDate as fe, refinePlainDateBag as de, parsePlainDate as me, formatOffsetNano as Se, computeZonedHoursInDay as Te, zonedEpochSlotsToIso as he, zonedDateTimeWithFields as De, slotsWithTimeZoneId as ge, zonedDateTimeWithPlainTime as Pe, moveZonedDateTime as Oe, createDurationSlots as pe, diffZonedDateTimes as we, roundZonedDateTime as Ie, computeZonedStartOfDay as be, zonedDateTimesEqual as ve, zonedDateTimeToInstant as Ce, formatZonedDateTimeIso as Fe, refineDirectionOptions as Ze, refineTimeZoneId as Me, constructZonedDateTimeSlots as ye, refineZonedFieldOptions as je, refineZonedDateTimeBag as Ae, parseZonedDateTime as Ne, compareZonedDateTimes as Be, moveInstant as Ye, diffInstants as Ee, roundInstant as Le, instantsEqual as Ve, instantToZonedDateTime as Je, formatInstantIso as ke, constructInstantSlots as qe, InstantBranding as Re, createInstantSlots as xe, parseInstant as We, numberToBigNano as Ge, requireNumberIsInteger as _e, epochMilliToInstant as ze, epochNanoToInstant as $e, compareInstants as He, nanoInMilli as Ke, getCurrentTimeZoneId as Qe, getCurrentEpochNano as Ue, createZonedDateTimeSlots as Xe, getCurrentIsoDateTime as tn, RawDateTimeFormat as en, pluckProps as nn, memoize as on, invalidFormatType as rn, createFormatForPrep as an, mismatchingFormatTypes as ln } from \"./internal.js\";\n\nconst sn = /*@__PURE__*/ new WeakMap, cn = /*@__PURE__*/ sn.get.bind(sn), un = /*@__PURE__*/ sn.set.bind(sn), fn = {\n era: m,\n eraYear: S,\n year: T,\n month: h,\n daysInMonth: h,\n daysInYear: h,\n inLeapYear: D,\n monthsInYear: h\n}, dn = {\n monthCode: d\n}, mn = {\n day: h\n}, Sn = {\n dayOfWeek: h,\n dayOfYear: h,\n weekOfYear: g,\n yearOfWeek: S,\n daysInWeek: h\n}, Tn = /*@__PURE__*/ createCalendarGetters(/*@__PURE__*/ Object.assign({}, fn, dn, mn, Sn)), hn = /*@__PURE__*/ createCalendarGetters({\n ...fn,\n ...dn\n}), Dn = /*@__PURE__*/ createCalendarGetters({\n ...dn,\n ...mn\n}), gn = {\n calendarId: t => t.calendar\n}, Pn = /*@__PURE__*/ P((t => e => e[t]), O.concat(\"sign\")), On = /*@__PURE__*/ P(((t, e) => t => t[w[e]]), p), pn = {\n epochMilliseconds: I,\n epochNanoseconds: b\n}, [wn, In, bn] = createSlotClass(A, j, {\n ...Pn,\n blank: y\n}, {\n with: (t, e) => In(N(t, e)),\n negated: t => In(B(t)),\n abs: t => In(Y(t)),\n add: (t, e, n) => In(E(refinePublicRelativeTo, v, L, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => In(E(refinePublicRelativeTo, v, L, 1, t, toDurationSlots(e), n)),\n round: (t, e) => In(V(refinePublicRelativeTo, v, L, t, e)),\n total: (t, e) => J(refinePublicRelativeTo, v, L, t, e),\n toLocaleString(t, e, n) {\n return Intl.DurationFormat ? new Intl.DurationFormat(e, n).format(this) : k(t);\n },\n toString: k,\n toJSON: t => k(t),\n valueOf: neverValueOf\n}, {\n from: t => In(toDurationSlots(t)),\n compare: (t, e, n) => H(refinePublicRelativeTo, v, L, toDurationSlots(t), toDurationSlots(e), n)\n}, k), vn = {\n Instant: Q,\n PlainDateTime: U,\n PlainDate: X,\n PlainTime: tt,\n PlainYearMonth: et,\n PlainMonthDay: nt\n}, Cn = /*@__PURE__*/ K(Q), Fn = /*@__PURE__*/ K(ot), Zn = /*@__PURE__*/ K(U), Mn = /*@__PURE__*/ K(X), yn = /*@__PURE__*/ K(tt), jn = /*@__PURE__*/ K(et), An = /*@__PURE__*/ K(nt), [Nn, Bn] = createSlotClass(ft, ut, On, {\n with(t, e, n) {\n return Bn(rt(this, rejectInvalidBag(e), n));\n },\n add: (t, e) => Bn(at(0, t, toDurationSlots(e))),\n subtract: (t, e) => Bn(at(1, t, toDurationSlots(e))),\n until: (t, e, n) => In(it(0, t, toPlainTimeSlots(e), n)),\n since: (t, e, n) => In(it(1, t, toPlainTimeSlots(e), n)),\n round: (t, e) => Bn(lt(t, e)),\n equals: (t, e) => st(t, toPlainTimeSlots(e)),\n toLocaleString(t, e, n) {\n const [o, r] = yn(e, n, t);\n return o.format(r);\n },\n toString: ct,\n toJSON: t => ct(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => Bn(toPlainTimeSlots(t, e)),\n compare: (t, e) => Dt(toPlainTimeSlots(t), toPlainTimeSlots(e))\n}, ct), [Yn, En] = createSlotClass(x, gt(Mt, Zt), {\n ...gn,\n ...Tn,\n ...On\n}, {\n with: (t, e, n) => En(Pt(v, t, rejectInvalidBag(e), n)),\n withCalendar: (t, e) => En(Ot(t, refineCalendarArg(e))),\n withPlainTime: (t, e) => En(pt(t, optionalToPlainTimeFields(e))),\n add: (t, e, n) => En(wt(v, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => En(wt(v, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(It(v, 0, t, toPlainDateTimeSlots(e), n)),\n since: (t, e, n) => In(It(v, 1, t, toPlainDateTimeSlots(e), n)),\n round: (t, e) => En(bt(t, e)),\n equals: (t, e) => vt(t, toPlainDateTimeSlots(e)),\n toZonedDateTime: (t, e, n) => zn(Ct(L, t, refineTimeZoneArg(e), n)),\n toPlainDate: t => Wn(W(t)),\n toPlainTime: t => Bn(St(t)),\n toLocaleString(t, e, n) {\n const [o, r] = Zn(e, n, t);\n return o.format(r);\n },\n toString: Ft,\n toJSON: t => Ft(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => En(toPlainDateTimeSlots(t, e)),\n compare: (t, e) => Yt(toPlainDateTimeSlots(t), toPlainDateTimeSlots(e))\n}, Ft), [Ln, Vn, Jn] = createSlotClass(qt, gt(kt, Zt), {\n ...gn,\n ...Dn\n}, {\n with: (t, e, n) => Vn(Et(v, t, rejectInvalidBag(e), n)),\n equals: (t, e) => Lt(t, toPlainMonthDaySlots(e)),\n toPlainDate(t, e) {\n return Wn(Vt(v, t, this, e));\n },\n toLocaleString(t, e, n) {\n const [o, r] = An(e, n, t);\n return o.format(r);\n },\n toString: Jt,\n toJSON: t => Jt(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => Vn(toPlainMonthDaySlots(t, e))\n}, Jt), [kn, qn, Rn] = createSlotClass(Qt, gt(Kt, Zt), {\n ...gn,\n ...hn\n}, {\n with: (t, e, n) => qn(Wt(v, t, rejectInvalidBag(e), n)),\n add: (t, e, n) => qn(Gt(v, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => qn(Gt(v, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(_t(v, 0, t, toPlainYearMonthSlots(e), n)),\n since: (t, e, n) => In(_t(v, 1, t, toPlainYearMonthSlots(e), n)),\n equals: (t, e) => zt(t, toPlainYearMonthSlots(e)),\n toPlainDate(t, e) {\n return Wn($t(v, t, this, e));\n },\n toLocaleString(t, e, n) {\n const [o, r] = jn(e, n, t);\n return o.format(r);\n },\n toString: Ht,\n toJSON: t => Ht(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => qn(toPlainYearMonthSlots(t, e)),\n compare: (t, e) => te(toPlainYearMonthSlots(t), toPlainYearMonthSlots(e))\n}, Ht), [xn, Wn, Gn] = createSlotClass(G, gt(ue, Zt), {\n ...gn,\n ...Tn\n}, {\n with: (t, e, n) => Wn(ee(v, t, rejectInvalidBag(e), n)),\n withCalendar: (t, e) => Wn(Ot(t, refineCalendarArg(e))),\n add: (t, e, n) => Wn(ne(v, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => Wn(ne(v, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(oe(v, 0, t, toPlainDateSlots(e), n)),\n since: (t, e, n) => In(oe(v, 1, t, toPlainDateSlots(e), n)),\n equals: (t, e) => re(t, toPlainDateSlots(e)),\n toZonedDateTime(t, e) {\n const n = s(e) ? e : {\n timeZone: e\n };\n return zn(ae(refineTimeZoneArg, toPlainTimeSlots, L, t, n));\n },\n toPlainDateTime: (t, e) => En(ie(t, optionalToPlainTimeFields(e))),\n toPlainYearMonth(t) {\n return qn(le(v, t, this));\n },\n toPlainMonthDay(t) {\n return Vn(se(v, t, this));\n },\n toLocaleString(t, e, n) {\n const [o, r] = Mn(e, n, t);\n return o.format(r);\n },\n toString: ce,\n toJSON: t => ce(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => Wn(toPlainDateSlots(t, e)),\n compare: (t, e) => te(toPlainDateSlots(t), toPlainDateSlots(e))\n}, ce), [_n, zn] = createSlotClass(_, gt(ye, Zt, Me), {\n ...pn,\n ...gn,\n ...adaptDateMethods(Tn),\n ...adaptDateMethods(On),\n offset: t => Se(slotsToIso(t).offsetNanoseconds),\n offsetNanoseconds: t => slotsToIso(t).offsetNanoseconds,\n timeZoneId: t => t.timeZone,\n hoursInDay: t => Te(L, t)\n}, {\n with: (t, e, n) => zn(De(v, L, t, rejectInvalidBag(e), n)),\n withCalendar: (t, e) => zn(Ot(t, refineCalendarArg(e))),\n withTimeZone: (t, e) => zn(ge(t, refineTimeZoneArg(e))),\n withPlainTime: (t, e) => zn(Pe(L, t, optionalToPlainTimeFields(e))),\n add: (t, e, n) => zn(Oe(v, L, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => zn(Oe(v, L, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(pe(we(v, L, 0, t, toZonedDateTimeSlots(e), n))),\n since: (t, e, n) => In(pe(we(v, L, 1, t, toZonedDateTimeSlots(e), n))),\n round: (t, e) => zn(Ie(L, t, e)),\n startOfDay: t => zn(be(L, t)),\n equals: (t, e) => ve(t, toZonedDateTimeSlots(e)),\n toInstant: t => Hn(Ce(t)),\n toPlainDateTime: t => En(yt(L, t)),\n toPlainDate: t => Wn(fe(L, t)),\n toPlainTime: t => Bn(mt(L, t)),\n toLocaleString(t, e, n = {}) {\n const [o, r] = Fn(e, n, t);\n return o.format(r);\n },\n toString: (t, e) => Fe(L, t, e),\n toJSON: t => Fe(L, t),\n valueOf: neverValueOf,\n getTimeZoneTransition(t, e) {\n const {timeZone: n, epochNanoseconds: o} = t, r = Ze(e), a = L(n).l(o, r);\n return a ? zn({\n ...t,\n epochNanoseconds: a\n }) : null;\n }\n}, {\n from: (t, e) => zn(toZonedDateTimeSlots(t, e)),\n compare: (t, e) => Be(toZonedDateTimeSlots(t), toZonedDateTimeSlots(e))\n}, (t => Fe(L, t))), [$n, Hn, Kn] = createSlotClass(Re, qe, pn, {\n add: (t, e) => Hn(Ye(0, t, toDurationSlots(e))),\n subtract: (t, e) => Hn(Ye(1, t, toDurationSlots(e))),\n until: (t, e, n) => In(Ee(0, t, toInstantSlots(e), n)),\n since: (t, e, n) => In(Ee(1, t, toInstantSlots(e), n)),\n round: (t, e) => Hn(Le(t, e)),\n equals: (t, e) => Ve(t, toInstantSlots(e)),\n toZonedDateTimeISO: (t, e) => zn(Je(t, refineTimeZoneArg(e))),\n toLocaleString(t, e, n) {\n const [o, r] = Cn(e, n, t);\n return o.format(r);\n },\n toString: (t, e) => ke(refineTimeZoneArg, L, t, e),\n toJSON: t => ke(refineTimeZoneArg, L, t),\n valueOf: neverValueOf\n}, {\n from: t => Hn(toInstantSlots(t)),\n fromEpochMilliseconds: t => Hn(ze(t)),\n fromEpochNanoseconds: t => Hn($e(t)),\n compare: (t, e) => He(toInstantSlots(t), toInstantSlots(e))\n}, (t => ke(refineTimeZoneArg, L, t))), Qn = /*@__PURE__*/ Object.defineProperties({}, {\n ...o(\"Temporal.Now\"),\n ...n({\n timeZoneId: () => Qe(),\n instant: () => Hn(xe(Ue())),\n zonedDateTimeISO: (t = Qe()) => zn(Xe(Ue(), refineTimeZoneArg(t), l)),\n plainDateTimeISO: (t = Qe()) => En(jt(tn(L(refineTimeZoneArg(t))), l)),\n plainDateISO: (t = Qe()) => Wn(W(tn(L(refineTimeZoneArg(t))), l)),\n plainTimeISO: (t = Qe()) => Bn(St(tn(L(refineTimeZoneArg(t)))))\n })\n}), Un = /*@__PURE__*/ Object.defineProperties({}, {\n ...o(\"Temporal\"),\n ...n({\n PlainYearMonth: kn,\n PlainMonthDay: Ln,\n PlainDate: xn,\n PlainTime: Nn,\n PlainDateTime: Yn,\n ZonedDateTime: _n,\n Instant: $n,\n Duration: wn,\n Now: Qn\n })\n}), Xn = /*@__PURE__*/ createDateTimeFormatClass(), to = /*@__PURE__*/ new WeakMap, eo = /*@__PURE__*/ Object.defineProperties(Object.create(Intl), n({\n DateTimeFormat: Xn\n}));\n\nexport { Xn as DateTimeFormat, eo as IntlExtended, Un as 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 if (isNaN(time)) {\n return null;\n }\n let calculatedTime = time;\n let cal = this.getAdjustedDate();\n // let cal = new Temporal.PlainDate(adj.year, adj.month, adj.day);\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 if (isSunrise && localTimeHours + hours > 18) {\n cal = cal.add({ days: -1 });\n // cal = cal.minus({days: 1});\n }\n else if (!isSunrise && localTimeHours + hours < 6) {\n cal = cal.add({ days: 1 });\n }\n return cal\n .toZonedDateTime({\n timeZone: 'UTC',\n plainTime: new Temporal.PlainTime(hours, minutes, seconds, Math.trunc(calculatedTime * 1000)),\n })\n .withTimeZone(this.geoLocation.getTimeZone());\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//# sourceMappingURL=index.js.map","import { Temporal as Un, DateTimeFormat as Xn, toTemporalInstant as tj } from \"./chunks/classApi.js\";\n\nimport { createPropDescriptors as n } from \"./chunks/internal.js\";\n\nObject.defineProperties(globalThis, n({\n Temporal: Un\n})), Object.defineProperties(Intl, n({\n DateTimeFormat: Xn\n})), Object.defineProperties(Date.prototype, n({\n toTemporalInstant: tj\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';\n\nconst classicCities0: [string, string, number, number, string, number][] = [\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 [\n 'Buenos Aires',\n 'AR',\n -34.61315,\n -58.37723,\n 'America/Argentina/Buenos_Aires',\n 31,\n ],\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], // -11\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], // -15\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], // -140\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];\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 Map<string, Intl.DateTimeFormat>();\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\n/** Class representing Location */\nexport class Location extends GeoLocation {\n private readonly il: boolean;\n private readonly cc?: string;\n private readonly geoid?: string | number;\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 =\n 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 this.geoid = geoid;\n }\n\n getIsrael(): boolean {\n return this.il;\n }\n\n getName(): string | null {\n return this.getLocationName();\n }\n\n /**\n * Returns the location name, up to the first comma\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 } else 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 getCountryCode(): string | undefined {\n return this.cc;\n }\n\n getTzid(): string {\n return this.getTimeZone();\n }\n\n /**\n * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location\n */\n getTimeFormatter(): Intl.DateTimeFormat {\n return getFormatter(this.getTimeZone());\n }\n\n getGeoId(): string | number | undefined {\n return this.geoid;\n }\n\n /**\n * Creates a location object from one of 60 \"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 * @param name\n */\n static lookup(name: string): Location | undefined {\n return classicCities.get(name.toLowerCase());\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n\n /**\n * Converts legacy Hebcal timezone to a standard Olson tzid.\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 } else {\n const plus = tz > 0 ? '+' : '';\n return `Etc/GMT${plus}${tz}`;\n }\n } else if (tz === 2 && dst === 'israel') {\n return 'Asia/Jerusalem';\n } else 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 } else 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 } else if (tz === 7 && state === 'AZ') {\n return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';\n } else {\n return ZIPCODES_TZ_MAP[tz];\n }\n }\n\n /**\n * Adds a location name for `Location.lookup()` only if the name isn't\n * already being used. Returns `false` if the name is already taken\n * and `true` if successfully added.\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\nfor (const city of classicCities0) {\n const location = new Location(\n city[2],\n city[3],\n city[1] === 'IL',\n city[4],\n city[0],\n city[1],\n undefined,\n city[5]\n );\n Location.addLocation(city[0], location);\n}\n","import {CalOptions} from './CalOptions';\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 * @private\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\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string')\n 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\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';\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 <a\n * href=\"https://en.wikipedia.org/wiki/Standard_time\">standard time</a>. The globe is split into 360&deg;, with\n * 15&deg; per hour of the day. For a local that is at a longitude that is evenly divisible by 15 (longitude % 15 ==\n * 0), at solar {@link com.kosherjava.zmanim.AstronomicalCalendar#getSunTransit() noon} (with adjustment for the <a\n * href=\"https://en.wikipedia.org/wiki/Equation_of_time\">equation of time</a>) the sun should be directly overhead,\n * so a user who is 1&deg; west of this will have noon at 4 minutes after standard time noon, and conversely, a user\n * who is 1&deg; east of the 15&deg; 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&deg;. 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 <a\n * href=\"https://en.wikipedia.org/wiki/Daylight_saving_time\">Daylight saving time</a> offset since this class is\n * unaware of dates.\n *\n * @return the offset in milliseconds not accounting for Daylight saving time. A positive value will be returned\n * East of the 15&deg; timezone line, and a negative value West of it.\n */\nfunction getLocalMeanTimeOffset(\n dt: Date,\n longitude: number,\n tzid: string\n): 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 molad in UTC as a Temporal.ZonedDateTime.\n * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude\n * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method\n * intentionally uses standard time and not daylight savings time.\n *\n * @return the ZonedDateTime representing the moment of the molad in UTC\n\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","import 'temporal-polyfill/global';\nimport {Event, flags} from './event';\nimport {CalOptions} from './CalOptions';\nimport {HDate, Locale, pad2} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {MoladBase, calculateMolad} from './moladBase';\nimport {getMoladAsDate} from './moladDate';\nimport './locale'; // 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 === 'he' || locale === 'he-x-nonikud' || locale === 'h') {\n return heDayNames;\n } else if (locale === 'fr') {\n return frDoW;\n }\n return enDoW;\n}\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n else if (hour < 12) return 'בַּבֹּקֶר';\n else if (hour < 17) return 'בַּצׇּהֳרַיִים';\n else if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a molad, the moment when the new moon is \"born\"\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 Hebrew month\n * @param year\n * @param month 1=NISSAN, 7=TISHREI\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 molad in Standard Time in Yerushalayim as a Temporal.ZonedDateTime.\n * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude\n * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method\n * intentionally uses standard time and not daylight savings time.\n *\n * @return the Temporal.ZonedDateTime representing the moment of the molad in Yerushalayim standard time (GMT + 2)\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 <a\n * href=\"https://en.wikipedia.org/wiki/Yosef_Karo\">Mechaber</a>. See the <a\n * href=\"https://en.wikipedia.org/wiki/Yoel_Sirkis\">Bach's</a> 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 <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> 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 * <a href=\"https://en.wikipedia.org/wiki/Moses_Isserles\">Rema</a> who brings down the opinion of the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> of calculating\n * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} 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 <a\n * href=\"https://www.worldcat.org/oclc/461326125\">Shaarei Zmanim</a>. 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 * @param [locale] Optional locale name (defaults to empty locale)\n * @param options\n */\n render(locale?: string, options?: CalOptions): string {\n locale = locale ?? 'en';\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\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 (isHebrewLocale) {\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 === '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 = monthName.replace(/'/g, '’');\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 {\n HDate,\n getPseudoISO,\n getTimezoneOffset,\n isDate,\n pad2,\n} from '@hebcal/hdate';\nimport {Molad} from './molad';\n\n/**\n * @private\n */\nfunction zdtToDate(zdt: Temporal.ZonedDateTime | null): Date {\n if (zdt === null) {\n return new Date(NaN);\n }\n const res = new Date(zdt.epochMilliseconds);\n res.setMilliseconds(0);\n return res;\n}\n\nfunction getDate(date: Date | HDate): Date {\n if (isDate(date)) return date as Date;\n if (HDate.isHDate(date)) return (date as HDate).greg();\n throw new TypeError(`invalid date: ${date}`);\n}\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;\n */\nconst GEOMETRIC_ZENITH: number = 90;\n\n/**\n * The zenith of 1.583&deg; below {@link GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>.\n *\n * @see Zmanim.sunriseBaalHatanya()\n * @see Zmanim.sunsetBaalHatanya()\n */\nconst ZENITH_1_POINT_583: number = GEOMETRIC_ZENITH + 1.583;\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 * const {GeoLocation, Zmanim} = require('@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 */\nexport class Zmanim {\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 const dt = getDate(date);\n this.plainDate = Temporal.PlainDate.from({\n year: dt.getFullYear(),\n month: dt.getMonth() + 1,\n day: 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 elevation adjustment is enabled\n * for zmanim support elevation adjustment\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for zmanim support elevation adjustment\n * @param useElevation\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\n * @param rising\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = GEOMETRIC_ZENITH + angle;\n const zdt = rising\n ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)\n : this.noaa.getSunsetOffsetByDegrees(offsetZenith);\n return zdtToDate(zdt);\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 const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\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 const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getBeginCivilTwilight();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getEndCivilTwilight();\n return zdtToDate(zdt);\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 * @private\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 chatzot(): Date {\n const startOfDay = this.noaa.getSeaLevelSunrise();\n const endOfDay = this.noaa.getSeaLevelSunset();\n const zdt = this.noaa.getSunTransit(startOfDay, endOfDay);\n return zdtToDate(zdt);\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 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 getShaahZmanisBasedZmanZdt(\n startOfDay: Temporal.ZonedDateTime | null,\n endOfDay: Temporal.ZonedDateTime | null,\n hours: number\n ): Temporal.ZonedDateTime | null {\n const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);\n const offset = Math.trunc(temporalHour * hours);\n const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);\n return zdt;\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @private\n * @param hours\n */\n private getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n const endOfDay = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n const zdt = this.getShaahZmanisBasedZmanZdt(startOfDay, endOfDay, hours);\n return zdtToDate(zdt);\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 shema in the morning)\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 <a href=\"https://en.wikipedia.org/wiki/Vilna_Gaon\">GRA</a>. This time is 5 hours into the day based on the\n * opinion of the <a href=\"https://en.wikipedia.org/wiki/Vilna_Gaon\">GRA</a> that the day is calculated from\n * sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea\n * level sunrise}.\n * @return the <code>Date</code> of the latest time for burning _chametz_ on _Erev Pesach_. If it is not\n * _erev Pesach_ or the calculation can't be computed such as in the Arctic Circle where there is at least\n * one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be\n * returned.\n */\n sofZmanBiurChametzGRA(): Date {\n return this.getShaahZmanisBasedZman(5);\n }\n /**\n * Returns an array with alot (Date) and ms in hour (number)\n * @private\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 an array with alot (Date) and ms in hour (number)\n * @private\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 the latest 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 * @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 * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\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 private getHDate(): HDate {\n const dt = new Date(\n this.plainDate.year,\n this.plainDate.month - 1,\n this.plainDate.day\n );\n return new HDate(dt);\n }\n\n /**\n * Returns the latest time of Kiddush Levana according to the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> 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 * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between\n * _tzais_ and _alos_, see {@link getSofZmanKidushLevanaBetweenMoldos}.\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 Date representing the moment halfway between molad and molad. If the time occurs between\n * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this\n * day, a `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.getHDate();\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 * <a href=\"https://en.wikipedia.org/wiki/Moses_Isserles\">Rema</a> who brings down the opinion of the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> 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 the subject,\n * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href=\"https://hebrewbooks.org/53000\">Shaarei\n * Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to\n * between _tzais_ and _alos_, see {@link getSofZmanKidushLevana15Days}.\n *\n * @return the Date representing the moment 15 days after the _molad_. If the time occurs between\n * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a\n * `null` will be returned.\n *\n *\n */\n public getSofZmanKidushLevana15Days(\n alos: Temporal.ZonedDateTime | null = null,\n tzais: Temporal.ZonedDateTime | null = null\n ): Temporal.ZonedDateTime | null {\n const hd = this.getHDate();\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 <a href=\n * \"https://en.wikipedia.org/wiki/Yonah_Gerondi\">Rabbeinu Yonah</a>'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 Date representing the moment 3 days after the molad. If the time occurs between _alos_ and\n * _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a\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.getHDate();\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 _Molad_ as a <code>Date</code> Object. For the traditional day of week, hour,\n * minute and chalakim, {@link Molad.getInstant()} and the not yet completed\n * {@link HebrewDateFormatter} that will have formatting for this.\n *\n * @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a\n * `null` will be returned.\n *\n */\n public getZmanMolad(): Temporal.ZonedDateTime | null {\n const hd = this.getHDate();\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. Use {@link getTchilasZmanKidushLevana7Days} if you want to limit the time to night hours.\n *\n * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_\n * will not occur on this day, a `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.getHDate();\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 <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>'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&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom\n * DovBer Levine's commentary on The <a href=\"https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf\">Baal\n * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=\n * \"https://en.wikipedia.org/wiki/Mount_Carmel\">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;\n * below the sea level horizon. This in turn is based on the Gemara <a href=\n * \"https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35\">Shabbos 35a</a>. 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&deg;. This is identical to the 1&deg; 35' _zman_\n * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=\n * \"https://en.wikipedia.org/wiki/Chabad\">Chabad</a> calendars that use the Baal Hatanya's _zmanim_. See\n * <a href=\"https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm\">About Our\n * _Zmanim_ Calculations @ Chabad.org</a>.\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 <code>Date</code> representing 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, a `null` will be returned. See detailed explanation on top of the page.\n *\n * @see ZENITH_1_POINT_583\n */\n private getSunriseBaalHatanya(): Temporal.ZonedDateTime | null {\n return this.noaa.getSunriseOffsetByDegrees(ZENITH_1_POINT_583);\n }\n\n /**\n * A method that returns the <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>'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 * <a href=\"https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm\">About Our\n * _Zmanim_ Calculations @ Chabad.org</a>.\n *\n * @return the <code>Date</code> representing 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, a `null` will be returned.\n *\n * @see ZENITH_1_POINT_583\n */\n private getSunsetBaalHatanya(): Temporal.ZonedDateTime | null {\n return this.noaa.getSunsetOffsetByDegrees(ZENITH_1_POINT_583);\n }\n\n /**\n * Returns the <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>'s _alos_\n * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link GEOMETRIC_ZENITH geometric horizon}\n * before {@link getSunrise() sunrise}.\n *\n * The zenith of 16.9&deg; below is based on the calculation that the time between dawn\n * and _netz amiti_ (sunrise) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes\n * a mil (<a href=\"https://en.wikipedia.org/wiki/Maimonides\">Rambam</a> and others). The sun's position at 72\n * minutes before {@link getSunriseBaalHatanya _netz amiti_ (sunrise)} in Jerusalem <a href=\n * \"https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\">around the equinox / equilux</a> is\n * 16.9&deg; below {@link GEOMETRIC_ZENITH geometric zenith}.\n *\n * @return The <code>Date</code> of dawn. If the calculation can't be computed such as 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, a `null` will be returned. */\n public alosBaalHatanya(): Date {\n return this.timeAtAngle(16.9, true);\n }\n\n private getShaahZmanisBaalHatanya(hours: number): Date {\n const zdt = this.getShaahZmanisBasedZmanZdt(\n this.getSunriseBaalHatanya(),\n this.getSunsetBaalHatanya(),\n hours\n );\n return zdtToDate(zdt);\n }\n\n /**\n * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3\n * {@link shaahZmanisBaalHatanya() _shaos zmaniyos_} (solar hours) after {@link getSunriseBaalHatanya()\n * _netz amiti_ (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from\n * sunrise to sunset. This returns the time 3 * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya()\n * _netz amiti_ (sunrise)}.\n *\n * @return the <code>Date</code> 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, a `null` 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 * hours into the day based on the opinion of the Baal Hatanya that the day is\n * calculated from sunrise to sunset. This returns the time 4 * {@link getShaahZmanisBaalHatanya()} after\n * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.\n *\n * @return the <code>Date</code> 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, a `null` 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 <a href=\"https://en.wikipedia.org/wiki/Maimonides\">Rambam</a> is of the opinion that it is\n * better to delay _mincha_ until {@link minchaKetanaBaalHatanya() _mincha ketana_} while the\n * <a href=\"https://en.wikipedia.org/wiki/Asher_ben_Jehiel\">Ra\"sh</a>,\n * <a href=\"https://en.wikipedia.org/wiki/Jacob_ben_Asher\">Tur</a>, <a href=\n * \"https://en.wikipedia.org/wiki/Vilna_Gaon\">GRA</a> and others are of the opinion that _mincha_ can be prayed\n * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 {@link getShaahZmanisBaalHatanya()\n * sea level solar hours} after {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}. This calculation is based\n * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5\n * * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya() _netz amiti_ (\"real\" sunrise)}.\n * @return the <code>Date</code> 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, a `null` 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 <a href=\"https://en.wikipedia.org/wiki/Maimonides\">Rambam</a> 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 {@link getSunriseBaalHatanya\n * _netz amiti_ (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the\n * day is calculated from sunrise to sunset. This returns the time 9.5 * after\n * _netz amiti_ (sunrise).\n *\n * @return the <code>Date</code> 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, a `null` 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 hours after sunrise. This\n * calculation is based on the opinion of the Baal Hatanya that the day is calculated\n * from sunrise to sunset. This returns the time 10.75 * {@link getShaahZmanisBaalHatanya()} after\n * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.\n *\n * @return the <code>Date</code> of the time of _plag hamincha_. 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.\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&deg; below the western geometric horizon\n * (90&deg;) after {@link getSunset() sunset}. For information on the source of this calculation see\n * {@link ZENITH_6_DEGREES}.\n *\n * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as 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, a `null` will be returned. * @see ZENITH_6_DEGREES\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 */\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 const hm = time.split(':');\n if (hm[0] === '24') {\n return '00:' + hm[1];\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 =\n 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) +\n 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(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): 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(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): 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 * const {GeoLocation, Zmanim, HDate} = require('@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","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","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'; // 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 } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\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 Parashah HaShavua for an entire Hebrew year\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 * Caculates the Parashah HaShavua 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(\n `improper sedra year type ${key} calculated for ${hyear}`\n );\n }\n }\n\n /**\n * Returns the date that a parsha occurs\n * or `null` if the parsha doesn't occur this year\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 */\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 } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(\n `Invalid parsha argument: ${JSON.stringify(parsha)}`\n );\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 that a parsha (or its doubled or undoubled counterpart)\n * occurs, or `null` if the parsha doesn't occur this year\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 sedra schedule.\n * Used by `@hebcal/triennial`\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * R.D. date of the first Saturday on or after Rosh Hashana\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns an object describing the parsha on the first Saturday on or after `hd`\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs =\n typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(\n `Date ${hd} before start of Hebrew year ${this.year}`\n );\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/**\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\ntype 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(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\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 `Sedra` or reuse a previously\n * created and cached instance.\n * @param hyear\n * @param il\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';\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';\n\n/**\n * Transliterated names of holidays, used by `Event.getDesc()`\n * @readonly\n * @enum {string}\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 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} 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';\nimport {holidayDesc as hdesc} from './staticHolidays';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */\nexport class HolidayEvent extends Event {\n /** During Sukkot or Pesach */\n 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 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 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 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 this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +\n '-' +\n this.urlDateSuffix();\n return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;\n }\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 } else if (this.getFlags() & flags.SPECIAL_SHABBAT) {\n return '🕍';\n } else {\n return '✡️';\n }\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 str.replace(/'/g, '’');\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 str.replace(/'/g, '’');\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 urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replace(/-/g, '');\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 * @private\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 = monthName0.replace(/'/g, '’');\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';\nimport {HolidayEvent} from './HolidayEvent';\nimport './locale'; // 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 * @private\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 = monthName0.replace(/'/g, '’');\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';\nimport {dateYomHaShoah, dateYomHaZikaron} from './modern';\nimport {getSedra} from './sedra';\nimport {\n staticHolidays,\n staticModernHolidays,\n holidayDesc as hdesc,\n} from './staticHolidays';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent';\n\n/**\n * Returns an array of Events on this date (or `undefined` if no events)\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 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 TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\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;\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 } else 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 ev = new HolidayEvent(hd, h.desc, h.flags);\n if (h.emoji) ev.emoji = h.emoji;\n if (h.chmDay) ev.cholHaMoedDay = h.chmDay;\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(\n new HDate(10, TEVET, year),\n hdesc.ASARA_BTEVET,\n MINOR_FAST\n )\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 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(\n new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'})\n );\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 an array of holidays for the year\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(\n year: number,\n il: boolean\n): 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} from '@hebcal/hdate';\nimport {Zmanim} from './zmanim';\nimport {Location} from './location';\nimport {getHolidaysOnDate} from './holidays';\nimport {Event, flags} from './event';\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 <em>Shabbos</em> or if it is a <em>Yom Tov</em> day that has a <em>melacha</em> (work) prohibition.\n *\n * @return if the day is a <em>Yom Tov</em> that is <em>assur bemlacha</em> or <em>Shabbos</em>\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 * Utility method to determine if the date and time has a <em>melacha</em> (work) prohibition.\n * Although there are many opinions on the time of <em>tzais</em>, for simplicity\n * this function uses solar depression of 8.5 degrees.\n *\n * @return `true` if <em>melacha</em> is prohibited or `false` if it is not.\n */\nexport function isAssurBemlacha(\n currentTime: Date,\n location: Location,\n useElevation: boolean\n): boolean {\n const zmanim = new Zmanim(location, currentTime, 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 hd = new HDate(currentTime);\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, Locale} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions';\nimport {Location} from './location';\nimport {Event} from './event';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {Zmanim} from './zmanim';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/** An event that has an `eventTime` and `eventTimeStr` */\nexport class TimedEvent extends Event {\n readonly eventTime: Date;\n readonly location: Location;\n readonly eventTimeStr: string;\n readonly fmtTime: string;\n readonly linkedEvent?: Event;\n /**\n * @param desc Description (not translated)\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 'Fast begins':\n case 'Fast ends':\n return ['zmanim', 'fast'];\n case 'Biur Chametz':\n return ['zmanim', 'biurChametz'];\n }\n /* NOTREACHED */\n return ['unknown'];\n }\n}\n\n/** Candle lighting before Shabbat or holiday */\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(\n date,\n 'Candle lighting',\n mask,\n eventTime,\n location,\n linkedEvent,\n options\n );\n }\n\n getEmoji(): string {\n return '🕯️';\n }\n}\n\n/** Havdalah after Shabbat or holiday */\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';\nimport {Location} from './location';\nimport {Event, flags} from './event';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent';\nimport {Zmanim} from './zmanim';\nimport {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent';\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 = 'Fast begins';\nconst FAST_ENDS = 'Fast ends';\n\n/** A fast day also contains a start and end time */\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 fastEndDeg = options.fastEndDeg;\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 tzeit = zmanim.tzeit(fastEndDeg);\n if (!isNaN(tzeit.getTime())) {\n endEvent = makeTimedEvent(ev, tzeit, 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 tzeit = zmanim.tzeit(fastEndDeg);\n if (!isNaN(tzeit.getTime())) {\n endEvent = makeTimedEvent(ev, tzeit, 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\nexport class TimedChanukahEvent extends ChanukahEvent {\n eventTime: Date;\n eventTimeStr: string;\n readonly location: Location;\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","import {HDate, Locale, gematriya} from '@hebcal/hdate';\nimport {Event, flags} from './event';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport sefira from './sefira.json';\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;\n\n/** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */\nexport class OmerEvent extends Event {\n private readonly weekNumber: number;\n private readonly daysWithinWeeks: number;\n readonly omer: number;\n\n /**\n * @param date\n * @param omerDay\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 sefira. For example, on day 8:\n * * חֶֽסֶד שֶׁבִּגְבוּרָה\n * * Chesed shebiGevurah\n * * Lovingkindness within Might\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 locale = locale ?? 'en';\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\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 getWeeks(): number {\n const day7 = this.daysWithinWeeks === 7;\n return day7 ? this.weekNumber : this.weekNumber - 1;\n }\n\n getDaysWithinWeeks(): number {\n return this.daysWithinWeeks;\n }\n /**\n * Returns a sentence with that evening's omer count\n * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`\n * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`\n */\n getTodayIs(locale: string): string {\n locale = locale ?? 'en';\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrew = locale === 'he' || locale === 'he-x-nonikud';\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 < 3860 || 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 {Event, flags} from './event';\nimport {isoDateString} from '@hebcal/hdate';\nimport {renderParshaName} from './parshaName';\nimport {SedraResult} from './sedra';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents one of 54 weekly Torah portions, always on a Saturday\n */\nexport class ParshaEvent extends Event {\n readonly p: SedraResult;\n constructor(parsha: SedraResult) {\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/' +\n this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +\n '-' +\n dt;\n return this.p.il ? url + '?i=on' : url;\n }\n\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replace(/-/g, '');\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';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n const locale0 = locale ?? 'en';\n let name = Locale.gettext(parsha[0], locale0);\n if (parsha.length === 2) {\n const hyphen = locale0 === 'he' ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale0);\n }\n name = name.replace(/'/g, '’');\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n","import {HDate, Locale, months} from '@hebcal/hdate';\nimport {Event, flags} from './event';\nimport {Molad} from './molad';\nimport './locale'; // 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]\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 = monthName0.replace(/'/g, '’');\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 {HDate} from '@hebcal/hdate';\nimport {Event} from './event';\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-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.\n *\n * Learning schedules are provided by the `@hebcal/learning` package.\n */\nexport class DailyLearning {\n /**\n * Register a new learning calendar.\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 an event from daily calendar for a given date. Returns `null` if there\n * is no learning from this calendar on this date.\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 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 * Tests to see if learning calendar has been registered\n * @param name case insensitive\n */\n static has(name: string): boolean {\n return cals.has(name.toLowerCase());\n }\n\n /** Returns the names of all calendars registered */\n static getCalendars(): string[] {\n return Array.from(cals.keys());\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern';\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(\n hdate: HDate,\n il: boolean,\n checkNext: boolean\n): 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(\n mday => new HDate(mday, months.TISHREI, year)\n ),\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 {greg2abs, isDate, daysInGregMonth, HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions';\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\n/**\n * Parse options object to determine start & end days\n * @private\n */\nexport function getStartAndEnd(options: CalOptions): number[] {\n if ((options.start && !options.end) || (options.end && !options.start)) {\n throw new TypeError('Both options.start and options.end are required');\n } else if (options.start && options.end) {\n return [getAbs(options.start), getAbs(options.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 } else 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 (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 } else 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 {Locale} from './locale';\nimport {abs2greg, HDate, months} from '@hebcal/hdate';\nimport {CalOptions, DailyLearningValue} from './CalOptions';\nimport {\n makeCandleEvent,\n makeFastStartEnd,\n makeWeekdayChanukahCandleLighting,\n} from './candles';\nimport {Event, flags} from './event';\nimport {getStartAndEnd} from './getStartAndEnd';\nimport {HebrewDateEvent} from './HebrewDateEvent';\nimport {HolidayYearMap, getHolidaysForYear_} from './holidays';\nimport {ParshaEvent} from './ParshaEvent';\nimport {Sedra, getSedra} from './sedra';\nimport {TimedEvent, HavdalahEvent} from './TimedEvent';\nimport {DailyLearning} from './DailyLearning';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent';\nimport {MevarchimChodeshEvent} from './MevarchimChodeshEvent';\nimport {MoladEvent, Molad} from './molad';\nimport {OmerEvent} from './omer';\nimport {Zmanim} from './zmanim';\nimport {Location} from './location';\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)\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 * * 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 (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) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\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 {HebrewCalendar, HDate, Location, Event} 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 */\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 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 const mm = hd.getMonth();\n const dd = hd.getDate();\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, '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;\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 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 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 (\n RECOGNIZED_OPTIONS[k] === undefined &&\n !unrecognizedAlreadyWarned.has(k)\n ) {\n console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);\n unrecognizedAlreadyWarned.add(k);\n }\n }\n if (options.dailyLearning) {\n for (const k of Object.keys(options.dailyLearning)) {\n if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(k)) {\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 * @private\n * @constant\n * This calculation is based on observation of 3 medium sized stars by Dr. Baruch Cohen\n * in his calendar published in in 1899 in Strasbourg, France.\n * This calculates to 7.0833333° below geometric zenith.\n * @see {https://kosherjava.com/zmanim/docs/api/com/kosherjava/zmanim/ComplexZmanimCalendar.html#ZENITH_7_POINT_083}\n */\nconst TZEIT_3MEDIUM_STARS = 7.0833333;\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(\n 'options.candlelighting requires valid options.location'\n );\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\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, min);\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 = TZEIT_3MEDIUM_STARS;\n }\n}\n\nfunction overrideIsraelCandleMins(location: Location, min: number) {\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 min;\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.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 & 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.noModern && eFlags & MODERN_HOLIDAY)\n ) {\n return candlesEv; // bail out early\n }\n if (options.candlelighting && ev.getDesc() === 'Erev Pesach') {\n const biurChametzEv = makeBiurChametzEvent(ev, options);\n if (biurChametzEv) {\n events.push(biurChametzEv);\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() !== '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 ) {\n events.push(ev); // the original event itself\n }\n }\n if (\n (isMajorFast || (isMinorFast && !options.noMinorFast)) &&\n fastEv?.endEvent\n ) {\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 || 'en', options);\n evts.push(\n new MevarchimChodeshEvent(hd, nextMonthName, memo, options.locale)\n );\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 makeBiurChametzEvent(\n erevPesachEv: Event,\n options: CalOptions\n): TimedEvent | undefined {\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 time = zmanim.sofZmanBiurChametzGRA();\n if (isNaN(time.getTime())) {\n return undefined;\n }\n const biurChametzEv = new TimedEvent(\n hd,\n 'Biur Chametz',\n flags.USER_EVENT,\n time,\n location,\n erevPesachEv,\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 {getBirthdayHD, getYahrzeitHD, HDate} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions';\nimport {version as pkgVersion} from './pkgVersion';\nimport {Event, flags} from './event';\nimport {Sedra, getSedra} from './sedra';\nimport {hallel_} from './hallel';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays';\nimport {HolidayEvent} from './HolidayEvent';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {TachanunResult, tachanun} from './tachanun';\nimport {calendar} from './calendar';\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 * 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)\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 * * 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 (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) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\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 {HebrewCalendar, HDate, Location, Event} 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 * `hyear` must be after original `gdate` of anniversary.\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 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 const dt = getBirthdayHD(hyear, gdate);\n if (dt === undefined) {\n return dt;\n }\n return new HDate(dt);\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 const dt = getYahrzeitHD(hyear, gdate);\n if (dt === undefined) {\n return dt;\n }\n return new HDate(dt);\n }\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 * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns an array of holidays for the year\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 Events on this date (or `undefined` if no events)\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 * Eruv Tavshilin\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 23-hour (00:00-23:59) time in US format (\"8:13pm\") or\n * keep as \"20:13\" for any other locale/country. Uses {@link CalOptions} to determine\n * locale.\n * If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.\n * If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.\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\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of `Sedra` or reuse a previously\n * created and cached instance.\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Return a number containing information on what Hallel is said on that day.\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 *\n * The number is one of the following values:\n *\n * 0 - No Hallel\n * 1 - Half Hallel\n * 2 - Whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysForYearArray(hdate.getFullYear(), il);\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 */\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';\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 whole = events\n .filter(ev => {\n const desc: string = ev.getDesc();\n const hd: HDate = ev.getDate();\n const month = hd.getMonth();\n const mday = hd.getDate();\n return (\n desc.startsWith('Chanukah') ||\n desc.startsWith('Shavuot') ||\n desc.startsWith('Sukkot') ||\n (month === months.NISAN &&\n (mday === 15 || mday === 16) &&\n ev.getFlags() & flags.CHAG) || // Pesach\n desc === \"Yom HaAtzma'ut\" ||\n desc === 'Yom Yerushalayim'\n );\n })\n .map(ev => {\n return ev.getDate().abs();\n });\n\n const abs = hdate.abs();\n if (whole.includes(abs)) {\n return WHOLE;\n }\n\n const half = events\n .filter(ev => {\n const desc = ev.getDesc();\n return (\n ev.getFlags() & flags.ROSH_CHODESH ||\n (desc.startsWith('Pesach') &&\n desc !== 'Pesach I' &&\n desc !== 'Pesach II')\n );\n })\n .map(ev => {\n return ev.getDate().abs();\n });\n\n if (half.includes(abs)) {\n return HALF;\n }\n\n return NONE;\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {ParshaEvent} from './ParshaEvent';\nimport {getSedra} from './sedra';\n\n/**\n * Calculates weekly Torah Reading on Saturdays for entire year\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","edCache","Map","EPOCH","assertNumber","n","name","hebrew2abs","tempabs","m","monthsInYear","elapsedDays","newYear","abs2hebrew","yy","mm","dd","longCheshvan","shortKislev","getMonthName","get","elapsed","prevYear","mElapsed","pElapsed","hElapsed","parts","altDay","elapsedDays0","set","daysInYear","monthFromName","monthName","c","trim","toLowerCase","startsWith","substring","test","toSimpleHebrewDate","obj0","isSimpleHebrewDate","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","dateFormatRegex","getPseudoISO","tzid","fmt","f","Intl","DateTimeFormat","hour","minute","second","hour12","timeZone","getFormatter","format","exec","Error","getTimezoneOffset","utcStr","localStr","diffMs","ceil","isoDateString","poHe","headers","language","contexts","Adar","Av","Cheshvan","Elul","Iyyar","Kislev","Nisan","Sivan","Tamuz","Tammuz","Tevet","Tishrei","noopLocale","alias","h","a","s","locales","getEnOrdinal","v","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","locale0","copyLocaleNoNikud","strs","poHeNoNikud","UNITS_DAY","UNITS_WEEK","UNITS_MONTH","UNITS_YEAR","HDate","rd","constructor","arguments","hd","monthNum","fix","setMonth","abs0","isNumber","d","getTishreiMonth","nummonths","getDay","render","showYear","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","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","flagToCategory","Event","desc","mask","attrs","getDesc","getFlags","renderBrief","getEmoji","emoji","basename","url","observedInIsrael","observedInDiaspora","observedIn","il","getCategories","HebrewDateEvent","super","renderBriefHebrew","clampProp","e","o","r","ba","missingField","clampNumber","numberOutOfRange","on","value","configurable","writable","Symbol","toStringTag","zipProps","P","remapProps","nn","create","hasAnyPropsByName","allPropsEqual","zeroOutProps","gt","capitalize","toUpperCase","sortStrings","padNumber","padStart","compareNumbers","max","divModFloor","modFloor","divModTrunc","divTrunc","modTrunc","hasHalf","givenFieldsToBigNano","Zu","go","u","nanoToGivenFields","S","T","requireNumberIsPositive","_e","rl","requirePropDefined","oa","ru","requireType","invalidEntity","Number","isInteger","expectedInteger","expectedPositive","tu","ou","toStringViaPrimitive","toBigInt","BigInt","invalidBigInt","toNumber","forbiddenBigIntToNumber","isFinite","expectedFinite","Za","Ba","toPositiveInteger","createBigNano","so","Ta","va","pa","bigNanoOutside","bigIntToBigNano","Ge","La","Oa","divModBigNano","checkIsoYearMonthInBounds","Nl","yl","isoYear","To","Do","At","isoHour","io","ma","isoDay","isoNanosecond","Ml","Tl","Mu","isoTimeFieldsToNano","w","nanoToIsoTimeAndDay","epochNanoToSecMod","oo","isoToEpochMilli","isoArgsToEpochMilli","isoMonth","isoMinute","isoSecond","isoMillisecond","Cu","Ke","isoMicrosecond","ro","isoToEpochNanoWithOffset","isoArgsToEpochSec","ku","isoToLegacyDate","valueOf","setUTCHours","setUTCFullYear","So","Pa","gl","pl","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","hashIntlFormatParts","formatToParts","type","computeIsoDateParts","computeIsoMonthCodeParts","computeIsoMonthsInYear","Fl","computeIsoDaysInMonth","computeIsoInLeapYear","computeIsoDaysInYear","Ha","getUTCDay","computeIsoEraParts","Xu","el","Ol","computeJapaneseEraParts","El","bf","era","eraYear","parseIntlYear","checkIsoDateTimeFields","checkIsoDateFields","constrainIsoTimeFields","constrainIsoDateFields","isIsoDateFieldsValid","ml","Gl","je","normalizeOptions","Vl","_l","refineDiffOptions","$l","parseRoundingIncInteger","Xl","xl","checkLargestSmallestUnit","refineRoundingInc","refineRoundingOptions","normalizeOptionsOrString","bl","refineDateDisplayOptions","Jl","refineTimeDisplayOptions","refineTimeDisplayTuple","refineSubsecDigits","refineSmallestUnitAndSubsecDigits","Bl","Yl","fabricateOverflowOptions","overflow","Rl","refineUnitOption","Bu","ul","invalidChoice","Yu","refineChoiceOption","Eu","xe","branding","Re","epochNanoseconds","Xe","_","calendar","jt","Il","W","G","Ca","createPlainYearMonthSlots","Qt","createPlainMonthDaySlots","qt","St","ft","hl","pe","A","computeDurationSign","I","fa","J","getMaxDurationUnit","Sl","Cl","Hl","isUniformUnit","totalDayTimeDuration","vu","l","createMarkerSystem","createMarkerToEpochNano","createMoveMarker","p","createDiffMarkers","isZonedEpochSlots","clampRelativeDuration","dl","ja","O","ya","durationFieldsToBigNano","du","Ie","he","getStartOfDayInstantFor","Ea","uo","computeDayInterval","N","getMatchingInstantFor","roundDateTime","be","lo","ho","roundDateTimeToNano","computeNanoInc","roundTimeToNano","Ua","Da","roundToMinute","ao","Ra","roundDayTimeDurationByInc","nanoToDurationDayTimeFields","Ya","roundRelativeDuration","nudgeZonedTimeDuration","nudgeDayTimeDuration","nudgeRelativeDuration","roundBigNano","ef","fl","D","g","nanoToDurationTimeFields","days","Boolean","weeks","ke","formatIsoDateTimeFields","Se","nf","Fe","Ql","Kl","formatCalendar","Ft","ce","formatIsoDateFields","Ht","formatDateLikeIso","formatIsoYearMonthFields","Jt","formatIsoMonthDayFields","ct","formatIsoTimeFields","k","checkDurationUnits","negateDurationFields","hours","minutes","checkDurationTimeUnit","formatSubsecNano","formatDurationFragments","Y","formatDurationNumber","years","M","H","formatCalendarId","join","wu","getSignStr","no","af","toLocaleString","useGrouping","_zonedEpochSlotsToIso","offsetNanoseconds","gu","$o","Tu","Du","Ye","durationHasDateParts","Pu","Oe","Fa","wt","ka","ne","moveDate","Gt","Na","B","ll","at","moveTime","diffZonedEpochsExact","diffDateTimesExact","E","relativeTo","Nu","cl","sf","isSafeInteger","yu","sl","createSplitTuple","computePeriod","tf","parseOffsetNano","parseOffsetNanoMaybe","failedParse","me","parseDateTimeLike","C","Pl","finalizeDateTime","finalizeDate","requireIsoCalendar","invalidSubstring","finalizeZonedDateTime","Z","L","j","resolveSlotsCalendar","gf","organizeIsoYearParts","organizeTimeParts","organizeAnnotationParts","parseYearMonthOnly","If","parseMonthDayOnly","Df","Mf","Iu","parseInt0","parseSubsecNano","parseSign","yf","reverse","padEnd","createRegExp","RegExp","getTimeZoneEssence","Ff","F","Pf","hu","map","getTimeZoneAtomic","resolvedOptions","vf","He","Be","Yt","te","Dt","isTimeZoneIdsEqual","Ee","diffEpochNanos","we","ha","pu","ga","diffZonedEpochsBig","It","diffDateTimesBig","oe","diffDateLike","_t","it","diffTimes","diffEpochNanosExact","updateMid","Sa","td","diffEpochMilliByDay","mu","computeNativeWeekOfYear","computeNativeYearOfWeek","computeNativeDayOfYear","parseMonthCode","Ef","invalidMonthCode","sa","monthCodeNumberToMonth","monthToMonthCodeNumber","eraYearToYear","getCalendarEraOrigins","nl","getCalendarIdBase","getCalendarLeapMonthMeta","ol","computeCalendarIdBase","createIntlCalendar","epochMilliToIntlFields","V","createIntlFieldCache","createIntlYearDataCache","WeakMap","vl","K","X","bu","parseIntlPartsYear","tl","relatedYear","computeIntlDateParts","computeIntlEpochMilli","computeIntlMonthCodeParts","computeIntlLeapMonth","call","queryMonthStrings","computeIntlDaysInYear","computeIntlDaysInMonth","computeIntlMonthsInYear","computeIntlEraParts","Zt","createNativeOpsCreator","Of","z","refineCalendarFields","_u","ju","ee","refineTimeBag","refineFields","fields","duplicateFields","forbiddenField","Rm","includes","Qu","noValidFields","zm","convertToIso","refineYear","su","iu","invalidEra","cu","missingYear","refineMonth","monthCode","fu","uu","lu","refineDay","spliceFields","computeDateEssentials","ra","yt","fe","mt","le","Vu","convertToPlainYearMonth","se","Ku","convertToPlainMonthDay","createOptionsTransformer","Set","ie","an","mp","toEpochMillis","Ou","en","computeNonBuggyIsoResolve","Ot","tn","Ue","now","Qe","Fu","ln","Su","nanosecond","microsecond","millisecond","week","Ru","zu","Au","Uu","concat","qu","Lu","Wu","xu","$u","Hu","Gu","Ju","gregory","japanese","meiji","taisho","showa","heisei","reiwa","ethiopic","ethioaa","coptic","roc","buddhist","islamic","ah","indian","saka","persian","ap","bce","era0","era1","broc","minguo","chinese","dangi","hebrew","al","Dl","kl","Zl","constrain","reject","zl","compatible","earlier","later","Al","use","prefer","ignore","Ul","auto","never","critical","always","jl","ql","Ll","halfFloor","halfCeil","halfTrunc","expand","halfExpand","halfEven","Wl","previous","round","of","rf","IntlTimeZone","FixedTimeZone","ae","getOffsetSec","pinch","ue","epochNanoToSec","cf","uf","lf","ff","df","mf","pf","hf","Tf","Nf","kf","wa","q","U","R","inLeapYear","dayOfYear","$","daysInWeek","Kf","tm","om","weekOfYear","yearOfWeek","computeWeekShift","computeWeeksInYear","im","Nm","Om","bm","Sm","Bm","Ym","Cm","km","Zm","Ga","Am","Um","jm","qm","Lm","Wm","xm","$m","timeZoneName","Hm","Gm","Vm","_m","Jm","Km","Qm","Xm","ep","np","tp","op","rp","ip","sp","cp","up","lp","fp","dp","pp","Q","ot","tt","et","nt","createSlotClass","Class","un","dbg","bindMethod","defineProperties","getSpecificSlots","cn","rejectInvalidBag","defineProperty","enumerable","getCalendarIdFromBag","extractCalendarIdFromBag","refineCalendarArg","createCalendarGetters","neverValueOf","refineTimeZoneArg","toDurationSlots","parseUnit","refinePublicRelativeTo","toPlainTimeSlots","Tt","ht","optionalToPlainTimeFields","toPlainDateTimeSlots","Nt","Bt","toPlainMonthDaySlots","Rt","xt","toPlainYearMonthSlots","Ut","Xt","toPlainDateSlots","de","toZonedDateTimeSlots","Ae","Ne","adaptDateMethods","slotsToIso","toInstantSlots","We","createDateTimeFormatClass","DateTimeFormatFunc","DateTimeFormatNew","to","createFormatPrepperForBranding","prepFormat","getOwnPropertyDescriptors","createFormatMethod","createProxiedMethod","apply","vn","rn","sn","bind","fn","dn","mn","Sn","Tn","hn","Dn","gn","calendarId","Pn","On","pn","epochMilliseconds","bigNanoToBigInt","wn","In","blank","with","negated","total","DurationFormat","toJSON","compare","Instant","PlainDateTime","PlainDate","PlainTime","PlainYearMonth","PlainMonthDay","Cn","Fn","Zn","Mn","yn","jn","An","Nn","Bn","rt","until","since","lt","equals","st","Yn","En","Pt","withCalendar","withPlainTime","pt","bt","vt","toZonedDateTime","zn","Ct","toPlainDate","Wn","toPlainTime","Ln","Vn","Et","Lt","Vt","kn","qn","Wt","zt","$t","xn","re","plainTime","toPlainDateTime","toPlainYearMonth","toPlainMonthDay","_n","timeZoneId","hoursInDay","Te","De","withTimeZone","ge","Pe","startOfDay","ve","toInstant","Hn","Ce","getTimeZoneTransition","Ze","$n","Le","Ve","toZonedDateTimeISO","Je","fromEpochMilliseconds","ze","fromEpochNanoseconds","$e","Qn","instant","zonedDateTimeISO","plainDateTimeISO","plainDateISO","plainTimeISO","Un","ZonedDateTime","Duration","Now","Xn","degreesToRadians","degrees","PI","radiansToDegrees","radians","globalThis","Temporal","toTemporalInstant","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","time","milliseconds","offsetZenith","dawn","zenith","getUTCSunrise","getAdjustedDate","getUTCSunset","getElevationAdjustment","acos","adjustZenith","adjustedZenith","solarRadius","adjustForElevation","getSunriseUTC","getJulianDay","getSunsetUTC","getTemporalHour","endOfDay","NaN","delta","getSunTransit","temporalHour","isSunrise","calculatedTime","cal","seconds","localTimeHours","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","classicCities0","classicCities","ZIPCODES_TZ_MAP","timeFormatCache","Location","cityName","countryCode","geoid","parseFloat","long","elev","cc","getIsrael","getName","getShortName","comma","getCountryCode","getTzid","getTimeFormatter","getGeoId","lookup","JSON","stringify","legacyTzToTzid","tz","dst","getUsaTzid","state","addLocation","location","city","hour12cc","US","CA","BR","AU","NZ","DO","PR","GR","IN","KR","NP","ZA","reformatTimeStr","timeStr","suffix","options","_a","hm","CHALAKIM_PER_DAY","getChalakimSinceMoladTohu","monthOfYear","leap","getJewishMonthOfYear","calculateMolad","absDate","moladToAbsDate","conjunctionDay","adjustedChalakim","hdate","getMoladAsDate","molad","moladSeconds","millis","zdt","getLocalMeanTimeOffset","enDoW","heDayNames","frDoW","night","getMoladDate","getYear","getDow","getHour","getMinutes","getChalakim","getInstant","getTchilasZmanKidushLevana3Days","getTchilasZmanKidushLevana7Days","getSofZmanKidushLevanaBetweenMoldos","getSofZmanKidushLevana15Days","isHebrewLocale","dayNames","getDayNames","dow","moladStr","minutesStr","chalakimStr","and","ampm","getHebrewTimeOfDay","result","fmtTime","MoladEvent","hyear","hmonth","zdtToDate","res","setMilliseconds","ZENITH_1_POINT_583","Zmanim","gloc","useElevation","plainDate","noaa","getUseElevation","setUseElevation","timeAtAngle","angle","rising","seaLevelSunrise","seaLevelSunset","dusk","gregEve","prev0","nightHour","chatzot","chatzotNight","alotHaShachar","alotHaShachar72","sunriseOffset","alotHaShachar72zdt","misheyakir","misheyakirMachmir","getShaahZmanisBasedZmanZdt","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","getHDate","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","sunsetMillis","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","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","idx","findContaining","getSedraArray","getFirstSaturday","saturday","weekNum","index","getSedra","chag","doubles","PESACH","PESACH1","PESACH7","PESACH8","SHAVUOT","range","start","stop","yearStartVayeilech","yearStartHaazinu","yearStartRH","r020","r027","r3340","r4349","r4350","sedraCache","cacheKey","sedra","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_ESTHER","TISHA_BAV","TZOM_GEDALIAH","TZOM_TAMMUZ","YOM_HAATZMA_UT","YOM_HASHOAH","YOM_HAZIKARON","CHANUKAH_1_CANDLE","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","beshalachHd","birkatHaChama","startMonth","startDay","baseRd","getBirkatHaChama","getHolidaysForYearArray","yearMap","startAbs","endAbs","absDt","holidays","filtered","TimedEvent","eventTime","linkedEvent","eventTimeStr","opts","CandleLightingEvent","HavdalahEvent","havdalahMins","makeCandleEvent","isFriday","isSaturday","havdalahTitle","useHavdalahOffset","candleLightingMins","zmanim","havdalahDeg","FAST_BEGINS","FAST_ENDS","FastDayEvent","startEvent","endEvent","makeTimedEvent","TimedChanukahEvent","sefirot","infix","infix26","words","pfxWords","translit","getWeeks","omerDay","tens","ones","shnei","yamim","shneiYamim","shavuot","yom","yomEchad","asar","anaBekoach","lamnatzeach","flatMap","lamnatzeachLetters","sefira","OmerEvent","checkDay","weekNumber","daysWithinWeeks","omer","lang","config","codePoint","fromCodePoint","getDaysWithinWeeks","getTodayIs","ten","one","omerTodayIsHe","day7","numWeeks","omerTodayIsEn","getLamnatzeachWord","getLamnatzeachLetter","getAnaBekoachWord","ParshaEvent","renderParshaName","mevarchimChodeshStr","MevarchimChodeshEvent","monNext","space","cals","DailyLearning","addCalendar","startDate","getStartDate","getCalendars","end","NONE","shacharit","mincha","allCongs","tachanun","tachanun0","checkNext","dates","shushPurim","none","mday","some","yesPrev","tachanunYear","ret","tomorrow","tmp","getAbs","getStartAndEnd","isHebrewYear","theYear","theMonth","numYears","startEndHebrew","gregMonth","startGreg","endYear","endGreg","startEndGregorian","candlelighting","min0","geoIdCandleOffset","shortName","israelCityOffset","overrideIsraelCandleMins","TZEIT_3SMALL_STARS","fastEndDeg","TZEIT_3MEDIUM_STARS","checkCandleOptions","defaultLocation","hasUserMask","noRoshChodesh","noModern","noMinorFast","noSpecialShabbat","sedrot","dailyLearning","dafYomi","mishnaYomi","nachYomi","yerushalmi","shabbatMevarchim","yomKippurKatan","yizkor","setOptionsFromMask","noHolidays","getMaskFromOptions","ashkenazi","evts","holidaysYear","beginOmer","endOmer","currentYear","startAndEnd","RECOGNIZED_OPTIONS","unrecognizedAlreadyWarned","console","warn","warnUnrecognizedOptions","startGregYear","prevEventsLength","candlesEv","appendHolidayAndRelated","parsha0","numDailyLearning","makeDailyLearning","omerEv","makeOmerEvent","makeMoladAndMevarchimChodesh","addHebrewDates","addHebrewDatesForEvents","e2","splice","Jerusalem","Haifa","MASK_LIGHT_CANDLES","eFlags","biurChametzEv","erevPesachEv","makeBiurChametzEvent","isMajorFast","isMinorFast","fastEv","ev2","makeFastStartEnd","chanukahEv","candleLightingTime","makeWeekdayChanukahCandleLighting","dailyLearningName","learningEv","alarm","isChag","getBirthdayOrAnniversary","gdate","orig","origYear","isOrigLeap","getBirthdayHD","getYahrzeit","hDeath","getYahrzeitHD","getHolidaysForYear","eruvTavshilin","today","friday","pkgVersion","hallel","whole","hallel_","currentTime","currentMillis","isTomorrowShabbosOrYomTov","isTodayAssurBemelacha"],"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,CA4BA,SAASI,EAAeC,GACpB,QAASA,EAAO,KAAUA,EAAO,MAAUA,EAAO,IACtD,CAMA,SAASC,EAAgBC,EAAOF,GAE5B,OAAOT,GAAcQ,EAAeC,IAAOE,EAC/C,CAIA,SAASC,EAAOC,GAEZ,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,KAC3BA,GAAS,EAAI,EAAIH,EAAeC,IAAQ,MACzCS,CACR,CAKA,SAASE,EAASC,GACd,IAAKT,EAAOS,GACR,MAAM,IAAIC,UAAU,eAAeD,KAElC,GAAIE,MAAMF,EAAKG,WAChB,MAAM,IAAIC,WAAW,gBAQzB,OANYR,EAAQI,EAAKK,cAAeL,EAAKM,WAAa,EAAGN,EAAKO,U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AAOpJ,KAAKsJ,GAAMA,EAAGx1C,WAAajC,GAKjD,CA2CMymD,CAA0BliB,EAAKgT,IAAWiP,GAAiBzb,EAC7D,OAAO,EAGT,GAxCF,SAA+BxG,EAAagT,GAC1C,OAAY,IAARhT,KAGSgT,EAAOpJ,KAAKsJ,GAAMA,EAAGx1C,WAAanC,GAAMC,KAKvD,CA+BM2mD,CAAsBniB,EAAKgT,GAAS,CAGtC,OAAOiP,GAFOxL,EAAO3S,QACKv8C,SAE5B,CACA,OAAO,CACT,0Ba3DM,SAAqBf,EAAc2X,GACvC,MAAMiuC,EAAQrB,GAASvkD,EAAM2X,GACvBm3C,EAAWlJ,EAAMzB,mBACjB4K,EAAS5hD,GAAMpJ,WAAW/D,EAAMwC,EAAOM,KAAM,IAC7C0pD,EAAwB,GAC9B,IAAK,IAAIwC,EAAQF,EAAUE,GAASD,EAAQC,GAAS,EAAG,CACtD,MAAM3L,EAASuC,EAAMrQ,OAAOyZ,GAC5B,IAAK3L,EAAOmB,KAAM,CAChB,MAAMkI,EAAK,IAAI0G,GAAY/P,GAC3BmJ,EAAO7lD,KAAK+lD,EACd,CACF,CACA,OAAOF,CACT","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,19,20,21,22,29]}
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","../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-polyfill/chunks/internal.js","../node_modules/temporal-polyfill/chunks/classApi.js","../node_modules/@hebcal/noaa/dist/index.js","../node_modules/temporal-polyfill/global.esm.js","../src/location.ts","../src/reformatTimeStr.ts","../src/moladBase.ts","../src/moladDate.ts","../src/molad.ts","../src/zmanim.ts","../node_modules/quick-lru/index.js","../src/modern.ts","../src/sedra.ts","../src/staticHolidays.ts","../src/HolidayEvent.ts","../src/YomKippurKatanEvent.ts","../src/holidays.ts","../src/isAssurBemlacha.ts","../src/TimedEvent.ts","../src/candles.ts","../src/omer.ts","../src/ParshaEvent.ts","../src/parshaName.ts","../src/MevarchimChodeshEvent.ts","../src/DailyLearning.ts","../src/tachanun.ts","../src/getStartAndEnd.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.3.1';\n","/*! @hebcal/hdate v0.22.0, 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 * @param year Gregorian year\n */\nfunction 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 */\nfunction 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 */\nfunction 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 * @param date Gregorian date\n */\nfunction 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 * @param abs - R.D. number of days\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 */\nfunction 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\nexport { abs2greg, daysInGregMonth, greg2abs, isDate, isGregLeapYear };\n//# sourceMappingURL=greg.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\n/**\n * Removes niqqud from Hebrew string\n */\nfunction hebrewStripNikkud(str) {\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\nexport { hebrewStripNikkud };\n//# sourceMappingURL=hebrewStripNikkud.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { abs2greg, daysInGregMonth, greg2abs, isDate, isGregLeapYear } from './greg.js';\n\n/* eslint-disable @typescript-eslint/no-namespace */\n/**\n * Gregorian date helper functions\n */\nvar greg;\n(function (greg) {\n})(greg || (greg = {}));\ngreg.abs2greg = abs2greg;\ngreg.daysInMonth = daysInGregMonth;\ngreg.greg2abs = greg2abs;\ngreg.isDate = isDate;\ngreg.isLeapYear = isGregLeapYear;\n\nexport { greg };\n//# sourceMappingURL=gregNamespace.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { hebrewStripNikkud } from './hebrewStripNikkud.js';\n\n/*\n * More minimal HDate\n */\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 * @readonly\n * @enum {number}\n */\nconst 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];\nconst edCache = new Map();\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 Gregorian\n * Calendar.\n * @param year Hebrew year\n * @param month Hebrew month\n * @param day Hebrew date (1-30)\n * @example\n * const abs = hebrew2abs(5769, months.CHESHVAN, 15);\n */\nfunction 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 for (let m = TISHREI; m <= monthsInYear(year); 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 * 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 */\nfunction 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 */\nfunction 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 * @param year Hebrew year\n */\nfunction 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 * @param year Hebrew year\n */\nfunction monthsInYear(year) {\n return 12 + +isLeapYear(year); // boolean is cast to 1 or 0\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 */\nfunction daysInMonth(month, year) {\n switch (month) {\n case IYYAR:\n case TAMUZ:\n case ELUL:\n case TEVET:\n case ADAR_II:\n return 29;\n }\n if ((month === ADAR_I && !isLeapYear(year)) ||\n (month === CHESHVAN && !longCheshvan(year)) ||\n (month === KISLEV && shortKislev(year))) {\n return 29;\n }\n else {\n return 30;\n }\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 */\nfunction 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\n * @param year Hebrew year\n */\nfunction elapsedDays(year) {\n const n = edCache.get(year);\n if (typeof n === 'number') {\n return n;\n }\n const elapsed = elapsedDays0(year);\n edCache.set(year, elapsed);\n return elapsed;\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 * @param year Hebrew year\n */\nfunction daysInYear(year) {\n return elapsedDays(year + 1) - elapsedDays(year);\n}\n/**\n * true if Cheshvan is long in Hebrew year\n * @param year Hebrew year\n */\nfunction longCheshvan(year) {\n return daysInYear(year) % 10 === 5;\n}\n/**\n * true if Kislev is short in Hebrew year\n * @param year Hebrew year\n */\nfunction shortKislev(year) {\n return daysInYear(year) % 10 === 3;\n}\n/**\n * Converts Hebrew month string name to numeric\n * @param monthName monthName\n */\nfunction 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 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 }\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 }\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 }\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 }\n break;\n case 'ת':\n switch (c[1]) {\n case 'מ':\n return TAMUZ;\n case 'ש':\n return TISHREI;\n }\n break;\n }\n throw new RangeError(`bad monthName: ${monthName}`);\n}\n\nexport { abs2hebrew, daysInMonth, daysInYear, elapsedDays, getMonthName, hd2abs, hebrew2abs, isLeapYear, longCheshvan, monthFromName, months, monthsInYear, shortKislev };\n//# sourceMappingURL=hdateBase.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { monthsInYear, longCheshvan, months, shortKislev, isLeapYear, hebrew2abs, abs2hebrew } from './hdateBase.js';\nimport { abs2greg, isDate, greg2abs } from './greg.js';\n\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 * @private\n */\nfunction toSimpleHebrewDate(obj) {\n if (isSimpleHebrewDate(obj)) {\n return obj;\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.\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 * 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 {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 * @param hyear Hebrew year\n * @param date Gregorian or Hebrew date of death\n * @returns anniversary occurring in `hyear`\n */\nfunction 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}\nfunction 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).\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 * 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 {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\n * @param date Gregorian or Hebrew date of event\n * @returns anniversary occurring in `hyear`\n */\nfunction 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}\nfunction 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\nexport { getBirthdayHD, getBirthdayOrAnniversary, getYahrzeit, getYahrzeitHD };\n//# sourceMappingURL=anniversary.js.map\n","/*! @hebcal/hdate v0.22.0, 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);\n digits.push(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 */\nfunction 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 */\nfunction gematriyaStrToNum(str) {\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\nexport { gematriya, gematriyaStrToNum };\n//# sourceMappingURL=gematriya.js.map\n","/*! @hebcal/hdate v0.22.0, 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 */\nfunction 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 */\nfunction pad2(num) {\n if (num >= 0 && num < 10) {\n return '0' + num;\n }\n return String(num);\n}\n\nexport { pad2, pad4 };\n//# sourceMappingURL=pad.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { pad4, pad2 } from './pad.js';\n\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 */\nfunction 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 */\nfunction 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 * Returns YYYY-MM-DD in the local timezone\n */\nfunction isoDateString(dt) {\n return (pad4(dt.getFullYear()) +\n '-' +\n pad2(dt.getMonth() + 1) +\n '-' +\n pad2(dt.getDate()));\n}\n\nexport { getPseudoISO, getTimezoneOffset, isoDateString };\n//# sourceMappingURL=dateFormat.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nvar poAshkenazi = { \"headers\": { \"plural-forms\": \"nplurals=2; plural=(n > 1);\", \"language\": \"en_CA@ashkenazi\" }, \"contexts\": { \"\": { \"Tevet\": [\"Teves\"] } } };\n\nexport { poAshkenazi as default };\n//# sourceMappingURL=ashkenazi.po.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nvar poHe = { \"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\nexport { poHe as default };\n//# sourceMappingURL=he.po.js.map\n","/*! @hebcal/hdate v0.22.0, 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';\n\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 */\nclass 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 */\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 */\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.\n * @param locale Locale name (i.e.: `'he'`, `'fr'`)\n * @param data parsed data from a `.po` file.\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 */\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 * @param locale Locale name (i.e: `'he'`, `'fr'`).\n * @param data parsed data from a `.po` file.\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 */\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 */\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 */\n static ordinal(n, locale) {\n let locale0 = locale?.toLowerCase();\n if (!locale0) {\n return getEnOrdinal(n);\n }\n locale0 = alias[locale0] || locale0;\n switch (locale0) {\n case 'en':\n case 'ashkenazi':\n return getEnOrdinal(n);\n case 'es':\n return n + 'º';\n case 'he':\n case 'he-x-nonikud':\n return String(n);\n }\n if (locale0.startsWith('ashkenazi')) {\n return getEnOrdinal(n);\n }\n return n + '.';\n }\n /**\n * Removes nekudot from Hebrew string\n */\n static hebrewStripNikkud(str) {\n return hebrewStripNikkud(str);\n }\n /**\n * Makes a copy of entire Hebrew locale with no niqqud\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}\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\nexport { Locale };\n//# sourceMappingURL=locale.js.map\n","/*! @hebcal/hdate v0.22.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */\nimport { abs2hebrew, isLeapYear, monthsInYear, daysInMonth, hebrew2abs, getMonthName, monthFromName, daysInYear, longCheshvan, shortKislev, months } from './hdateBase.js';\nimport { isDate, greg2abs, abs2greg } from './greg.js';\nimport { gematriya, gematriyaStrToNum } from './gematriya.js';\nimport { Locale } from './locale.js';\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 */\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 */\nclass 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.getDate(); // 4\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 * @example\n * new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014\n * new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * @example\n * new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\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 * @example\n * new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014\n * new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014\n * new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014\n * @param dayOfWeek day of week: Sunday=0, Saturday=6\n */\n after(dayOfWeek) {\n return onOrBefore(dayOfWeek, this, 7);\n }\n /**\n * Returns the next Hebrew date\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.next(); // '16 Cheshvan 5769'\n */\n next() {\n return new HDate(this.abs() + 1);\n }\n /**\n * Returns the previous Hebrew date\n * @example\n * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769\n * hd.prev(); // '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 */\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 * const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769\n * const hd3 = hd1.add(-3, 'M'); // 30 Av 5768\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 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 * @param dayOfWeek day of week: Sunday=0, Saturday=6\n */\n static dayOnOrBefore(dayOfWeek, absdate) {\n return absdate - ((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 * @example\n * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783\n * HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704\n * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708\n */\n static fromGematriyaString(str, currentThousands = 5000) {\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 }\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\nexport { HDate };\n//# sourceMappingURL=hdate.js.map\n","export default {\"headers\":{\"plural-forms\":\"nplurals=2; plural=(n > 1);\",\"language\":\"en_CA@ashkenazi\"},\"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\"],\"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 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 %s\":[\"רֹאשׁ חוֹדֶשׁ %s\"],\"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 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';\nimport poHe from './he.po';\nimport noNikudOverride from './he-x-NoNikud.po';\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'; // 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 * @readonly\n * @enum {number}\n */\nexport const flags = {\n /** Chag, yontiff, yom tov */\n CHAG: 0x000001,\n /** Light candles 18 minutes 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} as const;\n\nconst flagToCategory = [\n [flags.MAJOR_FAST, 'holiday', 'major', 'fast'],\n [flags.CHANUKAH_CANDLES, 'holiday', 'major'],\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, and more.\n *\n * To get the title of the event a language other than English\n * with Sephardic transliterations, use the `render()` method.\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 } else 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 * 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 return this.render(locale);\n }\n /**\n * Optional holiday-specific Emoji or `null`.\n */\n getEmoji(): string | null {\n return this.emoji || null;\n }\n /**\n * Returns a simplified (untranslated) description for this event. For example,\n * the `HolidayEvent` class supports\n * \"Erev Pesach\" => \"Pesach\", and \"Sukkot III (CH''M)\" => \"Sukkot\".\n * For many holidays the basename and the event description are the same.\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 * Returns `undefined` for events with no detail page.\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 a list of event categories\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';\nimport './locale'; // 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","function clampProp(e, n, t, o, r) {\n return ba(n, ((e, n) => {\n const t = e[n];\n if (void 0 === t) {\n throw new TypeError(missingField(n));\n }\n return t;\n })(e, n), t, o, r);\n}\n\nfunction ba(e, n, t, o, r, i) {\n const a = clampNumber(n, t, o);\n if (r && n !== a) {\n throw new RangeError(numberOutOfRange(e, n, t, o, i));\n }\n return a;\n}\n\nfunction s(e) {\n return null !== e && /object|function/.test(typeof e);\n}\n\nfunction on(e, n = Map) {\n const t = new n;\n return (n, ...o) => {\n if (t.has(n)) {\n return t.get(n);\n }\n const r = e(n, ...o);\n return t.set(n, r), r;\n };\n}\n\nfunction r(e) {\n return n({\n name: e\n }, 1);\n}\n\nfunction n(n, t) {\n return e((e => ({\n value: e,\n configurable: 1,\n writable: !t\n })), n);\n}\n\nfunction t(n) {\n return e((e => ({\n get: e,\n configurable: 1\n })), n);\n}\n\nfunction o(e) {\n return {\n [Symbol.toStringTag]: {\n value: e,\n configurable: 1\n }\n };\n}\n\nfunction zipProps(e, n) {\n const t = {};\n let o = e.length;\n for (const r of n) {\n t[e[--o]] = r;\n }\n return t;\n}\n\nfunction e(e, n, t) {\n const o = {};\n for (const r in n) {\n o[r] = e(n[r], r, t);\n }\n return o;\n}\n\nfunction P(e, n, t) {\n const o = {};\n for (let r = 0; r < n.length; r++) {\n const i = n[r];\n o[i] = e(i, r, t);\n }\n return o;\n}\n\nfunction remapProps(e, n, t) {\n const o = {};\n for (let r = 0; r < e.length; r++) {\n o[n[r]] = t[e[r]];\n }\n return o;\n}\n\nfunction nn(e, n) {\n const t = Object.create(null);\n for (const o of e) {\n t[o] = n[o];\n }\n return t;\n}\n\nfunction hasAnyPropsByName(e, n) {\n for (const t of n) {\n if (t in e) {\n return 1;\n }\n }\n return 0;\n}\n\nfunction allPropsEqual(e, n, t) {\n for (const o of e) {\n if (n[o] !== t[o]) {\n return 0;\n }\n }\n return 1;\n}\n\nfunction zeroOutProps(e, n, t) {\n const o = {\n ...t\n };\n for (let t = 0; t < n; t++) {\n o[e[t]] = 0;\n }\n return o;\n}\n\nfunction gt(e, ...n) {\n return (...t) => e(...n, ...t);\n}\n\nfunction Io(e) {\n return e;\n}\n\nfunction noop() {}\n\nfunction capitalize(e) {\n return e[0].toUpperCase() + e.substring(1);\n}\n\nfunction sortStrings(e) {\n return e.slice().sort();\n}\n\nfunction padNumber(e, n) {\n return String(n).padStart(e, \"0\");\n}\n\nfunction compareNumbers(e, n) {\n return Math.sign(e - n);\n}\n\nfunction clampNumber(e, n, t) {\n return Math.min(Math.max(e, n), t);\n}\n\nfunction divModFloor(e, n) {\n return [ Math.floor(e / n), modFloor(e, n) ];\n}\n\nfunction modFloor(e, n) {\n return (e % n + n) % n;\n}\n\nfunction divModTrunc(e, n) {\n return [ divTrunc(e, n), modTrunc(e, n) ];\n}\n\nfunction divTrunc(e, n) {\n return Math.trunc(e / n) || 0;\n}\n\nfunction modTrunc(e, n) {\n return e % n || 0;\n}\n\nfunction hasHalf(e) {\n return .5 === Math.abs(e % 1);\n}\n\nfunction givenFieldsToBigNano(e, n, t) {\n let o = 0, r = 0;\n for (let i = 0; i <= n; i++) {\n const n = e[t[i]], a = Zu[i], s = go / a, [c, u] = divModTrunc(n, s);\n o += u * a, r += c;\n }\n const [i, a] = divModTrunc(o, go);\n return [ r + i, a ];\n}\n\nfunction nanoToGivenFields(e, n, t) {\n const o = {};\n for (let r = n; r >= 0; r--) {\n const n = Zu[r];\n o[t[r]] = divTrunc(e, n), e = modTrunc(e, n);\n }\n return o;\n}\n\nfunction m(e) {\n if (void 0 !== e) {\n return d(e);\n }\n}\n\nfunction g(e) {\n if (void 0 !== e) {\n return h(e);\n }\n}\n\nfunction S(e) {\n if (void 0 !== e) {\n return T(e);\n }\n}\n\nfunction h(e) {\n return requireNumberIsPositive(T(e));\n}\n\nfunction T(e) {\n return _e(rl(e));\n}\n\nfunction requirePropDefined(e, n) {\n if (null == n) {\n throw new RangeError(missingField(e));\n }\n return n;\n}\n\nfunction oa(e) {\n if (!s(e)) {\n throw new TypeError(ru);\n }\n return e;\n}\n\nfunction requireType(e, n, t = e) {\n if (typeof n !== e) {\n throw new TypeError(invalidEntity(t, n));\n }\n return n;\n}\n\nfunction _e(e, n = \"number\") {\n if (!Number.isInteger(e)) {\n throw new RangeError(expectedInteger(n, e));\n }\n return e || 0;\n}\n\nfunction requireNumberIsPositive(e, n = \"number\") {\n if (e <= 0) {\n throw new RangeError(expectedPositive(n, e));\n }\n return e;\n}\n\nfunction tu(e) {\n if (\"symbol\" == typeof e) {\n throw new TypeError(ou);\n }\n return String(e);\n}\n\nfunction toStringViaPrimitive(e, n) {\n return s(e) ? String(e) : d(e, n);\n}\n\nfunction toBigInt(e) {\n if (\"string\" == typeof e) {\n return BigInt(e);\n }\n if (\"bigint\" != typeof e) {\n throw new TypeError(invalidBigInt(e));\n }\n return e;\n}\n\nfunction toNumber(e, n = \"number\") {\n if (\"bigint\" == typeof e) {\n throw new TypeError(forbiddenBigIntToNumber(n));\n }\n if (e = Number(e), !Number.isFinite(e)) {\n throw new RangeError(expectedFinite(n, e));\n }\n return e;\n}\n\nfunction Za(e, n) {\n return Math.trunc(toNumber(e, n)) || 0;\n}\n\nfunction Ba(e, n) {\n return _e(toNumber(e, n), n);\n}\n\nfunction toPositiveInteger(e, n) {\n return requireNumberIsPositive(Za(e, n), n);\n}\n\nfunction createBigNano(e, n) {\n let [t, o] = divModTrunc(n, go), r = e + t;\n const i = Math.sign(r);\n return i && i === -Math.sign(o) && (r -= i, o += i * go), [ r, o ];\n}\n\nfunction so(e, n, t = 1) {\n return createBigNano(e[0] + n[0] * t, e[1] + n[1] * t);\n}\n\nfunction Ta(e, n) {\n return createBigNano(e[0], e[1] + n);\n}\n\nfunction va(e, n) {\n return so(n, e, -1);\n}\n\nfunction pa(e, n) {\n return compareNumbers(e[0], n[0]) || compareNumbers(e[1], n[1]);\n}\n\nfunction bigNanoOutside(e, n, t) {\n return -1 === pa(e, n) || 1 === pa(e, t);\n}\n\nfunction bigIntToBigNano(e, n = 1) {\n const t = BigInt(go / n);\n return [ Number(e / t), Number(e % t) * n ];\n}\n\nfunction Ge(e, n = 1) {\n const t = go / n, [o, r] = divModTrunc(e, t);\n return [ o, r * n ];\n}\n\nfunction bigNanoToBigInt(e, n = 1) {\n const [t, o] = e, r = Math.floor(o / n), i = go / n;\n return BigInt(t) * BigInt(i) + BigInt(r);\n}\n\nfunction La(e, n = 1, t) {\n const [o, r] = e, [i, a] = divModTrunc(r, n);\n return o * (go / n) + (i + (t ? a / n : 0));\n}\n\nfunction Oa(e) {\n return e[0] + e[1] / go;\n}\n\nfunction divModBigNano(e, n, t = divModFloor) {\n const [o, r] = e, [i, a] = t(r, n);\n return [ o * (go / n) + i, a ];\n}\n\nfunction checkIsoYearMonthInBounds(e) {\n return clampProp(e, \"isoYear\", Nl, yl, 1), e.isoYear === Nl ? clampProp(e, \"isoMonth\", 4, 12, 1) : e.isoYear === yl && clampProp(e, \"isoMonth\", 1, 9, 1), \n e;\n}\n\nfunction To(e) {\n return Do({\n ...e,\n ...At,\n isoHour: 12\n }), e;\n}\n\nfunction Do(e) {\n const n = clampProp(e, \"isoYear\", Nl, yl, 1), t = n === Nl ? 1 : n === yl ? -1 : 0;\n return t && io(ma({\n ...e,\n isoDay: e.isoDay + t,\n isoNanosecond: e.isoNanosecond - t\n })), e;\n}\n\nfunction io(e) {\n if (!e || bigNanoOutside(e, Ml, Tl)) {\n throw new RangeError(Mu);\n }\n return e;\n}\n\nfunction isoTimeFieldsToNano(e) {\n return givenFieldsToBigNano(e, 5, w)[1];\n}\n\nfunction nanoToIsoTimeAndDay(e) {\n const [n, t] = divModFloor(e, go);\n return [ nanoToGivenFields(t, 5, w), n ];\n}\n\nfunction epochNanoToSec(e) {\n return epochNanoToSecMod(e)[0];\n}\n\nfunction epochNanoToSecMod(e) {\n return divModBigNano(e, oo);\n}\n\nfunction isoToEpochMilli(e) {\n return isoArgsToEpochMilli(e.isoYear, e.isoMonth, e.isoDay, e.isoHour, e.isoMinute, e.isoSecond, e.isoMillisecond);\n}\n\nfunction ma(e) {\n const n = isoToEpochMilli(e);\n if (void 0 !== n) {\n const [t, o] = divModTrunc(n, Cu);\n return [ t, o * Ke + (e.isoMicrosecond || 0) * ro + (e.isoNanosecond || 0) ];\n }\n}\n\nfunction isoToEpochNanoWithOffset(e, n) {\n const [t, o] = nanoToIsoTimeAndDay(isoTimeFieldsToNano(e) - n);\n return io(ma({\n ...e,\n isoDay: e.isoDay + o,\n ...t\n }));\n}\n\nfunction isoArgsToEpochSec(...e) {\n return isoArgsToEpochMilli(...e) / ku;\n}\n\nfunction isoArgsToEpochMilli(...e) {\n const [n, t] = isoToLegacyDate(...e), o = n.valueOf();\n if (!isNaN(o)) {\n return o - t * Cu;\n }\n}\n\nfunction isoToLegacyDate(e, n = 1, t = 1, o = 0, r = 0, i = 0, a = 0) {\n const s = e === Nl ? 1 : e === yl ? -1 : 0, c = new Date;\n return c.setUTCHours(o, r, i, a), c.setUTCFullYear(e, n - 1, t + s), [ c, s ];\n}\n\nfunction So(e, n) {\n let [t, o] = Ta(e, n);\n o < 0 && (o += go, t -= 1);\n const [r, i] = divModFloor(o, Ke), [a, s] = divModFloor(i, ro);\n return Pa(t * Cu + r, a, s);\n}\n\nfunction Pa(e, n = 0, t = 0) {\n const o = Math.ceil(Math.max(0, Math.abs(e) - gl) / Cu) * Math.sign(e), r = new Date(e - o * Cu);\n return zipProps(pl, [ r.getUTCFullYear(), r.getUTCMonth() + 1, r.getUTCDate() + o, r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds(), r.getUTCMilliseconds(), n, t ]);\n}\n\nfunction hashIntlFormatParts(e, n) {\n if (n < -gl) {\n throw new RangeError(Mu);\n }\n const t = e.formatToParts(n), o = {};\n for (const e of t) {\n o[e.type] = e.value;\n }\n return o;\n}\n\nfunction computeIsoDay(e) {\n return e.isoDay;\n}\n\nfunction computeIsoDateParts(e) {\n return [ e.isoYear, e.isoMonth, e.isoDay ];\n}\n\nfunction computeIsoMonthCodeParts(e, n) {\n return [ n, 0 ];\n}\n\nfunction computeIsoYearMonthForMonthDay(e, n) {\n if (!n) {\n return [ Pl, e ];\n }\n}\n\nfunction computeIsoFieldsFromParts(e, n, t) {\n return {\n isoYear: e,\n isoMonth: n,\n isoDay: t\n };\n}\n\nfunction fo() {\n return 7;\n}\n\nfunction computeIsoMonthsInYear() {\n return Fl;\n}\n\nfunction computeIsoDaysInMonth(e, n) {\n switch (n) {\n case 2:\n return computeIsoInLeapYear(e) ? 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(e) {\n return computeIsoInLeapYear(e) ? 366 : 365;\n}\n\nfunction computeIsoInLeapYear(e) {\n return e % 4 == 0 && (e % 100 != 0 || e % 400 == 0);\n}\n\nfunction Ha(e) {\n const [n, t] = isoToLegacyDate(e.isoYear, e.isoMonth, e.isoDay);\n return modFloor(n.getUTCDay() - t, 7) || 7;\n}\n\nfunction computeIsoEraParts(e) {\n return this.id === Xu ? (({isoYear: e}) => e < 1 ? [ \"gregory-inverse\", 1 - e ] : [ \"gregory\", e ])(e) : this.id === el ? Ol(e) : [];\n}\n\nfunction computeJapaneseEraParts(e) {\n const n = isoToEpochMilli(e);\n if (n < El) {\n const {isoYear: n} = e;\n return n < 1 ? [ \"japanese-inverse\", 1 - n ] : [ \"japanese\", n ];\n }\n const t = hashIntlFormatParts(bf(el), n), {era: o, eraYear: r} = parseIntlYear(t, el);\n return [ o, r ];\n}\n\nfunction checkIsoDateTimeFields(e) {\n return checkIsoDateFields(e), constrainIsoTimeFields(e, 1), e;\n}\n\nfunction checkIsoDateFields(e) {\n return constrainIsoDateFields(e, 1), e;\n}\n\nfunction isIsoDateFieldsValid(e) {\n return allPropsEqual(ml, e, constrainIsoDateFields(e));\n}\n\nfunction constrainIsoDateFields(e, n) {\n const {isoYear: t} = e, o = clampProp(e, \"isoMonth\", 1, computeIsoMonthsInYear(), n);\n return {\n isoYear: t,\n isoMonth: o,\n isoDay: clampProp(e, \"isoDay\", 1, computeIsoDaysInMonth(t, o), n)\n };\n}\n\nfunction constrainIsoTimeFields(e, n) {\n return zipProps(w, [ clampProp(e, \"isoHour\", 0, 23, n), clampProp(e, \"isoMinute\", 0, 59, n), clampProp(e, \"isoSecond\", 0, 59, n), clampProp(e, \"isoMillisecond\", 0, 999, n), clampProp(e, \"isoMicrosecond\", 0, 999, n), clampProp(e, \"isoNanosecond\", 0, 999, n) ]);\n}\n\nfunction dt(e) {\n return void 0 === e ? 0 : Gl(oa(e));\n}\n\nfunction je(e, n = 0) {\n e = normalizeOptions(e);\n const t = Vl(e), o = _l(e, n);\n return [ Gl(e), o, t ];\n}\n\nfunction refineDiffOptions(e, n, t, o = 9, r = 0, i = 4) {\n n = normalizeOptions(n);\n let a = $l(n, o, r), s = parseRoundingIncInteger(n), c = Xl(n, i);\n const u = xl(n, o, r, 1);\n return null == a ? a = Math.max(t, u) : checkLargestSmallestUnit(a, u), s = refineRoundingInc(s, u, 1), \n e && (c = (e => e < 4 ? (e + 2) % 4 : e)(c)), [ a, u, s, c ];\n}\n\nfunction refineRoundingOptions(e, n = 6, t) {\n let o = parseRoundingIncInteger(e = normalizeOptionsOrString(e, bl));\n const r = Xl(e, 7);\n let i = xl(e, n);\n return i = requirePropDefined(bl, i), o = refineRoundingInc(o, i, void 0, t), [ i, o, r ];\n}\n\nfunction refineRoundingMathOptions(e, n, t) {\n let o = parseRoundingIncInteger(n = normalizeOptionsOrString(n, wl));\n const r = Xl(n, 7);\n return o = refineRoundingInc(o, e, t), [ o, r ];\n}\n\nfunction Ma(e, n) {\n return void 0 !== n ? refineRoundingMathOptions(e, n, 1) : [];\n}\n\nfunction co(e, n) {\n return void 0 !== n ? refineRoundingMathOptions(e, n) : [ 1, 7 ];\n}\n\nfunction refineDateDisplayOptions(e) {\n return Jl(normalizeOptions(e));\n}\n\nfunction refineTimeDisplayOptions(e, n) {\n return refineTimeDisplayTuple(normalizeOptions(e), n);\n}\n\nfunction Ze(e) {\n const n = normalizeOptionsOrString(e, kl), t = refineChoiceOption(kl, Wl, n, 0);\n if (!t) {\n throw new RangeError(invalidEntity(kl, t));\n }\n return t;\n}\n\nfunction refineTimeDisplayTuple(e, n = 4) {\n const t = refineSubsecDigits(e);\n return [ Xl(e, 4), ...refineSmallestUnitAndSubsecDigits(xl(e, n), t) ];\n}\n\nfunction refineSmallestUnitAndSubsecDigits(e, n) {\n return null != e ? [ Zu[e], e < 4 ? 9 - 3 * e : -1 ] : [ void 0 === n ? 1 : 10 ** (9 - n), n ];\n}\n\nfunction parseRoundingIncInteger(e) {\n const n = e[Bl];\n return void 0 === n ? 1 : Za(n, Bl);\n}\n\nfunction refineRoundingInc(e, n, t, o) {\n const r = o ? go : Zu[n + 1];\n if (r) {\n const t = Zu[n];\n if (r % ((e = ba(Bl, e, 1, r / t - (o ? 0 : 1), 1)) * t)) {\n throw new RangeError(invalidEntity(Bl, e));\n }\n } else {\n e = ba(Bl, e, 1, t ? 10 ** 9 : 1, 1);\n }\n return e;\n}\n\nfunction refineSubsecDigits(e) {\n let n = e[Yl];\n if (void 0 !== n) {\n if (\"number\" != typeof n) {\n if (\"auto\" === tu(n)) {\n return;\n }\n throw new RangeError(invalidEntity(Yl, n));\n }\n n = ba(Yl, Math.floor(n), 0, 9, 1);\n }\n return n;\n}\n\nfunction normalizeOptions(e) {\n return void 0 === e ? {} : oa(e);\n}\n\nfunction normalizeOptionsOrString(e, n) {\n return \"string\" == typeof e ? {\n [n]: e\n } : oa(e);\n}\n\nfunction fabricateOverflowOptions(e) {\n return {\n overflow: Rl[e]\n };\n}\n\nfunction refineUnitOption(e, n, t = 9, o = 0, r) {\n let i = n[e];\n if (void 0 === i) {\n return r ? o : void 0;\n }\n if (i = tu(i), \"auto\" === i) {\n return r ? o : null;\n }\n let a = Bu[i];\n if (void 0 === a && (a = ul[i]), void 0 === a) {\n throw new RangeError(invalidChoice(e, i, Bu));\n }\n return ba(e, a, o, t, 1, Yu), a;\n}\n\nfunction refineChoiceOption(e, n, t, o = 0) {\n const r = t[e];\n if (void 0 === r) {\n return o;\n }\n const i = tu(r), a = n[i];\n if (void 0 === a) {\n throw new RangeError(invalidChoice(e, i, n));\n }\n return a;\n}\n\nfunction checkLargestSmallestUnit(e, n) {\n if (n > e) {\n throw new RangeError(Eu);\n }\n}\n\nfunction xe(e) {\n return {\n branding: Re,\n epochNanoseconds: e\n };\n}\n\nfunction Xe(e, n, t) {\n return {\n branding: _,\n calendar: t,\n timeZone: n,\n epochNanoseconds: e\n };\n}\n\nfunction jt(e, n = e.calendar) {\n return {\n branding: x,\n calendar: n,\n ...nn(Il, e)\n };\n}\n\nfunction W(e, n = e.calendar) {\n return {\n branding: G,\n calendar: n,\n ...nn(Ca, e)\n };\n}\n\nfunction createPlainYearMonthSlots(e, n = e.calendar) {\n return {\n branding: Qt,\n calendar: n,\n ...nn(Ca, e)\n };\n}\n\nfunction createPlainMonthDaySlots(e, n = e.calendar) {\n return {\n branding: qt,\n calendar: n,\n ...nn(Ca, e)\n };\n}\n\nfunction St(e) {\n return {\n branding: ft,\n ...nn(hl, e)\n };\n}\n\nfunction pe(e) {\n return {\n branding: A,\n sign: computeDurationSign(e),\n ...nn(il, e)\n };\n}\n\nfunction ta(e) {\n return epochNanoToSec(e.epochNanoseconds);\n}\n\nfunction I(e) {\n return divModBigNano(e.epochNanoseconds, Ke)[0];\n}\n\nfunction aa(e) {\n return bigNanoToBigInt(e.epochNanoseconds, ro);\n}\n\nfunction b(e) {\n return bigNanoToBigInt(e.epochNanoseconds);\n}\n\nfunction fa(e) {\n return e.epochNanoseconds;\n}\n\nfunction J(e, n, t, o, r) {\n const i = getMaxDurationUnit(o), [a, s] = ((e, n) => {\n const t = n((e = normalizeOptionsOrString(e, Sl))[Cl]);\n let o = Hl(e);\n return o = requirePropDefined(Sl, o), [ o, t ];\n })(r, e), c = Math.max(a, i);\n if (!s && isUniformUnit(c, s)) {\n return totalDayTimeDuration(o, a);\n }\n if (!s) {\n throw new RangeError(vu);\n }\n if (!o.sign) {\n return 0;\n }\n const [u, l, f] = createMarkerSystem(n, t, s), d = createMarkerToEpochNano(f), m = createMoveMarker(f), p = createDiffMarkers(f), h = m(l, u, o);\n isZonedEpochSlots(s) || (Do(u), Do(h));\n const I = p(l, u, h, a);\n return isUniformUnit(a, s) ? totalDayTimeDuration(I, a) : ya(I, d(h), a, l, u, d, m);\n}\n\nfunction ya(e, n, t, o, r, i, a) {\n const s = computeDurationSign(e), [c, u] = clampRelativeDuration(o, dl(t, e), t, s, r, i, a), l = ja(n, c, u);\n return e[O[t]] + l * s;\n}\n\nfunction totalDayTimeDuration(e, n) {\n return La(durationFieldsToBigNano(e), Zu[n], 1);\n}\n\nfunction clampRelativeDuration(e, n, t, o, r, i, a) {\n const s = O[t], c = {\n ...n,\n [s]: n[s] + o\n }, u = a(e, r, n), l = a(e, r, c);\n return [ i(u), i(l) ];\n}\n\nfunction ja(e, n, t) {\n const o = La(va(n, t));\n if (!o) {\n throw new RangeError(du);\n }\n return La(va(n, e)) / o;\n}\n\nfunction Le(e, n) {\n const [t, o, r] = refineRoundingOptions(n, 5, 1);\n return xe(roundBigNano(e.epochNanoseconds, t, o, r, 1));\n}\n\nfunction Ie(e, n, t) {\n let {epochNanoseconds: o, timeZone: r, calendar: i} = n;\n const [a, s, c] = refineRoundingOptions(t);\n if (0 === a && 1 === s) {\n return n;\n }\n const u = e(r);\n if (6 === a) {\n o = uo(computeDayInterval, u, n, c);\n } else {\n const e = u.N(o);\n o = getMatchingInstantFor(u, roundDateTime(So(o, e), a, s, c), e, 2, 0, 1);\n }\n return Xe(o, r, i);\n}\n\nfunction bt(e, n) {\n return jt(roundDateTime(e, ...refineRoundingOptions(n)), e.calendar);\n}\n\nfunction lt(e, n) {\n const [t, o, r] = refineRoundingOptions(n, 5);\n var i;\n return St((i = r, roundTimeToNano(e, computeNanoInc(t, o), i)[0]));\n}\n\nfunction Te(e, n) {\n const t = e(n.timeZone), o = he(n, t), [r, i] = computeDayInterval(o), a = La(va(getStartOfDayInstantFor(t, r), getStartOfDayInstantFor(t, i)), no, 1);\n if (a <= 0) {\n throw new RangeError(du);\n }\n return a;\n}\n\nfunction be(e, n) {\n const {timeZone: t, calendar: o} = n;\n return Xe(lo(ho, e(t), n), t, o);\n}\n\nfunction lo(e, n, t) {\n return getStartOfDayInstantFor(n, e(he(t, n)));\n}\n\nfunction uo(e, n, t, o) {\n const r = he(t, n), [i, a] = e(r), s = t.epochNanoseconds, c = getStartOfDayInstantFor(n, i), u = getStartOfDayInstantFor(n, a);\n if (bigNanoOutside(s, c, u)) {\n throw new RangeError(du);\n }\n return Ea(ja(s, c, u), o) ? u : c;\n}\n\nfunction roundDateTime(e, n, t, o) {\n return roundDateTimeToNano(e, computeNanoInc(n, t), o);\n}\n\nfunction roundDateTimeToNano(e, n, t) {\n const [o, r] = roundTimeToNano(e, n, t);\n return Do({\n ...Ua(e, r),\n ...o\n });\n}\n\nfunction roundTimeToNano(e, n, t) {\n return nanoToIsoTimeAndDay(Da(isoTimeFieldsToNano(e), n, t));\n}\n\nfunction roundToMinute(e) {\n return Da(e, ao, 7);\n}\n\nfunction computeNanoInc(e, n) {\n return Zu[e] * n;\n}\n\nfunction computeDayInterval(e) {\n const n = ho(e);\n return [ n, Ua(n, 1) ];\n}\n\nfunction ho(e) {\n return Ra(6, e);\n}\n\nfunction roundDayTimeDurationByInc(e, n, t) {\n const o = Math.min(getMaxDurationUnit(e), 6);\n return nanoToDurationDayTimeFields(Ya(durationFieldsToBigNano(e, o), n, t), o);\n}\n\nfunction roundRelativeDuration(e, n, t, o, r, i, a, s, c, u) {\n if (0 === o && 1 === r) {\n return e;\n }\n const l = isUniformUnit(o, s) ? isZonedEpochSlots(s) && o < 6 && t >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;\n let [f, d, m] = l(e, n, t, o, r, i, a, s, c, u);\n return m && 7 !== o && (f = ((e, n, t, o, r, i, a, s) => {\n const c = computeDurationSign(e);\n for (let u = o + 1; u <= t; u++) {\n if (7 === u && 7 !== t) {\n continue;\n }\n const o = dl(u, e);\n o[O[u]] += c;\n const l = La(va(a(s(r, i, o)), n));\n if (l && Math.sign(l) !== c) {\n break;\n }\n e = o;\n }\n return e;\n })(f, d, t, Math.max(6, o), a, s, c, u)), f;\n}\n\nfunction roundBigNano(e, n, t, o, r) {\n return 6 === n ? [ Da(Oa(e), t, o), 0 ] : Ya(e, computeNanoInc(n, t), o, r);\n}\n\nfunction Ya(e, n, t, o) {\n let [r, i] = e;\n o && i < 0 && (i += go, r -= 1);\n const [a, s] = divModFloor(Da(i, n, t), go);\n return createBigNano(r + a, s);\n}\n\nfunction Da(e, n, t) {\n return Ea(e / n, t) * n;\n}\n\nfunction Ea(e, n) {\n return ef[n](e);\n}\n\nfunction nudgeDayTimeDuration(e, n, t, o, r, i) {\n const a = computeDurationSign(e), s = durationFieldsToBigNano(e), c = roundBigNano(s, o, r, i), u = va(s, c), l = Math.sign(c[0] - s[0]) === a, f = nanoToDurationDayTimeFields(c, Math.min(t, 6));\n return [ {\n ...e,\n ...f\n }, so(n, u), l ];\n}\n\nfunction nudgeZonedTimeDuration(e, n, t, o, r, i, a, s, c, u) {\n const l = computeDurationSign(e) || 1, f = La(durationFieldsToBigNano(e, 5)), d = computeNanoInc(o, r);\n let m = Da(f, d, i);\n const [p, h] = clampRelativeDuration(a, {\n ...e,\n ...fl\n }, 6, l, s, c, u), I = m - La(va(p, h));\n let D = 0;\n I && Math.sign(I) !== l ? n = Ta(p, m) : (D += l, m = Da(I, d, i), n = Ta(h, m));\n const g = nanoToDurationTimeFields(m);\n return [ {\n ...e,\n ...g,\n days: e.days + D\n }, n, Boolean(D) ];\n}\n\nfunction nudgeRelativeDuration(e, n, t, o, r, i, a, s, c, u) {\n const l = computeDurationSign(e), f = O[o], d = dl(o, e);\n 7 === o && (e = {\n ...e,\n weeks: e.weeks + Math.trunc(e.days / 7)\n });\n const m = divTrunc(e[f], r) * r;\n d[f] = m;\n const [p, h] = clampRelativeDuration(a, d, o, r * l, s, c, u), I = m + ja(n, p, h) * l * r, D = Da(I, r, i), g = Math.sign(D - I) === l;\n return d[f] = D, [ d, g ? h : p, g ];\n}\n\nfunction ke(e, n, t, o) {\n const [r, i, a, s] = (e => {\n const n = refineTimeDisplayTuple(e = normalizeOptions(e));\n return [ e.timeZone, ...n ];\n })(o), c = void 0 !== r;\n return ((e, n, t, o, r, i) => {\n t = Ya(t, r, o, 1);\n const a = n.N(t);\n return formatIsoDateTimeFields(So(t, a), i) + (e ? Se(roundToMinute(a)) : \"Z\");\n })(c, n(c ? e(r) : nf), t.epochNanoseconds, i, a, s);\n}\n\nfunction Fe(e, n, t) {\n const [o, r, i, a, s, c] = (e => {\n e = normalizeOptions(e);\n const n = Jl(e), t = refineSubsecDigits(e), o = Ql(e), r = Xl(e, 4), i = xl(e, 4);\n return [ n, Kl(e), o, r, ...refineSmallestUnitAndSubsecDigits(i, t) ];\n })(t);\n return ((e, n, t, o, r, i, a, s, c, u) => {\n o = Ya(o, c, s, 1);\n const l = e(t).N(o);\n return formatIsoDateTimeFields(So(o, l), u) + Se(roundToMinute(l), a) + ((e, n) => 1 !== n ? \"[\" + (2 === n ? \"!\" : \"\") + e + \"]\" : \"\")(t, i) + formatCalendar(n, r);\n })(e, n.calendar, n.timeZone, n.epochNanoseconds, o, r, i, a, s, c);\n}\n\nfunction Ft(e, n) {\n const [t, o, r, i] = (e => (e = normalizeOptions(e), [ Jl(e), ...refineTimeDisplayTuple(e) ]))(n);\n return a = e.calendar, s = t, c = i, formatIsoDateTimeFields(roundDateTimeToNano(e, r, o), c) + formatCalendar(a, s);\n var a, s, c;\n}\n\nfunction ce(e, n) {\n return t = e.calendar, o = e, r = refineDateDisplayOptions(n), formatIsoDateFields(o) + formatCalendar(t, r);\n var t, o, r;\n}\n\nfunction Ht(e, n) {\n return formatDateLikeIso(e.calendar, formatIsoYearMonthFields, e, refineDateDisplayOptions(n));\n}\n\nfunction Jt(e, n) {\n return formatDateLikeIso(e.calendar, formatIsoMonthDayFields, e, refineDateDisplayOptions(n));\n}\n\nfunction ct(e, n) {\n const [t, o, r] = refineTimeDisplayOptions(n);\n return i = r, formatIsoTimeFields(roundTimeToNano(e, o, t)[0], i);\n var i;\n}\n\nfunction k(e, n) {\n const [t, o, r] = refineTimeDisplayOptions(n, 3);\n return o > 1 && checkDurationUnits(e = {\n ...e,\n ...roundDayTimeDurationByInc(e, o, t)\n }), ((e, n) => {\n const {sign: t} = e, o = -1 === t ? negateDurationFields(e) : e, {hours: r, minutes: i} = o, [a, s] = divModBigNano(durationFieldsToBigNano(o, 3), oo, divModTrunc);\n checkDurationTimeUnit(a);\n const c = formatSubsecNano(s, n), u = n >= 0 || !t || c;\n return (t < 0 ? \"-\" : \"\") + \"P\" + formatDurationFragments({\n Y: formatDurationNumber(o.years),\n M: formatDurationNumber(o.months),\n W: formatDurationNumber(o.weeks),\n D: formatDurationNumber(o.days)\n }) + (r || i || a || u ? \"T\" + formatDurationFragments({\n H: formatDurationNumber(r),\n M: formatDurationNumber(i),\n S: formatDurationNumber(a, u) + c\n }) : \"\");\n })(e, r);\n}\n\nfunction formatDateLikeIso(e, n, t, o) {\n const r = o > 1 || 0 === o && e !== l;\n return 1 === o ? e === l ? n(t) : formatIsoDateFields(t) : r ? formatIsoDateFields(t) + formatCalendarId(e, 2 === o) : n(t);\n}\n\nfunction formatDurationFragments(e) {\n const n = [];\n for (const t in e) {\n const o = e[t];\n o && n.push(o, t);\n }\n return n.join(\"\");\n}\n\nfunction formatIsoDateTimeFields(e, n) {\n return formatIsoDateFields(e) + \"T\" + formatIsoTimeFields(e, n);\n}\n\nfunction formatIsoDateFields(e) {\n return formatIsoYearMonthFields(e) + \"-\" + wu(e.isoDay);\n}\n\nfunction formatIsoYearMonthFields(e) {\n const {isoYear: n} = e;\n return (n < 0 || n > 9999 ? getSignStr(n) + padNumber(6, Math.abs(n)) : padNumber(4, n)) + \"-\" + wu(e.isoMonth);\n}\n\nfunction formatIsoMonthDayFields(e) {\n return wu(e.isoMonth) + \"-\" + wu(e.isoDay);\n}\n\nfunction formatIsoTimeFields(e, n) {\n const t = [ wu(e.isoHour), wu(e.isoMinute) ];\n return -1 !== n && t.push(wu(e.isoSecond) + ((e, n, t, o) => formatSubsecNano(e * Ke + n * ro + t, o))(e.isoMillisecond, e.isoMicrosecond, e.isoNanosecond, n)), \n t.join(\":\");\n}\n\nfunction Se(e, n = 0) {\n if (1 === n) {\n return \"\";\n }\n const [t, o] = divModFloor(Math.abs(e), no), [r, i] = divModFloor(o, ao), [a, s] = divModFloor(i, oo);\n return getSignStr(e) + wu(t) + \":\" + wu(r) + (a || s ? \":\" + wu(a) + formatSubsecNano(s) : \"\");\n}\n\nfunction formatCalendar(e, n) {\n return 1 !== n && (n > 1 || 0 === n && e !== l) ? formatCalendarId(e, 2 === n) : \"\";\n}\n\nfunction formatCalendarId(e, n) {\n return \"[\" + (n ? \"!\" : \"\") + \"u-ca=\" + e + \"]\";\n}\n\nfunction formatSubsecNano(e, n) {\n let t = padNumber(9, e);\n return t = void 0 === n ? t.replace(af, \"\") : t.slice(0, n), t ? \".\" + t : \"\";\n}\n\nfunction getSignStr(e) {\n return e < 0 ? \"-\" : \"+\";\n}\n\nfunction formatDurationNumber(e, n) {\n return e || n ? e.toLocaleString(\"fullwide\", {\n useGrouping: 0\n }) : \"\";\n}\n\nfunction _zonedEpochSlotsToIso(e, n) {\n const {epochNanoseconds: t} = e, o = (n.N ? n : n(e.timeZone)).N(t), r = So(t, o);\n return {\n calendar: e.calendar,\n ...r,\n offsetNanoseconds: o\n };\n}\n\nfunction Ja(e, n) {\n const t = he(n, e);\n return {\n calendar: n.calendar,\n ...nn(Il, t),\n offset: Se(t.offsetNanoseconds),\n timeZone: n.timeZone\n };\n}\n\nfunction getMatchingInstantFor(e, n, t, o = 0, r = 0, i, a) {\n if (void 0 !== t && 1 === o && (1 === o || a)) {\n return isoToEpochNanoWithOffset(n, t);\n }\n const s = e.v(n);\n if (void 0 !== t && 3 !== o) {\n const e = ((e, n, t, o) => {\n const r = ma(n);\n o && (t = roundToMinute(t));\n for (const n of e) {\n let e = La(va(n, r));\n if (o && (e = roundToMinute(e)), e === t) {\n return n;\n }\n }\n })(s, n, t, i);\n if (void 0 !== e) {\n return e;\n }\n if (0 === o) {\n throw new RangeError(gu);\n }\n }\n return a ? ma(n) : $o(e, n, r, s);\n}\n\nfunction $o(e, n, t = 0, o = e.v(n)) {\n if (1 === o.length) {\n return o[0];\n }\n if (1 === t) {\n throw new RangeError(Tu);\n }\n if (o.length) {\n return o[3 === t ? 1 : 0];\n }\n const r = ma(n), i = ((e, n) => {\n const t = e.N(Ta(n, -go));\n return (e => {\n if (e > go) {\n throw new RangeError(Du);\n }\n return e;\n })(e.N(Ta(n, go)) - t);\n })(e, r), a = i * (2 === t ? -1 : 1);\n return (o = e.v(So(r, a)))[2 === t ? 0 : o.length - 1];\n}\n\nfunction getStartOfDayInstantFor(e, n) {\n const t = e.v(n);\n if (t.length) {\n return t[0];\n }\n const o = Ta(ma(n), -go);\n return e.l(o, 1);\n}\n\nfunction Ye(e, n, t) {\n return xe(io(so(n.epochNanoseconds, (e => {\n if (durationHasDateParts(e)) {\n throw new RangeError(Pu);\n }\n return durationFieldsToBigNano(e, 5);\n })(e ? negateDurationFields(t) : t))));\n}\n\nfunction Oe(e, n, t, o, r, i = Object.create(null)) {\n const a = n(o.timeZone), s = e(o.calendar);\n return {\n ...o,\n ...Fa(a, s, o, t ? negateDurationFields(r) : r, i)\n };\n}\n\nfunction wt(e, n, t, o, r = Object.create(null)) {\n const {calendar: i} = t;\n return jt(ka(e(i), t, n ? negateDurationFields(o) : o, r), i);\n}\n\nfunction ne(e, n, t, o, r) {\n const {calendar: i} = t;\n return W(moveDate(e(i), t, n ? negateDurationFields(o) : o, r), i);\n}\n\nfunction Gt(e, n, t, o, r) {\n const i = t.calendar, a = e(i);\n let s = To(Na(a, t));\n n && (o = B(o)), o.sign < 0 && (s = a.P(s, {\n ...ll,\n months: 1\n }), s = Ua(s, -1));\n const c = a.P(s, o, r);\n return createPlainYearMonthSlots(Na(a, c), i);\n}\n\nfunction at(e, n, t) {\n return St(moveTime(n, e ? negateDurationFields(t) : t)[0]);\n}\n\nfunction Fa(e, n, t, o, r) {\n const i = durationFieldsToBigNano(o, 5);\n let a = t.epochNanoseconds;\n if (durationHasDateParts(o)) {\n const s = he(t, e);\n a = so($o(e, {\n ...moveDate(n, s, {\n ...o,\n ...fl\n }, r),\n ...nn(w, s)\n }), i);\n } else {\n a = so(a, i), dt(r);\n }\n return {\n epochNanoseconds: io(a)\n };\n}\n\nfunction ka(e, n, t, o) {\n const [r, i] = moveTime(n, t);\n return Do({\n ...moveDate(e, n, {\n ...t,\n ...fl,\n days: t.days + i\n }, o),\n ...r\n });\n}\n\nfunction moveDate(e, n, t, o) {\n if (t.years || t.months || t.weeks) {\n return e.P(n, t, o);\n }\n dt(o);\n const r = t.days + durationFieldsToBigNano(t, 5)[0];\n return r ? To(Ua(n, r)) : n;\n}\n\nfunction Na(e, n, t = 1) {\n return Ua(n, t - e.day(n));\n}\n\nfunction moveTime(e, n) {\n const [t, o] = durationFieldsToBigNano(n, 5), [r, i] = nanoToIsoTimeAndDay(isoTimeFieldsToNano(e) + o);\n return [ r, t + i ];\n}\n\nfunction nativeDateAdd(e, n, t) {\n const o = dt(t);\n let r, {years: i, months: a, weeks: s, days: c} = n;\n if (c += durationFieldsToBigNano(n, 5)[0], i || a) {\n r = wa(this, e, i, a, o);\n } else {\n if (!s && !c) {\n return e;\n }\n r = isoToEpochMilli(e);\n }\n if (void 0 === r) {\n throw new RangeError(Mu);\n }\n return r += (7 * s + c) * Cu, To(Pa(r));\n}\n\nfunction wa(e, n, t, o, r) {\n let [i, a, s] = e.u(n);\n if (t) {\n const [n, o] = e.m(i, a);\n i += t, a = monthCodeNumberToMonth(n, o, e.F(i)), a = ba(\"month\", a, 1, e.O(i), r);\n }\n return o && ([i, a] = e.p(i, a, o)), s = ba(\"day\", s, 1, e.B(i, a), r), e.M(i, a, s);\n}\n\nfunction isoMonthAdd(e, n, t) {\n return e += divTrunc(t, Fl), (n += modTrunc(t, Fl)) < 1 ? (e--, n += Fl) : n > Fl && (e++, \n n -= Fl), [ e, n ];\n}\n\nfunction intlMonthAdd(e, n, t) {\n if (t) {\n if (n += t, !Number.isSafeInteger(n)) {\n throw new RangeError(Mu);\n }\n if (t < 0) {\n for (;n < 1; ) {\n n += computeIntlMonthsInYear.call(this, --e);\n }\n } else {\n let t;\n for (;n > (t = computeIntlMonthsInYear.call(this, e)); ) {\n n -= t, e++;\n }\n }\n }\n return [ e, n ];\n}\n\nfunction Ua(e, n) {\n return n ? {\n ...e,\n ...Pa(isoToEpochMilli(e) + n * Cu)\n } : e;\n}\n\nfunction createMarkerSystem(e, n, t) {\n const o = e(t.calendar);\n return isZonedEpochSlots(t) ? [ t, o, n(t.timeZone) ] : [ {\n ...t,\n ...At\n }, o ];\n}\n\nfunction createMarkerToEpochNano(e) {\n return e ? fa : ma;\n}\n\nfunction createMoveMarker(e) {\n return e ? gt(Fa, e) : ka;\n}\n\nfunction createDiffMarkers(e) {\n return e ? gt(diffZonedEpochsExact, e) : diffDateTimesExact;\n}\n\nfunction isZonedEpochSlots(e) {\n return e && e.epochNanoseconds;\n}\n\nfunction isUniformUnit(e, n) {\n return e <= 6 - (isZonedEpochSlots(n) ? 1 : 0);\n}\n\nfunction E(e, n, t, o, r, i, a) {\n const s = e(normalizeOptions(a).relativeTo), c = Math.max(getMaxDurationUnit(r), getMaxDurationUnit(i));\n if (isUniformUnit(c, s)) {\n return pe(checkDurationUnits(((e, n, t, o) => {\n const r = so(durationFieldsToBigNano(e), durationFieldsToBigNano(n), o ? -1 : 1);\n if (!Number.isFinite(r[0])) {\n throw new RangeError(Mu);\n }\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(r, t)\n };\n })(r, i, c, o)));\n }\n if (!s) {\n throw new RangeError(vu);\n }\n o && (i = negateDurationFields(i));\n const [u, l, f] = createMarkerSystem(n, t, s), d = createMoveMarker(f), m = createDiffMarkers(f), p = d(l, u, r);\n return pe(m(l, u, d(l, p, i), c));\n}\n\nfunction V(e, n, t, o, r) {\n const i = getMaxDurationUnit(o), [a, s, c, u, l] = ((e, n, t) => {\n e = normalizeOptionsOrString(e, bl);\n let o = $l(e);\n const r = t(e[Cl]);\n let i = parseRoundingIncInteger(e);\n const a = Xl(e, 7);\n let s = xl(e);\n if (void 0 === o && void 0 === s) {\n throw new RangeError(Fu);\n }\n if (null == s && (s = 0), null == o && (o = Math.max(s, n)), checkLargestSmallestUnit(o, s), \n i = refineRoundingInc(i, s, 1), i > 1 && s > 5 && o !== s) {\n throw new RangeError(\"For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit\");\n }\n return [ o, s, i, a, r ];\n })(r, i, e), f = Math.max(i, a);\n if (!l && f <= 6) {\n return pe(checkDurationUnits(((e, n, t, o, r) => {\n const i = roundBigNano(durationFieldsToBigNano(e), t, o, r);\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(i, n)\n };\n })(o, a, s, c, u)));\n }\n if (!isZonedEpochSlots(l) && !o.sign) {\n return o;\n }\n if (!l) {\n throw new RangeError(vu);\n }\n const [d, m, p] = createMarkerSystem(n, t, l), h = createMarkerToEpochNano(p), I = createMoveMarker(p), D = createDiffMarkers(p), g = I(m, d, o);\n isZonedEpochSlots(l) || (Do(d), Do(g));\n let T = D(m, d, g, a);\n const M = o.sign, y = computeDurationSign(T);\n if (M && y && M !== y) {\n throw new RangeError(du);\n }\n return T = roundRelativeDuration(T, h(g), a, s, c, u, m, d, h, I), pe(T);\n}\n\nfunction Y(e) {\n return -1 === e.sign ? B(e) : e;\n}\n\nfunction B(e) {\n return pe(negateDurationFields(e));\n}\n\nfunction negateDurationFields(e) {\n const n = {};\n for (const t of O) {\n n[t] = -1 * e[t] || 0;\n }\n return n;\n}\n\nfunction y(e) {\n return !e.sign;\n}\n\nfunction computeDurationSign(e, n = O) {\n let t = 0;\n for (const o of n) {\n const n = Math.sign(e[o]);\n if (n) {\n if (t && t !== n) {\n throw new RangeError(Nu);\n }\n t = n;\n }\n }\n return t;\n}\n\nfunction checkDurationUnits(e) {\n for (const n of cl) {\n ba(n, e[n], -sf, sf, 1);\n }\n return checkDurationTimeUnit(La(durationFieldsToBigNano(e), oo)), e;\n}\n\nfunction checkDurationTimeUnit(e) {\n if (!Number.isSafeInteger(e)) {\n throw new RangeError(yu);\n }\n}\n\nfunction durationFieldsToBigNano(e, n = 6) {\n return givenFieldsToBigNano(e, n, O);\n}\n\nfunction nanoToDurationDayTimeFields(e, n = 6) {\n const [t, o] = e, r = nanoToGivenFields(o, n, O);\n if (r[O[n]] += t * (go / Zu[n]), !Number.isFinite(r[O[n]])) {\n throw new RangeError(Mu);\n }\n return r;\n}\n\nfunction nanoToDurationTimeFields(e, n = 5) {\n return nanoToGivenFields(e, n, O);\n}\n\nfunction durationHasDateParts(e) {\n return Boolean(computeDurationSign(e, sl));\n}\n\nfunction getMaxDurationUnit(e) {\n let n = 9;\n for (;n > 0 && !e[O[n]]; n--) {}\n return n;\n}\n\nfunction createSplitTuple(e, n) {\n return [ e, n ];\n}\n\nfunction computePeriod(e) {\n const n = Math.floor(e / tf) * tf;\n return [ n, n + tf ];\n}\n\nfunction We(e) {\n const n = parseDateTimeLike(e = toStringViaPrimitive(e));\n if (!n) {\n throw new RangeError(failedParse(e));\n }\n let t;\n if (n.C) {\n t = 0;\n } else {\n if (!n.offset) {\n throw new RangeError(failedParse(e));\n }\n t = parseOffsetNano(n.offset);\n }\n return n.timeZone && parseOffsetNanoMaybe(n.timeZone, 1), xe(isoToEpochNanoWithOffset(checkIsoDateTimeFields(n), t));\n}\n\nfunction $(e) {\n const n = parseDateTimeLike(d(e));\n if (!n) {\n throw new RangeError(failedParse(e));\n }\n if (n.timeZone) {\n return finalizeZonedDateTime(n, n.offset ? parseOffsetNano(n.offset) : void 0);\n }\n if (n.C) {\n throw new RangeError(failedParse(e));\n }\n return finalizeDate(n);\n}\n\nfunction Ne(e, n) {\n const t = parseDateTimeLike(d(e));\n if (!t || !t.timeZone) {\n throw new RangeError(failedParse(e));\n }\n const {offset: o} = t, r = o ? parseOffsetNano(o) : void 0, [, i, a] = je(n);\n return finalizeZonedDateTime(t, r, i, a);\n}\n\nfunction parseOffsetNano(e) {\n const n = parseOffsetNanoMaybe(e);\n if (void 0 === n) {\n throw new RangeError(failedParse(e));\n }\n return n;\n}\n\nfunction Bt(e) {\n const n = parseDateTimeLike(d(e));\n if (!n || n.C) {\n throw new RangeError(failedParse(e));\n }\n return jt(finalizeDateTime(n));\n}\n\nfunction me(e, n, t) {\n let o = parseDateTimeLike(d(e));\n if (!o || o.C) {\n throw new RangeError(failedParse(e));\n }\n return n ? o.calendar === l && (o = -271821 === o.isoYear && 4 === o.isoMonth ? {\n ...o,\n isoDay: 20,\n ...At\n } : {\n ...o,\n isoDay: 1,\n ...At\n }) : t && o.calendar === l && (o = {\n ...o,\n isoYear: Pl\n }), W(o.k ? finalizeDateTime(o) : finalizeDate(o));\n}\n\nfunction Xt(e, n) {\n const t = parseYearMonthOnly(d(n));\n if (t) {\n return requireIsoCalendar(t), createPlainYearMonthSlots(checkIsoYearMonthInBounds(checkIsoDateFields(t)));\n }\n const o = me(n, 1);\n return createPlainYearMonthSlots(Na(e(o.calendar), o));\n}\n\nfunction requireIsoCalendar(e) {\n if (e.calendar !== l) {\n throw new RangeError(invalidSubstring(e.calendar));\n }\n}\n\nfunction xt(e, n) {\n const t = parseMonthDayOnly(d(n));\n if (t) {\n return requireIsoCalendar(t), createPlainMonthDaySlots(checkIsoDateFields(t));\n }\n const o = me(n, 0, 1), {calendar: r} = o, i = e(r), [a, s, c] = i.u(o), [u, l] = i.m(a, s), [f, m] = i.R(u, l, c);\n return createPlainMonthDaySlots(To(i.U(f, m, c)), r);\n}\n\nfunction ht(e) {\n let n, t = (e => {\n const n = Tf.exec(e);\n return n ? (organizeAnnotationParts(n[10]), organizeTimeParts(n)) : void 0;\n })(d(e));\n if (!t) {\n if (t = parseDateTimeLike(e), !t) {\n throw new RangeError(failedParse(e));\n }\n if (!t.k) {\n throw new RangeError(failedParse(e));\n }\n if (t.C) {\n throw new RangeError(invalidSubstring(\"Z\"));\n }\n requireIsoCalendar(t);\n }\n if ((n = parseYearMonthOnly(e)) && isIsoDateFieldsValid(n)) {\n throw new RangeError(failedParse(e));\n }\n if ((n = parseMonthDayOnly(e)) && isIsoDateFieldsValid(n)) {\n throw new RangeError(failedParse(e));\n }\n return St(constrainIsoTimeFields(t, 1));\n}\n\nfunction R(e) {\n const n = (e => {\n const n = Nf.exec(e);\n return n ? (e => {\n function parseUnit(e, r, i) {\n let a = 0, s = 0;\n if (i && ([a, o] = divModFloor(o, Zu[i])), void 0 !== e) {\n if (t) {\n throw new RangeError(invalidSubstring(e));\n }\n s = (e => {\n const n = parseInt(e);\n if (!Number.isFinite(n)) {\n throw new RangeError(invalidSubstring(e));\n }\n return n;\n })(e), n = 1, r && (o = parseSubsecNano(r) * (Zu[i] / oo), t = 1);\n }\n return a + s;\n }\n let n = 0, t = 0, o = 0, r = {\n ...zipProps(O, [ parseUnit(e[2]), parseUnit(e[3]), parseUnit(e[4]), parseUnit(e[5]), parseUnit(e[6], e[7], 5), parseUnit(e[8], e[9], 4), parseUnit(e[10], e[11], 3) ]),\n ...nanoToGivenFields(o, 2, O)\n };\n if (!n) {\n throw new RangeError(noValidFields(O));\n }\n return parseSign(e[1]) < 0 && (r = negateDurationFields(r)), r;\n })(n) : void 0;\n })(d(e));\n if (!n) {\n throw new RangeError(failedParse(e));\n }\n return pe(checkDurationUnits(n));\n}\n\nfunction f(e) {\n const n = parseDateTimeLike(e) || parseYearMonthOnly(e) || parseMonthDayOnly(e);\n return n ? n.calendar : e;\n}\n\nfunction M(e) {\n const n = parseDateTimeLike(e);\n return n && (n.timeZone || n.C && nf || n.offset) || e;\n}\n\nfunction finalizeZonedDateTime(e, n, t = 0, o = 0) {\n const r = Z(e.timeZone), i = L(r);\n let a;\n return checkIsoDateTimeFields(e), a = e.k ? getMatchingInstantFor(i, e, n, t, o, !i.j, e.C) : getStartOfDayInstantFor(i, e), \n Xe(a, r, u(e.calendar));\n}\n\nfunction finalizeDateTime(e) {\n return resolveSlotsCalendar(Do(checkIsoDateTimeFields(e)));\n}\n\nfunction finalizeDate(e) {\n return resolveSlotsCalendar(To(checkIsoDateFields(e)));\n}\n\nfunction resolveSlotsCalendar(e) {\n return {\n ...e,\n calendar: u(e.calendar)\n };\n}\n\nfunction parseDateTimeLike(e) {\n const n = gf.exec(e);\n return n ? (e => {\n const n = e[10], t = \"Z\" === (n || \"\").toUpperCase();\n return {\n isoYear: organizeIsoYearParts(e),\n isoMonth: parseInt(e[4]),\n isoDay: parseInt(e[5]),\n ...organizeTimeParts(e.slice(5)),\n ...organizeAnnotationParts(e[16]),\n k: Boolean(e[6]),\n C: t,\n offset: t ? void 0 : n\n };\n })(n) : void 0;\n}\n\nfunction parseYearMonthOnly(e) {\n const n = If.exec(e);\n return n ? (e => ({\n isoYear: organizeIsoYearParts(e),\n isoMonth: parseInt(e[4]),\n isoDay: 1,\n ...organizeAnnotationParts(e[5])\n }))(n) : void 0;\n}\n\nfunction parseMonthDayOnly(e) {\n const n = Df.exec(e);\n return n ? (e => ({\n isoYear: Pl,\n isoMonth: parseInt(e[1]),\n isoDay: parseInt(e[2]),\n ...organizeAnnotationParts(e[3])\n }))(n) : void 0;\n}\n\nfunction parseOffsetNanoMaybe(e, n) {\n const t = Mf.exec(e);\n return t ? ((e, n) => {\n const t = e[4] || e[5];\n if (n && t) {\n throw new RangeError(invalidSubstring(t));\n }\n return (e => {\n if (Math.abs(e) >= go) {\n throw new RangeError(Iu);\n }\n return e;\n })((parseInt0(e[2]) * no + parseInt0(e[3]) * ao + parseInt0(e[4]) * oo + parseSubsecNano(e[5] || \"\")) * parseSign(e[1]));\n })(t, n) : void 0;\n}\n\nfunction organizeIsoYearParts(e) {\n const n = parseSign(e[1]), t = parseInt(e[2] || e[3]);\n if (n < 0 && !t) {\n throw new RangeError(invalidSubstring(-0));\n }\n return n * t;\n}\n\nfunction organizeTimeParts(e) {\n const n = parseInt0(e[3]);\n return {\n ...nanoToIsoTimeAndDay(parseSubsecNano(e[4] || \"\"))[0],\n isoHour: parseInt0(e[1]),\n isoMinute: parseInt0(e[2]),\n isoSecond: 60 === n ? 59 : n\n };\n}\n\nfunction organizeAnnotationParts(e) {\n let n, t;\n const o = [];\n if (e.replace(yf, ((e, r, i) => {\n const a = Boolean(r), [s, c] = i.split(\"=\").reverse();\n if (c) {\n if (\"u-ca\" === c) {\n o.push(s), n || (n = a);\n } else if (a || /[A-Z]/.test(c)) {\n throw new RangeError(invalidSubstring(e));\n }\n } else {\n if (t) {\n throw new RangeError(invalidSubstring(e));\n }\n t = s;\n }\n return \"\";\n })), o.length > 1 && n) {\n throw new RangeError(invalidSubstring(e));\n }\n return {\n timeZone: t,\n calendar: o[0] || l\n };\n}\n\nfunction parseSubsecNano(e) {\n return parseInt(e.padEnd(9, \"0\"));\n}\n\nfunction createRegExp(e) {\n return new RegExp(`^${e}$`, \"i\");\n}\n\nfunction parseSign(e) {\n return e && \"+\" !== e ? -1 : 1;\n}\n\nfunction parseInt0(e) {\n return void 0 === e ? 0 : parseInt(e);\n}\n\nfunction Me(e) {\n return Z(d(e));\n}\n\nfunction Z(e) {\n const n = getTimeZoneEssence(e);\n return \"number\" == typeof n ? Se(n) : n ? (e => {\n if (Ff.test(e)) {\n throw new RangeError(F(e));\n }\n if (Pf.test(e)) {\n throw new RangeError(hu);\n }\n return e.toLowerCase().split(\"/\").map(((e, n) => (e.length <= 3 || /\\d/.test(e)) && !/etc|yap/.test(e) ? e.toUpperCase() : e.replace(/baja|dumont|[a-z]+/g, ((e, t) => e.length <= 2 && !n || \"in\" === e || \"chat\" === e ? e.toUpperCase() : e.length > 2 || !t ? capitalize(e).replace(/island|noronha|murdo|rivadavia|urville/, capitalize) : e)))).join(\"/\");\n })(e) : nf;\n}\n\nfunction getTimeZoneAtomic(e) {\n const n = getTimeZoneEssence(e);\n return \"number\" == typeof n ? n : n ? n.resolvedOptions().timeZone : nf;\n}\n\nfunction getTimeZoneEssence(e) {\n const n = parseOffsetNanoMaybe(e = e.toUpperCase(), 1);\n return void 0 !== n ? n : e !== nf ? vf(e) : void 0;\n}\n\nfunction He(e, n) {\n return pa(e.epochNanoseconds, n.epochNanoseconds);\n}\n\nfunction Be(e, n) {\n return pa(e.epochNanoseconds, n.epochNanoseconds);\n}\n\nfunction H(e, n, t, o, r, i) {\n const a = e(normalizeOptions(i).relativeTo), s = Math.max(getMaxDurationUnit(o), getMaxDurationUnit(r));\n if (allPropsEqual(O, o, r)) {\n return 0;\n }\n if (isUniformUnit(s, a)) {\n return pa(durationFieldsToBigNano(o), durationFieldsToBigNano(r));\n }\n if (!a) {\n throw new RangeError(vu);\n }\n const [c, u, l] = createMarkerSystem(n, t, a), f = createMarkerToEpochNano(l), d = createMoveMarker(l);\n return pa(f(d(u, c, o)), f(d(u, c, r)));\n}\n\nfunction Yt(e, n) {\n return te(e, n) || Dt(e, n);\n}\n\nfunction te(e, n) {\n return compareNumbers(isoToEpochMilli(e), isoToEpochMilli(n));\n}\n\nfunction Dt(e, n) {\n return compareNumbers(isoTimeFieldsToNano(e), isoTimeFieldsToNano(n));\n}\n\nfunction Ve(e, n) {\n return !He(e, n);\n}\n\nfunction ve(e, n) {\n return !Be(e, n) && !!isTimeZoneIdsEqual(e.timeZone, n.timeZone) && e.calendar === n.calendar;\n}\n\nfunction vt(e, n) {\n return !Yt(e, n) && e.calendar === n.calendar;\n}\n\nfunction re(e, n) {\n return !te(e, n) && e.calendar === n.calendar;\n}\n\nfunction zt(e, n) {\n return !te(e, n) && e.calendar === n.calendar;\n}\n\nfunction Lt(e, n) {\n return !te(e, n) && e.calendar === n.calendar;\n}\n\nfunction st(e, n) {\n return !Dt(e, n);\n}\n\nfunction isTimeZoneIdsEqual(e, n) {\n if (e === n) {\n return 1;\n }\n try {\n return getTimeZoneAtomic(e) === getTimeZoneAtomic(n);\n } catch (e) {}\n}\n\nfunction Ee(e, n, t, o) {\n const r = refineDiffOptions(e, o, 3, 5), i = diffEpochNanos(n.epochNanoseconds, t.epochNanoseconds, ...r);\n return pe(e ? negateDurationFields(i) : i);\n}\n\nfunction we(e, n, t, o, r, i) {\n const a = ha(o.calendar, r.calendar), [s, c, u, l] = refineDiffOptions(t, i, 5), f = o.epochNanoseconds, d = r.epochNanoseconds, m = pa(d, f);\n let p;\n if (m) {\n if (s < 6) {\n p = diffEpochNanos(f, d, s, c, u, l);\n } else {\n const t = n(ga(o.timeZone, r.timeZone)), f = e(a);\n p = diffZonedEpochsBig(f, t, o, r, m, s, i), p = roundRelativeDuration(p, d, s, c, u, l, f, o, fa, gt(Fa, t));\n }\n } else {\n p = ll;\n }\n return pe(t ? negateDurationFields(p) : p);\n}\n\nfunction It(e, n, t, o, r) {\n const i = ha(t.calendar, o.calendar), [a, s, c, u] = refineDiffOptions(n, r, 6), l = ma(t), f = ma(o), d = pa(f, l);\n let m;\n if (d) {\n if (a <= 6) {\n m = diffEpochNanos(l, f, a, s, c, u);\n } else {\n const n = e(i);\n m = diffDateTimesBig(n, t, o, d, a, r), m = roundRelativeDuration(m, f, a, s, c, u, n, t, ma, ka);\n }\n } else {\n m = ll;\n }\n return pe(n ? negateDurationFields(m) : m);\n}\n\nfunction oe(e, n, t, o, r) {\n const i = ha(t.calendar, o.calendar);\n return diffDateLike(n, (() => e(i)), t, o, ...refineDiffOptions(n, r, 6, 9, 6));\n}\n\nfunction _t(e, n, t, o, r) {\n const i = ha(t.calendar, o.calendar), a = refineDiffOptions(n, r, 9, 9, 8), s = e(i), c = Na(s, t), u = Na(s, o);\n return c.isoYear === u.isoYear && c.isoMonth === u.isoMonth && c.isoDay === u.isoDay ? pe(ll) : diffDateLike(n, (() => s), To(c), To(u), ...a, 8);\n}\n\nfunction diffDateLike(e, n, t, o, r, i, a, s, c = 6) {\n const u = ma(t), l = ma(o);\n if (void 0 === u || void 0 === l) {\n throw new RangeError(Mu);\n }\n let f;\n if (pa(l, u)) {\n if (6 === r) {\n f = diffEpochNanos(u, l, r, i, a, s);\n } else {\n const e = n();\n f = e.h(t, o, r), i === c && 1 === a || (f = roundRelativeDuration(f, l, r, i, a, s, e, t, ma, moveDate));\n }\n } else {\n f = ll;\n }\n return pe(e ? negateDurationFields(f) : f);\n}\n\nfunction it(e, n, t, o) {\n const [r, i, a, s] = refineDiffOptions(e, o, 5, 5), c = Da(diffTimes(n, t), computeNanoInc(i, a), s), u = {\n ...ll,\n ...nanoToDurationTimeFields(c, r)\n };\n return pe(e ? negateDurationFields(u) : u);\n}\n\nfunction diffZonedEpochsExact(e, n, t, o, r, i) {\n const a = pa(o.epochNanoseconds, t.epochNanoseconds);\n return a ? r < 6 ? diffEpochNanosExact(t.epochNanoseconds, o.epochNanoseconds, r) : diffZonedEpochsBig(n, e, t, o, a, r, i) : ll;\n}\n\nfunction diffDateTimesExact(e, n, t, o, r) {\n const i = ma(n), a = ma(t), s = pa(a, i);\n return s ? o <= 6 ? diffEpochNanosExact(i, a, o) : diffDateTimesBig(e, n, t, s, o, r) : ll;\n}\n\nfunction diffZonedEpochsBig(e, n, t, o, r, i, a) {\n const [s, c, u] = Sa(n, t, o, r);\n var l, f;\n return {\n ...6 === i ? (l = s, f = c, {\n ...ll,\n days: td(l, f)\n }) : e.h(s, c, i, a),\n ...nanoToDurationTimeFields(u)\n };\n}\n\nfunction diffDateTimesBig(e, n, t, o, r, i) {\n const [a, s, c] = ((e, n, t) => {\n let o = n, r = diffTimes(e, n);\n return Math.sign(r) === -t && (o = Ua(n, -t), r += go * t), [ e, o, r ];\n })(n, t, o);\n return {\n ...e.h(a, s, r, i),\n ...nanoToDurationTimeFields(c)\n };\n}\n\nfunction Sa(e, n, t, o) {\n function updateMid() {\n return l = {\n ...Ua(a, c++ * -o),\n ...i\n }, f = $o(e, l), pa(s, f) === -o;\n }\n const r = he(n, e), i = nn(w, r), a = he(t, e), s = t.epochNanoseconds;\n let c = 0;\n const u = diffTimes(r, a);\n let l, f;\n if (Math.sign(u) === -o && c++, updateMid() && (-1 === o || updateMid())) {\n throw new RangeError(du);\n }\n const d = La(va(f, s));\n return [ r, l, d ];\n}\n\nfunction diffEpochNanos(e, n, t, o, r, i) {\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(roundBigNano(va(e, n), o, r, i), t)\n };\n}\n\nfunction diffEpochNanosExact(e, n, t) {\n return {\n ...ll,\n ...nanoToDurationDayTimeFields(va(e, n), t)\n };\n}\n\nfunction td(e, n) {\n return diffEpochMilliByDay(isoToEpochMilli(e), isoToEpochMilli(n));\n}\n\nfunction diffEpochMilliByDay(e, n) {\n return Math.trunc((n - e) / Cu);\n}\n\nfunction diffTimes(e, n) {\n return isoTimeFieldsToNano(n) - isoTimeFieldsToNano(e);\n}\n\nfunction nativeDateUntil(e, n, t) {\n if (t <= 7) {\n let o = 0, r = td({\n ...e,\n ...At\n }, {\n ...n,\n ...At\n });\n return 7 === t && ([o, r] = divModTrunc(r, 7)), {\n ...ll,\n weeks: o,\n days: r\n };\n }\n const o = this.u(e), r = this.u(n);\n let [i, a, s] = ((e, n, t, o, r, i, a) => {\n let s = r - n, c = i - t, u = a - o;\n if (s || c) {\n const l = Math.sign(s || c);\n let f = e.B(r, i), d = 0;\n if (Math.sign(u) === -l) {\n const o = f;\n [r, i] = e.p(r, i, -l), s = r - n, c = i - t, f = e.B(r, i), d = l < 0 ? -o : f;\n }\n if (u = a - Math.min(o, f) + d, s) {\n const [o, a] = e.m(n, t), [u, f] = e.m(r, i);\n if (c = u - o || Number(f) - Number(a), Math.sign(c) === -l) {\n const t = l < 0 && -e.O(r);\n s = (r -= l) - n, c = i - monthCodeNumberToMonth(o, a, e.F(r)) + (t || e.O(r));\n }\n }\n }\n return [ s, c, u ];\n })(this, ...o, ...r);\n return 8 === t && (a += this.q(i, o[0]), i = 0), {\n ...ll,\n years: i,\n months: a,\n days: s\n };\n}\n\nfunction computeIsoMonthsInYearSpan(e) {\n return e * Fl;\n}\n\nfunction computeIntlMonthsInYearSpan(e, n) {\n const t = n + e, o = Math.sign(e), r = o < 0 ? -1 : 0;\n let i = 0;\n for (let e = n; e !== t; e += o) {\n i += computeIntlMonthsInYear.call(this, e + r);\n }\n return i;\n}\n\nfunction ha(e, n) {\n if (e !== n) {\n throw new RangeError(mu);\n }\n return e;\n}\n\nfunction ga(e, n) {\n if (!isTimeZoneIdsEqual(e, n)) {\n throw new RangeError(pu);\n }\n return e;\n}\n\nfunction computeNativeWeekOfYear(e) {\n return this.I(e)[0];\n}\n\nfunction computeNativeYearOfWeek(e) {\n return this.I(e)[1];\n}\n\nfunction computeNativeInLeapYear(e) {\n const [n] = this.u(e);\n return this.L(n);\n}\n\nfunction computeNativeMonthsInYear(e) {\n const [n] = this.u(e);\n return this.O(n);\n}\n\nfunction computeNativeDaysInMonth(e) {\n const [n, t] = this.u(e);\n return this.B(n, t);\n}\n\nfunction computeNativeDaysInYear(e) {\n const [n] = this.u(e);\n return this.G(n);\n}\n\nfunction computeNativeDayOfYear(e) {\n const [n] = this.u(e);\n return diffEpochMilliByDay(this.M(n), isoToEpochMilli(e)) + 1;\n}\n\nfunction parseMonthCode(e) {\n const n = Ef.exec(e);\n if (!n) {\n throw new RangeError(invalidMonthCode(e));\n }\n return [ parseInt(n[1]), Boolean(n[2]) ];\n}\n\nfunction sa(e, n) {\n return \"M\" + wu(e) + (n ? \"L\" : \"\");\n}\n\nfunction monthCodeNumberToMonth(e, n, t) {\n return e + (n || t && e >= t ? 1 : 0);\n}\n\nfunction monthToMonthCodeNumber(e, n) {\n return e - (n && e >= n ? 1 : 0);\n}\n\nfunction eraYearToYear(e, n) {\n return (n + e) * (Math.sign(n) || 1) || 0;\n}\n\nfunction getCalendarEraOrigins(e) {\n return nl[getCalendarIdBase(e)];\n}\n\nfunction getCalendarLeapMonthMeta(e) {\n return ol[getCalendarIdBase(e)];\n}\n\nfunction getCalendarIdBase(e) {\n return computeCalendarIdBase(e.id || l);\n}\n\nfunction createIntlCalendar(e) {\n function epochMilliToIntlFields(e) {\n return ((e, n) => ({\n ...parseIntlYear(e, n),\n V: e.month,\n day: parseInt(e.day)\n }))(hashIntlFormatParts(n, e), t);\n }\n const n = bf(e), t = computeCalendarIdBase(e);\n return {\n id: e,\n _: createIntlFieldCache(epochMilliToIntlFields),\n J: createIntlYearDataCache(epochMilliToIntlFields)\n };\n}\n\nfunction createIntlFieldCache(e) {\n return on((n => {\n const t = isoToEpochMilli(n);\n return e(t);\n }), WeakMap);\n}\n\nfunction createIntlYearDataCache(e) {\n const n = e(0).year - vl;\n return on((t => {\n let o, r = isoArgsToEpochMilli(t - n), i = 0;\n const a = [], s = [];\n do {\n r += 400 * Cu;\n } while ((o = e(r)).year <= t);\n do {\n if (r += (1 - o.day) * Cu, o.year === t && (a.push(r), s.push(o.V)), r -= Cu, ++i > 100 || r < -gl) {\n throw new RangeError(du);\n }\n } while ((o = e(r)).year >= t);\n return {\n K: a.reverse(),\n X: bu(s.reverse())\n };\n }));\n}\n\nfunction parseIntlYear(e, n) {\n let t, o, r = parseIntlPartsYear(e);\n if (e.era) {\n const i = nl[n], a = tl[n] || {};\n void 0 !== i && (t = \"islamic\" === n ? \"ah\" : e.era.normalize(\"NFD\").toLowerCase().replace(/[^a-z0-9]/g, \"\"), \n \"bc\" === t || \"b\" === t ? t = \"bce\" : \"ad\" === t || \"a\" === t ? t = \"ce\" : \"beforeroc\" === t && (t = \"broc\"), \n t = a[t] || t, o = r, r = eraYearToYear(o, i[t] || 0));\n }\n return {\n era: t,\n eraYear: o,\n year: r\n };\n}\n\nfunction parseIntlPartsYear(e) {\n return parseInt(e.relatedYear || e.year);\n}\n\nfunction computeIntlDay(e) {\n return this._(e).day;\n}\n\nfunction computeIntlDateParts(e) {\n const {year: n, V: t, day: o} = this._(e), {X: r} = this.J(n);\n return [ n, r[t] + 1, o ];\n}\n\nfunction computeIsoFieldsFromIntlParts(e, n, t) {\n return Pa(computeIntlEpochMilli.call(this, e, n, t));\n}\n\nfunction computeIntlEpochMilli(e, n = 1, t = 1) {\n return this.J(e).K[n - 1] + (t - 1) * Cu;\n}\n\nfunction computeIntlMonthCodeParts(e, n) {\n const t = computeIntlLeapMonth.call(this, e);\n return [ monthToMonthCodeNumber(n, t), t === n ];\n}\n\nfunction computeIntlLeapMonth(e) {\n const n = queryMonthStrings(this, e), t = queryMonthStrings(this, e - 1), o = n.length;\n if (o > t.length) {\n const e = getCalendarLeapMonthMeta(this);\n if (e < 0) {\n return -e;\n }\n for (let e = 0; e < o; e++) {\n if (n[e] !== t[e]) {\n return e + 1;\n }\n }\n }\n}\n\nfunction computeIntlInLeapYear(e) {\n const n = computeIntlDaysInYear.call(this, e);\n return n > computeIntlDaysInYear.call(this, e - 1) && n > computeIntlDaysInYear.call(this, e + 1);\n}\n\nfunction computeIntlDaysInYear(e) {\n return diffEpochMilliByDay(computeIntlEpochMilli.call(this, e), computeIntlEpochMilli.call(this, e + 1));\n}\n\nfunction computeIntlDaysInMonth(e, n) {\n const {K: t} = this.J(e);\n let o = n + 1, r = t;\n return o > t.length && (o = 1, r = this.J(e + 1).K), diffEpochMilliByDay(t[n - 1], r[o - 1]);\n}\n\nfunction computeIntlMonthsInYear(e) {\n return this.J(e).K.length;\n}\n\nfunction computeIntlEraParts(e) {\n const n = this._(e);\n return [ n.era, n.eraYear ];\n}\n\nfunction computeIntlYearMonthForMonthDay(e, n, t) {\n const o = this.id && \"chinese\" === computeCalendarIdBase(this.id) ? ((e, n, t) => {\n if (n) {\n switch (e) {\n case 1:\n return 1651;\n\n case 2:\n return t < 30 ? 1947 : 1765;\n\n case 3:\n return t < 30 ? 1966 : 1955;\n\n case 4:\n return t < 30 ? 1963 : 1944;\n\n case 5:\n return t < 30 ? 1971 : 1952;\n\n case 6:\n return t < 30 ? 1960 : 1941;\n\n case 7:\n return t < 30 ? 1968 : 1938;\n\n case 8:\n return t < 30 ? 1957 : 1718;\n\n case 9:\n return 1832;\n\n case 10:\n return 1870;\n\n case 11:\n return 1814;\n\n case 12:\n return 1890;\n }\n }\n return 1972;\n })(e, n, t) : Pl;\n let [r, i, a] = computeIntlDateParts.call(this, {\n isoYear: o,\n isoMonth: Fl,\n isoDay: 31\n });\n const s = computeIntlLeapMonth.call(this, r), c = i === s;\n 1 === (compareNumbers(e, monthToMonthCodeNumber(i, s)) || compareNumbers(Number(n), Number(c)) || compareNumbers(t, a)) && r--;\n for (let o = 0; o < 100; o++) {\n const i = r - o, a = computeIntlLeapMonth.call(this, i), s = monthCodeNumberToMonth(e, n, a);\n if (n === (s === a) && t <= computeIntlDaysInMonth.call(this, i, s)) {\n return [ i, s ];\n }\n }\n}\n\nfunction queryMonthStrings(e, n) {\n return Object.keys(e.J(n).X);\n}\n\nfunction Zt(e) {\n return u(d(e));\n}\n\nfunction u(e) {\n if ((e = e.toLowerCase()) !== l && e !== Xu) {\n const n = bf(e).resolvedOptions().calendar;\n if (computeCalendarIdBase(e) !== computeCalendarIdBase(n)) {\n throw new RangeError(c(e));\n }\n return n;\n }\n return e;\n}\n\nfunction computeCalendarIdBase(e) {\n return \"islamicc\" === e && (e = \"islamic\"), e.split(\"-\")[0];\n}\n\nfunction createNativeOpsCreator(e, n) {\n return t => t === l ? e : t === Xu || t === el ? Object.assign(Object.create(e), {\n id: t\n }) : Object.assign(Object.create(n), Of(t));\n}\n\nfunction z(e, n, t, o) {\n const r = refineCalendarFields(t, o, _u, [], ju);\n if (void 0 !== r.timeZone) {\n const o = t.ee(r), i = refineTimeBag(r), a = e(r.timeZone);\n return {\n epochNanoseconds: getMatchingInstantFor(n(a), {\n ...o,\n ...i\n }, void 0 !== r.offset ? parseOffsetNano(r.offset) : void 0),\n timeZone: a\n };\n }\n return {\n ...t.ee(r),\n ...At\n };\n}\n\nfunction Ae(e, n, t, o, r, i) {\n const a = refineCalendarFields(t, r, _u, Au, ju), s = e(a.timeZone), [c, u, l] = je(i), f = t.ee(a, fabricateOverflowOptions(c)), d = refineTimeBag(a, c);\n return Xe(getMatchingInstantFor(n(s), {\n ...f,\n ...d\n }, void 0 !== a.offset ? parseOffsetNano(a.offset) : void 0, u, l), s, o);\n}\n\nfunction Nt(e, n, t) {\n const o = refineCalendarFields(e, n, _u, [], p), r = dt(t);\n return jt(Do({\n ...e.ee(o, fabricateOverflowOptions(r)),\n ...refineTimeBag(o, r)\n }));\n}\n\nfunction de(e, n, t, o = []) {\n const r = refineCalendarFields(e, n, _u, o);\n return e.ee(r, t);\n}\n\nfunction Ut(e, n, t, o) {\n const r = refineCalendarFields(e, n, Gu, o);\n return e.ne(r, t);\n}\n\nfunction Rt(e, n, t, o) {\n const r = refineCalendarFields(e, t, _u, Hu);\n return n && void 0 !== r.month && void 0 === r.monthCode && void 0 === r.year && (r.year = Pl), \n e.te(r, o);\n}\n\nfunction Tt(e, n) {\n return St(refineTimeBag(refineFields(e, Ru, [], 1), dt(n)));\n}\n\nfunction q(e) {\n const n = refineFields(e, il);\n return pe(checkDurationUnits({\n ...ll,\n ...n\n }));\n}\n\nfunction refineCalendarFields(e, n, t, o = [], r = []) {\n return refineFields(n, [ ...e.fields(t), ...r ].sort(), o);\n}\n\nfunction refineFields(e, n, t, o = !t) {\n const r = {};\n let i, a = 0;\n for (const o of n) {\n if (o === i) {\n throw new RangeError(duplicateFields(o));\n }\n if (\"constructor\" === o || \"__proto__\" === o) {\n throw new RangeError(forbiddenField(o));\n }\n let n = e[o];\n if (void 0 !== n) {\n a = 1, Rm[o] && (n = Rm[o](n, o)), r[o] = n;\n } else if (t) {\n if (t.includes(o)) {\n throw new TypeError(missingField(o));\n }\n r[o] = Qu[o];\n }\n i = o;\n }\n if (o && !a) {\n throw new TypeError(noValidFields(n));\n }\n return r;\n}\n\nfunction refineTimeBag(e, n) {\n return constrainIsoTimeFields(zm({\n ...Qu,\n ...e\n }), n);\n}\n\nfunction De(e, n, t, o, r) {\n const {calendar: i, timeZone: a} = t, s = e(i), c = n(a), u = [ ...s.fields(_u), ...Uu ].sort(), l = (e => {\n const n = he(e, L), t = Se(n.offsetNanoseconds), o = ra(e.calendar), [r, i, a] = o.u(n), [s, c] = o.m(r, i), u = sa(s, c);\n return {\n ...Ga(n),\n year: r,\n monthCode: u,\n day: a,\n offset: t\n };\n })(t), f = refineFields(o, u), d = s.oe(l, f), m = {\n ...l,\n ...f\n }, [p, h, I] = je(r, 2);\n return Xe(getMatchingInstantFor(c, {\n ...s.ee(d, fabricateOverflowOptions(p)),\n ...constrainIsoTimeFields(zm(m), p)\n }, parseOffsetNano(m.offset), h, I), a, i);\n}\n\nfunction Pt(e, n, t, o) {\n const r = e(n.calendar), i = [ ...r.fields(_u), ...p ].sort(), a = {\n ...computeDateEssentials(s = n),\n hour: s.isoHour,\n minute: s.isoMinute,\n second: s.isoSecond,\n millisecond: s.isoMillisecond,\n microsecond: s.isoMicrosecond,\n nanosecond: s.isoNanosecond\n };\n var s;\n const c = refineFields(t, i), u = dt(o), l = r.oe(a, c), f = {\n ...a,\n ...c\n };\n return jt(Do({\n ...r.ee(l, fabricateOverflowOptions(u)),\n ...constrainIsoTimeFields(zm(f), u)\n }));\n}\n\nfunction ee(e, n, t, o) {\n const r = e(n.calendar), i = r.fields(_u).sort(), a = computeDateEssentials(n), s = refineFields(t, i), c = r.oe(a, s);\n return r.ee(c, o);\n}\n\nfunction Wt(e, n, t, o) {\n const r = e(n.calendar), i = r.fields(Gu).sort(), a = (e => {\n const n = ra(e.calendar), [t, o] = n.u(e), [r, i] = n.m(t, o);\n return {\n year: t,\n monthCode: sa(r, i)\n };\n })(n), s = refineFields(t, i), c = r.oe(a, s);\n return r.ne(c, o);\n}\n\nfunction Et(e, n, t, o) {\n const r = e(n.calendar), i = r.fields(_u).sort(), a = (e => {\n const n = ra(e.calendar), [t, o, r] = n.u(e), [i, a] = n.m(t, o);\n return {\n monthCode: sa(i, a),\n day: r\n };\n })(n), s = refineFields(t, i), c = r.oe(a, s);\n return r.te(c, o);\n}\n\nfunction rt(e, n, t) {\n return St(((e, n, t) => refineTimeBag({\n ...nn(Ru, e),\n ...refineFields(n, Ru)\n }, dt(t)))(e, n, t));\n}\n\nfunction N(e, n) {\n return pe((t = e, o = n, checkDurationUnits({\n ...t,\n ...refineFields(o, il)\n })));\n var t, o;\n}\n\nfunction convertToPlainMonthDay(e, n) {\n const t = refineCalendarFields(e, n, Ku);\n return e.te(t);\n}\n\nfunction convertToPlainYearMonth(e, n, t) {\n const o = refineCalendarFields(e, n, Vu);\n return e.ne(o, t);\n}\n\nfunction convertToIso(e, n, t, o, r) {\n n = nn(t = e.fields(t), n), o = refineFields(o, r = e.fields(r), []);\n let i = e.oe(n, o);\n return i = refineFields(i, [ ...t, ...r ].sort(), []), e.ee(i);\n}\n\nfunction nativeDateFromFields(e, n) {\n const t = dt(n), o = refineYear(this, e), r = refineMonth(this, e, o, t), i = refineDay(this, e, r, o, t);\n return W(To(this.U(o, r, i)), this.id || l);\n}\n\nfunction nativeYearMonthFromFields(e, n) {\n const t = dt(n), o = refineYear(this, e), r = refineMonth(this, e, o, t);\n return createPlainYearMonthSlots(checkIsoYearMonthInBounds(this.U(o, r, 1)), this.id || l);\n}\n\nfunction nativeMonthDayFromFields(e, n) {\n const t = dt(n);\n let o, r, i, a = void 0 !== e.eraYear || void 0 !== e.year ? refineYear(this, e) : void 0;\n const s = !this.id;\n if (void 0 === a && s && (a = Pl), void 0 !== a) {\n const n = refineMonth(this, e, a, t);\n o = refineDay(this, e, n, a, t);\n const s = this.F(a);\n r = monthToMonthCodeNumber(n, s), i = n === s;\n } else {\n if (void 0 === e.monthCode) {\n throw new TypeError(lu);\n }\n if ([r, i] = parseMonthCode(e.monthCode), this.id && this.id !== Xu && this.id !== el) {\n if (this.id && \"coptic\" === computeCalendarIdBase(this.id) && 0 === t) {\n const n = i || 13 !== r ? 30 : 6;\n o = e.day, o = clampNumber(o, 1, n);\n } else if (this.id && \"chinese\" === computeCalendarIdBase(this.id) && 0 === t) {\n const n = !i || 1 !== r && 9 !== r && 10 !== r && 11 !== r && 12 !== r ? 30 : 29;\n o = e.day, o = clampNumber(o, 1, n);\n } else {\n o = e.day;\n }\n } else {\n o = refineDay(this, e, refineMonth(this, e, Pl, t), Pl, t);\n }\n }\n const c = this.R(r, i, o);\n if (!c) {\n throw new RangeError(\"Cannot guess year\");\n }\n const [u, f] = c;\n return createPlainMonthDaySlots(To(this.U(u, f, o)), this.id || l);\n}\n\nfunction nativeFieldsMethod(e) {\n return getCalendarEraOrigins(this) && e.includes(\"year\") ? [ ...e, ...qu ] : e;\n}\n\nfunction nativeMergeFields(e, n) {\n const t = Object.assign(Object.create(null), e);\n return spliceFields(t, n, $u), getCalendarEraOrigins(this) && (spliceFields(t, n, Lu), \n this.id === el && spliceFields(t, n, Ju, qu)), t;\n}\n\nfunction refineYear(e, n) {\n const t = getCalendarEraOrigins(e), o = tl[e.id || \"\"] || {};\n let {era: r, eraYear: i, year: a} = n;\n if (void 0 !== r || void 0 !== i) {\n if (void 0 === r || void 0 === i) {\n throw new TypeError(su);\n }\n if (!t) {\n throw new RangeError(iu);\n }\n const e = t[o[r] || r];\n if (void 0 === e) {\n throw new RangeError(invalidEra(r));\n }\n const n = eraYearToYear(i, e);\n if (void 0 !== a && a !== n) {\n throw new RangeError(cu);\n }\n a = n;\n } else if (void 0 === a) {\n throw new TypeError(missingYear(t));\n }\n return a;\n}\n\nfunction refineMonth(e, n, t, o) {\n let {month: r, monthCode: i} = n;\n if (void 0 !== i) {\n const n = ((e, n, t, o) => {\n const r = e.F(t), [i, a] = parseMonthCode(n);\n let s = monthCodeNumberToMonth(i, a, r);\n if (a) {\n const n = getCalendarLeapMonthMeta(e);\n if (void 0 === n) {\n throw new RangeError(fu);\n }\n if (n > 0) {\n if (s > n) {\n throw new RangeError(fu);\n }\n if (void 0 === r) {\n if (1 === o) {\n throw new RangeError(fu);\n }\n s--;\n }\n } else {\n if (s !== -n) {\n throw new RangeError(fu);\n }\n if (void 0 === r && 1 === o) {\n throw new RangeError(fu);\n }\n }\n }\n return s;\n })(e, i, t, o);\n if (void 0 !== r && r !== n) {\n throw new RangeError(uu);\n }\n r = n, o = 1;\n } else if (void 0 === r) {\n throw new TypeError(lu);\n }\n return ba(\"month\", r, 1, e.O(t), o);\n}\n\nfunction refineDay(e, n, t, o, r) {\n return clampProp(n, \"day\", 1, e.B(o, t), r);\n}\n\nfunction spliceFields(e, n, t, o) {\n let r = 0;\n const i = [];\n for (const e of t) {\n void 0 !== n[e] ? r = 1 : i.push(e);\n }\n if (Object.assign(e, n), r) {\n for (const n of o || i) {\n delete e[n];\n }\n }\n}\n\nfunction computeDateEssentials(e) {\n const n = ra(e.calendar), [t, o, r] = n.u(e), [i, a] = n.m(t, o);\n return {\n year: t,\n monthCode: sa(i, a),\n day: r\n };\n}\n\nfunction qe(e) {\n return xe(io(bigIntToBigNano(toBigInt(e))));\n}\n\nfunction ye(e, n, t, o, r = l) {\n return Xe(io(bigIntToBigNano(toBigInt(t))), n(o), e(r));\n}\n\nfunction Mt(n, t, o, r, i = 0, a = 0, s = 0, c = 0, u = 0, f = 0, d = l) {\n return jt(Do(checkIsoDateTimeFields(e(Za, zipProps(pl, [ t, o, r, i, a, s, c, u, f ])))), n(d));\n}\n\nfunction ue(n, t, o, r, i = l) {\n return W(To(checkIsoDateFields(e(Za, {\n isoYear: t,\n isoMonth: o,\n isoDay: r\n }))), n(i));\n}\n\nfunction Kt(e, n, t, o = l, r = 1) {\n const i = Za(n), a = Za(t), s = e(o);\n return createPlainYearMonthSlots(checkIsoYearMonthInBounds(checkIsoDateFields({\n isoYear: i,\n isoMonth: a,\n isoDay: Za(r)\n })), s);\n}\n\nfunction kt(e, n, t, o = l, r = Pl) {\n const i = Za(n), a = Za(t), s = e(o);\n return createPlainMonthDaySlots(To(checkIsoDateFields({\n isoYear: Za(r),\n isoMonth: i,\n isoDay: a\n })), s);\n}\n\nfunction ut(n = 0, t = 0, o = 0, r = 0, i = 0, a = 0) {\n return St(constrainIsoTimeFields(e(Za, zipProps(w, [ n, t, o, r, i, a ])), 1));\n}\n\nfunction j(n = 0, t = 0, o = 0, r = 0, i = 0, a = 0, s = 0, c = 0, u = 0, l = 0) {\n return pe(checkDurationUnits(e(Ba, zipProps(O, [ n, t, o, r, i, a, s, c, u, l ]))));\n}\n\nfunction Je(e, n, t = l) {\n return Xe(e.epochNanoseconds, n, t);\n}\n\nfunction Ce(e) {\n return xe(e.epochNanoseconds);\n}\n\nfunction yt(e, n) {\n return jt(he(n, e));\n}\n\nfunction fe(e, n) {\n return W(he(n, e));\n}\n\nfunction Qa(e, n, t) {\n return convertToPlainYearMonth(e(n.calendar), t);\n}\n\nfunction Xa(e, n, t) {\n return convertToPlainMonthDay(e(n.calendar), t);\n}\n\nfunction mt(e, n) {\n return St(he(n, e));\n}\n\nfunction Ct(e, n, t, o) {\n const r = ((e, n, t, o) => {\n const r = (e => Vl(normalizeOptions(e)))(o);\n return $o(e(n), t, r);\n })(e, t, n, o);\n return Xe(io(r), t, n.calendar);\n}\n\nfunction po(e, n, t) {\n const o = e(n.calendar);\n return createPlainYearMonthSlots({\n ...n,\n ...convertToPlainYearMonth(o, t)\n });\n}\n\nfunction yo(e, n, t) {\n return convertToPlainMonthDay(e(n.calendar), t);\n}\n\nfunction ae(e, n, t, o, r) {\n const i = e(r.timeZone), a = r.plainTime, s = void 0 !== a ? n(a) : void 0, c = t(i);\n let u;\n return u = s ? $o(c, {\n ...o,\n ...s\n }) : getStartOfDayInstantFor(c, {\n ...o,\n ...At\n }), Xe(u, i, o.calendar);\n}\n\nfunction ie(e, n = At) {\n return jt(Do({\n ...e,\n ...n\n }));\n}\n\nfunction le(e, n, t) {\n return convertToPlainYearMonth(e(n.calendar), t);\n}\n\nfunction se(e, n, t) {\n return convertToPlainMonthDay(e(n.calendar), t);\n}\n\nfunction $t(e, n, t, o) {\n return ((e, n, t) => convertToIso(e, n, Vu, oa(t), Hu))(e(n.calendar), t, o);\n}\n\nfunction Vt(e, n, t, o) {\n return ((e, n, t) => convertToIso(e, n, Ku, oa(t), Wu))(e(n.calendar), t, o);\n}\n\nfunction vo(e, n, t, o, r) {\n const i = oa(r), a = n(i.re), s = e(i.timeZone);\n return Xe($o(t(s), {\n ...a,\n ...o\n }), s, a.calendar);\n}\n\nfunction Oo(e, n) {\n return jt(Do({\n ...e,\n ...n\n }));\n}\n\nfunction ea(e) {\n return xe(io(Ge(Ba(e), oo)));\n}\n\nfunction ze(e) {\n return xe(io(Ge(Ba(e), Ke)));\n}\n\nfunction na(e) {\n return xe(io(bigIntToBigNano(toBigInt(e), ro)));\n}\n\nfunction $e(e) {\n return xe(io(bigIntToBigNano(toBigInt(e))));\n}\n\nfunction createOptionsTransformer(e, n, t) {\n const o = new Set(t);\n return (r, i) => {\n const a = t && hasAnyPropsByName(r, t);\n if (!hasAnyPropsByName(r = ((e, n) => {\n const t = {};\n for (const o in n) {\n e.has(o) || (t[o] = n[o]);\n }\n return t;\n })(o, r), e)) {\n if (i && a) {\n throw new TypeError(\"Invalid formatting options\");\n }\n r = {\n ...n,\n ...r\n };\n }\n return t && (r.timeZone = nf, [ \"full\", \"long\" ].includes(r.ie) && (r.ie = \"medium\")), \n r;\n };\n}\n\nfunction K(e, n = an, t = 0) {\n const [o, , , r] = e;\n return (i, a = mp, ...s) => {\n const c = n(r && r(...s), i, a, o, t), u = c.resolvedOptions();\n return [ c, ...toEpochMillis(e, u, s) ];\n };\n}\n\nfunction an(e, n, t, o, r) {\n if (t = o(t, r), e) {\n if (void 0 !== t.timeZone) {\n throw new TypeError(Ou);\n }\n t.timeZone = e;\n }\n return new en(n, t);\n}\n\nfunction computeNonBuggyIsoResolve() {\n return new en(void 0, {\n calendar: l\n }).resolvedOptions().calendar === l;\n}\n\nfunction toEpochMillis(e, n, t) {\n const [, o, r] = e;\n return t.map((e => (e.calendar && ((e, n, t) => {\n if ((t || e !== l) && e !== n) {\n throw new RangeError(mu);\n }\n })(e.calendar, n.calendar, r), o(e, n))));\n}\n\nfunction Pe(e, n, t) {\n const o = n.timeZone, r = e(o), i = {\n ...he(n, r),\n ...t || At\n };\n let a;\n return a = t ? getMatchingInstantFor(r, i, i.offsetNanoseconds, 2) : getStartOfDayInstantFor(r, i), \n Xe(a, o, n.calendar);\n}\n\nfunction Ka(e, n, t) {\n const o = n.timeZone, r = e(o), i = {\n ...he(n, r),\n ...t\n }, a = getPreferredCalendarId(n.calendar, t.calendar);\n return Xe(getMatchingInstantFor(r, i, i.offsetNanoseconds, 2), o, a);\n}\n\nfunction pt(e, n = At) {\n return jt(Do({\n ...e,\n ...n\n }));\n}\n\nfunction Mo(e, n) {\n return jt({\n ...e,\n ...n\n }, getPreferredCalendarId(e.calendar, n.calendar));\n}\n\nfunction Ot(e, n) {\n return {\n ...e,\n calendar: n\n };\n}\n\nfunction ge(e, n) {\n return {\n ...e,\n timeZone: n\n };\n}\n\nfunction getPreferredCalendarId(e, n) {\n if (e === n) {\n return e;\n }\n if (e === n || e === l) {\n return n;\n }\n if (n === l) {\n return e;\n }\n throw new RangeError(mu);\n}\n\nfunction tn(e) {\n const n = Ue();\n return So(n, e.N(n));\n}\n\nfunction Ue() {\n return Ge(Date.now(), Ke);\n}\n\nfunction Qe() {\n return (new en).resolvedOptions().timeZone;\n}\n\nconst expectedInteger = (e, n) => `Non-integer ${e}: ${n}`, expectedPositive = (e, n) => `Non-positive ${e}: ${n}`, expectedFinite = (e, n) => `Non-finite ${e}: ${n}`, forbiddenBigIntToNumber = e => `Cannot convert bigint to ${e}`, invalidBigInt = e => `Invalid bigint: ${e}`, ou = \"Cannot convert Symbol to string\", ru = \"Invalid object\", numberOutOfRange = (e, n, t, o, r) => r ? numberOutOfRange(e, r[n], r[t], r[o]) : invalidEntity(e, n) + `; must be between ${t}-${o}`, invalidEntity = (e, n) => `Invalid ${e}: ${n}`, missingField = e => `Missing ${e}`, forbiddenField = e => `Invalid field ${e}`, duplicateFields = e => `Duplicate field ${e}`, noValidFields = e => \"No valid fields: \" + e.join(), i = \"Invalid bag\", invalidChoice = (e, n, t) => invalidEntity(e, n) + \"; must be \" + Object.keys(t).join(), C = \"Cannot use valueOf\", a = \"Invalid calling context\", iu = \"Forbidden era/eraYear\", su = \"Mismatching era/eraYear\", cu = \"Mismatching year/eraYear\", invalidEra = e => `Invalid era: ${e}`, missingYear = e => \"Missing year\" + (e ? \"/era/eraYear\" : \"\"), invalidMonthCode = e => `Invalid monthCode: ${e}`, uu = \"Mismatching month/monthCode\", lu = \"Missing month/monthCode\", fu = \"Invalid leap month\", du = \"Invalid protocol results\", c = e => invalidEntity(\"Calendar\", e), mu = \"Mismatching Calendars\", qa = \"Calendar week operations forbidden\", F = e => invalidEntity(\"TimeZone\", e), pu = \"Mismatching TimeZones\", hu = \"Forbidden ICU TimeZone\", Iu = \"Out-of-bounds offset\", Du = \"Out-of-bounds TimeZone gap\", gu = \"Invalid TimeZone offset\", Tu = \"Ambiguous offset\", Mu = \"Out-of-bounds date\", yu = \"Out-of-bounds duration\", Nu = \"Cannot mix duration signs\", vu = \"Missing relativeTo\", Pu = \"Cannot use large units\", Fu = \"Required smallestUnit or largestUnit\", Eu = \"smallestUnit > largestUnit\", failedParse = e => `Cannot parse: ${e}`, invalidSubstring = e => `Invalid substring: ${e}`, rn = e => `Cannot format ${e}`, ln = \"Mismatching types for formatting\", Ou = \"Cannot specify TimeZone\", bu = /*@__PURE__*/ gt(P, ((e, n) => n)), Su = /*@__PURE__*/ gt(P, ((e, n, t) => t)), wu = /*@__PURE__*/ gt(padNumber, 2), Bu = {\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}, Yu = /*@__PURE__*/ Object.keys(Bu), Cu = 864e5, ku = 1e3, ro = 1e3, Ke = 1e6, oo = 1e9, ao = 6e10, no = 36e11, go = 864e11, Zu = [ 1, ro, Ke, oo, ao, no, go ], p = /*@__PURE__*/ Yu.slice(0, 6), Ru = /*@__PURE__*/ sortStrings(p), zu = [ \"offset\" ], Au = [ \"timeZone\" ], Uu = /*@__PURE__*/ p.concat(zu), ju = /*@__PURE__*/ Uu.concat(Au), qu = [ \"era\", \"eraYear\" ], Lu = /*@__PURE__*/ qu.concat([ \"year\" ]), Wu = [ \"year\" ], xu = [ \"monthCode\" ], $u = /*@__PURE__*/ [ \"month\" ].concat(xu), Hu = [ \"day\" ], Gu = /*@__PURE__*/ $u.concat(Wu), Vu = /*@__PURE__*/ xu.concat(Wu), _u = /*@__PURE__*/ Hu.concat(Gu), Ju = /*@__PURE__*/ Hu.concat($u), Ku = /*@__PURE__*/ Hu.concat(xu), Qu = /*@__PURE__*/ Su(p, 0), l = \"iso8601\", Xu = \"gregory\", el = \"japanese\", nl = {\n [Xu]: {\n \"gregory-inverse\": -1,\n gregory: 0\n },\n [el]: {\n \"japanese-inverse\": -1,\n japanese: 0,\n meiji: 1867,\n taisho: 1911,\n showa: 1925,\n heisei: 1988,\n reiwa: 2018\n },\n ethiopic: {\n ethioaa: 0,\n ethiopic: 5500\n },\n coptic: {\n \"coptic-inverse\": -1,\n coptic: 0\n },\n roc: {\n \"roc-inverse\": -1,\n roc: 0\n },\n buddhist: {\n be: 0\n },\n islamic: {\n ah: 0\n },\n indian: {\n saka: 0\n },\n persian: {\n ap: 0\n }\n}, tl = {\n [Xu]: {\n bce: \"gregory-inverse\",\n ce: \"gregory\"\n },\n [el]: {\n bce: \"japanese-inverse\",\n ce: \"japanese\"\n },\n ethiopic: {\n era0: \"ethioaa\",\n era1: \"ethiopic\"\n },\n coptic: {\n era0: \"coptic-inverse\",\n era1: \"coptic\"\n },\n roc: {\n broc: \"roc-inverse\",\n minguo: \"roc\"\n }\n}, ol = {\n chinese: 13,\n dangi: 13,\n hebrew: -6\n}, d = /*@__PURE__*/ gt(requireType, \"string\"), D = /*@__PURE__*/ gt(requireType, \"boolean\"), rl = /*@__PURE__*/ gt(requireType, \"number\"), O = /*@__PURE__*/ Yu.map((e => e + \"s\")), il = /*@__PURE__*/ sortStrings(O), al = /*@__PURE__*/ O.slice(0, 6), sl = /*@__PURE__*/ O.slice(6), cl = /*@__PURE__*/ sl.slice(1), ul = /*@__PURE__*/ bu(O), ll = /*@__PURE__*/ Su(O, 0), fl = /*@__PURE__*/ Su(al, 0), dl = /*@__PURE__*/ gt(zeroOutProps, O), w = [ \"isoNanosecond\", \"isoMicrosecond\", \"isoMillisecond\", \"isoSecond\", \"isoMinute\", \"isoHour\" ], ml = [ \"isoDay\", \"isoMonth\", \"isoYear\" ], pl = /*@__PURE__*/ w.concat(ml), Ca = /*@__PURE__*/ sortStrings(ml), hl = /*@__PURE__*/ sortStrings(w), Il = /*@__PURE__*/ sortStrings(pl), At = /*@__PURE__*/ Su(hl, 0), Ra = /*@__PURE__*/ gt(zeroOutProps, pl), Dl = 1e8, gl = Dl * Cu, Tl = [ Dl, 0 ], Ml = [ -Dl, 0 ], yl = 275760, Nl = -271821, en = Intl.DateTimeFormat, vl = 1970, Pl = 1972, Fl = 12, El = /*@__PURE__*/ isoArgsToEpochMilli(1868, 9, 8), Ol = /*@__PURE__*/ on(computeJapaneseEraParts, WeakMap), bl = \"smallestUnit\", Sl = \"unit\", wl = \"roundingMode\", Bl = \"roundingIncrement\", Yl = \"fractionalSecondDigits\", Cl = \"relativeTo\", kl = \"direction\", Zl = {\n constrain: 0,\n reject: 1\n}, Rl = /*@__PURE__*/ Object.keys(Zl), zl = {\n compatible: 0,\n reject: 1,\n earlier: 2,\n later: 3\n}, Al = {\n reject: 0,\n use: 1,\n prefer: 2,\n ignore: 3\n}, Ul = {\n auto: 0,\n never: 1,\n critical: 2,\n always: 3\n}, jl = {\n auto: 0,\n never: 1,\n critical: 2\n}, ql = {\n auto: 0,\n never: 1\n}, Ll = {\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}, Wl = {\n previous: -1,\n next: 1\n}, xl = /*@__PURE__*/ gt(refineUnitOption, bl), $l = /*@__PURE__*/ gt(refineUnitOption, \"largestUnit\"), Hl = /*@__PURE__*/ gt(refineUnitOption, Sl), Gl = /*@__PURE__*/ gt(refineChoiceOption, \"overflow\", Zl), Vl = /*@__PURE__*/ gt(refineChoiceOption, \"disambiguation\", zl), _l = /*@__PURE__*/ gt(refineChoiceOption, \"offset\", Al), Jl = /*@__PURE__*/ gt(refineChoiceOption, \"calendarName\", Ul), Kl = /*@__PURE__*/ gt(refineChoiceOption, \"timeZoneName\", jl), Ql = /*@__PURE__*/ gt(refineChoiceOption, \"offset\", ql), Xl = /*@__PURE__*/ gt(refineChoiceOption, wl, Ll), Qt = \"PlainYearMonth\", qt = \"PlainMonthDay\", G = \"PlainDate\", x = \"PlainDateTime\", ft = \"PlainTime\", _ = \"ZonedDateTime\", Re = \"Instant\", A = \"Duration\", ef = [ Math.floor, e => hasHalf(e) ? Math.floor(e) : Math.round(e), Math.ceil, e => hasHalf(e) ? Math.ceil(e) : Math.round(e), Math.trunc, e => hasHalf(e) ? Math.trunc(e) || 0 : Math.round(e), e => e < 0 ? Math.floor(e) : Math.ceil(e), e => Math.sign(e) * Math.round(Math.abs(e)) || 0, e => hasHalf(e) ? (e = Math.trunc(e) || 0) + e % 2 : Math.round(e) ], nf = \"UTC\", tf = 5184e3, of = /*@__PURE__*/ isoArgsToEpochSec(1847), rf = /*@__PURE__*/ isoArgsToEpochSec((() => {\n const e = new Date;\n return (0 === e.getTime() ? 2040 : e.getUTCFullYear()) + 10;\n})()), af = /0+$/, he = /*@__PURE__*/ on(_zonedEpochSlotsToIso, WeakMap), sf = 2 ** 32 - 1, L = /*@__PURE__*/ on((e => {\n const n = getTimeZoneEssence(e);\n return \"object\" == typeof n ? new IntlTimeZone(n) : new FixedTimeZone(n || 0);\n}));\n\nclass FixedTimeZone {\n constructor(e) {\n this.j = e;\n }\n N() {\n return this.j;\n }\n v(e) {\n return (e => {\n const n = ma({\n ...e,\n ...At\n });\n if (!n || Math.abs(n[0]) > 1e8) {\n throw new RangeError(Mu);\n }\n })(e), [ isoToEpochNanoWithOffset(e, this.j) ];\n }\n l() {}\n}\n\nclass IntlTimeZone {\n constructor(e) {\n this.ae = (e => {\n function getOffsetSec(e) {\n const i = clampNumber(e, o, r), [a, s] = computePeriod(i), c = n(a), u = n(s);\n return c === u ? c : pinch(t(a, s), c, u, e);\n }\n function pinch(n, t, o, r) {\n let i, a;\n for (;(void 0 === r || void 0 === (i = r < n[0] ? t : r >= n[1] ? o : void 0)) && (a = n[1] - n[0]); ) {\n const t = n[0] + Math.floor(a / 2);\n e(t) === o ? n[1] = t : n[0] = t + 1;\n }\n return i;\n }\n const n = on(e), t = on(createSplitTuple);\n let o = of, r = rf;\n return {\n se(e) {\n const n = getOffsetSec(e - 86400), t = getOffsetSec(e + 86400), o = e - n, r = e - t;\n if (n === t) {\n return [ o ];\n }\n const i = getOffsetSec(o);\n return i === getOffsetSec(r) ? [ e - i ] : n > t ? [ o, r ] : [];\n },\n ue: getOffsetSec,\n l(e, i) {\n const a = clampNumber(e, o, r);\n let [s, c] = computePeriod(a);\n const u = tf * i, l = i < 0 ? () => c > o || (o = a, 0) : () => s < r || (r = a, \n 0);\n for (;l(); ) {\n const o = n(s), r = n(c);\n if (o !== r) {\n const n = t(s, c);\n pinch(n, o, r);\n const a = n[0];\n if ((compareNumbers(a, e) || 1) === i) {\n return a;\n }\n }\n s += u, c += u;\n }\n }\n };\n })((e => n => {\n const t = hashIntlFormatParts(e, n * ku);\n return isoArgsToEpochSec(parseIntlPartsYear(t), parseInt(t.month), parseInt(t.day), parseInt(t.hour), parseInt(t.minute), parseInt(t.second)) - n;\n })(e));\n }\n N(e) {\n return this.ae.ue(epochNanoToSec(e)) * oo;\n }\n v(e) {\n const [n, t] = [ isoArgsToEpochSec((o = e).isoYear, o.isoMonth, o.isoDay, o.isoHour, o.isoMinute, o.isoSecond), o.isoMillisecond * Ke + o.isoMicrosecond * ro + o.isoNanosecond ];\n var o;\n return this.ae.se(n).map((e => io(Ta(Ge(e, oo), t))));\n }\n l(e, n) {\n const [t, o] = epochNanoToSecMod(e), r = this.ae.l(t + (n > 0 || o ? 1 : 0), n);\n if (void 0 !== r) {\n return Ge(r, oo);\n }\n }\n}\n\nconst cf = \"([+-])\", uf = \"(?:[.,](\\\\d{1,9}))?\", lf = `(?:(?:${cf}(\\\\d{6}))|(\\\\d{4}))-?(\\\\d{2})`, ff = \"(\\\\d{2})(?::?(\\\\d{2})(?::?(\\\\d{2})\" + uf + \")?)?\", df = cf + ff, mf = lf + \"-?(\\\\d{2})(?:[T ]\" + ff + \"(Z|\" + df + \")?)?\", pf = \"\\\\[(!?)([^\\\\]]*)\\\\]\", hf = `((?:${pf}){0,9})`, If = /*@__PURE__*/ createRegExp(lf + hf), Df = /*@__PURE__*/ createRegExp(\"(?:--)?(\\\\d{2})-?(\\\\d{2})\" + hf), gf = /*@__PURE__*/ createRegExp(mf + hf), Tf = /*@__PURE__*/ createRegExp(\"T?\" + ff + \"(?:\" + df + \")?\" + hf), Mf = /*@__PURE__*/ createRegExp(df), yf = /*@__PURE__*/ new RegExp(pf, \"g\"), Nf = /*@__PURE__*/ createRegExp(`${cf}?P(\\\\d+Y)?(\\\\d+M)?(\\\\d+W)?(\\\\d+D)?(?:T(?:(\\\\d+)${uf}H)?(?:(\\\\d+)${uf}M)?(?:(\\\\d+)${uf}S)?)?`), vf = /*@__PURE__*/ on((e => new en(\"en\", {\n calendar: l,\n timeZone: e,\n era: \"short\",\n year: \"numeric\",\n month: \"numeric\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"numeric\",\n second: \"numeric\",\n hour12: 0\n}))), Pf = /^(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$/, Ff = /[^\\w\\/:+-]+/, Ef = /^M(\\d{2})(L?)$/, Of = /*@__PURE__*/ on(createIntlCalendar), bf = /*@__PURE__*/ on((e => new en(\"en\", {\n calendar: e,\n timeZone: nf,\n era: \"short\",\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n hour12: 0\n}))), Sf = {\n ne: nativeYearMonthFromFields,\n fields: nativeFieldsMethod\n}, wf = {\n ee: nativeDateFromFields,\n fields: nativeFieldsMethod\n}, Bf = {\n te: nativeMonthDayFromFields,\n fields: nativeFieldsMethod\n}, Yf = {\n P: nativeDateAdd\n}, Cf = {\n P: nativeDateAdd,\n h: nativeDateUntil\n}, kf = {\n P: nativeDateAdd,\n h: nativeDateUntil,\n ee: nativeDateFromFields,\n ne: nativeYearMonthFromFields,\n te: nativeMonthDayFromFields,\n fields: nativeFieldsMethod,\n oe: nativeMergeFields,\n inLeapYear: computeNativeInLeapYear,\n monthsInYear: computeNativeMonthsInYear,\n daysInMonth: computeNativeDaysInMonth,\n daysInYear: computeNativeDaysInYear,\n dayOfYear: computeNativeDayOfYear,\n era(e) {\n return this.$(e)[0];\n },\n eraYear(e) {\n return this.$(e)[1];\n },\n monthCode(e) {\n const [n, t] = this.u(e), [o, r] = this.m(n, t);\n return sa(o, r);\n },\n dayOfWeek: Ha,\n daysInWeek: fo\n}, Zf = {\n F: noop,\n O: computeIsoMonthsInYear,\n U: computeIsoFieldsFromParts\n}, Rf = /*@__PURE__*/ Object.assign({}, Zf, {\n B: computeIsoDaysInMonth\n}), zf = /*@__PURE__*/ Object.assign({}, Rf, {\n R: computeIsoYearMonthForMonthDay\n}), Af = /*@__PURE__*/ Object.assign({}, Sf, Zf), Uf = /*@__PURE__*/ Object.assign({}, wf, zf), jf = /*@__PURE__*/ Object.assign({}, Bf, zf), qf = /*@__PURE__*/ Object.assign({}, Af, {\n oe: nativeMergeFields\n}), Lf = /*@__PURE__*/ Object.assign({}, Uf, {\n oe: nativeMergeFields\n}), Wf = /*@__PURE__*/ Object.assign({}, jf, {\n oe: nativeMergeFields\n}), xf = {\n u: computeIsoDateParts,\n M: isoArgsToEpochMilli,\n p: isoMonthAdd\n}, $f = /*@__PURE__*/ Object.assign({}, xf, {\n m: computeIsoMonthCodeParts,\n O: computeIsoMonthsInYear,\n B: computeIsoDaysInMonth,\n F: noop\n}), Hf = /*@__PURE__*/ Object.assign({}, Yf, $f), Gf = /*@__PURE__*/ Object.assign({}, Cf, $f, {\n q: computeIsoMonthsInYearSpan\n}), Vf = {\n day: computeIsoDay\n}, _f = /*@__PURE__*/ Object.assign({}, Hf, Vf), Jf = /*@__PURE__*/ Object.assign({}, Gf, Vf), Kf = {\n u: computeIsoDateParts,\n $: computeIsoEraParts,\n m: computeIsoMonthCodeParts\n}, Qf = {\n inLeapYear: computeNativeInLeapYear,\n u: computeIsoDateParts,\n L: computeIsoInLeapYear\n}, Xf = {\n monthsInYear: computeNativeMonthsInYear,\n u: computeIsoDateParts,\n O: computeIsoMonthsInYear\n}, em = {\n daysInMonth: computeNativeDaysInMonth,\n u: computeIsoDateParts,\n B: computeIsoDaysInMonth\n}, nm = {\n daysInYear: computeNativeDaysInYear,\n u: computeIsoDateParts,\n G: computeIsoDaysInYear\n}, tm = {\n dayOfYear: computeNativeDayOfYear,\n u: computeIsoDateParts,\n M: isoArgsToEpochMilli\n}, om = /*@__PURE__*/ Object.assign({}, tm, {\n weekOfYear: computeNativeWeekOfYear,\n yearOfWeek: computeNativeYearOfWeek,\n I(e) {\n function computeWeekShift(e) {\n return (7 - e < n ? 7 : 0) - e;\n }\n function computeWeeksInYear(e) {\n const n = computeIsoDaysInYear(l + e), t = e || 1, o = computeWeekShift(modFloor(a + n * t, 7));\n return c = (n + (o - s) * t) / 7;\n }\n const n = this.id ? 1 : 4, t = Ha(e), o = this.dayOfYear(e), r = modFloor(t - 1, 7), i = o - 1, a = modFloor(r - i, 7), s = computeWeekShift(a);\n let c, u = Math.floor((i - s) / 7) + 1, l = e.isoYear;\n return u ? u > computeWeeksInYear(0) && (u = 1, l++) : (u = computeWeeksInYear(-1), \n l--), [ u, l, c ];\n }\n}), rm = {\n u: computeIsoDateParts,\n m: computeIsoMonthCodeParts,\n R: computeIsoYearMonthForMonthDay,\n U: computeIsoFieldsFromParts\n}, im = /*@__PURE__*/ Object.assign({}, kf, om, {\n u: computeIsoDateParts,\n $: computeIsoEraParts,\n m: computeIsoMonthCodeParts,\n R: computeIsoYearMonthForMonthDay,\n L: computeIsoInLeapYear,\n F: noop,\n O: computeIsoMonthsInYear,\n q: computeIsoMonthsInYearSpan,\n B: computeIsoDaysInMonth,\n G: computeIsoDaysInYear,\n U: computeIsoFieldsFromParts,\n M: isoArgsToEpochMilli,\n p: isoMonthAdd,\n year(e) {\n return e.isoYear;\n },\n month(e) {\n return e.isoMonth;\n },\n day: computeIsoDay\n}), am = {\n F: computeIntlLeapMonth,\n O: computeIntlMonthsInYear,\n U: computeIsoFieldsFromIntlParts\n}, sm = /*@__PURE__*/ Object.assign({}, am, {\n B: computeIntlDaysInMonth\n}), cm = /*@__PURE__*/ Object.assign({}, sm, {\n R: computeIntlYearMonthForMonthDay\n}), um = /*@__PURE__*/ Object.assign({}, Sf, am), lm = /*@__PURE__*/ Object.assign({}, wf, sm), fm = /*@__PURE__*/ Object.assign({}, Bf, cm), dm = /*@__PURE__*/ Object.assign({}, um, {\n oe: nativeMergeFields\n}), mm = /*@__PURE__*/ Object.assign({}, lm, {\n oe: nativeMergeFields\n}), pm = /*@__PURE__*/ Object.assign({}, fm, {\n oe: nativeMergeFields\n}), hm = {\n u: computeIntlDateParts,\n M: computeIntlEpochMilli,\n p: intlMonthAdd\n}, Im = /*@__PURE__*/ Object.assign({}, hm, {\n m: computeIntlMonthCodeParts,\n O: computeIntlMonthsInYear,\n B: computeIntlDaysInMonth,\n F: computeIntlLeapMonth\n}), Dm = /*@__PURE__*/ Object.assign({}, Yf, Im), gm = /*@__PURE__*/ Object.assign({}, Cf, Im, {\n q: computeIntlMonthsInYearSpan\n}), Tm = {\n day: computeIntlDay\n}, Mm = /*@__PURE__*/ Object.assign({}, Dm, Tm), ym = /*@__PURE__*/ Object.assign({}, gm, Tm), Nm = {\n u: computeIntlDateParts,\n $: computeIntlEraParts,\n m: computeIntlMonthCodeParts\n}, vm = {\n inLeapYear: computeNativeInLeapYear,\n u: computeIntlDateParts,\n L: computeIntlInLeapYear\n}, Pm = {\n monthsInYear: computeNativeMonthsInYear,\n u: computeIntlDateParts,\n O: computeIntlMonthsInYear\n}, Fm = {\n daysInMonth: computeNativeDaysInMonth,\n u: computeIntlDateParts,\n B: computeIntlDaysInMonth\n}, Em = {\n daysInYear: computeNativeDaysInYear,\n u: computeIntlDateParts,\n G: computeIntlDaysInYear\n}, Om = {\n dayOfYear: computeNativeDayOfYear,\n u: computeIntlDateParts,\n M: computeIntlEpochMilli\n}, bm = {\n I() {\n return [];\n }\n}, Sm = /*@__PURE__*/ Object.assign({}, Om, bm, {\n weekOfYear: computeNativeWeekOfYear,\n yearOfWeek: computeNativeYearOfWeek\n}), wm = {\n u: computeIntlDateParts,\n m: computeIntlMonthCodeParts,\n R: computeIntlYearMonthForMonthDay,\n U: computeIsoFieldsFromIntlParts\n}, Bm = /*@__PURE__*/ Object.assign({}, kf, Sm, {\n u: computeIntlDateParts,\n $: computeIntlEraParts,\n m: computeIntlMonthCodeParts,\n R: computeIntlYearMonthForMonthDay,\n L: computeIntlInLeapYear,\n F: computeIntlLeapMonth,\n O: computeIntlMonthsInYear,\n q: computeIntlMonthsInYearSpan,\n B: computeIntlDaysInMonth,\n G: computeIntlDaysInYear,\n U: computeIsoFieldsFromIntlParts,\n M: computeIntlEpochMilli,\n p: intlMonthAdd,\n year(e) {\n return this._(e).year;\n },\n month(e) {\n const {year: n, V: t} = this._(e), {X: o} = this.J(n);\n return o[t] + 1;\n },\n day: computeIntlDay\n}), Va = /*@__PURE__*/ createNativeOpsCreator(Af, um), Aa = /*@__PURE__*/ createNativeOpsCreator(Uf, lm), _a = /*@__PURE__*/ createNativeOpsCreator(jf, fm), Fo = /*@__PURE__*/ createNativeOpsCreator(qf, dm), mo = /*@__PURE__*/ createNativeOpsCreator(Lf, mm), Wo = /*@__PURE__*/ createNativeOpsCreator(Wf, pm), xa = /*@__PURE__*/ createNativeOpsCreator(xf, hm), Wa = /*@__PURE__*/ createNativeOpsCreator(Hf, Dm), Ia = /*@__PURE__*/ createNativeOpsCreator(Gf, gm), za = /*@__PURE__*/ createNativeOpsCreator(Vf, Tm), Yo = /*@__PURE__*/ createNativeOpsCreator(_f, Mm), Lo = /*@__PURE__*/ createNativeOpsCreator(Jf, ym), ra = /*@__PURE__*/ createNativeOpsCreator(Kf, Nm), ia = /*@__PURE__*/ createNativeOpsCreator(Qf, vm), ca = /*@__PURE__*/ createNativeOpsCreator(Xf, Pm), da = /*@__PURE__*/ createNativeOpsCreator(em, Fm), ua = /*@__PURE__*/ createNativeOpsCreator(nm, Em), la = /*@__PURE__*/ createNativeOpsCreator(tm, Om), $a = /*@__PURE__*/ createNativeOpsCreator(om, Sm), ko = /*@__PURE__*/ createNativeOpsCreator(rm, wm), v = /*@__PURE__*/ createNativeOpsCreator(im, Bm), Ym = {\n era: toStringViaPrimitive,\n eraYear: Za,\n year: Za,\n month: toPositiveInteger,\n monthCode(e) {\n const n = toStringViaPrimitive(e);\n return parseMonthCode(n), n;\n },\n day: toPositiveInteger\n}, Cm = /*@__PURE__*/ Su(p, Za), km = /*@__PURE__*/ Su(O, Ba), Zm = {\n offset(e) {\n const n = toStringViaPrimitive(e);\n return parseOffsetNano(n), n;\n }\n}, Rm = /*@__PURE__*/ Object.assign({}, Ym, Cm, km, Zm), zm = /*@__PURE__*/ gt(remapProps, p, w), Ga = /*@__PURE__*/ gt(remapProps, w, p), Am = \"numeric\", Um = [ \"timeZoneName\" ], jm = {\n month: Am,\n day: Am\n}, qm = {\n year: Am,\n month: Am\n}, Lm = /*@__PURE__*/ Object.assign({}, qm, {\n day: Am\n}), Wm = {\n hour: Am,\n minute: Am,\n second: Am\n}, xm = /*@__PURE__*/ Object.assign({}, Lm, Wm), $m = /*@__PURE__*/ Object.assign({}, xm, {\n timeZoneName: \"short\"\n}), Hm = /*@__PURE__*/ Object.keys(qm), Gm = /*@__PURE__*/ Object.keys(jm), Vm = /*@__PURE__*/ Object.keys(Lm), _m = /*@__PURE__*/ Object.keys(Wm), Jm = [ \"dateStyle\" ], Km = /*@__PURE__*/ Hm.concat(Jm), Qm = /*@__PURE__*/ Gm.concat(Jm), Xm = /*@__PURE__*/ Vm.concat(Jm, [ \"weekday\" ]), ep = /*@__PURE__*/ _m.concat([ \"dayPeriod\", \"timeStyle\", \"fractionalSecondDigits\" ]), np = /*@__PURE__*/ Xm.concat(ep), tp = /*@__PURE__*/ Um.concat(ep), op = /*@__PURE__*/ Um.concat(Xm), rp = /*@__PURE__*/ Um.concat([ \"day\", \"weekday\" ], ep), ip = /*@__PURE__*/ Um.concat([ \"year\", \"weekday\" ], ep), ap = /*@__PURE__*/ createOptionsTransformer(np, xm), sp = /*@__PURE__*/ createOptionsTransformer(np, $m), cp = /*@__PURE__*/ createOptionsTransformer(np, xm, Um), up = /*@__PURE__*/ createOptionsTransformer(Xm, Lm, tp), lp = /*@__PURE__*/ createOptionsTransformer(ep, Wm, op), fp = /*@__PURE__*/ createOptionsTransformer(Km, qm, rp), dp = /*@__PURE__*/ createOptionsTransformer(Qm, jm, ip), mp = {}, pp = /*@__PURE__*/ computeNonBuggyIsoResolve(), Q = [ ap, I ], ot = [ sp, I, 0, (e, n) => {\n const t = e.timeZone;\n if (n && n.timeZone !== t) {\n throw new RangeError(pu);\n }\n return t;\n} ], U = [ cp, isoToEpochMilli ], X = [ up, isoToEpochMilli ], tt = [ lp, e => isoTimeFieldsToNano(e) / Ke ], et = [ fp, isoToEpochMilli, pp ], nt = [ dp, isoToEpochMilli, pp ];\n\nexport { A as DurationBranding, Re as InstantBranding, G as PlainDateBranding, x as PlainDateTimeBranding, qt as PlainMonthDayBranding, ft as PlainTimeBranding, Qt as PlainYearMonthBranding, en as RawDateTimeFormat, _ as ZonedDateTimeBranding, Y as absDuration, so as addBigNanos, E as addDurations, lo as alignZonedEpoch, Oa as bigNanoToExactDays, La as bigNanoToNumber, gt as bindArgs, Ja as buildZonedIsoFields, io as checkEpochNanoInBounds, To as checkIsoDateInBounds, Do as checkIsoDateTimeInBounds, ba as clampEntity, Ra as clearIsoFields, pa as compareBigNanos, H as compareDurations, He as compareInstants, te as compareIsoDateFields, Yt as compareIsoDateTimeFields, Dt as compareIsoTimeFields, Be as compareZonedDateTimes, ho as computeDayFloor, ja as computeEpochNanoFrac, Ha as computeIsoDayOfWeek, fo as computeIsoDaysInWeek, Te as computeZonedHoursInDay, be as computeZonedStartOfDay, j as constructDurationSlots, qe as constructInstantSlots, ue as constructPlainDateSlots, Mt as constructPlainDateTimeSlots, kt as constructPlainMonthDaySlots, ut as constructPlainTimeSlots, Kt as constructPlainYearMonthSlots, ye as constructZonedDateTimeSlots, pe as createDurationSlots, an as createFormatForPrep, K as createFormatPrepper, t as createGetterDescriptors, xe as createInstantSlots, r as createNameDescriptors, xa as createNativeConvertOps, mo as createNativeDateModOps, Aa as createNativeDateRefineOps, la as createNativeDayOfYearOps, za as createNativeDayOps, da as createNativeDaysInMonthOps, ua as createNativeDaysInYearOps, Ia as createNativeDiffOps, ia as createNativeInLeapYearOps, Wo as createNativeMonthDayModOps, ko as createNativeMonthDayParseOps, _a as createNativeMonthDayRefineOps, ca as createNativeMonthsInYearOps, Wa as createNativeMoveOps, ra as createNativePartOps, v as createNativeStandardOps, $a as createNativeWeekOps, Lo as createNativeYearMonthDiffOps, Fo as createNativeYearMonthModOps, Yo as createNativeYearMonthMoveOps, Va as createNativeYearMonthRefineOps, W as createPlainDateSlots, jt as createPlainDateTimeSlots, St as createPlainTimeSlots, n as createPropDescriptors, o as createStringTagDescriptors, Xe as createZonedDateTimeSlots, X as dateConfig, U as dateTimeConfig, va as diffBigNanos, Ee as diffInstants, It as diffPlainDateTimes, oe as diffPlainDates, it as diffPlainTimes, _t as diffPlainYearMonth, we as diffZonedDateTimes, O as durationFieldNamesAsc, N as durationWithFields, na as epochMicroToInstant, ze as epochMilliToInstant, Pa as epochMilliToIso, $e as epochNanoToInstant, So as epochNanoToIso, ea as epochSecToInstant, fa as extractEpochNano, C as forbiddenValueOf, k as formatDurationIso, ke as formatInstantIso, sa as formatMonthCode, Se as formatOffsetNano, ce as formatPlainDateIso, Ft as formatPlainDateTimeIso, Jt as formatPlainMonthDayIso, ct as formatPlainTimeIso, Ht as formatPlainYearMonthIso, Fe as formatZonedDateTimeIso, ha as getCommonCalendarId, ga as getCommonTimeZoneId, Ue as getCurrentEpochNano, tn as getCurrentIsoDateTime, Qe as getCurrentTimeZoneId, y as getDurationBlank, aa as getEpochMicro, I as getEpochMilli, b as getEpochNano, ta as getEpochSec, $o as getSingleInstantFor, Io as identity, Q as instantConfig, Je as instantToZonedDateTime, Ve as instantsEqual, i as invalidBag, c as invalidCalendar, a as invalidCallingContext, rn as invalidFormatType, F as invalidTimeZone, s as isObjectLike, l as isoCalendarId, Ca as isoDateFieldNamesAlpha, At as isoTimeFieldDefaults, w as isoTimeFieldNamesAsc, Ga as isoTimeFieldsToCal, ma as isoToEpochNano, P as mapPropNames, e as mapProps, on as memoize, ln as mismatchingFormatTypes, nt as monthDayConfig, Ta as moveBigNano, Ua as moveByDays, ka as moveDateTime, Ye as moveInstant, ne as movePlainDate, wt as movePlainDateTime, at as movePlainTime, Gt as movePlainYearMonth, Na as moveToDayOfMonthUnsafe, Oe as moveZonedDateTime, Fa as moveZonedEpochs, no as nanoInHour, ro as nanoInMicro, Ke as nanoInMilli, ao as nanoInMinute, oo as nanoInSec, go as nanoInUtcDay, wa as nativeYearMonthAdd, B as negateDuration, Ge as numberToBigNano, f as parseCalendarId, R as parseDuration, We as parseInstant, me as parsePlainDate, Bt as parsePlainDateTime, xt as parsePlainMonthDay, ht as parsePlainTime, Xt as parsePlainYearMonth, $ as parseRelativeToSlots, M as parseTimeZoneId, Ne as parseZonedDateTime, yo as plainDateTimeToPlainMonthDay, po as plainDateTimeToPlainYearMonth, Ct as plainDateTimeToZonedDateTime, Pt as plainDateTimeWithFields, Mo as plainDateTimeWithPlainDate, pt as plainDateTimeWithPlainTime, vt as plainDateTimesEqual, ie as plainDateToPlainDateTime, se as plainDateToPlainMonthDay, le as plainDateToPlainYearMonth, ae as plainDateToZonedDateTime, ee as plainDateWithFields, re as plainDatesEqual, Vt as plainMonthDayToPlainDate, Et as plainMonthDayWithFields, Lt as plainMonthDaysEqual, Oo as plainTimeToPlainDateTime, vo as plainTimeToZonedDateTime, rt as plainTimeWithFields, st as plainTimesEqual, $t as plainYearMonthToPlainDate, Wt as plainYearMonthWithFields, zt as plainYearMonthsEqual, nn as pluckProps, Sa as prepareZonedEpochDiff, L as queryNativeTimeZone, Zt as refineCalendarId, Ze as refineDirectionOptions, q as refineDurationBag, z as refineMaybeZonedDateTimeBag, dt as refineOverflowOptions, de as refinePlainDateBag, Nt as refinePlainDateTimeBag, Rt as refinePlainMonthDayBag, Tt as refinePlainTimeBag, Ut as refinePlainYearMonthBag, Me as refineTimeZoneId, Ma as refineUnitDiffOptions, co as refineUnitRoundOptions, Ae as refineZonedDateTimeBag, je as refineZonedFieldOptions, D as requireBoolean, T as requireInteger, S as requireIntegerOrUndefined, _e as requireNumberIsInteger, oa as requireObjectLike, h as requirePositiveInteger, g as requirePositiveIntegerOrUndefined, d as requireString, m as requireStringOrUndefined, u as resolveCalendarId, Z as resolveTimeZoneId, Ya as roundBigNanoByInc, Da as roundByInc, V as roundDuration, Le as roundInstant, bt as roundPlainDateTime, lt as roundPlainTime, Ea as roundWithMode, Ie as roundZonedDateTime, uo as roundZonedEpochToInterval, Ot as slotsWithCalendarId, ge as slotsWithTimeZoneId, tt as timeConfig, p as timeFieldNamesAsc, Za as toInteger, Ba as toStrictInteger, J as totalDuration, ya as totalRelativeDuration, qa as unsupportedWeekNumbers, et as yearMonthConfig, ot as zonedConfig, Ce as zonedDateTimeToInstant, fe as zonedDateTimeToPlainDate, yt as zonedDateTimeToPlainDateTime, Xa as zonedDateTimeToPlainMonthDay, mt as zonedDateTimeToPlainTime, Qa as zonedDateTimeToPlainYearMonth, De as zonedDateTimeWithFields, Ka as zonedDateTimeWithPlainDate, Pe as zonedDateTimeWithPlainTime, ve as zonedDateTimesEqual, he as zonedEpochSlotsToIso };\n","function createSlotClass(i, l, s, c, u, f) {\n function Class(...t) {\n if (!(this instanceof Class)) {\n throw new TypeError(a);\n }\n {\n const e = l(...t);\n un(this, e), dbg(this, e, f);\n }\n }\n function bindMethod(t, e) {\n return Object.defineProperties((function(...e) {\n return t.call(this, getSpecificSlots(this), ...e);\n }), r(e));\n }\n function getSpecificSlots(t) {\n const e = cn(t);\n if (!e || e.branding !== i) {\n throw new TypeError(a);\n }\n return e;\n }\n return Object.defineProperties(Class.prototype, {\n ...t(e(bindMethod, s)),\n ...n(e(bindMethod, c)),\n ...o(\"Temporal.\" + i)\n }), Object.defineProperties(Class, {\n ...n(u),\n ...r(i)\n }), [ Class, t => {\n const e = Object.create(Class.prototype);\n return un(e, t), dbg(e, t, f), e;\n }, getSpecificSlots ];\n}\n\nfunction rejectInvalidBag(t) {\n if (cn(t) || void 0 !== t.calendar || void 0 !== t.timeZone) {\n throw new TypeError(i);\n }\n return t;\n}\n\nfunction dbg(t, e, n) {\n \"dbg\" === dbg.name && Object.defineProperty(t, \"o\", {\n value: n(e),\n writable: 0,\n enumerable: 0,\n configurable: 0\n });\n}\n\nfunction getCalendarIdFromBag(t) {\n return extractCalendarIdFromBag(t) || l;\n}\n\nfunction extractCalendarIdFromBag(t) {\n const {calendar: e} = t;\n if (void 0 !== e) {\n return refineCalendarArg(e);\n }\n}\n\nfunction refineCalendarArg(t) {\n if (s(t)) {\n const {calendar: e} = cn(t) || {};\n if (!e) {\n throw new TypeError(c(t));\n }\n return e;\n }\n return (t => u(f(d(t))))(t);\n}\n\nfunction createCalendarGetters(t) {\n const e = {};\n for (const n in t) {\n e[n] = t => {\n const {calendar: e} = t;\n return v(e)[n](t);\n };\n }\n return e;\n}\n\nfunction neverValueOf() {\n throw new TypeError(C);\n}\n\nfunction refineTimeZoneArg(t) {\n if (s(t)) {\n const {timeZone: e} = cn(t) || {};\n if (!e) {\n throw new TypeError(F(t));\n }\n return e;\n }\n return (t => Z(M(d(t))))(t);\n}\n\nfunction toDurationSlots(t) {\n if (s(t)) {\n const e = cn(t);\n return e && e.branding === A ? e : q(t);\n }\n return R(t);\n}\n\nfunction refinePublicRelativeTo(t) {\n if (void 0 !== t) {\n if (s(t)) {\n const e = cn(t) || {};\n switch (e.branding) {\n case _:\n case G:\n return e;\n\n case x:\n return W(e);\n }\n const n = getCalendarIdFromBag(t);\n return {\n ...z(refineTimeZoneArg, L, v(n), t),\n calendar: n\n };\n }\n return $(t);\n }\n}\n\nfunction toPlainTimeSlots(t, e) {\n if (s(t)) {\n const n = cn(t) || {};\n switch (n.branding) {\n case ft:\n return dt(e), n;\n\n case x:\n return dt(e), St(n);\n\n case _:\n return dt(e), mt(L, n);\n }\n return Tt(t, e);\n }\n const n = ht(t);\n return dt(e), n;\n}\n\nfunction optionalToPlainTimeFields(t) {\n return void 0 === t ? void 0 : toPlainTimeSlots(t);\n}\n\nfunction toPlainDateTimeSlots(t, e) {\n if (s(t)) {\n const n = cn(t) || {};\n switch (n.branding) {\n case x:\n return dt(e), n;\n\n case G:\n return dt(e), jt({\n ...n,\n ...At\n });\n\n case _:\n return dt(e), yt(L, n);\n }\n return Nt(v(getCalendarIdFromBag(t)), t, e);\n }\n const n = Bt(t);\n return dt(e), n;\n}\n\nfunction toPlainMonthDaySlots(t, e) {\n if (s(t)) {\n const n = cn(t);\n if (n && n.branding === qt) {\n return dt(e), n;\n }\n const o = extractCalendarIdFromBag(t);\n return Rt(v(o || l), !o, t, e);\n }\n const n = xt(v, t);\n return dt(e), n;\n}\n\nfunction toPlainYearMonthSlots(t, e) {\n if (s(t)) {\n const n = cn(t);\n return n && n.branding === Qt ? (dt(e), n) : Ut(v(getCalendarIdFromBag(t)), t, e);\n }\n const n = Xt(v, t);\n return dt(e), n;\n}\n\nfunction toPlainDateSlots(t, e) {\n if (s(t)) {\n const n = cn(t) || {};\n switch (n.branding) {\n case G:\n return dt(e), n;\n\n case x:\n return dt(e), W(n);\n\n case _:\n return dt(e), fe(L, n);\n }\n return de(v(getCalendarIdFromBag(t)), t, e);\n }\n const n = me(t);\n return dt(e), n;\n}\n\nfunction toZonedDateTimeSlots(t, e) {\n if (s(t)) {\n const n = cn(t);\n if (n && n.branding === _) {\n return je(e), n;\n }\n const o = getCalendarIdFromBag(t);\n return Ae(refineTimeZoneArg, L, v(o), o, t, e);\n }\n return Ne(t, e);\n}\n\nfunction adaptDateMethods(t) {\n return e((t => e => t(slotsToIso(e))), t);\n}\n\nfunction slotsToIso(t) {\n return he(t, L);\n}\n\nfunction toInstantSlots(t) {\n if (s(t)) {\n const e = cn(t);\n if (e) {\n switch (e.branding) {\n case Re:\n return e;\n\n case _:\n return xe(e.epochNanoseconds);\n }\n }\n }\n return We(t);\n}\n\nfunction toTemporalInstant() {\n const t = Date.prototype.valueOf.call(this);\n return Hn(xe(Ge(_e(t), Ke)));\n}\n\nfunction createDateTimeFormatClass() {\n function DateTimeFormatFunc(t, e) {\n return new DateTimeFormatNew(t, e);\n }\n function DateTimeFormatNew(t, e = Object.create(null)) {\n to.set(this, ((t, e) => {\n const n = new en(t, e), o = n.resolvedOptions(), r = o.locale, a = nn(Object.keys(e), o), i = on(createFormatPrepperForBranding), prepFormat = (t, ...e) => {\n if (t) {\n if (2 !== e.length) {\n throw new TypeError(ln);\n }\n for (const t of e) {\n if (void 0 === t) {\n throw new TypeError(ln);\n }\n }\n }\n t || void 0 !== e[0] || (e = []);\n const o = e.map((t => cn(t) || Number(t)));\n let l, s = 0;\n for (const t of o) {\n const e = \"object\" == typeof t ? t.branding : void 0;\n if (s++ && e !== l) {\n throw new TypeError(ln);\n }\n l = e;\n }\n return l ? i(l)(r, a, ...o) : [ n, ...o ];\n };\n return prepFormat.i = n, prepFormat;\n })(t, e));\n }\n const t = en.prototype, e = Object.getOwnPropertyDescriptors(t), n = Object.getOwnPropertyDescriptors(en);\n for (const t in e) {\n const n = e[t], o = t.startsWith(\"format\") && createFormatMethod(t);\n \"function\" == typeof n.value ? n.value = \"constructor\" === t ? DateTimeFormatFunc : o || createProxiedMethod(t) : o && (n.get = function() {\n if (!to.has(this)) {\n throw new TypeError(a);\n }\n return (...t) => o.apply(this, t);\n }, Object.defineProperties(n.get, r(`get ${t}`)));\n }\n return n.prototype.value = DateTimeFormatNew.prototype = Object.create({}, e), Object.defineProperties(DateTimeFormatFunc, n), \n DateTimeFormatFunc;\n}\n\nfunction createFormatMethod(t) {\n return Object.defineProperties((function(...e) {\n const n = to.get(this), [o, ...r] = n(t.includes(\"Range\"), ...e);\n return o[t](...r);\n }), r(t));\n}\n\nfunction createProxiedMethod(t) {\n return Object.defineProperties((function(...e) {\n return to.get(this).i[t](...e);\n }), r(t));\n}\n\nfunction createFormatPrepperForBranding(t) {\n const e = vn[t];\n if (!e) {\n throw new TypeError(rn(t));\n }\n return K(e, on(an), 1);\n}\n\nimport { createGetterDescriptors as t, mapProps as e, createPropDescriptors as n, createStringTagDescriptors as o, createNameDescriptors as r, invalidCallingContext as a, invalidBag as i, isoCalendarId as l, isObjectLike as s, invalidCalendar as c, resolveCalendarId as u, parseCalendarId as f, requireString as d, requireStringOrUndefined as m, requireIntegerOrUndefined as S, requireInteger as T, requirePositiveInteger as h, requireBoolean as D, requirePositiveIntegerOrUndefined as g, mapPropNames as P, durationFieldNamesAsc as O, timeFieldNamesAsc as p, isoTimeFieldNamesAsc as w, getEpochMilli as I, getEpochNano as b, createNativeStandardOps as v, forbiddenValueOf as C, invalidTimeZone as F, resolveTimeZoneId as Z, parseTimeZoneId as M, getDurationBlank as y, constructDurationSlots as j, DurationBranding as A, durationWithFields as N, negateDuration as B, absDuration as Y, addDurations as E, queryNativeTimeZone as L, roundDuration as V, totalDuration as J, formatDurationIso as k, refineDurationBag as q, parseDuration as R, PlainDateTimeBranding as x, createPlainDateSlots as W, PlainDateBranding as G, ZonedDateTimeBranding as _, refineMaybeZonedDateTimeBag as z, parseRelativeToSlots as $, compareDurations as H, createFormatPrepper as K, instantConfig as Q, dateTimeConfig as U, dateConfig as X, timeConfig as tt, yearMonthConfig as et, monthDayConfig as nt, zonedConfig as ot, plainTimeWithFields as rt, movePlainTime as at, diffPlainTimes as it, roundPlainTime as lt, plainTimesEqual as st, formatPlainTimeIso as ct, constructPlainTimeSlots as ut, PlainTimeBranding as ft, refineOverflowOptions as dt, zonedDateTimeToPlainTime as mt, createPlainTimeSlots as St, refinePlainTimeBag as Tt, parsePlainTime as ht, compareIsoTimeFields as Dt, bindArgs as gt, plainDateTimeWithFields as Pt, slotsWithCalendarId as Ot, plainDateTimeWithPlainTime as pt, movePlainDateTime as wt, diffPlainDateTimes as It, roundPlainDateTime as bt, plainDateTimesEqual as vt, plainDateTimeToZonedDateTime as Ct, formatPlainDateTimeIso as Ft, refineCalendarId as Zt, constructPlainDateTimeSlots as Mt, zonedDateTimeToPlainDateTime as yt, createPlainDateTimeSlots as jt, isoTimeFieldDefaults as At, refinePlainDateTimeBag as Nt, parsePlainDateTime as Bt, compareIsoDateTimeFields as Yt, plainMonthDayWithFields as Et, plainMonthDaysEqual as Lt, plainMonthDayToPlainDate as Vt, formatPlainMonthDayIso as Jt, constructPlainMonthDaySlots as kt, PlainMonthDayBranding as qt, refinePlainMonthDayBag as Rt, parsePlainMonthDay as xt, plainYearMonthWithFields as Wt, movePlainYearMonth as Gt, diffPlainYearMonth as _t, plainYearMonthsEqual as zt, plainYearMonthToPlainDate as $t, formatPlainYearMonthIso as Ht, constructPlainYearMonthSlots as Kt, PlainYearMonthBranding as Qt, refinePlainYearMonthBag as Ut, parsePlainYearMonth as Xt, compareIsoDateFields as te, plainDateWithFields as ee, movePlainDate as ne, diffPlainDates as oe, plainDatesEqual as re, plainDateToZonedDateTime as ae, plainDateToPlainDateTime as ie, plainDateToPlainYearMonth as le, plainDateToPlainMonthDay as se, formatPlainDateIso as ce, constructPlainDateSlots as ue, zonedDateTimeToPlainDate as fe, refinePlainDateBag as de, parsePlainDate as me, formatOffsetNano as Se, computeZonedHoursInDay as Te, zonedEpochSlotsToIso as he, zonedDateTimeWithFields as De, slotsWithTimeZoneId as ge, zonedDateTimeWithPlainTime as Pe, moveZonedDateTime as Oe, createDurationSlots as pe, diffZonedDateTimes as we, roundZonedDateTime as Ie, computeZonedStartOfDay as be, zonedDateTimesEqual as ve, zonedDateTimeToInstant as Ce, formatZonedDateTimeIso as Fe, refineDirectionOptions as Ze, refineTimeZoneId as Me, constructZonedDateTimeSlots as ye, refineZonedFieldOptions as je, refineZonedDateTimeBag as Ae, parseZonedDateTime as Ne, compareZonedDateTimes as Be, moveInstant as Ye, diffInstants as Ee, roundInstant as Le, instantsEqual as Ve, instantToZonedDateTime as Je, formatInstantIso as ke, constructInstantSlots as qe, InstantBranding as Re, createInstantSlots as xe, parseInstant as We, numberToBigNano as Ge, requireNumberIsInteger as _e, epochMilliToInstant as ze, epochNanoToInstant as $e, compareInstants as He, nanoInMilli as Ke, getCurrentTimeZoneId as Qe, getCurrentEpochNano as Ue, createZonedDateTimeSlots as Xe, getCurrentIsoDateTime as tn, RawDateTimeFormat as en, pluckProps as nn, memoize as on, invalidFormatType as rn, createFormatForPrep as an, mismatchingFormatTypes as ln } from \"./internal.js\";\n\nconst sn = /*@__PURE__*/ new WeakMap, cn = /*@__PURE__*/ sn.get.bind(sn), un = /*@__PURE__*/ sn.set.bind(sn), fn = {\n era: m,\n eraYear: S,\n year: T,\n month: h,\n daysInMonth: h,\n daysInYear: h,\n inLeapYear: D,\n monthsInYear: h\n}, dn = {\n monthCode: d\n}, mn = {\n day: h\n}, Sn = {\n dayOfWeek: h,\n dayOfYear: h,\n weekOfYear: g,\n yearOfWeek: S,\n daysInWeek: h\n}, Tn = /*@__PURE__*/ createCalendarGetters(/*@__PURE__*/ Object.assign({}, fn, dn, mn, Sn)), hn = /*@__PURE__*/ createCalendarGetters({\n ...fn,\n ...dn\n}), Dn = /*@__PURE__*/ createCalendarGetters({\n ...dn,\n ...mn\n}), gn = {\n calendarId: t => t.calendar\n}, Pn = /*@__PURE__*/ P((t => e => e[t]), O.concat(\"sign\")), On = /*@__PURE__*/ P(((t, e) => t => t[w[e]]), p), pn = {\n epochMilliseconds: I,\n epochNanoseconds: b\n}, [wn, In, bn] = createSlotClass(A, j, {\n ...Pn,\n blank: y\n}, {\n with: (t, e) => In(N(t, e)),\n negated: t => In(B(t)),\n abs: t => In(Y(t)),\n add: (t, e, n) => In(E(refinePublicRelativeTo, v, L, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => In(E(refinePublicRelativeTo, v, L, 1, t, toDurationSlots(e), n)),\n round: (t, e) => In(V(refinePublicRelativeTo, v, L, t, e)),\n total: (t, e) => J(refinePublicRelativeTo, v, L, t, e),\n toLocaleString(t, e, n) {\n return Intl.DurationFormat ? new Intl.DurationFormat(e, n).format(this) : k(t);\n },\n toString: k,\n toJSON: t => k(t),\n valueOf: neverValueOf\n}, {\n from: t => In(toDurationSlots(t)),\n compare: (t, e, n) => H(refinePublicRelativeTo, v, L, toDurationSlots(t), toDurationSlots(e), n)\n}, k), vn = {\n Instant: Q,\n PlainDateTime: U,\n PlainDate: X,\n PlainTime: tt,\n PlainYearMonth: et,\n PlainMonthDay: nt\n}, Cn = /*@__PURE__*/ K(Q), Fn = /*@__PURE__*/ K(ot), Zn = /*@__PURE__*/ K(U), Mn = /*@__PURE__*/ K(X), yn = /*@__PURE__*/ K(tt), jn = /*@__PURE__*/ K(et), An = /*@__PURE__*/ K(nt), [Nn, Bn] = createSlotClass(ft, ut, On, {\n with(t, e, n) {\n return Bn(rt(this, rejectInvalidBag(e), n));\n },\n add: (t, e) => Bn(at(0, t, toDurationSlots(e))),\n subtract: (t, e) => Bn(at(1, t, toDurationSlots(e))),\n until: (t, e, n) => In(it(0, t, toPlainTimeSlots(e), n)),\n since: (t, e, n) => In(it(1, t, toPlainTimeSlots(e), n)),\n round: (t, e) => Bn(lt(t, e)),\n equals: (t, e) => st(t, toPlainTimeSlots(e)),\n toLocaleString(t, e, n) {\n const [o, r] = yn(e, n, t);\n return o.format(r);\n },\n toString: ct,\n toJSON: t => ct(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => Bn(toPlainTimeSlots(t, e)),\n compare: (t, e) => Dt(toPlainTimeSlots(t), toPlainTimeSlots(e))\n}, ct), [Yn, En] = createSlotClass(x, gt(Mt, Zt), {\n ...gn,\n ...Tn,\n ...On\n}, {\n with: (t, e, n) => En(Pt(v, t, rejectInvalidBag(e), n)),\n withCalendar: (t, e) => En(Ot(t, refineCalendarArg(e))),\n withPlainTime: (t, e) => En(pt(t, optionalToPlainTimeFields(e))),\n add: (t, e, n) => En(wt(v, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => En(wt(v, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(It(v, 0, t, toPlainDateTimeSlots(e), n)),\n since: (t, e, n) => In(It(v, 1, t, toPlainDateTimeSlots(e), n)),\n round: (t, e) => En(bt(t, e)),\n equals: (t, e) => vt(t, toPlainDateTimeSlots(e)),\n toZonedDateTime: (t, e, n) => zn(Ct(L, t, refineTimeZoneArg(e), n)),\n toPlainDate: t => Wn(W(t)),\n toPlainTime: t => Bn(St(t)),\n toLocaleString(t, e, n) {\n const [o, r] = Zn(e, n, t);\n return o.format(r);\n },\n toString: Ft,\n toJSON: t => Ft(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => En(toPlainDateTimeSlots(t, e)),\n compare: (t, e) => Yt(toPlainDateTimeSlots(t), toPlainDateTimeSlots(e))\n}, Ft), [Ln, Vn, Jn] = createSlotClass(qt, gt(kt, Zt), {\n ...gn,\n ...Dn\n}, {\n with: (t, e, n) => Vn(Et(v, t, rejectInvalidBag(e), n)),\n equals: (t, e) => Lt(t, toPlainMonthDaySlots(e)),\n toPlainDate(t, e) {\n return Wn(Vt(v, t, this, e));\n },\n toLocaleString(t, e, n) {\n const [o, r] = An(e, n, t);\n return o.format(r);\n },\n toString: Jt,\n toJSON: t => Jt(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => Vn(toPlainMonthDaySlots(t, e))\n}, Jt), [kn, qn, Rn] = createSlotClass(Qt, gt(Kt, Zt), {\n ...gn,\n ...hn\n}, {\n with: (t, e, n) => qn(Wt(v, t, rejectInvalidBag(e), n)),\n add: (t, e, n) => qn(Gt(v, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => qn(Gt(v, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(_t(v, 0, t, toPlainYearMonthSlots(e), n)),\n since: (t, e, n) => In(_t(v, 1, t, toPlainYearMonthSlots(e), n)),\n equals: (t, e) => zt(t, toPlainYearMonthSlots(e)),\n toPlainDate(t, e) {\n return Wn($t(v, t, this, e));\n },\n toLocaleString(t, e, n) {\n const [o, r] = jn(e, n, t);\n return o.format(r);\n },\n toString: Ht,\n toJSON: t => Ht(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => qn(toPlainYearMonthSlots(t, e)),\n compare: (t, e) => te(toPlainYearMonthSlots(t), toPlainYearMonthSlots(e))\n}, Ht), [xn, Wn, Gn] = createSlotClass(G, gt(ue, Zt), {\n ...gn,\n ...Tn\n}, {\n with: (t, e, n) => Wn(ee(v, t, rejectInvalidBag(e), n)),\n withCalendar: (t, e) => Wn(Ot(t, refineCalendarArg(e))),\n add: (t, e, n) => Wn(ne(v, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => Wn(ne(v, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(oe(v, 0, t, toPlainDateSlots(e), n)),\n since: (t, e, n) => In(oe(v, 1, t, toPlainDateSlots(e), n)),\n equals: (t, e) => re(t, toPlainDateSlots(e)),\n toZonedDateTime(t, e) {\n const n = s(e) ? e : {\n timeZone: e\n };\n return zn(ae(refineTimeZoneArg, toPlainTimeSlots, L, t, n));\n },\n toPlainDateTime: (t, e) => En(ie(t, optionalToPlainTimeFields(e))),\n toPlainYearMonth(t) {\n return qn(le(v, t, this));\n },\n toPlainMonthDay(t) {\n return Vn(se(v, t, this));\n },\n toLocaleString(t, e, n) {\n const [o, r] = Mn(e, n, t);\n return o.format(r);\n },\n toString: ce,\n toJSON: t => ce(t),\n valueOf: neverValueOf\n}, {\n from: (t, e) => Wn(toPlainDateSlots(t, e)),\n compare: (t, e) => te(toPlainDateSlots(t), toPlainDateSlots(e))\n}, ce), [_n, zn] = createSlotClass(_, gt(ye, Zt, Me), {\n ...pn,\n ...gn,\n ...adaptDateMethods(Tn),\n ...adaptDateMethods(On),\n offset: t => Se(slotsToIso(t).offsetNanoseconds),\n offsetNanoseconds: t => slotsToIso(t).offsetNanoseconds,\n timeZoneId: t => t.timeZone,\n hoursInDay: t => Te(L, t)\n}, {\n with: (t, e, n) => zn(De(v, L, t, rejectInvalidBag(e), n)),\n withCalendar: (t, e) => zn(Ot(t, refineCalendarArg(e))),\n withTimeZone: (t, e) => zn(ge(t, refineTimeZoneArg(e))),\n withPlainTime: (t, e) => zn(Pe(L, t, optionalToPlainTimeFields(e))),\n add: (t, e, n) => zn(Oe(v, L, 0, t, toDurationSlots(e), n)),\n subtract: (t, e, n) => zn(Oe(v, L, 1, t, toDurationSlots(e), n)),\n until: (t, e, n) => In(pe(we(v, L, 0, t, toZonedDateTimeSlots(e), n))),\n since: (t, e, n) => In(pe(we(v, L, 1, t, toZonedDateTimeSlots(e), n))),\n round: (t, e) => zn(Ie(L, t, e)),\n startOfDay: t => zn(be(L, t)),\n equals: (t, e) => ve(t, toZonedDateTimeSlots(e)),\n toInstant: t => Hn(Ce(t)),\n toPlainDateTime: t => En(yt(L, t)),\n toPlainDate: t => Wn(fe(L, t)),\n toPlainTime: t => Bn(mt(L, t)),\n toLocaleString(t, e, n = {}) {\n const [o, r] = Fn(e, n, t);\n return o.format(r);\n },\n toString: (t, e) => Fe(L, t, e),\n toJSON: t => Fe(L, t),\n valueOf: neverValueOf,\n getTimeZoneTransition(t, e) {\n const {timeZone: n, epochNanoseconds: o} = t, r = Ze(e), a = L(n).l(o, r);\n return a ? zn({\n ...t,\n epochNanoseconds: a\n }) : null;\n }\n}, {\n from: (t, e) => zn(toZonedDateTimeSlots(t, e)),\n compare: (t, e) => Be(toZonedDateTimeSlots(t), toZonedDateTimeSlots(e))\n}, (t => Fe(L, t))), [$n, Hn, Kn] = createSlotClass(Re, qe, pn, {\n add: (t, e) => Hn(Ye(0, t, toDurationSlots(e))),\n subtract: (t, e) => Hn(Ye(1, t, toDurationSlots(e))),\n until: (t, e, n) => In(Ee(0, t, toInstantSlots(e), n)),\n since: (t, e, n) => In(Ee(1, t, toInstantSlots(e), n)),\n round: (t, e) => Hn(Le(t, e)),\n equals: (t, e) => Ve(t, toInstantSlots(e)),\n toZonedDateTimeISO: (t, e) => zn(Je(t, refineTimeZoneArg(e))),\n toLocaleString(t, e, n) {\n const [o, r] = Cn(e, n, t);\n return o.format(r);\n },\n toString: (t, e) => ke(refineTimeZoneArg, L, t, e),\n toJSON: t => ke(refineTimeZoneArg, L, t),\n valueOf: neverValueOf\n}, {\n from: t => Hn(toInstantSlots(t)),\n fromEpochMilliseconds: t => Hn(ze(t)),\n fromEpochNanoseconds: t => Hn($e(t)),\n compare: (t, e) => He(toInstantSlots(t), toInstantSlots(e))\n}, (t => ke(refineTimeZoneArg, L, t))), Qn = /*@__PURE__*/ Object.defineProperties({}, {\n ...o(\"Temporal.Now\"),\n ...n({\n timeZoneId: () => Qe(),\n instant: () => Hn(xe(Ue())),\n zonedDateTimeISO: (t = Qe()) => zn(Xe(Ue(), refineTimeZoneArg(t), l)),\n plainDateTimeISO: (t = Qe()) => En(jt(tn(L(refineTimeZoneArg(t))), l)),\n plainDateISO: (t = Qe()) => Wn(W(tn(L(refineTimeZoneArg(t))), l)),\n plainTimeISO: (t = Qe()) => Bn(St(tn(L(refineTimeZoneArg(t)))))\n })\n}), Un = /*@__PURE__*/ Object.defineProperties({}, {\n ...o(\"Temporal\"),\n ...n({\n PlainYearMonth: kn,\n PlainMonthDay: Ln,\n PlainDate: xn,\n PlainTime: Nn,\n PlainDateTime: Yn,\n ZonedDateTime: _n,\n Instant: $n,\n Duration: wn,\n Now: Qn\n })\n}), Xn = /*@__PURE__*/ createDateTimeFormatClass(), to = /*@__PURE__*/ new WeakMap, eo = /*@__PURE__*/ Object.defineProperties(Object.create(Intl), n({\n DateTimeFormat: Xn\n}));\n\nexport { Xn as DateTimeFormat, eo as IntlExtended, Un as 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 if (isNaN(time)) {\n return null;\n }\n let calculatedTime = time;\n let cal = this.getAdjustedDate();\n // let cal = new Temporal.PlainDate(adj.year, adj.month, adj.day);\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 if (isSunrise && localTimeHours + hours > 18) {\n cal = cal.add({ days: -1 });\n // cal = cal.minus({days: 1});\n }\n else if (!isSunrise && localTimeHours + hours < 6) {\n cal = cal.add({ days: 1 });\n }\n return cal\n .toZonedDateTime({\n timeZone: 'UTC',\n plainTime: new Temporal.PlainTime(hours, minutes, seconds, Math.trunc(calculatedTime * 1000)),\n })\n .withTimeZone(this.geoLocation.getTimeZone());\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//# sourceMappingURL=index.js.map","import { Temporal as Un, DateTimeFormat as Xn, toTemporalInstant as tj } from \"./chunks/classApi.js\";\n\nimport { createPropDescriptors as n } from \"./chunks/internal.js\";\n\nObject.defineProperties(globalThis, n({\n Temporal: Un\n})), Object.defineProperties(Intl, n({\n DateTimeFormat: Xn\n})), Object.defineProperties(Date.prototype, n({\n toTemporalInstant: tj\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';\n\nconst classicCities0: [string, string, number, number, string, number][] = [\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 [\n 'Buenos Aires',\n 'AR',\n -34.61315,\n -58.37723,\n 'America/Argentina/Buenos_Aires',\n 31,\n ],\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], // -11\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], // -15\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], // -140\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];\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 Map<string, Intl.DateTimeFormat>();\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\n/** Class representing Location */\nexport class Location extends GeoLocation {\n private readonly il: boolean;\n private readonly cc?: string;\n private readonly geoid?: string | number;\n admin1?: string;\n stateName?: string;\n geo?: 'zip' | 'geoname';\n zip?: string;\n population?: number;\n asciiname?: string;\n jersualem?: boolean;\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 =\n 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 this.geoid = geoid;\n }\n\n getIsrael(): boolean {\n return this.il;\n }\n\n getName(): string | null {\n return this.getLocationName();\n }\n\n /**\n * Returns the location name, up to the first comma\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 } else 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 getCountryCode(): string | undefined {\n return this.cc;\n }\n\n getTzid(): string {\n return this.getTimeZone();\n }\n\n /**\n * Gets a 24-hour time formatter (e.g. 07:41 or 20:03) for this location\n */\n getTimeFormatter(): Intl.DateTimeFormat {\n return getFormatter(this.getTimeZone());\n }\n\n getGeoId(): string | number | undefined {\n return this.geoid;\n }\n\n /**\n * Creates a location object from one of 60 \"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 * @param name\n */\n static lookup(name: string): Location | undefined {\n return classicCities.get(name.toLowerCase());\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n\n /**\n * Converts legacy Hebcal timezone to a standard Olson tzid.\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 } else {\n const plus = tz > 0 ? '+' : '';\n return `Etc/GMT${plus}${tz}`;\n }\n } else if (tz === 2 && dst === 'israel') {\n return 'Asia/Jerusalem';\n } else 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 } else 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 } else if (tz === 7 && state === 'AZ') {\n return dst === 'Y' ? 'America/Denver' : 'America/Phoenix';\n } else {\n return ZIPCODES_TZ_MAP[tz];\n }\n }\n\n /**\n * Adds a location name for `Location.lookup()` only if the name isn't\n * already being used. Returns `false` if the name is already taken\n * and `true` if successfully added.\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\nfor (const city of classicCities0) {\n const location = new Location(\n city[2],\n city[3],\n city[1] === 'IL',\n city[4],\n city[0],\n city[1],\n undefined,\n city[5]\n );\n Location.addLocation(city[0], location);\n}\n","import {CalOptions} from './CalOptions';\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 * @private\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\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string')\n 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\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';\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 <a\n * href=\"https://en.wikipedia.org/wiki/Standard_time\">standard time</a>. The globe is split into 360&deg;, with\n * 15&deg; per hour of the day. For a local that is at a longitude that is evenly divisible by 15 (longitude % 15 ==\n * 0), at solar {@link com.kosherjava.zmanim.AstronomicalCalendar#getSunTransit() noon} (with adjustment for the <a\n * href=\"https://en.wikipedia.org/wiki/Equation_of_time\">equation of time</a>) the sun should be directly overhead,\n * so a user who is 1&deg; west of this will have noon at 4 minutes after standard time noon, and conversely, a user\n * who is 1&deg; east of the 15&deg; 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&deg;. 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 <a\n * href=\"https://en.wikipedia.org/wiki/Daylight_saving_time\">Daylight saving time</a> offset since this class is\n * unaware of dates.\n *\n * @return the offset in milliseconds not accounting for Daylight saving time. A positive value will be returned\n * East of the 15&deg; timezone line, and a negative value West of it.\n */\nfunction getLocalMeanTimeOffset(\n dt: Date,\n longitude: number,\n tzid: string\n): 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 molad in UTC as a Temporal.ZonedDateTime.\n * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude\n * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method\n * intentionally uses standard time and not daylight savings time.\n *\n * @return the ZonedDateTime representing the moment of the molad in UTC\n\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","import 'temporal-polyfill/global';\nimport {Event, flags} from './event';\nimport {CalOptions} from './CalOptions';\nimport {HDate, Locale, pad2} from '@hebcal/hdate';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {MoladBase, calculateMolad} from './moladBase';\nimport {getMoladAsDate} from './moladDate';\nimport './locale'; // 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 === 'he' || locale === 'he-x-nonikud' || locale === 'h') {\n return heDayNames;\n } else if (locale === 'fr') {\n return frDoW;\n }\n return enDoW;\n}\n\nfunction getHebrewTimeOfDay(hour: number): string {\n if (hour < 5) return night;\n else if (hour < 12) return 'בַּבֹּקֶר';\n else if (hour < 17) return 'בַּצׇּהֳרַיִים';\n else if (hour < 21) return 'בָּעֶרֶב';\n return night;\n}\n\n/**\n * Represents a molad, the moment when the new moon is \"born\"\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 Hebrew month\n * @param year\n * @param month 1=NISSAN, 7=TISHREI\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 molad in Standard Time in Yerushalayim as a Temporal.ZonedDateTime.\n * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude\n * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method\n * intentionally uses standard time and not daylight savings time.\n *\n * @return the Temporal.ZonedDateTime representing the moment of the molad in Yerushalayim standard time (GMT + 2)\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 <a\n * href=\"https://en.wikipedia.org/wiki/Yosef_Karo\">Mechaber</a>. See the <a\n * href=\"https://en.wikipedia.org/wiki/Yoel_Sirkis\">Bach's</a> 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 <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> 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 * <a href=\"https://en.wikipedia.org/wiki/Moses_Isserles\">Rema</a> who brings down the opinion of the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> of calculating\n * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} 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 <a\n * href=\"https://www.worldcat.org/oclc/461326125\">Shaarei Zmanim</a>. 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 * @param [locale] Optional locale name (defaults to empty locale)\n * @param options\n */\n render(locale?: string, options?: CalOptions): string {\n locale = locale ?? 'en';\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\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 (isHebrewLocale) {\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 === '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 = monthName.replace(/'/g, '’');\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 {\n HDate,\n getPseudoISO,\n getTimezoneOffset,\n isDate,\n pad2,\n} from '@hebcal/hdate';\nimport {Molad} from './molad';\n\n/**\n * @private\n */\nfunction zdtToDate(zdt: Temporal.ZonedDateTime | null): Date {\n if (zdt === null) {\n return new Date(NaN);\n }\n const res = new Date(zdt.epochMilliseconds);\n res.setMilliseconds(0);\n return res;\n}\n\n/**\n * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;\n */\nconst GEOMETRIC_ZENITH: number = 90;\n\n/**\n * The zenith of 1.583&deg; below {@link GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for\n * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the\n * <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>.\n *\n * @see Zmanim.sunriseBaalHatanya()\n * @see Zmanim.sunsetBaalHatanya()\n */\nconst ZENITH_1_POINT_583: number = GEOMETRIC_ZENITH + 1.583;\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 * const {GeoLocation, Zmanim} = require('@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 */\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 this.plainDate = Temporal.PlainDate.from({\n year: dt.getFullYear(),\n month: dt.getMonth() + 1,\n day: 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 elevation adjustment is enabled\n * for zmanim support elevation adjustment\n */\n getUseElevation(): boolean {\n return this.useElevation;\n }\n /**\n * Enables or disables elevation adjustment for zmanim support elevation adjustment\n * @param useElevation\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\n * @param rising\n */\n timeAtAngle(angle: number, rising: boolean): Date {\n const offsetZenith = GEOMETRIC_ZENITH + angle;\n const zdt = rising\n ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)\n : this.noaa.getSunsetOffsetByDegrees(offsetZenith);\n return zdtToDate(zdt);\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 const zdt = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getSeaLevelSunrise();\n return zdtToDate(zdt);\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 const zdt = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getSeaLevelSunset();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getBeginCivilTwilight();\n return zdtToDate(zdt);\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 const zdt = this.noaa.getEndCivilTwilight();\n return zdtToDate(zdt);\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 * @private\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 chatzot(): Date {\n const startOfDay = this.noaa.getSeaLevelSunrise();\n const endOfDay = this.noaa.getSeaLevelSunset();\n const zdt = this.noaa.getSunTransit(startOfDay, endOfDay);\n return zdtToDate(zdt);\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 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 getShaahZmanisBasedZmanZdt(\n startOfDay: Temporal.ZonedDateTime | null,\n endOfDay: Temporal.ZonedDateTime | null,\n hours: number\n ): Temporal.ZonedDateTime | null {\n const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);\n const offset = Math.trunc(temporalHour * hours);\n const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);\n return zdt;\n }\n /**\n * Utility method for using elevation-aware sunrise/sunset\n * @private\n * @param hours\n */\n private getShaahZmanisBasedZman(hours: number): Date {\n const startOfDay = this.useElevation\n ? this.noaa.getSunrise()\n : this.noaa.getSeaLevelSunrise();\n const endOfDay = this.useElevation\n ? this.noaa.getSunset()\n : this.noaa.getSeaLevelSunset();\n const zdt = this.getShaahZmanisBasedZmanZdt(startOfDay, endOfDay, hours);\n return zdtToDate(zdt);\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 shema in the morning)\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 <a href=\"https://en.wikipedia.org/wiki/Vilna_Gaon\">GRA</a>. This time is 5 hours into the day based on the\n * opinion of the <a href=\"https://en.wikipedia.org/wiki/Vilna_Gaon\">GRA</a> that the day is calculated from\n * sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea\n * level sunrise}.\n * @return the <code>Date</code> of the latest time for burning _chametz_ on _Erev Pesach_. If it is not\n * _erev Pesach_ or the calculation can't be computed such as in the Arctic Circle where there is at least\n * one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be\n * returned.\n */\n sofZmanBiurChametzGRA(): Date {\n return this.getShaahZmanisBasedZman(5);\n }\n /**\n * Returns an array with alot (Date) and ms in hour (number)\n * @private\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 an array with alot (Date) and ms in hour (number)\n * @private\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 the latest 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 * @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 * Because degree-based functions estimate the amount of light in the sky,\n * the result is not impacted by elevation.\n */\n tzeit(angle = 8.5): Date {\n return this.timeAtAngle(angle, false);\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 <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> 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 * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between\n * _tzais_ and _alos_, see {@link getSofZmanKidushLevanaBetweenMoldos}.\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 Date representing the moment halfway between molad and molad. If the time occurs between\n * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this\n * day, a `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 * <a href=\"https://en.wikipedia.org/wiki/Moses_Isserles\">Rema</a> who brings down the opinion of the <a\n * href=\"https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin\">Maharil's</a> 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 the subject,\n * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href=\"https://hebrewbooks.org/53000\">Shaarei\n * Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to\n * between _tzais_ and _alos_, see {@link getSofZmanKidushLevana15Days}.\n *\n * @return the Date representing the moment 15 days after the _molad_. If the time occurs between\n * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a\n * `null` will be returned.\n *\n *\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 <a href=\n * \"https://en.wikipedia.org/wiki/Yonah_Gerondi\">Rabbeinu Yonah</a>'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 Date representing the moment 3 days after the molad. If the time occurs between _alos_ and\n * _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a\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 _Molad_ as a <code>Date</code> Object. For the traditional day of week, hour,\n * minute and chalakim, {@link Molad.getInstant()} and the not yet completed\n * {@link HebrewDateFormatter} that will have formatting for this.\n *\n * @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a\n * `null` will be returned.\n *\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. Use {@link getTchilasZmanKidushLevana7Days} if you want to limit the time to night hours.\n *\n * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_\n * will not occur on this day, a `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 <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>'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&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom\n * DovBer Levine's commentary on The <a href=\"https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf\">Baal\n * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=\n * \"https://en.wikipedia.org/wiki/Mount_Carmel\">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;\n * below the sea level horizon. This in turn is based on the Gemara <a href=\n * \"https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35\">Shabbos 35a</a>. 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&deg;. This is identical to the 1&deg; 35' _zman_\n * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=\n * \"https://en.wikipedia.org/wiki/Chabad\">Chabad</a> calendars that use the Baal Hatanya's _zmanim_. See\n * <a href=\"https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm\">About Our\n * _Zmanim_ Calculations @ Chabad.org</a>.\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 <code>Date</code> representing 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, a `null` will be returned. See detailed explanation on top of the page.\n *\n * @see ZENITH_1_POINT_583\n */\n private getSunriseBaalHatanya(): Temporal.ZonedDateTime | null {\n return this.noaa.getSunriseOffsetByDegrees(ZENITH_1_POINT_583);\n }\n\n /**\n * A method that returns the <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>'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 * <a href=\"https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm\">About Our\n * _Zmanim_ Calculations @ Chabad.org</a>.\n *\n * @return the <code>Date</code> representing 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, a `null` will be returned.\n *\n * @see ZENITH_1_POINT_583\n */\n private getSunsetBaalHatanya(): Temporal.ZonedDateTime | null {\n return this.noaa.getSunsetOffsetByDegrees(ZENITH_1_POINT_583);\n }\n\n /**\n * Returns the <a href=\"https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi\">Baal Hatanya</a>'s _alos_\n * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link GEOMETRIC_ZENITH geometric horizon}\n * before {@link getSunrise() sunrise}.\n *\n * The zenith of 16.9&deg; below is based on the calculation that the time between dawn\n * and _netz amiti_ (sunrise) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes\n * a mil (<a href=\"https://en.wikipedia.org/wiki/Maimonides\">Rambam</a> and others). The sun's position at 72\n * minutes before {@link getSunriseBaalHatanya _netz amiti_ (sunrise)} in Jerusalem <a href=\n * \"https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/\">around the equinox / equilux</a> is\n * 16.9&deg; below {@link GEOMETRIC_ZENITH geometric zenith}.\n *\n * @return The <code>Date</code> of dawn. If the calculation can't be computed such as 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, a `null` will be returned. */\n public alosBaalHatanya(): Date {\n return this.timeAtAngle(16.9, true);\n }\n\n private getShaahZmanisBaalHatanya(hours: number): Date {\n const zdt = this.getShaahZmanisBasedZmanZdt(\n this.getSunriseBaalHatanya(),\n this.getSunsetBaalHatanya(),\n hours\n );\n return zdtToDate(zdt);\n }\n\n /**\n * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3\n * {@link shaahZmanisBaalHatanya() _shaos zmaniyos_} (solar hours) after {@link getSunriseBaalHatanya()\n * _netz amiti_ (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from\n * sunrise to sunset. This returns the time 3 * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya()\n * _netz amiti_ (sunrise)}.\n *\n * @return the <code>Date</code> 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, a `null` 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 * hours into the day based on the opinion of the Baal Hatanya that the day is\n * calculated from sunrise to sunset. This returns the time 4 * {@link getShaahZmanisBaalHatanya()} after\n * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.\n *\n * @return the <code>Date</code> 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, a `null` 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 <a href=\"https://en.wikipedia.org/wiki/Maimonides\">Rambam</a> is of the opinion that it is\n * better to delay _mincha_ until {@link minchaKetanaBaalHatanya() _mincha ketana_} while the\n * <a href=\"https://en.wikipedia.org/wiki/Asher_ben_Jehiel\">Ra\"sh</a>,\n * <a href=\"https://en.wikipedia.org/wiki/Jacob_ben_Asher\">Tur</a>, <a href=\n * \"https://en.wikipedia.org/wiki/Vilna_Gaon\">GRA</a> and others are of the opinion that _mincha_ can be prayed\n * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 {@link getShaahZmanisBaalHatanya()\n * sea level solar hours} after {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}. This calculation is based\n * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5\n * * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya() _netz amiti_ (\"real\" sunrise)}.\n * @return the <code>Date</code> 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, a `null` 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 <a href=\"https://en.wikipedia.org/wiki/Maimonides\">Rambam</a> 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 {@link getSunriseBaalHatanya\n * _netz amiti_ (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the\n * day is calculated from sunrise to sunset. This returns the time 9.5 * after\n * _netz amiti_ (sunrise).\n *\n * @return the <code>Date</code> 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, a `null` 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 hours after sunrise. This\n * calculation is based on the opinion of the Baal Hatanya that the day is calculated\n * from sunrise to sunset. This returns the time 10.75 * {@link getShaahZmanisBaalHatanya()} after\n * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.\n *\n * @return the <code>Date</code> of the time of _plag hamincha_. 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.\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&deg; below the western geometric horizon\n * (90&deg;) after {@link getSunset() sunset}. For information on the source of this calculation see\n * {@link ZENITH_6_DEGREES}.\n *\n * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as 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, a `null` will be returned. * @see ZENITH_6_DEGREES\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 */\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 const hm = time.split(':');\n if (hm[0] === '24') {\n return '00:' + hm[1];\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 =\n 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) +\n 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(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): 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(\n offset: number,\n roundMinute = true,\n forceSeaLevel = false\n ): 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 * const {GeoLocation, Zmanim, HDate} = require('@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","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","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'; // 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 } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\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 Parashah HaShavua for an entire Hebrew year\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 * Caculates the Parashah HaShavua 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(\n `improper sedra year type ${key} calculated for ${hyear}`\n );\n }\n }\n\n /**\n * Returns the date that a parsha occurs\n * or `null` if the parsha doesn't occur this year\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 */\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 } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(\n `Invalid parsha argument: ${JSON.stringify(parsha)}`\n );\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 that a parsha (or its doubled or undoubled counterpart)\n * occurs, or `null` if the parsha doesn't occur this year\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 sedra schedule.\n * Used by `@hebcal/triennial`\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * R.D. date of the first Saturday on or after Rosh Hashana\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns an object describing the parsha on the first Saturday on or after `hd`\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs =\n typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(\n `Date ${hd} before start of Hebrew year ${this.year}`\n );\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/**\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\ntype 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(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\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 `Sedra` or reuse a previously\n * created and cached instance.\n * @param hyear\n * @param il\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';\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 * @readonly\n * @enum {string}\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 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';\nimport {holidayDesc as hdesc} from './staticHolidays';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/** Represents a built-in holiday like Pesach, Purim or Tu BiShvat */\nexport class HolidayEvent extends Event {\n /** During Sukkot or Pesach */\n 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 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 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 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 this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +\n '-' +\n this.urlDateSuffix();\n return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;\n }\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 } else if (this.getFlags() & flags.SPECIAL_SHABBAT) {\n return '🕍';\n } else {\n return '✡️';\n }\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 str.replace(/'/g, '’');\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 str.replace(/'/g, '’');\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 urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replace(/-/g, '');\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 * @private\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 = monthName0.replace(/'/g, '’');\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';\nimport {HolidayEvent} from './HolidayEvent';\nimport './locale'; // 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 * @private\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 = monthName0.replace(/'/g, '’');\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';\nimport {dateYomHaShoah, dateYomHaZikaron} from './modern';\nimport {getSedra} from './sedra';\nimport {\n staticHolidays,\n staticModernHolidays,\n holidayDesc as hdesc,\n} from './staticHolidays';\nimport {YomKippurKatanEvent} from './YomKippurKatanEvent';\nimport {\n HolidayEvent,\n ChanukahEvent,\n AsaraBTevetEvent,\n RoshHashanaEvent,\n RoshChodeshEvent,\n} from './HolidayEvent';\n\n/**\n * Returns an array of Events on this date (or `undefined` if no events)\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 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 TAMUZ = months.TAMUZ;\nconst AV = months.AV;\nconst TISHREI = months.TISHREI;\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;\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 } else 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 ev = new HolidayEvent(hd, h.desc, h.flags);\n if (h.emoji) ev.emoji = h.emoji;\n if (h.chmDay) ev.cholHaMoedDay = h.chmDay;\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(\n new HDate(10, TEVET, year),\n hdesc.ASARA_BTEVET,\n MINOR_FAST\n )\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 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(\n new HolidayEvent(hd, hdesc.BIRKAT_HACHAMAH, MINOR_HOLIDAY, {emoji: '☀️'})\n );\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 an array of holidays for the year\n * @param year Hebrew year\n * @param il use the Israeli schedule for holidays\n */\nexport function getHolidaysForYearArray(\n year: number,\n il: boolean\n): 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} from '@hebcal/hdate';\nimport {Zmanim} from './zmanim';\nimport {Location} from './location';\nimport {getHolidaysOnDate} from './holidays';\nimport {Event, flags} from './event';\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 <em>Shabbos</em> or if it is a <em>Yom Tov</em> day that has a <em>melacha</em> (work) prohibition.\n *\n * @return if the day is a <em>Yom Tov</em> that is <em>assur bemlacha</em> or <em>Shabbos</em>\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 * Utility method to determine if the date and time has a <em>melacha</em> (work) prohibition.\n * Although there are many opinions on the time of <em>tzais</em>, for simplicity\n * this function uses solar depression of 8.5 degrees.\n *\n * @return `true` if <em>melacha</em> is prohibited or `false` if it is not.\n */\nexport function isAssurBemlacha(\n currentTime: Date,\n location: Location,\n useElevation: boolean\n): boolean {\n const zmanim = new Zmanim(location, currentTime, 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 hd = new HDate(currentTime);\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, Locale} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions';\nimport {Location} from './location';\nimport {Event} from './event';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {Zmanim} from './zmanim';\nimport {holidayDesc as hdesc} from './staticHolidays';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst HAVDALAH = hdesc.HAVDALAH;\nconst CANDLE_LIGHTING = hdesc.CANDLE_LIGHTING;\n\n/** An event that has an `eventTime` and `eventTimeStr` */\nexport class TimedEvent extends Event {\n readonly eventTime: Date;\n readonly location: Location;\n readonly eventTimeStr: string;\n readonly fmtTime: string;\n readonly linkedEvent?: Event;\n /**\n * @param desc Description (not translated)\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/** Candle lighting before Shabbat or holiday */\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(\n date,\n CANDLE_LIGHTING,\n mask,\n eventTime,\n location,\n linkedEvent,\n options\n );\n }\n\n getEmoji(): string {\n return '🕯️';\n }\n}\n\n/** Havdalah after Shabbat or holiday */\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';\nimport {Location} from './location';\nimport {Event, flags} from './event';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent';\nimport {Zmanim} from './zmanim';\nimport {TimedEvent, CandleLightingEvent, HavdalahEvent} from './TimedEvent';\nimport {holidayDesc as hdesc} from './staticHolidays';\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/** A fast day also contains a start and end time */\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 fastEndDeg = options.fastEndDeg;\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 tzeit = zmanim.tzeit(fastEndDeg);\n if (!isNaN(tzeit.getTime())) {\n endEvent = makeTimedEvent(ev, tzeit, 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 tzeit = zmanim.tzeit(fastEndDeg);\n if (!isNaN(tzeit.getTime())) {\n endEvent = makeTimedEvent(ev, tzeit, 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\nexport class TimedChanukahEvent extends ChanukahEvent {\n eventTime: Date;\n eventTimeStr: string;\n readonly location: Location;\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","import {HDate, Locale, gematriya} from '@hebcal/hdate';\nimport {Event, flags} from './event';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport sefira from './sefira.json';\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/** Represents a day 1-49 of counting the Omer from Pesach to Shavuot */\nexport class OmerEvent extends Event {\n private readonly weekNumber: number;\n private readonly daysWithinWeeks: number;\n readonly omer: number;\n\n /**\n * @param date\n * @param omerDay\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 sefira. For example, on day 8:\n * * חֶֽסֶד שֶׁבִּגְבוּרָה\n * * Chesed shebiGevurah\n * * Lovingkindness within Might\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 locale = locale ?? 'en';\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrewLocale =\n locale === 'he' || locale === 'he-x-nonikud' || locale === 'h';\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 getWeeks(): number {\n const day7 = this.daysWithinWeeks === 7;\n return day7 ? this.weekNumber : this.weekNumber - 1;\n }\n\n getDaysWithinWeeks(): number {\n return this.daysWithinWeeks;\n }\n /**\n * Returns a sentence with that evening's omer count\n * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`\n * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`\n */\n getTodayIs(locale: string): string {\n locale = locale ?? 'en';\n if (typeof locale === 'string') {\n locale = locale.toLowerCase();\n }\n const isHebrew = locale === 'he' || locale === 'he-x-nonikud';\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 <= 4000 || 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 {Event, flags} from './event';\nimport {isoDateString} from '@hebcal/hdate';\nimport {renderParshaName} from './parshaName';\nimport {SedraResult} from './sedra';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\n/**\n * Represents one of 54 weekly Torah portions, always on a Saturday\n */\nexport class ParshaEvent extends Event {\n readonly p: SedraResult;\n constructor(parsha: SedraResult) {\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/' +\n this.basename().toLowerCase().replace(/'/g, '').replace(/ /g, '-') +\n '-' +\n dt;\n return this.p.il ? url + '?i=on' : url;\n }\n\n urlDateSuffix(): string {\n const isoDate = isoDateString(this.greg());\n return isoDate.replace(/-/g, '');\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';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n const locale0 = locale ?? 'en';\n let name = Locale.gettext(parsha[0], locale0);\n if (parsha.length === 2) {\n const hyphen = locale0 === 'he' ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale0);\n }\n name = name.replace(/'/g, '’');\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n","import {HDate, Locale, months} from '@hebcal/hdate';\nimport {Event, flags} from './event';\nimport {Molad} from './molad';\nimport './locale'; // 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]\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 = monthName0.replace(/'/g, '’');\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 {HDate} from '@hebcal/hdate';\nimport {Event} from './event';\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-ins for daily learning calendars such as Daf Yomi, Mishna Yomi, Nach Yomi, etc.\n *\n * Learning schedules are provided by the `@hebcal/learning` package.\n */\nexport class DailyLearning {\n /**\n * Register a new learning calendar.\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 an event from daily calendar for a given date. Returns `null` if there\n * is no learning from this calendar on this date.\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 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 * Tests to see if learning calendar has been registered\n * @param name case insensitive\n */\n static has(name: string): boolean {\n return cals.has(name.toLowerCase());\n }\n\n /** Returns the names of all calendars registered */\n static getCalendars(): string[] {\n return Array.from(cals.keys());\n }\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern';\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(\n hdate: HDate,\n il: boolean,\n checkNext: boolean\n): 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(\n mday => new HDate(mday, months.TISHREI, year)\n ),\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 {greg2abs, isDate, daysInGregMonth, HDate, months} from '@hebcal/hdate';\nimport {CalOptions} from './CalOptions';\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\n/**\n * Parse options object to determine start & end days\n * @private\n */\nexport function getStartAndEnd(options: CalOptions): number[] {\n if ((options.start && !options.end) || (options.end && !options.start)) {\n throw new TypeError('Both options.start and options.end are required');\n } else if (options.start && options.end) {\n return [getAbs(options.start), getAbs(options.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 } else 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 (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 } else 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 {Locale} from './locale';\nimport {abs2greg, HDate, months} from '@hebcal/hdate';\nimport {CalOptions, DailyLearningValue} from './CalOptions';\nimport {\n makeCandleEvent,\n makeFastStartEnd,\n makeWeekdayChanukahCandleLighting,\n} from './candles';\nimport {Event, flags} from './event';\nimport {getStartAndEnd} from './getStartAndEnd';\nimport {HebrewDateEvent} from './HebrewDateEvent';\nimport {HolidayYearMap, getHolidaysForYear_} from './holidays';\nimport {ParshaEvent} from './ParshaEvent';\nimport {Sedra, getSedra} from './sedra';\nimport {TimedEvent, HavdalahEvent} from './TimedEvent';\nimport {DailyLearning} from './DailyLearning';\nimport {ChanukahEvent, HolidayEvent} from './HolidayEvent';\nimport {MevarchimChodeshEvent} from './MevarchimChodeshEvent';\nimport {MoladEvent, Molad} from './molad';\nimport {OmerEvent} from './omer';\nimport {Zmanim} from './zmanim';\nimport {Location} from './location';\nimport {holidayDesc as hdesc} from './staticHolidays';\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)\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 * * 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 (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) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\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 {HebrewCalendar, HDate, Location, Event} 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 */\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 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 const mm = hd.getMonth();\n const dd = hd.getDate();\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;\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 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 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 (\n RECOGNIZED_OPTIONS[k] === undefined &&\n !unrecognizedAlreadyWarned.has(k)\n ) {\n console.warn(`Ignoring unrecognized HebrewCalendar option: ${k}`);\n unrecognizedAlreadyWarned.add(k);\n }\n }\n if (options.dailyLearning) {\n for (const k of Object.keys(options.dailyLearning)) {\n if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(k)) {\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 * @private\n * @constant\n * This calculation is based on observation of 3 medium sized stars by Dr. Baruch Cohen\n * in his calendar published in in 1899 in Strasbourg, France.\n * This calculates to 7.0833333° below geometric zenith.\n * @see {https://kosherjava.com/zmanim/docs/api/com/kosherjava/zmanim/ComplexZmanimCalendar.html#ZENITH_7_POINT_083}\n */\nconst TZEIT_3MEDIUM_STARS = 7.0833333;\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(\n 'options.candlelighting requires valid options.location'\n );\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\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, min);\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 = TZEIT_3MEDIUM_STARS;\n }\n}\n\nfunction overrideIsraelCandleMins(location: Location, min: number) {\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 min;\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.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 & 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.noModern && eFlags & MODERN_HOLIDAY)\n ) {\n return candlesEv; // bail out early\n }\n if (options.candlelighting && ev.getDesc() === '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() !== '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 ) {\n events.push(ev); // the original event itself\n }\n }\n if (\n (isMajorFast || (isMinorFast && !options.noMinorFast)) &&\n fastEv?.endEvent\n ) {\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 || 'en', options);\n evts.push(\n new MevarchimChodeshEvent(hd, nextMonthName, memo, options.locale)\n );\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 const time = zmanim.sofZmanBiurChametzGRA();\n if (isNaN(zmanAchilas.getTime()) || isNaN(time.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 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 evts.push(biurChametzEv);\n return evts;\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 {getBirthdayHD, getYahrzeitHD, HDate} from '@hebcal/hdate';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\nimport {CalOptions} from './CalOptions';\nimport {version as pkgVersion} from './pkgVersion';\nimport {Event, flags} from './event';\nimport {Sedra, getSedra} from './sedra';\nimport {hallel_} from './hallel';\nimport {\n getHolidaysForYear_,\n getHolidaysForYearArray,\n getHolidaysOnDate,\n HolidayYearMap,\n} from './holidays';\nimport {HolidayEvent} from './HolidayEvent';\nimport {reformatTimeStr} from './reformatTimeStr';\nimport {TachanunResult, tachanun} from './tachanun';\nimport {calendar} from './calendar';\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 * 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)\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 * * 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 (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) and\n * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon\n * in the evening).\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 {HebrewCalendar, HDate, Location, Event} 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 * `hyear` must be after original `gdate` of anniversary.\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 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 const dt = getBirthdayHD(hyear, gdate);\n if (dt === undefined) {\n return dt;\n }\n return new HDate(dt);\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 const dt = getYahrzeitHD(hyear, gdate);\n if (dt === undefined) {\n return dt;\n }\n return new HDate(dt);\n }\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 * @param year Hebrew year\n */\n static getHolidaysForYear(year: number): HolidayYearMap {\n return getHolidaysForYear_(year);\n }\n\n /**\n * Returns an array of holidays for the year\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 Events on this date (or `undefined` if no events)\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 * Eruv Tavshilin\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 23-hour (00:00-23:59) time in US format (\"8:13pm\") or\n * keep as \"20:13\" for any other locale/country. Uses {@link CalOptions} to determine\n * locale.\n * If `options.hour12` is `false`, locale is ignored and always returns 24-hour time.\n * If `options.hour12` is `true`, locale is ignored and always returns 12-hour time.\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\n */\n static reformatTimeStr(\n timeStr: string,\n suffix: string,\n options: CalOptions\n ): string {\n return reformatTimeStr(timeStr, suffix, options);\n }\n\n static version(): string {\n return pkgVersion;\n }\n\n /**\n * Convenience function to create an instance of `Sedra` or reuse a previously\n * created and cached instance.\n */\n static getSedra(hyear: number, il: boolean): Sedra {\n return getSedra(hyear, il);\n }\n\n /**\n * Return a number containing information on what Hallel is said on that day.\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 *\n * The number is one of the following values:\n *\n * 0 - No Hallel\n * 1 - Half Hallel\n * 2 - Whole Hallel\n */\n static hallel(hdate: HDate, il: boolean): number {\n const events = getHolidaysForYearArray(hdate.getFullYear(), il);\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 */\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';\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 whole = events\n .filter(ev => {\n const desc: string = ev.getDesc();\n const hd: HDate = ev.getDate();\n const month = hd.getMonth();\n const mday = hd.getDate();\n return (\n desc.startsWith('Chanukah') ||\n desc.startsWith('Shavuot') ||\n desc.startsWith('Sukkot') ||\n (month === months.NISAN &&\n (mday === 15 || mday === 16) &&\n ev.getFlags() & flags.CHAG) || // Pesach\n desc === \"Yom HaAtzma'ut\" ||\n desc === 'Yom Yerushalayim'\n );\n })\n .map(ev => {\n return ev.getDate().abs();\n });\n\n const abs = hdate.abs();\n if (whole.includes(abs)) {\n return WHOLE;\n }\n\n const half = events\n .filter(ev => {\n const desc = ev.getDesc();\n return (\n ev.getFlags() & flags.ROSH_CHODESH ||\n (desc.startsWith('Pesach') &&\n desc !== 'Pesach I' &&\n desc !== 'Pesach II')\n );\n })\n .map(ev => {\n return ev.getDate().abs();\n });\n\n if (half.includes(abs)) {\n return HALF;\n }\n\n return NONE;\n}\n","import {HDate, months} from '@hebcal/hdate';\nimport {ParshaEvent} from './ParshaEvent';\nimport {getSedra} from './sedra';\n\n/**\n * Calculates weekly Torah Reading on Saturdays for entire year\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","edCache","Map","EPOCH","assertNumber","n","name","hebrew2abs","tempabs","m","monthsInYear","elapsedDays","newYear","abs2hebrew","yy","mm","dd","longCheshvan","shortKislev","getMonthName","get","elapsed","prevYear","mElapsed","pElapsed","hElapsed","parts","altDay","elapsedDays0","set","daysInYear","monthFromName","monthName","c","trim","toLowerCase","startsWith","substring","test","toSimpleHebrewDate","obj0","isSimpleHebrewDate","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","dateFormatRegex","getPseudoISO","tzid","fmt","f","Intl","DateTimeFormat","hour","minute","second","hour12","timeZone","getFormatter","format","exec","Error","getTimezoneOffset","utcStr","localStr","diffMs","ceil","isoDateString","poHe","headers","language","contexts","Adar","Av","Cheshvan","Elul","Iyyar","Kislev","Nisan","Sivan","Tamuz","Tammuz","Tevet","Tishrei","noopLocale","alias","h","a","s","locales","getEnOrdinal","v","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","locale0","copyLocaleNoNikud","strs","poHeNoNikud","UNITS_DAY","UNITS_WEEK","UNITS_MONTH","UNITS_YEAR","HDate","rd","constructor","arguments","hd","monthNum","fix","setMonth","abs0","isNumber","d","getTishreiMonth","nummonths","getDay","render","showYear","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","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","flagToCategory","Event","desc","mask","attrs","getDesc","getFlags","renderBrief","getEmoji","emoji","basename","url","observedInIsrael","observedInDiaspora","observedIn","il","getCategories","HebrewDateEvent","super","renderBriefHebrew","clampProp","e","o","r","ba","missingField","clampNumber","numberOutOfRange","on","value","configurable","writable","Symbol","toStringTag","zipProps","P","remapProps","nn","create","hasAnyPropsByName","allPropsEqual","zeroOutProps","gt","capitalize","toUpperCase","sortStrings","padNumber","padStart","compareNumbers","max","divModFloor","modFloor","divModTrunc","divTrunc","modTrunc","hasHalf","givenFieldsToBigNano","Zu","go","u","nanoToGivenFields","S","T","requireNumberIsPositive","_e","rl","requirePropDefined","oa","ru","requireType","invalidEntity","Number","isInteger","expectedInteger","expectedPositive","tu","ou","toStringViaPrimitive","toBigInt","BigInt","invalidBigInt","toNumber","forbiddenBigIntToNumber","isFinite","expectedFinite","Za","Ba","toPositiveInteger","createBigNano","so","Ta","va","pa","bigNanoOutside","bigIntToBigNano","Ge","La","Oa","divModBigNano","checkIsoYearMonthInBounds","Nl","yl","isoYear","To","Do","At","isoHour","io","ma","isoDay","isoNanosecond","Ml","Tl","Mu","isoTimeFieldsToNano","w","nanoToIsoTimeAndDay","epochNanoToSecMod","oo","isoToEpochMilli","isoArgsToEpochMilli","isoMonth","isoMinute","isoSecond","isoMillisecond","Cu","Ke","isoMicrosecond","ro","isoToEpochNanoWithOffset","isoArgsToEpochSec","ku","isoToLegacyDate","valueOf","setUTCHours","setUTCFullYear","So","Pa","gl","pl","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","getUTCMilliseconds","hashIntlFormatParts","formatToParts","type","computeIsoDateParts","computeIsoMonthCodeParts","computeIsoMonthsInYear","Fl","computeIsoDaysInMonth","computeIsoInLeapYear","computeIsoDaysInYear","Ha","getUTCDay","computeIsoEraParts","Xu","el","Ol","computeJapaneseEraParts","El","bf","era","eraYear","parseIntlYear","checkIsoDateTimeFields","checkIsoDateFields","constrainIsoTimeFields","constrainIsoDateFields","isIsoDateFieldsValid","ml","Gl","je","normalizeOptions","Vl","_l","refineDiffOptions","$l","parseRoundingIncInteger","Xl","xl","checkLargestSmallestUnit","refineRoundingInc","refineRoundingOptions","normalizeOptionsOrString","bl","refineDateDisplayOptions","Jl","refineTimeDisplayOptions","refineTimeDisplayTuple","refineSubsecDigits","refineSmallestUnitAndSubsecDigits","Bl","Yl","fabricateOverflowOptions","overflow","Rl","refineUnitOption","Bu","ul","invalidChoice","Yu","refineChoiceOption","Eu","xe","branding","Re","epochNanoseconds","Xe","_","calendar","jt","Il","W","G","Ca","createPlainYearMonthSlots","Qt","createPlainMonthDaySlots","qt","St","ft","hl","pe","A","computeDurationSign","I","fa","J","getMaxDurationUnit","Sl","Cl","Hl","isUniformUnit","totalDayTimeDuration","vu","l","createMarkerSystem","createMarkerToEpochNano","createMoveMarker","p","createDiffMarkers","isZonedEpochSlots","clampRelativeDuration","dl","ja","O","ya","durationFieldsToBigNano","du","Ie","he","getStartOfDayInstantFor","Ea","uo","computeDayInterval","N","getMatchingInstantFor","roundDateTime","be","lo","ho","roundDateTimeToNano","computeNanoInc","roundTimeToNano","Ua","Da","roundToMinute","ao","Ra","roundDayTimeDurationByInc","nanoToDurationDayTimeFields","Ya","roundRelativeDuration","nudgeZonedTimeDuration","nudgeDayTimeDuration","nudgeRelativeDuration","roundBigNano","ef","fl","D","g","nanoToDurationTimeFields","days","Boolean","weeks","ke","formatIsoDateTimeFields","Se","nf","Fe","Ql","Kl","formatCalendar","Ft","ce","formatIsoDateFields","Ht","formatDateLikeIso","formatIsoYearMonthFields","Jt","formatIsoMonthDayFields","ct","formatIsoTimeFields","k","checkDurationUnits","negateDurationFields","hours","minutes","checkDurationTimeUnit","formatSubsecNano","formatDurationFragments","Y","formatDurationNumber","years","M","H","formatCalendarId","join","wu","getSignStr","no","af","toLocaleString","useGrouping","_zonedEpochSlotsToIso","offsetNanoseconds","gu","$o","Tu","Du","Ye","durationHasDateParts","Pu","Oe","Fa","wt","ka","ne","moveDate","Gt","Na","B","ll","at","moveTime","diffZonedEpochsExact","diffDateTimesExact","E","relativeTo","Nu","cl","sf","isSafeInteger","yu","sl","createSplitTuple","computePeriod","tf","parseOffsetNano","parseOffsetNanoMaybe","failedParse","me","parseDateTimeLike","C","Pl","finalizeDateTime","finalizeDate","requireIsoCalendar","invalidSubstring","finalizeZonedDateTime","Z","L","j","resolveSlotsCalendar","gf","organizeIsoYearParts","organizeTimeParts","organizeAnnotationParts","parseYearMonthOnly","If","parseMonthDayOnly","Df","Mf","Iu","parseInt0","parseSubsecNano","parseSign","yf","reverse","padEnd","createRegExp","RegExp","getTimeZoneEssence","Ff","F","Pf","hu","map","getTimeZoneAtomic","resolvedOptions","vf","He","Be","Yt","te","Dt","isTimeZoneIdsEqual","Ee","diffEpochNanos","we","ha","pu","ga","diffZonedEpochsBig","It","diffDateTimesBig","oe","diffDateLike","_t","it","diffTimes","diffEpochNanosExact","updateMid","Sa","td","diffEpochMilliByDay","mu","computeNativeWeekOfYear","computeNativeYearOfWeek","computeNativeDayOfYear","parseMonthCode","Ef","invalidMonthCode","sa","monthCodeNumberToMonth","monthToMonthCodeNumber","eraYearToYear","getCalendarEraOrigins","nl","getCalendarIdBase","getCalendarLeapMonthMeta","ol","computeCalendarIdBase","createIntlCalendar","epochMilliToIntlFields","V","createIntlFieldCache","createIntlYearDataCache","WeakMap","vl","K","X","bu","parseIntlPartsYear","tl","relatedYear","computeIntlDateParts","computeIntlEpochMilli","computeIntlMonthCodeParts","computeIntlLeapMonth","call","queryMonthStrings","computeIntlDaysInYear","computeIntlDaysInMonth","computeIntlMonthsInYear","computeIntlEraParts","Zt","createNativeOpsCreator","Of","z","refineCalendarFields","_u","ju","ee","refineTimeBag","refineFields","fields","duplicateFields","forbiddenField","Rm","includes","Qu","noValidFields","zm","convertToIso","refineYear","su","iu","invalidEra","cu","missingYear","refineMonth","monthCode","fu","uu","lu","refineDay","spliceFields","computeDateEssentials","ra","yt","fe","mt","le","Vu","convertToPlainYearMonth","se","Ku","convertToPlainMonthDay","createOptionsTransformer","Set","ie","an","mp","toEpochMillis","Ou","en","computeNonBuggyIsoResolve","Ot","tn","Ue","now","Qe","Fu","ln","Su","nanosecond","microsecond","millisecond","week","Ru","zu","Au","Uu","concat","qu","Lu","Wu","xu","$u","Hu","Gu","Ju","gregory","japanese","meiji","taisho","showa","heisei","reiwa","ethiopic","ethioaa","coptic","roc","buddhist","islamic","ah","indian","saka","persian","ap","bce","era0","era1","broc","minguo","chinese","dangi","hebrew","al","Dl","kl","Zl","constrain","reject","zl","compatible","earlier","later","Al","use","prefer","ignore","Ul","auto","never","critical","always","jl","ql","Ll","halfFloor","halfCeil","halfTrunc","expand","halfExpand","halfEven","Wl","previous","round","of","rf","IntlTimeZone","FixedTimeZone","ae","getOffsetSec","pinch","ue","epochNanoToSec","cf","uf","lf","ff","df","mf","pf","hf","Tf","Nf","kf","wa","q","U","R","inLeapYear","dayOfYear","$","daysInWeek","Kf","tm","om","weekOfYear","yearOfWeek","computeWeekShift","computeWeeksInYear","im","Nm","Om","bm","Sm","Bm","Ym","Cm","km","Zm","Ga","Am","Um","jm","qm","Lm","Wm","xm","$m","timeZoneName","Hm","Gm","Vm","_m","Jm","Km","Qm","Xm","ep","np","tp","op","rp","ip","sp","cp","up","lp","fp","dp","pp","Q","ot","tt","et","nt","createSlotClass","Class","un","dbg","bindMethod","defineProperties","getSpecificSlots","cn","rejectInvalidBag","defineProperty","enumerable","getCalendarIdFromBag","extractCalendarIdFromBag","refineCalendarArg","createCalendarGetters","neverValueOf","refineTimeZoneArg","toDurationSlots","parseUnit","refinePublicRelativeTo","toPlainTimeSlots","Tt","ht","optionalToPlainTimeFields","toPlainDateTimeSlots","Nt","Bt","toPlainMonthDaySlots","Rt","xt","toPlainYearMonthSlots","Ut","Xt","toPlainDateSlots","de","toZonedDateTimeSlots","Ae","Ne","adaptDateMethods","slotsToIso","toInstantSlots","We","createDateTimeFormatClass","DateTimeFormatFunc","DateTimeFormatNew","to","createFormatPrepperForBranding","prepFormat","getOwnPropertyDescriptors","createFormatMethod","createProxiedMethod","apply","vn","rn","sn","bind","fn","dn","mn","Sn","Tn","hn","Dn","gn","calendarId","Pn","On","pn","epochMilliseconds","bigNanoToBigInt","wn","In","blank","with","negated","total","DurationFormat","toJSON","compare","Instant","PlainDateTime","PlainDate","PlainTime","PlainYearMonth","PlainMonthDay","Cn","Fn","Zn","Mn","yn","jn","An","Nn","Bn","rt","until","since","lt","equals","st","Yn","En","Pt","withCalendar","withPlainTime","pt","bt","vt","toZonedDateTime","zn","Ct","toPlainDate","Wn","toPlainTime","Ln","Vn","Et","Lt","Vt","kn","qn","Wt","zt","$t","xn","re","plainTime","toPlainDateTime","toPlainYearMonth","toPlainMonthDay","_n","timeZoneId","hoursInDay","Te","De","withTimeZone","ge","Pe","startOfDay","ve","toInstant","Hn","Ce","getTimeZoneTransition","Ze","$n","Le","Ve","toZonedDateTimeISO","Je","fromEpochMilliseconds","ze","fromEpochNanoseconds","$e","Qn","instant","zonedDateTimeISO","plainDateTimeISO","plainDateISO","plainTimeISO","Un","ZonedDateTime","Duration","Now","Xn","degreesToRadians","degrees","PI","radiansToDegrees","radians","globalThis","Temporal","toTemporalInstant","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","time","milliseconds","offsetZenith","dawn","zenith","getUTCSunrise","getAdjustedDate","getUTCSunset","getElevationAdjustment","acos","adjustZenith","adjustedZenith","solarRadius","adjustForElevation","getSunriseUTC","getJulianDay","getSunsetUTC","getTemporalHour","endOfDay","NaN","delta","getSunTransit","temporalHour","isSunrise","calculatedTime","cal","seconds","localTimeHours","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","classicCities0","classicCities","ZIPCODES_TZ_MAP","timeFormatCache","Location","cityName","countryCode","geoid","parseFloat","long","elev","cc","getIsrael","getName","getShortName","comma","getCountryCode","getTzid","getTimeFormatter","getGeoId","lookup","JSON","stringify","legacyTzToTzid","tz","dst","getUsaTzid","state","addLocation","location","city","hour12cc","US","CA","BR","AU","NZ","DO","PR","GR","IN","KR","NP","ZA","reformatTimeStr","timeStr","suffix","options","_a","hm","CHALAKIM_PER_DAY","getChalakimSinceMoladTohu","monthOfYear","leap","getJewishMonthOfYear","calculateMolad","absDate","moladToAbsDate","conjunctionDay","adjustedChalakim","hdate","getMoladAsDate","molad","moladSeconds","millis","zdt","getLocalMeanTimeOffset","enDoW","heDayNames","frDoW","night","getMoladDate","getYear","getDow","getHour","getMinutes","getChalakim","getInstant","getTchilasZmanKidushLevana3Days","getTchilasZmanKidushLevana7Days","getSofZmanKidushLevanaBetweenMoldos","getSofZmanKidushLevana15Days","isHebrewLocale","dayNames","getDayNames","dow","moladStr","minutesStr","chalakimStr","and","ampm","getHebrewTimeOfDay","result","fmtTime","MoladEvent","hyear","hmonth","zdtToDate","res","setMilliseconds","ZENITH_1_POINT_583","Zmanim","gloc","useElevation","plainDate","noaa","getUseElevation","setUseElevation","timeAtAngle","angle","rising","seaLevelSunrise","seaLevelSunset","dusk","gregEve","prev0","nightHour","chatzot","chatzotNight","alotHaShachar","alotHaShachar72","sunriseOffset","alotHaShachar72zdt","misheyakir","misheyakirMachmir","getShaahZmanisBasedZmanZdt","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","sunsetMillis","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","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","idx","findContaining","getSedraArray","getFirstSaturday","saturday","weekNum","index","getSedra","chag","doubles","PESACH","PESACH1","PESACH7","PESACH8","SHAVUOT","range","start","stop","yearStartVayeilech","yearStartHaazinu","yearStartRH","r020","r027","r3340","r4349","r4350","sedraCache","cacheKey","sedra","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_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","beshalachHd","birkatHaChama","startMonth","startDay","baseRd","getBirkatHaChama","getHolidaysForYearArray","yearMap","startAbs","endAbs","absDt","holidays","filtered","HAVDALAH","CANDLE_LIGHTING","TimedEvent","eventTime","linkedEvent","eventTimeStr","opts","FAST_BEGINS","FAST_ENDS","CandleLightingEvent","HavdalahEvent","havdalahMins","makeCandleEvent","isFriday","isSaturday","havdalahTitle","useHavdalahOffset","candleLightingMins","zmanim","havdalahDeg","FastDayEvent","startEvent","endEvent","makeTimedEvent","TimedChanukahEvent","sefirot","infix","infix26","words","pfxWords","translit","getWeeks","omerDay","tens","ones","shnei","yamim","shneiYamim","shavuot","yom","yomEchad","asar","anaBekoach","sefira","lamnatzeach","ps67lines","flatMap","lamnatzeachLetters","OmerEvent","checkDay","weekNumber","daysWithinWeeks","omer","lang","config","codePoint","fromCodePoint","getDaysWithinWeeks","getTodayIs","ten","one","omerTodayIsHe","day7","numWeeks","omerTodayIsEn","getLamnatzeachWord","getLamnatzeachLetter","getAnaBekoachWord","ParshaEvent","renderParshaName","mevarchimChodeshStr","MevarchimChodeshEvent","monNext","space","cals","DailyLearning","addCalendar","startDate","getStartDate","getCalendars","end","NONE","shacharit","mincha","allCongs","tachanun","tachanun0","checkNext","dates","shushPurim","none","mday","some","yesPrev","tachanunYear","ret","tomorrow","tmp","getAbs","getStartAndEnd","isHebrewYear","theYear","theMonth","numYears","startEndHebrew","gregMonth","startGreg","endYear","endGreg","startEndGregorian","candlelighting","min0","geoIdCandleOffset","shortName","israelCityOffset","overrideIsraelCandleMins","TZEIT_3SMALL_STARS","fastEndDeg","TZEIT_3MEDIUM_STARS","checkCandleOptions","defaultLocation","hasUserMask","noRoshChodesh","noModern","noMinorFast","noSpecialShabbat","sedrot","dailyLearning","dafYomi","mishnaYomi","nachYomi","yerushalmi","shabbatMevarchim","yomKippurKatan","yizkor","setOptionsFromMask","noHolidays","getMaskFromOptions","ashkenazi","evts","holidaysYear","beginOmer","endOmer","currentYear","startAndEnd","RECOGNIZED_OPTIONS","unrecognizedAlreadyWarned","console","warn","warnUnrecognizedOptions","startGregYear","prevEventsLength","candlesEv","appendHolidayAndRelated","parsha0","numDailyLearning","makeDailyLearning","omerEv","makeOmerEvent","makeMoladAndMevarchimChodesh","addHebrewDates","addHebrewDatesForEvents","e2","splice","Jerusalem","Haifa","MASK_LIGHT_CANDLES","eFlags","erevPesachEv","zmanAchilas","zmanAchilasEv","biurChametzEv","makeErevPesachChametzEvents","isMajorFast","isMinorFast","fastEv","ev2","makeFastStartEnd","chanukahEv","candleLightingTime","makeWeekdayChanukahCandleLighting","dailyLearningName","learningEv","alarm","isChag","getBirthdayOrAnniversary","gdate","orig","origYear","isOrigLeap","getBirthdayHD","getYahrzeit","hDeath","getYahrzeitHD","getHolidaysForYear","eruvTavshilin","today","friday","pkgVersion","hallel","whole","hallel_","currentTime","currentMillis","isTomorrowSh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,CACA,MAAMpM,EAAQ,IAAI5qC,GAAMg3C,GACxB,GAAqB,iBAAVE,EAET,MAAO,CAACjB,OAAQ,CAACiB,GAAQE,MAAM,EAAMxM,QAAOpgC,GAAIrM,KAAKqM,GAAIlR,IAAK,GAEhE,GAAI49C,GAAS,EACX,MAAO,CACLjB,OAAQ,CAACC,GAASgB,IAClBE,MAAM,EACN99C,IAAK49C,EAAQ,EACbtM,QACApgC,GAAIrM,KAAKqM,IAIb,MAAMisC,EAAKp7B,GAAE67B,GACb,MAAO,CACLjB,OAAQ,CAACC,GAASO,GAAKP,GAASO,EAAK,IACrCW,MAAM,EACN99C,IAAK,CAACm9C,EAAK,EAAGA,EAAK,GACnB7L,QACApgC,GAAIrM,KAAKqM,GAEb,EAYK,MAAM0rC,GAA8B,CACzC,WACA,QACA,aACA,SACA,cACA,SACA,WACA,aACA,WACA,SACA,WACA,UACA,SACA,QACA,KACA,YACA,QACA,YACA,UACA,WACA,UACA,WACA,UACA,UACA,OACA,SACA,SACA,UACA,aACA,WACA,OACA,QACA,aACA,WACA,QACA,eACA,UACA,SACA,SACA,QACA,UACA,QACA,QACA,UACA,aACA,QACA,QACA,UACA,aACA,UACA,WACA,YACA,WACA,oBAIIG,GAAY,IAAI9/C,IACtB,IAAK,IAAIwH,EAAK,EAAGA,EAAKm4C,GAASj8C,OAAQ8D,IAAM,CAC3C,MAAMpH,EAAOu/C,GAASn4C,GACtBs4C,GAAUn+C,IAAIvB,EAAMoH,EACtB,CAGA,MAAMs5C,GAAU,IAAIztB,IAAI,CACtB,GACA,GACA,GACA,GACA,GACA,GACA,KAOF,SAASusB,GAAcp4C,GACrB,OAAOs5C,GAAQ/3C,KAAKvB,EACtB,CAOA,SAASsd,GAAExC,GACT,OAAQA,CACV,CAEA,MAIM09B,GAAW,8BAGXe,GAAS,SACTC,GAAU,WACVjB,GAAY,8BACZkB,GAAU,aACVC,GAAU,cACVC,GAAU,UAQhB,SAASC,GAAMC,EAAeC,GAC5B,OAAOl5C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