@hebcal/core 6.9.0 → 6.9.2

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 (102) hide show
  1. package/dist/bundle.js +258 -70
  2. package/dist/bundle.js.map +1 -1
  3. package/dist/bundle.min.js +8 -8
  4. package/dist/bundle.min.js.map +1 -1
  5. package/dist/esm/CalOptions.d.ts +1 -1
  6. package/dist/esm/DailyLearning.d.ts +1 -1
  7. package/dist/esm/DailyLearning.js +1 -1
  8. package/dist/esm/DailyLearning.js.map +1 -1
  9. package/dist/esm/HebrewDateEvent.d.ts +2 -2
  10. package/dist/esm/HebrewDateEvent.js +1 -1
  11. package/dist/esm/HebrewDateEvent.js.map +1 -1
  12. package/dist/esm/HolidayEvent.d.ts +2 -2
  13. package/dist/esm/HolidayEvent.js +1 -1
  14. package/dist/esm/HolidayEvent.js.map +1 -1
  15. package/dist/esm/MevarchimChodeshEvent.d.ts +2 -2
  16. package/dist/esm/MevarchimChodeshEvent.js +1 -1
  17. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  18. package/dist/esm/ParshaEvent.d.ts +3 -3
  19. package/dist/esm/ParshaEvent.js +1 -1
  20. package/dist/esm/ParshaEvent.js.map +1 -1
  21. package/dist/esm/TimedEvent.d.ts +4 -4
  22. package/dist/esm/TimedEvent.js +1 -1
  23. package/dist/esm/TimedEvent.js.map +1 -1
  24. package/dist/esm/YomKippurKatanEvent.d.ts +2 -2
  25. package/dist/esm/YomKippurKatanEvent.js +1 -1
  26. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  27. package/dist/esm/ashkenazi.po.js +1 -1
  28. package/dist/esm/calendar.d.ts +2 -2
  29. package/dist/esm/calendar.js +1 -1
  30. package/dist/esm/calendar.js.map +1 -1
  31. package/dist/esm/candles.d.ts +5 -5
  32. package/dist/esm/candles.js +1 -1
  33. package/dist/esm/candles.js.map +1 -1
  34. package/dist/esm/cities.json.d.ts +2 -0
  35. package/dist/esm/cities.json.js +68 -2
  36. package/dist/esm/cities.json.js.map +1 -1
  37. package/dist/esm/event.d.ts +1 -1
  38. package/dist/esm/event.js +1 -1
  39. package/dist/esm/event.js.map +1 -1
  40. package/dist/esm/getStartAndEnd.d.ts +1 -1
  41. package/dist/esm/getStartAndEnd.js +1 -1
  42. package/dist/esm/getStartAndEnd.js.map +1 -1
  43. package/dist/esm/hallel.d.ts +1 -1
  44. package/dist/esm/hallel.js +1 -1
  45. package/dist/esm/hallel.js.map +1 -1
  46. package/dist/esm/he-x-NoNikud.po.js +1 -1
  47. package/dist/esm/he.po.js +1 -1
  48. package/dist/esm/hebcal.d.ts +7 -7
  49. package/dist/esm/hebcal.js +1 -1
  50. package/dist/esm/hebcal.js.map +1 -1
  51. package/dist/esm/holidays.d.ts +1 -1
  52. package/dist/esm/holidays.js +1 -1
  53. package/dist/esm/holidays.js.map +1 -1
  54. package/dist/esm/index.d.ts +29 -29
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/isAssurBemlacha.d.ts +1 -1
  57. package/dist/esm/isAssurBemlacha.js +1 -1
  58. package/dist/esm/isAssurBemlacha.js.map +1 -1
  59. package/dist/esm/isAveilut.js +1 -1
  60. package/dist/esm/isFastDay.js +1 -1
  61. package/dist/esm/isFastDay.js.map +1 -1
  62. package/dist/esm/locale.js +1 -1
  63. package/dist/esm/locale.js.map +1 -1
  64. package/dist/esm/location.js +1 -1
  65. package/dist/esm/location.js.map +1 -1
  66. package/dist/esm/modern.js +1 -1
  67. package/dist/esm/molad.d.ts +3 -3
  68. package/dist/esm/molad.js +1 -1
  69. package/dist/esm/molad.js.map +1 -1
  70. package/dist/esm/moladBase.js +1 -1
  71. package/dist/esm/moladDate.d.ts +1 -1
  72. package/dist/esm/moladDate.js +1 -1
  73. package/dist/esm/moladDate.js.map +1 -1
  74. package/dist/esm/omer.d.ts +2 -2
  75. package/dist/esm/omer.js +1 -1
  76. package/dist/esm/omer.js.map +1 -1
  77. package/dist/esm/parshaName.js +1 -1
  78. package/dist/esm/parshaName.js.map +1 -1
  79. package/dist/esm/parshaYear.d.ts +1 -1
  80. package/dist/esm/parshaYear.js +1 -1
  81. package/dist/esm/parshaYear.js.map +1 -1
  82. package/dist/esm/pkgVersion.d.ts +1 -1
  83. package/dist/esm/pkgVersion.js +2 -2
  84. package/dist/esm/pkgVersion.js.map +1 -1
  85. package/dist/esm/reformatTimeStr.d.ts +1 -1
  86. package/dist/esm/reformatTimeStr.js +1 -1
  87. package/dist/esm/reformatTimeStr.js.map +1 -1
  88. package/dist/esm/sedra.d.ts +1 -1
  89. package/dist/esm/sedra.js +1 -1
  90. package/dist/esm/sedra.js.map +1 -1
  91. package/dist/esm/sefira.json.d.ts +6 -0
  92. package/dist/esm/sefira.json.js +65 -3
  93. package/dist/esm/sefira.json.js.map +1 -1
  94. package/dist/esm/staticHolidays.js +1 -1
  95. package/dist/esm/staticHolidays.js.map +1 -1
  96. package/dist/esm/string.js +1 -1
  97. package/dist/esm/tachanun.js +1 -1
  98. package/dist/esm/tachanun.js.map +1 -1
  99. package/dist/esm/zmanim.d.ts +18 -1
  100. package/dist/esm/zmanim.js +86 -55
  101. package/dist/esm/zmanim.js.map +1 -1
  102. package/package.json +18 -13
package/dist/bundle.js CHANGED
@@ -1,9 +1,9 @@
1
- /*! @hebcal/core v6.9.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.9.2, 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.9.0';
6
+ const version = '6.9.2';
7
7
 
8
8
  /*! @hebcal/hdate v0.22.7, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
9
9
  /** @private */
@@ -8057,12 +8057,36 @@ class NOAACalculator {
8057
8057
  * @return {Temporal.ZonedDateTime | null} The Date.
8058
8058
  */
8059
8059
  getDateFromTime(time, isSunrise) {
8060
- if (isNaN(time)) {
8060
+ const epochMillis = this.getEpochMillisFromTime(time, isSunrise);
8061
+ if (isNaN(epochMillis)) {
8061
8062
  return null;
8062
8063
  }
8064
+ return Temporal.Instant.fromEpochMilliseconds(epochMillis).toZonedDateTimeISO(this.geoLocation.getTimeZone());
8065
+ }
8066
+ /**
8067
+ * The instant that {@link getDateFromTime} describes, as milliseconds since
8068
+ * the epoch, without building a `Temporal.ZonedDateTime`.
8069
+ *
8070
+ * Constructing a `ZonedDateTime` costs roughly 750ns because the IANA zone
8071
+ * has to be resolved, and that dominates this calculation. Callers that only
8072
+ * want an instant — a `Date`, or the difference between two times — can skip
8073
+ * it. Deriving the instant arithmetically also avoids a `PlainTime`
8074
+ * allocation and turns the day rollover into a subtraction rather than a
8075
+ * ~610ns `PlainDate.add({days})`.
8076
+ *
8077
+ * @param {number} time
8078
+ * The time in the format 18.75 for 6:45:00 PM, as returned by
8079
+ * {@link getUTCSunrise} / {@link getUTCSunset}, i.e. already
8080
+ * normalized to `[0, 24)`.
8081
+ * @param {boolean} isSunrise true if the time is sunrise, and false if it is sunset
8082
+ * @return {number} milliseconds since the epoch, or `NaN` if `time` is `NaN`
8083
+ */
8084
+ getEpochMillisFromTime(time, isSunrise) {
8085
+ if (isNaN(time)) {
8086
+ return NaN;
8087
+ }
8063
8088
  let calculatedTime = time;
8064
- let cal = this.getAdjustedDate();
8065
- // let cal = new Temporal.PlainDate(adj.year, adj.month, adj.day);
8089
+ const cal = this.getAdjustedDate();
8066
8090
  const hours = Math.trunc(calculatedTime); // retain only the hours
8067
8091
  calculatedTime -= hours;
8068
8092
  const minutes = Math.trunc((calculatedTime *= 60)); // retain only the minutes
@@ -8072,19 +8096,24 @@ class NOAACalculator {
8072
8096
  // Check if a date transition has occurred, or is about to occur - this indicates the date of the event is
8073
8097
  // actually not the target date, but the day prior or after
8074
8098
  const localTimeHours = Math.trunc(this.geoLocation.getLongitude() / 15);
8099
+ let dayOffset = 0;
8075
8100
  if (isSunrise && localTimeHours + hours > 18) {
8076
- cal = cal.add({ days: -1 });
8077
- // cal = cal.minus({days: 1});
8101
+ dayOffset = -1;
8078
8102
  }
8079
8103
  else if (!isSunrise && localTimeHours + hours < 6) {
8080
- cal = cal.add({ days: 1 });
8104
+ dayOffset = 1;
8081
8105
  }
8082
- return cal
8083
- .toZonedDateTime({
8084
- timeZone: 'UTC',
8085
- plainTime: new Temporal.PlainTime(hours, minutes, seconds, Math.trunc(calculatedTime * 1000)),
8086
- })
8087
- .withTimeZone(this.geoLocation.getTimeZone());
8106
+ const year = cal.year;
8107
+ let millis = Date.UTC(year, cal.month - 1, cal.day, hours, minutes, seconds, Math.trunc(calculatedTime * 1000));
8108
+ if (year >= 0 && year < 100) {
8109
+ // Date.UTC() maps years 0-99 onto 1900-1999; setUTCFullYear() does not.
8110
+ // Worth the branch (about 3ns): @hebcal/core computes candle-lighting
8111
+ // times for early historical years rather than suppressing them.
8112
+ const d = new Date(millis);
8113
+ d.setUTCFullYear(year);
8114
+ millis = d.getTime();
8115
+ }
8116
+ return millis + dayOffset * 86400000;
8088
8117
  }
8089
8118
  /**
8090
8119
  * Return the <a href="http://en.wikipedia.org/wiki/Julian_day">Julian day</a> from a Java Calendar
@@ -8474,7 +8503,73 @@ class NOAACalculator {
8474
8503
  }
8475
8504
  }
8476
8505
 
8477
- 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"];
8506
+ var citiesJson = [
8507
+ "Ashdod|IL|31.79213|34.64966|Asia/Jerusalem|27",
8508
+ "Atlanta|US|33.749|-84.38798|America/New_York|336",
8509
+ "Austin|US|30.26715|-97.74306|America/Chicago|165",
8510
+ "Baghdad|IQ|33.34058|44.40088|Asia/Baghdad|41",
8511
+ "Beer Sheva|IL|31.25181|34.7913|Asia/Jerusalem|285",
8512
+ "Berlin|DE|52.52437|13.41053|Europe/Berlin|43",
8513
+ "Baltimore|US|39.29038|-76.61219|America/New_York|35",
8514
+ "Bogota|CO|4.60971|-74.08175|America/Bogota|2582",
8515
+ "Boston|US|42.35843|-71.05977|America/New_York|38",
8516
+ "Budapest|HU|47.49801|19.03991|Europe/Budapest|104",
8517
+ "Buenos Aires|AR|-34.61315|-58.37723|America/Argentina/Buenos_Aires|31",
8518
+ "Buffalo|US|42.88645|-78.87837|America/New_York|191",
8519
+ "Chicago|US|41.85003|-87.65005|America/Chicago|180",
8520
+ "Cincinnati|US|39.162|-84.45689|America/New_York|267",
8521
+ "Cleveland|US|41.4995|-81.69541|America/New_York|204",
8522
+ "Dallas|US|32.78306|-96.80667|America/Chicago|139",
8523
+ "Denver|US|39.73915|-104.9847|America/Denver|1636",
8524
+ "Detroit|US|42.33143|-83.04575|America/Detroit|192",
8525
+ "Eilat|IL|29.55805|34.94821|Asia/Jerusalem|63",
8526
+ "Gibraltar|GI|36.14474|-5.35257|Europe/Gibraltar|11",
8527
+ "Haifa|IL|32.81841|34.9885|Asia/Jerusalem|40",
8528
+ "Hawaii|US|21.30694|-157.85833|Pacific/Honolulu|18",
8529
+ "Helsinki|FI|60.16952|24.93545|Europe/Helsinki|26",
8530
+ "Houston|US|29.76328|-95.36327|America/Chicago|30",
8531
+ "Jerusalem|IL|31.76904|35.21633|Asia/Jerusalem|786",
8532
+ "Johannesburg|ZA|-26.20227|28.04363|Africa/Johannesburg|1767",
8533
+ "Kiev|UA|50.45466|30.5238|Europe/Kiev|187",
8534
+ "La Paz|BO|-16.5|-68.15|America/La_Paz|3782",
8535
+ "Livingston|US|40.79593|-74.31487|America/New_York|98",
8536
+ "Las Vegas|US|36.17497|-115.13722|America/Los_Angeles|613",
8537
+ "London|GB|51.50853|-0.12574|Europe/London|25",
8538
+ "Los Angeles|US|34.05223|-118.24368|America/Los_Angeles|96",
8539
+ "Marseilles|FR|43.29695|5.38107|Europe/Paris|28",
8540
+ "Miami|US|25.77427|-80.19366|America/New_York|25",
8541
+ "Minneapolis|US|44.97997|-93.26384|America/Chicago|262",
8542
+ "Melbourne|AU|-37.814|144.96332|Australia/Melbourne|25",
8543
+ "Mexico City|MX|19.42847|-99.12766|America/Mexico_City|2240",
8544
+ "Montreal|CA|45.50884|-73.58781|America/Toronto|216",
8545
+ "Moscow|RU|55.75222|37.61556|Europe/Moscow|144",
8546
+ "New York|US|40.71427|-74.00597|America/New_York|57",
8547
+ "Omaha|US|41.25861|-95.93779|America/Chicago|315",
8548
+ "Ottawa|CA|45.41117|-75.69812|America/Toronto|71",
8549
+ "Panama City|PA|8.9936|-79.51973|America/Panama|17",
8550
+ "Paris|FR|48.85341|2.3488|Europe/Paris|42",
8551
+ "Pawtucket|US|41.87871|-71.38256|America/New_York|0",
8552
+ "Petach Tikvah|IL|32.08707|34.88747|Asia/Jerusalem|54",
8553
+ "Philadelphia|US|39.95233|-75.16379|America/New_York|8",
8554
+ "Phoenix|US|33.44838|-112.07404|America/Phoenix|366",
8555
+ "Pittsburgh|US|40.44062|-79.99589|America/New_York|239",
8556
+ "Providence|US|41.82399|-71.41283|America/New_York|0",
8557
+ "Portland|US|45.52345|-122.67621|America/Los_Angeles|15",
8558
+ "Saint Louis|US|38.62727|-90.19789|America/Chicago|149",
8559
+ "Saint Petersburg|RU|59.93863|30.31413|Europe/Moscow|11",
8560
+ "San Diego|US|32.71533|-117.15726|America/Los_Angeles|20",
8561
+ "San Francisco|US|37.77493|-122.41942|America/Los_Angeles|28",
8562
+ "Sao Paulo|BR|-23.5475|-46.63611|America/Sao_Paulo|769",
8563
+ "Seattle|US|47.60621|-122.33207|America/Los_Angeles|56",
8564
+ "Sydney|AU|-33.86785|151.20732|Australia/Sydney|58",
8565
+ "Tel Aviv|IL|32.08088|34.78057|Asia/Jerusalem|15",
8566
+ "Tiberias|IL|32.79221|35.53124|Asia/Jerusalem|0",
8567
+ "Toronto|CA|43.70011|-79.4163|America/Toronto|175",
8568
+ "Vancouver|CA|49.24966|-123.11934|America/Vancouver|70",
8569
+ "White Plains|US|41.03399|-73.76291|America/New_York|82",
8570
+ "Washington DC|US|38.89511|-77.03637|America/New_York|6",
8571
+ "Worcester|US|42.26259|-71.80229|America/New_York|164"
8572
+ ];
8478
8573
 
8479
8574
  class QuickLRU extends Map {
8480
8575
  #size = 0;
@@ -9658,13 +9753,17 @@ class MoladEvent extends Event {
9658
9753
  }
9659
9754
 
9660
9755
  /**
9756
+ * Converts an instant to a `Date`, discarding milliseconds.
9757
+ *
9758
+ * Zmanim are read out to the minute, and every accessor here reduces to an
9759
+ * instant, so we ask `@hebcal/noaa` for epoch milliseconds rather than a
9760
+ * `Temporal.ZonedDateTime`. Resolving the IANA zone to build a
9761
+ * `ZonedDateTime` costs roughly 750ns and nothing downstream uses it, which
9762
+ * made it the single most expensive step in a sunrise/sunset calculation.
9661
9763
  * @private
9662
9764
  */
9663
- function zdtToDate(zdt) {
9664
- if (zdt === null) {
9665
- return new Date(NaN);
9666
- }
9667
- const res = new Date(zdt.epochMilliseconds);
9765
+ function millisToDate(millis) {
9766
+ const res = new Date(millis);
9668
9767
  res.setMilliseconds(0);
9669
9768
  return res;
9670
9769
  }
@@ -9681,6 +9780,20 @@ const GEOMETRIC_ZENITH = 90;
9681
9780
  * @see Zmanim.sunsetBaalHatanya
9682
9781
  */
9683
9782
  const ZENITH_1_POINT_583 = GEOMETRIC_ZENITH + 1.583;
9783
+ /**
9784
+ * The zenith of civil twilight; the sun is 6° below the horizon.
9785
+ * Matches `NOAACalculator.CIVIL_ZENITH`.
9786
+ */
9787
+ const CIVIL_ZENITH = GEOMETRIC_ZENITH + 6;
9788
+ /**
9789
+ * Length of one temporal (halachic) hour in milliseconds, i.e. one twelfth of
9790
+ * the day. Mirrors `NOAACalculator.getTemporalHour()`, including its floor, so
9791
+ * that results stay identical to the `ZonedDateTime` code path.
9792
+ * @private
9793
+ */
9794
+ function temporalHourMillis(startOfDay, endOfDay) {
9795
+ return Math.floor((endOfDay - startOfDay) / 12);
9796
+ }
9684
9797
  /**
9685
9798
  * Calculate halachic times (zmanim / זְמַנִּים) for a given day and location.
9686
9799
  * Calculations are available for tzeit / tzais (nightfall),
@@ -9723,11 +9836,10 @@ class Zmanim {
9723
9836
  constructor(gloc, date, useElevation) {
9724
9837
  this.hdate = new HDate(date);
9725
9838
  const dt = isDate(date) ? date : this.hdate.greg();
9726
- this.plainDate = Temporal.PlainDate.from({
9727
- year: dt.getFullYear(),
9728
- month: dt.getMonth() + 1,
9729
- day: dt.getDate(),
9730
- });
9839
+ // The constructor is ~1.8x cheaper than PlainDate.from(), which has to
9840
+ // walk a property bag and apply overflow handling. The fields come from a
9841
+ // real Date, so they are always in range and never need constraining.
9842
+ this.plainDate = new Temporal.PlainDate(dt.getFullYear(), dt.getMonth() + 1, dt.getDate());
9731
9843
  this.gloc = gloc;
9732
9844
  this.noaa = new NOAACalculator(gloc, this.plainDate);
9733
9845
  this.useElevation = Boolean(useElevation);
@@ -9761,46 +9873,64 @@ class Zmanim {
9761
9873
  */
9762
9874
  timeAtAngle(angle, rising) {
9763
9875
  const offsetZenith = GEOMETRIC_ZENITH + angle;
9764
- const zdt = rising
9765
- ? this.noaa.getSunriseOffsetByDegrees(offsetZenith)
9766
- : this.noaa.getSunsetOffsetByDegrees(offsetZenith);
9767
- return zdtToDate(zdt);
9876
+ return millisToDate(rising
9877
+ ? this.sunriseMillis(offsetZenith, true)
9878
+ : this.sunsetMillis(offsetZenith, true));
9879
+ }
9880
+ /**
9881
+ * Sunrise for a given zenith as epoch milliseconds, mirroring what
9882
+ * `NOAACalculator.getSunrise()` / `getSeaLevelSunrise()` /
9883
+ * `getSunriseOffsetByDegrees()` compute, minus the `ZonedDateTime`.
9884
+ *
9885
+ * Note that noaa's degree-based accessors pass `adjustForElevation = true`
9886
+ * as well; the adjustment is a no-op unless the zenith is exactly
9887
+ * {@link GEOMETRIC_ZENITH}, which is why degree-based zmanim are unaffected
9888
+ * by elevation.
9889
+ * @private
9890
+ */
9891
+ sunriseMillis(zenith, useElevation) {
9892
+ const utc = useElevation
9893
+ ? this.noaa.getUTCSunrise0(zenith)
9894
+ : this.noaa.getUTCSeaLevelSunrise(zenith);
9895
+ return this.noaa.getEpochMillisFromTime(utc, true);
9896
+ }
9897
+ /**
9898
+ * Sunset counterpart of {@link sunriseMillis}.
9899
+ * @private
9900
+ */
9901
+ sunsetMillis(zenith, useElevation) {
9902
+ const utc = useElevation
9903
+ ? this.noaa.getUTCSunset0(zenith)
9904
+ : this.noaa.getUTCSeaLevelSunset(zenith);
9905
+ return this.noaa.getEpochMillisFromTime(utc, false);
9768
9906
  }
9769
9907
  /**
9770
9908
  * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon)
9771
9909
  * If elevation is enabled, this function will include elevation in the calculation.
9772
9910
  */
9773
9911
  sunrise() {
9774
- const zdt = this.useElevation
9775
- ? this.noaa.getSunrise()
9776
- : this.noaa.getSeaLevelSunrise();
9777
- return zdtToDate(zdt);
9912
+ return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation));
9778
9913
  }
9779
9914
  /**
9780
9915
  * Upper edge of the Sun appears over the eastern horizon in the morning (0.833° above horizon).
9781
9916
  * This function does not support elevation adjustment.
9782
9917
  */
9783
9918
  seaLevelSunrise() {
9784
- const zdt = this.noaa.getSeaLevelSunrise();
9785
- return zdtToDate(zdt);
9919
+ return millisToDate(this.sunriseMillis(GEOMETRIC_ZENITH, false));
9786
9920
  }
9787
9921
  /**
9788
9922
  * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).
9789
9923
  * If elevation is enabled, this function will include elevation in the calculation.
9790
9924
  */
9791
9925
  sunset() {
9792
- const zdt = this.useElevation
9793
- ? this.noaa.getSunset()
9794
- : this.noaa.getSeaLevelSunset();
9795
- return zdtToDate(zdt);
9926
+ return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation));
9796
9927
  }
9797
9928
  /**
9798
9929
  * When the upper edge of the Sun disappears below the horizon (0.833° below horizon).
9799
9930
  * This function does not support elevation adjustment.
9800
9931
  */
9801
9932
  seaLevelSunset() {
9802
- const zdt = this.noaa.getSeaLevelSunset();
9803
- return zdtToDate(zdt);
9933
+ return millisToDate(this.sunsetMillis(GEOMETRIC_ZENITH, false));
9804
9934
  }
9805
9935
  /**
9806
9936
  * Civil dawn; Sun is 6° below the horizon in the morning.
@@ -9808,8 +9938,7 @@ class Zmanim {
9808
9938
  * the result is not impacted by elevation.
9809
9939
  */
9810
9940
  dawn() {
9811
- const zdt = this.noaa.getBeginCivilTwilight();
9812
- return zdtToDate(zdt);
9941
+ return millisToDate(this.sunriseMillis(CIVIL_ZENITH, true));
9813
9942
  }
9814
9943
  /**
9815
9944
  * Civil dusk; Sun is 6° below the horizon in the evening.
@@ -9817,8 +9946,7 @@ class Zmanim {
9817
9946
  * the result is not impacted by elevation.
9818
9947
  */
9819
9948
  dusk() {
9820
- const zdt = this.noaa.getEndCivilTwilight();
9821
- return zdtToDate(zdt);
9949
+ return millisToDate(this.sunsetMillis(CIVIL_ZENITH, true));
9822
9950
  }
9823
9951
  /**
9824
9952
  * Returns sunset for the previous day.
@@ -9846,10 +9974,10 @@ class Zmanim {
9846
9974
  * `useElevation` setting.
9847
9975
  */
9848
9976
  chatzot() {
9849
- const startOfDay = this.noaa.getSeaLevelSunrise();
9850
- const endOfDay = this.noaa.getSeaLevelSunset();
9851
- const zdt = this.noaa.getSunTransit(startOfDay, endOfDay);
9852
- return zdtToDate(zdt);
9977
+ const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, false);
9978
+ const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, false);
9979
+ // NOAACalculator.getSunTransit(): sunrise plus 6 temporal hours
9980
+ return millisToDate(startOfDay + temporalHourMillis(startOfDay, endOfDay) * 6);
9853
9981
  }
9854
9982
  /**
9855
9983
  * Midnight – Chatzot; Sunset plus 6 halachic hours.
@@ -9903,25 +10031,18 @@ class Zmanim {
9903
10031
  misheyakirMachmir() {
9904
10032
  return this.timeAtAngle(10.2, true);
9905
10033
  }
9906
- getShaahZmanisBasedZmanZdt(startOfDay, endOfDay, hours) {
9907
- const temporalHour = this.noaa.getTemporalHour(startOfDay, endOfDay);
9908
- const offset = Math.trunc(temporalHour * hours);
9909
- const zdt = NOAACalculator.getTimeOffset(startOfDay, offset);
9910
- return zdt;
10034
+ getShaahZmanisBasedZmanMillis(startOfDay, endOfDay, hours) {
10035
+ const offset = Math.trunc(temporalHourMillis(startOfDay, endOfDay) * hours);
10036
+ return startOfDay + offset;
9911
10037
  }
9912
10038
  /**
9913
10039
  * Utility method for using elevation-aware sunrise/sunset
9914
10040
  * @param hours number of _shaos zmaniyos_ (solar hours) after sunrise
9915
10041
  */
9916
10042
  getShaahZmanisBasedZman(hours) {
9917
- const startOfDay = this.useElevation
9918
- ? this.noaa.getSunrise()
9919
- : this.noaa.getSeaLevelSunrise();
9920
- const endOfDay = this.useElevation
9921
- ? this.noaa.getSunset()
9922
- : this.noaa.getSeaLevelSunset();
9923
- const zdt = this.getShaahZmanisBasedZmanZdt(startOfDay, endOfDay, hours);
9924
- return zdtToDate(zdt);
10043
+ const startOfDay = this.sunriseMillis(GEOMETRIC_ZENITH, this.useElevation);
10044
+ const endOfDay = this.sunsetMillis(GEOMETRIC_ZENITH, this.useElevation);
10045
+ return millisToDate(this.getShaahZmanisBasedZmanMillis(startOfDay, endOfDay, hours));
9925
10046
  }
9926
10047
  /**
9927
10048
  * Latest Shema (Gra); Sunrise plus 3 halachic hours, according to the Gra.
@@ -10419,7 +10540,7 @@ class Zmanim {
10419
10540
  * where it does not set, `null` will be returned.
10420
10541
  */
10421
10542
  getSunriseBaalHatanya() {
10422
- return this.noaa.getSunriseOffsetByDegrees(ZENITH_1_POINT_583);
10543
+ return this.sunriseMillis(ZENITH_1_POINT_583, true);
10423
10544
  }
10424
10545
  /**
10425
10546
  * A method that returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s
@@ -10442,7 +10563,7 @@ class Zmanim {
10442
10563
  * rise, and one where it does not set, `null` will be returned.
10443
10564
  */
10444
10565
  getSunsetBaalHatanya() {
10445
- return this.noaa.getSunsetOffsetByDegrees(ZENITH_1_POINT_583);
10566
+ return this.sunsetMillis(ZENITH_1_POINT_583, true);
10446
10567
  }
10447
10568
  /**
10448
10569
  * Returns the [Baal Hatanya](https://en.wikipedia.org/wiki/Shneur_Zalman_of_Liadi)'s _alos_
@@ -10464,8 +10585,7 @@ class Zmanim {
10464
10585
  return this.timeAtAngle(16.9, true);
10465
10586
  }
10466
10587
  getShaahZmanisBaalHatanya(hours) {
10467
- const zdt = this.getShaahZmanisBasedZmanZdt(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), hours);
10468
- return zdtToDate(zdt);
10588
+ return millisToDate(this.getShaahZmanisBasedZmanMillis(this.getSunriseBaalHatanya(), this.getSunsetBaalHatanya(), hours));
10469
10589
  }
10470
10590
  /**
10471
10591
  * This method returns the latest _zman krias shema_ (time to recite Shema in the morning). This time is 3
@@ -10558,9 +10678,15 @@ class Zmanim {
10558
10678
  return 'XX:XX'; // Invalid Date
10559
10679
  }
10560
10680
  const time = timeFormat.format(dt);
10561
- const hm = time.split(':');
10562
- if (hm[0] === '24') {
10563
- return '00:' + hm[1];
10681
+ // Rewrite the h24 midnight ("24:15") that some locales produce. Checking
10682
+ // the two leading characters avoids the throwaway array that split(':')
10683
+ // allocated on every event; this runs once per timed event, and the
10684
+ // Intl.format() call above is already the expensive part.
10685
+ if (time.charCodeAt(0) === 0x32 && // '2'
10686
+ time.charCodeAt(1) === 0x34 && // '4'
10687
+ time.charCodeAt(2) === 0x3a // ':'
10688
+ ) {
10689
+ return '00' + time.substring(2);
10564
10690
  }
10565
10691
  return time;
10566
10692
  }
@@ -13126,7 +13252,69 @@ function makeWeekdayChanukahCandleLighting(ev, options) {
13126
13252
  return new TimedChanukahEvent(ev, candleLightingTime, location);
13127
13253
  }
13128
13254
 
13129
- const ps67lines$1=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters$1="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach$1=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines$1,lamnatzeachLetters:lamnatzeachLetters$1,anaBekoach:anaBekoach$1};
13255
+ var sefira = {
13256
+ "ps67lines": [
13257
+ "אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה",
13258
+ "לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ",
13259
+ "יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם",
13260
+ "יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה",
13261
+ "יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם",
13262
+ "אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ",
13263
+ "יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"
13264
+ ],
13265
+ "lamnatzeachLetters": "ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה",
13266
+ "anaBekoach": [
13267
+ "אָנָּא",
13268
+ "בְּכֹחַ",
13269
+ "גְּדֻלַּת",
13270
+ "יְמִינְךָ",
13271
+ "תַּתִּיר",
13272
+ "צְרוּרָה",
13273
+ "אב״ג ית״ץ",
13274
+ "קַבֵּל",
13275
+ "רִנַּת",
13276
+ "עַמְּךָ",
13277
+ "שַׂגְּבֵנוּ",
13278
+ "טַהֲרֵנוּ",
13279
+ "נוֹרָא",
13280
+ "קר״ע שט״ן",
13281
+ "נָא",
13282
+ "גִבּוֹר",
13283
+ "דּוֹרְשֵׁי",
13284
+ "יִחוּדְךָ",
13285
+ "כְּבָבַת",
13286
+ "שָׁמְרֵם",
13287
+ "נג״ד יכ״ש",
13288
+ "בָּרְכֵם",
13289
+ "טַהֲרֵם",
13290
+ "רַחֲמֵי",
13291
+ "צִדְקָתְךָ",
13292
+ "תָּמִיד",
13293
+ "גָּמְלֵם",
13294
+ "בט״ר צת״ג",
13295
+ "חֲסִין",
13296
+ "קָדוֹשׁ",
13297
+ "בְּרֹב",
13298
+ "טוּבְךָ",
13299
+ "נַהֵל",
13300
+ "עֲדָתֶךָ",
13301
+ "חק״ב תנ״ע",
13302
+ "יָחִיד",
13303
+ "גֵּאֶה",
13304
+ "לְעַמְּךָ",
13305
+ "פְּנֵה",
13306
+ "זוֹכְרֵי",
13307
+ "קְדֻשָּׁתֶךָ",
13308
+ "יג״ל פז״ק",
13309
+ "שַׁוְעָתֵנוּ",
13310
+ "קַבֵּל",
13311
+ "וּשְׁמַע",
13312
+ "צַעֲקָתֵנוּ",
13313
+ "יוֹדֵעַ",
13314
+ "תַּעֲלוּמוֹת",
13315
+ "שק״ו צי״ת"
13316
+ ]
13317
+ };
13130
13318
 
13131
13319
  const sefirot = {
13132
13320
  en: {