@hebcal/core 6.8.2 → 6.9.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 (109) hide show
  1. package/README.md +262 -4
  2. package/dist/bundle.js +1530 -944
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +18 -17
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/CalOptions.d.ts +12 -2
  7. package/dist/esm/DailyLearning.d.ts +5 -5
  8. package/dist/esm/DailyLearning.js +5 -5
  9. package/dist/esm/DailyLearning.js.map +1 -1
  10. package/dist/esm/HebrewDateEvent.d.ts +2 -2
  11. package/dist/esm/HebrewDateEvent.js +1 -1
  12. package/dist/esm/HebrewDateEvent.js.map +1 -1
  13. package/dist/esm/HolidayEvent.d.ts +9 -4
  14. package/dist/esm/HolidayEvent.js +8 -3
  15. package/dist/esm/HolidayEvent.js.map +1 -1
  16. package/dist/esm/MevarchimChodeshEvent.d.ts +4 -3
  17. package/dist/esm/MevarchimChodeshEvent.js +3 -2
  18. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  19. package/dist/esm/ParshaEvent.d.ts +16 -3
  20. package/dist/esm/ParshaEvent.js +14 -1
  21. package/dist/esm/ParshaEvent.js.map +1 -1
  22. package/dist/esm/TimedEvent.d.ts +16 -8
  23. package/dist/esm/TimedEvent.js +13 -5
  24. package/dist/esm/TimedEvent.js.map +1 -1
  25. package/dist/esm/YomKippurKatanEvent.d.ts +4 -3
  26. package/dist/esm/YomKippurKatanEvent.js +3 -2
  27. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  28. package/dist/esm/ashkenazi.po.js +1 -1
  29. package/dist/esm/calendar.d.ts +19 -9
  30. package/dist/esm/calendar.js +23 -10
  31. package/dist/esm/calendar.js.map +1 -1
  32. package/dist/esm/candles.d.ts +24 -6
  33. package/dist/esm/candles.js +20 -2
  34. package/dist/esm/candles.js.map +1 -1
  35. package/dist/esm/cities.json.d.ts +2 -0
  36. package/dist/esm/cities.json.js +68 -2
  37. package/dist/esm/cities.json.js.map +1 -1
  38. package/dist/esm/event.d.ts +3 -5
  39. package/dist/esm/event.js +3 -5
  40. package/dist/esm/event.js.map +1 -1
  41. package/dist/esm/getStartAndEnd.d.ts +1 -1
  42. package/dist/esm/getStartAndEnd.js +1 -1
  43. package/dist/esm/getStartAndEnd.js.map +1 -1
  44. package/dist/esm/hallel.d.ts +1 -1
  45. package/dist/esm/hallel.js +1 -1
  46. package/dist/esm/hallel.js.map +1 -1
  47. package/dist/esm/he-x-NoNikud.po.js +1 -1
  48. package/dist/esm/he.po.js +1 -1
  49. package/dist/esm/hebcal.d.ts +38 -103
  50. package/dist/esm/hebcal.js +34 -107
  51. package/dist/esm/hebcal.js.map +1 -1
  52. package/dist/esm/holidays.d.ts +9 -2
  53. package/dist/esm/holidays.js +2 -2
  54. package/dist/esm/holidays.js.map +1 -1
  55. package/dist/esm/index.d.ts +29 -27
  56. package/dist/esm/index.js +3 -1
  57. package/dist/esm/index.js.map +1 -1
  58. package/dist/esm/isAssurBemlacha.d.ts +1 -1
  59. package/dist/esm/isAssurBemlacha.js +6 -3
  60. package/dist/esm/isAssurBemlacha.js.map +1 -1
  61. package/dist/esm/isAveilut.js +1 -1
  62. package/dist/esm/isFastDay.d.ts +1 -1
  63. package/dist/esm/isFastDay.js +2 -2
  64. package/dist/esm/isFastDay.js.map +1 -1
  65. package/dist/esm/locale.js +1 -1
  66. package/dist/esm/locale.js.map +1 -1
  67. package/dist/esm/location.d.ts +37 -9
  68. package/dist/esm/location.js +38 -10
  69. package/dist/esm/location.js.map +1 -1
  70. package/dist/esm/modern.js +1 -1
  71. package/dist/esm/molad.d.ts +29 -23
  72. package/dist/esm/molad.js +27 -21
  73. package/dist/esm/molad.js.map +1 -1
  74. package/dist/esm/moladBase.d.ts +11 -0
  75. package/dist/esm/moladBase.js +12 -1
  76. package/dist/esm/moladBase.js.map +1 -1
  77. package/dist/esm/moladDate.d.ts +11 -7
  78. package/dist/esm/moladDate.js +25 -18
  79. package/dist/esm/moladDate.js.map +1 -1
  80. package/dist/esm/omer.d.ts +21 -5
  81. package/dist/esm/omer.js +20 -4
  82. package/dist/esm/omer.js.map +1 -1
  83. package/dist/esm/parshaName.js +1 -1
  84. package/dist/esm/parshaName.js.map +1 -1
  85. package/dist/esm/parshaYear.d.ts +3 -3
  86. package/dist/esm/parshaYear.js +3 -3
  87. package/dist/esm/parshaYear.js.map +1 -1
  88. package/dist/esm/pkgVersion.d.ts +1 -1
  89. package/dist/esm/pkgVersion.js +2 -2
  90. package/dist/esm/pkgVersion.js.map +1 -1
  91. package/dist/esm/reformatTimeStr.d.ts +15 -3
  92. package/dist/esm/reformatTimeStr.js +15 -3
  93. package/dist/esm/reformatTimeStr.js.map +1 -1
  94. package/dist/esm/sedra.d.ts +45 -19
  95. package/dist/esm/sedra.js +39 -17
  96. package/dist/esm/sedra.js.map +1 -1
  97. package/dist/esm/sefira.json.d.ts +6 -0
  98. package/dist/esm/sefira.json.js +65 -3
  99. package/dist/esm/sefira.json.js.map +1 -1
  100. package/dist/esm/staticHolidays.d.ts +0 -2
  101. package/dist/esm/staticHolidays.js +1 -3
  102. package/dist/esm/staticHolidays.js.map +1 -1
  103. package/dist/esm/string.js +1 -1
  104. package/dist/esm/tachanun.js +1 -1
  105. package/dist/esm/tachanun.js.map +1 -1
  106. package/dist/esm/zmanim.d.ts +177 -142
  107. package/dist/esm/zmanim.js +183 -148
  108. package/dist/esm/zmanim.js.map +1 -1
  109. package/package.json +18 -15
package/dist/bundle.js CHANGED
@@ -1,11 +1,11 @@
1
- /*! @hebcal/core v6.8.2, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.9.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
5
5
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
6
- const version = '6.8.2';
6
+ const version = '6.9.1';
7
7
 
8
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
8
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
9
9
  /** @private */
10
10
  const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
11
11
  /** @private */
@@ -47,8 +47,13 @@ const ABS_2SEP1752 = 639785;
47
47
  * Formerly in namespace, now top-level
48
48
  */
49
49
  /**
50
- * Returns true if the Gregorian year is a leap year
50
+ * Returns true if the Gregorian year is a leap year.
51
+ *
52
+ * Uses the proleptic Gregorian rule (divisible by 4, except centuries
53
+ * that are not divisible by 400) for **all** years, including those
54
+ * before the Gregorian calendar was adopted in 1582.
51
55
  * @param year Gregorian year
56
+ * @returns `true` if February has 29 days in `year`
52
57
  * @example
53
58
  * isGregLeapYear(2000); // true
54
59
  * isGregLeapYear(2020); // true
@@ -62,6 +67,7 @@ function isGregLeapYear(year) {
62
67
  * Number of days in the Gregorian month for given year
63
68
  * @param month Gregorian month (1=January, 12=December)
64
69
  * @param year Gregorian year
70
+ * @returns an integer 28-31
65
71
  * @example
66
72
  * daysInGregMonth(2, 2024); // 29 (February in a leap year)
67
73
  * daysInGregMonth(2, 2023); // 28
@@ -72,7 +78,10 @@ function daysInGregMonth(month, year) {
72
78
  return monthLengths[+isGregLeapYear(year)][month];
73
79
  }
74
80
  /**
75
- * Returns true if the object is a Javascript Date
81
+ * Returns true if the object is a Javascript `Date`.
82
+ *
83
+ * Note that this only tests the type: an invalid date such as
84
+ * `new Date('foo')` is still a `Date` and returns `true`.
76
85
  * @example
77
86
  * isDate(new Date()); // true
78
87
  * isDate('2024-01-01'); // false
@@ -99,8 +108,20 @@ function toFixed(year, month, day) {
99
108
  day);
100
109
  }
101
110
  /**
102
- * Converts Gregorian date to absolute R.D. (Rata Die) days
111
+ * Converts Gregorian date to absolute R.D. (Rata Die) days.
112
+ * R.D. 1 is the imaginary date Monday, January 1, 1 (Gregorian).
113
+ *
114
+ * Only the local-time year, month and day of `date` are used; hours,
115
+ * minutes, seconds and milliseconds are ignored.
116
+ *
117
+ * Dates are interpreted on the **proleptic** Gregorian calendar, which
118
+ * applies the Gregorian rules uniformly to every year without the
119
+ * ten-day discontinuity of the Gregorian Reformation of 1582.
103
120
  * @param date Gregorian date
121
+ * @returns R.D. number of days
122
+ * @throws {TypeError} if `date` is not a `Date`
123
+ * @throws {RangeError} if `date` is an Invalid Date
124
+ * @see {@link abs2greg}
104
125
  * @example
105
126
  * greg2abs(new Date(2008, 10, 13)); // 733359 (13 November 2008)
106
127
  * greg2abs(new Date(2005, 3, 2)); // 732038 (2 April 2005)
@@ -131,7 +152,14 @@ function greg2abs(date) {
131
152
  * For example, the 15th of Cheshvan 5769 began at sundown on
132
153
  * 12 November 2008 and continues through 13 November 2008. This
133
154
  * function would return only the date 13 November 2008.
155
+ *
156
+ * The returned `Date` is in the local (i.e. host system) time zone with
157
+ * hours, minutes, seconds and milliseconds all set to zero, and is on the
158
+ * **proleptic** Gregorian calendar (see {@link greg2abs}).
134
159
  * @param abs - R.D. number of days
160
+ * @returns Gregorian date at local midnight
161
+ * @throws {TypeError} if `abs` is not a number
162
+ * @see {@link greg2abs}
135
163
  * @example
136
164
  * const abs = hebrew2abs(5769, months.CHESHVAN, 15);
137
165
  * const date = abs2greg(abs); // 13 November 2008
@@ -161,11 +189,26 @@ function abs2greg(abs) {
161
189
  return dt;
162
190
  }
163
191
 
164
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
165
-
192
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
166
193
  /* eslint-disable @typescript-eslint/no-namespace */
167
194
  /**
168
- * Gregorian date helper functions
195
+ * Gregorian date helper functions.
196
+ *
197
+ * These are aliases retained for backwards compatibility. Each member
198
+ * simply forwards to the identically-behaving top-level function, which
199
+ * is the preferred form in new code because it tree-shakes cleanly:
200
+ *
201
+ * | Namespace | Top-level equivalent |
202
+ * | --- | --- |
203
+ * | `greg.abs2greg` | {@link abs2greg} |
204
+ * | `greg.daysInMonth` | {@link daysInGregMonth} |
205
+ * | `greg.greg2abs` | {@link greg2abs} |
206
+ * | `greg.isDate` | {@link isDate} |
207
+ * | `greg.isLeapYear` | {@link isGregLeapYear} |
208
+ * @example
209
+ * import {greg} from '@hebcal/hdate';
210
+ * greg.greg2abs(new Date(2008, 10, 13)); // 733359
211
+ * greg.isLeapYear(2024); // true
169
212
  */
170
213
  exports.greg = void 0;
171
214
  (function (greg) {
@@ -176,7 +219,7 @@ exports.greg.greg2abs = greg2abs;
176
219
  exports.greg.isDate = isDate;
177
220
  exports.greg.isLeapYear = isGregLeapYear;
178
221
 
179
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
222
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
180
223
  /**
181
224
  * Removes niqqud from Hebrew string
182
225
  * @example
@@ -192,8 +235,7 @@ function hebrewStripNikkud(str) {
192
235
  return a.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
193
236
  }
194
237
 
195
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
196
-
238
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
197
239
  /*
198
240
  * More minimal HDate
199
241
  */
@@ -211,9 +253,21 @@ const SHVAT$1 = 11;
211
253
  const ADAR_I$2 = 12;
212
254
  const ADAR_II$2 = 13;
213
255
  /**
214
- * Hebrew months of the year (NISAN=1, TISHREI=7)
256
+ * Hebrew months of the year (NISAN=1, TISHREI=7).
257
+ *
258
+ * Months are numbered from Nisan, the first month of the ecclesiastical
259
+ * year, even though the civil year begins with Tishrei on Rosh Hashanah
260
+ * (see {@link HDate.getTishreiMonth} for Tishrei-based numbering).
261
+ *
262
+ * In a common year month 12 is Adar; in a leap year month 12 is Adar I
263
+ * and month 13 is Adar II.
215
264
  * @readonly
216
265
  * @enum {number}
266
+ * @example
267
+ * import {months, getMonthName} from '@hebcal/hdate';
268
+ * months.TISHREI; // 7
269
+ * getMonthName(months.ADAR_I, 5784); // 'Adar I' (5784 is a leap year)
270
+ * getMonthName(months.ADAR_I, 5783); // 'Adar'
217
271
  */
218
272
  const months = {
219
273
  /** Nissan / ניסן */
@@ -289,11 +343,19 @@ function assertNumber(n, name) {
289
343
  }
290
344
  /**
291
345
  * Converts Hebrew date to R.D. (Rata Die) fixed days.
292
- * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
293
- * Calendar.
346
+ * R.D. 1 is the imaginary date Monday, January 1, 1 on the (proleptic)
347
+ * Gregorian Calendar.
348
+ *
349
+ * R.D. is the common currency between the two calendars: convert a
350
+ * Hebrew date to R.D. with this function, then to a Gregorian `Date`
351
+ * with {@link abs2greg}.
294
352
  * @param year Hebrew year
295
- * @param month Hebrew month
353
+ * @param month Hebrew month (1=NISAN, 7=TISHREI)
296
354
  * @param day Hebrew date (1-30)
355
+ * @returns R.D. number of days
356
+ * @throws {TypeError} if any argument is not a number
357
+ * @throws {RangeError} if `year` is less than 1
358
+ * @see {@link abs2hebrew}
297
359
  * @example
298
360
  * import {hebrew2abs, months} from '@hebcal/hdate';
299
361
  * hebrew2abs(5769, months.CHESHVAN, 15); // 733359
@@ -331,6 +393,10 @@ function newYear(year) {
331
393
  /**
332
394
  * Converts absolute R.D. days to Hebrew date
333
395
  * @param abs absolute R.D. days
396
+ * @returns the Hebrew date as a plain `{yy, mm, dd}` object
397
+ * @throws {TypeError} if `abs` is not a number
398
+ * @throws {RangeError} if `abs` precedes the Hebrew epoch
399
+ * @see {@link hebrew2abs}
334
400
  * @example
335
401
  * abs2hebrew(733359); // {yy: 5769, mm: 8, dd: 15} (15 Cheshvan 5769)
336
402
  */
@@ -354,8 +420,13 @@ function abs2hebrew(abs) {
354
420
  return { yy: year, mm: month, dd: day };
355
421
  }
356
422
  /**
357
- * Returns true if Hebrew year is a leap year
423
+ * Returns true if Hebrew year is a leap year.
424
+ *
425
+ * The Hebrew calendar is lunisolar: 7 years out of every 19-year
426
+ * (Metonic) cycle are leap years, in which a 13th month (Adar I) is
427
+ * inserted before Adar so that Nisan stays in the spring.
358
428
  * @param year Hebrew year
429
+ * @returns `true` if `year` has 13 months
359
430
  * @example
360
431
  * isLeapYear(5783); // false
361
432
  * isLeapYear(5784); // true
@@ -364,8 +435,13 @@ function isLeapYear(year) {
364
435
  return (1 + year * 7) % 19 < 7;
365
436
  }
366
437
  /**
367
- * Number of months in this Hebrew year (either 12 or 13 depending on leap year)
438
+ * Number of months in this Hebrew year (either 12 or 13 depending on leap year).
439
+ *
440
+ * Because Adar II is the last month of a leap year and Adar the last
441
+ * month of a common year, this doubles as "the number of the final
442
+ * month", which is how the anniversary rules identify Adar.
368
443
  * @param year Hebrew year
444
+ * @returns 12 or 13
369
445
  * @example
370
446
  * monthsInYear(5783); // 12
371
447
  * monthsInYear(5784); // 13
@@ -379,9 +455,15 @@ const STATIC_DAYS_IN_MONTH = [
379
455
  0, 30, 29, 30, 29, 30, 29, 30, 0, 0, 29, 30, 0, 29,
380
456
  ];
381
457
  /**
382
- * Number of days in Hebrew month in a given year (29 or 30)
458
+ * Number of days in Hebrew month in a given year (29 or 30).
459
+ *
460
+ * Most months have a fixed length. Cheshvan and Kislev vary to absorb
461
+ * the 353/354/355-day variation of the Hebrew year (see
462
+ * {@link longCheshvan} and {@link shortKislev}), and Adar I has 30 days
463
+ * in a leap year but 29 in a common year.
383
464
  * @param month Hebrew month (e.g. months.TISHREI)
384
465
  * @param year Hebrew year
466
+ * @returns an integer 29-30
385
467
  * @example
386
468
  * import {daysInMonth, months} from '@hebcal/hdate';
387
469
  * daysInMonth(months.CHESHVAN, 5769); // 29
@@ -400,8 +482,14 @@ function daysInMonth(month, year) {
400
482
  /**
401
483
  * Returns a transliterated string name of Hebrew month in year,
402
484
  * for example 'Elul' or 'Cheshvan'.
485
+ *
486
+ * The year matters only for the 12th month, which is named `'Adar'` in a
487
+ * common year and `'Adar I'` in a leap year. To translate the result into
488
+ * another locale, pass it to {@link Locale.gettext}.
403
489
  * @param month Hebrew month (e.g. months.TISHREI)
404
490
  * @param year Hebrew year
491
+ * @returns transliterated month name
492
+ * @throws {TypeError} if `month` is out of range 1-14
405
493
  * @example
406
494
  * import {getMonthName, months} from '@hebcal/hdate';
407
495
  * getMonthName(months.CHESHVAN, 5769); // 'Cheshvan'
@@ -418,8 +506,15 @@ function getMonthName(month, year) {
418
506
  }
419
507
  /**
420
508
  * Days from sunday prior to start of Hebrew calendar to mean
421
- * conjunction of Tishrei in Hebrew YEAR
509
+ * conjunction of Tishrei in Hebrew YEAR, after applying the four
510
+ * postponement rules (dechiyot) that fix Rosh Hashanah.
511
+ *
512
+ * This is an implementation detail of the calendar arithmetic rather
513
+ * than a supported entry point; prefer {@link hebrew2abs} or
514
+ * {@link daysInYear}. Results for years 5000-6999 are cached.
515
+ * @internal
422
516
  * @param year Hebrew year
517
+ * @returns days elapsed since the epoch
423
518
  */
424
519
  function elapsedDays(year) {
425
520
  if (year >= ED_CACHE_MIN && year <= ED_CACHE_MAX) {
@@ -468,7 +563,12 @@ function elapsedDays0(year) {
468
563
  * Number of days in the hebrew YEAR.
469
564
  * A common Hebrew calendar year can have a length of 353, 354 or 355 days
470
565
  * A leap Hebrew calendar year can have a length of 383, 384 or 385 days
566
+ *
567
+ * The three lengths within each group are deficient, regular and
568
+ * complete years respectively; see {@link shortKislev} and
569
+ * {@link longCheshvan} for which month absorbs the difference.
471
570
  * @param year Hebrew year
571
+ * @returns 353-355 in a common year, 383-385 in a leap year
472
572
  * @example
473
573
  * daysInYear(5783); // 355
474
574
  * daysInYear(5784); // 383 (leap year)
@@ -477,8 +577,13 @@ function daysInYear(year) {
477
577
  return elapsedDays(year + 1) - elapsedDays(year);
478
578
  }
479
579
  /**
480
- * true if Cheshvan is long in Hebrew year
580
+ * true if Cheshvan is long in Hebrew year.
581
+ *
582
+ * Cheshvan normally has 29 days, but gains a 30th in a "complete"
583
+ * (שלמה) year, one of the two ways the calendar stretches a year to
584
+ * keep Rosh Hashanah off a forbidden weekday.
481
585
  * @param year Hebrew year
586
+ * @returns `true` if Cheshvan has 30 days
482
587
  * @example
483
588
  * longCheshvan(5783); // true
484
589
  * longCheshvan(5784); // false
@@ -487,8 +592,13 @@ function longCheshvan(year) {
487
592
  return daysInYear(year) % 10 === 5;
488
593
  }
489
594
  /**
490
- * true if Kislev is short in Hebrew year
595
+ * true if Kislev is short in Hebrew year.
596
+ *
597
+ * Kislev normally has 30 days, but drops to 29 in a "deficient" (חסרה)
598
+ * year, the counterpart to {@link longCheshvan} that shortens a year by
599
+ * a day.
491
600
  * @param year Hebrew year
601
+ * @returns `true` if Kislev has 29 days
492
602
  * @example
493
603
  * shortKislev(5783); // false
494
604
  * shortKislev(5784); // true
@@ -497,8 +607,18 @@ function shortKislev(year) {
497
607
  return daysInYear(year) % 10 === 3;
498
608
  }
499
609
  /**
500
- * Converts Hebrew month string name to numeric
610
+ * Converts Hebrew month string name to numeric.
611
+ *
612
+ * Accepts transliterated names (`'Cheshvan'`, `'Sh'vat'`), Hebrew-script
613
+ * names with or without nikud (`'חשון'`, `'תִּשְׁרֵי'`), an optional bet
614
+ * prefix (`'בתמוז'`), and passes numbers through unchanged. Matching is
615
+ * case-insensitive and only needs enough of the name to be unambiguous.
616
+ * `'Adar'` resolves to Adar I; `'Adar II'` (and `'אדר ב׳'`) to Adar II.
501
617
  * @param monthName monthName
618
+ * @returns Hebrew month number (1=NISAN, 7=TISHREI)
619
+ * @throws {TypeError} if `monthName` is neither a string nor a number
620
+ * @throws {RangeError} if the name is not recognized, or a numeric month
621
+ * is outside 1-14
502
622
  * @example
503
623
  * monthFromName('Cheshvan'); // 8
504
624
  * monthFromName('חשון'); // 8
@@ -623,8 +743,7 @@ function monthFromName(monthName) {
623
743
  throw new RangeError(`bad monthName: ${monthName}`);
624
744
  }
625
745
 
626
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
627
-
746
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
628
747
  const NISAN$4 = months.NISAN;
629
748
  const CHESHVAN$1 = months.CHESHVAN;
630
749
  const KISLEV$1 = months.KISLEV;
@@ -645,11 +764,19 @@ function isSimpleHebrewDate$1(obj0) {
645
764
  typeof obj.dd === 'number');
646
765
  }
647
766
  /**
767
+ * Normalizes any accepted form of an event date into a `SimpleHebrewDate`.
768
+ *
769
+ * When the caller passes an object (a `SimpleHebrewDate` or anything
770
+ * structurally compatible with it, such as an `HDate`), this returns a
771
+ * copy rather than the object itself: callers keep their original event
772
+ * date around and reuse it across years, and the anniversary functions
773
+ * are free to modify the value they get back from here.
648
774
  * @private
649
775
  */
650
776
  function toSimpleHebrewDate(obj) {
651
777
  if (isSimpleHebrewDate$1(obj)) {
652
- return obj;
778
+ const hd = obj;
779
+ return { yy: hd.yy, mm: hd.mm, dd: hd.dd };
653
780
  }
654
781
  else if (isDate(obj)) {
655
782
  const abs = greg2abs(obj);
@@ -661,14 +788,52 @@ function toSimpleHebrewDate(obj) {
661
788
  }
662
789
  }
663
790
  /**
664
- * Same calculation as `getYahrzeit`, but returns the result as a
665
- * `SimpleHebrewDate` (`{yy, mm, dd}`) rather than converting to a
666
- * Gregorian `Date`. Useful when the caller needs the Hebrew date
667
- * directly (e.g. for rendering with `gematriya` or further Hebrew-calendar
668
- * arithmetic) and wants to avoid an extra R.D. → Gregorian round-trip.
791
+ * Calculates yahrzeit, the anniversary of a death, and returns it as a
792
+ * `SimpleHebrewDate` (`{yy, mm, dd}`).
793
+ * `hyear` must be after original `date` of death.
794
+ * Returns `undefined` when requested year preceeds or is same as original year.
669
795
  *
670
- * See `getYahrzeit` for the full description of the algorithm and
671
- * edge cases (Marcheshvan 30, Kislev 30, Adar I / Adar II).
796
+ * Hebcal uses the algorithm defined in "Calendrical Calculations"
797
+ * by Edward M. Reingold and Nachum Dershowitz.
798
+ *
799
+ * **This is not the same calculation as a birthday.** When the original
800
+ * date does not exist in the target year, a yahrzeit falls *earlier* —
801
+ * on the last day of the preceding month — because the anniversary
802
+ * should not be observed later than the day itself. A birthday in the
803
+ * same situation is *postponed* to the first of the following month.
804
+ * See {@link getBirthdayHD} for the contrast.
805
+ *
806
+ * The two also differ in whether the original year is a legal `hyear`.
807
+ * A yahrzeit is by definition an *anniversary* of a death, so the
808
+ * earliest one that exists is the first: the day of the death itself is
809
+ * not a yahrzeit, and a "zeroth" yahrzeit has no meaning to return.
810
+ * `hyear` must therefore be strictly after the year of death, and this
811
+ * function returns `undefined` otherwise. A birth date, by contrast, is
812
+ * a real and meaningful day in its own right, so
813
+ * {@link getBirthdayHD} accepts the year of birth and hands back the
814
+ * original date.
815
+ *
816
+ * The customary anniversary date of a death is more complicated and depends
817
+ * also on the character of the year in which the first anniversary occurs.
818
+ * There are several cases:
819
+ *
820
+ * * If the date of death is Marcheshvan 30, the anniversary in general depends
821
+ * on the first anniversary; if that first anniversary was not Marcheshvan 30,
822
+ * use the day before Kislev 1.
823
+ * * If the date of death is Kislev 30, the anniversary in general again depends
824
+ * on the first anniversary — if that was not Kislev 30, use the day before
825
+ * Tevet 1.
826
+ * * If the date of death is Adar II, the anniversary is the same day in the
827
+ * last month of the Hebrew year (Adar or Adar II).
828
+ * * If the date of death is Adar I 30, the anniversary in a Hebrew year that
829
+ * is not a leap year (in which Adar only has 29 days) is the last day in
830
+ * Shevat.
831
+ * * In all other cases, use the normal (that is, same month number) anniversary
832
+ * of the date of death. [Calendrical Calculations p. 113]
833
+ *
834
+ * The `date` argument is never modified, so a single original date can be
835
+ * reused to generate a run of years.
836
+ * @see {@link yahrzeit} for the same result as an `HDate` instance
672
837
  * @example
673
838
  * import {getYahrzeitHD} from '@hebcal/hdate';
674
839
  * const dt = new Date(2014, 2, 2); // 30 Adar I 5774
@@ -722,16 +887,40 @@ function getYahrzeitHD(hyear, date) {
722
887
  return hDeath;
723
888
  }
724
889
  /**
725
- * Same calculation as `getBirthdayOrAnniversary`, but returns the
726
- * result as a `SimpleHebrewDate` (`{yy, mm, dd}`) rather than
727
- * converting to a Gregorian `Date`. Useful when the caller needs the
728
- * Hebrew date directly (e.g. for rendering with `gematriya` or further
729
- * Hebrew-calendar arithmetic) and wants to avoid an extra R.D. →
730
- * Gregorian round-trip.
890
+ * Calculates a birthday or anniversary (non-yahrzeit) and returns it as
891
+ * a `SimpleHebrewDate` (`{yy, mm, dd}`).
892
+ * `hyear` must be on or after original `date` of anniversary.
893
+ * Returns `undefined` when requested year preceeds the original year.
731
894
  *
732
- * See `getBirthdayOrAnniversary` for the full description of the
733
- * algorithm and edge cases (Adar / Adar II, and the 30th of
734
- * Marcheshvan, Kislev, or Adar I).
895
+ * Hebcal uses the algorithm defined in "Calendrical Calculations"
896
+ * by Edward M. Reingold and Nachum Dershowitz.
897
+ *
898
+ * **This is not the same calculation as a yahrzeit.** When the original
899
+ * date is missing from the target year, a birthday is *postponed* to the
900
+ * first of the following month, whereas a yahrzeit moves *earlier* to
901
+ * the last day of the preceding month. Passing the same original date to
902
+ * both functions can therefore return dates almost a month apart.
903
+ *
904
+ * Unlike {@link getYahrzeitHD}, `hyear` may equal the original year, in
905
+ * which case the original date is returned unchanged. A birth date is a
906
+ * meaningful day in its own right — it is the day the person was born,
907
+ * not merely the zeroth anniversary of it. A death has no comparable
908
+ * day: a yahrzeit only begins to exist on the first anniversary, which
909
+ * is why {@link getYahrzeitHD} rejects the year of death.
910
+ *
911
+ * The birthday of someone born in Adar of an ordinary year or Adar II of
912
+ * a leap year is also always in the last month of the year, be that Adar
913
+ * or Adar II. The birthday in an ordinary year of someone born during the
914
+ * first 29 days of Adar I in a leap year is on the corresponding day of Adar;
915
+ * in a leap year, the birthday occurs in Adar I, as expected.
916
+ *
917
+ * Someone born on the thirtieth day of Marcheshvan, Kislev, or Adar I
918
+ * has his birthday postponed until the first of the following month in
919
+ * years where that day does not occur. [Calendrical Calculations p. 111]
920
+ *
921
+ * The `date` argument is never modified, so a single original date can be
922
+ * reused to generate a run of years.
923
+ * @see {@link birthdayOrAnniversary} for the same result as an `HDate` instance
735
924
  * @example
736
925
  * import {getBirthdayHD} from '@hebcal/hdate';
737
926
  * const dt = new Date(2014, 2, 2); // 30 Adar I 5774
@@ -775,7 +964,7 @@ function getBirthdayHD(hyear, date) {
775
964
  return { yy: hyear, mm: month, dd: day };
776
965
  }
777
966
 
778
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
967
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
779
968
  const GERESH = '׳';
780
969
  const GERSHAYIM = '״';
781
970
  const heb2num = {
@@ -894,7 +1083,7 @@ function gematriyaStrToNum(str) {
894
1083
  return num;
895
1084
  }
896
1085
 
897
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1086
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
898
1087
  /**
899
1088
  * Formats a number with leading zeros so the resulting string is 4 digits long.
900
1089
  * Similar to `string.padStart(4, '0')` but will also format
@@ -934,8 +1123,7 @@ function pad2(num) {
934
1123
  return String(num);
935
1124
  }
936
1125
 
937
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
938
-
1126
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
939
1127
  const _formatters = new Map();
940
1128
  /**
941
1129
  * @private
@@ -1016,14 +1204,13 @@ function isoDateString(dt) {
1016
1204
  pad2(dt.getDate()));
1017
1205
  }
1018
1206
 
1019
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1207
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1020
1208
  var poAshkenazi$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "und-x-ashkenaz" }, "contexts": { "": { "Tevet": ["Teves"] } } };
1021
1209
 
1022
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1210
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1023
1211
  var poHe$1 = { "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": ["תִּשְׁרֵי"] } } };
1024
1212
 
1025
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1026
-
1213
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1027
1214
  const noopLocale = {
1028
1215
  headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },
1029
1216
  contexts: { '': {} },
@@ -1066,6 +1253,27 @@ function getExistingLocale(locale) {
1066
1253
  * * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
1067
1254
  * * `he` - Hebrew (e.g. "שַׁבָּת")
1068
1255
  * * `he-x-NoNikud` - Hebrew without nikud (e.g. "שבת")
1256
+ *
1257
+ * The locale set that ships here covers only what this package needs:
1258
+ * month names, a handful of connective words, and the parts of speech
1259
+ * used by {@link HDate.render}. Packages built on top of it (such as
1260
+ * `@hebcal/core`) register their own holiday translations into the same
1261
+ * locales with {@link Locale.addTranslations}.
1262
+ *
1263
+ * Every method is static — `Locale` is a namespace, not something you
1264
+ * instantiate. Locale names are matched case-insensitively, and the
1265
+ * single letters `h`, `a` and `s` are accepted as aliases for `he`,
1266
+ * `ashkenazi` and `en` respectively.
1267
+ * @example
1268
+ * import {Locale, HDate, months} from '@hebcal/hdate';
1269
+ *
1270
+ * Locale.gettext('Cheshvan', 'he'); // 'חֶשְׁוָן'
1271
+ * Locale.gettext('Cheshvan', 'ashkenazi'); // 'Cheshvan'
1272
+ * Locale.ordinal(15, 'en'); // '15th'
1273
+ *
1274
+ * const hd = new HDate(15, months.CHESHVAN, 5769);
1275
+ * hd.render('en'); // '15th of Cheshvan, 5769'
1276
+ * hd.render('he'); // '15 חֶשְׁוָן, 5769'
1069
1277
  */
1070
1278
  class Locale {
1071
1279
  /**
@@ -1103,11 +1311,16 @@ class Locale {
1103
1311
  return text;
1104
1312
  }
1105
1313
  /**
1106
- * Register locale translations.
1314
+ * Register locale translations, replacing the locale entirely if it
1315
+ * was already registered. Use {@link Locale.addTranslations} to merge
1316
+ * into an existing locale instead.
1107
1317
  * @param locale Locale name (i.e.: `'he'`, `'fr'`)
1108
1318
  * @param data parsed data from a `.po` file.
1319
+ * @throws {TypeError} if `data` is not in the compact `.po` format
1109
1320
  * @example
1110
- * import poFr from './fr.po';
1321
+ * import {Locale} from '@hebcal/hdate';
1322
+ * // typically `import poFr from './fr.po'` — inlined here for clarity
1323
+ * const poFr = {headers: {}, contexts: {'': {Shabbat: ['Chabbat']}}};
1111
1324
  * Locale.addLocale('fr', poFr);
1112
1325
  * Locale.gettext('Shabbat', 'fr'); // 'Chabbat'
1113
1326
  */
@@ -1155,6 +1368,16 @@ class Locale {
1155
1368
  * existing locale.
1156
1369
  * @param locale Locale name (i.e: `'he'`, `'fr'`).
1157
1370
  * @param data parsed data from a `.po` file.
1371
+ * @throws {RangeError} if `locale` has not been registered
1372
+ * @throws {TypeError} if `data` is not in the compact `.po` format
1373
+ * @example
1374
+ * import {Locale} from '@hebcal/hdate';
1375
+ * Locale.addTranslations('ashkenazi', {
1376
+ * headers: {},
1377
+ * contexts: {'': {Sukkot: ['Sukkos'], Shavuot: ['Shavuos']}},
1378
+ * });
1379
+ * Locale.gettext('Sukkot', 'ashkenazi'); // 'Sukkos'
1380
+ * Locale.gettext('Tevet', 'ashkenazi'); // 'Teves' (existing translations kept)
1158
1381
  */
1159
1382
  static addTranslations(locale, data) {
1160
1383
  const loc = getExistingLocale(locale);
@@ -1222,6 +1445,18 @@ class Locale {
1222
1445
  * This is the helper used internally to build the `he-x-NoNikud`
1223
1446
  * locale from `he`; call it when registering a derived "no nikud"
1224
1447
  * variant of a custom Hebrew-script locale.
1448
+ * @param data locale data to copy
1449
+ * @returns a new `LocaleData` with niqqud removed
1450
+ * @see {@link Locale.hebrewStripNikkud}
1451
+ * @example
1452
+ * import {Locale} from '@hebcal/hdate';
1453
+ * const withNikud = {
1454
+ * headers: {},
1455
+ * contexts: {'': {Elul: ['אֱלוּל']}},
1456
+ * };
1457
+ * const stripped = Locale.copyLocaleNoNikud(withNikud);
1458
+ * stripped.contexts[''].Elul[0]; // 'אלול'
1459
+ * withNikud.contexts[''].Elul[0]; // 'אֱלוּל' (input unchanged)
1225
1460
  */
1226
1461
  static copyLocaleNoNikud(data) {
1227
1462
  const strs = data.contexts[''];
@@ -1259,8 +1494,7 @@ Locale.addLocale('he', poHe$1);
1259
1494
  const poHeNoNikud$1 = Locale.copyLocaleNoNikud(poHe$1);
1260
1495
  Locale.addLocale('he-x-NoNikud', poHeNoNikud$1);
1261
1496
 
1262
- /*! @hebcal/hdate v0.22.5, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1263
-
1497
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1264
1498
  /*
1265
1499
  Hebcal - A Jewish Calendar Generator
1266
1500
  Copyright (c) 1994-2020 Danny Sadinoff
@@ -1461,7 +1695,7 @@ class HDate {
1461
1695
  * @returns an integer 0-6
1462
1696
  * @example
1463
1697
  * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1464
- * hd.getDate(); // 4
1698
+ * hd.getDay(); // 4 (Thursday)
1465
1699
  */
1466
1700
  getDay() {
1467
1701
  return mod(this.abs(), 7);
@@ -1579,10 +1813,15 @@ class HDate {
1579
1813
  }
1580
1814
  /**
1581
1815
  * Returns an `HDate` corresponding to the specified day of week
1582
- * **before** this Hebrew date
1816
+ * **before** this Hebrew date.
1817
+ *
1818
+ * Strictly before: if this date already falls on `dayOfWeek`, the
1819
+ * previous occurrence a week earlier is returned.
1583
1820
  * @example
1584
- * new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
1821
+ * const wed = new HDate(new Date('Wednesday February 19, 2014'));
1822
+ * wed.before(6).greg().toDateString(); // 'Sat Feb 15 2014'
1585
1823
  * @param dayOfWeek day of week: Sunday=0, Saturday=6
1824
+ * @returns a new `HDate`; the original is not modified
1586
1825
  */
1587
1826
  before(dayOfWeek) {
1588
1827
  return onOrBefore(dayOfWeek, this, -1);
@@ -1591,21 +1830,31 @@ class HDate {
1591
1830
  * Returns an `HDate` corresponding to the specified day of week
1592
1831
  * **on or before** this Hebrew date
1593
1832
  * @example
1594
- * new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
1595
- * new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
1596
- * new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
1833
+ * const wed = new HDate(new Date('Wednesday February 19, 2014'));
1834
+ * const sat = new HDate(new Date('Saturday February 22, 2014'));
1835
+ * const sun = new HDate(new Date('Sunday February 23, 2014'));
1836
+ * wed.onOrBefore(6).greg().toDateString(); // 'Sat Feb 15 2014'
1837
+ * sat.onOrBefore(6).greg().toDateString(); // 'Sat Feb 22 2014'
1838
+ * sun.onOrBefore(6).greg().toDateString(); // 'Sat Feb 22 2014'
1597
1839
  * @param dayOfWeek day of week: Sunday=0, Saturday=6
1840
+ * @returns a new `HDate`; the original is not modified
1598
1841
  */
1599
1842
  onOrBefore(dayOfWeek) {
1600
1843
  return onOrBefore(dayOfWeek, this, 0);
1601
1844
  }
1602
1845
  /**
1603
1846
  * Returns an `HDate` corresponding to the specified day of week
1604
- * **nearest** to this Hebrew date
1847
+ * **nearest** to this Hebrew date.
1848
+ *
1849
+ * Ties are broken forward: a date exactly 3 days from `dayOfWeek` in
1850
+ * both directions resolves to the later one.
1605
1851
  * @example
1606
- * new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
1607
- * new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
1852
+ * const wed = new HDate(new Date('Wednesday February 19, 2014'));
1853
+ * const tue = new HDate(new Date('Tuesday February 18, 2014'));
1854
+ * wed.nearest(6).greg().toDateString(); // 'Sat Feb 22 2014'
1855
+ * tue.nearest(6).greg().toDateString(); // 'Sat Feb 15 2014'
1608
1856
  * @param dayOfWeek day of week: Sunday=0, Saturday=6
1857
+ * @returns a new `HDate`; the original is not modified
1609
1858
  */
1610
1859
  nearest(dayOfWeek) {
1611
1860
  return onOrBefore(dayOfWeek, this, 3);
@@ -1614,40 +1863,53 @@ class HDate {
1614
1863
  * Returns an `HDate` corresponding to the specified day of week
1615
1864
  * **on or after** this Hebrew date
1616
1865
  * @example
1617
- * new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
1618
- * new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
1619
- * new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
1866
+ * const wed = new HDate(new Date('Wednesday February 19, 2014'));
1867
+ * const sat = new HDate(new Date('Saturday February 22, 2014'));
1868
+ * const sun = new HDate(new Date('Sunday February 23, 2014'));
1869
+ * wed.onOrAfter(6).greg().toDateString(); // 'Sat Feb 22 2014'
1870
+ * sat.onOrAfter(6).greg().toDateString(); // 'Sat Feb 22 2014'
1871
+ * sun.onOrAfter(6).greg().toDateString(); // 'Sat Mar 01 2014'
1620
1872
  * @param dayOfWeek day of week: Sunday=0, Saturday=6
1873
+ * @returns a new `HDate`; the original is not modified
1621
1874
  */
1622
1875
  onOrAfter(dayOfWeek) {
1623
1876
  return onOrBefore(dayOfWeek, this, 6);
1624
1877
  }
1625
1878
  /**
1626
1879
  * Returns an `HDate` corresponding to the specified day of week
1627
- * **after** this Hebrew date
1880
+ * **after** this Hebrew date.
1881
+ *
1882
+ * Strictly after: if this date already falls on `dayOfWeek`, the next
1883
+ * occurrence a week later is returned.
1628
1884
  * @example
1629
- * new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
1630
- * new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
1631
- * new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
1885
+ * const wed = new HDate(new Date('Wednesday February 19, 2014'));
1886
+ * const sat = new HDate(new Date('Saturday February 22, 2014'));
1887
+ * const sun = new HDate(new Date('Sunday February 23, 2014'));
1888
+ * wed.after(6).greg().toDateString(); // 'Sat Feb 22 2014'
1889
+ * sat.after(6).greg().toDateString(); // 'Sat Mar 01 2014'
1890
+ * sun.after(6).greg().toDateString(); // 'Sat Mar 01 2014'
1632
1891
  * @param dayOfWeek day of week: Sunday=0, Saturday=6
1892
+ * @returns a new `HDate`; the original is not modified
1633
1893
  */
1634
1894
  after(dayOfWeek) {
1635
1895
  return onOrBefore(dayOfWeek, this, 7);
1636
1896
  }
1637
1897
  /**
1638
1898
  * Returns the next Hebrew date
1899
+ * @returns a new `HDate` one day later; the original is not modified
1639
1900
  * @example
1640
1901
  * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1641
- * hd.next(); // '16 Cheshvan 5769'
1902
+ * hd.next().toString(); // '16 Cheshvan 5769'
1642
1903
  */
1643
1904
  next() {
1644
1905
  return new HDate(this.abs() + 1);
1645
1906
  }
1646
1907
  /**
1647
1908
  * Returns the previous Hebrew date
1909
+ * @returns a new `HDate` one day earlier; the original is not modified
1648
1910
  * @example
1649
1911
  * const hd = new HDate(new Date(2008, 10, 13)); // 15 Cheshvan 5769
1650
- * hd.prev(); // '14 Cheshvan 5769'
1912
+ * hd.prev().toString(); // '14 Cheshvan 5769'
1651
1913
  */
1652
1914
  prev() {
1653
1915
  return new HDate(this.abs() - 1);
@@ -1668,9 +1930,13 @@ class HDate {
1668
1930
  * import {HDate, months} from '@hebcal/hdate';
1669
1931
  *
1670
1932
  * const hd1 = new HDate(15, months.CHESHVAN, 5769);
1671
- * hd1.add(7, 'd'); // 22 Cheshvan 5769
1672
- * hd1.add(1, 'weeks'); // 22 Cheshvan 5769
1673
- * hd1.add(1, 'year'); // 15 Cheshvan 5770
1933
+ * hd1.add(7, 'd').toString(); // '22 Cheshvan 5769'
1934
+ * hd1.add(1, 'weeks').toString(); // '22 Cheshvan 5769'
1935
+ * hd1.add(1, 'year').toString(); // '15 Cheshvan 5770'
1936
+ * @param amount number of units to add (negative values subtract)
1937
+ * @param [units=d] unit of time, defaults to days
1938
+ * @returns a new `HDate`; the original is not modified
1939
+ * @throws {TypeError} if `units` is not a recognized unit of time
1674
1940
  */
1675
1941
  add(amount, units = 'd') {
1676
1942
  amount = typeof amount === 'string' ? parseInt(amount, 10) : amount;
@@ -1714,8 +1980,12 @@ class HDate {
1714
1980
  * import {HDate, months} from '@hebcal/hdate';
1715
1981
  *
1716
1982
  * const hd1 = new HDate(15, months.CHESHVAN, 5769);
1717
- * const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
1718
- * const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
1983
+ * hd1.subtract(1, 'weeks').toString(); // '8 Cheshvan 5769'
1984
+ * hd1.subtract(3, 'M').toString(); // '16 Av 5768'
1985
+ * @param amount number of units to subtract (negative values add)
1986
+ * @param [units=d] unit of time, defaults to days
1987
+ * @returns a new `HDate`; the original is not modified
1988
+ * @throws {TypeError} if `units` is not a recognized unit of time
1719
1989
  */
1720
1990
  subtract(amount, units = 'd') {
1721
1991
  return this.add(amount * -1, units);
@@ -1879,7 +2149,18 @@ class HDate {
1879
2149
  * absolute day d. Similarly, applying it to d+3 gives the `dayOfWeek` nearest to
1880
2150
  * absolute date d, applying it to d-1 gives the `dayOfWeek` previous to absolute
1881
2151
  * date d, and applying it to d+7 gives the `dayOfWeek` following absolute date d.
2152
+ *
2153
+ * The instance methods {@link HDate.before}, {@link HDate.onOrBefore},
2154
+ * {@link HDate.nearest}, {@link HDate.onOrAfter} and {@link HDate.after}
2155
+ * wrap this with those offsets already applied.
1882
2156
  * @param dayOfWeek day of week: Sunday=0, Saturday=6
2157
+ * @param absdate R.D. number of days
2158
+ * @returns R.D. number of days
2159
+ * @example
2160
+ * import {HDate} from '@hebcal/hdate';
2161
+ * // 733359 is Thursday 13 November 2008
2162
+ * HDate.dayOnOrBefore(6, 733359); // 733354 (Saturday 8 November 2008)
2163
+ * HDate.dayOnOrBefore(6, 733359 + 6); // 733361 (Saturday 15 November 2008)
1883
2164
  */
1884
2165
  static dayOnOrBefore(dayOfWeek, absdate) {
1885
2166
  return absdate - ((absdate - dayOfWeek) % 7);
@@ -1904,11 +2185,22 @@ class HDate {
1904
2185
  typeof obj.abs === 'function');
1905
2186
  }
1906
2187
  /**
1907
- * Construct a new instance of `HDate` from a Gematriya-formatted string
2188
+ * Construct a new instance of `HDate` from a Gematriya-formatted string.
2189
+ *
2190
+ * The string must have the form day-month-year, with the month name
2191
+ * written in Hebrew script (nikud optional, an optional bet prefix
2192
+ * allowed). A year below 1000 is assumed to omit the thousands and has
2193
+ * `currentThousands` added to it.
2194
+ * @param str Hebrew date in gematriya, e.g. `'כ״ז בְּתַמּוּז תשפ״ג'`
2195
+ * @param [currentThousands=5000] added to a year below 1000
2196
+ * @returns the parsed Hebrew date
2197
+ * @throws {TypeError} if `str` is not a string
2198
+ * @throws {RangeError} if `str` is not 3 or 4 space-separated parts,
2199
+ * or the month name is not recognized
1908
2200
  * @example
1909
- * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג') // 27 Tamuz 5783
1910
- * HDate.fromGematriyaString('כ׳ סיון תש״ד') // 20 Sivan 5704
1911
- * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח') // 5 Iyyar 5708
2201
+ * HDate.fromGematriyaString('כ״ז בְּתַמּוּז תשפ״ג').toString(); // '27 Tamuz 5783'
2202
+ * HDate.fromGematriyaString('כ׳ סיון תש״ד').toString(); // '20 Sivan 5704'
2203
+ * HDate.fromGematriyaString('ה׳ אִיָיר תש״ח').toString(); // '5 Iyyar 5708'
1912
2204
  */
1913
2205
  static fromGematriyaString(str, currentThousands = 5000) {
1914
2206
  if (typeof str !== 'string') {
@@ -2034,6 +2326,87 @@ function onOrBefore(day, t, offset) {
2034
2326
  return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
2035
2327
  }
2036
2328
 
2329
+ /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2330
+ /**
2331
+ * Calculates yahrzeit, the anniversary of a death, and returns it as an
2332
+ * {@link HDate}.
2333
+ *
2334
+ * Same calculation as {@link getYahrzeitHD}, but the result comes back
2335
+ * as an `HDate` instance rather than a plain `{yy, mm, dd}` object, so it
2336
+ * can be rendered (`render`, `renderGematriya`) or used for further
2337
+ * Hebrew calendar arithmetic directly.
2338
+ *
2339
+ * Note that a yahrzeit is *not* calculated the same way as a birthday:
2340
+ * when the original date is missing from `hyear` it moves earlier rather
2341
+ * than later. See {@link getYahrzeitHD} for the full algorithm and its
2342
+ * edge cases (Marcheshvan 30, Kislev 30, Adar I / Adar II).
2343
+ *
2344
+ * `hyear` must be strictly after the year of death. A yahrzeit is an
2345
+ * *anniversary* of a death, so the first one is the earliest that
2346
+ * exists — the day of the death itself is not a yahrzeit, and there is
2347
+ * no meaningful "zeroth" one to return. This is the one place where
2348
+ * {@link birthdayOrAnniversary} legitimately accepts a year that this
2349
+ * function rejects: a birth date is a real day in its own right.
2350
+ *
2351
+ * The `date` argument is never modified, so a single original date can be
2352
+ * reused to generate a run of years.
2353
+ * @param hyear Hebrew year in which to find the anniversary
2354
+ * @param date Gregorian or Hebrew date of death
2355
+ * @returns anniversary occurring in `hyear`, or `undefined` when `hyear`
2356
+ * is on or before the year of death
2357
+ * @see {@link getYahrzeitHD}
2358
+ * @see {@link birthdayOrAnniversary}
2359
+ * @example
2360
+ * import {yahrzeit} from '@hebcal/hdate';
2361
+ * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
2362
+ * yahrzeit(5780, dt)?.toString(); // '30 Sh\'vat 5780'
2363
+ * yahrzeit(5780, dt)?.renderGematriya(); // 'ל׳ שְׁבָט תש״פ'
2364
+ * yahrzeit(5774, dt); // undefined (year of death)
2365
+ */
2366
+ function yahrzeit(hyear, date) {
2367
+ const hd = getYahrzeitHD(hyear, date);
2368
+ return hd && new HDate(hd);
2369
+ }
2370
+ /**
2371
+ * Calculates a birthday or anniversary (non-yahrzeit) and returns it as
2372
+ * an {@link HDate}.
2373
+ *
2374
+ * Same calculation as {@link getBirthdayHD}, but the result comes back
2375
+ * as an `HDate` instance rather than a plain `{yy, mm, dd}` object, so it
2376
+ * can be rendered (`render`, `renderGematriya`) or used for further
2377
+ * Hebrew calendar arithmetic directly.
2378
+ *
2379
+ * Note that a birthday is *not* calculated the same way as a yahrzeit:
2380
+ * when the original date is missing from `hyear` it is postponed rather
2381
+ * than moved earlier. See {@link getBirthdayHD} for the full algorithm
2382
+ * and its edge cases.
2383
+ *
2384
+ * `hyear` may be the original year, in which case the original date is
2385
+ * returned unchanged: someone's birth date is a meaningful day in its
2386
+ * own right, not merely the zeroth anniversary of itself. A death has no
2387
+ * equivalent — a yahrzeit begins at the first anniversary — which is why
2388
+ * {@link yahrzeit} rejects the year of death.
2389
+ *
2390
+ * The `date` argument is never modified, so a single original date can be
2391
+ * reused to generate a run of years.
2392
+ * @param hyear Hebrew year in which to find the anniversary
2393
+ * @param date Gregorian or Hebrew date of the original event
2394
+ * @returns anniversary occurring in `hyear`, or `undefined` when `hyear`
2395
+ * precedes the original year
2396
+ * @see {@link getBirthdayHD}
2397
+ * @see {@link yahrzeit}
2398
+ * @example
2399
+ * import {birthdayOrAnniversary} from '@hebcal/hdate';
2400
+ * const dt = new Date(2014, 2, 2); // '2014-03-02' == '30 Adar I 5774'
2401
+ * birthdayOrAnniversary(5780, dt)?.toString(); // '1 Nisan 5780'
2402
+ * birthdayOrAnniversary(5774, dt)?.toString(); // '30 Adar I 5774'
2403
+ * birthdayOrAnniversary(5773, dt); // undefined
2404
+ */
2405
+ function birthdayOrAnniversary(hyear, date) {
2406
+ const hd = getBirthdayHD(hyear, date);
2407
+ return hd && new HDate(hd);
2408
+ }
2409
+
2037
2410
  var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "und-x-ashkenaz" }, "contexts": { "": { "Shabbat": ["Shabbos"], "Achrei Mot": ["Achrei Mos"], "Bechukotai": ["Bechukosai"], "Beha'alotcha": ["Beha’aloscha"], "Bereshit": ["Bereshis"], "Chukat": ["Chukas"], "Erev Shavuot": ["Erev Shavuos"], "Erev Sukkot": ["Erev Sukkos"], "Ki Tavo": ["Ki Savo"], "Ki Teitzei": ["Ki Seitzei"], "Ki Tisa": ["Ki Sisa"], "Matot": ["Matos"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "Purim Katan": ["Purim Koton"], "Rosh Hashana LaBehemot": ["Rosh Hashana LaBeheimos"], "Shabbat Chazon": ["Shabbos Chazon"], "Shabbat HaChodesh": ["Shabbos HaChodesh"], "Shabbat HaGadol": ["Shabbos HaGadol"], "Shabbat Nachamu": ["Shabbos Nachamu"], "Shabbat Parah": ["Shabbos Parah"], "Shabbat Shekalim": ["Shabbos Shekalim"], "Shabbat Shuva": ["Shabbos Shuvah"], "Shabbat Zachor": ["Shabbos Zachor"], "Shavuot": ["Shavuos"], "Shavuot I": ["Shavuos I"], "Shavuot II": ["Shavuos II"], "Shemot": ["Shemos"], "Shmini Atzeret": ["Shmini Atzeres"], "Simchat Torah": ["Simchas Torah"], "Sukkot": ["Sukkos"], "Sukkot I": ["Sukkos I"], "Sukkot II": ["Sukkos II"], "Sukkot II (CH''M)": ["Sukkos II (CH’’M)"], "Sukkot III (CH''M)": ["Sukkos III (CH’’M)"], "Sukkot IV (CH''M)": ["Sukkos IV (CH’’M)"], "Sukkot V (CH''M)": ["Sukkos V (CH’’M)"], "Sukkot VI (CH''M)": ["Sukkos VI (CH’’M)"], "Sukkot VII (Hoshana Raba)": ["Sukkos VII (Hoshana Raba)"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "Ta'anit Bechorot": ["Ta’anis Bechoros"], "Ta'anit BeHaB": ["Ta’anis BeHaB"], "Ta'anit Esther": ["Ta’anis Esther"], "Toldot": ["Toldos"], "Vaetchanan": ["Vaeschanan"], "Yitro": ["Yisro"], "Vezot Haberakhah": ["Vezos Haberakhah"], "Parashat": ["Parshas"], "Leil Selichot": ["Leil Selichos"], "Shabbat Mevarchim Chodesh": ["Shabbos Mevorchim Chodesh"], "Shabbat Shirah": ["Shabbos Shirah"], "Asara B'Tevet": ["Asara B’Teves"], "Birkat Hachamah": ["Birkas HaChamah"], "Birkat HaChamah": ["Birkas HaChamah"], "Shushan Purim Katan": ["Shushan Purim Koton"], "Alot HaShachar": ["Alos HaShachar"], "Misheyakir": ["Misheyakir"], "Misheyakir Machmir": ["Misheyakir Machmir"], "Sunrise": ["Sunrise"], "Kriat Shema, sof zeman": ["Krias Shema, sof zman"], "Tefilah, sof zeman": ["Tefilah, sof zman"], "Kriat Shema, sof zeman (MGA)": ["Krias Shema, sof zman (MGA)"], "Kriat Shema, sof zeman (GRA)": ["Krias Shema, sof zman (GRA)"], "Tefilah, sof zeman (MGA)": ["Tefilah, sof zman (MGA)"], "Tefilah, sof zeman (GRA)": ["Tefilah, sof zman (GRA)"], "Chatzot HaLailah": ["Chatzos HaLailah"], "Chatzot HaYom": ["Chatzos"], "Chatzot hayom": ["Chatzos"], "Mincha Gedolah": ["Mincha Gedolah"], "Mincha Ketanah": ["Mincha Ketanah"], "Plag HaMincha": ["Plag HaMincha"], "Sunset": ["Sunset"], "Bein HaShemashot": ["Bein HaShemashos"], "Tzeit HaKochavim": ["Tzeis HaKochavim"] } } };
2038
2411
 
2039
2412
  var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat": ["שַׁבָּת"], "Parashat": ["פָּרָשַׁת"], "Achrei Mot": ["אַחֲרֵי מוֹת"], "Balak": ["בָּלָק"], "Bamidbar": ["בְּמִדְבַּר"], "Bechukotai": ["בְּחֻקֹּתַי"], "Beha'alotcha": ["בְּהַעֲלֹתְךָ"], "Behar": ["בְּהַר"], "Bereshit": ["בְּרֵאשִׁית"], "Beshalach": ["בְּשַׁלַּח"], "Bo": ["בֹּא"], "Chayei Sara": ["חַיֵּי שָֹרָה"], "Chukat": ["חֻקַּת"], "Devarim": ["דְּבָרִים"], "Eikev": ["עֵקֶב"], "Emor": ["אֱמוֹר"], "Ha'azinu": ["הַאֲזִינוּ"], "Kedoshim": ["קְדֹשִׁים"], "Ki Tavo": ["כִּי־תָבוֹא"], "Ki Teitzei": ["כִּי־תֵצֵא"], "Ki Tisa": ["כִּי תִשָּׂא"], "Korach": ["קֹרַח"], "Lech-Lecha": ["לֶךְ־לְךָ"], "Masei": ["מַסְעֵי"], "Matot": ["מַטּוֹת"], "Metzora": ["מְצֹרָע"], "Miketz": ["מִקֵּץ"], "Mishpatim": ["מִשְׁפָּטִים"], "Nasso": ["נָשׂא"], "Nitzavim": ["נִצָּבִים"], "Noach": ["נֹחַ"], "Pekudei": ["פְקוּדֵי"], "Pinchas": ["פִּינְחָס"], "Re'eh": ["רְאֵה"], "Sh'lach": ["שְׁלַח־לְךָ"], "Shemot": ["שְׁמוֹת"], "Shmini": ["שְּׁמִינִי"], "Shoftim": ["שׁוֹפְטִים"], "Tazria": ["תַזְרִיעַ"], "Terumah": ["תְּרוּמָה"], "Tetzaveh": ["תְּצַוֶּה"], "Toldot": ["תּוֹלְדוֹת"], "Tzav": ["צַו"], "Vaera": ["וָאֵרָא"], "Vaetchanan": ["וָאֶתְחַנַּן"], "Vayakhel": ["וַיַּקְהֵל"], "Vayechi": ["וַיְחִי"], "Vayeilech": ["וַיֵּלֶךְ"], "Vayera": ["וַיֵּרָא"], "Vayeshev": ["וַיֵּשֶׁב"], "Vayetzei": ["וַיֵּצֵא"], "Vayigash": ["וַיִּגַּשׁ"], "Vayikra": ["וַיִּקְרָא"], "Vayishlach": ["וַיִּשְׁלַח"], "Vezot Haberakhah": ["וְזֹאת הַבְּרָכָה"], "Yitro": ["יִתְרוֹ"], "Asara B'Tevet": ["עֲשָׂרָה בְּטֵבֵת"], "Candle lighting": ["הַדְלָקַת נֵרוֹת"], "Chanukah": ["חֲנוּכָּה"], "Chanukah: 1 Candle": ["חֲנוּכָּה: א׳ נֵר"], "Chanukah: 2 Candles": ["חֲנוּכָּה: ב׳ נֵרוֹת"], "Chanukah: 3 Candles": ["חֲנוּכָּה: ג׳ נֵרוֹת"], "Chanukah: 4 Candles": ["חֲנוּכָּה: ד׳ נֵרוֹת"], "Chanukah: 5 Candles": ["חֲנוּכָּה: ה׳ נֵרוֹת"], "Chanukah: 6 Candles": ["חֲנוּכָּה: ו׳ נֵרוֹת"], "Chanukah: 7 Candles": ["חֲנוּכָּה: ז׳ נֵרוֹת"], "Chanukah: 8 Candles": ["חֲנוּכָּה: ח׳ נֵרוֹת"], "Chanukah: 8th Day": ["חֲנוּכָּה: יוֹם ח׳"], "Days of the Omer": ["סְפִירַת הָעוֹמֶר"], "Omer": ["עוֹמֶר"], "day of the Omer": ["בָּעוֹמֶר"], "Erev Pesach": ["עֶרֶב פֶּסַח"], "Erev Purim": ["עֶרֶב פּוּרִים"], "Erev Rosh Hashana": ["עֶרֶב רֹאשׁ הַשָּׁנָה"], "Erev Shavuot": ["עֶרֶב שָׁבוּעוֹת"], "Erev Simchat Torah": ["עֶרֶב שִׂמְחַת תּוֹרָה"], "Erev Sukkot": ["עֶרֶב סֻכּוֹת"], "Erev Tish'a B'Av": ["עֶרֶב תִּשְׁעָה בְּאָב"], "Erev Yom Kippur": ["עֶרֶב יוֹם כִּפּוּר"], "Havdalah": ["הַבְדָּלָה"], "Lag BaOmer": ["ל״ג בָּעוֹמֶר"], "Leil Selichot": ["סְלִיחוֹת"], "Pesach": ["פֶּסַח"], "Pesach I": ["פֶּסַח א׳"], "Pesach II": ["פֶּסַח ב׳"], "Pesach II (CH''M)": ["פֶּסַח ב׳ (חוה״מ)"], "Pesach III (CH''M)": ["פֶּסַח ג׳ (חוה״מ)"], "Pesach IV (CH''M)": ["פֶּסַח ד׳ (חוה״מ)"], "Pesach Sheni": ["פֶּסַח שֵׁנִי"], "Pesach V (CH''M)": ["פֶּסַח ה׳ (חוה״מ)"], "Pesach VI (CH''M)": ["פֶּסַח ו׳ (חוה״מ)"], "Pesach VII": ["פֶּסַח ז׳"], "Pesach VIII": ["פֶּסַח ח׳"], "Pesach Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד פֶּסַח"], "Purim": ["פּוּרִים"], "Purim Katan": ["פּוּרִים קָטָן"], "Rosh Chodesh": ["רֹאשׁ חוֹדֶשׁ"], "Rosh Hashana": ["רֹאשׁ הַשָּׁנָה"], "Rosh Hashana I": ["רֹאשׁ הַשָּׁנָה א׳"], "Rosh Hashana II": ["רֹאשׁ הַשָּׁנָה ב׳"], "Shabbat Chazon": ["שַׁבַּת חֲזוֹן"], "Shabbat HaChodesh": ["שַׁבַּת הַחֹדֶשׁ"], "Shabbat HaGadol": ["שַׁבַּת הַגָּדוֹל"], "Shabbat Nachamu": ["שַׁבַּת נַחֲמוּ"], "Shabbat Parah": ["שַׁבַּת פָּרָה"], "Shabbat Shekalim": ["שַׁבַּת שְׁקָלִים"], "Shabbat Shuva": ["שַׁבַּת שׁוּבָה"], "Shabbat Zachor": ["שַׁבַּת זָכוֹר"], "Shavuot": ["שָׁבוּעוֹת"], "Shavuot I": ["שָׁבוּעוֹת א׳"], "Shavuot II": ["שָׁבוּעוֹת ב׳"], "Shmini Atzeret": ["שְׁמִינִי עֲצֶרֶת"], "Shushan Purim": ["שׁוּשָׁן פּוּרִים"], "Sigd": ["חַג הַסִּיגְד"], "Simchat Torah": ["שִׂמְחַת תּוֹרָה"], "Sukkot": ["סֻכּוֹת"], "Sukkot I": ["סֻכּוֹת א׳"], "Sukkot II": ["סֻכּוֹת ב׳"], "Sukkot II (CH''M)": ["סֻכּוֹת ב׳ (חוה״מ)"], "Sukkot III (CH''M)": ["סֻכּוֹת ג׳ (חוה״מ)"], "Sukkot IV (CH''M)": ["סֻכּוֹת ד׳ (חוה״מ)"], "Sukkot V (CH''M)": ["סֻכּוֹת ה׳ (חוה״מ)"], "Sukkot VI (CH''M)": ["סֻכּוֹת ו׳ (חוה״מ)"], "Sukkot VII (Hoshana Raba)": ["סֻכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Sukkot Shabbat Chol ha-Moed": ["שַׁבַּת חֹל הַמּוֹעֵד סֻכּוֹת"], "Ta'anit Bechorot": ["תַּעֲנִית בְּכוֹרוֹת"], "Ta'anit BeHaB": ["תַּעֲנִית בה״ב"], "Ta'anit Esther": ["תַּעֲנִית אֶסְתֵּר"], "Tish'a B'Av": ["תִּשְׁעָה בְּאָב"], "Tu B'Av": ["ט״וּ בְּאָב"], "Tu BiShvat": ["ט״וּ בִּשְׁבָט"], "Tu B'Shvat": ["ט״וּ בִּשְׁבָט"], "Tzom Gedaliah": ["צוֹם גְּדַלְיָה"], "Tzom Tammuz": ["צוֹם י״ז בְּתַמּוּז"], "Yom HaAtzma'ut": ["יוֹם הָעַצְמָאוּת"], "Yom HaShoah": ["יוֹם הַשּׁוֹאָה"], "Yom HaZikaron": ["יוֹם הַזִּכָּרוֹן"], "Yom Kippur": ["יוֹם כִּפּוּר"], "Yom Yerushalayim": ["יוֹם יְרוּשָׁלַיִם"], "Yom HaAliyah": ["יוֹם הַעֲלִיָּה"], "Yom HaAliyah School Observance": ["שְׁמִירָת בֵּית הַסֵפֶר לְיוֹם הַעֲלִיָּה"], "Rosh Chodesh Adar": ["רֹאשׁ חוֹדֶשׁ אֲדָר"], "Rosh Chodesh Adar I": ["רֹאשׁ חוֹדֶשׁ אֲדָר א׳"], "Rosh Chodesh Adar II": ["רֹאשׁ חוֹדֶשׁ אֲדָר ב׳"], "Rosh Chodesh Av": ["רֹאשׁ חוֹדֶשׁ אָב"], "Rosh Chodesh Cheshvan": ["רֹאשׁ חוֹדֶשׁ חֶשְׁוָן"], "Rosh Chodesh Elul": ["רֹאשׁ חוֹדֶשׁ אֱלוּל"], "Rosh Chodesh Iyyar": ["רֹאשׁ חוֹדֶשׁ אִיָּיר"], "Rosh Chodesh Kislev": ["רֹאשׁ חוֹדֶשׁ כִּסְלֵו"], "Rosh Chodesh Nisan": ["רֹאשׁ חוֹדֶשׁ נִיסָן"], "Rosh Chodesh Sh'vat": ["רֹאשׁ חוֹדֶשׁ שְׁבָט"], "Rosh Chodesh Sivan": ["רֹאשׁ חוֹדֶשׁ סִיוָן"], "Rosh Chodesh Tamuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tammuz": ["רֹאשׁ חוֹדֶשׁ תַּמּוּז"], "Rosh Chodesh Tevet": ["רֹאשׁ חוֹדֶשׁ טֵבֵת"], "min": ["דַּקּוֹת"], "Fast begins": ["תְּחִילַּת הַצוֹם"], "Fast ends": ["סִיּוּם הַצוֹם"], "Rosh Hashana LaBehemot": ["רֹאשׁ הַשָּׁנָה לְמַעְשַׂר בְּהֵמָה"], "Tish'a B'Av (observed)": ["(תִּשְׁעָה בְּאָב (נִדְחָה"], "Shabbat Mevarchim Chodesh": ["שַׁבַּת מְבָרְכִים חוֹדֶשׁ"], "Shabbat Shirah": ["שַׁבַּת שִׁירָה"], "Lovingkindness": ["חֶסֶד"], "Might": ["גְּבוּרָה"], "Beauty": ["תִּפְאֶרֶת"], "Eternity": ["נֶּצַח"], "Splendor": ["הוֹד"], "Foundation": ["יְּסוֹד"], "Majesty": ["מַּלְכוּת"], "day": ["יוֹם"], "Yom Kippur Katan": ["יוֹם כִּפּוּר קָטָן"], "Yizkor": ["יִזְכּוֹר"], "Family Day": ["יוֹם הַמִּשׁפָּחָה"], "Yitzhak Rabin Memorial Day": ["יוֹם הַזִּכָּרוֹן לְיִצְחָק רַבִּין"], "Jabotinsky Day": ["יוֹם זַ׳בּוֹטִינְסְקִי"], "Herzl Day": ["יוֹם הֶרְצְל"], "Ben-Gurion Day": ["יוֹם בֶּן־גּוּרִיּוֹן"], "Hebrew Language Day": ["יוֹם הַשָׂפָה הַעִברִית"], "Birkat Hachamah": ["בִּרְכַּת הַחַמָּה"], "Birkat HaChamah": ["בִּרְכַּת הַחַמָּה"], "Shushan Purim Katan": ["שׁוּשָׁן פּוּרִים קָטָן"], "Purim Meshulash": ["פּוּרִים מְשׁוּלָּשׁ"], "Chag HaBanot": ["חַג הַבָּנוֹת"], "Molad": ["מוֹלָד הָלְּבָנָה"], "chalakim": ["חֲלָקִים"], "Alot HaShachar": ["עֲלוֹת הַשַּׁחַר"], "Misheyakir": ["מִשֶּׁיַּכִּיר"], "Misheyakir Machmir": ["מִשֶּׁיַּכִּיר מַחְמִיר"], "Sunrise": ["נֵץ הַחַמָּה"], "Kriat Shema, sof zeman": ["סוֹף זְמַן קְרִיאַת שְׁמַע"], "Tefilah, sof zeman": ["סוֹף זְמַן תְּפִלָּה"], "Kriat Shema, sof zeman (MGA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (מג״א)"], "Kriat Shema, sof zeman (GRA)": ["סוֹף זְמַן קְרִיאַת שְׁמַע (גְּרָ״א)"], "Tefilah, sof zeman (MGA)": ["סוֹף זְמַן תְּפִלָּה (מג״א)"], "Tefilah, sof zeman (GRA)": ["סוֹף זְמַן תְּפִלָּה (גְּרָ״א)"], "Chatzot HaLailah": ["חֲצוֹת הַלַּיְלָה"], "Chatzot HaYom": ["חֲצוֹת הַיּוֹם"], "Chatzot hayom": ["חֲצוֹת הַיּוֹם"], "Mincha Gedolah": ["מִנְחָה גְּדוֹלָה"], "Mincha Ketanah": ["מִנְחָה קְטַנָּה"], "Plag HaMincha": ["פְּלַג הַמִּנְחָה"], "Sunset": ["שְׁקִיעַת הַחַמָּה"], "Bein HaShemashot": ["בֵּין הַשְּׁמָשׁוֹת"], "Tzeit HaKochavim": ["צֵאת הַכּוֹכָבִים"], "Biur Chametz": ["בִּעוּר חָמֵץ"], "Finish eating chametz": ["סוֹף זְמַן אֲכִילַת חָמֵץ"] } } };
@@ -2050,13 +2423,11 @@ Locale.addTranslations('he-x-NoNikud', noNikudOverride);
2050
2423
  /**
2051
2424
  * Holiday flags for Event. These flags are typically
2052
2425
  * combined using bitwise arithmetic to form a mask.
2053
- * @readonly
2054
- * @enum {number}
2055
2426
  */
2056
2427
  const flags = {
2057
2428
  /** Chag, yontiff, yom tov */
2058
2429
  CHAG: 0x000001,
2059
- /** Light candles 18 minutes before sundown */
2430
+ /** Light candles before sundown */
2060
2431
  LIGHT_CANDLES: 0x000002,
2061
2432
  /** End of holiday (end of Yom Tov) */
2062
2433
  YOM_TOV_ENDS: 0x000004,
@@ -2136,7 +2507,7 @@ const flagToCategory = [
2136
2507
  * Torah readings, Omer days, Hebrew dates, and more. Most concrete event
2137
2508
  * types are subclasses (e.g. {@link HolidayEvent}, {@link TimedEvent},
2138
2509
  * {@link ParshaEvent}, {@link OmerEvent}) and are produced by
2139
- * {@link HebrewCalendar.calendar}.
2510
+ * {@link calendar}.
2140
2511
  *
2141
2512
  * To get the title of the event in a language other than English with
2142
2513
  * Sephardic transliterations, use the {@link Event.render} method.
@@ -2997,7 +3368,7 @@ function computeIsoWeekFields(isoDateFields) {
2997
3368
  weeksInYear = computeIsoWeeksInYear(++yearOfWeek)), {
2998
3369
  weekOfYear: weekOfYear,
2999
3370
  yearOfWeek: yearOfWeek,
3000
- Ie: weeksInYear
3371
+ Be: weeksInYear
3001
3372
  };
3002
3373
  }
3003
3374
 
@@ -3043,27 +3414,27 @@ function constrainIsoDateFields(isoDate, overflow) {
3043
3414
  }
3044
3415
 
3045
3416
  function computeCalendarDateFields(calendar, isoDate) {
3046
- return calendar ? calendar.ie(isoDate) : isoDate;
3417
+ return calendar ? calendar.ae(isoDate) : isoDate;
3047
3418
  }
3048
3419
 
3049
3420
  function computeCalendarMonthCodeParts(calendar, year, month) {
3050
- return calendar ? calendar.O(year, month) : computeIsoMonthCodeParts(month);
3421
+ return calendar ? calendar.L(year, month) : computeIsoMonthCodeParts(month);
3051
3422
  }
3052
3423
 
3053
3424
  function computeCalendarEraFields(calendar, isoDate) {
3054
- return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar ? calendar.h(isoDate) : {};
3425
+ return 0 === calendar ? computeGregoryEraFields(isoDate) : calendar && calendar.h?.(isoDate) || {};
3055
3426
  }
3056
3427
 
3057
3428
  function computeCalendarIsoFieldsFromParts(calendar, year, month, day) {
3058
- return calendar ? calendar.je(year, month, day) : computeIsoFieldsFromParts(year, month, day);
3429
+ return calendar ? calendar.de(year, month, day) : computeIsoFieldsFromParts(year, month, day);
3059
3430
  }
3060
3431
 
3061
3432
  function computeCalendarMonthsInYearForYear(calendar, year) {
3062
- return calendar ? calendar.k(year) : 12;
3433
+ return calendar ? calendar.j(year) : 12;
3063
3434
  }
3064
3435
 
3065
3436
  function computeCalendarDaysInMonthForYearMonth(calendar, year, month) {
3066
- return calendar ? calendar.p(year, month) : computeIsoDaysInMonth(year, month);
3437
+ return calendar ? calendar.o(year, month) : computeIsoDaysInMonth(year, month);
3067
3438
  }
3068
3439
 
3069
3440
  function computeCalendarMonthCode(calendar, isoDate) {
@@ -3074,7 +3445,7 @@ function computeCalendarMonthCode(calendar, isoDate) {
3074
3445
 
3075
3446
  function computeCalendarInLeapYear(calendar, isoDate) {
3076
3447
  const {year: year} = computeCalendarDateFields(calendar, isoDate);
3077
- return calendar ? calendar.u(year) : computeIsoInLeapYear(year);
3448
+ return calendar ? calendar.q(year) : computeIsoInLeapYear(year);
3078
3449
  }
3079
3450
 
3080
3451
  function computeCalendarMonthsInYear(calendar, isoDate) {
@@ -3089,7 +3460,7 @@ function computeCalendarDaysInMonth(calendar, isoDate) {
3089
3460
 
3090
3461
  function computeCalendarDaysInYear(calendar, isoDate) {
3091
3462
  const {year: year} = computeCalendarDateFields(calendar, isoDate);
3092
- return calendar ? calendar.j(year) : computeIsoDaysInYear(year);
3463
+ return calendar ? calendar.i(year) : computeIsoDaysInYear(year);
3093
3464
  }
3094
3465
 
3095
3466
  function computeCalendarDayOfYear(calendar, isoDate) {
@@ -3121,9 +3492,6 @@ const durationDateFieldNamesAsc = /*@__PURE__*/ durationFieldNamesAsc.slice(6);
3121
3492
 
3122
3493
  const durationCalendarFieldNamesAsc = /*@__PURE__*/ durationDateFieldNamesAsc.slice(1);
3123
3494
 
3124
- const durationFieldIndexes = /*@__PURE__*/ durationFieldNamesAsc.reduce((indexes, fieldName, i) => (indexes[fieldName] = i,
3125
- indexes), {});
3126
-
3127
3495
  const durationFieldDefaults = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, 0);
3128
3496
 
3129
3497
  const durationTimeFieldDefaults = /*@__PURE__*/ zipPropsConst(durationTimeFieldNamesAsc, 0);
@@ -3257,7 +3625,7 @@ function coerceUnitOption(optionName, options, minUnit = 0, ensureDefined) {
3257
3625
  return ensureDefined ? minUnit : null;
3258
3626
  }
3259
3627
  let unit = unitNameMap[unitStr];
3260
- return void 0 === unit && (unit = durationFieldIndexes[unitStr]), void 0 === unit && throwRangeError(invalidChoice(optionName, unitStr, unitNameMap)),
3628
+ return void 0 === unit && (unit = durationFieldNamesAsc.indexOf(unitStr)), unit < 0 && throwRangeError(invalidChoice(optionName, unitStr, unitNameMap)),
3261
3629
  unit;
3262
3630
  }
3263
3631
 
@@ -3439,58 +3807,57 @@ function totalDuration(refineRelativeTo, slots, options) {
3439
3807
  let totalUnit = coerceTotalUnit(options);
3440
3808
  return totalUnit = requirePropDefined("unit", totalUnit), [ totalUnit, relativeToInternals ];
3441
3809
  })(options, refineRelativeTo);
3442
- if (!relativeToSlots && isUniformUnit(Math.max(totalUnit, maxDurationUnit), relativeToSlots)) {
3810
+ const maxUnit = Math.max(totalUnit, maxDurationUnit);
3811
+ const isZoned = relativeToSlots && isZonedEpochSlots(relativeToSlots);
3812
+ if (!relativeToSlots && isUniformUnit(maxUnit, isZoned)) {
3443
3813
  return totalDayTimeDuration(slots, totalUnit);
3444
3814
  }
3445
- if (relativeToSlots || throwRangeError("Missing relativeTo"), !slots.sign && isUniformUnit(totalUnit, relativeToSlots)) {
3815
+ if (relativeToSlots || throwRangeError("Missing relativeTo"), !slots.sign && isUniformUnit(totalUnit, isZoned)) {
3446
3816
  return 0;
3447
3817
  }
3448
- const markerSpanOps = createMarkerSpanOps(relativeToSlots);
3449
- const endMarker = markerSpanOps.G(markerSpanOps.i, slots);
3450
- checkMarkerSpanInBounds(markerSpanOps, endMarker);
3451
- const balancedDuration = markerSpanOps.re(markerSpanOps.i, endMarker, totalUnit);
3452
- return isUniformUnit(totalUnit, relativeToSlots) ? totalDayTimeDuration(balancedDuration, totalUnit) : totalRelativeDuration(balancedDuration, markerSpanOps.V(endMarker), totalUnit, markerSpanOps);
3818
+ const [balancedDuration, endEpochNano, relativeOps] = spanRelativeDuration(relativeToSlots, slots, totalUnit);
3819
+ return isUniformUnit(totalUnit, isZoned) ? totalDayTimeDuration(balancedDuration, totalUnit) : totalRelativeDuration(balancedDuration, endEpochNano, totalUnit, relativeOps);
3453
3820
  }
3454
3821
 
3455
- function totalRelativeDuration(durationFields, endEpochNano, totalUnit, markerMoveOps) {
3822
+ function totalRelativeDuration(durationFields, endEpochNano, totalUnit, relativeOps) {
3456
3823
  const sign = computeDurationSign(durationFields) || 1;
3457
- const nudgeWindow = clampRelativeDuration(clearDurationFields(totalUnit, durationFields), totalUnit, sign, markerMoveOps, endEpochNano);
3458
- const epochNano0 = nudgeWindow.ae;
3459
- const epochNano1 = nudgeWindow.de;
3824
+ const nudgeWindow = clampRelativeDuration(clearDurationFields(totalUnit, durationFields), totalUnit, sign, relativeOps, endEpochNano);
3825
+ const epochNano0 = nudgeWindow.ee;
3826
+ const epochNano1 = nudgeWindow.te;
3460
3827
  const denom = Number(epochNano1 - epochNano0);
3461
3828
  const numerator = Number(endEpochNano - epochNano0);
3462
- return nudgeWindow.ye[durationFieldNamesAsc[totalUnit]] + numerator / denom * sign;
3829
+ return nudgeWindow.pe[durationFieldNamesAsc[totalUnit]] + numerator / denom * sign;
3463
3830
  }
3464
3831
 
3465
3832
  function totalDayTimeDuration(durationFields, totalUnit) {
3466
3833
  return divideBigNanoToExactNumber(durationDayTimeToBigNano(durationFields), unitNanoMap[totalUnit]);
3467
3834
  }
3468
3835
 
3469
- function clampRelativeDuration(durationFields, clampUnit, clampDistance, markerMoveOps, epochNanoProgress) {
3836
+ function clampRelativeDuration(durationFields, clampUnit, clampDistance, relativeOps, epochNanoProgress) {
3470
3837
  const unitName = durationFieldNamesAsc[clampUnit];
3471
3838
  let startDurationFields = durationFields;
3472
3839
  let shifted = 0;
3473
- let window = computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, markerMoveOps);
3474
- return epochNanoProgress && !((epochNanoProgress, epochNano0, epochNano1, sign) => sign > 0 ? compareBigInts(epochNano0, epochNanoProgress) <= 0 && compareBigInts(epochNanoProgress, epochNano1) <= 0 : compareBigInts(epochNano1, epochNanoProgress) <= 0 && compareBigInts(epochNanoProgress, epochNano0) <= 0)(epochNanoProgress, window.ae, window.de, Math.sign(clampDistance)) && (startDurationFields = {
3840
+ let window = computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, relativeOps);
3841
+ return epochNanoProgress && !((epochNanoProgress, epochNano0, epochNano1, sign) => sign > 0 ? compareBigInts(epochNano0, epochNanoProgress) <= 0 && compareBigInts(epochNanoProgress, epochNano1) <= 0 : compareBigInts(epochNano1, epochNanoProgress) <= 0 && compareBigInts(epochNanoProgress, epochNano0) <= 0)(epochNanoProgress, window.ee, window.te, Math.sign(clampDistance)) && (startDurationFields = {
3475
3842
  ...durationFields,
3476
3843
  [unitName]: durationFields[unitName] + clampDistance
3477
- }, shifted = 1, window = computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, markerMoveOps)),
3844
+ }, shifted = 1, window = computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, relativeOps)),
3478
3845
  {
3479
3846
  ...window,
3480
- ye: startDurationFields,
3481
- He: shifted
3847
+ pe: startDurationFields,
3848
+ Ae: shifted
3482
3849
  };
3483
3850
  }
3484
3851
 
3485
- function computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, markerMoveOps) {
3852
+ function computeRelativeDurationWindow(startDurationFields, unitName, clampDistance, relativeOps) {
3486
3853
  const endDurationFields = {
3487
3854
  ...startDurationFields,
3488
3855
  [unitName]: startDurationFields[unitName] + clampDistance
3489
3856
  };
3490
3857
  return {
3491
- ae: moveMarkerToEpochNano(markerMoveOps, startDurationFields),
3492
- de: moveMarkerToEpochNano(markerMoveOps, endDurationFields),
3493
- Ae: endDurationFields
3858
+ ee: moveRelativeToEpochNano(relativeOps, startDurationFields),
3859
+ te: moveRelativeToEpochNano(relativeOps, endDurationFields),
3860
+ se: endDurationFields
3494
3861
  };
3495
3862
  }
3496
3863
 
@@ -3521,7 +3888,7 @@ function roundZonedEpochSlotsToUnit(slots, smallestUnit, roundingInc, roundingMo
3521
3888
  const isoFields1 = combineDateAndTime(moveByDays(isoFields0, 1), timeFieldDefaults);
3522
3889
  const epochNano0 = getStartOfDayInstantFor(timeZone, isoFields0);
3523
3890
  const epochNano1 = getStartOfDayInstantFor(timeZone, isoFields1);
3524
- epochNanoseconds = roundWithMode(computeEpochNanoFrac(epochNanoseconds, epochNano0, epochNano1), roundingMode) ? epochNano1 : epochNano0;
3891
+ epochNanoseconds = roundWithMode(computeZonedDayRoundFrac(epochNanoseconds, epochNano0, epochNano1), roundingMode) ? epochNano1 : epochNano0;
3525
3892
  } else {
3526
3893
  const isoDateTime = zonedEpochSlotsToIso(slots);
3527
3894
  const offsetNano = isoDateTime.offsetNanoseconds;
@@ -3547,6 +3914,10 @@ function computeZonedStartOfDay(slots) {
3547
3914
  return createZonedEpochNanoSlots(getStartOfDayInstantFor(timeZone, combineDateAndTime(zonedEpochSlotsToIso(slots), timeFieldDefaults)), timeZone, calendar);
3548
3915
  }
3549
3916
 
3917
+ function computeZonedDayRoundFrac(epochNano, epochNano0, epochNano1) {
3918
+ return computeEpochNanoFrac(epochNano < epochNano1 ? epochNano : epochNano1 - 1n, epochNano0, epochNano1);
3919
+ }
3920
+
3550
3921
  function roundDateTimeToNano(isoDateTime, nanoInc, roundingMode) {
3551
3922
  const [roundedTimeFields, dayDelta] = roundTimeToNano(isoDateTime, nanoInc, roundingMode);
3552
3923
  const roundedIsoDateTime = combineDateAndTime(moveByDays(isoDateTime, dayDelta), roundedTimeFields);
@@ -3574,28 +3945,28 @@ function roundDayTimeDurationByInc(durationFields, nanoInc, roundingMode) {
3574
3945
  return nanoToDurationDayTimeFields(roundBigNanoToInc(durationDayTimeToBigNano(durationFields), BigInt(nanoInc), roundingMode), maxUnit);
3575
3946
  }
3576
3947
 
3577
- function roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, markerMoveOps) {
3948
+ function roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps, isZoned) {
3578
3949
  if (0 === smallestUnit && 1 === roundingInc) {
3579
3950
  return durationFields;
3580
3951
  }
3581
3952
  const sign = computeDurationSign(durationFields) || 1;
3582
- const nudgeFunc = isUniformUnit(smallestUnit, markerMoveOps.i) ? isZonedEpochSlots(markerMoveOps.i) && smallestUnit < 6 && largestUnit >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;
3583
- let [roundedDurationFields, roundedEpochNano, grewBigUnit] = nudgeFunc(sign, durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, markerMoveOps);
3584
- return grewBigUnit && 7 !== smallestUnit && (roundedDurationFields = ((durationFields, endEpochNano, largestUnit, smallestUnit, sign, markerMoveOps) => {
3953
+ const nudgeFunc = isUniformUnit(smallestUnit, isZoned) ? isZoned && smallestUnit < 6 && largestUnit >= 6 ? nudgeZonedTimeDuration : nudgeDayTimeDuration : nudgeRelativeDuration;
3954
+ let [roundedDurationFields, roundedEpochNano, grewBigUnit] = nudgeFunc(sign, durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps);
3955
+ return grewBigUnit && 7 !== smallestUnit && (roundedDurationFields = ((durationFields, endEpochNano, largestUnit, smallestUnit, sign, relativeOps) => {
3585
3956
  for (let currentUnit = smallestUnit + 1; currentUnit <= largestUnit; currentUnit++) {
3586
3957
  if (7 === currentUnit && 7 !== largestUnit) {
3587
3958
  continue;
3588
3959
  }
3589
3960
  const baseDurationFields = clearDurationFields(currentUnit, durationFields);
3590
3961
  baseDurationFields[durationFieldNamesAsc[currentUnit]] += sign;
3591
- const thresholdCompare = compareBigInts(endEpochNano, moveMarkerToEpochNano(markerMoveOps, baseDurationFields));
3962
+ const thresholdCompare = compareBigInts(endEpochNano, moveRelativeToEpochNano(relativeOps, baseDurationFields));
3592
3963
  if (thresholdCompare && thresholdCompare !== sign) {
3593
3964
  break;
3594
3965
  }
3595
3966
  durationFields = baseDurationFields;
3596
3967
  }
3597
3968
  return durationFields;
3598
- })(roundedDurationFields, roundedEpochNano, largestUnit, Math.max(6, smallestUnit), sign, markerMoveOps)),
3969
+ })(roundedDurationFields, roundedEpochNano, largestUnit, Math.max(6, smallestUnit), sign, relativeOps)),
3599
3970
  roundedDurationFields;
3600
3971
  }
3601
3972
 
@@ -3638,16 +4009,16 @@ function nudgeDayTimeDuration(sign, durationFields, endEpochNano, largestUnit, s
3638
4009
  }, endEpochNano + nanoDiff, expandedBigUnit ];
3639
4010
  }
3640
4011
 
3641
- function nudgeZonedTimeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, markerMoveOps) {
4012
+ function nudgeZonedTimeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps) {
3642
4013
  const timeNano = Number(durationTimeToBigNano(durationFields));
3643
4014
  const nanoInc = computeNanoInc(smallestUnit, roundingInc);
3644
4015
  let roundedTimeNano = roundNumberToInc(timeNano, nanoInc, roundingMode);
3645
4016
  const dayWindow = clampRelativeDuration({
3646
4017
  ...durationFields,
3647
4018
  ...durationTimeFieldDefaults
3648
- }, 6, sign, markerMoveOps, endEpochNano);
3649
- const dayEpochNano0 = dayWindow.ae;
3650
- const dayEpochNano1 = dayWindow.de;
4019
+ }, 6, sign, relativeOps, endEpochNano);
4020
+ const dayEpochNano0 = dayWindow.ee;
4021
+ const dayEpochNano1 = dayWindow.te;
3651
4022
  const beyondDayNano = roundedTimeNano - Number(dayEpochNano1 - dayEpochNano0);
3652
4023
  let dayDelta = 0;
3653
4024
  beyondDayNano && Math.sign(beyondDayNano) !== sign ? endEpochNano = dayEpochNano0 + BigInt(roundedTimeNano) : (dayDelta += sign,
@@ -3660,7 +4031,7 @@ function nudgeZonedTimeDuration(sign, durationFields, endEpochNano, _largestUnit
3660
4031
  }, endEpochNano, Boolean(dayDelta) ];
3661
4032
  }
3662
4033
 
3663
- function nudgeRelativeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, markerMoveOps) {
4034
+ function nudgeRelativeDuration(sign, durationFields, endEpochNano, _largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps) {
3664
4035
  const smallestUnitFieldName = durationFieldNamesAsc[smallestUnit];
3665
4036
  const baseDurationFields = clearDurationFields(smallestUnit, durationFields);
3666
4037
  7 === smallestUnit && (durationFields = {
@@ -3669,19 +4040,19 @@ function nudgeRelativeDuration(sign, durationFields, endEpochNano, _largestUnit,
3669
4040
  });
3670
4041
  const truncedVal = divTrunc(durationFields[smallestUnitFieldName], roundingInc) * roundingInc;
3671
4042
  baseDurationFields[smallestUnitFieldName] = truncedVal;
3672
- const nudgeWindow = clampRelativeDuration(baseDurationFields, smallestUnit, roundingInc * sign, markerMoveOps, endEpochNano);
3673
- const epochNano0 = nudgeWindow.ae;
3674
- const epochNano1 = nudgeWindow.de;
4043
+ const nudgeWindow = clampRelativeDuration(baseDurationFields, smallestUnit, roundingInc * sign, relativeOps, endEpochNano);
4044
+ const epochNano0 = nudgeWindow.ee;
4045
+ const epochNano1 = nudgeWindow.te;
3675
4046
  const frac = computeEpochNanoFrac(endEpochNano, epochNano0, epochNano1);
3676
- const windowStartVal = nudgeWindow.ye[smallestUnitFieldName];
3677
- const windowEndVal = nudgeWindow.Ae[smallestUnitFieldName];
4047
+ const windowStartVal = nudgeWindow.pe[smallestUnitFieldName];
4048
+ const windowEndVal = nudgeWindow.se[smallestUnitFieldName];
3678
4049
  const roundedVal = roundNumberToInc(windowStartVal + frac * sign * roundingInc, roundingInc, roundingMode);
3679
4050
  const roundedToEnd = roundedVal === windowEndVal;
3680
- return baseDurationFields[smallestUnitFieldName] = roundedVal, [ baseDurationFields, roundedToEnd ? epochNano1 : epochNano0, nudgeWindow.He || roundedToEnd ];
4051
+ return baseDurationFields[smallestUnitFieldName] = roundedVal, [ baseDurationFields, roundedToEnd ? epochNano1 : epochNano0, nudgeWindow.Ae || roundedToEnd ];
3681
4052
  }
3682
4053
 
3683
4054
  function getTimeZoneTransitionEpochNanoseconds(slots, options) {
3684
- return slots.timeZone.U(slots.epochNanoseconds, (options => {
4055
+ return slots.timeZone.O(slots.epochNanoseconds, (options => {
3685
4056
  const normalizedOptions = normalizeOptionsOrString(options, "direction");
3686
4057
  const res = coerceDirection(normalizedOptions, 0);
3687
4058
  return res || throwRangeError(invalidEntity("direction", res)), res;
@@ -3692,7 +4063,7 @@ const zonedEpochSlotsToIso = /*@__PURE__*/ memoize(_zonedEpochSlotsToIso, WeakMa
3692
4063
 
3693
4064
  function _zonedEpochSlotsToIso(slots) {
3694
4065
  const {epochNanoseconds: epochNanoseconds, timeZone: timeZone} = slots;
3695
- const offsetNanoseconds = timeZone.C(epochNanoseconds);
4066
+ const offsetNanoseconds = timeZone.B(epochNanoseconds);
3696
4067
  return {
3697
4068
  ...epochNanoToIsoDateTime(epochNanoseconds + BigInt(offsetNanoseconds)),
3698
4069
  offsetNanoseconds: offsetNanoseconds
@@ -3704,7 +4075,7 @@ function getMatchingInstantFor(timeZone, isoDateTime, offsetNano, offsetDisambig
3704
4075
  return isoDateTimeAndOffsetToEpochNano(isoDateTime, offsetNano);
3705
4076
  }
3706
4077
  2 !== offsetDisambig && 0 !== offsetDisambig || checkIsoDateInBounds(isoDateTime, 0);
3707
- const possibleEpochNanos = timeZone.R(isoDateTime);
4078
+ const possibleEpochNanos = timeZone.N(isoDateTime);
3708
4079
  if (void 0 !== offsetNano && 3 !== offsetDisambig) {
3709
4080
  const matchingEpochNano = ((possibleEpochNanos, isoDateTime, offsetNano, fuzzy) => {
3710
4081
  const zonedEpochNano = isoDateTimeToEpochNano(isoDateTime);
@@ -3724,7 +4095,7 @@ function getMatchingInstantFor(timeZone, isoDateTime, offsetNano, offsetDisambig
3724
4095
  return hasZ ? isoDateTimeToEpochNano(isoDateTime) : getSingleInstantFor(timeZone, isoDateTime, epochDisambig, possibleEpochNanos);
3725
4096
  }
3726
4097
 
3727
- function getSingleInstantFor(timeZone, isoDateTime, disambig = 0, possibleEpochNanos = timeZone.R(isoDateTime)) {
4098
+ function getSingleInstantFor(timeZone, isoDateTime, disambig = 0, possibleEpochNanos = timeZone.N(isoDateTime)) {
3728
4099
  if (1 === possibleEpochNanos.length) {
3729
4100
  return possibleEpochNanos[0];
3730
4101
  }
@@ -3733,21 +4104,21 @@ function getSingleInstantFor(timeZone, isoDateTime, disambig = 0, possibleEpochN
3733
4104
  }
3734
4105
  const zonedEpochNano = isoDateTimeToEpochNano(isoDateTime);
3735
4106
  const gapNano = ((timeZone, zonedEpochNano) => {
3736
- const startOffsetNano = timeZone.C(zonedEpochNano - bigNanoInUtcDay);
4107
+ const startOffsetNano = timeZone.B(zonedEpochNano - bigNanoInUtcDay);
3737
4108
  return (gapNano => (gapNano > nanoInUtcDay && throwRangeError("Out-of-bounds TimeZone gap"),
3738
- gapNano))(timeZone.C(zonedEpochNano + bigNanoInUtcDay) - startOffsetNano);
4109
+ gapNano))(timeZone.B(zonedEpochNano + bigNanoInUtcDay) - startOffsetNano);
3739
4110
  })(timeZone, zonedEpochNano);
3740
4111
  const shiftedIsoDateTime = epochNanoToIsoDateTime(zonedEpochNano + BigInt(gapNano * (2 === disambig ? -1 : 1)));
3741
- return (possibleEpochNanos = timeZone.R(shiftedIsoDateTime))[2 === disambig ? 0 : possibleEpochNanos.length - 1];
4112
+ return (possibleEpochNanos = timeZone.N(shiftedIsoDateTime))[2 === disambig ? 0 : possibleEpochNanos.length - 1];
3742
4113
  }
3743
4114
 
3744
4115
  function getStartOfDayInstantFor(timeZone, isoDateTime) {
3745
- const possibleEpochNanos = timeZone.R(isoDateTime);
4116
+ const possibleEpochNanos = timeZone.N(isoDateTime);
3746
4117
  if (possibleEpochNanos.length) {
3747
4118
  return possibleEpochNanos[0];
3748
4119
  }
3749
4120
  const zonedEpochNanoDayBefore = isoDateTimeToEpochNano(isoDateTime) - bigNanoInUtcDay;
3750
- return timeZone.U(zonedEpochNanoDayBefore, 1);
4121
+ return timeZone.O(zonedEpochNanoDayBefore, 1);
3751
4122
  }
3752
4123
 
3753
4124
  function moveYearMonth(doSubtract, calendar, isoDateFields, durationSlots, options) {
@@ -3784,12 +4155,11 @@ function moveZonedEpochSlots(slots, durationFields, options) {
3784
4155
 
3785
4156
  function moveDateTime(calendar, isoDateTimeFields, durationFields, options) {
3786
4157
  const [movedTimeFields, dayDelta] = moveTime(isoDateTimeFields, durationFields);
3787
- const movedIsoDateTimeFields = combineDateAndTime(moveDate(calendar, isoDateTimeFields, {
4158
+ return checkIsoDateTimeInBounds(combineDateAndTime(moveDate(calendar, isoDateTimeFields, {
3788
4159
  ...durationFields,
3789
4160
  ...durationTimeFieldDefaults,
3790
4161
  days: durationFields.days + dayDelta
3791
- }, options), movedTimeFields);
3792
- return checkIsoDateTimeInBounds(movedIsoDateTimeFields), movedIsoDateTimeFields;
4162
+ }, options), movedTimeFields));
3793
4163
  }
3794
4164
 
3795
4165
  function moveDate(calendar, isoDateFields, durationFields, options) {
@@ -3836,11 +4206,11 @@ function addDateMonths(calendar, isoDateFields, years, months, overflow) {
3836
4206
  let {year: year, month: month, day: day} = dateParts;
3837
4207
  if (years) {
3838
4208
  const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, year, month);
3839
- year += years, month = computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, calendar ? calendar.q(year) : void 0, overflow),
4209
+ year += years, month = computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, calendar ? calendar.p(year) : void 0, overflow),
3840
4210
  month = clampEntity("month", month, 1, computeCalendarMonthsInYearForYear(calendar, year), overflow);
3841
4211
  }
3842
4212
  if (months) {
3843
- const yearMonthParts = calendar ? calendar.N(year, month, months) : addIsoMonths(year, month, months);
4213
+ const yearMonthParts = calendar ? calendar.K(year, month, months) : addIsoMonths(year, month, months);
3844
4214
  ({year: year, month: month} = yearMonthParts);
3845
4215
  }
3846
4216
  return day = clampEntity("day", day, 1, computeCalendarDaysInMonthForYearMonth(calendar, year, month), overflow),
@@ -3849,7 +4219,7 @@ function addDateMonths(calendar, isoDateFields, years, months, overflow) {
3849
4219
 
3850
4220
  function computeYearMovedMonth(calendar, monthCodeNumber, isLeapMonth, targetLeapMonth, overflow) {
3851
4221
  if (isLeapMonth) {
3852
- const leapMonthMeta = calendar ? calendar.m : void 0;
4222
+ const leapMonthMeta = calendar ? calendar.l : void 0;
3853
4223
  return void 0 !== targetLeapMonth && (leapMonthMeta < 0 || targetLeapMonth === monthCodeNumber + 1) ? targetLeapMonth : (1 === overflow && throwRangeError(invalidLeapMonth),
3854
4224
  leapMonthMeta < 0 ? -leapMonthMeta : monthCodeNumber);
3855
4225
  }
@@ -3862,7 +4232,7 @@ function getCommonCalendar(a, b) {
3862
4232
  }
3863
4233
 
3864
4234
  function getCommonTimeZone(a, b) {
3865
- return a.o !== b.o && throwRangeError("Mismatching TimeZones"),
4235
+ return a.m !== b.m && throwRangeError("Mismatching TimeZones"),
3866
4236
  a;
3867
4237
  }
3868
4238
 
@@ -3881,9 +4251,18 @@ function diffZonedDateTimes(invert, calendar, slots0, slots1, options) {
3881
4251
  const epochNano0 = slots0.epochNanoseconds;
3882
4252
  const epochNano1 = slots1.epochNanoseconds;
3883
4253
  let durationFields;
3884
- return compareBigInts(epochNano1, epochNano0) ? largestUnit < 6 ? durationFields = diffEpochNanos(epochNano0, epochNano1, largestUnit, smallestUnit, roundingInc, roundingMode) : (durationFields = diffZonedEpochsExact(getCommonTimeZone(slots0.timeZone, slots1.timeZone), calendar, slots0, slots1, largestUnit),
3885
- durationFields = roundRelativeDuration(durationFields, epochNano1, largestUnit, smallestUnit, roundingInc, roundingMode, createMarkerMoveOps(slots0, getEpochNano, moveZonedEpochSlots))) : durationFields = durationFieldDefaults,
3886
- createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);
4254
+ if (compareBigInts(epochNano1, epochNano0)) {
4255
+ if (largestUnit < 6) {
4256
+ durationFields = diffEpochNanos(epochNano0, epochNano1, largestUnit, smallestUnit, roundingInc, roundingMode);
4257
+ } else {
4258
+ const timeZone = getCommonTimeZone(slots0.timeZone, slots1.timeZone);
4259
+ durationFields = diffZonedEpochsExact(timeZone, calendar, slots0, slots1, largestUnit),
4260
+ durationFields = roundRelativeDuration(durationFields, epochNano1, largestUnit, smallestUnit, roundingInc, roundingMode, createZonedRelativeOps(calendar, timeZone, slots0), 1);
4261
+ }
4262
+ } else {
4263
+ durationFields = durationFieldDefaults;
4264
+ }
4265
+ return createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);
3887
4266
  }
3888
4267
 
3889
4268
  function diffPlainDateTimes(invert, calendar, plainDateTimeSlots0, plainDateTimeSlots1, options) {
@@ -3893,7 +4272,7 @@ function diffPlainDateTimes(invert, calendar, plainDateTimeSlots0, plainDateTime
3893
4272
  const sign = compareBigInts(endEpochNano, startEpochNano);
3894
4273
  let durationFields;
3895
4274
  return sign ? largestUnit <= 6 ? durationFields = diffEpochNanos(startEpochNano, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) : (durationFields = diffDateTimesBig(calendar, plainDateTimeSlots0, plainDateTimeSlots1, sign, largestUnit),
3896
- durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createMarkerMoveOps(plainDateTimeSlots0, isoDateTimeToEpochNano, bindArgs(moveDateTime, calendar)))) : durationFields = durationFieldDefaults,
4275
+ durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createDateTimeRelativeOps(calendar, plainDateTimeSlots0))) : durationFields = durationFieldDefaults,
3897
4276
  createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);
3898
4277
  }
3899
4278
 
@@ -3914,7 +4293,7 @@ function diffDateLike(invert, calendar, startIsoDate, endIsoDate, largestUnit, s
3914
4293
  const endEpochNano = isoDateToEpochNano(endIsoDate);
3915
4294
  let durationFields;
3916
4295
  return compareBigInts(endEpochNano, startEpochNano) ? 6 === largestUnit ? durationFields = diffEpochNanos(startEpochNano, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode) : (durationFields = diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit),
3917
- smallestUnit === smallestPrecision && 1 === roundingInc || (durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createMarkerMoveOps(startIsoDate, isoDateToEpochNano, bindArgs(moveDate, calendar))))) : durationFields = durationFieldDefaults,
4296
+ smallestUnit === smallestPrecision && 1 === roundingInc || (durationFields = roundRelativeDuration(durationFields, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, createDateRelativeOps(calendar, startIsoDate)))) : durationFields = durationFieldDefaults,
3918
4297
  createDurationSlots(invert ? negateDurationFields(durationFields) : durationFields);
3919
4298
  }
3920
4299
 
@@ -3996,7 +4375,7 @@ function diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit) {
3996
4375
  let months = 0;
3997
4376
  let days = 0;
3998
4377
  if (sign) {
3999
- months = calendar ? calendar.ne(year0, month0, year1, month1) : diffIsoMonthSlots(year0, month0, year1, month1);
4378
+ months = calendar ? calendar._(year0, month0, year1, month1) : diffIsoMonthSlots(year0, month0, year1, month1);
4000
4379
  let anchorIsoDate = addDateMonths(calendar, startIsoDate, 0, months, 0);
4001
4380
  sign * compareNumbers(day0, day1) > 0 && (months -= sign, anchorIsoDate = addDateMonths(calendar, startIsoDate, 0, months, 0)),
4002
4381
  days = diffDays(anchorIsoDate, endIsoDate);
@@ -4018,7 +4397,7 @@ function diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit) {
4018
4397
  let dayCorrect = 0;
4019
4398
  if (Math.sign(day1 - day0) === -sign) {
4020
4399
  const origDaysInMonth1 = daysInMonth1;
4021
- const yearMonthParts = calendar ? calendar.N(year1, month1, -sign) : addIsoMonths(year1, month1, -sign);
4400
+ const yearMonthParts = calendar ? calendar.K(year1, month1, -sign) : addIsoMonths(year1, month1, -sign);
4022
4401
  (({year: year1, month: month1} = yearMonthParts)), yearDiff = year1 - year0, monthDiff = month1 - month0,
4023
4402
  daysInMonth1 = computeCalendarDaysInMonthForYearMonth(calendar, year1, month1),
4024
4403
  dayCorrect = sign < 0 ? -origDaysInMonth1 : daysInMonth1;
@@ -4026,14 +4405,14 @@ function diffCalendarDates(calendar, startIsoDate, endIsoDate, largestUnit) {
4026
4405
  if (dayDiff = day1 - Math.min(day0, daysInMonth1) + dayCorrect, yearDiff) {
4027
4406
  const [monthCodeNumber0, isLeapMonth0] = computeCalendarMonthCodeParts(calendar, year0, month0);
4028
4407
  const [monthCodeNumber1, isLeapMonth1] = computeCalendarMonthCodeParts(calendar, year1, month1);
4029
- const leapMonthMeta = calendar ? calendar.m : void 0;
4408
+ const leapMonthMeta = calendar ? calendar.l : void 0;
4030
4409
  if (monthDiff = void 0 !== leapMonthMeta && isLeapMonth0 && !isLeapMonth1 && (leapMonthMeta < 0 ? sign > 0 && monthCodeNumber1 === -leapMonthMeta : sign < 0 && monthCodeNumber1 === monthCodeNumber0) ? 0 : monthCodeNumber1 - monthCodeNumber0 || Number(isLeapMonth1) - Number(isLeapMonth0),
4031
4410
  Math.sign(monthDiff) === -sign) {
4032
4411
  const monthCorrect = sign < 0 && -computeCalendarMonthsInYearForYear(calendar, year1);
4033
- year1 -= sign, yearDiff = year1 - year0, monthDiff = month1 - computeYearMovedMonth(calendar, monthCodeNumber0, isLeapMonth0, calendar ? calendar.q(year1) : void 0, 0) + (monthCorrect || computeCalendarMonthsInYearForYear(calendar, year1));
4412
+ year1 -= sign, yearDiff = year1 - year0, monthDiff = month1 - computeYearMovedMonth(calendar, monthCodeNumber0, isLeapMonth0, calendar ? calendar.p(year1) : void 0, 0) + (monthCorrect || computeCalendarMonthsInYearForYear(calendar, year1));
4034
4413
  } else if (calendar) {
4035
- const month0Projected = computeYearMovedMonth(calendar, monthCodeNumber0, isLeapMonth0, calendar.q(year1), 0);
4036
- monthDiff = calendar.ne(year1, month0Projected, year1, month1);
4414
+ const month0Projected = computeYearMovedMonth(calendar, monthCodeNumber0, isLeapMonth0, calendar.p(year1), 0);
4415
+ monthDiff = calendar._(year1, month0Projected, year1, month1);
4037
4416
  }
4038
4417
  }
4039
4418
  }
@@ -4077,56 +4456,60 @@ function diffDays(startIsoDate, endIsoDate) {
4077
4456
  return isoDateToEpochDays(endIsoDate) - isoDateToEpochDays(startIsoDate);
4078
4457
  }
4079
4458
 
4080
- function createMarkerMoveOps(marker, markerToEpochNano, moveMarker) {
4459
+ function createDateRelativeOps(calendar, origin) {
4081
4460
  return {
4082
- i: marker,
4083
- V: markerToEpochNano,
4084
- G: moveMarker
4461
+ origin: origin,
4462
+ ie: isoDateToEpochNano(origin),
4463
+ calendar: calendar,
4464
+ he: isoDateToEpochNano
4085
4465
  };
4086
4466
  }
4087
4467
 
4088
- function createMarkerSpanOps(relativeToSlots) {
4089
- const {calendar: calendar} = relativeToSlots;
4090
- if (isZonedEpochSlots(relativeToSlots)) {
4091
- const {timeZone: timeZone} = relativeToSlots;
4092
- return {
4093
- i: relativeToSlots,
4094
- V: getEpochNano,
4095
- G: moveZonedEpochSlots,
4096
- re: bindArgs(diffZonedEpochsExact, timeZone, calendar)
4097
- };
4098
- }
4468
+ function createDateTimeRelativeOps(calendar, origin) {
4099
4469
  return {
4100
- i: normalizeDateTimeMarker(relativeToSlots),
4101
- V: isoDateTimeToEpochNano,
4102
- G: bindArgs(moveDateTime, calendar),
4103
- re: bindArgs(diffDateTimesExact, calendar)
4470
+ origin: origin,
4471
+ ie: isoDateTimeToEpochNano(origin),
4472
+ calendar: calendar,
4473
+ he: movedIsoDate => isoDateTimeToEpochNano(combineDateAndTime(movedIsoDate, origin))
4104
4474
  };
4105
4475
  }
4106
4476
 
4107
- function moveMarkerToEpochNano(markerMoveOps, durationFields) {
4108
- return markerMoveOps.V(markerMoveOps.G(markerMoveOps.i, durationFields));
4477
+ function createZonedRelativeOps(calendar, timeZone, slots) {
4478
+ const origin = zonedEpochSlotsToIso(slots);
4479
+ return {
4480
+ origin: origin,
4481
+ ie: slots.epochNanoseconds,
4482
+ calendar: calendar,
4483
+ he: movedIsoDate => getSingleInstantFor(timeZone, combineDateAndTime(movedIsoDate, origin))
4484
+ };
4109
4485
  }
4110
4486
 
4111
- function isZonedEpochSlots(marker) {
4112
- return "timeZone" in marker;
4487
+ function moveRelativeToEpochNano(relativeOps, dateDuration) {
4488
+ return durationHasDateParts(dateDuration) ? relativeOps.he(moveDate(relativeOps.calendar, relativeOps.origin, dateDuration)) : relativeOps.ie;
4113
4489
  }
4114
4490
 
4115
- function checkMarkerSpanInBounds(markerSpanOps, endMarker) {
4116
- isZonedEpochSlots(markerSpanOps.i) || (checkMarkerInBounds(markerSpanOps.i),
4117
- checkMarkerInBounds(endMarker));
4491
+ function spanRelativeDuration(relativeToSlots, durationFields, largestUnit) {
4492
+ const {calendar: calendar} = relativeToSlots;
4493
+ if (isZonedEpochSlots(relativeToSlots)) {
4494
+ const {timeZone: timeZone} = relativeToSlots;
4495
+ const endSlots = moveZonedEpochSlots(relativeToSlots, durationFields);
4496
+ return [ diffZonedEpochsExact(timeZone, calendar, relativeToSlots, endSlots, largestUnit), endSlots.epochNanoseconds, createZonedRelativeOps(calendar, timeZone, relativeToSlots) ];
4497
+ }
4498
+ const origin = checkIsoDateTimeInBounds(combineDateAndTime(relativeToSlots, timeFieldDefaults));
4499
+ const end = moveDateTime(calendar, origin, durationFields);
4500
+ return [ diffDateTimesExact(calendar, origin, end, largestUnit), isoDateTimeToEpochNano(end), createDateRelativeOps(calendar, relativeToSlots) ];
4118
4501
  }
4119
4502
 
4120
- function normalizeDateTimeMarker(marker) {
4121
- return combineDateAndTime(marker, "hour" in marker ? marker : timeFieldDefaults);
4503
+ function moveRelativeEndpointToEpochNano(relativeToSlots, durationFields) {
4504
+ return isZonedEpochSlots(relativeToSlots) ? moveZonedEpochSlots(relativeToSlots, durationFields).epochNanoseconds : isoDateTimeToEpochNano(moveDateTime(relativeToSlots.calendar, combineDateAndTime(relativeToSlots, timeFieldDefaults), durationFields));
4122
4505
  }
4123
4506
 
4124
- function checkMarkerInBounds(marker) {
4125
- checkIsoDateTimeInBounds(normalizeDateTimeMarker(marker));
4507
+ function isZonedEpochSlots(slots) {
4508
+ return "timeZone" in slots;
4126
4509
  }
4127
4510
 
4128
- function isUniformUnit(unit, marker) {
4129
- return unit <= 6 - (marker && isZonedEpochSlots(marker) ? 1 : 0);
4511
+ function isUniformUnit(unit, isZoned) {
4512
+ return unit <= 6 - (isZoned ? 1 : 0);
4130
4513
  }
4131
4514
 
4132
4515
  function nanoToGivenFields(nano, largestUnit, fieldNames) {
@@ -4143,14 +4526,18 @@ const maxDurationSeconds = 2 ** 53;
4143
4526
  function addDurations(refineRelativeTo, doSubtract, slots, otherSlots, options) {
4144
4527
  const relativeToSlots = refineRelativeTo(normalizeOptions(options).relativeTo);
4145
4528
  const maxUnit = Math.max(getMaxDurationUnit(slots), getMaxDurationUnit(otherSlots));
4146
- if (isUniformUnit(maxUnit, relativeToSlots)) {
4147
- return addDayTimeDurationsChecked(doSubtract, slots, otherSlots, maxUnit);
4148
- }
4149
- relativeToSlots || throwRangeError("Missing relativeTo"), doSubtract && (otherSlots = negateDurationFields(otherSlots));
4150
- const markerSpanOps = createMarkerSpanOps(relativeToSlots);
4151
- const midMarker = markerSpanOps.G(markerSpanOps.i, slots);
4152
- const endMarker = markerSpanOps.G(midMarker, otherSlots);
4153
- return createDurationSlots(markerSpanOps.re(markerSpanOps.i, endMarker, maxUnit));
4529
+ return isUniformUnit(maxUnit, relativeToSlots && isZonedEpochSlots(relativeToSlots)) ? addDayTimeDurationsChecked(doSubtract, slots, otherSlots, maxUnit) : (relativeToSlots || throwRangeError("Missing relativeTo"),
4530
+ doSubtract && (otherSlots = negateDurationFields(otherSlots)), createDurationSlots(((relativeToSlots, durationFields0, durationFields1, largestUnit) => {
4531
+ const {calendar: calendar} = relativeToSlots;
4532
+ if (isZonedEpochSlots(relativeToSlots)) {
4533
+ const {timeZone: timeZone} = relativeToSlots;
4534
+ const midSlots = moveZonedEpochSlots(relativeToSlots, durationFields0);
4535
+ return diffZonedEpochsExact(timeZone, calendar, relativeToSlots, moveZonedEpochSlots(midSlots, durationFields1), largestUnit);
4536
+ }
4537
+ const origin = combineDateAndTime(relativeToSlots, timeFieldDefaults);
4538
+ const mid = moveDateTime(calendar, origin, durationFields0);
4539
+ return diffDateTimesExact(calendar, origin, moveDateTime(calendar, mid, durationFields1), largestUnit);
4540
+ })(relativeToSlots, slots, otherSlots, maxUnit)));
4154
4541
  }
4155
4542
 
4156
4543
  function addDayTimeDurationsChecked(doSubtract, slots, otherSlots, maxUnit) {
@@ -4188,17 +4575,14 @@ function roundDuration(refineRelativeTo, slots, options) {
4188
4575
  };
4189
4576
  })(slots, largestUnit, smallestUnit, roundingInc, roundingMode)));
4190
4577
  }
4191
- const needsZonedDayLength = relativeToSlots && isZonedEpochSlots(relativeToSlots) && largestUnit >= 6 && smallestUnit < 6;
4578
+ const isZoned = relativeToSlots && isZonedEpochSlots(relativeToSlots);
4579
+ const needsZonedDayLength = isZoned && largestUnit >= 6 && smallestUnit < 6;
4192
4580
  if (!slots.sign && !needsZonedDayLength) {
4193
4581
  return slots;
4194
4582
  }
4195
4583
  relativeToSlots || throwRangeError("Missing relativeTo");
4196
- const markerSpanOps = createMarkerSpanOps(relativeToSlots);
4197
- const endMarker = markerSpanOps.G(markerSpanOps.i, slots);
4198
- checkMarkerSpanInBounds(markerSpanOps, endMarker);
4199
- let balancedDuration = markerSpanOps.re(markerSpanOps.i, endMarker, largestUnit);
4200
- return balancedDuration = roundRelativeDuration(balancedDuration, markerSpanOps.V(endMarker), largestUnit, smallestUnit, roundingInc, roundingMode, markerSpanOps),
4201
- createDurationSlots(balancedDuration);
4584
+ const [balancedDuration, endEpochNano, relativeOps] = spanRelativeDuration(relativeToSlots, slots, largestUnit);
4585
+ return createDurationSlots(roundRelativeDuration(balancedDuration, endEpochNano, largestUnit, smallestUnit, roundingInc, roundingMode, relativeOps, isZoned));
4202
4586
  }
4203
4587
 
4204
4588
  function absDuration(slots) {
@@ -4275,26 +4659,15 @@ function getMaxDurationUnit(fields) {
4275
4659
  return unit;
4276
4660
  }
4277
4661
 
4278
- function compareInstants(instantSlots0, instantSlots1) {
4279
- return compareBigInts(instantSlots0.epochNanoseconds, instantSlots1.epochNanoseconds);
4280
- }
4281
-
4282
- function compareZonedDateTimes(zonedDateTimeSlots0, zonedDateTimeSlots1) {
4283
- return compareBigInts(zonedDateTimeSlots0.epochNanoseconds, zonedDateTimeSlots1.epochNanoseconds);
4662
+ function compareZonedEpochSlots(zonedEpochSlots0, zonedEpochSlots1) {
4663
+ return compareBigInts(zonedEpochSlots0.epochNanoseconds, zonedEpochSlots1.epochNanoseconds);
4284
4664
  }
4285
4665
 
4286
4666
  function compareDurations(refineRelativeTo, durationSlots0, durationSlots1, options) {
4287
4667
  const relativeToSlots = refineRelativeTo(normalizeOptions(options).relativeTo);
4288
4668
  const maxUnit = Math.max(getMaxDurationUnit(durationSlots0), getMaxDurationUnit(durationSlots1));
4289
- if (allPropsEqual(durationFieldNamesAsc, durationSlots0, durationSlots1)) {
4290
- return 0;
4291
- }
4292
- if (isUniformUnit(maxUnit, relativeToSlots)) {
4293
- return compareBigInts(durationDayTimeToBigNano(durationSlots0), durationDayTimeToBigNano(durationSlots1));
4294
- }
4295
- relativeToSlots || throwRangeError("Missing relativeTo");
4296
- const markerSpanOps = createMarkerSpanOps(relativeToSlots);
4297
- return compareBigInts(moveMarkerToEpochNano(markerSpanOps, durationSlots0), moveMarkerToEpochNano(markerSpanOps, durationSlots1));
4669
+ return allPropsEqual(durationFieldNamesAsc, durationSlots0, durationSlots1) ? 0 : isUniformUnit(maxUnit, relativeToSlots && isZonedEpochSlots(relativeToSlots)) ? compareBigInts(durationDayTimeToBigNano(durationSlots0), durationDayTimeToBigNano(durationSlots1)) : (relativeToSlots || throwRangeError("Missing relativeTo"),
4670
+ compareBigInts(moveRelativeEndpointToEpochNano(relativeToSlots, durationSlots0), moveRelativeEndpointToEpochNano(relativeToSlots, durationSlots1)));
4298
4671
  }
4299
4672
 
4300
4673
  function compareIsoDateTimeFields(isoDateTime0, isoDateTime1) {
@@ -4310,11 +4683,11 @@ function compareTimeFields(isoFields0, isoFields1) {
4310
4683
  }
4311
4684
 
4312
4685
  function instantsEqual(instantSlots0, instantSlots1) {
4313
- return !compareInstants(instantSlots0, instantSlots1);
4686
+ return !compareZonedEpochSlots(instantSlots0, instantSlots1);
4314
4687
  }
4315
4688
 
4316
4689
  function zonedDateTimesEqual(zonedDateTimeSlots0, zonedDateTimeSlots1) {
4317
- return !compareZonedDateTimes(zonedDateTimeSlots0, zonedDateTimeSlots1) && zonedDateTimeSlots0.timeZone.o === zonedDateTimeSlots1.timeZone.o && zonedDateTimeSlots0.calendar === zonedDateTimeSlots1.calendar;
4690
+ return !compareZonedEpochSlots(zonedDateTimeSlots0, zonedDateTimeSlots1) && zonedDateTimeSlots0.timeZone.m === zonedDateTimeSlots1.timeZone.m && zonedDateTimeSlots0.calendar === zonedDateTimeSlots1.calendar;
4318
4691
  }
4319
4692
 
4320
4693
  function plainDateTimesEqual(plainDateTimeSlots0, plainDateTimeSlots1) {
@@ -4338,7 +4711,7 @@ function plainTimesEqual(plainTimeSlots0, plainTimeSlots1) {
4338
4711
  }
4339
4712
 
4340
4713
  function getCalendarEraOrigins(calendar) {
4341
- return 0 === calendar ? gregoryEraOrigins : calendar ? calendar.l : void 0;
4714
+ return 0 === calendar ? gregoryEraOrigins : calendar ? calendar.k : void 0;
4342
4715
  }
4343
4716
 
4344
4717
  function getCalendarFieldNames(calendar, fieldNames, fieldNamesWithEra = fieldNames) {
@@ -4356,7 +4729,7 @@ function resolveCalendarYear(calendar, fields) {
4356
4729
  const normalizedEra = normalizeEraName(era);
4357
4730
  const eraOrigin = eraOrigins[normalizedEra];
4358
4731
  void 0 === eraOrigin && throwRangeError((era => `Invalid era: ${era}`)(era));
4359
- const yearByEra = exoticCalendar?.te ? exoticCalendar.te(eraYear, normalizedEra, eraOrigin) : eraYearToYear(eraYear, eraOrigin);
4732
+ const yearByEra = exoticCalendar?.$ ? exoticCalendar.$(eraYear, normalizedEra, eraOrigin) : eraYearToYear(eraYear, eraOrigin);
4360
4733
  void 0 !== year && year !== yearByEra && throwRangeError("Mismatching year/eraYear"),
4361
4734
  year = yearByEra;
4362
4735
  } else {
@@ -4369,11 +4742,11 @@ function resolveCalendarMonth(calendar, fields, year, overflow, monthCodeParts)
4369
4742
  let {month: month, monthCode: monthCode} = fields;
4370
4743
  if (void 0 !== monthCode) {
4371
4744
  const monthByCode = ((calendar, monthCode, year, overflow, monthCodeParts = parseMonthCode(monthCode)) => {
4372
- const leapMonth = calendar ? calendar.q(year) : void 0;
4745
+ const leapMonth = calendar ? calendar.p(year) : void 0;
4373
4746
  const [monthCodeNumber, wantsLeapMonth] = monthCodeParts;
4374
4747
  let month = monthCodeNumberToMonth(monthCodeNumber, wantsLeapMonth, leapMonth);
4375
4748
  if (wantsLeapMonth) {
4376
- const leapMonthMeta = calendar ? calendar.m : void 0;
4749
+ const leapMonthMeta = calendar ? calendar.l : void 0;
4377
4750
  void 0 === leapMonthMeta && throwRangeError(invalidLeapMonth), leapMonthMeta > 0 ? (month > leapMonthMeta && throwRangeError(invalidLeapMonth),
4378
4751
  leapMonth !== month && (1 === overflow && throwRangeError(invalidLeapMonth), month = monthCodeNumberToMonth(monthCodeNumber, 0, leapMonth))) : (month !== -leapMonthMeta && throwRangeError(invalidLeapMonth),
4379
4752
  void 0 === leapMonth && 1 === overflow && throwRangeError(invalidLeapMonth));
@@ -4433,19 +4806,17 @@ function parseOffsetNanoMaybe(s, onlyHourMinute) {
4433
4806
  const dateFieldRefiners = {
4434
4807
  era: toStringViaPrimitive,
4435
4808
  month: toPositiveIntegerWithTruncation,
4436
- monthCode(monthCode, entityName = "monthCode") {
4437
- return ((monthCode, entityName) => {
4438
- if ("string" == typeof monthCode) {
4439
- return monthCode;
4440
- }
4441
- if (monthCode && "object" == typeof monthCode) {
4442
- const monthCodeToString = monthCode.toString;
4443
- if ("function" == typeof monthCodeToString) {
4444
- return requireString(monthCodeToString.call(monthCode), entityName);
4445
- }
4809
+ monthCode(monthCode, entityName) {
4810
+ if ("string" == typeof monthCode) {
4811
+ return monthCode;
4812
+ }
4813
+ if (monthCode && "object" == typeof monthCode) {
4814
+ const monthCodeToString = monthCode.toString;
4815
+ if ("function" == typeof monthCodeToString) {
4816
+ return requireString(monthCodeToString.call(monthCode), entityName);
4446
4817
  }
4447
- return requireString(monthCode, entityName);
4448
- })(monthCode, entityName);
4818
+ }
4819
+ return requireString(monthCode, entityName);
4449
4820
  },
4450
4821
  day: toPositiveIntegerWithTruncation
4451
4822
  };
@@ -4454,16 +4825,15 @@ const timeFieldRefiners = /*@__PURE__*/ zipPropsConst(timeFieldNamesAsc, toInteg
4454
4825
 
4455
4826
  const durationFieldRefiners = /*@__PURE__*/ zipPropsConst(durationFieldNamesAsc, toStrictInteger);
4456
4827
 
4457
- const offsetFieldRefiners = {
4828
+ const dateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateFieldRefiners, timeFieldRefiners);
4829
+
4830
+ const zonedDateTimeFieldRefiners = {
4458
4831
  offset(offsetString) {
4459
4832
  return parseOffsetNano(toStringViaPrimitive(offsetString));
4460
- }
4833
+ },
4834
+ ...dateTimeFieldRefiners
4461
4835
  };
4462
4836
 
4463
- const dateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateFieldRefiners, timeFieldRefiners);
4464
-
4465
- const zonedDateTimeFieldRefiners = /*@__PURE__*/ Object.assign({}, dateTimeFieldRefiners, offsetFieldRefiners);
4466
-
4467
4837
  function readAndRefineBagFields(bag, validFieldNames, fieldRefiners, requiredFieldNames, disallowEmpty = !requiredFieldNames) {
4468
4838
  const res = {};
4469
4839
  let anyMatching = 0;
@@ -4540,19 +4910,19 @@ function createPlainMonthDayFromFields(calendar, fields, options) {
4540
4910
  day = resolveCalendarDay(calendar, fields, month, yearMaybe, overflow), [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, yearMaybe, month);
4541
4911
  } else {
4542
4912
  void 0 === fields.monthCode && throwTypeError("Missing month/monthCode"), [monthCodeNumber, isLeapMonth] = monthCodeParts;
4543
- const referenceYear = calendar ? calendar.ge : 1972;
4913
+ const referenceYear = calendar ? calendar.ne : 1972;
4544
4914
  if (void 0 !== referenceYear) {
4545
4915
  day = resolveCalendarDay(calendar, fields, resolveCalendarMonth(calendar, fields, referenceYear, overflow, monthCodeParts), referenceYear, overflow);
4546
4916
  } else {
4547
- const constrainedDay = 0 === overflow && calendar ? calendar.ke?.(monthCodeNumber, isLeapMonth, fields.day) : void 0;
4917
+ const constrainedDay = 0 === overflow && calendar ? calendar.fe?.(monthCodeNumber, isLeapMonth, fields.day) : void 0;
4548
4918
  day = void 0 !== constrainedDay ? constrainedDay : fields.day;
4549
4919
  }
4550
4920
  }
4551
- isLeapMonth && ((calendar && calendar.Z?.[monthCodeNumber]) ?? 1 / 0) < fields.day && (1 === overflow && throwRangeError(invalidLeapMonth),
4552
- isLeapMonth = 0, day = constrainToRange(fields.day, 1, (calendar && calendar.X) ?? 1 / 0));
4553
- let res = calendar ? calendar.v(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));
4921
+ isLeapMonth && ((calendar && calendar.U?.[monthCodeNumber]) ?? 1 / 0) < fields.day && (1 === overflow && throwRangeError(invalidLeapMonth),
4922
+ isLeapMonth = 0, day = constrainToRange(fields.day, 1, (calendar && calendar.R) ?? 1 / 0));
4923
+ let res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));
4554
4924
  for (;!res && 0 === overflow && day > 1; ) {
4555
- day--, res = calendar ? calendar.v(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));
4925
+ day--, res = calendar ? calendar.u(monthCodeNumber, Boolean(isLeapMonth), day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, Boolean(isLeapMonth));
4556
4926
  }
4557
4927
  res || throwRangeError("Cannot guess year");
4558
4928
  const {year: finalYear, month: finalMonth} = res;
@@ -4620,7 +4990,7 @@ function formatInstantIso(refineTimeZoneString, instantSlots, options) {
4620
4990
  const providedTimeZone = void 0 !== timeZoneArg;
4621
4991
  return ((providedTimeZone, timeZone, epochNano, roundingMode, nanoInc, subsecDigits) => {
4622
4992
  epochNano = roundBigNanoToDayOriginInc(epochNano, BigInt(nanoInc), roundingMode);
4623
- const offsetNano = timeZone.C(epochNano);
4993
+ const offsetNano = timeZone.B(epochNano);
4624
4994
  return formatIsoDateTimeFields(epochNanoToIsoDateTime(epochNano + BigInt(offsetNano)), subsecDigits) + (providedTimeZone ? formatOffsetNano(roundToMinute(offsetNano)) : "Z");
4625
4995
  })(providedTimeZone, queryTimeZone(providedTimeZone ? refineTimeZoneString(timeZoneArg) : "UTC"), instantSlots.epochNanoseconds, roundingMode, nanoInc, subsecDigits);
4626
4996
  }
@@ -4637,7 +5007,7 @@ function formatZonedDateTimeIso(zonedDateTimeSlots0, options) {
4637
5007
  })(options);
4638
5008
  return ((calendar, timeZoneId, timeZone, epochNano, calendarDisplay, timeZoneDisplay, offsetDisplay, roundingMode, nanoInc, subsecDigits) => {
4639
5009
  epochNano = roundBigNanoToDayOriginInc(epochNano, BigInt(nanoInc), roundingMode);
4640
- const offsetNano = timeZone.C(epochNano);
5010
+ const offsetNano = timeZone.B(epochNano);
4641
5011
  return formatIsoDateTimeFields(epochNanoToIsoDateTime(epochNano + BigInt(offsetNano)), subsecDigits) + formatOffsetNano(roundToMinute(offsetNano), offsetDisplay) + formatTimeZone(timeZoneId, timeZoneDisplay) + formatCalendar(calendar, calendarDisplay);
4642
5012
  })(zonedDateTimeSlots0.calendar, zonedDateTimeSlots0.timeZone.id, zonedDateTimeSlots0.timeZone, zonedDateTimeSlots0.epochNanoseconds, ...displayOptions);
4643
5013
  }
@@ -4793,8 +5163,8 @@ function resolveTimeZoneRecord(rawId) {
4793
5163
  if (void 0 !== offsetNano) {
4794
5164
  return {
4795
5165
  id: formatOffsetNano(offsetNano),
4796
- _: offsetNano,
4797
- o: offsetNano
5166
+ X: offsetNano,
5167
+ m: offsetNano
4798
5168
  };
4799
5169
  }
4800
5170
  })(upperRawId);
@@ -4814,7 +5184,7 @@ const queryNamedTimeZoneRecord = /*@__PURE__*/ memoize(normId => {
4814
5184
  return {
4815
5185
  kind: "utc",
4816
5186
  id: normId,
4817
- o: normId
5187
+ m: normId
4818
5188
  };
4819
5189
  }
4820
5190
  const upperNormId = normId.toUpperCase();
@@ -4823,7 +5193,7 @@ const queryNamedTimeZoneRecord = /*@__PURE__*/ memoize(normId => {
4823
5193
  kind: "named",
4824
5194
  id: normId,
4825
5195
  format: format,
4826
- o: format.resolvedOptions().timeZone
5196
+ m: format.resolvedOptions().timeZone
4827
5197
  };
4828
5198
  });
4829
5199
 
@@ -4844,24 +5214,24 @@ function queryTimeZone(rawTimeZoneId) {
4844
5214
  return queryTimeZoneRecord(record.id, record);
4845
5215
  }
4846
5216
 
4847
- const queryTimeZoneRecord = /*@__PURE__*/ memoize((normTimeZoneId, record) => "named" === record.kind ? new IntlTimeZone(normTimeZoneId, record.o, record.format) : new FixedTimeZone(normTimeZoneId, record.o, "fixed" === record.kind ? record._ : 0));
5217
+ const queryTimeZoneRecord = /*@__PURE__*/ memoize((normTimeZoneId, record) => "named" === record.kind ? new IntlTimeZone(normTimeZoneId, record.m, record.format) : new FixedTimeZone(normTimeZoneId, record.m, "fixed" === record.kind ? record.X : 0));
4848
5218
 
4849
5219
  class FixedTimeZone {
4850
5220
  constructor(id, compareKey, offsetNano) {
4851
- this.id = id, this.o = compareKey, this._ = offsetNano;
5221
+ this.id = id, this.m = compareKey, this.X = offsetNano;
4852
5222
  }
4853
- C() {
4854
- return this._;
5223
+ B() {
5224
+ return this.X;
4855
5225
  }
4856
- R(isoDateTime) {
4857
- return [ isoDateTimeAndOffsetToEpochNano(isoDateTime, this._) ];
5226
+ N(isoDateTime) {
5227
+ return [ isoDateTimeAndOffsetToEpochNano(isoDateTime, this.X) ];
4858
5228
  }
4859
- U() {}
5229
+ O() {}
4860
5230
  }
4861
5231
 
4862
5232
  class IntlTimeZone {
4863
5233
  constructor(id, compareKey, format) {
4864
- this.id = id, this.o = compareKey, this.qe = ((computeOffsetSec, periodDays) => {
5234
+ this.id = id, this.m = compareKey, this.ke = ((computeOffsetSec, periodDays) => {
4865
5235
  const getSample = memoize(computeOffsetSec);
4866
5236
  const getSplit = memoize(createSplitTuple);
4867
5237
  const periodSec = 86400 * periodDays;
@@ -4883,7 +5253,7 @@ class IntlTimeZone {
4883
5253
  return offsetSec;
4884
5254
  }
4885
5255
  return {
4886
- Ee(zonedEpochSec) {
5256
+ xe(zonedEpochSec) {
4887
5257
  const wideOffsetSec0 = getOffsetSec(zonedEpochSec - 86400);
4888
5258
  const wideOffsetSec1 = getOffsetSec(zonedEpochSec + 86400);
4889
5259
  const wideUtcEpochSec0 = zonedEpochSec - wideOffsetSec0;
@@ -4894,8 +5264,8 @@ class IntlTimeZone {
4894
5264
  const narrowOffsetSec0 = getOffsetSec(wideUtcEpochSec0);
4895
5265
  return narrowOffsetSec0 === getOffsetSec(wideUtcEpochSec1) ? [ zonedEpochSec - narrowOffsetSec0 ] : wideOffsetSec0 > wideOffsetSec1 ? [ wideUtcEpochSec0, wideUtcEpochSec1 ] : [];
4896
5266
  },
4897
- De: getOffsetSec,
4898
- U: function getTransition(epochSec, direction) {
5267
+ we: getOffsetSec,
5268
+ O: function getTransition(epochSec, direction) {
4899
5269
  if (direction > 0 && epochSec >= 864e10) {
4900
5270
  return;
4901
5271
  }
@@ -4945,17 +5315,17 @@ class IntlTimeZone {
4945
5315
  return timeZonePeriodDaysByName[timeZoneName] || 60;
4946
5316
  })(id));
4947
5317
  }
4948
- C(epochNano) {
4949
- return this.qe.De((epochNano => epochNanoToSecMod(epochNano)[0])(epochNano)) * nanoInSec;
5318
+ B(epochNano) {
5319
+ return this.ke.we((epochNano => epochNanoToSecMod(epochNano)[0])(epochNano)) * nanoInSec;
4950
5320
  }
4951
- R(isoDateTime) {
5321
+ N(isoDateTime) {
4952
5322
  const zonedEpochSec = 86400 * isoDateToEpochDays(isoDateTime) + timeFieldsToSec(isoDateTime);
4953
5323
  const subsecNano = timeFieldsToSubsecNano(isoDateTime);
4954
- return this.qe.Ee(zonedEpochSec).map(epochSec => checkEpochNanoInBounds(BigInt(epochSec) * bigNanoInSec + BigInt(subsecNano)));
5324
+ return this.ke.xe(zonedEpochSec).map(epochSec => checkEpochNanoInBounds(BigInt(epochSec) * bigNanoInSec + BigInt(subsecNano)));
4955
5325
  }
4956
- U(epochNano, direction) {
5326
+ O(epochNano, direction) {
4957
5327
  const [epochSec, subsecNano] = epochNanoToSecMod(epochNano);
4958
- const resEpochSec = this.qe.U(epochSec + (direction > 0 || subsecNano ? 1 : 0), direction);
5328
+ const resEpochSec = this.ke.O(epochSec + (direction > 0 || subsecNano ? 1 : 0), direction);
4959
5329
  if (void 0 !== resEpochSec) {
4960
5330
  return BigInt(resEpochSec) * bigNanoInSec;
4961
5331
  }
@@ -5042,14 +5412,14 @@ function throwFailedParse(s) {
5042
5412
  function parseInstant(s) {
5043
5413
  const organized = parseDateTimeLike(s = toStringViaPrimitive(s));
5044
5414
  let offsetNano;
5045
- return organized || throwFailedParse(s), organized.F ? offsetNano = 0 : organized.offset ? offsetNano = parseOffsetNano(organized.offset) : throwFailedParse(s),
5415
+ return organized || throwFailedParse(s), organized.C ? offsetNano = 0 : organized.offset ? offsetNano = parseOffsetNano(organized.offset) : throwFailedParse(s),
5046
5416
  organized.timeZoneId && parseOffsetNanoMaybe(organized.timeZoneId, 1), validateIsoDateTimeFields(organized),
5047
5417
  createEpochNanoSlots(isoDateTimeAndOffsetToEpochNano(organized, offsetNano));
5048
5418
  }
5049
5419
 
5050
5420
  function parseRelativeToSlots(s, resolveCalendar) {
5051
5421
  const organized = parseDateTimeLike(requireString(s));
5052
- return organized || throwFailedParse(s), organized.timeZoneId ? finalizeZonedDateTime(organized, resolveCalendar, void 0) : (organized.F && throwFailedParse(s),
5422
+ return organized || throwFailedParse(s), organized.timeZoneId ? finalizeZonedDateTime(organized, resolveCalendar, void 0) : (organized.C && throwFailedParse(s),
5053
5423
  finalizeDate(organized, resolveCalendar));
5054
5424
  }
5055
5425
 
@@ -5060,7 +5430,7 @@ function parseZonedDateTime(s, resolveCalendar, options) {
5060
5430
 
5061
5431
  function parsePlainDateTime(s, resolveCalendar) {
5062
5432
  const organized = parseDateTimeLike(requireString(s));
5063
- return organized && !organized.F || throwFailedParse(s), finalizeDateTime(organized, resolveCalendar);
5433
+ return organized && !organized.C || throwFailedParse(s), finalizeDateTime(organized, resolveCalendar);
5064
5434
  }
5065
5435
 
5066
5436
  function parsePlainDate(s, resolveCalendar) {
@@ -5092,7 +5462,7 @@ function parsePlainMonthDay(s, resolveCalendar) {
5092
5462
  const {year: origYear, month: origMonth, day: day} = computeCalendarDateFields(calendar, dateSlots);
5093
5463
  const [monthCodeNumber, isLeapMonth] = computeCalendarMonthCodeParts(calendar, origYear, origMonth);
5094
5464
  const {year: year, month: month} = ((calendar, monthCodeNumber, isLeapMonth, day) => {
5095
- const yearMonthFields = calendar ? calendar.v(monthCodeNumber, isLeapMonth, day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth);
5465
+ const yearMonthFields = calendar ? calendar.u(monthCodeNumber, isLeapMonth, day) : computeIsoYearMonthFieldsForMonthDay(monthCodeNumber, isLeapMonth);
5096
5466
  return yearMonthFields || throwRangeError("Cannot guess year"), yearMonthFields;
5097
5467
  })(calendar, monthCodeNumber, isLeapMonth, day);
5098
5468
  return createDateSlots(checkIsoDateInBounds(computeCalendarIsoFieldsFromParts(calendar, year, month, day)), calendar);
@@ -5103,47 +5473,47 @@ function parsePlainTime(s) {
5103
5473
  const parts = parseTimeOnlyParts(s);
5104
5474
  return parts ? (organizeAnnotationParts(parts[13]), organizeTimeParts(parts, 1)) : void 0;
5105
5475
  })(s = requireString(s));
5476
+ if (!organized) {
5477
+ const dateTime = parseDateTimeLike(s);
5478
+ dateTime && dateTime.re || throwFailedParse(s), dateTime.C && throwRangeError(invalidSubstring("Z")),
5479
+ requireIsoCalendar(dateTime), organized = dateTime;
5480
+ }
5106
5481
  let altParsed;
5107
- return organized || (organized = parseDateTimeLike(s), organized ? (organized.fe || throwFailedParse(s),
5108
- organized.F && throwRangeError(invalidSubstring("Z")), requireIsoCalendar(organized)) : throwFailedParse(s)),
5109
- (altParsed = parseYearMonthOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s),
5482
+ return (altParsed = parseYearMonthOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s),
5110
5483
  (altParsed = parseMonthDayOnly(s)) && isIsoDateFieldsValid(altParsed) && throwFailedParse(s),
5111
5484
  createTimeSlots(validateTimeFields(organized));
5112
5485
  }
5113
5486
 
5114
5487
  function parseDuration(s) {
5115
- const parsed = (s => {
5116
- const parts = durationRegExp.exec(s);
5117
- return parts ? (parts => {
5118
- let hasAny = 0;
5119
- let hasAnyFrac = 0;
5120
- let leftoverNano = 0;
5121
- let durationFields = {
5122
- years: parseUnit(parts[2]),
5123
- months: parseUnit(parts[3]),
5124
- weeks: parseUnit(parts[4]),
5125
- days: parseUnit(parts[5]),
5126
- hours: parseUnit(parts[6], parts[7], 5),
5127
- minutes: parseUnit(parts[8], parts[9], 4),
5128
- seconds: parseUnit(parts[10], parts[11], 3),
5129
- ...nanoToGivenFields(leftoverNano, 2, durationFieldNamesAsc)
5130
- };
5131
- return hasAny || throwRangeError(noValidFields(durationFieldNamesAsc)), parseSign(parts[1]) < 0 && (durationFields = negateDurationFields(durationFields)),
5132
- durationFields;
5133
- function parseUnit(wholeStr, fracStr, timeUnit) {
5134
- let leftoverUnits = 0;
5135
- let wholeUnits = 0;
5136
- return timeUnit && ([leftoverUnits, leftoverNano] = divModFloor(leftoverNano, unitNanoMap[timeUnit])),
5137
- void 0 !== wholeStr && (hasAnyFrac && throwRangeError(invalidSubstring(wholeStr)),
5138
- wholeUnits = (s => {
5139
- const n = parseInt(s);
5140
- return Number.isFinite(n) || throwRangeError(invalidSubstring(s)), n;
5141
- })(wholeStr), hasAny = 1, fracStr && (leftoverNano = parseSubsecNano(fracStr) * (unitNanoMap[timeUnit] / nanoInSec),
5142
- hasAnyFrac = 1)), leftoverUnits + wholeUnits;
5143
- }
5144
- })(parts) : void 0;
5145
- })(requireString(s));
5146
- return parsed || throwFailedParse(s), createDurationSlots(validateDurationFields(parsed));
5488
+ const parts = durationRegExp.exec(requireString(s));
5489
+ return parts || throwFailedParse(s), createDurationSlots(validateDurationFields((parts => {
5490
+ let hasAny = 0;
5491
+ let hasAnyFrac = 0;
5492
+ let leftoverNano = 0;
5493
+ let durationFields = {
5494
+ years: parseUnit(parts[2]),
5495
+ months: parseUnit(parts[3]),
5496
+ weeks: parseUnit(parts[4]),
5497
+ days: parseUnit(parts[5]),
5498
+ hours: parseUnit(parts[6], parts[7], 5),
5499
+ minutes: parseUnit(parts[8], parts[9], 4),
5500
+ seconds: parseUnit(parts[10], parts[11], 3),
5501
+ ...nanoToGivenFields(leftoverNano, 2, durationFieldNamesAsc)
5502
+ };
5503
+ return hasAny || throwRangeError(noValidFields(durationFieldNamesAsc)), parseSign(parts[1]) < 0 && (durationFields = negateDurationFields(durationFields)),
5504
+ durationFields;
5505
+ function parseUnit(wholeStr, fracStr, timeUnit) {
5506
+ let leftoverUnits = 0;
5507
+ let wholeUnits = 0;
5508
+ return timeUnit && ([leftoverUnits, leftoverNano] = divModFloor(leftoverNano, unitNanoMap[timeUnit])),
5509
+ void 0 !== wholeStr && (hasAnyFrac && throwRangeError(invalidSubstring(wholeStr)),
5510
+ wholeUnits = (s => {
5511
+ const n = parseInt(s);
5512
+ return Number.isFinite(n) || throwRangeError(invalidSubstring(s)), n;
5513
+ })(wholeStr), hasAny = 1, fracStr && (leftoverNano = parseSubsecNano(fracStr) * (unitNanoMap[timeUnit] / nanoInSec),
5514
+ hasAnyFrac = 1)), leftoverUnits + wholeUnits;
5515
+ }
5516
+ })(parts)));
5147
5517
  }
5148
5518
 
5149
5519
  function parseCalendarId(s) {
@@ -5157,17 +5527,17 @@ function parseCalendarId(s) {
5157
5527
 
5158
5528
  function parseTimeZoneId(s) {
5159
5529
  const parsed = parseDateTimeLike(s);
5160
- return parsed && (parsed.timeZoneId || parsed.F && "UTC" || parsed.offset) || s;
5530
+ return parsed && (parsed.timeZoneId || parsed.C && "UTC" || parsed.offset) || s;
5161
5531
  }
5162
5532
 
5163
5533
  function parsePlainDateLike(s) {
5164
5534
  const organized = parseDateTimeLike(s);
5165
- return organized && !organized.F || throwFailedParse(s), organized;
5535
+ return organized && !organized.C || throwFailedParse(s), organized;
5166
5536
  }
5167
5537
 
5168
5538
  function finalizeDateLike(organized, isoDateProjector, resolveCalendar) {
5169
5539
  return isoDateProjector && "iso8601" === organized.calendarId ? (validateIsoDateFields(organized),
5170
- organized.fe && validateTimeFields(organized), finalizeDate(isoDateProjector(organized), resolveCalendar)) : organized.fe ? finalizeDateTime(organized, resolveCalendar) : finalizeDate(organized, resolveCalendar);
5540
+ organized.re && validateTimeFields(organized), finalizeDate(isoDateProjector(organized), resolveCalendar)) : organized.re ? finalizeDateTime(organized, resolveCalendar) : finalizeDate(organized, resolveCalendar);
5171
5541
  }
5172
5542
 
5173
5543
  function projectIsoYearMonthDate(organized) {
@@ -5188,11 +5558,11 @@ function projectIsoMonthDayDate(organized) {
5188
5558
  function finalizeZonedDateTime(organized, resolveCalendar, options) {
5189
5559
  const timeZone = queryTimeZone(resolveTimeZoneId(organized.timeZoneId));
5190
5560
  let epochNano;
5191
- if (validateIsoDateTimeFields(organized), organized.fe) {
5561
+ if (validateIsoDateTimeFields(organized), organized.re) {
5192
5562
  const offsetNano = organized.offset ? parseOffsetNano(organized.offset) : void 0;
5193
5563
  const [, offsetDisambig, epochDisambig] = refineZonedFieldOptions(options);
5194
- epochNano = getMatchingInstantFor(timeZone, organized, offsetNano, offsetDisambig, epochDisambig, !(timeZone._ || void 0 === organized.offset || (offset = organized.offset,
5195
- offset.replace(/\D/g, "").length > 4)), organized.F);
5564
+ epochNano = getMatchingInstantFor(timeZone, organized, offsetNano, offsetDisambig, epochDisambig, !(timeZone.X || void 0 === organized.offset || (offset = organized.offset,
5565
+ offset.replace(/\D/g, "").length > 4)), organized.C);
5196
5566
  } else {
5197
5567
  refineZonedFieldOptions(options), epochNano = getStartOfDayInstantFor(timeZone, organized);
5198
5568
  }
@@ -5221,11 +5591,7 @@ function timeRegExpStr(separatorIndex) {
5221
5591
  return `(\\d{2})(?:(:?)(\\d{2})(?:\\${separatorIndex}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`;
5222
5592
  }
5223
5593
 
5224
- function offsetRegExpStr(separatorIndex) {
5225
- return "([+-])" + timeRegExpStr(separatorIndex);
5226
- }
5227
-
5228
- const dateTimeRegExpStr = "(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]" + timeRegExpStr(8) + "(Z|" + offsetRegExpStr(15) + ")?)?";
5594
+ const dateTimeRegExpStr = "(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]" + timeRegExpStr(8) + "(Z|([+-])" + timeRegExpStr(15) + ")?)?";
5229
5595
 
5230
5596
  const yearMonthRegExp = /*@__PURE__*/ createRegExp("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})");
5231
5597
 
@@ -5233,11 +5599,11 @@ const monthDayRegExp = /*@__PURE__*/ createRegExp("(?:--)?(\\d{2})-?(\\d{2})((?:
5233
5599
 
5234
5600
  const dateTimeRegExp = /*@__PURE__*/ createRegExp(dateTimeRegExpStr + "((?:\\[(!?)([^\\]]*)\\]){0,9})");
5235
5601
 
5236
- const timeRegExp = /*@__PURE__*/ createRegExp("T?" + timeRegExpStr(2) + `(${offsetRegExpStr(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`);
5602
+ const timeRegExp = /*@__PURE__*/ createRegExp("T?" + timeRegExpStr(2) + `(([+-])${timeRegExpStr(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`);
5237
5603
 
5238
5604
  const annotationRegExp = /*@__PURE__*/ new RegExp("\\[(!?)([^\\]]*)\\]", "g");
5239
5605
 
5240
- const durationRegExp = /*@__PURE__*/ createRegExp("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");
5606
+ const durationRegExp = /*@__PURE__*/ createRegExp("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?!$)(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");
5241
5607
 
5242
5608
  function parseDateTimeLike(s) {
5243
5609
  const parts = dateTimeRegExp.exec(s);
@@ -5250,8 +5616,8 @@ function parseDateTimeLike(s) {
5250
5616
  day: parseInt(parts[6]),
5251
5617
  ...organizeTimeParts(parts, 7),
5252
5618
  ...organizeAnnotationParts(parts[19]),
5253
- fe: Boolean(parts[7]),
5254
- F: hasZ,
5619
+ re: Boolean(parts[7]),
5620
+ C: hasZ,
5255
5621
  offset: hasZ ? void 0 : zOrOffset
5256
5622
  };
5257
5623
  })(parts) : void 0;
@@ -5321,7 +5687,7 @@ function organizeAnnotationParts(s) {
5321
5687
  function mergeCalendarFields(calendar, baseFields, additionalFields) {
5322
5688
  const merged = Object.assign(Object.create(null), baseFields);
5323
5689
  return spliceFields(merged, additionalFields, monthFieldNames), getCalendarEraOrigins(calendar) && (spliceFields(merged, additionalFields, allYearFieldNames),
5324
- calendar && calendar.le && spliceFields(merged, additionalFields, monthDayFieldNames, eraYearFieldNames)),
5690
+ calendar && calendar.ge && spliceFields(merged, additionalFields, monthDayFieldNames, eraYearFieldNames)),
5325
5691
  merged;
5326
5692
  }
5327
5693
 
@@ -5462,10 +5828,7 @@ function zonedDateTimeToPlainTime(zonedDateTimeSlots0) {
5462
5828
  }
5463
5829
 
5464
5830
  function plainDateTimeToZonedDateTime(plainDateTimeSlots, timeZone, options) {
5465
- const epochNano = ((timeZone, isoDateTime, options) => {
5466
- const epochDisambig = (options => coerceEpochDisambig(normalizeOptions(options)))(options);
5467
- return getSingleInstantFor(timeZone, isoDateTime, epochDisambig);
5468
- })(timeZone, plainDateTimeSlots, options);
5831
+ const epochNano = getSingleInstantFor(timeZone, plainDateTimeSlots, (options => coerceEpochDisambig(normalizeOptions(options)))(options));
5469
5832
  return createZonedEpochNanoSlots(checkEpochNanoInBounds(epochNano), timeZone, plainDateTimeSlots.calendar);
5470
5833
  }
5471
5834
 
@@ -5531,36 +5894,30 @@ function createOptionsTransformer(shapeFieldNames, invalidShapeFieldNames, ignor
5531
5894
  const invalidShapeFieldNameSet = new Set(invalidShapeFieldNames);
5532
5895
  const ignoredFieldNameSet = new Set(ignoredFieldNames);
5533
5896
  return (options, allowPartialOverlap) => {
5534
- const analysis = ((options, shapeFieldNameSet, invalidShapeFieldNameSet, ignoredFieldNameSet) => {
5535
- const analysis = {
5536
- dateStyle: void 0,
5537
- timeStyle: void 0,
5538
- me: {},
5539
- pe: {},
5540
- xe: {},
5541
- oe: 0,
5542
- ue: 0
5543
- };
5544
- for (const name of Object.keys(options)) {
5545
- const value = options[name];
5546
- void 0 === value || ignoredFieldNameSet.has(name) || (shapeFieldNameSet.has(name) ? "dateStyle" === name ? analysis.dateStyle = value : "timeStyle" === name ? analysis.timeStyle = value : analysis.me[name] = value : "era" === name ? analysis.pe[name] = value : invalidShapeFieldNameSet.has(name) ? "dateStyle" === name || "timeStyle" === name ? analysis.ue = 1 : analysis.oe = 1 : analysis.xe[name] = value);
5547
- }
5548
- return analysis;
5549
- })(options, shapeFieldNameSet, invalidShapeFieldNameSet, ignoredFieldNameSet);
5550
- const hasDateStyle = void 0 !== analysis.dateStyle;
5551
- const hasTimeStyle = void 0 !== analysis.timeStyle;
5897
+ let dateStyle;
5898
+ let timeStyle;
5899
+ const granularShapeFields = {};
5900
+ const modifierFields = {};
5901
+ const otherFields = {};
5902
+ let hasInvalidGranularShapeFields = 0;
5903
+ let hasInvalidStyleFields = 0;
5904
+ for (const name of Object.keys(options)) {
5905
+ const value = options[name];
5906
+ void 0 === value || ignoredFieldNameSet.has(name) || (shapeFieldNameSet.has(name) ? "dateStyle" === name ? dateStyle = value : "timeStyle" === name ? timeStyle = value : granularShapeFields[name] = value : "era" === name ? modifierFields[name] = value : invalidShapeFieldNameSet.has(name) ? "dateStyle" === name || "timeStyle" === name ? hasInvalidStyleFields = 1 : hasInvalidGranularShapeFields = 1 : otherFields[name] = value);
5907
+ }
5908
+ const hasDateStyle = void 0 !== dateStyle;
5909
+ const hasTimeStyle = void 0 !== timeStyle;
5552
5910
  const hasAnyStyle = hasDateStyle || hasTimeStyle;
5553
- const hasGranularShapeFields = Object.keys(analysis.me).length > 0;
5554
- const hasInvalids = analysis.oe || analysis.ue;
5911
+ const hasGranularShapeFields = Object.keys(granularShapeFields).length > 0;
5912
+ const hasInvalids = hasInvalidGranularShapeFields || hasInvalidStyleFields;
5555
5913
  const hasShapeFields = hasGranularShapeFields || hasDateStyle || hasTimeStyle;
5556
- const hasModifierFields = Object.keys(analysis.pe).length > 0;
5557
- const hasStyleConflictFields = hasGranularShapeFields || hasModifierFields || analysis.oe;
5558
- (!allowPartialOverlap && hasInvalids || allowPartialOverlap && hasInvalids && !hasShapeFields || hasAnyStyle && hasStyleConflictFields) && throwTypeError("Invalid formatting options");
5914
+ const hasModifierFields = Object.keys(modifierFields).length > 0;
5915
+ (!allowPartialOverlap && hasInvalids || allowPartialOverlap && hasInvalids && !hasShapeFields || hasAnyStyle && (hasGranularShapeFields || hasModifierFields || hasInvalidGranularShapeFields)) && throwTypeError("Invalid formatting options");
5559
5916
  const transformedOptions = {};
5560
5917
  return hasAnyStyle || hasShapeFields || Object.assign(transformedOptions, defaultShapeFields),
5561
- Object.assign(transformedOptions, analysis.me, analysis.pe, analysis.xe),
5562
- hasDateStyle && (dateStyleReplacementFields ? Object.assign(transformedOptions, dateStyleReplacementFields[analysis.dateStyle]) : transformedOptions.dateStyle = analysis.dateStyle),
5563
- hasTimeStyle && (transformedOptions.timeStyle = analysis.timeStyle), transformedOptions;
5918
+ Object.assign(transformedOptions, granularShapeFields, modifierFields, otherFields),
5919
+ hasDateStyle && (dateStyleReplacementFields ? Object.assign(transformedOptions, dateStyleReplacementFields[dateStyle]) : transformedOptions.dateStyle = dateStyle),
5920
+ hasTimeStyle && (transformedOptions.timeStyle = timeStyle), transformedOptions;
5564
5921
  };
5565
5922
  }
5566
5923
 
@@ -5578,20 +5935,6 @@ const timeDefaultShapeFields = {
5578
5935
 
5579
5936
  const dateTimeDefaultShapeFields = /*@__PURE__*/ Object.assign({}, dateDefaultShapeFields, timeDefaultShapeFields);
5580
5937
 
5581
- const zonedDateTimeDefaultShapeFields = /*@__PURE__*/ Object.assign({}, dateTimeDefaultShapeFields, {
5582
- timeZoneName: "short"
5583
- });
5584
-
5585
- const yearMonthDefaultShapeFields = {
5586
- year: "numeric",
5587
- month: "numeric"
5588
- };
5589
-
5590
- const monthDayDefaultShapeFields = {
5591
- month: "numeric",
5592
- day: "numeric"
5593
- };
5594
-
5595
5938
  const dateShapeFieldNames = [ "weekday", "year", "month", "day", "dateStyle" ];
5596
5939
 
5597
5940
  const timeShapeFieldNames = [ "dayPeriod", "hour", "minute", "second", "fractionalSecondDigits", "timeStyle" ];
@@ -5604,7 +5947,10 @@ const monthDayIgnoredFieldNames = /*@__PURE__*/ [ "weekday", "year" ].concat(tim
5604
5947
 
5605
5948
  const transformInstantOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], dateTimeDefaultShapeFields);
5606
5949
 
5607
- const transformZonedOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], zonedDateTimeDefaultShapeFields);
5950
+ const transformZonedOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [], {
5951
+ ...dateTimeDefaultShapeFields,
5952
+ timeZoneName: "short"
5953
+ });
5608
5954
 
5609
5955
  const transformDateTimeOptions = /*@__PURE__*/ createOptionsTransformer(dateTimeShapeFieldNames, [], [ "timeZoneName" ], dateTimeDefaultShapeFields);
5610
5956
 
@@ -5612,7 +5958,10 @@ const transformDateOptions = /*@__PURE__*/ createOptionsTransformer(dateShapeFie
5612
5958
 
5613
5959
  const transformTimeOptions = /*@__PURE__*/ createOptionsTransformer(timeShapeFieldNames, dateShapeFieldNames, [ "timeZoneName", "era" ], timeDefaultShapeFields);
5614
5960
 
5615
- const transformYearMonthOptions = /*@__PURE__*/ createOptionsTransformer([ "year", "month", "dateStyle" ], yearMonthIgnoredFieldNames, [ "timeZoneName" ], yearMonthDefaultShapeFields, {
5961
+ const transformYearMonthOptions = /*@__PURE__*/ createOptionsTransformer([ "year", "month", "dateStyle" ], yearMonthIgnoredFieldNames, [ "timeZoneName" ], {
5962
+ year: "numeric",
5963
+ month: "numeric"
5964
+ }, {
5616
5965
  full: {
5617
5966
  year: "numeric",
5618
5967
  month: "long"
@@ -5631,7 +5980,10 @@ const transformYearMonthOptions = /*@__PURE__*/ createOptionsTransformer([ "year
5631
5980
  }
5632
5981
  });
5633
5982
 
5634
- const transformMonthDayOptions = /*@__PURE__*/ createOptionsTransformer([ "month", "day", "dateStyle" ], monthDayIgnoredFieldNames, [ "timeZoneName", "era" ], monthDayDefaultShapeFields, {
5983
+ const transformMonthDayOptions = /*@__PURE__*/ createOptionsTransformer([ "month", "day", "dateStyle" ], monthDayIgnoredFieldNames, [ "timeZoneName", "era" ], {
5984
+ month: "numeric",
5985
+ day: "numeric"
5986
+ }, {
5635
5987
  full: {
5636
5988
  month: "long",
5637
5989
  day: "numeric"
@@ -5662,7 +6014,7 @@ function zonedDateTimeWithPlainTime(zonedDateTimeSlots, plainTimeFields) {
5662
6014
 
5663
6015
  function getCurrentIsoDateTime(timeZone) {
5664
6016
  const epochNano = getCurrentEpochNano();
5665
- const offsetNano = timeZone.C(epochNano);
6017
+ const offsetNano = timeZone.B(epochNano);
5666
6018
  return epochNanoToIsoDateTime(epochNano + BigInt(offsetNano));
5667
6019
  }
5668
6020
 
@@ -5683,29 +6035,36 @@ function createDateTimeFormatShell(createArgsProvider, transformOptions = identi
5683
6035
  class ShimDateTimeFormat {
5684
6036
  constructor(locales, options = Object.create(null)) {
5685
6037
  const transformedOptions = transformOptions(options);
5686
- const baseFormat = new RawDateTimeFormat(locales, transformedOptions);
6038
+ const observedOptionNames = [];
6039
+ const trackedOptions = new Proxy(Object.create(null), {
6040
+ get(_target, name) {
6041
+ const value = transformedOptions[name];
6042
+ return void 0 !== value && observedOptionNames.push(name), value;
6043
+ }
6044
+ });
6045
+ const baseFormat = new RawDateTimeFormat(locales, trackedOptions);
5687
6046
  const resolvedOptions = baseFormat.resolvedOptions();
5688
- const copiedOptions = pluckProps(Object.keys(options), resolvedOptions);
6047
+ const copiedOptions = pluckProps(observedOptionNames, resolvedOptions);
5689
6048
  internalsMap.set(this, {
5690
- ee: createArgsProvider({
6049
+ Z: createArgsProvider({
5691
6050
  t: baseFormat,
5692
- Ge: resolvedOptions.locale,
5693
- I: copiedOptions,
5694
- Je: transformedOptions
6051
+ ze: resolvedOptions.locale,
6052
+ F: copiedOptions,
6053
+ Ce: transformedOptions
5695
6054
  }),
5696
6055
  t: baseFormat
5697
6056
  });
5698
6057
  }
5699
6058
  get format() {
5700
6059
  const internals = getInternals(this);
5701
- return internals.ze || (internals.ze = record => {
5702
- const [format, ...rest] = internals.ee.B(record);
6060
+ return internals.qe || (internals.qe = record => {
6061
+ const [format, ...rest] = internals.Z.A(record);
5703
6062
  return format.format(...rest);
5704
6063
  });
5705
6064
  }
5706
6065
  formatToParts(record) {
5707
- const {ee: argsProvider} = getInternals(this);
5708
- const [format, ...rest] = argsProvider.B(record);
6066
+ const {Z: argsProvider} = getInternals(this);
6067
+ const [format, ...rest] = argsProvider.A(record);
5709
6068
  return format.formatToParts(...rest);
5710
6069
  }
5711
6070
  resolvedOptions() {
@@ -5718,13 +6077,13 @@ function createDateTimeFormatShell(createArgsProvider, transformOptions = identi
5718
6077
  }
5719
6078
  RawDateTimeFormat.prototype.formatRange && Object.defineProperties(prototype, createPropDescriptors({
5720
6079
  formatRange(record0, record1) {
5721
- const {ee: argsProvider} = getInternals(this);
5722
- const [format, epochMilli0, epochMilli1] = argsProvider.A(record0, record1);
6080
+ const {Z: argsProvider} = getInternals(this);
6081
+ const [format, epochMilli0, epochMilli1] = argsProvider.v(record0, record1);
5723
6082
  return format.formatRange(epochMilli0, epochMilli1);
5724
6083
  },
5725
6084
  formatRangeToParts(record0, record1) {
5726
- const {ee: argsProvider} = getInternals(this);
5727
- const [format, epochMilli0, epochMilli1] = argsProvider.A(record0, record1);
6085
+ const {Z: argsProvider} = getInternals(this);
6086
+ const [format, epochMilli0, epochMilli1] = argsProvider.v(record0, record1);
5728
6087
  return format.formatRangeToParts(epochMilli0, epochMilli1);
5729
6088
  }
5730
6089
  }));
@@ -5753,20 +6112,13 @@ const InstantBranding = "Instant";
5753
6112
  const DurationBranding = "Duration";
5754
6113
 
5755
6114
  function defineTemporalClass(branding, cls, getSlots, ...getterMaps) {
5756
- Object.defineProperties(cls, createNameDescriptors(branding)), Object.defineProperties(cls.prototype, createStringTagDescriptors("Temporal." + branding));
5757
- for (const getterMap of getterMaps) {
5758
- defineSlotGetters(cls.prototype, getSlots, getterMap);
5759
- }
5760
- return cls;
5761
- }
5762
-
5763
- function defineSlotGetters(destPrototype, getSlots, getterMap) {
5764
- Object.defineProperties(destPrototype, mapProps(getter => ({
6115
+ return Object.defineProperties(cls, createNameDescriptors(branding)), Object.defineProperties(cls.prototype, createStringTagDescriptors("Temporal." + branding)),
6116
+ Object.defineProperties(cls.prototype, mapProps(getter => ({
5765
6117
  get() {
5766
6118
  return getter(getSlots(this));
5767
6119
  },
5768
6120
  configurable: 1
5769
- }), getterMap));
6121
+ }), Object.assign({}, ...getterMaps))), cls;
5770
6122
  }
5771
6123
 
5772
6124
  const attachDebugString = "noop" === noop.name ? instance => {
@@ -5884,40 +6236,40 @@ createNativeGetters(yearMonthDerivedGetters), createNativeGetters(dateDerivedGet
5884
6236
 
5885
6237
  function createDateTimeFormatClass(getTemporalBrandingAndSlots) {
5886
6238
  return createDateTimeFormatShell(internals => {
5887
- const getTemporalFormat = memoize(branding => ((internals, branding) => {
6239
+ const getTemporalFormat = memoize(branding => {
5888
6240
  let options;
5889
6241
  switch (branding) {
5890
6242
  case InstantBranding:
5891
- options = transformInstantOptions(internals.I, 1);
6243
+ options = transformInstantOptions(internals.F, 1);
5892
6244
  break;
5893
6245
 
5894
6246
  case PlainDateTimeBranding:
5895
- options = applyPlainFormatTimeZone(transformDateTimeOptions(internals.I, 1));
6247
+ options = applyPlainFormatTimeZone(transformDateTimeOptions(internals.F, 1));
5896
6248
  break;
5897
6249
 
5898
6250
  case PlainDateBranding:
5899
- options = applyPlainFormatTimeZone(transformDateOptions(internals.I, 1));
6251
+ options = applyPlainFormatTimeZone(transformDateOptions(internals.F, 1));
5900
6252
  break;
5901
6253
 
5902
6254
  case PlainTimeBranding:
5903
- options = applyPlainFormatTimeZone(transformTimeOptions(internals.I, 1));
6255
+ options = applyPlainFormatTimeZone(transformTimeOptions(internals.F, 1));
5904
6256
  break;
5905
6257
 
5906
6258
  case PlainYearMonthBranding:
5907
- options = applyPlainFormatTimeZone(transformYearMonthOptions(internals.I, 1));
6259
+ options = applyPlainFormatTimeZone(transformYearMonthOptions(internals.F, 1));
5908
6260
  break;
5909
6261
 
5910
6262
  case PlainMonthDayBranding:
5911
- options = applyPlainFormatTimeZone(transformMonthDayOptions(internals.I, 1));
6263
+ options = applyPlainFormatTimeZone(transformMonthDayOptions(internals.F, 1));
5912
6264
  break;
5913
6265
 
5914
6266
  default:
5915
6267
  throwTypeError(invalidFormatType(branding));
5916
6268
  }
5917
- return new RawDateTimeFormat(internals.Ge, options);
5918
- })(internals, branding));
6269
+ return new RawDateTimeFormat(internals.ze, options);
6270
+ });
5919
6271
  return {
5920
- B(formattable) {
6272
+ A(formattable) {
5921
6273
  if (void 0 === formattable) {
5922
6274
  return [ internals.t ];
5923
6275
  }
@@ -5929,7 +6281,7 @@ function createDateTimeFormatClass(getTemporalBrandingAndSlots) {
5929
6281
  const format = getTemporalFormat(branding);
5930
6282
  return checkTemporalDateTimeFormatCompatible(format, branding, slots), [ format, temporalDateTimeToEpochMilli(branding, slots) ];
5931
6283
  },
5932
- A(start, end) {
6284
+ v(start, end) {
5933
6285
  void 0 !== start && void 0 !== end || throwTypeError(mismatchingFormatTypes);
5934
6286
  const startBrandingAndSlots = getTemporalBrandingAndSlots(start);
5935
6287
  const startEpochMilli = startBrandingAndSlots ? void 0 : Number(start);
@@ -6012,7 +6364,7 @@ const ZonedDateTime = /*@__PURE__*/ defineTemporalClass(ZonedDateTimeBranding, c
6012
6364
  return createZonedDateTime(toZonedDateTimeSlots(arg, options));
6013
6365
  }
6014
6366
  static compare(arg0, arg1) {
6015
- return compareZonedDateTimes(toZonedDateTimeSlots(arg0), toZonedDateTimeSlots(arg1));
6367
+ return compareZonedEpochSlots(toZonedDateTimeSlots(arg0), toZonedDateTimeSlots(arg1));
6016
6368
  }
6017
6369
  get calendarId() {
6018
6370
  return getCalendarSlotId(getZonedDateTimeSlots(this).calendar);
@@ -6182,7 +6534,7 @@ const Instant = /*@__PURE__*/ defineTemporalClass(InstantBranding, class {
6182
6534
  return createInstant(epochNanoToInstant(epochNano));
6183
6535
  }
6184
6536
  static compare(a, b) {
6185
- return compareInstants(toInstantSlots(a), toInstantSlots(b));
6537
+ return compareZonedEpochSlots(toInstantSlots(a), toInstantSlots(b));
6186
6538
  }
6187
6539
  get epochMilliseconds() {
6188
6540
  return getEpochMilli(getInstantSlots(this));
@@ -8122,7 +8474,73 @@ class NOAACalculator {
8122
8474
  }
8123
8475
  }
8124
8476
 
8125
- var citiesJson = ["Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27","Atlanta|US|33.749|-84.38798|America/New_York|336","Austin|US|30.26715|-97.74306|America/Chicago|165","Baghdad|IQ|33.34058|44.40088|Asia/Baghdad|41","Beer Sheva|IL|31.25181|34.7913|Asia/Jerusalem|285","Berlin|DE|52.52437|13.41053|Europe/Berlin|43","Baltimore|US|39.29038|-76.61219|America/New_York|35","Bogota|CO|4.60971|-74.08175|America/Bogota|2582","Boston|US|42.35843|-71.05977|America/New_York|38","Budapest|HU|47.49801|19.03991|Europe/Budapest|104","Buenos Aires|AR|-34.61315|-58.37723|America/Argentina/Buenos_Aires|31","Buffalo|US|42.88645|-78.87837|America/New_York|191","Chicago|US|41.85003|-87.65005|America/Chicago|180","Cincinnati|US|39.162|-84.45689|America/New_York|267","Cleveland|US|41.4995|-81.69541|America/New_York|204","Dallas|US|32.78306|-96.80667|America/Chicago|139","Denver|US|39.73915|-104.9847|America/Denver|1636","Detroit|US|42.33143|-83.04575|America/Detroit|192","Eilat|IL|29.55805|34.94821|Asia/Jerusalem|63","Gibraltar|GI|36.14474|-5.35257|Europe/Gibraltar|11","Haifa|IL|32.81841|34.9885|Asia/Jerusalem|40","Hawaii|US|21.30694|-157.85833|Pacific/Honolulu|18","Helsinki|FI|60.16952|24.93545|Europe/Helsinki|26","Houston|US|29.76328|-95.36327|America/Chicago|30","Jerusalem|IL|31.76904|35.21633|Asia/Jerusalem|786","Johannesburg|ZA|-26.20227|28.04363|Africa/Johannesburg|1767","Kiev|UA|50.45466|30.5238|Europe/Kiev|187","La Paz|BO|-16.5|-68.15|America/La_Paz|3782","Livingston|US|40.79593|-74.31487|America/New_York|98","Las Vegas|US|36.17497|-115.13722|America/Los_Angeles|613","London|GB|51.50853|-0.12574|Europe/London|25","Los Angeles|US|34.05223|-118.24368|America/Los_Angeles|96","Marseilles|FR|43.29695|5.38107|Europe/Paris|28","Miami|US|25.77427|-80.19366|America/New_York|25","Minneapolis|US|44.97997|-93.26384|America/Chicago|262","Melbourne|AU|-37.814|144.96332|Australia/Melbourne|25","Mexico City|MX|19.42847|-99.12766|America/Mexico_City|2240","Montreal|CA|45.50884|-73.58781|America/Toronto|216","Moscow|RU|55.75222|37.61556|Europe/Moscow|144","New York|US|40.71427|-74.00597|America/New_York|57","Omaha|US|41.25861|-95.93779|America/Chicago|315","Ottawa|CA|45.41117|-75.69812|America/Toronto|71","Panama City|PA|8.9936|-79.51973|America/Panama|17","Paris|FR|48.85341|2.3488|Europe/Paris|42","Pawtucket|US|41.87871|-71.38256|America/New_York|0","Petach Tikvah|IL|32.08707|34.88747|Asia/Jerusalem|54","Philadelphia|US|39.95233|-75.16379|America/New_York|8","Phoenix|US|33.44838|-112.07404|America/Phoenix|366","Pittsburgh|US|40.44062|-79.99589|America/New_York|239","Providence|US|41.82399|-71.41283|America/New_York|0","Portland|US|45.52345|-122.67621|America/Los_Angeles|15","Saint Louis|US|38.62727|-90.19789|America/Chicago|149","Saint Petersburg|RU|59.93863|30.31413|Europe/Moscow|11","San Diego|US|32.71533|-117.15726|America/Los_Angeles|20","San Francisco|US|37.77493|-122.41942|America/Los_Angeles|28","Sao Paulo|BR|-23.5475|-46.63611|America/Sao_Paulo|769","Seattle|US|47.60621|-122.33207|America/Los_Angeles|56","Sydney|AU|-33.86785|151.20732|Australia/Sydney|58","Tel Aviv|IL|32.08088|34.78057|Asia/Jerusalem|15","Tiberias|IL|32.79221|35.53124|Asia/Jerusalem|0","Toronto|CA|43.70011|-79.4163|America/Toronto|175","Vancouver|CA|49.24966|-123.11934|America/Vancouver|70","White Plains|US|41.03399|-73.76291|America/New_York|82","Washington DC|US|38.89511|-77.03637|America/New_York|6","Worcester|US|42.26259|-71.80229|America/New_York|164"];
8477
+ var citiesJson = [
8478
+ "Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27",
8479
+ "Atlanta|US|33.749|-84.38798|America/New_York|336",
8480
+ "Austin|US|30.26715|-97.74306|America/Chicago|165",
8481
+ "Baghdad|IQ|33.34058|44.40088|Asia/Baghdad|41",
8482
+ "Beer Sheva|IL|31.25181|34.7913|Asia/Jerusalem|285",
8483
+ "Berlin|DE|52.52437|13.41053|Europe/Berlin|43",
8484
+ "Baltimore|US|39.29038|-76.61219|America/New_York|35",
8485
+ "Bogota|CO|4.60971|-74.08175|America/Bogota|2582",
8486
+ "Boston|US|42.35843|-71.05977|America/New_York|38",
8487
+ "Budapest|HU|47.49801|19.03991|Europe/Budapest|104",
8488
+ "Buenos Aires|AR|-34.61315|-58.37723|America/Argentina/Buenos_Aires|31",
8489
+ "Buffalo|US|42.88645|-78.87837|America/New_York|191",
8490
+ "Chicago|US|41.85003|-87.65005|America/Chicago|180",
8491
+ "Cincinnati|US|39.162|-84.45689|America/New_York|267",
8492
+ "Cleveland|US|41.4995|-81.69541|America/New_York|204",
8493
+ "Dallas|US|32.78306|-96.80667|America/Chicago|139",
8494
+ "Denver|US|39.73915|-104.9847|America/Denver|1636",
8495
+ "Detroit|US|42.33143|-83.04575|America/Detroit|192",
8496
+ "Eilat|IL|29.55805|34.94821|Asia/Jerusalem|63",
8497
+ "Gibraltar|GI|36.14474|-5.35257|Europe/Gibraltar|11",
8498
+ "Haifa|IL|32.81841|34.9885|Asia/Jerusalem|40",
8499
+ "Hawaii|US|21.30694|-157.85833|Pacific/Honolulu|18",
8500
+ "Helsinki|FI|60.16952|24.93545|Europe/Helsinki|26",
8501
+ "Houston|US|29.76328|-95.36327|America/Chicago|30",
8502
+ "Jerusalem|IL|31.76904|35.21633|Asia/Jerusalem|786",
8503
+ "Johannesburg|ZA|-26.20227|28.04363|Africa/Johannesburg|1767",
8504
+ "Kiev|UA|50.45466|30.5238|Europe/Kiev|187",
8505
+ "La Paz|BO|-16.5|-68.15|America/La_Paz|3782",
8506
+ "Livingston|US|40.79593|-74.31487|America/New_York|98",
8507
+ "Las Vegas|US|36.17497|-115.13722|America/Los_Angeles|613",
8508
+ "London|GB|51.50853|-0.12574|Europe/London|25",
8509
+ "Los Angeles|US|34.05223|-118.24368|America/Los_Angeles|96",
8510
+ "Marseilles|FR|43.29695|5.38107|Europe/Paris|28",
8511
+ "Miami|US|25.77427|-80.19366|America/New_York|25",
8512
+ "Minneapolis|US|44.97997|-93.26384|America/Chicago|262",
8513
+ "Melbourne|AU|-37.814|144.96332|Australia/Melbourne|25",
8514
+ "Mexico City|MX|19.42847|-99.12766|America/Mexico_City|2240",
8515
+ "Montreal|CA|45.50884|-73.58781|America/Toronto|216",
8516
+ "Moscow|RU|55.75222|37.61556|Europe/Moscow|144",
8517
+ "New York|US|40.71427|-74.00597|America/New_York|57",
8518
+ "Omaha|US|41.25861|-95.93779|America/Chicago|315",
8519
+ "Ottawa|CA|45.41117|-75.69812|America/Toronto|71",
8520
+ "Panama City|PA|8.9936|-79.51973|America/Panama|17",
8521
+ "Paris|FR|48.85341|2.3488|Europe/Paris|42",
8522
+ "Pawtucket|US|41.87871|-71.38256|America/New_York|0",
8523
+ "Petach Tikvah|IL|32.08707|34.88747|Asia/Jerusalem|54",
8524
+ "Philadelphia|US|39.95233|-75.16379|America/New_York|8",
8525
+ "Phoenix|US|33.44838|-112.07404|America/Phoenix|366",
8526
+ "Pittsburgh|US|40.44062|-79.99589|America/New_York|239",
8527
+ "Providence|US|41.82399|-71.41283|America/New_York|0",
8528
+ "Portland|US|45.52345|-122.67621|America/Los_Angeles|15",
8529
+ "Saint Louis|US|38.62727|-90.19789|America/Chicago|149",
8530
+ "Saint Petersburg|RU|59.93863|30.31413|Europe/Moscow|11",
8531
+ "San Diego|US|32.71533|-117.15726|America/Los_Angeles|20",
8532
+ "San Francisco|US|37.77493|-122.41942|America/Los_Angeles|28",
8533
+ "Sao Paulo|BR|-23.5475|-46.63611|America/Sao_Paulo|769",
8534
+ "Seattle|US|47.60621|-122.33207|America/Los_Angeles|56",
8535
+ "Sydney|AU|-33.86785|151.20732|Australia/Sydney|58",
8536
+ "Tel Aviv|IL|32.08088|34.78057|Asia/Jerusalem|15",
8537
+ "Tiberias|IL|32.79221|35.53124|Asia/Jerusalem|0",
8538
+ "Toronto|CA|43.70011|-79.4163|America/Toronto|175",
8539
+ "Vancouver|CA|49.24966|-123.11934|America/Vancouver|70",
8540
+ "White Plains|US|41.03399|-73.76291|America/New_York|82",
8541
+ "Washington DC|US|38.89511|-77.03637|America/New_York|6",
8542
+ "Worcester|US|42.26259|-71.80229|America/New_York|164"
8543
+ ];
8126
8544
 
8127
8545
  class QuickLRU extends Map {
8128
8546
  #size = 0;
@@ -8526,7 +8944,7 @@ function initClassicCities() {
8526
8944
  *
8527
8945
  * Extends {@link GeoLocation} from `@hebcal/noaa` with Jewish-calendar
8528
8946
  * specific data: an Israel/Diaspora flag, ISO country code, and an optional
8529
- * geographic identifier. Also provides {@link Location.lookup} for ~60
8947
+ * geographic identifier. Also provides {@link Location.lookup} for the 65
8530
8948
  * built-in "classic" Hebcal cities.
8531
8949
  *
8532
8950
  * @example
@@ -8591,8 +9009,14 @@ class Location extends GeoLocation {
8591
9009
  /**
8592
9010
  * Returns the full descriptive location name passed to the constructor,
8593
9011
  * or `null` if no name was provided.
9012
+ *
9013
+ * Note that the built-in classic cities are named by city alone, so
9014
+ * `getName()` and {@link getShortName} return the same string for them.
8594
9015
  * @example
8595
- * Location.lookup('San Francisco')?.getName(); // 'San Francisco, California, USA'
9016
+ * const loc = new Location(41.85003, -87.65005, false,
9017
+ * 'America/Chicago', 'Chicago, Illinois, USA', 'US');
9018
+ * loc.getName(); // 'Chicago, Illinois, USA'
9019
+ * Location.lookup('San Francisco')?.getName(); // 'San Francisco'
8596
9020
  */
8597
9021
  getName() {
8598
9022
  return this.getLocationName();
@@ -8601,11 +9025,15 @@ class Location extends GeoLocation {
8601
9025
  * Returns the location name truncated at the first comma. Useful for
8602
9026
  * compact display where only the city name is desired.
8603
9027
  *
8604
- * Special-cased so that US locations of the form `"Washington, DC"` or
9028
+ * Special-cased so that US locations of the form `"Washington, DC ..."` or
8605
9029
  * `"Washington, D.C., ..."` keep the `DC` / `D.C.` suffix attached.
8606
9030
  * @example
8607
- * Location.lookup('San Francisco')?.getShortName(); // 'San Francisco'
8608
- * Location.lookup('Washington DC')?.getShortName(); // 'Washington, DC'
9031
+ * const chi = new Location(41.85003, -87.65005, false,
9032
+ * 'America/Chicago', 'Chicago, Illinois, USA', 'US');
9033
+ * chi.getShortName(); // 'Chicago'
9034
+ * const dc = new Location(38.89511, -77.03637, false,
9035
+ * 'America/New_York', 'Washington, D.C., USA', 'US');
9036
+ * dc.getShortName(); // 'Washington, D.C.'
8609
9037
  */
8610
9038
  getShortName() {
8611
9039
  const name = this.getLocationName();
@@ -8659,7 +9087,7 @@ class Location extends GeoLocation {
8659
9087
  return this.geoid;
8660
9088
  }
8661
9089
  /**
8662
- * Creates a location object from one of 60 "classic" Hebcal city names.
9090
+ * Creates a location object from one of 65 "classic" Hebcal city names.
8663
9091
  * The following city names are supported:
8664
9092
  * 'Ashdod', 'Atlanta', 'Austin', 'Baghdad', 'Beer Sheva',
8665
9093
  * 'Berlin', 'Baltimore', 'Bogota', 'Boston', 'Budapest',
@@ -8764,13 +9192,15 @@ class Location extends GeoLocation {
8764
9192
  * location with the same (lower-cased) name is already registered, and
8765
9193
  * `true` if successfully added.
8766
9194
  *
8767
- * Use this to extend the built-in set of ~60 classic Hebcal cities with
9195
+ * Use this to extend the built-in set of 65 classic Hebcal cities with
8768
9196
  * your own custom locations.
8769
9197
  * @example
8770
9198
  * const tlv = new Location(32.0853, 34.7818, true,
8771
- * 'Asia/Tel_Aviv', 'My Office, Tel Aviv', 'IL');
9199
+ * 'Asia/Jerusalem', 'My Office, Tel Aviv', 'IL');
8772
9200
  * Location.addLocation('My Office', tlv); // true
8773
- * Location.lookup('my office')?.getTzid(); // 'Asia/Tel_Aviv'
9201
+ * Location.lookup('my office')?.getTzid(); // 'Asia/Jerusalem'
9202
+ * @param cityName name to register the location under (case insensitive)
9203
+ * @param location the `Location` instance to register
8774
9204
  */
8775
9205
  static addLocation(cityName, location) {
8776
9206
  const name = cityName.toLowerCase();
@@ -8797,10 +9227,22 @@ const hour12cc = {
8797
9227
  ZA: 1,
8798
9228
  };
8799
9229
  /**
8800
- * @private
9230
+ * Helper function to format a 24-hour (00:00-23:59) time string in either
9231
+ * 12-hour US format (e.g. `"8:13pm"`) or keep it in 24-hour format (e.g.
9232
+ * `"20:13"`) for any other locale or country.
9233
+ *
9234
+ * The locale (and therefore default behavior) is derived from
9235
+ * `options.location` / `options.locale`. The `options.hour12` override
9236
+ * takes precedence: if `false`, locale is ignored and the result is always
9237
+ * 24-hour; if `true`, locale is ignored and the result is always 12-hour.
9238
+ * @example
9239
+ * import {reformatTimeStr, Location} from '@hebcal/core';
9240
+ * const opts = {location: Location.lookup('Chicago')};
9241
+ * reformatTimeStr('20:30', 'pm', opts); // '8:30pm'
9242
+ * reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'
8801
9243
  * @param timeStr - original time like "20:30"
8802
9244
  * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
8803
- * @param options
9245
+ * @param options optional; `location`, `locale` and `hour12` are consulted
8804
9246
  */
8805
9247
  function reformatTimeStr(timeStr, suffix, options) {
8806
9248
  if (typeof timeStr !== 'string')
@@ -8885,6 +9327,17 @@ function getChalakimSinceMoladTohu(year, month) {
8885
9327
  function moladToAbsDate(chalakim) {
8886
9328
  return Math.trunc(chalakim / CHALAKIM_PER_DAY) + JEWISH_EPOCH;
8887
9329
  }
9330
+ /**
9331
+ * Calculates the molad (birth of the new moon) for a Hebrew month using
9332
+ * traditional chalakim arithmetic.
9333
+ *
9334
+ * Returns the raw components — day of week, hour, minutes and chalakim. Use
9335
+ * {@link Molad} for a higher-level interface with rendering and Kiddush Levana
9336
+ * times.
9337
+ * @param year Hebrew year
9338
+ * @param month Hebrew month (see `months` from `@hebcal/hdate`)
9339
+ * @return the components of the molad for that month
9340
+ */
8888
9341
  function calculateMolad(year, month) {
8889
9342
  const chalakim = getChalakimSinceMoladTohu(year, month);
8890
9343
  const absDate = moladToAbsDate(chalakim);
@@ -8911,20 +9364,23 @@ function calculateMolad(year, month) {
8911
9364
  /** constant for milliseconds in a minute (60,000) */
8912
9365
  const MINUTE_MILLIS = 60 * 1000;
8913
9366
  /**
8914
- * A method that will return the location's local mean time offset in milliseconds from local <a
8915
- * href="https://en.wikipedia.org/wiki/Standard_time">standard time</a>. The globe is split into 360&deg;, with
8916
- * 15&deg; per hour of the day. For a local that is at a longitude that is evenly divisible by 15 (longitude % 15 ==
8917
- * 0), at solar {@link com.kosherjava.zmanim.AstronomicalCalendar#getSunTransit() noon} (with adjustment for the <a
8918
- * href="https://en.wikipedia.org/wiki/Equation_of_time">equation of time</a>) the sun should be directly overhead,
8919
- * so a user who is 1&deg; west of this will have noon at 4 minutes after standard time noon, and conversely, a user
8920
- * who is 1&deg; east of the 15&deg; longitude will have noon at 11:56 AM. Lakewood, N.J., whose longitude is
8921
- * -74.222, is 0.778 away from the closest multiple of 15 at -75&deg;. This is multiplied by 4 to yield 3 minutes
8922
- * and 10 seconds earlier than standard time. The offset returned does not account for the <a
8923
- * href="https://en.wikipedia.org/wiki/Daylight_saving_time">Daylight saving time</a> offset since this class is
9367
+ * A method that will return the location's local mean time offset in milliseconds from local
9368
+ * [standard time](https://en.wikipedia.org/wiki/Standard_time). The globe is split into 360°, with
9369
+ * 15° per hour of the day. For a locale that is at a longitude that is evenly divisible by 15
9370
+ * (longitude % 15 == 0), at solar noon (with adjustment for the
9371
+ * [equation of time](https://en.wikipedia.org/wiki/Equation_of_time)) the sun should be directly overhead,
9372
+ * so a user who is 1° west of this will have noon at 4 minutes after standard time noon, and conversely, a user
9373
+ * who is 1° east of the 15° longitude will have noon at 11:56 AM. Lakewood, N.J., whose longitude is
9374
+ * -74.222, is 0.778 away from the closest multiple of 15 at -75°. This is multiplied by 4 to yield 3 minutes
9375
+ * and 10 seconds earlier than standard time. The offset returned does not account for the
9376
+ * [Daylight saving time](https://en.wikipedia.org/wiki/Daylight_saving_time) offset since this function is
8924
9377
  * unaware of dates.
8925
9378
  *
9379
+ * @param dt the date used to resolve the timezone offset
9380
+ * @param longitude the location's longitude
9381
+ * @param tzid IANA timezone identifier
8926
9382
  * @return the offset in milliseconds not accounting for Daylight saving time. A positive value will be returned
8927
- * East of the 15&deg; timezone line, and a negative value West of it.
9383
+ * East of the 15° timezone line, and a negative value West of it.
8928
9384
  */
8929
9385
  function getLocalMeanTimeOffset(dt, longitude, tzid) {
8930
9386
  const offset = -1 * getTimezoneOffset(tzid, dt);
@@ -8932,13 +9388,17 @@ function getLocalMeanTimeOffset(dt, longitude, tzid) {
8932
9388
  return Math.trunc(d);
8933
9389
  }
8934
9390
  /**
8935
- * Returns the molad in UTC as a Temporal.ZonedDateTime.
8936
- * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude
8937
- * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method
8938
- * intentionally uses standard time and not daylight savings time.
9391
+ * Returns the moment of the molad as a `Temporal.ZonedDateTime` in the `UTC` zone.
8939
9392
  *
8940
- * @return the ZonedDateTime representing the moment of the molad in UTC
8941
-
9393
+ * The molad is computed in Jerusalem *standard* time and then converted, so the
9394
+ * returned instant is correct year-round; only the zone of the returned object
9395
+ * is `UTC`. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds)
9396
+ * from the computed time — Har Habayis, at longitude 35.2354°, is 5.2354° away
9397
+ * from the multiple-of-15 timezone longitude — to get to standard time. Daylight
9398
+ * savings time is intentionally not applied; adjust when formatting for display.
9399
+ *
9400
+ * @param molad the molad to convert
9401
+ * @return the `Temporal.ZonedDateTime` representing the moment of the molad
8942
9402
  */
8943
9403
  function getMoladAsDate(molad) {
8944
9404
  const moladSeconds = (molad.chalakim * 10) / 3;
@@ -9033,8 +9493,8 @@ function getHebrewTimeOfDay(hour) {
9033
9493
  * import {Molad, months} from '@hebcal/core';
9034
9494
  * const m = new Molad(5784, months.NISAN);
9035
9495
  * console.log(m.getMonthName()); // 'Nisan'
9036
- * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // e.g. 1 31 12
9037
- * console.log(m.render('en')); // 'Molad Nisan: Mon, 1:31am and 12 chalakim'
9496
+ * console.log(m.getHour(), m.getMinutes(), m.getChalakim()); // 22 57 7
9497
+ * console.log(m.render('en')); // 'Molad Nisan: Monday, 10:57pm and 7 chalakim'
9038
9498
  */
9039
9499
  class Molad {
9040
9500
  /**
@@ -9102,17 +9562,21 @@ class Molad {
9102
9562
  return this.m.chalakim;
9103
9563
  }
9104
9564
  /**
9105
- * Returns the molad in Standard Time in Yerushalayim as a `Temporal.ZonedDateTime`.
9106
- * This method subtracts 20.94 minutes (20 minutes and 56.496 seconds) from the computed time (Har Habayis with a longitude
9107
- * of 35.2354&deg; is 5.2354&deg; away from the %15 timezone longitude) to get to standard time. This method
9108
- * intentionally uses standard time and not daylight savings time.
9565
+ * Returns the moment of the molad as a `Temporal.ZonedDateTime` in the `UTC` zone.
9566
+ *
9567
+ * The molad is computed in Jerusalem *standard* time and then converted, so the
9568
+ * returned instant is correct year-round; only the zone of the returned object
9569
+ * is `UTC`. This method subtracts 20.94 minutes (20 minutes and 56.496 seconds)
9570
+ * from the computed time — Har Habayis, at longitude 35.2354°, is 5.2354° away
9571
+ * from the multiple-of-15 timezone longitude — to get to standard time. Daylight
9572
+ * savings time is intentionally not applied; adjust when formatting for display.
9109
9573
  *
9110
9574
  * The returned value is cached after the first call.
9111
9575
  * @example
9112
9576
  * import {Molad, months} from '@hebcal/core';
9113
9577
  * const m = new Molad(5784, months.NISAN);
9114
9578
  * const zdt = m.getInstant();
9115
- * console.log(zdt.toString()); // e.g. '2024-04-08T17:21:13.333+00:00[UTC]'
9579
+ * console.log(zdt.toString()); // '2024-04-08T20:36:26.837+00:00[UTC]'
9116
9580
  * @return the `Temporal.ZonedDateTime` representing the moment of the molad
9117
9581
  */
9118
9582
  getInstant() {
@@ -9131,9 +9595,9 @@ class Molad {
9131
9595
  return zdt.add({ hours: 72 });
9132
9596
  }
9133
9597
  /**
9134
- * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the <a
9135
- * href="https://en.wikipedia.org/wiki/Yosef_Karo">Mechaber</a>. See the <a
9136
- * href="https://en.wikipedia.org/wiki/Yoel_Sirkis">Bach's</a> opinion on this time. This method returns the time
9598
+ * Returns the earliest time of Kiddush Levana calculated as 7 days after the molad as mentioned by the
9599
+ * [Mechaber](https://en.wikipedia.org/wiki/Yosef_Karo). See the
9600
+ * [Bach's](https://en.wikipedia.org/wiki/Yoel_Sirkis) opinion on this time. This method returns the time
9137
9601
  * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
9138
9602
  * displaying the next _tzais_ if the zman is between _alos_ and _tzais_.
9139
9603
  *
@@ -9144,8 +9608,8 @@ class Molad {
9144
9608
  return zdt.add({ hours: 168 });
9145
9609
  }
9146
9610
  /**
9147
- * Returns the latest time of Kiddush Levana according to the <a
9148
- * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
9611
+ * Returns the latest time of Kiddush Levana according to the
9612
+ * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as
9149
9613
  * halfway between molad and molad. This adds half the 29 days, 12 hours and 793 chalakim time between molad and
9150
9614
  * molad (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's molad. This method returns the time
9151
9615
  * even if it is during the day when _Kiddush Levana_ can't be said. Callers of this method should consider
@@ -9168,12 +9632,12 @@ class Molad {
9168
9632
  /**
9169
9633
  * Returns the latest time of Kiddush Levana calculated as 15 days after the molad. This is the opinion brought down
9170
9634
  * in the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
9171
- * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
9172
- * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
9173
- * {@link Molad.getSofZmanKidushLevanaBetweenMoldos() half way between molad and mold} is of the opinion that Mechaber
9635
+ * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles) who brings down the opinion of the
9636
+ * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating
9637
+ * {@link Molad.getSofZmanKidushLevanaBetweenMoldos | half way between molad and molad} is of the opinion that Mechaber
9174
9638
  * agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject, See Rabbi Dovid
9175
- * Heber's very detailed writeup in Siman Daled (chapter 4) of <a
9176
- * href="https://www.worldcat.org/oclc/461326125">Shaarei Zmanim</a>. This method returns the time even if it is during
9639
+ * Heber's very detailed writeup in Siman Daled (chapter 4) of
9640
+ * [Shaarei Zmanim](https://www.worldcat.org/oclc/461326125). This method returns the time even if it is during
9177
9641
  * the day when _Kiddush Levana_ can't be said. Callers of this method should consider displaying _alos_
9178
9642
  * before this time if the zman is between _alos_ and _tzais_.
9179
9643
  *
@@ -9190,14 +9654,16 @@ class Molad {
9190
9654
  * month name, day of week, hour : minute, and chalakim if non-zero.
9191
9655
  *
9192
9656
  * Time format honors `options.hour12` and `options.location` (12-hour vs.
9193
- * 24-hour); see {@link HebrewCalendar.reformatTimeStr}.
9657
+ * 24-hour); see {@link reformatTimeStr}.
9194
9658
  * @example
9195
9659
  * import {Molad, months} from '@hebcal/core';
9196
9660
  * const m = new Molad(5784, months.NISAN);
9197
9661
  * m.render('en', {hour12: true});
9198
- * // => 'Molad Nisan: Mon, 7:21pm and 6 chalakim'
9662
+ * // => 'Molad Nisan: Monday, 10:57pm and 7 chalakim'
9663
+ * m.render('en', {hour12: false});
9664
+ * // => 'Molad Nisan: Monday, 22:57 and 7 chalakim'
9199
9665
  * m.render('he');
9200
- * // => 'מוֹלָד נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …'
9666
+ * // => 'מוֹלָד הָלְּבָנָה נִיסָן יִהְיֶה בַּיּוֹם שֵׁנִי בשָׁבוּעַ, …'
9201
9667
  * @param [locale] Optional locale name (defaults to empty locale)
9202
9668
  * @param options used for time formatting (12-hour vs 24-hour)
9203
9669
  */
@@ -9269,16 +9735,16 @@ function zdtToDate(zdt) {
9269
9735
  return res;
9270
9736
  }
9271
9737
  /**
9272
- * The zenith of astronomical sunrise and sunset. The sun is 90&deg; from the vertical 0&deg;
9738
+ * The zenith of astronomical sunrise and sunset. The sun is 90° from the vertical 0°
9273
9739
  */
9274
9740
  const GEOMETRIC_ZENITH = 90;
9275
9741
  /**
9276
- * The zenith of 1.583&deg; below {@link GEOMETRIC_ZENITH geometric zenith} (90&deg;). This calculation is used for
9742
+ * The zenith of 1.583° below geometric zenith (90°). This calculation is used for
9277
9743
  * calculating _netz amiti_ (sunrise) and _shkiah amiti_ (sunset) based on the opinion of the
9278
- * <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>.
9744
+ * [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi).
9279
9745
  *
9280
- * @see Zmanim.sunriseBaalHatanya()
9281
- * @see Zmanim.sunsetBaalHatanya()
9746
+ * @see Zmanim.sunriseBaalHatanya
9747
+ * @see Zmanim.sunsetBaalHatanya
9282
9748
  */
9283
9749
  const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
9284
9750
  /**
@@ -9297,7 +9763,7 @@ const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
9297
9763
  * https://gml.noaa.gov/grad/solcalc/calcdetails.html
9298
9764
  *
9299
9765
  * @example
9300
- * const {GeoLocation, Zmanim} = require('@hebcal/core');
9766
+ * import {GeoLocation, Zmanim} from '@hebcal/core';
9301
9767
  * const latitude = 41.822232;
9302
9768
  * const longitude = -71.448292;
9303
9769
  * const tzid = 'America/New_York';
@@ -9306,6 +9772,7 @@ const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
9306
9772
  * const zmanim = new Zmanim(gloc, friday, false);
9307
9773
  * const candleLighting = zmanim.sunsetOffset(-18, true);
9308
9774
  * const timeStr = Zmanim.formatISOWithTimeZone(tzid, candleLighting);
9775
+ * // '2023-09-08T18:49:00-04:00'
9309
9776
  */
9310
9777
  class Zmanim {
9311
9778
  /**
@@ -9332,15 +9799,19 @@ class Zmanim {
9332
9799
  this.useElevation = Boolean(useElevation);
9333
9800
  }
9334
9801
  /**
9335
- * Returns `true` if elevation adjustment is enabled
9336
- * for zmanim support elevation adjustment
9802
+ * Returns `true` if this instance uses the location's elevation when
9803
+ * calculating sunrise/sunset-based zmanim.
9337
9804
  */
9338
9805
  getUseElevation() {
9339
9806
  return this.useElevation;
9340
9807
  }
9341
9808
  /**
9342
- * Enables or disables elevation adjustment for zmanim support elevation adjustment
9343
- * @param useElevation
9809
+ * Enables or disables elevation adjustment for sunrise/sunset-based zmanim.
9810
+ *
9811
+ * Degree-based zmanim (such as {@link alotHaShachar} or {@link tzeit})
9812
+ * estimate the amount of light in the sky and are never affected by this
9813
+ * setting.
9814
+ * @param useElevation `true` to include the location's elevation
9344
9815
  */
9345
9816
  setUseElevation(useElevation) {
9346
9817
  this.useElevation = useElevation;
@@ -9349,8 +9820,10 @@ class Zmanim {
9349
9820
  * Convenience function to get the time when sun is above or below the horizon
9350
9821
  * for a certain angle (in degrees).
9351
9822
  * This function does not support elevation adjustment.
9352
- * @param angle
9353
- * @param rising
9823
+ * @param angle degrees of solar depression below the horizon; for example
9824
+ * `8.5` means the center of the sun is 8.5° below the horizon
9825
+ * @param rising `true` for the morning (before sunrise), `false` for the
9826
+ * evening (after sunset)
9354
9827
  */
9355
9828
  timeAtAngle(angle, rising) {
9356
9829
  const offsetZenith = GEOMETRIC_ZENITH + angle;
@@ -9424,13 +9897,19 @@ class Zmanim {
9424
9897
  return zman.sunset();
9425
9898
  }
9426
9899
  /**
9427
- * @private
9900
+ * Length in milliseconds of one halachic hour of the night, calculated as
9901
+ * one twelfth of the time between the previous day's sunset and this
9902
+ * day's sunrise. Used internally by {@link chatzotNight}.
9428
9903
  */
9429
9904
  nightHour() {
9430
9905
  return (this.sunrise().getTime() - this.gregEve().getTime()) / 12; // ms in hour
9431
9906
  }
9432
9907
  /**
9433
- * Midday – Chatzot; Sunrise plus 6 halachic hours
9908
+ * Midday – Chatzot; Sunrise plus 6 halachic hours.
9909
+ *
9910
+ * Unlike most sunrise/sunset-based zmanim, this is always computed from
9911
+ * sea-level sunrise and sunset, so it is not affected by the
9912
+ * `useElevation` setting.
9434
9913
  */
9435
9914
  chatzot() {
9436
9915
  const startOfDay = this.noaa.getSeaLevelSunrise();
@@ -9460,6 +9939,11 @@ class Zmanim {
9460
9939
  alotHaShachar72() {
9461
9940
  return this.sunriseOffset(-72, false, false);
9462
9941
  }
9942
+ /**
9943
+ * Same as {@link alotHaShachar72}, but returns a `Temporal.ZonedDateTime`
9944
+ * with seconds precision (instead of a `Date` rounded to the minute), or
9945
+ * `null` if sunrise cannot be calculated for this date and location.
9946
+ */
9463
9947
  alotHaShachar72zdt() {
9464
9948
  const zdt = this.useElevation
9465
9949
  ? this.noaa.getSunrise()
@@ -9493,8 +9977,7 @@ class Zmanim {
9493
9977
  }
9494
9978
  /**
9495
9979
  * Utility method for using elevation-aware sunrise/sunset
9496
- * @private
9497
- * @param hours
9980
+ * @param hours number of _shaos zmaniyos_ (solar hours) after sunrise
9498
9981
  */
9499
9982
  getShaahZmanisBasedZman(hours) {
9500
9983
  const startOfDay = this.useElevation
@@ -9517,7 +10000,7 @@ class Zmanim {
9517
10000
  /**
9518
10001
  * Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
9519
10002
  *
9520
- * This method returns the latest *zman tfila* (time to recite shema in the morning)
10003
+ * This method returns the latest *zman tfila* (time to recite the morning prayers)
9521
10004
  * that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
9522
10005
  * (depending on the `useElevation` setting), according
9523
10006
  * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
@@ -9530,21 +10013,23 @@ class Zmanim {
9530
10013
  }
9531
10014
  /**
9532
10015
  * This method returns the latest time for burning _chametz_ on _Erev Pesach_ according to the opinion
9533
- * of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a>. This time is 5 hours into the day based on the
9534
- * opinion of the <a href="https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> that the day is calculated from
9535
- * sunrise to sunset. This returns the time 5 * {@link #getShaahZmanisGra()} after {@link #getSeaLevelSunrise() sea
9536
- * level sunrise}.
9537
- * @return the <code>Date</code> of the latest time for burning _chametz_ on _Erev Pesach_. If it is not
9538
- * _erev Pesach_ or the calculation can't be computed such as in the Arctic Circle where there is at least
9539
- * one day a year where the sun does not rise, and one where it does not set, a <code>null</code> will be
9540
- * returned.
10016
+ * of the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon). This time is 5 halachic hours into the day, based on
10017
+ * the opinion of the GRA that the day is calculated from sunrise to sunset.
10018
+ *
10019
+ * If elevation is enabled, this function will include elevation in the calculation.
10020
+ * @return the `Date` of the latest time for burning _chametz_ on _Erev Pesach_. If the calculation can't be
10021
+ * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not
10022
+ * rise and one where it does not set, an `Invalid Date` will be returned.
9541
10023
  */
9542
10024
  sofZmanBiurChametzGRA() {
9543
10025
  return this.getShaahZmanisBasedZman(5);
9544
10026
  }
9545
10027
  /**
9546
- * Returns an array with alot (Date) and ms in hour (number)
9547
- * @private
10028
+ * Returns a 2-element array with alot (a `Date`, 72 minutes before sunrise)
10029
+ * and the length in milliseconds of one halachic hour of the resulting day.
10030
+ * Used internally by the Magen Avraham zmanim.
10031
+ * @param forceSeaLevel ignore the `useElevation` setting and use sea-level
10032
+ * sunrise and sunset
9548
10033
  */
9549
10034
  getTemporalHour72(forceSeaLevel) {
9550
10035
  const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);
@@ -9553,8 +10038,11 @@ class Zmanim {
9553
10038
  return [alot72, temporalHour];
9554
10039
  }
9555
10040
  /**
9556
- * Returns an array with alot (Date) and ms in hour (number)
9557
- * @private
10041
+ * Returns a 2-element array with alot (a `Date`, when the sun is `angle`
10042
+ * degrees below the horizon in the morning) and the length in milliseconds
10043
+ * of one halachic hour of the resulting day. Used internally by the
10044
+ * degree-based Magen Avraham zmanim.
10045
+ * @param angle degrees of solar depression below the horizon
9558
10046
  */
9559
10047
  getTemporalHourByDeg(angle) {
9560
10048
  const alot = this.timeAtAngle(angle, true);
@@ -9635,7 +10123,7 @@ class Zmanim {
9635
10123
  * Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
9636
10124
  * If elevation is enabled, this function will include elevation in the calculation.
9637
10125
  *
9638
- * This method returns the latest mincha gedola, the earliest time one can pray mincha
10126
+ * This method returns *mincha gedola*, the earliest time one can pray mincha,
9639
10127
  * that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
9640
10128
  * (depending on the `useElevation` setting), according
9641
10129
  * to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
@@ -9693,14 +10181,24 @@ class Zmanim {
9693
10181
  return this.getShaahZmanisBasedZman(10.75);
9694
10182
  }
9695
10183
  /**
9696
- * @param [angle=8.5] optional time for solar depression.
9697
- * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.
10184
+ * Nightfall – Tzeit HaKochavim; the sun is `angle` degrees below the
10185
+ * horizon in the evening.
10186
+ *
9698
10187
  * Because degree-based functions estimate the amount of light in the sky,
9699
10188
  * the result is not impacted by elevation.
10189
+ * @param [angle=8.5] optional time for solar depression.
10190
+ * Default is 8.5 degrees for 3 small stars, use 7.083 degrees for 3 medium-sized stars.
9700
10191
  */
9701
10192
  tzeit(angle = 8.5) {
9702
10193
  return this.timeAtAngle(angle, false);
9703
10194
  }
10195
+ /**
10196
+ * Nightfall – Tzeit HaKochavim; calculated as 72 minutes after sunset
10197
+ * (or sea-level sunset, depending on the `useElevation` setting).
10198
+ *
10199
+ * Returns a `Temporal.ZonedDateTime` with seconds precision, or `null` if
10200
+ * sunset cannot be calculated for this date and location.
10201
+ */
9704
10202
  tzeit72() {
9705
10203
  const zdt = this.useElevation
9706
10204
  ? this.noaa.getSunset()
@@ -9797,12 +10295,13 @@ class Zmanim {
9797
10295
  return moladBasedTime.withTimeZone(this.gloc.getTimeZone());
9798
10296
  }
9799
10297
  /**
9800
- * Returns the latest time of Kiddush Levana according to the <a
9801
- * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> opinion that it is calculated as
10298
+ * Returns the latest time of Kiddush Levana according to the
10299
+ * [Maharil's](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) opinion that it is calculated as
9802
10300
  * halfway between _molad_ and _molad_. This adds half the 29 days, 12 hours and 793 chalakim time between
9803
10301
  * _molad_ and _molad_ (14 days, 18 hours, 22 minutes and 666 milliseconds) to the month's _molad_.
9804
- * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to between
9805
- * _tzais_ and _alos_, see {@link getSofZmanKidushLevanaBetweenMoldos}.
10302
+ *
10303
+ * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and
10304
+ * `tzais` are supplied.
9806
10305
  *
9807
10306
  * @param alos
9808
10307
  * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
@@ -9812,9 +10311,9 @@ class Zmanim {
9812
10311
  * the end of the Jewish day. If Kidush Levana occurs during the day (starting at alos and ending at
9813
10312
  * tzais), the time returned will be alos. If either the alos or tzais parameters are null, no daytime
9814
10313
  * adjustment will be made.
9815
- * @return the Date representing the moment halfway between molad and molad. If the time occurs between
9816
- * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
9817
- * day, a `null` will be returned.
10314
+ * @return the `Temporal.ZonedDateTime` representing the moment halfway between molad and molad. If the time
10315
+ * occurs between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this
10316
+ * day, `null` will be returned.
9818
10317
  */
9819
10318
  getSofZmanKidushLevanaBetweenMoldos(alos = null, tzais = null) {
9820
10319
  const hd = this.hdate;
@@ -9831,19 +10330,25 @@ class Zmanim {
9831
10330
  /**
9832
10331
  * Returns the latest time of _Kiddush Levana_ calculated as 15 days after the molad. This is the opinion of
9833
10332
  * the Shulchan Aruch (Orach Chaim 426). It should be noted that some opinions hold that the
9834
- * <a href="https://en.wikipedia.org/wiki/Moses_Isserles">Rema</a> who brings down the opinion of the <a
9835
- * href="https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin">Maharil's</a> of calculating
9836
- * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_} is of
9837
- * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on the subject,
9838
- * See Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of <a href="https://hebrewbooks.org/53000">Shaarei
9839
- * Zmanim</a>. The _sof zman Kiddush Levana_ will be returned even if it occurs during the day. To limit the time to
9840
- * between _tzais_ and _alos_, see {@link getSofZmanKidushLevana15Days}.
9841
- *
9842
- * @return the Date representing the moment 15 days after the _molad_. If the time occurs between
9843
- * _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day, a
9844
- * `null` will be returned.
10333
+ * [Rema](https://en.wikipedia.org/wiki/Moses_Isserles), who brings down the opinion of the
10334
+ * [Maharil](https://en.wikipedia.org/wiki/Yaakov_ben_Moshe_Levi_Moelin) of calculating
10335
+ * {@link getSofZmanKidushLevanaBetweenMoldos half way between _molad_ and _molad_}, is of
10336
+ * the opinion that the Mechaber agrees to his opinion. Also see the Aruch Hashulchan. For additional details on
10337
+ * the subject, see Rabbi Dovid Heber's very detailed write-up in Siman Daled (chapter 4) of
10338
+ * [Shaarei Zmanim](https://hebrewbooks.org/53000).
9845
10339
  *
10340
+ * The _sof zman Kiddush Levana_ will be returned even if it occurs during the day, unless both `alos` and
10341
+ * `tzais` are supplied.
9846
10342
  *
10343
+ * @param alos
10344
+ * the beginning of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime
10345
+ * adjustment will be made.
10346
+ * @param tzais
10347
+ * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime
10348
+ * adjustment will be made.
10349
+ * @return the `Temporal.ZonedDateTime` representing the moment 15 days after the _molad_. If the time occurs
10350
+ * between _alos_ and _tzais_, _alos_ will be returned. If the _zman_ will not occur on this day,
10351
+ * `null` will be returned.
9847
10352
  */
9848
10353
  getSofZmanKidushLevana15Days(alos = null, tzais = null) {
9849
10354
  const hd = this.hdate;
@@ -9858,8 +10363,8 @@ class Zmanim {
9858
10363
  return this.getMoladBasedTime(molad.getSofZmanKidushLevana15Days(), alos, tzais, false);
9859
10364
  }
9860
10365
  /**
9861
- * Returns the earliest time of _Kiddush Levana_ according to <a href=
9862
- * "https://en.wikipedia.org/wiki/Yonah_Gerondi">Rabbeinu Yonah</a>'s opinion that it can be said 3 days after the _molad_.
10366
+ * Returns the earliest time of _Kiddush Levana_ according to
10367
+ * [Rabbeinu Yonah](https://en.wikipedia.org/wiki/Yonah_Gerondi)'s opinion that it can be said 3 days after the _molad_.
9863
10368
  * If the time of _tchilas zman Kiddush Levana_ occurs during the day (between _alos_ and _tzais_ passed to
9864
10369
  * this method) it will return the following _tzais_. If null is passed for either _alos_ or _tzais_, the actual
9865
10370
  * _tchilas zman Kiddush Levana_ will be returned, regardless of if it is during the day or not.
@@ -9873,8 +10378,8 @@ class Zmanim {
9873
10378
  * _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
9874
10379
  * are null, no daytime adjustment will be made.
9875
10380
  *
9876
- * @return the Date representing the moment 3 days after the molad. If the time occurs between _alos_ and
9877
- * _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day, a
10381
+ * @return the `Temporal.ZonedDateTime` representing the moment 3 days after the molad. If the time occurs
10382
+ * between _alos_ and _tzais_, _tzais_ will be returned. If the _zman_ will not occur on this day,
9878
10383
  * `null` will be returned.
9879
10384
  */
9880
10385
  getTchilasZmanKidushLevana3Days(alos = null, tzais = null) {
@@ -9899,13 +10404,11 @@ class Zmanim {
9899
10404
  return zman;
9900
10405
  }
9901
10406
  /**
9902
- * Returns the point in time of _Molad_ as a <code>Date</code> Object. For the traditional day of week, hour,
9903
- * minute and chalakim, {@link Molad.getInstant()} and the not yet completed
9904
- * {@link HebrewDateFormatter} that will have formatting for this.
9905
- *
9906
- * @return the Date representing the moment of the molad. If the _molad_ does not occur on this day, a
9907
- * `null` will be returned.
10407
+ * Returns the point in time of the _Molad_, if it occurs on this date. For the traditional day of week, hour,
10408
+ * minute and chalakim, see {@link Molad} and its {@link Molad.render} method.
9908
10409
  *
10410
+ * @return the `Temporal.ZonedDateTime` representing the moment of the molad. If the _molad_ does not occur on
10411
+ * this day, `null` will be returned.
9909
10412
  */
9910
10413
  getZmanMolad() {
9911
10414
  const hd = this.hdate;
@@ -9928,10 +10431,17 @@ class Zmanim {
9928
10431
  /**
9929
10432
  * Returns the earliest time of _Kiddush Levana_ according to the opinions that it should not be said until 7
9930
10433
  * days after the _molad_. The time will be returned even if it occurs during the day when _Kiddush Levana_
9931
- * can't be recited. Use {@link getTchilasZmanKidushLevana7Days} if you want to limit the time to night hours.
10434
+ * can't be recited, unless both `alos` and `tzais` are supplied.
9932
10435
  *
9933
- * @return the Date representing the moment 7 days after the molad regardless of it is day or night. If the _zman_
9934
- * will not occur on this day, a `null` will be returned.
10436
+ * @param alos
10437
+ * the beginning of the Jewish day. If _Kidush Levana_ occurs during the day (starting at _alos_ and
10438
+ * ending at _tzais_), the time returned will be _tzais_. If either the _alos_ or _tzais_ parameters
10439
+ * are null, no daytime adjustment will be made.
10440
+ * @param tzais
10441
+ * the end of the Jewish day. If either the _alos_ or _tzais_ parameters are null, no daytime
10442
+ * adjustment will be made.
10443
+ * @return the `Temporal.ZonedDateTime` representing the moment 7 days after the molad. If the _zman_
10444
+ * will not occur on this day, `null` will be returned.
9935
10445
  */
9936
10446
  getTchilasZmanKidushLevana7Days(alos = null, tzais = null) {
9937
10447
  const hd = this.hdate;
@@ -9947,41 +10457,38 @@ class Zmanim {
9947
10457
  return this.getMoladBasedTime(molad.getTchilasZmanKidushLevana7Days(), alos, tzais, true);
9948
10458
  }
9949
10459
  /**
9950
- * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
10460
+ * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s
9951
10461
  * _netz amiti_ (sunrise) without
9952
10462
  * elevation adjustment. This forms the base for the Baal Hatanya's dawn-based calculations that are
9953
10463
  * calculated as a dip below the horizon before sunrise.
9954
10464
  *
9955
10465
  * According to the Baal Hatanya, _netz amiti_, or true (halachic) sunrise, is when the top of the sun's
9956
10466
  * disk is visible at an elevation similar to the mountains of Eretz Yisrael. The time is calculated as the point at which
9957
- * the center of the sun's disk is 1.583&deg; below the horizon. This degree-based calculation can be found in Rabbi Shalom
9958
- * DovBer Levine's commentary on The <a href="https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf">Baal
9959
- * Hatanya's Seder Hachnasas Shabbos</a>. From an elevation of 546 meters, the top of <a href=
9960
- * "https://en.wikipedia.org/wiki/Mount_Carmel">Har Hacarmel</a>, the sun disappears when it is 1&deg; 35' or 1.583&deg;
9961
- * below the sea level horizon. This in turn is based on the Gemara <a href=
9962
- * "https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35">Shabbos 35a</a>. There are other opinions brought down by
10467
+ * the center of the sun's disk is 1.583° below the horizon. This degree-based calculation can be found in Rabbi Shalom
10468
+ * DovBer Levine's commentary on
10469
+ * [The Baal Hatanya's Seder Hachnasas Shabbos](https://www.chabadlibrary.org/books/pdf/Seder-Hachnosas-Shabbos.pdf).
10470
+ * From an elevation of 546 meters, the top of [Har Hacarmel](https://en.wikipedia.org/wiki/Mount_Carmel),
10471
+ * the sun disappears when it is 1° 35' or 1.583° below the sea level horizon. This in turn is based on the Gemara
10472
+ * [Shabbos 35a](https://hebrewbooks.org/shas.aspx?mesechta=2&daf=35). There are other opinions brought down by
9963
10473
  * Rabbi Levine, including Rabbi Yosef Yitzchok Feigelstock who calculates it as the degrees below the horizon 4 minutes after
9964
- * sunset in Yerushalayim (on the equinox). That is brought down as 1.583&deg;. This is identical to the 1&deg; 35' _zman_
9965
- * and is probably a typo and should be 1.683&deg;. These calculations are used by most <a href=
9966
- * "https://en.wikipedia.org/wiki/Chabad">Chabad</a> calendars that use the Baal Hatanya's _zmanim_. See
9967
- * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
9968
- * _Zmanim_ Calculations @ Chabad.org</a>.
10474
+ * sunset in Yerushalayim (on the equinox). That is brought down as 1.583°. This is identical to the 1° 35' _zman_
10475
+ * and is probably a typo and should be 1.683°. These calculations are used by most
10476
+ * [Chabad](https://en.wikipedia.org/wiki/Chabad) calendars that use the Baal Hatanya's _zmanim_. See
10477
+ * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).
9969
10478
  *
9970
10479
  * Note: _netz amiti_ is used only for calculating certain _zmanim_, and is intentionally unpublished. For
9971
10480
  * practical purposes, daytime _mitzvos_ like _shofar_ and _lulav_ should not be done until after the
9972
10481
  * published time for _netz_ / sunrise.
9973
10482
  *
9974
- * @return the <code>Date</code> representing the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be
9975
- * computed such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
9976
- * where it does not set, a `null` will be returned. See detailed explanation on top of the page.
9977
- *
9978
- * @see ZENITH_1_POINT_583
10483
+ * @return the exact sea level _netz amiti_ (sunrise) time. If the calculation can't be
10484
+ * computed, such as in the Arctic Circle where there is at least one day a year where the sun does not rise, and one
10485
+ * where it does not set, `null` will be returned.
9979
10486
  */
9980
10487
  getSunriseBaalHatanya() {
9981
10488
  return this.noaa.getSunriseOffsetByDegrees(ZENITH_1_POINT_583);
9982
10489
  }
9983
10490
  /**
9984
- * A method that returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s
10491
+ * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s
9985
10492
  * _shkiah amiti_ (sunset) without
9986
10493
  * elevation adjustment. This forms the base for the Baal Hatanya's dusk-based calculations that are calculated
9987
10494
  * as a dip below the horizon after sunset.
@@ -9994,33 +10501,31 @@ class Zmanim {
9994
10501
  * practical purposes, all daytime mitzvos should be completed before the published time for _shkiah_ / sunset.
9995
10502
  *
9996
10503
  * For further explanation of the calculations used for the Baal Hatanya's _zmanim_ in this library, see
9997
- * <a href="https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm">About Our
9998
- * _Zmanim_ Calculations @ Chabad.org</a>.
9999
- *
10000
- * @return the <code>Date</code> representing the exact sea level _shkiah amiti_ (sunset) time. If the calculation
10001
- * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does not
10002
- * rise, and one where it does not set, a `null` will be returned.
10504
+ * [About Our Zmanim Calculations @ Chabad.org](https://www.chabad.org/library/article_cdo/aid/3209349/jewish/About-Our-Zmanim-Calculations.htm).
10003
10505
  *
10004
- * @see ZENITH_1_POINT_583
10506
+ * @return the exact sea level _shkiah amiti_ (sunset) time. If the calculation
10507
+ * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does not
10508
+ * rise, and one where it does not set, `null` will be returned.
10005
10509
  */
10006
10510
  getSunsetBaalHatanya() {
10007
10511
  return this.noaa.getSunsetOffsetByDegrees(ZENITH_1_POINT_583);
10008
10512
  }
10009
10513
  /**
10010
- * Returns the <a href="https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi">Baal Hatanya</a>'s _alos_
10011
- * (dawn) calculated as the time when the sun is 16.9&deg; below the eastern {@link GEOMETRIC_ZENITH geometric horizon}
10012
- * before {@link getSunrise() sunrise}.
10514
+ * Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_
10515
+ * (dawn) calculated as the time when the sun is 16.9° below the eastern geometric horizon
10516
+ * before {@link sunrise}.
10013
10517
  *
10014
- * The zenith of 16.9&deg; below is based on the calculation that the time between dawn
10015
- * and _netz amiti_ (sunrise) is 72 minutes, the time that is takes to walk 4 mil at 18 minutes
10016
- * a mil (<a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others). The sun's position at 72
10017
- * minutes before {@link getSunriseBaalHatanya _netz amiti_ (sunrise)} in Jerusalem <a href=
10018
- * "https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/">around the equinox / equilux</a> is
10019
- * 16.9&deg; below {@link GEOMETRIC_ZENITH geometric zenith}.
10518
+ * The zenith of 16.9° below is based on the calculation that the time between dawn
10519
+ * and _netz amiti_ (sunrise) is 72 minutes, the time that it takes to walk 4 mil at 18 minutes
10520
+ * a mil ([Rambam](https://en.wikipedia.org/wiki/Maimonides) and others). The sun's position at 72
10521
+ * minutes before _netz amiti_ (sunrise) in Jerusalem
10522
+ * [around the equinox / equilux](https://kosherjava.com/2022/01/12/equinox-vs-equilux-zmanim-calculations/)
10523
+ * is 16.9° below geometric zenith.
10020
10524
  *
10021
- * @return The <code>Date</code> of dawn. If the calculation can't be computed such as northern and southern
10525
+ * @return the `Date` of dawn. If the calculation can't be computed, such as in northern and southern
10022
10526
  * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
10023
- * low enough below the horizon for this calculation, a `null` will be returned. */
10527
+ * low enough below the horizon for this calculation, an `Invalid Date` will be returned.
10528
+ */
10024
10529
  alosBaalHatanya() {
10025
10530
  return this.timeAtAngle(16.9, true);
10026
10531
  }
@@ -10030,86 +10535,79 @@ class Zmanim {
10030
10535
  }
10031
10536
  /**
10032
10537
  * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3
10033
- * {@link shaahZmanisBaalHatanya() _shaos zmaniyos_} (solar hours) after {@link getSunriseBaalHatanya()
10034
- * _netz amiti_ (sunrise)} based on the opinion of the Baal Hatanya that the day is calculated from
10035
- * sunrise to sunset. This returns the time 3 * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya()
10036
- * _netz amiti_ (sunrise)}.
10538
+ * _shaos zmaniyos_ (solar hours) after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya
10539
+ * that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
10037
10540
  *
10038
- * @return the <code>Date</code> of the latest _zman shema_ according to the Baal Hatanya. If the calculation
10039
- * can't be computed such as in the Arctic Circle where there is at least one day a year where the sun does
10040
- * not rise, and one where it does not set, a `null` will be returned.
10541
+ * @return the `Date` of the latest _zman shema_ according to the Baal Hatanya. If the calculation
10542
+ * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does
10543
+ * not rise and one where it does not set, an `Invalid Date` will be returned.
10041
10544
  */
10042
10545
  sofZmanShmaBaalHatanya() {
10043
10546
  return this.getShaahZmanisBaalHatanya(3);
10044
10547
  }
10045
10548
  /**
10046
10549
  * This method returns the latest _zman tfilah_ (time to recite the morning prayers). This time is 4
10047
- * hours into the day based on the opinion of the Baal Hatanya that the day is
10048
- * calculated from sunrise to sunset. This returns the time 4 * {@link getShaahZmanisBaalHatanya()} after
10049
- * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
10550
+ * halachic hours into the day, based on the opinion of the Baal Hatanya that the day is
10551
+ * calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
10050
10552
  *
10051
- * @return the <code>Date</code> of the latest _zman tfilah_. If the calculation can't be computed such as in
10052
- * the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it does
10053
- * not set, a `null` will be returned.
10553
+ * @return the `Date` of the latest _zman tfilah_. If the calculation can't be computed, such as in
10554
+ * the Arctic Circle where there is at least one day a year where the sun does not rise and one where it does
10555
+ * not set, an `Invalid Date` will be returned.
10054
10556
  */
10055
10557
  sofZmanTfilaBaalHatanya() {
10056
10558
  return this.getShaahZmanisBaalHatanya(4);
10057
10559
  }
10058
10560
  /**
10059
10561
  * This method returns the time of _mincha gedola_. _Mincha gedola_ is the earliest time one can pray
10060
- * _mincha_. The <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> is of the opinion that it is
10061
- * better to delay _mincha_ until {@link minchaKetanaBaalHatanya() _mincha ketana_} while the
10062
- * <a href="https://en.wikipedia.org/wiki/Asher_ben_Jehiel">Ra"sh</a>,
10063
- * <a href="https://en.wikipedia.org/wiki/Jacob_ben_Asher">Tur</a>, <a href=
10064
- * "https://en.wikipedia.org/wiki/Vilna_Gaon">GRA</a> and others are of the opinion that _mincha_ can be prayed
10065
- * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 {@link getShaahZmanisBaalHatanya()
10066
- * sea level solar hours} after {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}. This calculation is based
10067
- * on the opinion of the Baal Hatanya that the day is calculated from sunrise to sunset. This returns the time 6.5
10068
- * * {@link getShaahZmanisBaalHatanya()} after {@link getSunriseBaalHatanya() _netz amiti_ ("real" sunrise)}.
10069
- * @return the <code>Date</code> of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
10070
- * 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,
10071
- * and one where it does not set, a `null` will be returned.
10562
+ * _mincha_. The [Rambam](https://en.wikipedia.org/wiki/Maimonides) is of the opinion that it is
10563
+ * better to delay _mincha_ until {@link minchaKetanaBaalHatanya | _mincha ketana_} while the
10564
+ * [Ra"sh](https://en.wikipedia.org/wiki/Asher_ben_Jehiel),
10565
+ * [Tur](https://en.wikipedia.org/wiki/Jacob_ben_Asher),
10566
+ * [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon) and others are of the opinion that _mincha_ can be prayed
10567
+ * _lechatchila_ starting at _mincha gedola_. This is calculated as 6.5 sea level solar hours after
10568
+ * _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated from
10569
+ * _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
10570
+ * @return the `Date` of the time of _mincha gedola_ according to the Baal Hatanya. If the calculation
10571
+ * 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
10572
+ * and one where it does not set, an `Invalid Date` will be returned.
10072
10573
  */
10073
10574
  minchaGedolaBaalHatanya() {
10074
10575
  return this.getShaahZmanisBaalHatanya(6.5);
10075
10576
  }
10076
10577
  /**
10077
10578
  * This method returns the time of _mincha ketana_. This is the preferred earliest time to pray
10078
- * _mincha_ in the opinion of the <a href="https://en.wikipedia.org/wiki/Maimonides">Rambam</a> and others.
10079
- * For more information on this see the documentation on {@link minchaGedolaBaalHatanya() _mincha gedola_}.
10080
- * This is calculated as 9.5 sea level solar hours after {@link getSunriseBaalHatanya
10081
- * _netz amiti_ (sunrise)}. This calculation is calculated based on the opinion of the Baal Hatanya that the
10082
- * day is calculated from sunrise to sunset. This returns the time 9.5 * after
10083
- * _netz amiti_ (sunrise).
10084
- *
10085
- * @return the <code>Date</code> of the time of _mincha ketana_. If the calculation can't be computed such as
10086
- * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
10087
- * does not set, a `null` will be returned.
10579
+ * _mincha_ in the opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
10580
+ * For more information on this see the documentation on {@link minchaGedolaBaalHatanya | _mincha gedola_}.
10581
+ * This is calculated as 9.5 sea level solar hours after _netz amiti_ (sunrise), based on the opinion of
10582
+ * the Baal Hatanya that the day is calculated from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
10583
+ *
10584
+ * @return the `Date` of the time of _mincha ketana_. If the calculation can't be computed, such as
10585
+ * in the Arctic Circle where there is at least one day a year where the sun does not rise and one where it
10586
+ * does not set, an `Invalid Date` will be returned.
10088
10587
  */
10089
10588
  minchaKetanaBaalHatanya() {
10090
10589
  return this.getShaahZmanisBaalHatanya(9.5);
10091
10590
  }
10092
10591
  /**
10093
- * This method returns the time of _plag hamincha_. This is calculated as 10.75 hours after sunrise. This
10094
- * calculation is based on the opinion of the Baal Hatanya that the day is calculated
10095
- * from sunrise to sunset. This returns the time 10.75 * {@link getShaahZmanisBaalHatanya()} after
10096
- * {@link getSunriseBaalHatanya() _netz amiti_ (sunrise)}.
10592
+ * This method returns the time of _plag hamincha_. This is calculated as 10.75 sea level solar hours
10593
+ * after _netz amiti_ (sunrise), based on the opinion of the Baal Hatanya that the day is calculated
10594
+ * from _netz amiti_ (sunrise) to _shkiah amiti_ (sunset).
10097
10595
  *
10098
- * @return the <code>Date</code> of the time of _plag hamincha_. If the calculation can't be computed such as
10099
- * in the Arctic Circle where there is at least one day a year where the sun does not rise, and one where it
10100
- * does not set, a `null` will be returned.
10596
+ * @return the `Date` of the time of _plag hamincha_ according to the Baal Hatanya. If the calculation
10597
+ * can't be computed, such as in the Arctic Circle where there is at least one day a year where the sun does
10598
+ * not rise and one where it does not set, an `Invalid Date` will be returned.
10101
10599
  */
10102
10600
  plagHaminchaBaalHatanya() {
10103
10601
  return this.getShaahZmanisBaalHatanya(10.75);
10104
10602
  }
10105
10603
  /**
10106
- * A method that returns _tzais_ (nightfall) when the sun is 6&deg; below the western geometric horizon
10107
- * (90&deg;) after {@link getSunset() sunset}. For information on the source of this calculation see
10108
- * {@link ZENITH_6_DEGREES}.
10604
+ * A method that returns _tzais_ (nightfall) when the sun is 6° below the western geometric horizon
10605
+ * (90°) after {@link sunset}. This is the time the Baal Hatanya calls _shkiah amiti_ plus the
10606
+ * interval it takes the sun to descend a further 6°.
10109
10607
  *
10110
- * @return The <code>Date</code> of nightfall. If the calculation can't be computed such as northern and southern
10111
- * locations even south of the Arctic Circle and north of the Antarctic Circle where the sun may not reach
10112
- * low enough below the horizon for this calculation, a `null` will be returned. * @see ZENITH_6_DEGREES
10608
+ * @return the `Date` of nightfall. If the calculation can't be computed, such as in northern and southern
10609
+ * locations — even south of the Arctic Circle and north of the Antarctic Circle — where the sun may not
10610
+ * reach low enough below the horizon for this calculation, an `Invalid Date` will be returned.
10113
10611
  */
10114
10612
  tzaisBaalHatanya() {
10115
10613
  return this.timeAtAngle(6, false);
@@ -10117,6 +10615,9 @@ class Zmanim {
10117
10615
  /**
10118
10616
  * Uses timeFormat to return a date like '20:34'.
10119
10617
  * Returns `XX:XX` if the date is invalid.
10618
+ * @param dt the time to format
10619
+ * @param timeFormat formatter to use, e.g. from
10620
+ * {@link Location.getTimeFormatter}
10120
10621
  */
10121
10622
  static formatTime(dt, timeFormat) {
10122
10623
  if (isNaN(dt.getTime())) {
@@ -10226,7 +10727,7 @@ class Zmanim {
10226
10727
  * (for example `2024-09-22T20:07`), this function would return a
10227
10728
  * Hebrew date of `20th of Elul, 5784`.
10228
10729
  * @example
10229
- * const {GeoLocation, Zmanim, HDate} = require('@hebcal/core');
10730
+ * import {GeoLocation, Zmanim, HDate} from '@hebcal/core';
10230
10731
  * const latitude = 48.85341;
10231
10732
  * const longitude = 2.3488;
10232
10733
  * const timezone = 'Europe/Paris';
@@ -10365,14 +10866,14 @@ function yearType(hyear) {
10365
10866
  * Israel and the Diaspora diverge in some years when the 8th day of Pesach
10366
10867
  * or the 2nd day of Shavuot fall on Shabbat).
10367
10868
  *
10368
- * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over
10869
+ * Prefer {@link getSedra} over
10369
10870
  * calling this constructor directly, since both cache their results.
10370
10871
  *
10371
10872
  * @example
10372
10873
  * import {Sedra, HDate, months} from '@hebcal/core';
10373
10874
  * const sedra = new Sedra(5784, false);
10374
10875
  * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));
10375
- * console.log(result.parsha); // ['Lech-Lecha']
10876
+ * console.log(result.parsha); // ['Vayera']
10376
10877
  */
10377
10878
  class Sedra {
10378
10879
  /**
@@ -10419,15 +10920,20 @@ class Sedra {
10419
10920
  * @example
10420
10921
  * import {Sedra} from '@hebcal/core';
10421
10922
  * const sedra = new Sedra(5784, false);
10422
- * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'
10423
- * sedra.find(1)?.toString(); // same, by 0-based index
10424
- * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately
10425
- * sedra.find(['Matot', 'Masei']); // also null in 5784
10923
+ * sedra.find('Noach')?.toString(); // '6 Cheshvan 5784'
10924
+ * sedra.find(1)?.toString(); // '6 Cheshvan 5784', by 0-based index
10925
+ * // Matot and Masei are doubled in 5784, so the pair has a date...
10926
+ * sedra.find('Matot-Masei')?.toString(); // '28 Tamuz 5784'
10927
+ * sedra.find(['Matot', 'Masei'])?.toString(); // '28 Tamuz 5784'
10928
+ * // ...but neither half is read on its own that year:
10929
+ * sedra.find('Matot'); // null
10426
10930
  * @param parsha if a `string`, specified with Sephardic transliterations
10427
10931
  * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element
10428
10932
  * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should
10429
10933
  * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative
10430
- * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)
10934
+ * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei).
10935
+ * Note that this index is 0-based, unlike {@link SedraResult.num} which
10936
+ * is 1-based.
10431
10937
  */
10432
10938
  find(parsha) {
10433
10939
  if (typeof parsha === 'number') {
@@ -10490,12 +10996,19 @@ class Sedra {
10490
10996
  * will return the date of `'Matot'` alone.
10491
10997
  * @example
10492
10998
  * import {Sedra} from '@hebcal/core';
10999
+ * // Matot and Masei are doubled in 5784, so each half resolves to the
11000
+ * // date of the combined reading:
10493
11001
  * const sedra = new Sedra(5784, false);
10494
- * // Matot-Masei is split in 5784; both individual halves resolve:
10495
- * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'
10496
- * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'
10497
- * // Asking for the doubled name returns the date of the first half:
10498
- * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'
11002
+ * sedra.findContaining('Matot')?.toString(); // '28 Tamuz 5784'
11003
+ * sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5784'
11004
+ * @example
11005
+ * import {Sedra} from '@hebcal/core';
11006
+ * // They are read separately in 5795, so each half has its own date, and
11007
+ * // asking for the doubled name returns the date of the first half:
11008
+ * const sedra = new Sedra(5795, false);
11009
+ * sedra.findContaining('Matot')?.toString(); // '21 Tamuz 5795'
11010
+ * sedra.findContaining('Masei')?.toString(); // '28 Tamuz 5795'
11011
+ * sedra.findContaining('Matot-Masei')?.toString(); // '21 Tamuz 5795'
10499
11012
  */
10500
11013
  findContaining(parsha) {
10501
11014
  const hdate = this.find(parsha);
@@ -10577,11 +11090,11 @@ class Sedra {
10577
11090
  * @example
10578
11091
  * import {Sedra, HDate, months} from '@hebcal/core';
10579
11092
  * const sedra = new Sedra(5784, false);
10580
- * // A weekday — returns the upcoming Shabbat's reading
10581
- * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));
11093
+ * // A Friday — returns the upcoming Shabbat's reading
11094
+ * const result = sedra.lookup(new HDate(12, months.CHESHVAN, 5784));
10582
11095
  * console.log(result.parsha); // ['Lech-Lecha']
10583
11096
  * console.log(result.chag); // false
10584
- * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)
11097
+ * console.log(result.hdate.toString()); // '13 Cheshvan 5784' (Saturday)
10585
11098
  * @param hd Hebrew date or R.D. days
10586
11099
  */
10587
11100
  lookup(hd) {
@@ -10633,6 +11146,16 @@ class Sedra {
10633
11146
  *
10634
11147
  * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday
10635
11148
  * reading is *Vezot Haberakhah* even though it is not read on Shabbat.
11149
+ * @example
11150
+ * import {Sedra, HDate, months} from '@hebcal/core';
11151
+ * const sedra = new Sedra(5784, false);
11152
+ * // Monday 8 Cheshvan — begins the upcoming Shabbat's parsha
11153
+ * sedra.lookupWeekday(new HDate(8, months.CHESHVAN, 5784))?.parsha; // ['Lech-Lecha']
11154
+ * // Tuesday is neither Monday nor Thursday
11155
+ * sedra.lookupWeekday(new HDate(9, months.CHESHVAN, 5784)); // undefined
11156
+ * // Thursday 17 Nisan — the upcoming Shabbat is Chol ha-Moed Pesach,
11157
+ * // so the next regular parsha is returned instead
11158
+ * sedra.lookupWeekday(new HDate(17, months.NISAN, 5784))?.parsha; // ['Achrei Mot']
10636
11159
  * @param hd Hebrew date or R.D. days
10637
11160
  */
10638
11161
  lookupWeekday(hd) {
@@ -10908,7 +11431,7 @@ const sedraCache = new QuickLRU({ maxSize: 120 });
10908
11431
  * import {getSedra, HDate, months} from '@hebcal/core';
10909
11432
  * const sedra = getSedra(5784, false);
10910
11433
  * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));
10911
- * console.log(parsha); // ['Lech-Lecha']
11434
+ * console.log(parsha); // ['Vayera']
10912
11435
  * @param hyear Hebrew year
10913
11436
  * @param il Use Israel sedra schedule (`false` for Diaspora)
10914
11437
  */
@@ -11002,8 +11525,6 @@ const SOF_ZMAN_ACHILAT_CHAMETZ = 'Finish eating chametz';
11002
11525
  const YIZKOR$1 = 'Yizkor';
11003
11526
  /**
11004
11527
  * Transliterated names of holidays, used by `Event.getDesc()`
11005
- * @readonly
11006
- * @enum {string}
11007
11528
  */
11008
11529
  const holidayDesc = {
11009
11530
  /** Asara B'Tevet */
@@ -11561,7 +12082,7 @@ const staticModernHolidays = [
11561
12082
  /**
11562
12083
  * Represents a built-in holiday like Pesach, Purim or Tu BiShvat.
11563
12084
  *
11564
- * Most holiday-related events emitted by {@link HebrewCalendar.calendar}
12085
+ * Most holiday-related events emitted by {@link calendar}
11565
12086
  * are instances of `HolidayEvent` or one of its subclasses
11566
12087
  * ({@link ChanukahEvent}, {@link AsaraBTevetEvent},
11567
12088
  * {@link RoshHashanaEvent}, {@link RoshChodeshEvent}).
@@ -11621,6 +12142,10 @@ class HolidayEvent extends Event {
11621
12142
  this.urlDateSuffix();
11622
12143
  return this.getFlags() & flags.IL_ONLY ? url + '?i=on' : url;
11623
12144
  }
12145
+ /**
12146
+ * The date portion of {@link url}. For most holidays this is just the
12147
+ * Gregorian year; subclasses override it when a year alone is ambiguous.
12148
+ */
11624
12149
  urlDateSuffix() {
11625
12150
  const year = this.greg().getFullYear();
11626
12151
  return String(year);
@@ -11682,6 +12207,7 @@ class HolidayEvent extends Event {
11682
12207
  * we subclass HolidayEvent to generate the correct URL.
11683
12208
  */
11684
12209
  class AsaraBTevetEvent extends HolidayEvent {
12210
+ /** Full `YYYYMMDD` date, since the Gregorian year alone is ambiguous here */
11685
12211
  urlDateSuffix() {
11686
12212
  const isoDate = isoDateString(this.greg());
11687
12213
  return isoDate.replaceAll('-', '');
@@ -11729,7 +12255,7 @@ class ChanukahEvent extends HolidayEvent {
11729
12255
  /** Represents Rosh Hashana, the Jewish New Year */
11730
12256
  class RoshHashanaEvent extends HolidayEvent {
11731
12257
  /**
11732
- * @private
12258
+ * Normally created by {@link calendar} rather than directly.
11733
12259
  * @param date Hebrew date event occurs
11734
12260
  * @param hyear Hebrew year
11735
12261
  * @param mask optional holiday flags
@@ -11782,7 +12308,8 @@ const ykk = 'Yom Kippur Katan';
11782
12308
  /** YKK is minor day of atonement on the day preceeding each Rosh Chodesh */
11783
12309
  class YomKippurKatanEvent extends HolidayEvent {
11784
12310
  /**
11785
- * @private
12311
+ * Normally created by {@link calendar} (via
12312
+ * `options.yomKippurKatan`) rather than directly.
11786
12313
  * @param date Hebrew date event occurs
11787
12314
  * @param nextMonthName name of the upcoming month
11788
12315
  */
@@ -12107,7 +12634,7 @@ function getBirkatHaChama(year) {
12107
12634
  *
12108
12635
  * Includes Rosh Chodesh, fasts, special Shabbatot, modern holidays, etc.,
12109
12636
  * but does not generate candle-lighting times, Torah readings, or Omer days.
12110
- * Use {@link HebrewCalendar.calendar} for those.
12637
+ * Use {@link calendar} for those.
12111
12638
  * @example
12112
12639
  * import {getHolidaysForYearArray} from '@hebcal/core';
12113
12640
  * const events = getHolidaysForYearArray(5784, false);
@@ -12143,9 +12670,12 @@ function isTomorrowShabbosOrYomTov(dow, events) {
12143
12670
  return false;
12144
12671
  }
12145
12672
  /**
12146
- * 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.
12673
+ * Returns true if it is _Shabbos_ or if it is a _Yom Tov_ day that has a
12674
+ * _melacha_ (work) prohibition.
12147
12675
  *
12148
- * @return if the day is a <em>Yom Tov</em> that is <em>assur bemlacha</em> or <em>Shabbos</em>
12676
+ * @param dow day of week, where `6` is Shabbos
12677
+ * @param events events occurring on the day
12678
+ * @return `true` if the day is a _Yom Tov_ that is _assur bemlacha_, or _Shabbos_
12149
12679
  */
12150
12680
  function isTodayAssurBemelacha(dow, events) {
12151
12681
  if (dow === 6) {
@@ -12284,7 +12814,7 @@ const EREV$1 = flags.EREV;
12284
12814
  * isFastDay(new HDate(10, months.TISHREI, 5784)); // true (Yom Kippur)
12285
12815
  * isFastDay(new HDate(11, months.TISHREI, 5784)); // false
12286
12816
  * @param date Hebrew Date, Gregorian date, or absolute R.D. day number
12287
- * @param il use the Israeli schedule for holidays
12817
+ * @param il optional; use the Israeli schedule for holidays (default Diaspora)
12288
12818
  * @return `true` if the date is a major or minor fast day
12289
12819
  */
12290
12820
  function isFastDay(date, il) {
@@ -12310,7 +12840,14 @@ const CANDLE_LIGHTING = holidayDesc.CANDLE_LIGHTING;
12310
12840
  */
12311
12841
  class TimedEvent extends Event {
12312
12842
  /**
12843
+ * Normally created by {@link calendar} rather than directly.
12844
+ * @param date Hebrew date the event occurs
12313
12845
  * @param desc Description (not translated)
12846
+ * @param mask optional holiday flags
12847
+ * @param eventTime the exact moment of the event
12848
+ * @param location geographic location used to format the time
12849
+ * @param linkedEvent optional event this time is associated with
12850
+ * @param options optional; `locale` and `hour12` affect {@link fmtTime}
12314
12851
  */
12315
12852
  constructor(date, desc, mask, eventTime, location, linkedEvent, options) {
12316
12853
  super(date, desc, mask);
@@ -12362,10 +12899,11 @@ class TimedEvent extends Event {
12362
12899
  /**
12363
12900
  * Candle-lighting event for the eve of Shabbat or a Yom Tov.
12364
12901
  *
12365
- * Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
12902
+ * Generated by {@link calendar} when `options.candlelighting`
12366
12903
  * is `true` and `options.location` is provided. By default candle lighting
12367
- * occurs 18 minutes before sundown (40 minutes in Jerusalem; 30 minutes in
12368
- * Haifa and Zikhron Ya'akov), configurable via `options.candleLightingMins`.
12904
+ * occurs 18 minutes before sundown in the Diaspora and 20 minutes before
12905
+ * sundown in Israel (40 minutes in Jerusalem; 30 minutes in Haifa and
12906
+ * Zikhron Ya'akov), configurable via `options.candleLightingMins`.
12369
12907
  */
12370
12908
  class CandleLightingEvent extends TimedEvent {
12371
12909
  constructor(date, mask, eventTime, location, linkedEvent, options) {
@@ -12378,7 +12916,7 @@ class CandleLightingEvent extends TimedEvent {
12378
12916
  /**
12379
12917
  * Havdalah event marking the end of Shabbat or a Yom Tov.
12380
12918
  *
12381
- * Generated by {@link HebrewCalendar.calendar} when `options.candlelighting`
12919
+ * Generated by {@link calendar} when `options.candlelighting`
12382
12920
  * is `true` and `options.location` is provided. By default Havdalah is
12383
12921
  * calculated by *tzeit hakochavim* (8.5° solar depression); pass
12384
12922
  * `options.havdalahMins` to use a fixed minute offset instead, or
@@ -12517,7 +13055,7 @@ function makeFastEndTime(zmanim, isTishaBav, options) {
12517
13055
  *
12518
13056
  * Wraps an underlying fast-day {@link HolidayEvent} and (when computable
12519
13057
  * for the given location) exposes a "Fast begins" and "Fast ends"
12520
- * {@link TimedEvent}. Generated by {@link HebrewCalendar.calendar} when
13058
+ * {@link TimedEvent}. Generated by {@link calendar} when
12521
13059
  * `options.candlelighting` is `true` and `options.location` is provided.
12522
13060
  *
12523
13061
  * - Minor fasts (including Yom Kippur Katan) begin at *Alot HaShachar*
@@ -12611,7 +13149,22 @@ function makeTimedEvent(ev, time, desc, options) {
12611
13149
  const hd = ev.getDate();
12612
13150
  return new TimedEvent(hd, desc, ev.getFlags(), time, location, ev, options);
12613
13151
  }
13152
+ /**
13153
+ * A Chanukah candle-lighting event that carries a specific time of day.
13154
+ *
13155
+ * Generated by {@link calendar} when both `options.candlelighting`
13156
+ * and `options.location` are set. On weekdays the time is Bein HaShmashos
13157
+ * (13.5 minutes before the sun is 7.083° below the horizon in the evening);
13158
+ * on Friday it is regular candle-lighting time, and on Saturday night it is
13159
+ * regular Havdalah time.
13160
+ */
12614
13161
  class TimedChanukahEvent extends ChanukahEvent {
13162
+ /**
13163
+ * Normally created by {@link calendar} rather than directly.
13164
+ * @param ev the untimed Chanukah event this is derived from
13165
+ * @param eventTime time at which candles are lit
13166
+ * @param location location used to format the time
13167
+ */
12615
13168
  constructor(ev, eventTime, location) {
12616
13169
  super(ev.getDate(), ev.getDesc(), ev.getFlags(), ev.chanukahDay);
12617
13170
  this.eventTime = Zmanim.roundTime(eventTime);
@@ -12639,7 +13192,69 @@ function makeWeekdayChanukahCandleLighting(ev, options) {
12639
13192
  return new TimedChanukahEvent(ev, candleLightingTime, location);
12640
13193
  }
12641
13194
 
12642
- const ps67lines$1=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters$1="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach$1=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines$1,lamnatzeachLetters:lamnatzeachLetters$1,anaBekoach:anaBekoach$1};
13195
+ var sefira = {
13196
+ "ps67lines": [
13197
+ "אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה",
13198
+ "לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ",
13199
+ "יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם",
13200
+ "יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה",
13201
+ "יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם",
13202
+ "אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ",
13203
+ "יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"
13204
+ ],
13205
+ "lamnatzeachLetters": "ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה",
13206
+ "anaBekoach": [
13207
+ "אָנָּא",
13208
+ "בְּכֹחַ",
13209
+ "גְּדֻלַּת",
13210
+ "יְמִינְךָ",
13211
+ "תַּתִּיר",
13212
+ "צְרוּרָה",
13213
+ "אב״ג ית״ץ",
13214
+ "קַבֵּל",
13215
+ "רִנַּת",
13216
+ "עַמְּךָ",
13217
+ "שַׂגְּבֵנוּ",
13218
+ "טַהֲרֵנוּ",
13219
+ "נוֹרָא",
13220
+ "קר״ע שט״ן",
13221
+ "נָא",
13222
+ "גִבּוֹר",
13223
+ "דּוֹרְשֵׁי",
13224
+ "יִחוּדְךָ",
13225
+ "כְּבָבַת",
13226
+ "שָׁמְרֵם",
13227
+ "נג״ד יכ״ש",
13228
+ "בָּרְכֵם",
13229
+ "טַהֲרֵם",
13230
+ "רַחֲמֵי",
13231
+ "צִדְקָתְךָ",
13232
+ "תָּמִיד",
13233
+ "גָּמְלֵם",
13234
+ "בט״ר צת״ג",
13235
+ "חֲסִין",
13236
+ "קָדוֹשׁ",
13237
+ "בְּרֹב",
13238
+ "טוּבְךָ",
13239
+ "נַהֵל",
13240
+ "עֲדָתֶךָ",
13241
+ "חק״ב תנ״ע",
13242
+ "יָחִיד",
13243
+ "גֵּאֶה",
13244
+ "לְעַמְּךָ",
13245
+ "פְּנֵה",
13246
+ "זוֹכְרֵי",
13247
+ "קְדֻשָּׁתֶךָ",
13248
+ "יג״ל פז״ק",
13249
+ "שַׁוְעָתֵנוּ",
13250
+ "קַבֵּל",
13251
+ "וּשְׁמַע",
13252
+ "צַעֲקָתֵנוּ",
13253
+ "יוֹדֵעַ",
13254
+ "תַּעֲלוּמוֹת",
13255
+ "שק״ו צי״ת"
13256
+ ]
13257
+ };
12643
13258
 
12644
13259
  const sefirot = {
12645
13260
  en: {
@@ -12841,7 +13456,7 @@ const lamnatzeachLetters = sefira.lamnatzeachLetters.split('');
12841
13456
  * const ev = new OmerEvent(new HDate(16, months.NISAN, 5784), 1);
12842
13457
  * ev.render('en'); // '1st day of the Omer'
12843
13458
  * ev.render('he'); // 'א׳ בָּעוֹמֶר'
12844
- * ev.sefira('translit'); // 'Chesed shebChesed'
13459
+ * ev.sefira('translit'); // "Chesed sheb'Chesed"
12845
13460
  * ev.getTodayIs('en'); // 'Today is 1 day of the Omer'
12846
13461
  */
12847
13462
  class OmerEvent extends Event {
@@ -12936,17 +13551,33 @@ class OmerEvent extends Event {
12936
13551
  }
12937
13552
  return String.fromCodePoint(codePoint);
12938
13553
  }
13554
+ /**
13555
+ * Number of *completed* weeks of the Omer. On day 7 this returns `1`; on
13556
+ * day 8 it also returns `1`, because the second week is still in progress.
13557
+ * Pair with {@link getDaysWithinWeeks} to render "N weeks and M days".
13558
+ */
12939
13559
  getWeeks() {
12940
13560
  const day7 = this.daysWithinWeeks === 7;
12941
13561
  return day7 ? this.weekNumber : this.weekNumber - 1;
12942
13562
  }
13563
+ /**
13564
+ * Day within the current week, from `1` through `7`.
13565
+ */
12943
13566
  getDaysWithinWeeks() {
12944
13567
  return this.daysWithinWeeks;
12945
13568
  }
12946
13569
  /**
12947
13570
  * Returns a sentence with that evening's omer count
12948
- * @returns a string such as `Today is 10 days, which is 1 week and 3 days of the Omer`
12949
- * or `הַיוֹם עֲשָׂרָה יָמִים, שְׁהֵם שָׁבוּעַ אֶחָד וְשְׁלוֹשָׁה יָמִים לָעוֹמֶר`
13571
+ * @example
13572
+ * import {OmerEvent, HDate, months} from '@hebcal/core';
13573
+ * const ev = new OmerEvent(new HDate(25, months.NISAN, 5784), 10);
13574
+ * ev.getTodayIs('en');
13575
+ * // => 'Today is 10 days, which are 1 week and 3 days of the Omer'
13576
+ * ev.getTodayIs('he');
13577
+ * // => 'הַיּוֹם עֲשָׂרָה יָמִים, שֶׁהֵם שָׁבֽוּעַ אֶחָד וּשְׁלוֹשָׁה יָמִים לָעֽוֹמֶר'
13578
+ * @param locale locale name; Hebrew locales (`he`, `he-x-NoNikud`) produce
13579
+ * the Hebrew formula, anything else produces English. Defaults to `en`
13580
+ * when empty.
12950
13581
  */
12951
13582
  getTodayIs(locale) {
12952
13583
  locale = (locale || 'en').toLowerCase();
@@ -13160,6 +13791,14 @@ function renderParshaName(parsha, locale) {
13160
13791
  * `@hebcal/leyning` when the display title and exact Torah readings are needed.
13161
13792
  */
13162
13793
  class ParshaEvent extends Event {
13794
+ /**
13795
+ * Normally created by {@link calendar} (via `options.sedrot`)
13796
+ * rather than directly.
13797
+ * @param parsha result from {@link Sedra.lookup}
13798
+ * @throws {TypeError} if called with anything other than exactly one argument
13799
+ * @throws {TypeError} if `parsha` is not a valid {@link SedraResult} — it must
13800
+ * have an `HDate` and one or two parsha names
13801
+ */
13163
13802
  constructor(parsha) {
13164
13803
  // eslint-disable-next-line prefer-rest-params
13165
13804
  if (arguments.length !== 1) {
@@ -13196,6 +13835,10 @@ class ParshaEvent extends Event {
13196
13835
  const url = 'https://www.hebcal.com/sedrot/' + urlFriendly(this.basename()) + '-' + dt;
13197
13836
  return this.p.il ? url + '?i=on' : url;
13198
13837
  }
13838
+ /**
13839
+ * The date portion of {@link url}, as `YYYYMMDD` — a parsha name recurs every
13840
+ * year, so the full date is needed to identify the reading.
13841
+ */
13199
13842
  urlDateSuffix() {
13200
13843
  const isoDate = isoDateString(this.greg());
13201
13844
  return isoDate.replaceAll('-', '');
@@ -13217,8 +13860,8 @@ class ParshaEvent extends Event {
13217
13860
  * @example
13218
13861
  * import {parshaYear} from '@hebcal/core';
13219
13862
  * const events = parshaYear(5784, false);
13220
- * events[0].render('en'); // 'Parashat Vayeilech'
13221
- * events[0].getDate().toString(); // '4 Tishrei 5784'
13863
+ * events[0].render('en'); // 'Parashat Ha’azinu'
13864
+ * events[0].getDate().toString(); // '8 Tishrei 5784'
13222
13865
  * @param year Hebrew year
13223
13866
  * @param il Israel (false for Diaspora)
13224
13867
  * @returns an array of `ParshaEvent` occurring on Saturdays that contain a regular
@@ -13239,183 +13882,6 @@ function parshaYear(year, il) {
13239
13882
  return events;
13240
13883
  }
13241
13884
 
13242
- const mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';
13243
- /** Represents Mevarchim haChodesh, the announcement of the new month */
13244
- class MevarchimChodeshEvent extends Event {
13245
- /**
13246
- * Constructs Mevarchim haChodesh event
13247
- * @param date Hebrew date event occurs
13248
- * @param monthName Hebrew month name (not translated)
13249
- * @param [memo]
13250
- * @param locale Optional locale name
13251
- */
13252
- constructor(date, monthName, memo, locale) {
13253
- super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
13254
- this.monthName = Locale.gettext(monthName, locale);
13255
- if (memo) {
13256
- this.memo = memo;
13257
- }
13258
- else {
13259
- const hyear = date.getFullYear();
13260
- const hmonth = date.getMonth();
13261
- const monNext = hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;
13262
- const molad = new Molad(hyear, monNext);
13263
- this.memo = molad.render('en', { hour12: false });
13264
- }
13265
- }
13266
- basename() {
13267
- return this.getDesc();
13268
- }
13269
- /**
13270
- * Returns (translated) description of this event
13271
- * @param [locale] Optional locale name (defaults to empty locale)
13272
- */
13273
- render(locale) {
13274
- const monthName0 = Locale.gettext(this.monthName, locale);
13275
- const monthName = smartApostrophe(monthName0);
13276
- return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;
13277
- }
13278
- /**
13279
- * Returns (translated) description of this event
13280
- * @param [locale] Optional locale name (defaults to empty locale)
13281
- */
13282
- renderBrief(locale) {
13283
- const str = this.render(locale);
13284
- const space = str.indexOf(' ');
13285
- return str.substring(space + 1);
13286
- }
13287
- }
13288
-
13289
- const cals = new Map();
13290
- /**
13291
- * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
13292
- * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
13293
- *
13294
- * `@hebcal/core` itself contains no learning schedules — they are provided
13295
- * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}
13296
- * package, which calls {@link DailyLearning.addCalendar} on import. After
13297
- * `@hebcal/learning` is loaded, `HebrewCalendar.calendar()` will emit
13298
- * learning events when the corresponding `options.dailyLearning` flag is set.
13299
- *
13300
- * @example
13301
- * import '@hebcal/learning';
13302
- * import {DailyLearning, HDate} from '@hebcal/core';
13303
- *
13304
- * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);
13305
- * console.log(ev?.render('en')); // e.g. 'Berakhot 2'
13306
- */
13307
- class DailyLearning {
13308
- /**
13309
- * Registers a new learning calendar.
13310
- *
13311
- * The provided function is called whenever a caller asks for an event
13312
- * from this calendar; if no learning occurs that day (e.g. the date is
13313
- * before the cycle's start) it should return `null`.
13314
- * @example
13315
- * DailyLearning.addCalendar(
13316
- * 'myCalendar',
13317
- * (hd, il) => new Event(hd, 'Today\'s learning', 0),
13318
- * new HDate(1, 'Tishrei', 5780),
13319
- * );
13320
- * @param name case insensitive
13321
- * @param calendar a function that returns an `Event` or `null`
13322
- * @param startDate the first date for which this calendar is valid
13323
- */
13324
- static addCalendar(name, calendar, startDate) {
13325
- if (typeof calendar !== 'function') {
13326
- throw new TypeError(`Invalid calendar function: ${calendar}`);
13327
- }
13328
- cals.set(name.toLowerCase(), {
13329
- fn: calendar,
13330
- startDate: startDate,
13331
- });
13332
- }
13333
- /**
13334
- * Returns the learning event for the given date from the named calendar,
13335
- * or `null` if there is no learning that day (or the named calendar is
13336
- * not registered).
13337
- * @example
13338
- * import '@hebcal/learning';
13339
- * import {DailyLearning, HDate} from '@hebcal/core';
13340
- * DailyLearning.lookup('dafYomi', new HDate(2024, 1, 15), false);
13341
- * @param name case insensitive
13342
- * @param hd Hebrew Date
13343
- * @param il true for Israel, false for Diaspora
13344
- */
13345
- static lookup(name, hd, il) {
13346
- const cal = cals.get(name.toLowerCase());
13347
- if (typeof cal === 'object') {
13348
- return cal.fn(hd, il);
13349
- }
13350
- return null;
13351
- }
13352
- /**
13353
- * Returns the first Hebrew date for which the named learning calendar
13354
- * is valid (as registered by {@link addCalendar}), or `undefined` if the
13355
- * calendar was not registered with a start date or is not registered at all.
13356
- * @param name case insensitive
13357
- */
13358
- static getStartDate(name) {
13359
- const cal = cals.get(name.toLowerCase());
13360
- if (typeof cal === 'object') {
13361
- return cal.startDate;
13362
- }
13363
- return undefined;
13364
- }
13365
- /**
13366
- * Returns `true` if a learning calendar with the given name has been
13367
- * registered via {@link addCalendar}.
13368
- * @param name case insensitive
13369
- */
13370
- static has(name) {
13371
- return cals.has(name.toLowerCase());
13372
- }
13373
- /**
13374
- * Returns the (lower-cased) names of all currently-registered learning
13375
- * calendars.
13376
- */
13377
- static getCalendars() {
13378
- return Array.from(cals.keys());
13379
- }
13380
- }
13381
-
13382
- const NONE = 0;
13383
- const HALF = 1;
13384
- const WHOLE = 2;
13385
- /**
13386
- * @private
13387
- */
13388
- function hallel_(events, hdate) {
13389
- const abs = hdate.abs();
13390
- for (const ev of events) {
13391
- const hd = ev.getDate();
13392
- if (hd.abs() !== abs) {
13393
- continue;
13394
- }
13395
- const desc = ev.getDesc();
13396
- const month = hd.getMonth();
13397
- const mday = hd.getDate();
13398
- const mask = ev.getFlags();
13399
- if (desc.startsWith('Chanukah') ||
13400
- desc.startsWith('Shavuot') ||
13401
- desc.startsWith('Sukkot') ||
13402
- (month === months.NISAN &&
13403
- (mday === 15 || mday === 16) &&
13404
- mask & flags.CHAG) || // Pesach
13405
- desc === holidayDesc.YOM_HAATZMA_UT ||
13406
- desc === holidayDesc.YOM_YERUSHALAYIM) {
13407
- return WHOLE;
13408
- }
13409
- if (mask & flags.ROSH_CHODESH ||
13410
- (desc.startsWith('Pesach') &&
13411
- desc !== holidayDesc.PESACH_I &&
13412
- desc !== holidayDesc.PESACH_II)) {
13413
- return HALF;
13414
- }
13415
- }
13416
- return NONE;
13417
- }
13418
-
13419
13885
  const TISHREI = months.TISHREI;
13420
13886
  /**
13421
13887
  * Gets the R.D. days for a number, Date, or HDate
@@ -13523,6 +13989,147 @@ function startEndHebrew(theMonth, theYear, numYears) {
13523
13989
  return [startAbs, endAbs];
13524
13990
  }
13525
13991
 
13992
+ const cals = new Map();
13993
+ /**
13994
+ * Plug-in registry for daily learning calendars such as Daf Yomi (Bavli),
13995
+ * Yerushalmi Yomi, Mishna Yomi, Nach Yomi, etc.
13996
+ *
13997
+ * `@hebcal/core` itself contains no learning schedules — they are provided
13998
+ * by the {@link https://github.com/hebcal/hebcal-learning @hebcal/learning}
13999
+ * package, which calls {@link DailyLearning.addCalendar} on import. After
14000
+ * `@hebcal/learning` is loaded, `calendar()` will emit
14001
+ * learning events when the corresponding `options.dailyLearning` flag is set.
14002
+ *
14003
+ * @example
14004
+ * import '@hebcal/learning';
14005
+ * import {DailyLearning, HDate} from '@hebcal/core';
14006
+ *
14007
+ * const ev = DailyLearning.lookup('dafYomi', new HDate(), false);
14008
+ * console.log(ev?.render('en')); // e.g. 'Daf Yomi: Berakhot 2'
14009
+ */
14010
+ class DailyLearning {
14011
+ /**
14012
+ * Registers a new learning calendar.
14013
+ *
14014
+ * The provided function is called whenever a caller asks for an event
14015
+ * from this calendar; if no learning occurs that day (e.g. the date is
14016
+ * before the cycle's start) it should return `null`.
14017
+ * @example
14018
+ * DailyLearning.addCalendar(
14019
+ * 'myCalendar',
14020
+ * (hd, il) => new Event(hd, 'Today\'s learning', 0),
14021
+ * new HDate(1, 'Tishrei', 5780),
14022
+ * );
14023
+ * @param name case insensitive
14024
+ * @param calendar a function that returns an `Event` or `null`
14025
+ * @param startDate the first date for which this calendar is valid
14026
+ */
14027
+ static addCalendar(name, calendar, startDate) {
14028
+ if (typeof calendar !== 'function') {
14029
+ throw new TypeError(`Invalid calendar function: ${calendar}`);
14030
+ }
14031
+ cals.set(name.toLowerCase(), {
14032
+ fn: calendar,
14033
+ startDate: startDate,
14034
+ });
14035
+ }
14036
+ /**
14037
+ * Returns the learning event for the given date from the named calendar,
14038
+ * or `null` if there is no learning that day (or the named calendar is
14039
+ * not registered).
14040
+ * @example
14041
+ * import '@hebcal/learning';
14042
+ * import {DailyLearning, HDate, months} from '@hebcal/core';
14043
+ * DailyLearning.lookup('dafYomi', new HDate(15, months.CHESHVAN, 5784), false);
14044
+ * @param name case insensitive
14045
+ * @param hd Hebrew Date
14046
+ * @param il true for Israel, false for Diaspora
14047
+ */
14048
+ static lookup(name, hd, il) {
14049
+ const cal = cals.get(name.toLowerCase());
14050
+ if (typeof cal === 'object') {
14051
+ return cal.fn(hd, il);
14052
+ }
14053
+ return null;
14054
+ }
14055
+ /**
14056
+ * Returns the first Hebrew date for which the named learning calendar
14057
+ * is valid (as registered by {@link addCalendar}), or `undefined` if the
14058
+ * calendar was not registered with a start date or is not registered at all.
14059
+ * @param name case insensitive
14060
+ */
14061
+ static getStartDate(name) {
14062
+ const cal = cals.get(name.toLowerCase());
14063
+ if (typeof cal === 'object') {
14064
+ return cal.startDate;
14065
+ }
14066
+ return undefined;
14067
+ }
14068
+ /**
14069
+ * Returns `true` if a learning calendar with the given name has been
14070
+ * registered via {@link addCalendar}.
14071
+ * @param name case insensitive
14072
+ */
14073
+ static has(name) {
14074
+ return cals.has(name.toLowerCase());
14075
+ }
14076
+ /**
14077
+ * Returns the (lower-cased) names of all currently-registered learning
14078
+ * calendars.
14079
+ */
14080
+ static getCalendars() {
14081
+ return Array.from(cals.keys());
14082
+ }
14083
+ }
14084
+
14085
+ const mevarchimChodeshStr = 'Shabbat Mevarchim Chodesh';
14086
+ /** Represents Mevarchim haChodesh, the announcement of the new month */
14087
+ class MevarchimChodeshEvent extends Event {
14088
+ /**
14089
+ * Constructs Mevarchim haChodesh event
14090
+ * @param date Hebrew date event occurs
14091
+ * @param monthName Hebrew month name (not translated)
14092
+ * @param memo text for the event memo. When falsy, a memo announcing the
14093
+ * molad of the upcoming month is generated automatically
14094
+ * @param locale Optional locale name
14095
+ */
14096
+ constructor(date, monthName, memo, locale) {
14097
+ super(date, `${mevarchimChodeshStr} ${monthName}`, flags.SHABBAT_MEVARCHIM);
14098
+ this.monthName = Locale.gettext(monthName, locale);
14099
+ if (memo) {
14100
+ this.memo = memo;
14101
+ }
14102
+ else {
14103
+ const hyear = date.getFullYear();
14104
+ const hmonth = date.getMonth();
14105
+ const monNext = hmonth === HDate.monthsInYear(hyear) ? months.NISAN : hmonth + 1;
14106
+ const molad = new Molad(hyear, monNext);
14107
+ this.memo = molad.render('en', { hour12: false });
14108
+ }
14109
+ }
14110
+ basename() {
14111
+ return this.getDesc();
14112
+ }
14113
+ /**
14114
+ * Returns (translated) description of this event
14115
+ * @param [locale] Optional locale name (defaults to empty locale)
14116
+ */
14117
+ render(locale) {
14118
+ const monthName0 = Locale.gettext(this.monthName, locale);
14119
+ const monthName = smartApostrophe(monthName0);
14120
+ return Locale.gettext(mevarchimChodeshStr, locale) + ' ' + monthName;
14121
+ }
14122
+ /**
14123
+ * Returns (translated) description of this event
14124
+ * @param [locale] Optional locale name (defaults to empty locale)
14125
+ */
14126
+ renderBrief(locale) {
14127
+ const str = this.render(locale);
14128
+ const space = str.indexOf(' ');
14129
+ return str.substring(space + 1);
14130
+ }
14131
+ }
14132
+
13526
14133
  /**
13527
14134
  * Calculates holidays and other Hebrew calendar events based on {@link CalOptions}.
13528
14135
  *
@@ -13533,7 +14140,7 @@ function startEndHebrew(theMonth, theYear, numYears) {
13533
14140
  * The date range returned by this function can be controlled by:
13534
14141
  * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
13535
14142
  * * `options.isHebrewYear` - to interpret `year` as Hebrew year
13536
- * * `options.numYears` - generate calendar for multiple years (default 1)
14143
+ * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)
13537
14144
  * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)
13538
14145
  *
13539
14146
  * Alternatively, specify start and end days with `Date` or {@link HDate} instances:
@@ -13577,7 +14184,8 @@ function startEndHebrew(theMonth, theYear, numYears) {
13577
14184
  *
13578
14185
  * To add candle-lighting options, set `options.candlelighting=true` and set
13579
14186
  * `options.location` to an instance of `Location`. By default, candle lighting
13580
- * time is 18 minutes before sundown (40 minutes for Jerusalem,
14187
+ * time is 18 minutes before sundown in the Diaspora and 20 minutes before
14188
+ * sundown in Israel (40 minutes for Jerusalem,
13581
14189
  * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is
13582
14190
  * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
13583
14191
  * are observable in the night time sky with the naked eye). The default Havdalah
@@ -13597,9 +14205,18 @@ function startEndHebrew(theMonth, theYear, numYears) {
13597
14205
  * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
13598
14206
  * Saturday night (see above).
13599
14207
  *
13600
- * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
13601
- * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
13602
- * in the evening).
14208
+ * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning).
14209
+ * They end when 3 medium-sized stars are observable in the night sky (sun is 7.083°
14210
+ * below the horizon in the evening) in the Diaspora, or 15 minutes after sunset in
14211
+ * Israel (Rabbi Deblitzky's practice). Override with:
14212
+ * * `options.fastEndDeg` - degrees of solar depression for the end of a minor fast
14213
+ * * `options.fastEndMins` - minutes after sunset for the end of a minor fast
14214
+ * (mutually exclusive with `options.fastEndDeg`)
14215
+ *
14216
+ * Tish'a B'Av is different: it begins at sunset on the previous day and always ends
14217
+ * at tzeit 6.45° (Rabbi Yechiel Michel Tucazinsky), ignoring `options.fastEndDeg`
14218
+ * and `options.fastEndMins`. When a minor fast falls on a Friday the end time is
14219
+ * suppressed, because Shabbat begins before nightfall.
13603
14220
  *
13604
14221
  * Two options also exist for generating an Event with the Hebrew date:
13605
14222
  * * `options.addHebrewDates` - print the Hebrew date for the entire date range
@@ -13616,7 +14233,7 @@ function startEndHebrew(theMonth, theYear, numYears) {
13616
14233
  * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package
13617
14234
  *
13618
14235
  * @example
13619
- * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
14236
+ * import {calendar, Location} from '@hebcal/core';
13620
14237
  * const options: CalOptions = {
13621
14238
  * year: 1981,
13622
14239
  * isHebrewYear: false,
@@ -13625,7 +14242,7 @@ function startEndHebrew(theMonth, theYear, numYears) {
13625
14242
  * sedrot: true,
13626
14243
  * omer: true,
13627
14244
  * };
13628
- * const events = HebrewCalendar.calendar(options);
14245
+ * const events = calendar(options);
13629
14246
  * for (const ev of events) {
13630
14247
  * const hd = ev.getDate();
13631
14248
  * const date = hd.greg();
@@ -13852,8 +14469,11 @@ function warnUnrecognizedOptions(options) {
13852
14469
  }
13853
14470
  }
13854
14471
  if (options.dailyLearning) {
13855
- for (const k of Object.keys(options.dailyLearning)) {
13856
- if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(k)) {
14472
+ for (const [k, val] of Object.entries(options.dailyLearning)) {
14473
+ // Resolve aliases (e.g. `yerushalmi` -> `yerushalmi-vilna`) the same way
14474
+ // makeDailyLearning() does, so a valid option doesn't warn spuriously.
14475
+ const name = dailyLearningName(k, val);
14476
+ if (!unrecognizedAlreadyWarned.has(k) && !DailyLearning.has(name)) {
13857
14477
  console.warn(`Ignoring unrecognized DailyLearning calendar: ${k}`);
13858
14478
  unrecognizedAlreadyWarned.add(k);
13859
14479
  }
@@ -14222,6 +14842,43 @@ function makeBiurChametzEvent(hd, options) {
14222
14842
  return biurChametzEv;
14223
14843
  }
14224
14844
 
14845
+ const NONE = 0;
14846
+ const HALF = 1;
14847
+ const WHOLE = 2;
14848
+ /**
14849
+ * @private
14850
+ */
14851
+ function hallel_(events, hdate) {
14852
+ const abs = hdate.abs();
14853
+ for (const ev of events) {
14854
+ const hd = ev.getDate();
14855
+ if (hd.abs() !== abs) {
14856
+ continue;
14857
+ }
14858
+ const desc = ev.getDesc();
14859
+ const month = hd.getMonth();
14860
+ const mday = hd.getDate();
14861
+ const mask = ev.getFlags();
14862
+ if (desc.startsWith('Chanukah') ||
14863
+ desc.startsWith('Shavuot') ||
14864
+ desc.startsWith('Sukkot') ||
14865
+ (month === months.NISAN &&
14866
+ (mday === 15 || mday === 16) &&
14867
+ mask & flags.CHAG) || // Pesach
14868
+ desc === holidayDesc.YOM_HAATZMA_UT ||
14869
+ desc === holidayDesc.YOM_YERUSHALAYIM) {
14870
+ return WHOLE;
14871
+ }
14872
+ if (mask & flags.ROSH_CHODESH ||
14873
+ (desc.startsWith('Pesach') &&
14874
+ desc !== holidayDesc.PESACH_I &&
14875
+ desc !== holidayDesc.PESACH_II)) {
14876
+ return HALF;
14877
+ }
14878
+ }
14879
+ return NONE;
14880
+ }
14881
+
14225
14882
  /*
14226
14883
  Hebcal - A Jewish Calendar Generator
14227
14884
  Copyright (c) 1994-2020 Danny Sadinoff
@@ -14257,92 +14914,12 @@ class HebrewCalendar {
14257
14914
  * a description, flags and optional attributes.
14258
14915
  * If given no options, returns holidays for the Diaspora for the current Gregorian year.
14259
14916
  *
14260
- * The date range returned by this function can be controlled by:
14261
- * * `options.year` - Gregorian (e.g. 1993) or Hebrew year (e.g. 5749)
14262
- * * `options.isHebrewYear` - to interpret `year` as Hebrew year
14263
- * * `options.numYears` - generate calendar for multiple years (default 1, maximum 2000)
14264
- * * `options.month` - Gregorian or Hebrew month (to filter results to a single month)
14265
- *
14266
- * Alternatively, specify start and end days with `Date` or {@link HDate} instances:
14267
- * * `options.start` - use specific start date (requires `end` date)
14268
- * * `options.end` - use specific end date (requires `start` date)
14269
- *
14270
- * Unless `options.noHolidays == true`, default holidays include:
14271
- * * Major holidays - Rosh Hashana, Yom Kippur, Pesach, Sukkot, etc.
14272
- * * Minor holidays - Purim, Chanukah, Tu BiShvat, Lag BaOmer, etc.
14273
- * * Minor fasts - Ta'anit Esther, Tzom Gedaliah, etc. (unless `options.noMinorFast`)
14274
- * * Special Shabbatot - Shabbat Shekalim, Zachor, etc. (unless `options.noSpecialShabbat`)
14275
- * * Modern Holidays - Yom HaShoah, Yom HaAtzma'ut, etc. (unless `options.noModern`)
14276
- * * Rosh Chodesh (unless `options.noRoshChodesh`)
14277
- *
14278
- * Holiday and Torah reading schedules differ between Israel and the Disapora.
14279
- * Set `options.il=true` to use the Israeli schedule.
14280
- *
14281
- * Additional non-default event types can be specified:
14282
- * * Parashat HaShavua - weekly Torah Reading on Saturdays (`options.sedrot`)
14283
- * * Counting of the Omer (`options.omer`)
14284
- * * Shabbat Mevarchim HaChodesh on Saturday before Rosh Chodesh (`options.shabbatMevarchim`)
14285
- * * Molad announcement on Saturday before Rosh Chodesh (`options.molad`)
14286
- * * Yom Kippur Katan (`options.yomKippurKatan`)
14287
- * * Yizkor (`options.yizkor`)
14288
- *
14289
- * Daily Study of texts are supported by the
14290
- * {@link https://github.com/hebcal/hebcal-learning @hebcal/learning} package,
14291
- * for example:
14292
- * * Babylonian Talmud Daf Yomi (`options.dailyLearning.dafYomi`)
14293
- * * Jerusalem Talmud (Yerushalmi) Yomi (`options.dailyLearning.yerushalmi`)
14294
- * * Mishna Yomi (`options.dailyLearning.mishnaYomi`)
14295
- * * Nach Yomi (`options.dailyLearning.nachYomi`)
14296
- *
14297
- * Candle-lighting and Havdalah times are approximated using latitude and longitude
14298
- * specified by the {@link Location} class. The `Location` class contains a small
14299
- * database of cities with their associated geographic information and time-zone information.
14300
- * If you ever have any doubts about Hebcal's times, consult your local halachic authority.
14301
- * If you enter geographic coordinates above the arctic circle or antarctic circle,
14302
- * the times are guaranteed to be wrong.
14303
- *
14304
- * To add candle-lighting options, set `options.candlelighting=true` and set
14305
- * `options.location` to an instance of `Location`. By default, candle lighting
14306
- * time is 18 minutes before sundown (40 minutes for Jerusalem,
14307
- * 30 minutes for Haifa and Zikhron Ya'akov) and Havdalah is
14308
- * calculated according to Tzeit Hakochavim - Nightfall (the point when 3 small stars
14309
- * are observable in the night time sky with the naked eye). The default Havdalah
14310
- * option (Tzeit Hakochavim) is calculated when the sun is 8.5° below the horizon.
14311
- * These defaults can be changed using these options:
14312
- * * `options.candleLightingMins` - minutes before sundown to light candles
14313
- * * `options.havdalahMins` - minutes after sundown for Havdalah (typical values are 42, 50, or 72).
14314
- * Havdalah times are suppressed when `options.havdalahMins=0`.
14315
- * * `options.havdalahDeg` - degrees for solar depression for Havdalah.
14316
- * Default is 8.5 degrees for 3 small stars. Use 7.083 degrees for 3 medium-sized stars.
14317
- * Havdalah times are suppressed when `options.havdalahDeg=0`.
14318
- *
14319
- * If both `options.candlelighting=true` and `options.location` is specified,
14320
- * Chanukah candle-lighting times and minor fast start/end times will also be generated.
14321
- * Chanukah candle-lighting is at Bein HaShmashos (13.5 minutes before
14322
- * the sun is 7.083° below the horizon in the evening)
14323
- * on weekdays, at regular candle-lighting time on Fridays, and at regular Havdalah time on
14324
- * Saturday night (see above).
14325
- *
14326
- * Minor fasts begin at Alot HaShachar (sun is 16.1° below the horizon in the morning) and
14327
- * end when 3 medium-sized stars are observable in the night sky (sun is 7.083° below the horizon
14328
- * in the evening).
14329
- *
14330
- * Two options also exist for generating an Event with the Hebrew date:
14331
- * * `options.addHebrewDates` - print the Hebrew date for the entire date range
14332
- * * `options.addHebrewDatesForEvents` - print the Hebrew date for dates with some events
14333
- *
14334
- * Lastly, translation and transliteration of event titles is controlled by
14335
- * `options.locale` and the {@link Locale} API.
14336
- * `@hebcal/core` supports three locales by default:
14337
- * * `en` - default, Sephardic transliterations (e.g. "Shabbat")
14338
- * * `ashkenazi` - Ashkenazi transliterations (e.g. "Shabbos")
14339
- * * `he` - Hebrew (e.g. "שַׁבָּת")
14340
- *
14341
- * Additional locales (such as `ru` or `fr`) are supported by the
14342
- * {@link https://github.com/hebcal/hebcal-locales @hebcal/locales} package
14917
+ * This is a convenience wrapper around the standalone {@link calendar} function.
14918
+ * See {@link calendar} for the complete list of supported options, the
14919
+ * candle-lighting and Havdalah defaults, and notes on locales.
14343
14920
  *
14344
14921
  * @example
14345
- * import {HebrewCalendar, HDate, Location, Event} from '@hebcal/core';
14922
+ * import {HebrewCalendar, Location} from '@hebcal/core';
14346
14923
  * const options: CalOptions = {
14347
14924
  * year: 1981,
14348
14925
  * isHebrewYear: false,
@@ -14363,8 +14940,12 @@ class HebrewCalendar {
14363
14940
  }
14364
14941
  /**
14365
14942
  * Calculates a birthday or anniversary (non-yahrzeit).
14366
- * `hyear` must be after original `gdate` of anniversary.
14367
- * Returns `undefined` when requested year preceeds or is same as original year.
14943
+ * Returns `undefined` when `hyear` precedes the original year of `gdate`.
14944
+ *
14945
+ * When `hyear` is the original year, the original date is returned unchanged —
14946
+ * a "0th birthday" is a meaningful thing to ask for. This differs from
14947
+ * {@link getYahrzeit}, which returns `undefined` for the original year,
14948
+ * because a yahrzeit only has meaning from the first anniversary onward.
14368
14949
  *
14369
14950
  * Hebcal uses the algorithm defined in "Calendrical Calculations"
14370
14951
  * by Edward M. Reingold and Nachum Dershowitz.
@@ -14388,11 +14969,7 @@ class HebrewCalendar {
14388
14969
  * @returns anniversary occurring in `hyear`
14389
14970
  */
14390
14971
  static getBirthdayOrAnniversary(hyear, gdate) {
14391
- const dt = getBirthdayHD(hyear, gdate);
14392
- if (dt === undefined) {
14393
- return dt;
14394
- }
14395
- return new HDate(dt);
14972
+ return birthdayOrAnniversary(hyear, gdate);
14396
14973
  }
14397
14974
  /**
14398
14975
  * Calculates yahrzeit.
@@ -14429,11 +15006,7 @@ class HebrewCalendar {
14429
15006
  * @returns anniversary occurring in hyear
14430
15007
  */
14431
15008
  static getYahrzeit(hyear, gdate) {
14432
- const dt = getYahrzeitHD(hyear, gdate);
14433
- if (dt === undefined) {
14434
- return dt;
14435
- }
14436
- return new HDate(dt);
15009
+ return yahrzeit(hyear, gdate);
14437
15010
  }
14438
15011
  /**
14439
15012
  * Lower-level holidays interface, which returns a `Map` of `Event`s indexed by
@@ -14500,9 +15073,12 @@ class HebrewCalendar {
14500
15073
  * (Shabbat) to also be a sacred day.
14501
15074
  * @example
14502
15075
  * import {HebrewCalendar} from '@hebcal/core';
14503
- * // Thursday April 25, 2024 — first day of Pesach 5784, with Shabbat
14504
- * // chol ha-moed the next day, so Eruv Tavshilin is required:
14505
- * HebrewCalendar.eruvTavshilin(new Date(2024, 3, 25), false); // true
15076
+ * // Wednesday October 16, 2024 is Erev Sukkot 5785. In the Diaspora,
15077
+ * // Sukkot I falls on Thursday and Sukkot II on Friday, so Eruv
15078
+ * // Tavshilin is prepared on Wednesday:
15079
+ * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), false); // true
15080
+ * // In Israel there is only one day of Yom Tov, so Friday is a weekday:
15081
+ * HebrewCalendar.eruvTavshilin(new Date(2024, 9, 16), true); // false
14506
15082
  * @param date Gregorian or Hebrew date to test
14507
15083
  * @param il use the Israeli holiday schedule
14508
15084
  */
@@ -14534,14 +15110,14 @@ class HebrewCalendar {
14534
15110
  * HebrewCalendar.reformatTimeStr('20:30', 'pm', {hour12: false}); // '20:30'
14535
15111
  * @param timeStr - original time like "20:30"
14536
15112
  * @param suffix - "p" or "pm" or " P.M.". Add leading space if you want it
14537
- * @param options
15113
+ * @param options optional; `location`, `locale` and `hour12` are consulted
14538
15114
  */
14539
15115
  static reformatTimeStr(timeStr, suffix, options) {
14540
15116
  return reformatTimeStr(timeStr, suffix, options);
14541
15117
  }
14542
15118
  /**
14543
15119
  * Returns the semantic version string of the `@hebcal/core` package
14544
- * (e.g. `"5.10.0"`). Useful for logging or feature detection.
15120
+ * (e.g. `"6.8.2"`). Useful for logging or feature detection.
14545
15121
  */
14546
15122
  static version() {
14547
15123
  return version;
@@ -14554,10 +15130,10 @@ class HebrewCalendar {
14554
15130
  * since an internal LRU cache (~120 entries) avoids recomputing the
14555
15131
  * keviyah-specific reading pattern.
14556
15132
  * @example
14557
- * import {HebrewCalendar} from '@hebcal/core';
15133
+ * import {HebrewCalendar, HDate} from '@hebcal/core';
14558
15134
  * const sedra = HebrewCalendar.getSedra(5784, false);
14559
15135
  * const result = sedra.lookup(new HDate(15, 'Cheshvan', 5784));
14560
- * console.log(result.parsha); // ['Lech-Lecha']
15136
+ * console.log(result.parsha); // ['Vayera']
14561
15137
  * @param hyear Hebrew year
14562
15138
  * @param il Use Israel sedra schedule (`false` for Diaspora)
14563
15139
  */
@@ -14574,12 +15150,14 @@ class HebrewCalendar {
14574
15150
  * Yom Ha'atzmaut, and Yom Yerushalayim.
14575
15151
  *
14576
15152
  * Half Hallel is said on Rosh Chodesh (not Rosh Hashanah), and the last 6 days of Pesach.
14577
- * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
14578
15153
  * @example
14579
15154
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
14580
15155
  * HebrewCalendar.hallel(new HDate(25, months.KISLEV, 5784), false); // 2 (Chanukah)
14581
15156
  * HebrewCalendar.hallel(new HDate(1, months.SHVAT, 5784), false); // 1 (Rosh Chodesh)
14582
15157
  * HebrewCalendar.hallel(new HDate(2, months.SHVAT, 5784), false); // 0
15158
+ * @param hdate Hebrew date to test
15159
+ * @param il use the Israeli holiday schedule
15160
+ * @returns 0 for no Hallel, 1 for half Hallel, 2 for whole Hallel
14583
15161
  */
14584
15162
  static hallel(hdate, il) {
14585
15163
  const events = getHolidaysOnDate(hdate, il);
@@ -14606,12 +15184,18 @@ class HebrewCalendar {
14606
15184
  * @example
14607
15185
  * import {HebrewCalendar, HDate, months} from '@hebcal/core';
14608
15186
  * // Regular weekday — Tachanun is said at both services
14609
- * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
15187
+ * HebrewCalendar.tachanun(new HDate(4, months.SHVAT, 5784), false);
14610
15188
  * // => { shacharit: true, mincha: true, allCongs: true }
14611
15189
  *
15190
+ * // Friday 2 Sh'vat — said at Shacharit, but not at Mincha (erev Shabbat)
15191
+ * HebrewCalendar.tachanun(new HDate(2, months.SHVAT, 5784), false);
15192
+ * // => { shacharit: true, mincha: false, allCongs: true }
15193
+ *
14612
15194
  * // Rosh Chodesh — no Tachanun
14613
15195
  * HebrewCalendar.tachanun(new HDate(1, months.SHVAT, 5784), false);
14614
15196
  * // => { shacharit: false, mincha: false, allCongs: false }
15197
+ * @param hdate Hebrew date to test
15198
+ * @param il use the Israeli holiday schedule
14615
15199
  */
14616
15200
  static tachanun(hdate, il) {
14617
15201
  return tachanun(hdate, il);
@@ -14654,6 +15238,7 @@ exports.TimedEvent = TimedEvent;
14654
15238
  exports.YomKippurKatanEvent = YomKippurKatanEvent;
14655
15239
  exports.Zmanim = Zmanim;
14656
15240
  exports.calculateMolad = calculateMolad;
15241
+ exports.calendar = calendar;
14657
15242
  exports.flags = flags;
14658
15243
  exports.gematriya = gematriya;
14659
15244
  exports.gematriyaStrToNum = gematriyaStrToNum;
@@ -14667,6 +15252,7 @@ exports.isFastDay = isFastDay;
14667
15252
  exports.months = months;
14668
15253
  exports.parshaYear = parshaYear;
14669
15254
  exports.parshiot = parshiot;
15255
+ exports.reformatTimeStr = reformatTimeStr;
14670
15256
  exports.tachanun = tachanun;
14671
15257
  exports.version = version;
14672
15258