@hebcal/core 5.4.3 → 5.4.5
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.
- package/README.md +261 -301
- package/dist/bundle.js +214 -150
- package/dist/bundle.min.js +2 -2
- package/dist/index.cjs +218 -157
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +218 -157
- package/dist/pkgVersion.d.ts +1 -1
- package/dist/sedra.d.ts +2 -0
- package/dist/tachanun.d.ts +3 -0
- package/dist/zmanim.d.ts +44 -6
- package/package.json +8 -8
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/core v5.4.
|
|
1
|
+
/*! @hebcal/core v5.4.5 */
|
|
2
2
|
var hebcal = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -9432,6 +9432,12 @@ class Zmanim {
|
|
|
9432
9432
|
}
|
|
9433
9433
|
/**
|
|
9434
9434
|
* Latest Shacharit (Gra); Sunrise plus 4 halachic hours, according to the Gra.
|
|
9435
|
+
*
|
|
9436
|
+
* This method returns the latest *zman tfila* (time to recite shema in the morning)
|
|
9437
|
+
* that is 4 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
|
|
9438
|
+
* (depending on the `useElevation` setting), according
|
|
9439
|
+
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
9440
|
+
*
|
|
9435
9441
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
9436
9442
|
* @return {Date}
|
|
9437
9443
|
*/
|
|
@@ -9441,19 +9447,16 @@ class Zmanim {
|
|
|
9441
9447
|
/**
|
|
9442
9448
|
* Returns an array with alot (Date) and ms in hour (number)
|
|
9443
9449
|
* @private
|
|
9444
|
-
* @return {any[]}
|
|
9445
9450
|
*/
|
|
9446
|
-
getTemporalHour72() {
|
|
9447
|
-
const alot72 = this.sunriseOffset(-72, false,
|
|
9448
|
-
const tzeit72 = this.sunsetOffset(72, false,
|
|
9451
|
+
getTemporalHour72(forceSeaLevel) {
|
|
9452
|
+
const alot72 = this.sunriseOffset(-72, false, forceSeaLevel);
|
|
9453
|
+
const tzeit72 = this.sunsetOffset(72, false, forceSeaLevel);
|
|
9449
9454
|
const temporalHour = (tzeit72.getTime() - alot72.getTime()) / 12;
|
|
9450
9455
|
return [alot72, temporalHour];
|
|
9451
9456
|
}
|
|
9452
9457
|
/**
|
|
9453
9458
|
* Returns an array with alot (Date) and ms in hour (number)
|
|
9454
9459
|
* @private
|
|
9455
|
-
* @param {number} angle
|
|
9456
|
-
* @return {any[]}
|
|
9457
9460
|
*/
|
|
9458
9461
|
getTemporalHourByDeg(angle) {
|
|
9459
9462
|
const alot = this.timeAtAngle(angle, true);
|
|
@@ -9469,8 +9472,9 @@ class Zmanim {
|
|
|
9469
9472
|
* @return {Date}
|
|
9470
9473
|
*/
|
|
9471
9474
|
sofZmanShmaMGA() {
|
|
9472
|
-
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
9473
|
-
|
|
9475
|
+
const [alot72, temporalHour] = this.getTemporalHour72(true);
|
|
9476
|
+
const offset = Math.floor(3 * temporalHour);
|
|
9477
|
+
return new Date(alot72.getTime() + offset);
|
|
9474
9478
|
}
|
|
9475
9479
|
/**
|
|
9476
9480
|
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
@@ -9480,7 +9484,8 @@ class Zmanim {
|
|
|
9480
9484
|
*/
|
|
9481
9485
|
sofZmanShmaMGA16Point1() {
|
|
9482
9486
|
const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
|
|
9483
|
-
|
|
9487
|
+
const offset = Math.floor(3 * temporalHour);
|
|
9488
|
+
return new Date(alot.getTime() + offset);
|
|
9484
9489
|
}
|
|
9485
9490
|
/**
|
|
9486
9491
|
* Latest Shema (MGA); Sunrise plus 3 halachic hours, according to Magen Avraham.
|
|
@@ -9494,15 +9499,17 @@ class Zmanim {
|
|
|
9494
9499
|
*/
|
|
9495
9500
|
sofZmanShmaMGA19Point8() {
|
|
9496
9501
|
const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
|
|
9497
|
-
|
|
9502
|
+
const offset = Math.floor(3 * temporalHour);
|
|
9503
|
+
return new Date(alot.getTime() + offset);
|
|
9498
9504
|
}
|
|
9499
9505
|
/**
|
|
9500
9506
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham
|
|
9501
9507
|
* @return {Date}
|
|
9502
9508
|
*/
|
|
9503
9509
|
sofZmanTfillaMGA() {
|
|
9504
|
-
const [alot72, temporalHour] = this.getTemporalHour72();
|
|
9505
|
-
|
|
9510
|
+
const [alot72, temporalHour] = this.getTemporalHour72(true);
|
|
9511
|
+
const offset = Math.floor(4 * temporalHour);
|
|
9512
|
+
return new Date(alot72.getTime() + offset);
|
|
9506
9513
|
}
|
|
9507
9514
|
/**
|
|
9508
9515
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
|
|
@@ -9512,7 +9519,8 @@ class Zmanim {
|
|
|
9512
9519
|
*/
|
|
9513
9520
|
sofZmanTfillaMGA16Point1() {
|
|
9514
9521
|
const [alot, temporalHour] = this.getTemporalHourByDeg(16.1);
|
|
9515
|
-
|
|
9522
|
+
const offset = Math.floor(4 * temporalHour);
|
|
9523
|
+
return new Date(alot.getTime() + offset);
|
|
9516
9524
|
}
|
|
9517
9525
|
/**
|
|
9518
9526
|
* Latest Shacharit (MGA); Sunrise plus 4 halachic hours, according to Magen Avraham.
|
|
@@ -9526,24 +9534,67 @@ class Zmanim {
|
|
|
9526
9534
|
*/
|
|
9527
9535
|
sofZmanTfillaMGA19Point8() {
|
|
9528
9536
|
const [alot, temporalHour] = this.getTemporalHourByDeg(19.8);
|
|
9529
|
-
|
|
9537
|
+
const offset = Math.floor(4 * temporalHour);
|
|
9538
|
+
return new Date(alot.getTime() + offset);
|
|
9530
9539
|
}
|
|
9531
9540
|
/**
|
|
9532
|
-
* Earliest Mincha – Mincha Gedola; Sunrise plus 6.5 halachic hours.
|
|
9541
|
+
* Earliest Mincha – Mincha Gedola (GRA); Sunrise plus 6.5 halachic hours.
|
|
9533
9542
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
9543
|
+
*
|
|
9544
|
+
* This method returns the latest mincha gedola, the earliest time one can pray mincha
|
|
9545
|
+
* that is 6.5 shaos zmaniyos (solar hours) after sunrise or sea level sunrise
|
|
9546
|
+
* (depending on the `useElevation` setting), according
|
|
9547
|
+
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
9548
|
+
*
|
|
9549
|
+
* The Ramba"m is of the opinion that it is better to delay *mincha* until
|
|
9550
|
+
* *mincha ketana* while the Ra"sh, Tur, GRA and others are of the
|
|
9551
|
+
* opinion that *mincha* can be prayed *lechatchila* starting at *mincha gedola*.
|
|
9534
9552
|
* @return {Date}
|
|
9535
9553
|
*/
|
|
9536
9554
|
minchaGedola() {
|
|
9537
9555
|
return this.getShaahZmanisBasedZman(6.5);
|
|
9538
9556
|
}
|
|
9557
|
+
/**
|
|
9558
|
+
* Earliest Mincha – Mincha Gedola (MGA); Sunrise plus 6.5 halachic hours.
|
|
9559
|
+
* If elevation is enabled, this function will include elevation in the calculation.
|
|
9560
|
+
*
|
|
9561
|
+
* This method returns the time of *mincha gedola* according to the Magen Avraham
|
|
9562
|
+
* with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
|
|
9563
|
+
* This is the earliest time to pray *mincha*.
|
|
9564
|
+
* @return {Date}
|
|
9565
|
+
*/
|
|
9566
|
+
minchaGedolaMGA() {
|
|
9567
|
+
const [alot72, temporalHour] = this.getTemporalHour72(false);
|
|
9568
|
+
const offset = Math.floor(6.5 * temporalHour);
|
|
9569
|
+
return new Date(alot72.getTime() + offset);
|
|
9570
|
+
}
|
|
9539
9571
|
/**
|
|
9540
9572
|
* Preferable earliest time to recite Minchah – Mincha Ketana; Sunrise plus 9.5 halachic hours.
|
|
9541
9573
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
9574
|
+
*
|
|
9575
|
+
* This method returns *mincha ketana*, the preferred earliest time to pray *mincha* in the
|
|
9576
|
+
* opinion of the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others,
|
|
9577
|
+
* that is 9.5 *shaos zmaniyos* (solar hours) after sunrise or sea level sunrise
|
|
9578
|
+
* (depending on the `useElevation` setting), according
|
|
9579
|
+
* to the [GRA](https://en.wikipedia.org/wiki/Vilna_Gaon).
|
|
9542
9580
|
* @return {Date}
|
|
9543
9581
|
*/
|
|
9544
9582
|
minchaKetana() {
|
|
9545
9583
|
return this.getShaahZmanisBasedZman(9.5);
|
|
9546
9584
|
}
|
|
9585
|
+
/**
|
|
9586
|
+
* This method returns the time of *mincha ketana* according to the Magen Avraham
|
|
9587
|
+
* with the day starting 72 minutes before sunrise and ending 72 minutes after sunset.
|
|
9588
|
+
* This is the preferred earliest time to pray *mincha* according to the opinion of
|
|
9589
|
+
* the [Rambam](https://en.wikipedia.org/wiki/Maimonides) and others.
|
|
9590
|
+
*
|
|
9591
|
+
* If elevation is enabled, this function will include elevation in the calculation.
|
|
9592
|
+
* @return {Date}
|
|
9593
|
+
*/
|
|
9594
|
+
minchaKetanaMGA() {
|
|
9595
|
+
const [alot72, temporalHour] = this.getTemporalHour72(false);
|
|
9596
|
+
return new Date(alot72.getTime() + Math.floor(9.5 * temporalHour));
|
|
9597
|
+
}
|
|
9547
9598
|
/**
|
|
9548
9599
|
* Plag haMincha; Sunrise plus 10.75 halachic hours.
|
|
9549
9600
|
* If elevation is enabled, this function will include elevation in the calculation.
|
|
@@ -10042,12 +10093,6 @@ class OmerEvent extends Event {
|
|
|
10042
10093
|
}
|
|
10043
10094
|
|
|
10044
10095
|
class QuickLRU extends Map {
|
|
10045
|
-
#size = 0;
|
|
10046
|
-
#cache = new Map();
|
|
10047
|
-
#oldCache = new Map();
|
|
10048
|
-
#maxSize;
|
|
10049
|
-
#maxAge;
|
|
10050
|
-
#onEviction;
|
|
10051
10096
|
constructor() {
|
|
10052
10097
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10053
10098
|
super();
|
|
@@ -10057,102 +10102,104 @@ class QuickLRU extends Map {
|
|
|
10057
10102
|
if (typeof options.maxAge === 'number' && options.maxAge === 0) {
|
|
10058
10103
|
throw new TypeError('`maxAge` must be a number greater than 0');
|
|
10059
10104
|
}
|
|
10060
|
-
this.#maxSize = options.maxSize;
|
|
10061
|
-
this.#maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
10062
|
-
this.#onEviction = options.onEviction;
|
|
10063
|
-
}
|
|
10064
10105
|
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10106
|
+
// TODO: Use private class fields when ESLint supports them.
|
|
10107
|
+
this.maxSize = options.maxSize;
|
|
10108
|
+
this.maxAge = options.maxAge || Number.POSITIVE_INFINITY;
|
|
10109
|
+
this.onEviction = options.onEviction;
|
|
10110
|
+
this.cache = new Map();
|
|
10111
|
+
this.oldCache = new Map();
|
|
10112
|
+
this._size = 0;
|
|
10068
10113
|
}
|
|
10069
|
-
|
|
10070
|
-
|
|
10114
|
+
|
|
10115
|
+
// TODO: Use private class methods when targeting Node.js 16.
|
|
10116
|
+
_emitEvictions(cache) {
|
|
10117
|
+
if (typeof this.onEviction !== 'function') {
|
|
10071
10118
|
return;
|
|
10072
10119
|
}
|
|
10073
10120
|
for (const [key, item] of cache) {
|
|
10074
|
-
this
|
|
10121
|
+
this.onEviction(key, item.value);
|
|
10075
10122
|
}
|
|
10076
10123
|
}
|
|
10077
|
-
|
|
10124
|
+
_deleteIfExpired(key, item) {
|
|
10078
10125
|
if (typeof item.expiry === 'number' && item.expiry <= Date.now()) {
|
|
10079
|
-
if (typeof this
|
|
10080
|
-
this
|
|
10126
|
+
if (typeof this.onEviction === 'function') {
|
|
10127
|
+
this.onEviction(key, item.value);
|
|
10081
10128
|
}
|
|
10082
10129
|
return this.delete(key);
|
|
10083
10130
|
}
|
|
10084
10131
|
return false;
|
|
10085
10132
|
}
|
|
10086
|
-
|
|
10087
|
-
const deleted = this
|
|
10133
|
+
_getOrDeleteIfExpired(key, item) {
|
|
10134
|
+
const deleted = this._deleteIfExpired(key, item);
|
|
10088
10135
|
if (deleted === false) {
|
|
10089
10136
|
return item.value;
|
|
10090
10137
|
}
|
|
10091
10138
|
}
|
|
10092
|
-
|
|
10093
|
-
return item.expiry ? this
|
|
10139
|
+
_getItemValue(key, item) {
|
|
10140
|
+
return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value;
|
|
10094
10141
|
}
|
|
10095
|
-
|
|
10142
|
+
_peek(key, cache) {
|
|
10096
10143
|
const item = cache.get(key);
|
|
10097
|
-
return this
|
|
10144
|
+
return this._getItemValue(key, item);
|
|
10098
10145
|
}
|
|
10099
|
-
|
|
10100
|
-
this
|
|
10101
|
-
this
|
|
10102
|
-
if (this
|
|
10103
|
-
this
|
|
10104
|
-
this
|
|
10105
|
-
this
|
|
10106
|
-
this
|
|
10146
|
+
_set(key, value) {
|
|
10147
|
+
this.cache.set(key, value);
|
|
10148
|
+
this._size++;
|
|
10149
|
+
if (this._size >= this.maxSize) {
|
|
10150
|
+
this._size = 0;
|
|
10151
|
+
this._emitEvictions(this.oldCache);
|
|
10152
|
+
this.oldCache = this.cache;
|
|
10153
|
+
this.cache = new Map();
|
|
10107
10154
|
}
|
|
10108
10155
|
}
|
|
10109
|
-
|
|
10110
|
-
this
|
|
10111
|
-
this
|
|
10156
|
+
_moveToRecent(key, item) {
|
|
10157
|
+
this.oldCache.delete(key);
|
|
10158
|
+
this._set(key, item);
|
|
10112
10159
|
}
|
|
10113
|
-
|
|
10114
|
-
for (const item of this
|
|
10160
|
+
*_entriesAscending() {
|
|
10161
|
+
for (const item of this.oldCache) {
|
|
10115
10162
|
const [key, value] = item;
|
|
10116
|
-
if (!this
|
|
10117
|
-
const deleted = this
|
|
10163
|
+
if (!this.cache.has(key)) {
|
|
10164
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
10118
10165
|
if (deleted === false) {
|
|
10119
10166
|
yield item;
|
|
10120
10167
|
}
|
|
10121
10168
|
}
|
|
10122
10169
|
}
|
|
10123
|
-
for (const item of this
|
|
10170
|
+
for (const item of this.cache) {
|
|
10124
10171
|
const [key, value] = item;
|
|
10125
|
-
const deleted = this
|
|
10172
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
10126
10173
|
if (deleted === false) {
|
|
10127
10174
|
yield item;
|
|
10128
10175
|
}
|
|
10129
10176
|
}
|
|
10130
10177
|
}
|
|
10131
10178
|
get(key) {
|
|
10132
|
-
if (this
|
|
10133
|
-
const item = this
|
|
10134
|
-
return this
|
|
10135
|
-
}
|
|
10136
|
-
if (this
|
|
10137
|
-
const item = this
|
|
10138
|
-
if (this
|
|
10139
|
-
this
|
|
10179
|
+
if (this.cache.has(key)) {
|
|
10180
|
+
const item = this.cache.get(key);
|
|
10181
|
+
return this._getItemValue(key, item);
|
|
10182
|
+
}
|
|
10183
|
+
if (this.oldCache.has(key)) {
|
|
10184
|
+
const item = this.oldCache.get(key);
|
|
10185
|
+
if (this._deleteIfExpired(key, item) === false) {
|
|
10186
|
+
this._moveToRecent(key, item);
|
|
10140
10187
|
return item.value;
|
|
10141
10188
|
}
|
|
10142
10189
|
}
|
|
10143
10190
|
}
|
|
10144
10191
|
set(key, value) {
|
|
10145
10192
|
let {
|
|
10146
|
-
maxAge = this
|
|
10193
|
+
maxAge = this.maxAge
|
|
10147
10194
|
} = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10148
10195
|
const expiry = typeof maxAge === 'number' && maxAge !== Number.POSITIVE_INFINITY ? Date.now() + maxAge : undefined;
|
|
10149
|
-
if (this
|
|
10150
|
-
this
|
|
10196
|
+
if (this.cache.has(key)) {
|
|
10197
|
+
this.cache.set(key, {
|
|
10151
10198
|
value,
|
|
10152
10199
|
expiry
|
|
10153
10200
|
});
|
|
10154
10201
|
} else {
|
|
10155
|
-
this
|
|
10202
|
+
this._set(key, {
|
|
10156
10203
|
value,
|
|
10157
10204
|
expiry
|
|
10158
10205
|
});
|
|
@@ -10160,53 +10207,53 @@ class QuickLRU extends Map {
|
|
|
10160
10207
|
return this;
|
|
10161
10208
|
}
|
|
10162
10209
|
has(key) {
|
|
10163
|
-
if (this
|
|
10164
|
-
return !this
|
|
10210
|
+
if (this.cache.has(key)) {
|
|
10211
|
+
return !this._deleteIfExpired(key, this.cache.get(key));
|
|
10165
10212
|
}
|
|
10166
|
-
if (this
|
|
10167
|
-
return !this
|
|
10213
|
+
if (this.oldCache.has(key)) {
|
|
10214
|
+
return !this._deleteIfExpired(key, this.oldCache.get(key));
|
|
10168
10215
|
}
|
|
10169
10216
|
return false;
|
|
10170
10217
|
}
|
|
10171
10218
|
peek(key) {
|
|
10172
|
-
if (this
|
|
10173
|
-
return this
|
|
10219
|
+
if (this.cache.has(key)) {
|
|
10220
|
+
return this._peek(key, this.cache);
|
|
10174
10221
|
}
|
|
10175
|
-
if (this
|
|
10176
|
-
return this
|
|
10222
|
+
if (this.oldCache.has(key)) {
|
|
10223
|
+
return this._peek(key, this.oldCache);
|
|
10177
10224
|
}
|
|
10178
10225
|
}
|
|
10179
10226
|
delete(key) {
|
|
10180
|
-
const deleted = this
|
|
10227
|
+
const deleted = this.cache.delete(key);
|
|
10181
10228
|
if (deleted) {
|
|
10182
|
-
this
|
|
10229
|
+
this._size--;
|
|
10183
10230
|
}
|
|
10184
|
-
return this
|
|
10231
|
+
return this.oldCache.delete(key) || deleted;
|
|
10185
10232
|
}
|
|
10186
10233
|
clear() {
|
|
10187
|
-
this
|
|
10188
|
-
this
|
|
10189
|
-
this
|
|
10234
|
+
this.cache.clear();
|
|
10235
|
+
this.oldCache.clear();
|
|
10236
|
+
this._size = 0;
|
|
10190
10237
|
}
|
|
10191
10238
|
resize(newSize) {
|
|
10192
10239
|
if (!(newSize && newSize > 0)) {
|
|
10193
10240
|
throw new TypeError('`maxSize` must be a number greater than 0');
|
|
10194
10241
|
}
|
|
10195
|
-
const items = [...this
|
|
10242
|
+
const items = [...this._entriesAscending()];
|
|
10196
10243
|
const removeCount = items.length - newSize;
|
|
10197
10244
|
if (removeCount < 0) {
|
|
10198
|
-
this
|
|
10199
|
-
this
|
|
10200
|
-
this
|
|
10245
|
+
this.cache = new Map(items);
|
|
10246
|
+
this.oldCache = new Map();
|
|
10247
|
+
this._size = items.length;
|
|
10201
10248
|
} else {
|
|
10202
10249
|
if (removeCount > 0) {
|
|
10203
|
-
this
|
|
10250
|
+
this._emitEvictions(items.slice(0, removeCount));
|
|
10204
10251
|
}
|
|
10205
|
-
this
|
|
10206
|
-
this
|
|
10207
|
-
this
|
|
10252
|
+
this.oldCache = new Map(items.slice(removeCount));
|
|
10253
|
+
this.cache = new Map();
|
|
10254
|
+
this._size = 0;
|
|
10208
10255
|
}
|
|
10209
|
-
this
|
|
10256
|
+
this.maxSize = newSize;
|
|
10210
10257
|
}
|
|
10211
10258
|
*keys() {
|
|
10212
10259
|
for (const [key] of this) {
|
|
@@ -10219,17 +10266,17 @@ class QuickLRU extends Map {
|
|
|
10219
10266
|
}
|
|
10220
10267
|
}
|
|
10221
10268
|
*[Symbol.iterator]() {
|
|
10222
|
-
for (const item of this
|
|
10269
|
+
for (const item of this.cache) {
|
|
10223
10270
|
const [key, value] = item;
|
|
10224
|
-
const deleted = this
|
|
10271
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
10225
10272
|
if (deleted === false) {
|
|
10226
10273
|
yield [key, value.value];
|
|
10227
10274
|
}
|
|
10228
10275
|
}
|
|
10229
|
-
for (const item of this
|
|
10276
|
+
for (const item of this.oldCache) {
|
|
10230
10277
|
const [key, value] = item;
|
|
10231
|
-
if (!this
|
|
10232
|
-
const deleted = this
|
|
10278
|
+
if (!this.cache.has(key)) {
|
|
10279
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
10233
10280
|
if (deleted === false) {
|
|
10234
10281
|
yield [key, value.value];
|
|
10235
10282
|
}
|
|
@@ -10237,21 +10284,21 @@ class QuickLRU extends Map {
|
|
|
10237
10284
|
}
|
|
10238
10285
|
}
|
|
10239
10286
|
*entriesDescending() {
|
|
10240
|
-
let items = [...this
|
|
10287
|
+
let items = [...this.cache];
|
|
10241
10288
|
for (let i = items.length - 1; i >= 0; --i) {
|
|
10242
10289
|
const item = items[i];
|
|
10243
10290
|
const [key, value] = item;
|
|
10244
|
-
const deleted = this
|
|
10291
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
10245
10292
|
if (deleted === false) {
|
|
10246
10293
|
yield [key, value.value];
|
|
10247
10294
|
}
|
|
10248
10295
|
}
|
|
10249
|
-
items = [...this
|
|
10296
|
+
items = [...this.oldCache];
|
|
10250
10297
|
for (let i = items.length - 1; i >= 0; --i) {
|
|
10251
10298
|
const item = items[i];
|
|
10252
10299
|
const [key, value] = item;
|
|
10253
|
-
if (!this
|
|
10254
|
-
const deleted = this
|
|
10300
|
+
if (!this.cache.has(key)) {
|
|
10301
|
+
const deleted = this._deleteIfExpired(key, value);
|
|
10255
10302
|
if (deleted === false) {
|
|
10256
10303
|
yield [key, value.value];
|
|
10257
10304
|
}
|
|
@@ -10259,24 +10306,21 @@ class QuickLRU extends Map {
|
|
|
10259
10306
|
}
|
|
10260
10307
|
}
|
|
10261
10308
|
*entriesAscending() {
|
|
10262
|
-
for (const [key, value] of this
|
|
10309
|
+
for (const [key, value] of this._entriesAscending()) {
|
|
10263
10310
|
yield [key, value.value];
|
|
10264
10311
|
}
|
|
10265
10312
|
}
|
|
10266
10313
|
get size() {
|
|
10267
|
-
if (!this
|
|
10268
|
-
return this
|
|
10314
|
+
if (!this._size) {
|
|
10315
|
+
return this.oldCache.size;
|
|
10269
10316
|
}
|
|
10270
10317
|
let oldCacheSize = 0;
|
|
10271
|
-
for (const key of this
|
|
10272
|
-
if (!this
|
|
10318
|
+
for (const key of this.oldCache.keys()) {
|
|
10319
|
+
if (!this.cache.has(key)) {
|
|
10273
10320
|
oldCacheSize++;
|
|
10274
10321
|
}
|
|
10275
10322
|
}
|
|
10276
|
-
return Math.min(this
|
|
10277
|
-
}
|
|
10278
|
-
get maxSize() {
|
|
10279
|
-
return this.#maxSize;
|
|
10323
|
+
return Math.min(this._size + oldCacheSize, this.maxSize);
|
|
10280
10324
|
}
|
|
10281
10325
|
entries() {
|
|
10282
10326
|
return this.entriesAscending();
|
|
@@ -10326,6 +10370,19 @@ class QuickLRU extends Map {
|
|
|
10326
10370
|
const INCOMPLETE = 0;
|
|
10327
10371
|
const REGULAR = 1;
|
|
10328
10372
|
const COMPLETE = 2;
|
|
10373
|
+
function yearType(hyear) {
|
|
10374
|
+
const longC = HDate.longCheshvan(hyear);
|
|
10375
|
+
const shortK = HDate.shortKislev(hyear);
|
|
10376
|
+
if (longC && !shortK) {
|
|
10377
|
+
return COMPLETE;
|
|
10378
|
+
}
|
|
10379
|
+
else if (!longC && shortK) {
|
|
10380
|
+
return INCOMPLETE;
|
|
10381
|
+
}
|
|
10382
|
+
else {
|
|
10383
|
+
return REGULAR;
|
|
10384
|
+
}
|
|
10385
|
+
}
|
|
10329
10386
|
/**
|
|
10330
10387
|
* Represents Parashah HaShavua for an entire Hebrew year
|
|
10331
10388
|
*/
|
|
@@ -10337,11 +10394,6 @@ class Sedra {
|
|
|
10337
10394
|
*/
|
|
10338
10395
|
constructor(hyear, il) {
|
|
10339
10396
|
hyear = +hyear;
|
|
10340
|
-
const longC = HDate.longCheshvan(hyear);
|
|
10341
|
-
const shortK = HDate.shortKislev(hyear);
|
|
10342
|
-
const type = (longC && !shortK) ? COMPLETE :
|
|
10343
|
-
(!longC && shortK) ? INCOMPLETE :
|
|
10344
|
-
REGULAR;
|
|
10345
10397
|
this.year = hyear;
|
|
10346
10398
|
const rh0 = new HDate(1, months.TISHREI, hyear);
|
|
10347
10399
|
const rh = rh0.abs();
|
|
@@ -10350,6 +10402,7 @@ class Sedra {
|
|
|
10350
10402
|
this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);
|
|
10351
10403
|
const leap = +HDate.isLeapYear(hyear);
|
|
10352
10404
|
this.il = Boolean(il);
|
|
10405
|
+
const type = yearType(hyear);
|
|
10353
10406
|
let key = `${leap}${rhDay}${type}`;
|
|
10354
10407
|
if (types[key]) {
|
|
10355
10408
|
this.theSedraArray = types[key];
|
|
@@ -10602,7 +10655,6 @@ const YK = 'Yom Kippur'; // 1
|
|
|
10602
10655
|
const SUKKOT = 'Sukkot'; // 0
|
|
10603
10656
|
const CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0
|
|
10604
10657
|
const SHMINI = 'Shmini Atzeret'; // 0
|
|
10605
|
-
const EOY = CHMSUKOT; // always Sukkot day 3, 5 or 6
|
|
10606
10658
|
const PESACH = 'Pesach'; // 25
|
|
10607
10659
|
const PESACH1 = 'Pesach I';
|
|
10608
10660
|
const CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25
|
|
@@ -10619,75 +10671,81 @@ const SHAVUOT$1 = 'Shavuot'; // 33
|
|
|
10619
10671
|
function range$1(start, stop) {
|
|
10620
10672
|
return Array.from({ length: stop - start + 1 }, (v, k) => k + start);
|
|
10621
10673
|
}
|
|
10622
|
-
const
|
|
10674
|
+
const yearStartVayeilech = [51, 52, CHMSUKOT];
|
|
10675
|
+
const yearStartHaazinu = [52, YK, CHMSUKOT];
|
|
10676
|
+
const yearStartRH = [RH, 52, SUKKOT, SHMINI];
|
|
10677
|
+
const r020 = range$1(0, 20);
|
|
10678
|
+
const r027 = range$1(0, 27);
|
|
10679
|
+
const r3340 = range$1(33, 40);
|
|
10680
|
+
const r4349 = range$1(43, 49);
|
|
10681
|
+
const r4350 = range$1(43, 50);
|
|
10623
10682
|
/**
|
|
10624
10683
|
* The ordinary year types (keviot)
|
|
10625
10684
|
* names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel
|
|
10626
10685
|
* @private
|
|
10627
10686
|
* @readonly
|
|
10628
|
-
* @type {Object.<string, NumberOrString[]>}
|
|
10629
10687
|
*/
|
|
10630
10688
|
const types = {
|
|
10631
10689
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
10632
10690
|
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
10633
10691
|
// e.g. 5753
|
|
10634
|
-
'020':
|
|
10692
|
+
'020': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
|
|
10635
10693
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
10636
10694
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
10637
10695
|
// e.g. 5756
|
|
10638
|
-
'0220':
|
|
10696
|
+
'0220': yearStartVayeilech.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), 30, D(31), 33, SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
10639
10697
|
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
10640
10698
|
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
10641
10699
|
// e.g. 5701
|
|
10642
|
-
'0510':
|
|
10700
|
+
'0510': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH1, PESACH8, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
10643
10701
|
/* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29
|
|
10644
10702
|
* days and Kislev has 30 days), and has Passover start on Saturday. */
|
|
10645
10703
|
// e.g. 5745
|
|
10646
|
-
'0511':
|
|
10704
|
+
'0511': yearStartHaazinu.concat(r020, D(21), 23, 24, PESACH, 25, D(26), D(28), range$1(30, 40), D(41), r4350),
|
|
10647
10705
|
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
10648
10706
|
* Kislev each have 30 days), and has Passover start on Sunday. */
|
|
10649
10707
|
// e.g. 5754
|
|
10650
|
-
'052':
|
|
10708
|
+
'052': yearStartHaazinu.concat(range$1(0, 24), PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
10651
10709
|
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev
|
|
10652
10710
|
* each have 29 days), and has Passover start on Sunday. */
|
|
10653
10711
|
// e.g. 5761
|
|
10654
|
-
'070':
|
|
10712
|
+
'070': yearStartRH.concat(r020, D(21), 23, 24, PESACH7, 25, D(26), D(28), 30, D(31), r3340, D(41), r4350),
|
|
10655
10713
|
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
10656
10714
|
* Kislev each have 30 days), and has Passover start on Tuesday. */
|
|
10657
10715
|
// e.g. 5716
|
|
10658
|
-
'072':
|
|
10716
|
+
'072': yearStartRH.concat(r020, D(21), 23, 24, CHMPESACH, 25, D(26), D(28), 30, D(31), r3340, D(41), r4349, D(50)),
|
|
10659
10717
|
/* -- The leap year types (keviot) -- */
|
|
10660
10718
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
10661
10719
|
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
10662
10720
|
// e.g. 5746
|
|
10663
|
-
'1200':
|
|
10721
|
+
'1200': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
10664
10722
|
/* Hebrew year that starts on Monday, is `incomplete' (Heshvan and
|
|
10665
10723
|
* Kislev each have 29 days), and has Passover start on Thursday. */
|
|
10666
10724
|
// e.g. 5746
|
|
10667
|
-
'1201':
|
|
10725
|
+
'1201': yearStartVayeilech.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
|
|
10668
10726
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
10669
10727
|
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
10670
10728
|
// e.g.5752
|
|
10671
|
-
'1220':
|
|
10729
|
+
'1220': yearStartVayeilech.concat(r027, PESACH1, PESACH8, range$1(28, 40), D(41), r4350),
|
|
10672
10730
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
10673
10731
|
* Kislev each have 30 days), and has Passover start on Saturday. */
|
|
10674
10732
|
// e.g.5752
|
|
10675
|
-
'1221':
|
|
10733
|
+
'1221': yearStartVayeilech.concat(r027, PESACH, range$1(28, 50)),
|
|
10676
10734
|
/* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and
|
|
10677
10735
|
* Kislev both have 29 days), and has Passover start on Sunday. */
|
|
10678
10736
|
// e.g. 5768
|
|
10679
|
-
'150':
|
|
10737
|
+
'150': yearStartHaazinu.concat(range$1(0, 28), PESACH7, range$1(29, 50)),
|
|
10680
10738
|
/* Hebrew year that starts on Thursday, is `complete' (Heshvan and
|
|
10681
10739
|
* Kislev both have 30 days), and has Passover start on Tuesday. */
|
|
10682
10740
|
// eg. 5771
|
|
10683
|
-
'152':
|
|
10741
|
+
'152': yearStartHaazinu.concat(range$1(0, 28), CHMPESACH, range$1(29, 49), D(50)),
|
|
10684
10742
|
/* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and
|
|
10685
10743
|
* Kislev each have 29 days), and has Passover start on Tuesday. */
|
|
10686
10744
|
// e.g.5757
|
|
10687
|
-
'170':
|
|
10745
|
+
'170': yearStartRH.concat(r027, CHMPESACH, range$1(28, 40), D(41), r4349, D(50)),
|
|
10688
10746
|
/* Hebrew year that starts on Saturday, is `complete' (Heshvan and
|
|
10689
10747
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
10690
|
-
'1720':
|
|
10748
|
+
'1720': yearStartRH.concat(r027, CHMPESACH, range$1(28, 33), SHAVUOT$1, range$1(34, 37), D(38), 40, D(41), r4349, D(50)),
|
|
10691
10749
|
};
|
|
10692
10750
|
/* Hebrew year that starts on Monday, is `complete' (Heshvan and
|
|
10693
10751
|
* Kislev each have 30 days), and has Passover start on Thursday. */
|
|
@@ -10711,6 +10769,8 @@ types['1311'] = types['1221'];
|
|
|
10711
10769
|
types['1721'] = types['170'];
|
|
10712
10770
|
const sedraCache = new QuickLRU({ maxSize: 400 });
|
|
10713
10771
|
/**
|
|
10772
|
+
* Convenience function to create an instance of `Sedra` or reuse a previously
|
|
10773
|
+
* created and cached instance.
|
|
10714
10774
|
* @private
|
|
10715
10775
|
* @param {number} hyear
|
|
10716
10776
|
* @param {boolean} il
|
|
@@ -11375,7 +11435,7 @@ class DailyLearning {
|
|
|
11375
11435
|
}
|
|
11376
11436
|
|
|
11377
11437
|
/** DO NOT EDIT THIS AUTO-GENERATED FILE! */
|
|
11378
|
-
const version = '5.4.
|
|
11438
|
+
const version = '5.4.5';
|
|
11379
11439
|
|
|
11380
11440
|
/* eslint-disable max-len */
|
|
11381
11441
|
/**
|
|
@@ -12231,20 +12291,7 @@ function checkCandleOptions(options) {
|
|
|
12231
12291
|
}
|
|
12232
12292
|
let min = Number(options.candleLightingMins) || 18;
|
|
12233
12293
|
if (location.getIsrael() && Math.abs(min) === 18) {
|
|
12234
|
-
|
|
12235
|
-
if (geoid) {
|
|
12236
|
-
const offset = geoIdCandleOffset[geoid];
|
|
12237
|
-
if (typeof offset === 'number') {
|
|
12238
|
-
min = offset;
|
|
12239
|
-
}
|
|
12240
|
-
}
|
|
12241
|
-
const shortName = location.getShortName();
|
|
12242
|
-
if (shortName) {
|
|
12243
|
-
const offset = israelCityOffset[shortName];
|
|
12244
|
-
if (typeof offset === 'number') {
|
|
12245
|
-
min = offset;
|
|
12246
|
-
}
|
|
12247
|
-
}
|
|
12294
|
+
min = overrideIsraelCandleMins(location, min);
|
|
12248
12295
|
}
|
|
12249
12296
|
options.candleLightingMins = -1 * Math.abs(min);
|
|
12250
12297
|
if (typeof options.havdalahMins === 'number') {
|
|
@@ -12260,6 +12307,23 @@ function checkCandleOptions(options) {
|
|
|
12260
12307
|
options.fastEndDeg = TZEIT_3MEDIUM_STARS;
|
|
12261
12308
|
}
|
|
12262
12309
|
}
|
|
12310
|
+
function overrideIsraelCandleMins(location, min) {
|
|
12311
|
+
const geoid = location.getGeoId();
|
|
12312
|
+
if (geoid) {
|
|
12313
|
+
const offset = geoIdCandleOffset[geoid];
|
|
12314
|
+
if (typeof offset === 'number') {
|
|
12315
|
+
return offset;
|
|
12316
|
+
}
|
|
12317
|
+
}
|
|
12318
|
+
const shortName = location.getShortName();
|
|
12319
|
+
if (shortName) {
|
|
12320
|
+
const offset = israelCityOffset[shortName];
|
|
12321
|
+
if (typeof offset === 'number') {
|
|
12322
|
+
return offset;
|
|
12323
|
+
}
|
|
12324
|
+
}
|
|
12325
|
+
return min;
|
|
12326
|
+
}
|
|
12263
12327
|
/**
|
|
12264
12328
|
* Mask to filter Holiday array
|
|
12265
12329
|
* @private
|