@hebcal/leyning 8.1.0 → 8.1.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.
package/dist/index.cjs ADDED
@@ -0,0 +1,2972 @@
1
+ /*! @hebcal/leyning v8.1.1 */
2
+ 'use strict';
3
+
4
+ var core = require('@hebcal/core');
5
+
6
+ var numverses = {
7
+ "Genesis": [0,
8
+ 31, 25, 24, 26, 32, 22, 24, 22, 29, 32, 32, 20, 18, 24, 21, 16, 27, 33,
9
+ 38, 18, 34, 24, 20, 67, 34, 35, 46, 22, 35, 43, 54, 33, 20, 31, 29, 43,
10
+ 36, 30, 23, 23, 57, 38, 34, 34, 28, 34, 31, 22, 33, 26],
11
+ "Exodus": [0,
12
+ 22, 25, 22, 31, 23, 30, 29, 28, 35, 29, 10, 51, 22, 31, 27, 36, 16, 27,
13
+ 25, 26, 37, 30, 33, 18, 40, 37, 21, 43, 46, 38, 18, 35, 23, 35, 35, 38,
14
+ 29, 31, 43, 38],
15
+ "Leviticus": [0,
16
+ 17, 16, 17, 35, 26, 23, 38, 36, 24, 20, 47, 8, 59, 57, 33, 34, 16, 30,
17
+ 37, 27, 24, 33, 44, 23, 55, 46, 34],
18
+ "Numbers": [0,
19
+ 54, 34, 51, 49, 31, 27, 89, 26, 23, 36, 35, 16, 33, 45, 41, 35, 28, 32,
20
+ 22, 29, 35, 41, 30, 25, 19, 65, 23, 31, 39, 17, 54, 42, 56, 29, 34, 13],
21
+ "Deuteronomy": [0,
22
+ 46, 37, 29, 49, 30, 25, 26, 20, 29, 22, 32, 31, 19, 29, 23, 22, 20, 22,
23
+ 21, 20, 23, 29, 26, 22, 19, 19, 26, 69, 28, 20, 30, 52, 29, 12],
24
+
25
+ "Joshua": [0, 18, 24, 17, 24, 15, 27, 26, 35, 27, 43, 23, 24, 33, 15, 63, 10, 18, 28, 51, 9, 45, 34, 16, 33],
26
+ "Judges": [0, 36, 23, 31, 24, 31, 40, 25, 35, 57, 18, 40, 15, 25, 20, 20, 31, 13, 31, 30, 48, 25],
27
+ "Ruth": [0, 22, 23, 18, 22],
28
+ "I Samuel": [0, 28, 36, 21, 22, 12, 21, 17, 22, 27, 27, 15, 25, 23, 52, 35, 23, 58, 30, 24, 42, 16, 23, 28, 23, 43, 25, 12, 25, 11, 31, 13],
29
+ "II Samuel": [0, 27, 32, 39, 12, 25, 23, 29, 18, 13, 19, 27, 31, 39, 33, 37, 23, 29, 32, 44, 26, 22, 51, 39, 25],
30
+ "I Kings": [0, 53, 46, 28, 20, 32, 38, 51, 66, 28, 29, 43, 33, 34, 31, 34, 34, 24, 46, 21, 43, 29, 54],
31
+ "II Kings": [0, 18, 25, 27, 44, 27, 33, 20, 29, 37, 36, 20, 22, 25, 29, 38, 20, 41, 37, 37, 21, 26, 20, 37, 20, 30],
32
+ "Isaiah": [0, 31, 22, 26, 6, 30, 13, 25, 23, 20, 34, 16, 6, 22, 32, 9, 14, 14, 7, 25, 6, 17, 25, 18, 23, 12, 21, 13, 29, 24, 33, 9, 20, 24, 17, 10, 22, 38, 22, 8, 31, 29, 25, 28, 28, 25, 13, 15, 22, 26, 11, 23, 15, 12, 17, 13, 12, 21, 14, 21, 22, 11, 12, 19, 11, 25, 24],
33
+ "Jeremiah": [0, 19, 37, 25, 31, 31, 30, 34, 23, 25, 25, 23, 17, 27, 22, 21, 21, 27, 23, 15, 18, 14, 30, 40, 10, 38, 24, 22, 17, 32, 24, 40, 44, 26, 22, 19, 32, 21, 28, 18, 16, 18, 22, 13, 30, 5, 28, 7, 47, 39, 46, 64, 34],
34
+ "Lamentations": [0, 22, 22, 66, 22, 22],
35
+ "Baruch": [0, 22, 35, 38, 37, 9, 72],
36
+ "Esther": [0, 22, 23, 15, 17, 14, 14, 10, 17, 32, 3],
37
+ "Ecclesiastes": [0, 18, 26, 22, 17, 19, 12, 29, 17, 18, 20, 10, 14],
38
+ "Song of Songs": [0, 17, 17, 11, 16, 16, 12, 14, 14],
39
+ "Ezekiel": [0, 28, 10, 27, 17, 17, 14, 27, 18, 11, 22, 25, 28, 23, 23, 8, 63, 24, 32, 14, 44, 37, 31, 49, 27, 17, 21, 36, 26, 21, 26, 18, 32, 33, 31, 15, 38, 28, 23, 29, 49, 26, 20, 27, 31, 25, 24, 23, 35],
40
+ "Daniel": [0, 21, 49, 100, 34, 30, 29, 28, 27, 27, 21, 45, 13, 64, 42],
41
+ "Hosea": [0, 9, 25, 5, 19, 15, 11, 16, 14, 17, 15, 11, 15, 15, 10],
42
+ "Joel": [0, 20, 27, 5, 21],
43
+ "Amos": [0, 15, 16, 15, 13, 27, 14, 17, 14, 15],
44
+ "Obadiah": [0, 21],
45
+ "Jonah": [0, 16, 11, 10, 11],
46
+ "Micah": [0, 16, 13, 12, 14, 14, 16, 20],
47
+ "Nachum": [0, 14, 14, 19],
48
+ "Habakkuk": [0, 17, 20, 19],
49
+ "Zephaniah": [0, 18, 15, 20],
50
+ "Haggai": [0, 15, 23],
51
+ "Zechariah": [0, 17, 17, 10, 14, 11, 15, 14, 23, 17, 12, 17, 14, 9, 21],
52
+ "Malachi": [0, 14, 17, 24]
53
+ };
54
+
55
+ /**
56
+ * Names of the books of the Torah. BOOK[1] === 'Genesis'
57
+ * @readonly
58
+ * @const {string[]}
59
+ */
60
+ const BOOK = ['', 'Genesis', 'Exodus', 'Leviticus', 'Numbers', 'Deuteronomy'];
61
+
62
+ /**
63
+ * Formats parsha as a string
64
+ * @param {string|string[]} parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
65
+ * @return {string}
66
+ */
67
+ function parshaToString(parsha) {
68
+ if (typeof parsha === 'string') {
69
+ return parsha;
70
+ } else if (!Array.isArray(parsha) || parsha.length === 0 || parsha.length > 2) {
71
+ throw new TypeError(`Bad parsha argument: ${parsha}`);
72
+ }
73
+ let s = parsha[0];
74
+ if (parsha.length == 2) {
75
+ s += '-' + parsha[1];
76
+ }
77
+ return s;
78
+ }
79
+
80
+ /**
81
+ * Represents an aliyah
82
+ * @typedef {Object} Aliyah
83
+ * @property {string} k - Book (e.g. "Numbers")
84
+ * @property {string} b - beginning verse (e.g. "28:9")
85
+ * @property {string} e - ending verse (e.g. "28:15")
86
+ * @property {number} [v] - number of verses
87
+ * @property {number} [p] - parsha number (1=Bereshit, 54=Vezot HaBracha)
88
+ */
89
+
90
+ /**
91
+ * Makes a deep copy of the src object using JSON stringify and parse
92
+ * @param {any} src
93
+ * @return {any}
94
+ */
95
+ function clone(src) {
96
+ return JSON.parse(JSON.stringify(src));
97
+ }
98
+
99
+ /**
100
+ * Calculates the number of verses in an aliyah or haftara based on
101
+ * the `b` (begin verse), `e` (end verse) and `k` (book).
102
+ * Modifies `aliyah` by setting the `v` field.
103
+ * @param {Aliyah} aliyah
104
+ * @return {number}
105
+ */
106
+ function calculateNumVerses(aliyah) {
107
+ if (aliyah.v) {
108
+ return aliyah.v;
109
+ }
110
+ const chapVerseBegin = aliyah.b.split(':');
111
+ const chapVerseEnd = aliyah.e.split(':');
112
+ const c1 = parseInt(chapVerseBegin[0], 10);
113
+ const c2 = parseInt(chapVerseEnd[0], 10);
114
+ const v1 = parseInt(chapVerseBegin[1], 10);
115
+ const v2 = parseInt(chapVerseEnd[1], 10);
116
+ if (c1 === c2) {
117
+ aliyah.v = v2 - v1 + 1;
118
+ } else if (typeof aliyah.k === 'string') {
119
+ const numv = numverses[aliyah.k];
120
+ if (typeof numv !== 'object' || !numv.length) {
121
+ throw new ReferenceError(`Can't find numverses for ${aliyah.k}`);
122
+ }
123
+ let total = numv[c1] - v1 + 1;
124
+ for (let chap = c1 + 1; chap < c2; chap++) {
125
+ total += numv[chap];
126
+ }
127
+ total += v2;
128
+ aliyah.v = total;
129
+ }
130
+ return aliyah.v;
131
+ }
132
+
133
+ /**
134
+ * Formats an aliyah object like "Numbers 28:9-28:15"
135
+ * @param {Aliyah} a aliyah
136
+ * @return {string}
137
+ */
138
+ function formatAliyahWithBook(a) {
139
+ return `${a.k} ${a.b}-${a.e}`;
140
+ }
141
+
142
+ /**
143
+ * Formats an aliyah object like "Numbers 28:9-15"
144
+ * @param {Aliyah} aliyah
145
+ * @param {boolean} showBook
146
+ * @return {string}
147
+ */
148
+ function formatAliyahShort(aliyah, showBook) {
149
+ const begin = aliyah.b;
150
+ const end0 = aliyah.e;
151
+ const prefix = showBook ? aliyah.k + ' ' : '';
152
+ if (begin === end0) {
153
+ return `${prefix}${begin}`;
154
+ }
155
+ const cv1 = begin.split(':');
156
+ const cv2 = end0.split(':');
157
+ const end = cv1[0] === cv2[0] ? cv2[1] : end0;
158
+ return `${prefix}${begin}-${end}`;
159
+ }
160
+
161
+ /**
162
+ * Returns the total number of verses in an array of Aliyah (or haftarah) objects
163
+ * @param {Aliyah|Aliyah[]} aliyot
164
+ * @return {number}
165
+ */
166
+ function sumVerses(aliyot) {
167
+ return Array.isArray(aliyot) ? aliyot.reduce((prev, cur) => prev + cur.v, 0) : aliyot.v;
168
+ }
169
+
170
+ /**
171
+ * @private
172
+ * @param {Aliyah|Aliyah[]} haft
173
+ * @return {Aliyah|Aliyah[]}
174
+ */
175
+ function cloneHaftara(haft) {
176
+ if (!haft) {
177
+ return haft;
178
+ }
179
+ const dest = clone(haft);
180
+ if (Array.isArray(dest)) {
181
+ dest.map(calculateNumVerses);
182
+ } else {
183
+ calculateNumVerses(dest);
184
+ }
185
+ return dest;
186
+ }
187
+
188
+ /**
189
+ * @private
190
+ * @param {string} a
191
+ * @param {string} b
192
+ * @return {boolean}
193
+ */
194
+ function isChapVerseBefore(a, b) {
195
+ const cv1 = a.split(':').map((x) => +x);
196
+ const cv2 = b.split(':').map((x) => +x);
197
+ return (cv1[0]*100 + cv1[1]) < (cv2[0]*100 + cv2[1]);
198
+ }
199
+
200
+ /**
201
+ * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
202
+ * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
203
+ * @param {Object<string,Aliyah>} aliyot
204
+ * @return {Aliyah[]}
205
+ */
206
+ function makeLeyningParts(aliyot) {
207
+ const nums = Object.keys(aliyot).filter((x) => {
208
+ if (x.length === 1) {
209
+ return true;
210
+ }
211
+ const code = x.charCodeAt(0);
212
+ return code >= 48 && code <= 57;
213
+ });
214
+ let start = aliyot[nums[0]];
215
+ let end = start;
216
+ const parts = [];
217
+ for (let i = 0; i < nums.length; i++) {
218
+ const num = nums[i];
219
+ const aliyah = aliyot[num];
220
+ if ((i === nums.length - 1) && (aliyah.k === end.k) && (aliyah.e === end.e)) {
221
+ // short-circuit when final aliyah is within the previous (e.g. M inside of 7)
222
+ continue;
223
+ }
224
+ const prevEndChap = +(end.e.split(':')[0]);
225
+ const curStartChap = +(aliyah.b.split(':')[0]);
226
+ const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
227
+ if ((i !== 0) &&
228
+ (aliyah.k !== start.k || isChapVerseBefore(aliyah.b, start.e) || !sameOrNextChap)) {
229
+ parts.push({k: start.k, b: start.b, e: end.e});
230
+ start = aliyah;
231
+ }
232
+ end = aliyah;
233
+ }
234
+ parts.push({k: start.k, b: start.b, e: end.e});
235
+ return parts;
236
+ }
237
+
238
+ /**
239
+ * Returns a string representation of the leyning parts.
240
+ * Separate verse ranges read from the same book are separated
241
+ * by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
242
+ * Verse ranges from different books are separated by semicolons,
243
+ * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
244
+ * @param {Aliyah|Aliyah[]} parts
245
+ * @return {string}
246
+ */
247
+ function makeSummaryFromParts(parts) {
248
+ if (!Array.isArray(parts)) {
249
+ parts = [parts];
250
+ }
251
+ let prev = parts[0];
252
+ let summary = formatAliyahShort(prev, true);
253
+ for (let i = 1; i < parts.length; i++) {
254
+ const part = parts[i];
255
+ if (part.k === prev.k) {
256
+ summary += ', ';
257
+ } else {
258
+ summary += `; ${part.k} `;
259
+ }
260
+ summary += formatAliyahShort(part, false);
261
+ prev = part;
262
+ }
263
+ return summary;
264
+ }
265
+
266
+ /**
267
+ * Makes a summary of the leyning, like "Genesis 6:9-11:32"
268
+ * @param {Object<string,Aliyah>} aliyot
269
+ * @return {string}
270
+ */
271
+ function makeLeyningSummary(aliyot) {
272
+ const parts = makeLeyningParts(aliyot);
273
+ return makeSummaryFromParts(parts);
274
+ }
275
+
276
+ var festivals = {"Pesach I":{
277
+ "haft":{"k":"Joshua","b":"5:2","e":"6:1"},
278
+ "fullkriyah":
279
+ {"1":{"p":15,"k":2,"b":"12:21","e":"12:24"},
280
+ "2":{"p":15,"k":2,"b":"12:25","e":"12:28"},
281
+ "3":{"p":15,"k":2,"b":"12:29","e":"12:36"},
282
+ "4":{"p":15,"k":2,"b":"12:37","e":"12:42"},
283
+ "5":{"p":15,"k":2,"b":"12:43","e":"12:51"},
284
+ "M":{"p":41,"k":4,"b":"28:16","e":"28:25"}}},
285
+ "Pesach I (on Shabbat)":{
286
+ "haft":{"k":"Joshua","b":"5:2","e":"6:1"},
287
+ "fullkriyah":
288
+ {"1":{"p":15,"k":2,"b":"12:21","e":"12:24"},
289
+ "2":{"p":15,"k":2,"b":"12:25","e":"12:28"},
290
+ "3":{"p":15,"k":2,"b":"12:29","e":"12:32"},
291
+ "4":{"p":15,"k":2,"b":"12:33","e":"12:36"},
292
+ "5":{"p":15,"k":2,"b":"12:37","e":"12:42"},
293
+ "6":{"p":15,"k":2,"b":"12:43","e":"12:47"},
294
+ "7":{"p":15,"k":2,"b":"12:48","e":"12:51"},
295
+ "M":{"p":41,"k":4,"b":"28:16","e":"28:25"}}},
296
+ "Pesach II":{
297
+ "haft":[{"k":"II Kings","b":"23:1","e":"23:9"},
298
+ {"k":"II Kings","b":"23:21","e":"23:25"}],
299
+ "fullkriyah":
300
+ {"1":{"p":31,"k":3,"b":"22:26","e":"23:3"},
301
+ "2":{"p":31,"k":3,"b":"23:4","e":"23:14"},
302
+ "3":{"p":31,"k":3,"b":"23:15","e":"23:22"},
303
+ "4":{"p":31,"k":3,"b":"23:23","e":"23:32"},
304
+ "5":{"p":31,"k":3,"b":"23:33","e":"23:44"},
305
+ "M":{"p":41,"k":4,"b":"28:16","e":"28:25"}}},
306
+ "Pesach II (CH''M)":{
307
+ "note":"Israel only - according to Vaani T'fillati Siddur Yisraeli",
308
+ "il":true,
309
+ "fullkriyah":
310
+ {"1":{"p":31,"k":3,"b":"22:26","e":"23:8"},
311
+ "2":{"p":31,"k":3,"b":"23:9","e":"23:14"},
312
+ "3":{"p":31,"k":3,"b":"23:15","e":"23:44"},
313
+ "4":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
314
+ "Pesach Chol ha-Moed Day 1":{
315
+ "fullkriyah":
316
+ {"1":{"p":15,"k":2,"b":"13:1","e":"13:4"},
317
+ "2":{"p":15,"k":2,"b":"13:5","e":"13:10"},
318
+ "3":{"p":15,"k":2,"b":"13:11","e":"13:16"},
319
+ "4":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
320
+ "Pesach Chol ha-Moed Day 2":{
321
+ "fullkriyah":
322
+ {"1":{"p":18,"k":2,"b":"22:24","e":"22:26"},
323
+ "2":{"p":18,"k":2,"b":"22:27","e":"23:5"},
324
+ "3":{"p":18,"k":2,"b":"23:6","e":"23:19"},
325
+ "4":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
326
+ "Pesach Chol ha-Moed Day 3":{
327
+ "fullkriyah":
328
+ {"1":{"p":21,"k":2,"b":"34:1","e":"34:10"},
329
+ "2":{"p":21,"k":2,"b":"34:11","e":"34:17"},
330
+ "3":{"p":21,"k":2,"b":"34:18","e":"34:26"},
331
+ "4":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
332
+ "Pesach Chol ha-Moed Day 4":{
333
+ "fullkriyah":
334
+ {"1":{"p":36,"k":4,"b":"9:1","e":"9:5"},
335
+ "2":{"p":36,"k":4,"b":"9:6","e":"9:8"},
336
+ "3":{"p":36,"k":4,"b":"9:9","e":"9:14"},
337
+ "4":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
338
+ "Pesach Shabbat Chol ha-Moed":{
339
+ "megillah":"Song of Songs",
340
+ "haft":{"k":"Ezekiel","b":"37:1","e":"37:14"},
341
+ "fullkriyah":
342
+ {"1":{"p":21,"k":2,"b":"33:12","e":"33:16"},
343
+ "2":{"p":21,"k":2,"b":"33:17","e":"33:19"},
344
+ "3":{"p":21,"k":2,"b":"33:20","e":"33:23"},
345
+ "4":{"p":21,"k":2,"b":"34:1","e":"34:3"},
346
+ "5":{"p":21,"k":2,"b":"34:4","e":"34:10"},
347
+ "6":{"p":21,"k":2,"b":"34:11","e":"34:17"},
348
+ "7":{"p":21,"k":2,"b":"34:18","e":"34:26"},
349
+ "M":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
350
+ "Pesach VII":{
351
+ "haft":{"k":"II Samuel","b":"22:1","e":"22:51"},
352
+ "fullkriyah":
353
+ {"1":{"p":16,"k":2,"b":"13:17","e":"13:22"},
354
+ "2":{"p":16,"k":2,"b":"14:1","e":"14:8"},
355
+ "3":{"p":16,"k":2,"b":"14:9","e":"14:14"},
356
+ "4":{"p":16,"k":2,"b":"14:15","e":"14:25"},
357
+ "5":{"p":16,"k":2,"b":"14:26","e":"15:26"},
358
+ "M":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
359
+ "Pesach VII (on Shabbat)":{
360
+ "haft":{"k":"II Samuel","b":"22:1","e":"22:51"},
361
+ "fullkriyah":
362
+ {"1":{"p":16,"k":2,"b":"13:17","e":"13:19"},
363
+ "2":{"p":16,"k":2,"b":"13:20","e":"13:22"},
364
+ "3":{"p":16,"k":2,"b":"14:1","e":"14:4"},
365
+ "4":{"p":16,"k":2,"b":"14:5","e":"14:8"},
366
+ "5":{"p":16,"k":2,"b":"14:9","e":"14:14"},
367
+ "6":{"p":16,"k":2,"b":"14:15","e":"14:25"},
368
+ "7":{"p":16,"k":2,"b":"14:26","e":"15:26"},
369
+ "M":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
370
+ "Pesach VIII":{
371
+ "haft":{"k":"Isaiah","b":"10:32","e":"12:6"},
372
+ "fullkriyah":
373
+ {"1":{"p":47,"k":5,"b":"15:19","e":"15:23"},
374
+ "2":{"p":47,"k":5,"b":"16:1","e":"16:3"},
375
+ "3":{"p":47,"k":5,"b":"16:4","e":"16:8"},
376
+ "4":{"p":47,"k":5,"b":"16:9","e":"16:12"},
377
+ "5":{"p":47,"k":5,"b":"16:13","e":"16:17"},
378
+ "M":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
379
+ "Pesach VIII (on Shabbat)":{
380
+ "haft":{"k":"Isaiah","b":"10:32","e":"12:6"},
381
+ "fullkriyah":
382
+ {"1":{"p":47,"k":5,"b":"14:22","e":"14:29"},
383
+ "2":{"p":47,"k":5,"b":"15:1","e":"15:18"},
384
+ "3":{"p":47,"k":5,"b":"15:19","e":"15:23"},
385
+ "4":{"p":47,"k":5,"b":"16:1","e":"16:3"},
386
+ "5":{"p":47,"k":5,"b":"16:4","e":"16:8"},
387
+ "6":{"p":47,"k":5,"b":"16:9","e":"16:12"},
388
+ "7":{"p":47,"k":5,"b":"16:13","e":"16:17"},
389
+ "M":{"p":41,"k":4,"b":"28:19","e":"28:25"}}},
390
+ "Pesach III (CH''M)":{"alias":true,"il":true,"key":"Pesach Chol ha-Moed Day 1"},
391
+ "Pesach IV (CH''M)":{"alias":true,"il":true,"key":"Pesach Chol ha-Moed Day 2"},
392
+ "Pesach V (CH''M)":{"alias":true,"il":true,"key":"Pesach Chol ha-Moed Day 3"},
393
+ "Pesach VI (CH''M)":{"alias":true,"il":true,"key":"Pesach Chol ha-Moed Day 4"},
394
+ "Pesach Chol ha-Moed Day 2 on Sunday":{"alias":true,"il":false,"key":"Pesach Chol ha-Moed Day 1"},
395
+ "Pesach Chol ha-Moed Day 3 on Monday":{"alias":true,"il":false,"key":"Pesach Chol ha-Moed Day 2"},
396
+ "Shavuot":{
397
+ "note":"Israel only",
398
+ "il":true,
399
+ "megillah":"Ruth",
400
+ "haft":[{"k":"Ezekiel","b":"1:1","e":"1:28"},
401
+ {"k":"Ezekiel","b":"3:12","e":"3:12"}],
402
+ "fullkriyah":
403
+ {"1":{"p":17,"k":2,"b":"19:1","e":"19:6"},
404
+ "2":{"p":17,"k":2,"b":"19:7","e":"19:13"},
405
+ "3":{"p":17,"k":2,"b":"19:14","e":"19:19"},
406
+ "4":{"p":17,"k":2,"b":"19:20","e":"20:14"},
407
+ "5":{"p":17,"k":2,"b":"20:15","e":"20:23"},
408
+ "M":{"p":41,"k":4,"b":"28:26","e":"28:31"}}},
409
+ "Shavuot I":{
410
+ "haft":[{"k":"Ezekiel","b":"1:1","e":"1:28"},
411
+ {"k":"Ezekiel","b":"3:12","e":"3:12"}],
412
+ "fullkriyah":
413
+ {"1":{"p":17,"k":2,"b":"19:1","e":"19:6"},
414
+ "2":{"p":17,"k":2,"b":"19:7","e":"19:13"},
415
+ "3":{"p":17,"k":2,"b":"19:14","e":"19:19"},
416
+ "4":{"p":17,"k":2,"b":"19:20","e":"20:14"},
417
+ "5":{"p":17,"k":2,"b":"20:15","e":"20:23"},
418
+ "M":{"p":41,"k":4,"b":"28:26","e":"28:31"}}},
419
+ "Shavuot II":{
420
+ "megillah":"Ruth",
421
+ "haft":{"k":"Habakkuk","b":"3:1","e":"3:19"},
422
+ "fullkriyah":
423
+ {"1":{"p":47,"k":5,"b":"15:19","e":"15:23"},
424
+ "2":{"p":47,"k":5,"b":"16:1","e":"16:3"},
425
+ "3":{"p":47,"k":5,"b":"16:4","e":"16:8"},
426
+ "4":{"p":47,"k":5,"b":"16:9","e":"16:12"},
427
+ "5":{"p":47,"k":5,"b":"16:13","e":"16:17"},
428
+ "M":{"p":41,"k":4,"b":"28:26","e":"28:31"}}},
429
+ "Shavuot II (on Shabbat)":{
430
+ "megillah":"Ruth",
431
+ "haft":{"k":"Habakkuk","b":"3:1","e":"3:19"},
432
+ "fullkriyah":
433
+ {"1":{"p":47,"k":5,"b":"14:22","e":"14:29"},
434
+ "2":{"p":47,"k":5,"b":"15:1","e":"15:18"},
435
+ "3":{"p":47,"k":5,"b":"15:19","e":"15:23"},
436
+ "4":{"p":47,"k":5,"b":"16:1","e":"16:3"},
437
+ "5":{"p":47,"k":5,"b":"16:4","e":"16:8"},
438
+ "6":{"p":47,"k":5,"b":"16:9","e":"16:12"},
439
+ "7":{"p":47,"k":5,"b":"16:13","e":"16:17"},
440
+ "M":{"p":41,"k":4,"b":"28:26","e":"28:31"}}},
441
+ "Fast Day (Morning)":{
442
+ "fullkriyah":
443
+ {"1":{"p":21,"k":2,"b":"32:11","e":"32:14"},
444
+ "2":{"p":21,"k":2,"b":"34:1","e":"34:3"},
445
+ "3":{"p":21,"k":2,"b":"34:4","e":"34:10"}}},
446
+ "Fast Day (Afternoon)":{
447
+ "haft":{"k":"Isaiah","b":"55:6","e":"56:8"},
448
+ "fullkriyah":
449
+ {"1":{"p":21,"k":2,"b":"32:11","e":"32:14"},
450
+ "2":{"p":21,"k":2,"b":"34:1","e":"34:3"},
451
+ "M":{"p":21,"k":2,"b":"34:4","e":"34:10"}}},
452
+ "Asara B'Tevet":{"alias":true,"key":"Fast Day (Morning)"},
453
+ "Ta'anit Esther":{"alias":true,"key":"Fast Day (Morning)"},
454
+ "Tzom Gedaliah":{"alias":true,"key":"Fast Day (Morning)"},
455
+ "Tzom Tammuz":{"alias":true,"key":"Fast Day (Morning)"},
456
+ "Asara B'Tevet (Mincha)":{"alias":true,"key":"Fast Day (Afternoon)"},
457
+ "Ta'anit Esther (Mincha)":{"alias":true,"key":"Fast Day (Afternoon)"},
458
+ "Tzom Gedaliah (Mincha)":{"alias":true,"key":"Fast Day (Afternoon)"},
459
+ "Tzom Tammuz (Mincha)":{"alias":true,"key":"Fast Day (Afternoon)"},
460
+ "Erev Tish'a B'Av":{"megillah":"Lamentations"},
461
+ "Tish'a B'Av":{
462
+ "haft":{"k":"Jeremiah","b":"8:13","e":"9:23"},
463
+ "fullkriyah":
464
+ {"1":{"p":45,"k":5,"b":"4:25","e":"4:29"},
465
+ "2":{"p":45,"k":5,"b":"4:30","e":"4:35"},
466
+ "3":{"p":45,"k":5,"b":"4:36","e":"4:40"}}},
467
+ "Tish'a B'Av (Mincha)":{"alias":true,"key":"Fast Day (Afternoon)"},
468
+ "Rosh Hashana I":{
469
+ "haft":{"k":"I Samuel","b":"1:1","e":"2:10"},
470
+ "fullkriyah":
471
+ {"1":{"p":4,"k":1,"b":"21:1","e":"21:4"},
472
+ "2":{"p":4,"k":1,"b":"21:5","e":"21:12"},
473
+ "3":{"p":4,"k":1,"b":"21:13","e":"21:21"},
474
+ "4":{"p":4,"k":1,"b":"21:22","e":"21:27"},
475
+ "5":{"p":4,"k":1,"b":"21:28","e":"21:34"},
476
+ "M":{"p":41,"k":4,"b":"29:1","e":"29:6"}}},
477
+ "Rosh Hashana I (on Shabbat)":{
478
+ "haft":{"k":"I Samuel","b":"1:1","e":"2:10"},
479
+ "fullkriyah":
480
+ {"1":{"p":4,"k":1,"b":"21:1","e":"21:4"},
481
+ "2":{"p":4,"k":1,"b":"21:5","e":"21:8"},
482
+ "3":{"p":4,"k":1,"b":"21:9","e":"21:12"},
483
+ "4":{"p":4,"k":1,"b":"21:13","e":"21:17"},
484
+ "5":{"p":4,"k":1,"b":"21:18","e":"21:21"},
485
+ "6":{"p":4,"k":1,"b":"21:22","e":"21:27"},
486
+ "7":{"p":4,"k":1,"b":"21:28","e":"21:34"},
487
+ "M":{"p":41,"k":4,"b":"29:1","e":"29:6"}}},
488
+ "Rosh Hashana II":{
489
+ "haft":{"k":"Jeremiah","b":"31:1","e":"31:19"},
490
+ "fullkriyah":
491
+ {"1":{"p":4,"k":1,"b":"22:1","e":"22:3"},
492
+ "2":{"p":4,"k":1,"b":"22:4","e":"22:8"},
493
+ "3":{"p":4,"k":1,"b":"22:9","e":"22:14"},
494
+ "4":{"p":4,"k":1,"b":"22:15","e":"22:19"},
495
+ "5":{"p":4,"k":1,"b":"22:20","e":"22:24"},
496
+ "M":{"p":41,"k":4,"b":"29:1","e":"29:6"}}},
497
+ "Yom Kippur":{
498
+ "haft":{"k":"Isaiah","b":"57:14","e":"58:14"},
499
+ "fullkriyah":
500
+ {"1":{"p":29,"k":3,"b":"16:1","e":"16:6"},
501
+ "2":{"p":29,"k":3,"b":"16:7","e":"16:11"},
502
+ "3":{"p":29,"k":3,"b":"16:12","e":"16:17"},
503
+ "4":{"p":29,"k":3,"b":"16:18","e":"16:24"},
504
+ "5":{"p":29,"k":3,"b":"16:25","e":"16:30"},
505
+ "6":{"p":29,"k":3,"b":"16:31","e":"16:34"},
506
+ "M":{"p":41,"k":4,"b":"29:7","e":"29:11"}}},
507
+ "Yom Kippur (on Shabbat)":{
508
+ "haft":{"k":"Isaiah","b":"57:14","e":"58:14"},
509
+ "fullkriyah":
510
+ {"1":{"p":29,"k":3,"b":"16:1","e":"16:3"},
511
+ "2":{"p":29,"k":3,"b":"16:4","e":"16:6"},
512
+ "3":{"p":29,"k":3,"b":"16:7","e":"16:11"},
513
+ "4":{"p":29,"k":3,"b":"16:12","e":"16:17"},
514
+ "5":{"p":29,"k":3,"b":"16:18","e":"16:24"},
515
+ "6":{"p":29,"k":3,"b":"16:25","e":"16:30"},
516
+ "7":{"p":29,"k":3,"b":"16:31","e":"16:34"},
517
+ "M":{"p":41,"k":4,"b":"29:7","e":"29:11"}}},
518
+ "Yom Kippur (Mincha)":{"alias":true,"key":"Yom Kippur (Mincha, Traditional)"},
519
+ "Yom Kippur (Mincha, Traditional)":{
520
+ "haft":[{"k":"Jonah","b":"1:1","e":"4:11"},
521
+ {"k":"Micah","b":"7:18","e":"7:20"}],
522
+ "fullkriyah":
523
+ {"1":{"p":29,"k":3,"b":"18:1","e":"18:5"},
524
+ "2":{"p":29,"k":3,"b":"18:6","e":"18:21"},
525
+ "M":{"p":29,"k":3,"b":"18:22","e":"18:30"}}},
526
+ "Yom Kippur (Mincha, Alternate)":{
527
+ "haft":[{"k":"Jonah","b":"1:1","e":"4:11"},
528
+ {"k":"Micah","b":"7:18","e":"7:20"}],
529
+ "fullkriyah":
530
+ {"1":{"p":30,"k":3,"b":"19:1","e":"19:4"},
531
+ "2":{"p":30,"k":3,"b":"19:5","e":"19:10"},
532
+ "M":{"p":30,"k":3,"b":"19:11","e":"19:18"}}},
533
+ "Sukkot I":{
534
+ "haft":{"k":"Zechariah","b":"14:1","e":"14:21"},
535
+ "fullkriyah":
536
+ {"1":{"p":31,"k":3,"b":"22:26","e":"23:3"},
537
+ "2":{"p":31,"k":3,"b":"23:4","e":"23:14"},
538
+ "3":{"p":31,"k":3,"b":"23:15","e":"23:22"},
539
+ "4":{"p":31,"k":3,"b":"23:23","e":"23:32"},
540
+ "5":{"p":31,"k":3,"b":"23:33","e":"23:44"},
541
+ "M":{"p":41,"k":4,"b":"29:12","e":"29:16"}}},
542
+ "Sukkot I (on Shabbat)":{
543
+ "haft":{"k":"Zechariah","b":"14:1","e":"14:21"},
544
+ "fullkriyah":
545
+ {"1":{"p":31,"k":3,"b":"22:26","e":"22:33"},
546
+ "2":{"p":31,"k":3,"b":"23:1","e":"23:3"},
547
+ "3":{"p":31,"k":3,"b":"23:4","e":"23:8"},
548
+ "4":{"p":31,"k":3,"b":"23:9","e":"23:14"},
549
+ "5":{"p":31,"k":3,"b":"23:15","e":"23:22"},
550
+ "6":{"p":31,"k":3,"b":"23:23","e":"23:32"},
551
+ "7":{"p":31,"k":3,"b":"23:33","e":"23:44"},
552
+ "M":{"p":41,"k":4,"b":"29:12","e":"29:16"}}},
553
+ "Sukkot II":{
554
+ "haft":{"k":"I Kings","b":"8:2","e":"8:21"},
555
+ "fullkriyah":
556
+ {"1":{"p":31,"k":3,"b":"22:26","e":"23:3"},
557
+ "2":{"p":31,"k":3,"b":"23:4","e":"23:14"},
558
+ "3":{"p":31,"k":3,"b":"23:15","e":"23:22"},
559
+ "4":{"p":31,"k":3,"b":"23:23","e":"23:32"},
560
+ "5":{"p":31,"k":3,"b":"23:33","e":"23:44"},
561
+ "M":{"p":41,"k":4,"b":"29:12","e":"29:16"}}},
562
+ "Sukkot Chol ha-Moed Day 1":{
563
+ "fullkriyah":
564
+ {"1":{"p":41,"k":4,"b":"29:17","e":"29:19"},
565
+ "2":{"p":41,"k":4,"b":"29:20","e":"29:22"},
566
+ "3":{"p":41,"k":4,"b":"29:23","e":"29:25"},
567
+ "4":{"p":41,"k":4,"b":"29:17","e":"29:22"}}},
568
+ "Sukkot Chol ha-Moed Day 2":{
569
+ "fullkriyah":
570
+ {"1":{"p":41,"k":4,"b":"29:20","e":"29:22"},
571
+ "2":{"p":41,"k":4,"b":"29:23","e":"29:25"},
572
+ "3":{"p":41,"k":4,"b":"29:26","e":"29:28"},
573
+ "4":{"p":41,"k":4,"b":"29:20","e":"29:25"}}},
574
+ "Sukkot Chol ha-Moed Day 3":{
575
+ "fullkriyah":
576
+ {"1":{"p":41,"k":4,"b":"29:23","e":"29:25"},
577
+ "2":{"p":41,"k":4,"b":"29:26","e":"29:28"},
578
+ "3":{"p":41,"k":4,"b":"29:29","e":"29:31"},
579
+ "4":{"p":41,"k":4,"b":"29:23","e":"29:28"}}},
580
+ "Sukkot Chol ha-Moed Day 4":{
581
+ "fullkriyah":
582
+ {"1":{"p":41,"k":4,"b":"29:26","e":"29:28"},
583
+ "2":{"p":41,"k":4,"b":"29:29","e":"29:31"},
584
+ "3":{"p":41,"k":4,"b":"29:32","e":"29:34"},
585
+ "4":{"p":41,"k":4,"b":"29:26","e":"29:31"}}},
586
+ "Sukkot Chol ha-Moed Day 5":{
587
+ "fullkriyah":
588
+ {"1":{"p":41,"k":4,"b":"29:29","e":"29:31"},
589
+ "2":{"p":41,"k":4,"b":"29:32","e":"29:34"},
590
+ "3":{"p":41,"k":4,"b":"29:35","e":"29:37"},
591
+ "4":{"p":41,"k":4,"b":"29:29","e":"29:34"}}},
592
+ "Sukkot Shabbat Chol ha-Moed":{
593
+ "megillah":"Ecclesiastes",
594
+ "haft":{"k":"Ezekiel","b":"38:18","e":"39:16"},
595
+ "fullkriyah":
596
+ {"1":{"p":21,"k":2,"b":"33:12","e":"33:16"},
597
+ "2":{"p":21,"k":2,"b":"33:17","e":"33:19"},
598
+ "3":{"p":21,"k":2,"b":"33:20","e":"33:23"},
599
+ "4":{"p":21,"k":2,"b":"34:1","e":"34:3"},
600
+ "5":{"p":21,"k":2,"b":"34:4","e":"34:10"},
601
+ "6":{"p":21,"k":2,"b":"34:11","e":"34:17"},
602
+ "7":{"p":21,"k":2,"b":"34:18","e":"34:26"},
603
+ "M-day1":{"p":41,"k":4,"b":"29:17","e":"29:22"},
604
+ "M-day2":{"p":41,"k":4,"b":"29:20","e":"29:25"},
605
+ "M-day3":{"p":41,"k":4,"b":"29:23","e":"29:28"},
606
+ "M-day4":{"p":41,"k":4,"b":"29:26","e":"29:31"},
607
+ "M-day5":{"p":41,"k":4,"b":"29:29","e":"29:34"}}},
608
+ "Sukkot Final Day (Hoshana Raba)":{
609
+ "fullkriyah":
610
+ {"1":{"p":41,"k":4,"b":"29:26","e":"29:28"},
611
+ "2":{"p":41,"k":4,"b":"29:29","e":"29:31"},
612
+ "3":{"p":41,"k":4,"b":"29:32","e":"29:34"},
613
+ "4":{"p":41,"k":4,"b":"29:29","e":"29:34"}}},
614
+ "Shmini Atzeret":{
615
+ "haft":{"k":"I Kings","b":"8:54","e":"8:66"},
616
+ "fullkriyah":
617
+ {"1":{"p":47,"k":5,"b":"14:22","e":"14:29"},
618
+ "2":{"p":47,"k":5,"b":"15:1","e":"15:18"},
619
+ "3":{"p":47,"k":5,"b":"15:19","e":"16:3"},
620
+ "4":{"p":47,"k":5,"b":"16:4","e":"16:8"},
621
+ "5":{"p":47,"k":5,"b":"16:9","e":"16:17"},
622
+ "M":{"p":41,"k":4,"b":"29:35","e":"30:1"}}},
623
+ "Shmini Atzeret (on Shabbat)":{
624
+ "haft":{"k":"I Kings","b":"8:54","e":"8:66"},
625
+ "fullkriyah":
626
+ {"1":{"p":47,"k":5,"b":"14:22","e":"14:29"},
627
+ "2":{"p":47,"k":5,"b":"15:1","e":"15:18"},
628
+ "3":{"p":47,"k":5,"b":"15:19","e":"15:23"},
629
+ "4":{"p":47,"k":5,"b":"16:1","e":"16:3"},
630
+ "5":{"p":47,"k":5,"b":"16:4","e":"16:8"},
631
+ "6":{"p":47,"k":5,"b":"16:9","e":"16:12"},
632
+ "7":{"p":47,"k":5,"b":"16:13","e":"16:17"},
633
+ "M":{"p":41,"k":4,"b":"29:35","e":"30:1"}}},
634
+ "Erev Simchat Torah":{
635
+ "fullkriyah":
636
+ {"1":{"p":54,"k":5,"b":"33:1","e":"33:7"},
637
+ "2":{"p":54,"k":5,"b":"33:8","e":"33:12"},
638
+ "3":{"p":54,"k":5,"b":"33:13","e":"33:17"}}},
639
+ "Simchat Torah":{
640
+ "haft":{"k":"Joshua","b":"1:1","e":"1:18"},
641
+ "fullkriyah":
642
+ {"1":{"p":54,"k":5,"b":"33:1","e":"33:7"},
643
+ "2":{"p":54,"k":5,"b":"33:8","e":"33:12"},
644
+ "3":{"p":54,"k":5,"b":"33:13","e":"33:17"},
645
+ "4":{"p":54,"k":5,"b":"33:18","e":"33:21"},
646
+ "5":{"p":54,"k":5,"b":"33:22","e":"33:26"},
647
+ "6":{"p":54,"k":5,"b":"33:27","e":"34:12"},
648
+ "7":{"p":1,"k":1,"b":"1:1","e":"2:3"},
649
+ "M":{"p":41,"k":4,"b":"29:35","e":"30:1"}}},
650
+ "Shabbat Rosh Chodesh Chanukah":{
651
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
652
+ "fullkriyah":
653
+ {"7":{"p":41,"k":4,"b":"28:9","e":"28:15"},
654
+ "M":{"p":35,"k":4,"b":"7:42","e":"7:47"}}},
655
+ "Chanukah Day 1":{
656
+ "fullkriyah":
657
+ {"1":{"p":35,"k":4,"b":"7:1","e":"7:11"},
658
+ "2":{"p":35,"k":4,"b":"7:12","e":"7:14"},
659
+ "3":{"p":35,"k":4,"b":"7:15","e":"7:17"}},
660
+ "alt":{"1":{"p":35,"k":4,"b":"7:1","e":"7:3"},
661
+ "2":{"p":35,"k":4,"b":"7:4","e":"7:11"},
662
+ "3":{"p":35,"k":4,"b":"7:12","e":"7:17"}}},
663
+ "Chanukah Day 1 (on Shabbat)":{
664
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
665
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:1","e":"7:17"}}},
666
+ "Chanukah Day 2":{
667
+ "fullkriyah":
668
+ {"1":{"p":35,"k":4,"b":"7:18","e":"7:20"},
669
+ "2":{"p":35,"k":4,"b":"7:21","e":"7:23"},
670
+ "3":{"p":35,"k":4,"b":"7:24","e":"7:29"}},
671
+ "alt":{"1":{"p":35,"k":4,"b":"7:18","e":"7:20"},
672
+ "2":{"p":35,"k":4,"b":"7:21","e":"7:23"},
673
+ "3":{"p":35,"k":4,"b":"7:18","e":"7:23"}}},
674
+ "Chanukah Day 2 (on Shabbat)":{
675
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
676
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:18","e":"7:23"}}},
677
+ "Chanukah Day 3":{
678
+ "fullkriyah":
679
+ {"1":{"p":35,"k":4,"b":"7:24","e":"7:26"},
680
+ "2":{"p":35,"k":4,"b":"7:27","e":"7:29"},
681
+ "3":{"p":35,"k":4,"b":"7:30","e":"7:35"}},
682
+ "alt":{"1":{"p":35,"k":4,"b":"7:24","e":"7:26"},
683
+ "2":{"p":35,"k":4,"b":"7:27","e":"7:29"},
684
+ "3":{"p":35,"k":4,"b":"7:24","e":"7:29"}}},
685
+ "Chanukah Day 3 (on Shabbat)":{
686
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
687
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:24","e":"7:29"}}},
688
+ "Chanukah Day 4":{
689
+ "fullkriyah":
690
+ {"1":{"p":35,"k":4,"b":"7:30","e":"7:32"},
691
+ "2":{"p":35,"k":4,"b":"7:33","e":"7:35"},
692
+ "3":{"p":35,"k":4,"b":"7:36","e":"7:41"}},
693
+ "alt":{"1":{"p":35,"k":4,"b":"7:30","e":"7:32"},
694
+ "2":{"p":35,"k":4,"b":"7:33","e":"7:35"},
695
+ "3":{"p":35,"k":4,"b":"7:30","e":"7:35"}}},
696
+ "Chanukah Day 4 (on Shabbat)":{
697
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
698
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:30","e":"7:35"}}},
699
+ "Chanukah Day 5":{
700
+ "fullkriyah":
701
+ {"1":{"p":35,"k":4,"b":"7:36","e":"7:38"},
702
+ "2":{"p":35,"k":4,"b":"7:39","e":"7:41"},
703
+ "3":{"p":35,"k":4,"b":"7:42","e":"7:47"}},
704
+ "alt":{"1":{"p":35,"k":4,"b":"7:36","e":"7:38"},
705
+ "2":{"p":35,"k":4,"b":"7:39","e":"7:41"},
706
+ "3":{"p":35,"k":4,"b":"7:36","e":"7:41"}}},
707
+ "Chanukah Day 5 (on Shabbat)":{
708
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
709
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:36","e":"7:41"}}},
710
+ "Chanukah Day 6":{
711
+ "fullkriyah":
712
+ {"1":{"p":41,"k":4,"b":"28:1","e":"28:5"},
713
+ "2":{"p":41,"k":4,"b":"28:6","e":"28:10"},
714
+ "3":{"p":41,"k":4,"b":"28:11","e":"28:15"},
715
+ "4":{"p":35,"k":4,"b":"7:42","e":"7:47"}}},
716
+ "Chanukah Day 7":{
717
+ "fullkriyah":
718
+ {"1":{"p":35,"k":4,"b":"7:48","e":"7:50"},
719
+ "2":{"p":35,"k":4,"b":"7:51","e":"7:53"},
720
+ "3":{"p":35,"k":4,"b":"7:54","e":"7:59"}},
721
+ "alt":{"1":{"p":35,"k":4,"b":"7:48","e":"7:50"},
722
+ "2":{"p":35,"k":4,"b":"7:51","e":"7:53"},
723
+ "3":{"p":35,"k":4,"b":"7:48","e":"7:53"}}},
724
+ "Chanukah Day 7 (on Rosh Chodesh)":{
725
+ "fullkriyah":
726
+ {"1":{"p":41,"k":4,"b":"28:1","e":"28:5"},
727
+ "2":{"p":41,"k":4,"b":"28:6","e":"28:10"},
728
+ "3":{"p":41,"k":4,"b":"28:11","e":"28:15"},
729
+ "4":{"p":35,"k":4,"b":"7:48","e":"7:53"}}},
730
+ "Chanukah Day 7 (on Shabbat)":{
731
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
732
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:48","e":"7:53"}}},
733
+ "Chanukah Day 8":{
734
+ "fullkriyah":
735
+ {"1":{"p":35,"k":4,"b":"7:54","e":"7:56"},
736
+ "2":{"p":35,"k":4,"b":"7:57","e":"7:59"},
737
+ "3":{"p":35,"k":4,"b":"7:60","e":"8:4"}}},
738
+ "Chanukah Day 8 (on Shabbat)":{
739
+ "haft":{"k":"I Kings","b":"7:40","e":"7:50"},
740
+ "fullkriyah":{"M":{"p":35,"k":4,"b":"7:54","e":"8:4"}}},
741
+ "Erev Purim":{"megillah":"Esther"},
742
+ "Purim":{
743
+ "megillah":"Esther",
744
+ "fullkriyah":
745
+ {"1":{"p":16,"k":2,"b":"17:8","e":"17:10"},
746
+ "2":{"p":16,"k":2,"b":"17:11","e":"17:13"},
747
+ "3":{"p":16,"k":2,"b":"17:14","e":"17:16"}}},
748
+ "Shushan Purim":{
749
+ "note":"Jerusalem & walled cities only",
750
+ "il":true,
751
+ "megillah":"Esther",
752
+ "fullkriyah":
753
+ {"1":{"p":16,"k":2,"b":"17:8","e":"17:10"},
754
+ "2":{"p":16,"k":2,"b":"17:11","e":"17:13"},
755
+ "3":{"p":16,"k":2,"b":"17:14","e":"17:16"}}},
756
+ "Shushan Purim (on Shabbat)":{
757
+ "il":true,
758
+ "note":"Jerusalem & walled cities only: special maftir Exodus 17:8-16, same Haftara as Shabbat Zachor"},
759
+ "Shabbat HaChodesh":{
760
+ "haft":{"k":"Ezekiel","b":"45:16","e":"46:18"},
761
+ "fullkriyah":
762
+ {"M":{"p":15,"k":2,"b":"12:1","e":"12:20"}}},
763
+ "Shabbat HaChodesh (on Rosh Chodesh)":{
764
+ "haft":{"k":"Ezekiel","b":"45:16","e":"46:18"},
765
+ "fullkriyah":
766
+ {"7":{"p":41,"k":4,"b":"28:9","e":"28:15"},
767
+ "M":{"p":15,"k":2,"b":"12:1","e":"12:20"}}},
768
+ "Shabbat HaGadol":{
769
+ "haft":{"k":"Malachi","b":"3:4","e":"3:24"}},
770
+ "Shabbat Parah":{
771
+ "haft":{"k":"Ezekiel","b":"36:16","e":"36:38"},
772
+ "fullkriyah":
773
+ {"M":{"p":39,"k":4,"b":"19:1","e":"19:22"}}},
774
+ "Shabbat Shekalim":{
775
+ "haft":{"k":"II Kings","b":"12:1","e":"12:17"},
776
+ "fullkriyah":
777
+ {"M":{"p":21,"k":2,"b":"30:11","e":"30:16"}}},
778
+ "Shabbat Shekalim (on Rosh Chodesh)":{
779
+ "haft":{"k":"II Kings","b":"12:1","e":"12:17"},
780
+ "fullkriyah":
781
+ {"7":{"p":41,"k":4,"b":"28:9","e":"28:15"},
782
+ "M":{"p":21,"k":2,"b":"30:11","e":"30:16"}}},
783
+ "Shabbat Shuva (with Vayeilech)":{
784
+ "haft":[{"k":"Hosea","b":"14:2","e":"14:10"},
785
+ {"k":"Micah","b":"7:18","e":"7:20"}]},
786
+ "Shabbat Shuva (with Ha'azinu)":{
787
+ "haft":[{"k":"Hosea","b":"14:2","e":"14:10"},
788
+ {"k":"Joel","b":"2:15","e":"2:27"}],
789
+ "seph":[{"k":"Hosea","b":"14:2","e":"14:10"},
790
+ {"k":"Micah","b":"7:18","e":"7:20"}]},
791
+ "Shabbat Shuva":{
792
+ "haft":[{"k":"Hosea","b":"14:2","e":"14:10"},
793
+ {"k":"Micah","b":"7:18","e":"7:20"},
794
+ {"k":"Joel","b":"2:15","e":"2:27"}]},
795
+ "Shabbat Zachor":{
796
+ "haft":{"k":"I Samuel","b":"15:2","e":"15:34"},
797
+ "fullkriyah":
798
+ {"M":{"p":49,"k":5,"b":"25:17","e":"25:19"}}},
799
+ "Pinchas occurring after 17 Tammuz":{
800
+ "haft": {"k": "Jeremiah", "b": "1:1", "e": "2:3"}},
801
+ "Masei on Shabbat Rosh Chodesh":{
802
+ "haft":[
803
+ {"k":"Jeremiah","b":"2:4","e":"2:28"},
804
+ {"k":"Jeremiah","b":"3:4","e":"3:4"},
805
+ {"k":"Isaiah","b":"66:1","e":"66:1"},
806
+ {"k":"Isaiah","b":"66:23","e":"66:23"}]},
807
+ "Matot-Masei on Shabbat Rosh Chodesh":{"alias":true,"key":"Masei on Shabbat Rosh Chodesh"},
808
+ "Ki Teitzei with 3rd Haftarah of Consolation":{
809
+ "haft":[
810
+ {"k":"Isaiah","b":"54:1","e":"54:10"},
811
+ {"k":"Isaiah","b":"54:11","e":"55:5"}]},
812
+ "Rosh Chodesh":{
813
+ "fullkriyah":
814
+ {"1":{"p":41,"k":4,"b":"28:1","e":"28:3"},
815
+ "2":{"p":41,"k":4,"b":"28:3","e":"28:5"},
816
+ "3":{"p":41,"k":4,"b":"28:6","e":"28:10"},
817
+ "4":{"p":41,"k":4,"b":"28:11","e":"28:15"}}},
818
+ "Rosh Chodesh Nisan":{"alias":true,"key":"Rosh Chodesh"},
819
+ "Rosh Chodesh Iyyar":{"alias":true,"key":"Rosh Chodesh"},
820
+ "Rosh Chodesh Sivan":{"alias":true,"key":"Rosh Chodesh"},
821
+ "Rosh Chodesh Tamuz":{"alias":true,"key":"Rosh Chodesh"},
822
+ "Rosh Chodesh Av":{"alias":true,"key":"Rosh Chodesh"},
823
+ "Rosh Chodesh Elul":{"alias":true,"key":"Rosh Chodesh"},
824
+ "Rosh Chodesh Tishrei":{"alias":true,"key":"Rosh Chodesh"},
825
+ "Rosh Chodesh Cheshvan":{"alias":true,"key":"Rosh Chodesh"},
826
+ "Rosh Chodesh Kislev":{"alias":true,"key":"Rosh Chodesh"},
827
+ "Rosh Chodesh Sh'vat":{"alias":true,"key":"Rosh Chodesh"},
828
+ "Rosh Chodesh Adar":{"alias":true,"key":"Rosh Chodesh"},
829
+ "Rosh Chodesh Adar I":{"alias":true,"key":"Rosh Chodesh"},
830
+ "Rosh Chodesh Adar II":{"alias":true,"key":"Rosh Chodesh"},
831
+ "Shabbat Rosh Chodesh":{
832
+ "haft":{"k":"Isaiah","b":"66:1","e":"66:24"},
833
+ "fullkriyah":
834
+ {"M":{"p":41,"k":4,"b":"28:9","e":"28:15"}}},
835
+ "Shabbat Machar Chodesh":{
836
+ "haft":{"k":"I Samuel","b":"20:18","e":"20:42"}}};
837
+
838
+ /**
839
+ * Is there a special festival Torah Reading for `holiday`?
840
+ * @param {string} holiday
841
+ * @return {boolean}
842
+ */
843
+ function hasFestival(holiday) {
844
+ return typeof festivals[holiday] === 'object';
845
+ }
846
+
847
+ /**
848
+ * Returns the raw metadata for festival reading for `holiday`
849
+ * @param {string} holiday
850
+ * @return {any}
851
+ */
852
+ function lookupFestival(holiday) {
853
+ let src = festivals[holiday];
854
+ if (typeof src === 'undefined') {
855
+ return undefined;
856
+ }
857
+ if (src.alias) {
858
+ const tmp = festivals[src.key];
859
+ if (typeof tmp === 'undefined') {
860
+ throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
861
+ }
862
+ src = tmp;
863
+ }
864
+ const result = src.fullkriyah ? clone(src) : src;
865
+ if (result.fullkriyah) {
866
+ for (const aliyah of Object.values(result.fullkriyah)) {
867
+ if (typeof aliyah.k === 'number') {
868
+ aliyah.k = BOOK[aliyah.k];
869
+ }
870
+ }
871
+ }
872
+ if (src.note) {
873
+ result.note = src.note;
874
+ }
875
+ return result;
876
+ }
877
+
878
+ const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI | core.flags.OMER_COUNT | core.flags.SHABBAT_MEVARCHIM |
879
+ core.flags.MOLAD | core.flags.USER_EVENT | core.flags.HEBREW_DATE | core.flags.MISHNA_YOMI |
880
+ core.flags.MODERN_HOLIDAY | core.flags.YERUSHALMI_YOMI;
881
+
882
+ /**
883
+ * Based on the event date, type and title, finds the relevant leyning key
884
+ * @param {Event} ev event
885
+ * @param {boolean} [il] true if Israel holiday scheme
886
+ * @return {string} key to look up in holiday-reading.json
887
+ */
888
+ function getLeyningKeyForEvent(ev, il = false) {
889
+ if (typeof ev.eventTime !== 'undefined') {
890
+ return undefined;
891
+ }
892
+ const mask = ev.getFlags();
893
+ if (mask & HOLIDAY_IGNORE_MASK) {
894
+ return undefined;
895
+ }
896
+ // Skip all Erevs except for Simchat Torah
897
+ const desc = ev.getDesc();
898
+ if (mask & core.flags.EREV && !hasFestival(desc)) {
899
+ return undefined;
900
+ }
901
+ const hd = ev.getDate();
902
+ const day = hd.getDate();
903
+ const dow = hd.abs() % 7;
904
+ const month = hd.getMonth();
905
+ const isShabbat = (dow == 6);
906
+ const isRoshChodesh = (day == 1 || day == 30);
907
+ const holiday = ev.basename();
908
+ const isPesach = holiday === 'Pesach';
909
+ if (il && isPesach) {
910
+ if (isShabbat) {
911
+ return day === 15 || day === 21 ? desc + ' (on Shabbat)' : 'Pesach Shabbat Chol ha-Moed';
912
+ }
913
+ return desc;
914
+ }
915
+ const cholHaMoedDay = ev.cholHaMoedDay;
916
+ if (day == 1 && month === core.months.TISHREI) {
917
+ return isShabbat ? 'Rosh Hashana I (on Shabbat)' : 'Rosh Hashana I';
918
+ } else if (cholHaMoedDay) {
919
+ // Sukkot or Pesach
920
+ if (isShabbat) {
921
+ return holiday + ' Shabbat Chol ha-Moed';
922
+ } else if (desc == 'Sukkot VII (Hoshana Raba)') {
923
+ return 'Sukkot Final Day (Hoshana Raba)';
924
+ }
925
+ if (isPesach && cholHaMoedDay) {
926
+ if (dow === 0 && desc === 'Pesach IV (CH\'\'M)') {
927
+ return 'Pesach Chol ha-Moed Day 2 on Sunday';
928
+ } else if (dow === 1 && desc === 'Pesach V (CH\'\'M)') {
929
+ return 'Pesach Chol ha-Moed Day 3 on Monday';
930
+ }
931
+ }
932
+ return `${holiday} Chol ha-Moed Day ${cholHaMoedDay}`;
933
+ } else if (ev.chanukahDay) {
934
+ if (isShabbat && isRoshChodesh) {
935
+ return 'Shabbat Rosh Chodesh Chanukah';
936
+ } else if (isRoshChodesh && ev.chanukahDay == 7) {
937
+ return `Chanukah Day 7 (on Rosh Chodesh)`;
938
+ } else if (isShabbat) {
939
+ return `Chanukah Day ${ev.chanukahDay} (on Shabbat)`;
940
+ } else {
941
+ return `Chanukah Day ${ev.chanukahDay}`;
942
+ }
943
+ }
944
+
945
+ if (isRoshChodesh && (desc == 'Shabbat HaChodesh' || desc == 'Shabbat Shekalim')) {
946
+ return desc + ' (on Rosh Chodesh)';
947
+ }
948
+
949
+ if (il && desc == 'Shmini Atzeret') {
950
+ return 'Simchat Torah';
951
+ }
952
+
953
+ if (desc === 'Chag HaBanot') {
954
+ return undefined;
955
+ }
956
+
957
+ if (isShabbat && 'Shabbat' != desc.substring(0, 7)) {
958
+ if (isRoshChodesh) {
959
+ if (desc === 'Rosh Chodesh Tevet') {
960
+ return 'Shabbat Rosh Chodesh Chanukah';
961
+ }
962
+ return 'Shabbat Rosh Chodesh';
963
+ }
964
+ const desc2 = desc + ' (on Shabbat)';
965
+ if (hasFestival(desc2)) {
966
+ return desc2;
967
+ }
968
+ }
969
+
970
+ if (hasFestival(desc)) {
971
+ return desc;
972
+ }
973
+
974
+ if (isShabbat) {
975
+ const tommorow = hd.next().getDate();
976
+ if (tommorow === 30 || tommorow === 1) {
977
+ return 'Shabbat Machar Chodesh';
978
+ }
979
+ }
980
+
981
+ if (desc === 'Rosh Hashana LaBehemot') {
982
+ return undefined;
983
+ }
984
+
985
+ if (desc === 'Rosh Chodesh Tevet') {
986
+ if (isShabbat) {
987
+ return 'Shabbat Rosh Chodesh Chanukah';
988
+ }
989
+ if (day === 30 || core.HDate.shortKislev(hd.getFullYear())) {
990
+ return 'Chanukah Day 6'; // 30th of Kislev or 1st of Tevet
991
+ } else {
992
+ return 'Chanukah Day 7 (on Rosh Chodesh)'; // 1st of Tevet
993
+ }
994
+ }
995
+
996
+ if (isRoshChodesh) {
997
+ return desc;
998
+ }
999
+
1000
+ if (desc === 'Tish\'a B\'Av (observed)') {
1001
+ return 'Tish\'a B\'Av';
1002
+ }
1003
+
1004
+ return undefined;
1005
+ }
1006
+
1007
+ /**
1008
+ * Leyning for a parsha hashavua or holiday
1009
+ * @typedef {Object} SpecialReading
1010
+ * @property {Object<string,Aliyah>} aliyot - Map of aliyot `1` through `7` plus `M` for maftir
1011
+ * @property {Object<string,string>} [reason] - Explanations for special readings,
1012
+ * keyed by aliyah number, `M` for maftir or `haftara` for Haftarah
1013
+ * @property {Aliyah|Aliyah[]} haft - Haftarah object(s)
1014
+ * @property {Aliyah|Aliyah[]} seph - Haftarah object(s)
1015
+ */
1016
+
1017
+ /**
1018
+ * @private
1019
+ * @param {Object<string,Aliyah>} aliyot
1020
+ */
1021
+ function aliyotCombine67(aliyot) {
1022
+ const a6 = clone(aliyot['6']);
1023
+ const a7 = aliyot['7'];
1024
+ if (a6.k !== a7.k) {
1025
+ throw new Error('Impossible to combine aliyot 6 & 7: ' + JSON.stringify(aliyot));
1026
+ }
1027
+ delete aliyot['7'];
1028
+ aliyot['6'] = {
1029
+ k: a6.k,
1030
+ b: a6.b,
1031
+ e: a7.e,
1032
+ };
1033
+ if (a6.v && a7.v) {
1034
+ aliyot['6'].v = a6.v + a7.v;
1035
+ }
1036
+ }
1037
+
1038
+ /**
1039
+ * @private
1040
+ * @param {Object<string,Aliyah>} aliyot
1041
+ * @param {Object<string,Aliyah>} special
1042
+ */
1043
+ function mergeAliyotWithSpecial(aliyot, special) {
1044
+ if (special['7']) {
1045
+ aliyotCombine67(aliyot);
1046
+ aliyot['7'] = clone(special['7']);
1047
+ calculateNumVerses(aliyot['7']);
1048
+ }
1049
+ if (special['M']) {
1050
+ aliyot['M'] = clone(special['M']);
1051
+ calculateNumVerses(aliyot['M']);
1052
+ }
1053
+ }
1054
+
1055
+ /**
1056
+ * Determines if the regular parashat haShavua coincides with an event that requires
1057
+ * a special maftir or Haftara (for example Shabbat HaGadol, Shabbat Chanukah, Rosh
1058
+ * Chodesh or Machar Chodesh, etc.).
1059
+ *
1060
+ * This function does not modify `aliyot`. Instead, it returns a deep copy
1061
+ * with `aliyot['M']` replaced and sets `reason.M`
1062
+ * (and in some cases the 6th and 7th aliyah, setting `reason['7']`).
1063
+ *
1064
+ * If a special Haftarah applies, the result will have a `haft` property
1065
+ * pointing to Haftarah object and sets `reason.haftara`.
1066
+ * @param {string[]} parsha
1067
+ * @param {HDate} hd
1068
+ * @param {boolean} il
1069
+ * @param {Object<string,Aliyah>} aliyot
1070
+ * @return {SpecialReading}
1071
+ */
1072
+ function specialReadings2(parsha, hd, il, aliyot) {
1073
+ let haft;
1074
+ let seph;
1075
+ let specialHaft = false;
1076
+ const reason = {};
1077
+
1078
+ // eslint-disable-next-line require-jsdoc
1079
+ function handleSpecial(key) {
1080
+ const special = lookupFestival(key);
1081
+ if (!special) {
1082
+ return;
1083
+ }
1084
+ if (typeof special.il === 'boolean' && il !== special.il) {
1085
+ return;
1086
+ }
1087
+ if (special.haft && !specialHaft) {
1088
+ haft = cloneHaftara(special.haft);
1089
+ reason.haftara = key;
1090
+ specialHaft = true;
1091
+ if (special.seph) {
1092
+ seph = cloneHaftara(special.seph);
1093
+ reason.sephardic = key;
1094
+ }
1095
+ }
1096
+ if (special.fullkriyah) {
1097
+ const aliyotMap = clone(aliyot);
1098
+ mergeAliyotWithSpecial(aliyotMap, special.fullkriyah);
1099
+ for (const num of Object.keys(special.fullkriyah)) {
1100
+ reason[num] = key;
1101
+ }
1102
+ aliyot = aliyotMap;
1103
+ }
1104
+ }
1105
+
1106
+ const parshaName = parshaToString(parsha);
1107
+ const events0 = core.HebrewCalendar.getHolidaysOnDate(hd, il) || [];
1108
+ const events = events0.filter((ev) => !(ev.getFlags() & core.flags.ROSH_CHODESH));
1109
+ for (const ev of events) {
1110
+ if (ev.getDesc() === 'Shabbat Shuva') {
1111
+ handleSpecial(`Shabbat Shuva (with ${parshaName})`);
1112
+ } else {
1113
+ const key = getLeyningKeyForEvent(ev, il);
1114
+ if (key) {
1115
+ handleSpecial(key);
1116
+ }
1117
+ }
1118
+ }
1119
+ if (!haft) {
1120
+ const day = hd.getDate();
1121
+ if (parshaName === 'Pinchas' && day > 17) {
1122
+ // Pinchas is always read in Tamuz (never another month)
1123
+ // either on the 14, 16, 17 (in Israel), 19, 21, 23, 24
1124
+ handleSpecial('Pinchas occurring after 17 Tammuz');
1125
+ } else if (day === 30 || day === 1) {
1126
+ const key = (parshaName === 'Masei' || parshaName === 'Matot-Masei') ?
1127
+ `${parshaName} on Shabbat Rosh Chodesh` :
1128
+ 'Shabbat Rosh Chodesh';
1129
+ handleSpecial(key);
1130
+ } else if (parshaName === 'Ki Teitzei' && day === 14) {
1131
+ // Ki Teitzei is always read in Elul on 9, 11, 13 or 14
1132
+ // "Because Shabbat Re’eh was Rosh Ḥodesh, the usual 3rd haftarah of
1133
+ // consolation was not read. Chant the haftarah of Ki tetse and then
1134
+ // the haftarah of Re’eh as a single haftarah.
1135
+ // In the book of Isaiah these two brief passages are adjacent."
1136
+ // Source: Luaḥ Hashanah, Rabbi Miles B. Cohen and Leslie Rubin
1137
+ handleSpecial('Ki Teitzei with 3rd Haftarah of Consolation');
1138
+ } else if (hd.getMonth() !== core.months.AV) {
1139
+ // Parashat Re'eh is always read in Av on 25, 27, 29 or 30.
1140
+ // When it coincides with Erev Rosh Chodesh, the Haftarah is
1141
+ // עניה סוערה (Isaiah 54:11-55:5) and not מחר חדש
1142
+ const tommorow = hd.next().getDate();
1143
+ if (tommorow === 30 || tommorow === 1) {
1144
+ handleSpecial('Shabbat Machar Chodesh');
1145
+ }
1146
+ }
1147
+ }
1148
+ return {aliyot, reason, haft, seph};
1149
+ }
1150
+
1151
+ /**
1152
+ * Looks up leyning for a given holiday key. Key should be an
1153
+ * (untranslated) string used in holiday-readings.json. Returns some
1154
+ * of full kriyah aliyot, special Maftir, special Haftarah
1155
+ * @param {string} key name from `holiday-readings.json` to find
1156
+ * @param {number} [cholHaMoedDay]
1157
+ * @param {boolean} [il]
1158
+ * @return {Leyning} map of aliyot
1159
+ */
1160
+ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
1161
+ if (typeof key !== 'string') {
1162
+ return undefined;
1163
+ }
1164
+ const src = lookupFestival(key);
1165
+ if (typeof src === 'undefined') {
1166
+ return undefined;
1167
+ }
1168
+ if (typeof src.il === 'boolean' && typeof il === 'boolean' && il !== src.il) {
1169
+ return undefined;
1170
+ }
1171
+ const leyning = {
1172
+ name: {
1173
+ en: key,
1174
+ he: core.Locale.lookupTranslation(key, 'he'),
1175
+ },
1176
+ };
1177
+ if (src.fullkriyah) {
1178
+ leyning.fullkriyah = clone(src.fullkriyah);
1179
+ if (key === 'Sukkot Shabbat Chol ha-Moed' && cholHaMoedDay) {
1180
+ leyning.fullkriyah['M'] = leyning.fullkriyah[`M-day${cholHaMoedDay}`];
1181
+ for (let day = 1; day <= 5; day++) {
1182
+ delete leyning.fullkriyah[`M-day${day}`];
1183
+ }
1184
+ }
1185
+ if (typeof leyning.fullkriyah['1'] === 'object') {
1186
+ const parts = makeLeyningParts(leyning.fullkriyah);
1187
+ leyning.summary = makeSummaryFromParts(parts);
1188
+ if (parts.length > 1) {
1189
+ leyning.summaryParts = parts;
1190
+ }
1191
+ }
1192
+ Object.values(leyning.fullkriyah).map((aliyah) => calculateNumVerses(aliyah));
1193
+ }
1194
+ if (src.haft) {
1195
+ const haft = leyning.haft = cloneHaftara(src.haft);
1196
+ leyning.haftara = makeSummaryFromParts(haft);
1197
+ leyning.haftaraNumV = sumVerses(haft);
1198
+ }
1199
+ if (src.seph) {
1200
+ const seph = leyning.seph = cloneHaftara(src.seph);
1201
+ leyning.sephardic = makeSummaryFromParts(seph);
1202
+ leyning.sephardicNumV = sumVerses(seph);
1203
+ }
1204
+ if (src.megillah) {
1205
+ const book = src.megillah;
1206
+ const chaps = numverses[book];
1207
+ const m = {};
1208
+ for (let i = 1; i < chaps.length; i++) {
1209
+ const numv = chaps[i];
1210
+ m[`${i}`] = {k: book, b: `${i}:1`, e: `${i}:${numv}`, v: numv};
1211
+ }
1212
+ leyning.megillah = m;
1213
+ }
1214
+ if (src.note) {
1215
+ leyning.note = src.note;
1216
+ }
1217
+ return leyning;
1218
+ }
1219
+
1220
+ /**
1221
+ * Looks up leyning for a given holiday. Returns some
1222
+ * of full kriyah aliyot, special Maftir, special Haftarah
1223
+ * @param {Event} ev the Hebcal event associated with this leyning
1224
+ * @param {boolean} [il] true if Israel holiday scheme
1225
+ * @return {Leyning} map of aliyot
1226
+ */
1227
+ function getLeyningForHoliday(ev, il = false) {
1228
+ if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
1229
+ throw new TypeError(`Bad event argument: ${ev}`);
1230
+ } else if (typeof ev.eventTime !== 'undefined') {
1231
+ return undefined;
1232
+ } else if (ev.getFlags() & core.flags.PARSHA_HASHAVUA) {
1233
+ throw new TypeError(`Event should be a holiday: ${ev.getDesc()}`);
1234
+ } else if (ev.getFlags() & HOLIDAY_IGNORE_MASK) {
1235
+ return undefined;
1236
+ }
1237
+ const key = getLeyningKeyForEvent(ev, il);
1238
+ const leyning = getLeyningForHolidayKey(key, ev.cholHaMoedDay, il);
1239
+ return leyning;
1240
+ }
1241
+
1242
+ var parshiyotObj = {
1243
+ "Bereshit":{
1244
+ "num":1,
1245
+ "hebrew":"בְּרֵאשִׁית",
1246
+ "book":1,
1247
+ "haft":{"k":"Isaiah","b":"42:5","e":"43:10"},
1248
+ "seph":{"k":"Isaiah","b":"42:5","e":"42:21"},
1249
+ "fullkriyah":{
1250
+ "1":["1:1","2:3"],
1251
+ "2":["2:4","2:19"],
1252
+ "3":["2:20","3:21"],
1253
+ "4":["3:22","4:18"],
1254
+ "5":["4:19","4:22"],
1255
+ "6":["4:23","5:24"],
1256
+ "7":["5:25","6:8"],
1257
+ "M":["6:5","6:8"]},
1258
+ "weekday":{
1259
+ "1":["1:1","1:5"],
1260
+ "2":["1:6","1:8"],
1261
+ "3":["1:9","1:13"]
1262
+ }},
1263
+ "Noach":{
1264
+ "num":2,
1265
+ "hebrew":"נֹחַ",
1266
+ "book":1,
1267
+ "haft":{"k":"Isaiah","b":"54:1","e":"55:5"},
1268
+ "seph":{"k":"Isaiah","b":"54:1","e":"54:10"},
1269
+ "fullkriyah":{
1270
+ "1":["6:9","6:22"],
1271
+ "2":["7:1","7:16"],
1272
+ "3":["7:17","8:14"],
1273
+ "4":["8:15","9:7"],
1274
+ "5":["9:8","9:17"],
1275
+ "6":["9:18","10:32"],
1276
+ "7":["11:1","11:32"],
1277
+ "M":["11:29","11:32"]},
1278
+ "weekday":{
1279
+ "1":["6:9","6:16"],
1280
+ "2":["6:17","6:19"],
1281
+ "3":["6:20","6:22"]
1282
+ }},
1283
+ "Lech-Lecha":{
1284
+ "num":3,
1285
+ "hebrew":"לֶךְ־לְךָ",
1286
+ "book":1,
1287
+ "haft":{"k":"Isaiah","b":"40:27","e":"41:16"},
1288
+ "fullkriyah":{
1289
+ "1":["12:1","12:13"],
1290
+ "2":["12:14","13:4"],
1291
+ "3":["13:5","13:18"],
1292
+ "4":["14:1","14:20"],
1293
+ "5":["14:21","15:6"],
1294
+ "6":["15:7","17:6"],
1295
+ "7":["17:7","17:27"],
1296
+ "M":["17:24","17:27"]},
1297
+ "weekday":{
1298
+ "1":["12:1","12:3"],
1299
+ "2":["12:4","12:9"],
1300
+ "3":["12:10","12:13"]
1301
+ }},
1302
+ "Vayera":{
1303
+ "num":4,
1304
+ "hebrew":"וַיֵּרָא",
1305
+ "book":1,
1306
+ "haft":{"k":"II Kings","b":"4:1","e":"4:37"},
1307
+ "seph":{"k":"II Kings","b":"4:1","e":"4:23"},
1308
+ "fullkriyah":{
1309
+ "1":["18:1","18:14"],
1310
+ "2":["18:15","18:33"],
1311
+ "3":["19:1","19:20"],
1312
+ "4":["19:21","21:4"],
1313
+ "5":["21:5","21:21"],
1314
+ "6":["21:22","21:34"],
1315
+ "7":["22:1","22:24"],
1316
+ "M":["22:20","22:24"]},
1317
+ "weekday":{
1318
+ "1":["18:1","18:5"],
1319
+ "2":["18:6","18:8"],
1320
+ "3":["18:9","18:14"]
1321
+ }},
1322
+ "Chayei Sara":{
1323
+ "num":5,
1324
+ "hebrew":"חַיֵּי שָֹרָה",
1325
+ "book":1,
1326
+ "haft":{"k":"I Kings","b":"1:1","e":"1:31"},
1327
+ "fullkriyah":{
1328
+ "1":["23:1","23:16"],
1329
+ "2":["23:17","24:9"],
1330
+ "3":["24:10","24:26"],
1331
+ "4":["24:27","24:52"],
1332
+ "5":["24:53","24:67"],
1333
+ "6":["25:1","25:11"],
1334
+ "7":["25:12","25:18"],
1335
+ "M":["25:16","25:18"]},
1336
+ "weekday":{
1337
+ "1":["23:1","23:7"],
1338
+ "2":["23:8","23:12"],
1339
+ "3":["23:13","23:16"]
1340
+ }},
1341
+ "Toldot":{
1342
+ "num":6,
1343
+ "hebrew":"תּוֹלְדוֹת",
1344
+ "book":1,
1345
+ "haft":{"k":"Malachi","b":"1:1","e":"2:7"},
1346
+ "fullkriyah":{
1347
+ "1":["25:19","26:5"],
1348
+ "2":["26:6","26:12"],
1349
+ "3":["26:13","26:22"],
1350
+ "4":["26:23","26:29"],
1351
+ "5":["26:30","27:27"],
1352
+ "6":["27:28","28:4"],
1353
+ "7":["28:5","28:9"],
1354
+ "M":["28:7","28:9"]},
1355
+ "weekday":{
1356
+ "1":["25:19","25:22"],
1357
+ "2":["25:23","25:26"],
1358
+ "3":["25:27","26:5"]
1359
+ }},
1360
+ "Vayetzei":{
1361
+ "num":7,
1362
+ "hebrew":"וַיֵּצֵא",
1363
+ "book":1,
1364
+ "haft":{"k":"Hosea","b":"12:13","e":"14:10"},
1365
+ "seph":{"k":"Hosea","b":"11:7","e":"12:12"},
1366
+ "fullkriyah":{
1367
+ "1":["28:10","28:22"],
1368
+ "2":["29:1","29:17"],
1369
+ "3":["29:18","30:13"],
1370
+ "4":["30:14","30:27"],
1371
+ "5":["30:28","31:16"],
1372
+ "6":["31:17","31:42"],
1373
+ "7":["31:43","32:3"],
1374
+ "M":["32:1","32:3"]},
1375
+ "weekday":{
1376
+ "1":["28:10","28:12"],
1377
+ "2":["28:13","28:17"],
1378
+ "3":["28:18","28:22"]
1379
+ }},
1380
+ "Vayishlach":{
1381
+ "num":8,
1382
+ "hebrew":"וַיִּשְׁלַח",
1383
+ "book":1,
1384
+ "haft":{"k":"Obadiah","b":"1:1","e":"1:21"},
1385
+ "fullkriyah":{
1386
+ "1":["32:4","32:13"],
1387
+ "2":["32:14","32:30"],
1388
+ "3":["32:31","33:5"],
1389
+ "4":["33:6","33:20"],
1390
+ "5":["34:1","35:11"],
1391
+ "6":["35:12","36:19"],
1392
+ "7":["36:20","36:43"],
1393
+ "M":["36:40","36:43"]},
1394
+ "weekday":{
1395
+ "1":["32:4","32:6"],
1396
+ "2":["32:7","32:9"],
1397
+ "3":["32:10","32:13"]
1398
+ }},
1399
+ "Vayeshev":{
1400
+ "num":9,
1401
+ "hebrew":"וַיֵּשֶׁב",
1402
+ "book":1,
1403
+ "haft":{"k":"Amos","b":"2:6","e":"3:8"},
1404
+ "fullkriyah":{
1405
+ "1":["37:1","37:11"],
1406
+ "2":["37:12","37:22"],
1407
+ "3":["37:23","37:36"],
1408
+ "4":["38:1","38:30"],
1409
+ "5":["39:1","39:6"],
1410
+ "6":["39:7","39:23"],
1411
+ "7":["40:1","40:23"],
1412
+ "M":["40:20","40:23"]},
1413
+ "weekday":{
1414
+ "1":["37:1","37:3"],
1415
+ "2":["37:4","37:7"],
1416
+ "3":["37:8","37:11"]
1417
+ }},
1418
+ "Miketz":{
1419
+ "num":10,
1420
+ "hebrew":"מִקֵּץ",
1421
+ "book":1,
1422
+ "haft":{"k":"I Kings","b":"3:15","e":"4:1"},
1423
+ "fullkriyah":{
1424
+ "1":["41:1","41:14"],
1425
+ "2":["41:15","41:38"],
1426
+ "3":["41:39","41:52"],
1427
+ "4":["41:53","42:18"],
1428
+ "5":["42:19","43:15"],
1429
+ "6":["43:16","43:29"],
1430
+ "7":["43:30","44:17"],
1431
+ "M":["44:14","44:17"]},
1432
+ "weekday":{
1433
+ "1":["41:1","41:4"],
1434
+ "2":["41:5","41:7"],
1435
+ "3":["41:8","41:14"]
1436
+ }},
1437
+ "Vayigash":{
1438
+ "num":11,
1439
+ "hebrew":"וַיִּגַּשׁ",
1440
+ "book":1,
1441
+ "haft":{"k":"Ezekiel","b":"37:15","e":"37:28"},
1442
+ "fullkriyah":{
1443
+ "1":["44:18","44:30"],
1444
+ "2":["44:31","45:7"],
1445
+ "3":["45:8","45:18"],
1446
+ "4":["45:19","45:27"],
1447
+ "5":["45:28","46:27"],
1448
+ "6":["46:28","47:10"],
1449
+ "7":["47:11","47:27"],
1450
+ "M":["47:25","47:27"]},
1451
+ "weekday":{
1452
+ "1":["44:18","44:20"],
1453
+ "2":["44:21","44:24"],
1454
+ "3":["44:25","44:30"]
1455
+ }},
1456
+ "Vayechi":{
1457
+ "num":12,
1458
+ "hebrew":"וַיְחִי",
1459
+ "book":1,
1460
+ "haft":{"k":"I Kings","b":"2:1","e":"2:12"},
1461
+ "fullkriyah":{
1462
+ "1":["47:28","48:9"],
1463
+ "2":["48:10","48:16"],
1464
+ "3":["48:17","48:22"],
1465
+ "4":["49:1","49:18"],
1466
+ "5":["49:19","49:26"],
1467
+ "6":["49:27","50:20"],
1468
+ "7":["50:21","50:26"],
1469
+ "M":["50:23","50:26"]},
1470
+ "weekday":{
1471
+ "1":["47:28","47:31"],
1472
+ "2":["48:1","48:3"],
1473
+ "3":["48:4","48:9"]
1474
+ }},
1475
+ "Shemot":{
1476
+ "num":13,
1477
+ "hebrew":"שְׁמוֹת",
1478
+ "book":2,
1479
+ "haft":[{"k":"Isaiah","b":"27:6","e":"28:13"},{"k":"Isaiah","b":"29:22","e":"29:23"}],
1480
+ "seph":{"k":"Jeremiah","b":"1:1","e":"2:3"},
1481
+ "fullkriyah":{
1482
+ "1":["1:1","1:17"],
1483
+ "2":["1:18","2:10"],
1484
+ "3":["2:11","2:25"],
1485
+ "4":["3:1","3:15"],
1486
+ "5":["3:16","4:17"],
1487
+ "6":["4:18","4:31"],
1488
+ "7":["5:1","6:1"],
1489
+ "M":["5:22","6:1"]},
1490
+ "weekday":{
1491
+ "1":["1:1","1:7"],
1492
+ "2":["1:8","1:12"],
1493
+ "3":["1:13","1:17"]
1494
+ }},
1495
+ "Vaera":{
1496
+ "num":14,
1497
+ "hebrew":"וָאֵרָא",
1498
+ "book":2,
1499
+ "haft":{"k":"Ezekiel","b":"28:25","e":"29:21"},
1500
+ "fullkriyah":{
1501
+ "1":["6:2","6:13"],
1502
+ "2":["6:14","6:28"],
1503
+ "3":["6:29","7:7"],
1504
+ "4":["7:8","8:6"],
1505
+ "5":["8:7","8:18"],
1506
+ "6":["8:19","9:16"],
1507
+ "7":["9:17","9:35"],
1508
+ "M":["9:33","9:35"]},
1509
+ "weekday":{
1510
+ "1":["6:2","6:5"],
1511
+ "2":["6:6","6:9"],
1512
+ "3":["6:10","6:13"]
1513
+ }},
1514
+ "Bo":{
1515
+ "num":15,
1516
+ "hebrew":"בֹּא",
1517
+ "book":2,
1518
+ "haft":{"k":"Jeremiah","b":"46:13","e":"46:28"},
1519
+ "fullkriyah":{
1520
+ "1":["10:1","10:11"],
1521
+ "2":["10:12","10:23"],
1522
+ "3":["10:24","11:3"],
1523
+ "4":["11:4","12:20"],
1524
+ "5":["12:21","12:28"],
1525
+ "6":["12:29","12:51"],
1526
+ "7":["13:1","13:16"],
1527
+ "M":["13:14","13:16"]},
1528
+ "weekday":{
1529
+ "1":["10:1","10:3"],
1530
+ "2":["10:4","10:6"],
1531
+ "3":["10:7","10:11"]
1532
+ }},
1533
+ "Beshalach":{
1534
+ "num":16,
1535
+ "hebrew":"בְּשַׁלַּח",
1536
+ "book":2,
1537
+ "haft":{"k":"Judges","b":"4:4","e":"5:31"},
1538
+ "seph":{"k":"Judges","b":"5:1","e":"5:31"},
1539
+ "fullkriyah":{
1540
+ "1":["13:17","14:8"],
1541
+ "2":["14:9","14:14"],
1542
+ "3":["14:15","14:25"],
1543
+ "4":["14:26","15:26"],
1544
+ "5":["15:27","16:10"],
1545
+ "6":["16:11","16:36"],
1546
+ "7":["17:1","17:16"],
1547
+ "M":["17:14","17:16"]},
1548
+ "weekday":{
1549
+ "1":["13:17","13:22"],
1550
+ "2":["14:1","14:4"],
1551
+ "3":["14:5","14:8"]
1552
+ }},
1553
+ "Yitro":{
1554
+ "num":17,
1555
+ "hebrew":"יִתְרוֹ",
1556
+ "book":2,
1557
+ "haft":[{"k":"Isaiah","b":"6:1","e":"7:6"},{"k":"Isaiah","b":"9:5","e":"9:6"}],
1558
+ "seph":{"k":"Isaiah","b":"6:1","e":"6:13"},
1559
+ "fullkriyah":{
1560
+ "1":["18:1","18:12"],
1561
+ "2":["18:13","18:23"],
1562
+ "3":["18:24","18:27"],
1563
+ "4":["19:1","19:6"],
1564
+ "5":["19:7","19:19"],
1565
+ "6":["19:20","20:14"],
1566
+ "7":["20:15","20:23"],
1567
+ "M":["20:19","20:23"]},
1568
+ "weekday":{
1569
+ "1":["18:1","18:4"],
1570
+ "2":["18:5","18:8"],
1571
+ "3":["18:9","18:12"]
1572
+ }},
1573
+ "Mishpatim":{
1574
+ "num":18,
1575
+ "hebrew":"מִּשְׁפָּטִים",
1576
+ "book":2,
1577
+ "haft":[{"k":"Jeremiah","b":"34:8","e":"34:22"},{"k":"Jeremiah","b":"33:25","e":"33:26"}],
1578
+ "fullkriyah":{
1579
+ "1":["21:1","21:19"],
1580
+ "2":["21:20","22:3"],
1581
+ "3":["22:4","22:26"],
1582
+ "4":["22:27","23:5"],
1583
+ "5":["23:6","23:19"],
1584
+ "6":["23:20","23:25"],
1585
+ "7":["23:26","24:18"],
1586
+ "M":["24:15","24:18"]},
1587
+ "weekday":{
1588
+ "1":["21:1","21:6"],
1589
+ "2":["21:7","21:11"],
1590
+ "3":["21:12","21:19"]
1591
+ }},
1592
+ "Terumah":{
1593
+ "num":19,
1594
+ "hebrew":"תְּרוּמָה",
1595
+ "book":2,
1596
+ "haft":{"k":"I Kings","b":"5:26","e":"6:13"},
1597
+ "fullkriyah":{
1598
+ "1":["25:1","25:16"],
1599
+ "2":["25:17","25:30"],
1600
+ "3":["25:31","26:14"],
1601
+ "4":["26:15","26:30"],
1602
+ "5":["26:31","26:37"],
1603
+ "6":["27:1","27:8"],
1604
+ "7":["27:9","27:19"],
1605
+ "M":["27:17","27:19"]},
1606
+ "weekday":{
1607
+ "1":["25:1","25:5"],
1608
+ "2":["25:6","25:9"],
1609
+ "3":["25:10","25:16"]
1610
+ }},
1611
+ "Tetzaveh":{
1612
+ "num":20,
1613
+ "hebrew":"תְּצַוֶּה",
1614
+ "book":2,
1615
+ "haft":{"k":"Ezekiel","b":"43:10","e":"43:27"},
1616
+ "fullkriyah":{
1617
+ "1":["27:20","28:12"],
1618
+ "2":["28:13","28:30"],
1619
+ "3":["28:31","28:43"],
1620
+ "4":["29:1","29:18"],
1621
+ "5":["29:19","29:37"],
1622
+ "6":["29:38","29:46"],
1623
+ "7":["30:1","30:10"],
1624
+ "M":["30:8","30:10"]},
1625
+ "weekday":{
1626
+ "1":["27:20","28:5"],
1627
+ "2":["28:6","28:9"],
1628
+ "3":["28:10","28:12"]
1629
+ }},
1630
+ "Ki Tisa":{
1631
+ "num":21,
1632
+ "hebrew":"כִּי תִשָּׂא",
1633
+ "book":2,
1634
+ "haft":{"k":"I Kings","b":"18:1","e":"18:39"},
1635
+ "seph":{"k":"I Kings","b":"18:20","e":"18:39"},
1636
+ "fullkriyah":{
1637
+ "1":["30:11","31:17"],
1638
+ "2":["31:18","33:11"],
1639
+ "3":["33:12","33:16"],
1640
+ "4":["33:17","33:23"],
1641
+ "5":["34:1","34:9"],
1642
+ "6":["34:10","34:26"],
1643
+ "7":["34:27","34:35"],
1644
+ "M":["34:33","34:35"]},
1645
+ "weekday":{
1646
+ "1":["30:11","30:13"],
1647
+ "2":["30:14","30:16"],
1648
+ "3":["30:17","30:21"]
1649
+ }},
1650
+ "Vayakhel":{
1651
+ "num":22,
1652
+ "hebrew":"וַיַּקְהֵל",
1653
+ "book":2,
1654
+ "haft":{"k":"I Kings","b":"7:40","e":"7:50"},
1655
+ "seph":{"k":"I Kings","b":"7:13","e":"7:26"},
1656
+ "fullkriyah":{
1657
+ "1":["35:1","35:20"],
1658
+ "2":["35:21","35:29"],
1659
+ "3":["35:30","36:7"],
1660
+ "4":["36:8","36:19"],
1661
+ "5":["36:20","37:16"],
1662
+ "6":["37:17","37:29"],
1663
+ "7":["38:1","38:20"],
1664
+ "M":["38:18","38:20"]},
1665
+ "weekday":{
1666
+ "1":["35:1","35:3"],
1667
+ "2":["35:4","35:10"],
1668
+ "3":["35:11","35:20"]
1669
+ }},
1670
+ "Pekudei":{
1671
+ "num":23,
1672
+ "hebrew":"פְקוּדֵי",
1673
+ "book":2,
1674
+ "haft":{"k":"I Kings","b":"7:51","e":"8:21"},
1675
+ "seph":{"k":"I Kings","b":"7:40","e":"7:50"},
1676
+ "fullkriyah":{
1677
+ "1":["38:21","39:1"],
1678
+ "2":["39:2","39:21"],
1679
+ "3":["39:22","39:32"],
1680
+ "4":["39:33","39:43"],
1681
+ "5":["40:1","40:16"],
1682
+ "6":["40:17","40:27"],
1683
+ "7":["40:28","40:38"],
1684
+ "M":["40:34","40:38"]},
1685
+ "weekday":{
1686
+ "1":["38:21","38:23"],
1687
+ "2":["38:24","38:27"],
1688
+ "3":["38:28","39:1"]
1689
+ }},
1690
+ "Vayikra":{
1691
+ "num":24,
1692
+ "hebrew":"וַיִּקְרָא",
1693
+ "book":3,
1694
+ "haft":{"k":"Isaiah","b":"43:21","e":"44:23"},
1695
+ "fullkriyah":{
1696
+ "1":["1:1","1:13"],
1697
+ "2":["1:14","2:6"],
1698
+ "3":["2:7","2:16"],
1699
+ "4":["3:1","3:17"],
1700
+ "5":["4:1","4:26"],
1701
+ "6":["4:27","5:10"],
1702
+ "7":["5:11","5:26"],
1703
+ "M":["5:24","5:26"]},
1704
+ "weekday":{
1705
+ "1":["1:1","1:4"],
1706
+ "2":["1:5","1:9"],
1707
+ "3":["1:10","1:13"]
1708
+ }},
1709
+ "Tzav":{
1710
+ "num":25,
1711
+ "hebrew":"צַו",
1712
+ "book":3,
1713
+ "haft":[{"k":"Jeremiah","b":"7:21","e":"8:3"},{"k":"Jeremiah","b":"9:22","e":"9:23"}],
1714
+ "fullkriyah":{
1715
+ "1":["6:1","6:11"],
1716
+ "2":["6:12","7:10"],
1717
+ "3":["7:11","7:38"],
1718
+ "4":["8:1","8:13"],
1719
+ "5":["8:14","8:21"],
1720
+ "6":["8:22","8:29"],
1721
+ "7":["8:30","8:36"],
1722
+ "M":["8:33","8:36"]},
1723
+ "weekday":{
1724
+ "1":["6:1","6:3"],
1725
+ "2":["6:4","6:6"],
1726
+ "3":["6:7","6:11"]
1727
+ }},
1728
+ "Shmini":{
1729
+ "num":26,
1730
+ "hebrew":"שְּׁמִינִי",
1731
+ "book":3,
1732
+ "haft":{"k":"II Samuel","b":"6:1","e":"7:17"},
1733
+ "seph":{"k":"II Samuel","b":"6:1","e":"6:19"},
1734
+ "fullkriyah":{
1735
+ "1":["9:1","9:16"],
1736
+ "2":["9:17","9:23"],
1737
+ "3":["9:24","10:11"],
1738
+ "4":["10:12","10:15"],
1739
+ "5":["10:16","10:20"],
1740
+ "6":["11:1","11:32"],
1741
+ "7":["11:33","11:47"],
1742
+ "M":["11:45","11:47"]},
1743
+ "weekday":{
1744
+ "1":["9:1","9:6"],
1745
+ "2":["9:7","9:10"],
1746
+ "3":["9:11","9:16"]
1747
+ }},
1748
+ "Tazria":{
1749
+ "num":27,
1750
+ "hebrew":"תַזְרִיעַ",
1751
+ "book":3,
1752
+ "haft":{"k":"II Kings","b":"4:42","e":"5:19"},
1753
+ "fullkriyah":{
1754
+ "1":["12:1","13:5"],
1755
+ "2":["13:6","13:17"],
1756
+ "3":["13:18","13:23"],
1757
+ "4":["13:24","13:28"],
1758
+ "5":["13:29","13:39"],
1759
+ "6":["13:40","13:54"],
1760
+ "7":["13:55","13:59"],
1761
+ "M":["13:57","13:59"]},
1762
+ "weekday":{
1763
+ "1":["12:1","12:4"],
1764
+ "2":["12:5","12:8"],
1765
+ "3":["13:1","13:5"]
1766
+ }},
1767
+ "Metzora":{
1768
+ "num":28,
1769
+ "hebrew":"מְּצֹרָע",
1770
+ "book":3,
1771
+ "haft":{"k":"II Kings","b":"7:3","e":"7:20"},
1772
+ "fullkriyah":{
1773
+ "1":["14:1","14:12"],
1774
+ "2":["14:13","14:20"],
1775
+ "3":["14:21","14:32"],
1776
+ "4":["14:33","14:53"],
1777
+ "5":["14:54","15:15"],
1778
+ "6":["15:16","15:28"],
1779
+ "7":["15:29","15:33"],
1780
+ "M":["15:31","15:33"]},
1781
+ "weekday":{
1782
+ "1":["14:1","14:5"],
1783
+ "2":["14:6","14:9"],
1784
+ "3":["14:10","14:12"]
1785
+ }},
1786
+ "Achrei Mot":{
1787
+ "num":29,
1788
+ "hebrew":"אַחֲרֵי מוֹת",
1789
+ "book":3,
1790
+ "haft":{"k":"Ezekiel","b":"22:1","e":"22:19"},
1791
+ "seph":{"k":"Ezekiel","b":"22:1","e":"22:16"},
1792
+ "fullkriyah":{
1793
+ "1":["16:1","16:17"],
1794
+ "2":["16:18","16:24"],
1795
+ "3":["16:25","16:34"],
1796
+ "4":["17:1","17:7"],
1797
+ "5":["17:8","18:5"],
1798
+ "6":["18:6","18:21"],
1799
+ "7":["18:22","18:30"],
1800
+ "M":["18:28","18:30"]},
1801
+ "weekday":{
1802
+ "1":["16:1","16:6"],
1803
+ "2":["16:7","16:11"],
1804
+ "3":["16:12","16:17"]
1805
+ }},
1806
+ "Kedoshim":{
1807
+ "num":30,
1808
+ "hebrew":"קְדשִׁים",
1809
+ "book":3,
1810
+ "haft":{"k":"Amos","b":"9:7","e":"9:15"},
1811
+ "seph":{"k":"Ezekiel","b":"20:2","e":"20:20"},
1812
+ "fullkriyah":{
1813
+ "1":["19:1","19:14"],
1814
+ "2":["19:15","19:22"],
1815
+ "3":["19:23","19:32"],
1816
+ "4":["19:33","19:37"],
1817
+ "5":["20:1","20:7"],
1818
+ "6":["20:8","20:22"],
1819
+ "7":["20:23","20:27"],
1820
+ "M":["20:25","20:27"]},
1821
+ "weekday":{
1822
+ "1":["19:1","19:4"],
1823
+ "2":["19:5","19:10"],
1824
+ "3":["19:11","19:14"]
1825
+ }},
1826
+ "Emor":{
1827
+ "num":31,
1828
+ "hebrew":"אֱמוֹר",
1829
+ "book":3,
1830
+ "haft":{"k":"Ezekiel","b":"44:15","e":"44:31"},
1831
+ "fullkriyah":{
1832
+ "1":["21:1","21:15"],
1833
+ "2":["21:16","22:16"],
1834
+ "3":["22:17","22:33"],
1835
+ "4":["23:1","23:22"],
1836
+ "5":["23:23","23:32"],
1837
+ "6":["23:33","23:44"],
1838
+ "7":["24:1","24:23"],
1839
+ "M":["24:21","24:23"]},
1840
+ "weekday":{
1841
+ "1":["21:1","21:6"],
1842
+ "2":["21:7","21:12"],
1843
+ "3":["21:13","21:15"]
1844
+ }},
1845
+ "Behar":{
1846
+ "num":32,
1847
+ "hebrew":"בְּהַר",
1848
+ "book":3,
1849
+ "haft":{"k":"Jeremiah","b":"32:6","e":"32:27"},
1850
+ "fullkriyah":{
1851
+ "1":["25:1","25:13"],
1852
+ "2":["25:14","25:18"],
1853
+ "3":["25:19","25:24"],
1854
+ "4":["25:25","25:28"],
1855
+ "5":["25:29","25:38"],
1856
+ "6":["25:39","25:46"],
1857
+ "7":["25:47","26:2"],
1858
+ "M":["25:55","26:2"]},
1859
+ "weekday":{
1860
+ "1":["25:1","25:3"],
1861
+ "2":["25:4","25:7"],
1862
+ "3":["25:8","25:13"]
1863
+ }},
1864
+ "Bechukotai":{
1865
+ "num":33,
1866
+ "hebrew":"בְּחֻקֹּתַי",
1867
+ "book":3,
1868
+ "haft":{"k":"Jeremiah","b":"16:19","e":"17:14"},
1869
+ "fullkriyah":{
1870
+ "1":["26:3","26:5"],
1871
+ "2":["26:6","26:9"],
1872
+ "3":["26:10","26:46"],
1873
+ "4":["27:1","27:15"],
1874
+ "5":["27:16","27:21"],
1875
+ "6":["27:22","27:28"],
1876
+ "7":["27:29","27:34"],
1877
+ "M":["27:32","27:34"]},
1878
+ "weekday":{
1879
+ "1":["26:3","26:5"],
1880
+ "2":["26:6","26:9"],
1881
+ "3":["26:10","26:13"]
1882
+ }},
1883
+ "Bamidbar":{
1884
+ "num":34,
1885
+ "hebrew":"בְּמִדְבַּר",
1886
+ "book":4,
1887
+ "haft":{"k":"Hosea","b":"2:1","e":"2:22"},
1888
+ "fullkriyah":{
1889
+ "1":["1:1","1:19"],
1890
+ "2":["1:20","1:54"],
1891
+ "3":["2:1","2:34"],
1892
+ "4":["3:1","3:13"],
1893
+ "5":["3:14","3:39"],
1894
+ "6":["3:40","3:51"],
1895
+ "7":["4:1","4:20"],
1896
+ "M":["4:17","4:20"]},
1897
+ "weekday":{
1898
+ "1":["1:1","1:4"],
1899
+ "2":["1:5","1:16"],
1900
+ "3":["1:17","1:19"]
1901
+ }},
1902
+ "Nasso":{
1903
+ "num":35,
1904
+ "hebrew":"נָשׂא",
1905
+ "book":4,
1906
+ "haft":{"k":"Judges","b":"13:2","e":"13:25"},
1907
+ "fullkriyah":{
1908
+ "1":["4:21","4:37"],
1909
+ "2":["4:38","4:49"],
1910
+ "3":["5:1","5:10"],
1911
+ "4":["5:11","6:27"],
1912
+ "5":["7:1","7:41"],
1913
+ "6":["7:42","7:71"],
1914
+ "7":["7:72","7:89"],
1915
+ "M":["7:87","7:89"]},
1916
+ "weekday":{
1917
+ "1":["4:21","4:24"],
1918
+ "2":["4:25","4:28"],
1919
+ "3":["4:29","4:33"]
1920
+ }},
1921
+ "Beha'alotcha":{
1922
+ "num":36,
1923
+ "hebrew":"בְּהַעֲלֹתְךָ",
1924
+ "book":4,
1925
+ "haft":{"k":"Zechariah","b":"2:14","e":"4:7"},
1926
+ "fullkriyah":{
1927
+ "1":["8:1","8:14"],
1928
+ "2":["8:15","8:26"],
1929
+ "3":["9:1","9:14"],
1930
+ "4":["9:15","10:10"],
1931
+ "5":["10:11","10:34"],
1932
+ "6":["10:35","11:29"],
1933
+ "7":["11:30","12:16"],
1934
+ "M":["12:14","12:16"]},
1935
+ "weekday":{
1936
+ "1":["8:1","8:4"],
1937
+ "2":["8:5","8:9"],
1938
+ "3":["8:10","8:14"]
1939
+ }},
1940
+ "Sh'lach":{
1941
+ "num":37,
1942
+ "hebrew":"שְׁלַח־לְךָ",
1943
+ "book":4,
1944
+ "haft":{"k":"Joshua","b":"2:1","e":"2:24"},
1945
+ "fullkriyah":{
1946
+ "1":["13:1","13:20"],
1947
+ "2":["13:21","14:7"],
1948
+ "3":["14:8","14:25"],
1949
+ "4":["14:26","15:7"],
1950
+ "5":["15:8","15:16"],
1951
+ "6":["15:17","15:26"],
1952
+ "7":["15:27","15:41"],
1953
+ "M":["15:37","15:41"]},
1954
+ "weekday":{
1955
+ "1":["13:1","13:3"],
1956
+ "2":["13:4","13:16"],
1957
+ "3":["13:17","13:20"]
1958
+ }},
1959
+ "Korach":{
1960
+ "num":38,
1961
+ "hebrew":"קוֹרַח",
1962
+ "book":4,
1963
+ "haft":{"k":"I Samuel","b":"11:14","e":"12:22"},
1964
+ "fullkriyah":{
1965
+ "1":["16:1","16:13"],
1966
+ "2":["16:14","16:19"],
1967
+ "3":["16:20","17:8"],
1968
+ "4":["17:9","17:15"],
1969
+ "5":["17:16","17:24"],
1970
+ "6":["17:25","18:20"],
1971
+ "7":["18:21","18:32"],
1972
+ "M":["18:30","18:32"]},
1973
+ "weekday":{
1974
+ "1":["16:1","16:3"],
1975
+ "2":["16:4","16:7"],
1976
+ "3":["16:8","16:13"]
1977
+ }},
1978
+ "Chukat":{
1979
+ "num":39,
1980
+ "hebrew":"חֻקַּת",
1981
+ "book":4,
1982
+ "haft":{"k":"Judges","b":"11:1","e":"11:33"},
1983
+ "fullkriyah":{
1984
+ "1":["19:1","19:17"],
1985
+ "2":["19:18","20:6"],
1986
+ "3":["20:7","20:13"],
1987
+ "4":["20:14","20:21"],
1988
+ "5":["20:22","21:9"],
1989
+ "6":["21:10","21:20"],
1990
+ "7":["21:21","22:1"],
1991
+ "M":["21:34","22:1"]},
1992
+ "weekday":{
1993
+ "1":["19:1","19:6"],
1994
+ "2":["19:7","19:9"],
1995
+ "3":["19:10","19:17"]
1996
+ }},
1997
+ "Balak":{
1998
+ "num":40,
1999
+ "hebrew":"בָּלָק",
2000
+ "book":4,
2001
+ "haft":{"k":"Micah","b":"5:6","e":"6:8"},
2002
+ "fullkriyah":{
2003
+ "1":["22:2","22:12"],
2004
+ "2":["22:13","22:20"],
2005
+ "3":["22:21","22:38"],
2006
+ "4":["22:39","23:12"],
2007
+ "5":["23:13","23:26"],
2008
+ "6":["23:27","24:13"],
2009
+ "7":["24:14","25:9"],
2010
+ "M":["25:7","25:9"]},
2011
+ "weekday":{
2012
+ "1":["22:2","22:4"],
2013
+ "2":["22:5","22:7"],
2014
+ "3":["22:8","22:12"]
2015
+ }},
2016
+ "Pinchas":{
2017
+ "num":41,
2018
+ "hebrew":"פִּינְחָס",
2019
+ "book":4,
2020
+ "haft":{"k":"I Kings","b":"18:46","e":"19:21"},
2021
+ "fullkriyah":{
2022
+ "1":["25:10","26:4"],
2023
+ "2":["26:5","26:51"],
2024
+ "3":["26:52","27:5"],
2025
+ "4":["27:6","27:23"],
2026
+ "5":["28:1","28:15"],
2027
+ "6":["28:16","29:11"],
2028
+ "7":["29:12","30:1"],
2029
+ "M":["29:35","30:1"]},
2030
+ "weekday":{
2031
+ "1":["25:10","25:12"],
2032
+ "2":["25:13","25:15"],
2033
+ "3":["25:16","26:4"]
2034
+ }},
2035
+ "Matot":{
2036
+ "num":42,
2037
+ "hebrew":"מַּטּוֹת",
2038
+ "book":4,
2039
+ "haft":{"k":"Jeremiah","b":"1:1","e":"2:3"},
2040
+ "fullkriyah":{
2041
+ "1":["30:2","30:17"],
2042
+ "2":["31:1","31:12"],
2043
+ "3":["31:13","31:24"],
2044
+ "4":["31:25","31:41"],
2045
+ "5":["31:42","31:54"],
2046
+ "6":["32:1","32:19"],
2047
+ "7":["32:20","32:42"],
2048
+ "M":["32:39","32:42"]},
2049
+ "weekday":{
2050
+ "1":["30:2","30:9"],
2051
+ "2":["30:10","30:13"],
2052
+ "3":["30:14","30:17"]
2053
+ }},
2054
+ "Masei":{
2055
+ "num":43,
2056
+ "hebrew":"מַסְעֵי",
2057
+ "book":4,
2058
+ "haft":[{"k":"Jeremiah","b":"2:4","e":"2:28"},{"k":"Jeremiah","b":"3:4","e":"3:4"}],
2059
+ "seph":[{"k":"Jeremiah","b":"2:4","e":"2:28"},{"k":"Jeremiah","b":"4:1","e":"4:2"}],
2060
+ "fullkriyah":{
2061
+ "1":["33:1","33:10"],
2062
+ "2":["33:11","33:49"],
2063
+ "3":["33:50","34:15"],
2064
+ "4":["34:16","34:29"],
2065
+ "5":["35:1","35:8"],
2066
+ "6":["35:9","35:34"],
2067
+ "7":["36:1","36:13"],
2068
+ "M":["36:11","36:13"]},
2069
+ "weekday":{
2070
+ "1":["33:1","33:3"],
2071
+ "2":["33:4","33:6"],
2072
+ "3":["33:7","33:10"]
2073
+ }},
2074
+ "Devarim":{
2075
+ "num":44,
2076
+ "hebrew":"דְּבָרִים",
2077
+ "book":5,
2078
+ "haft":{"k":"Isaiah","b":"1:1","e":"1:27"},
2079
+ "fullkriyah":{
2080
+ "1":["1:1","1:10"],
2081
+ "2":["1:11","1:21"],
2082
+ "3":["1:22","1:38"],
2083
+ "4":["1:39","2:1"],
2084
+ "5":["2:2","2:30"],
2085
+ "6":["2:31","3:14"],
2086
+ "7":["3:15","3:22"],
2087
+ "M":["3:20","3:22"]},
2088
+ "weekday":{
2089
+ "1":["1:1","1:3"],
2090
+ "2":["1:4","1:7"],
2091
+ "3":["1:8","1:11"]
2092
+ }},
2093
+ "Vaetchanan":{
2094
+ "num":45,
2095
+ "hebrew":"וָאֶתְחַנַּן",
2096
+ "book":5,
2097
+ "haft":{"k":"Isaiah","b":"40:1","e":"40:26"},
2098
+ "fullkriyah":{
2099
+ "1":["3:23","4:4"],
2100
+ "2":["4:5","4:40"],
2101
+ "3":["4:41","4:49"],
2102
+ "4":["5:1","5:18"],
2103
+ "5":["5:19","6:3"],
2104
+ "6":["6:4","6:25"],
2105
+ "7":["7:1","7:11"],
2106
+ "M":["7:9","7:11"]},
2107
+ "weekday":{
2108
+ "1":["3:23","3:25"],
2109
+ "2":["3:26","4:4"],
2110
+ "3":["4:5","4:8"]
2111
+ }},
2112
+ "Eikev":{
2113
+ "num":46,
2114
+ "hebrew":"עֵקֶב",
2115
+ "book":5,
2116
+ "haft":{"k":"Isaiah","b":"49:14","e":"51:3"},
2117
+ "fullkriyah":{
2118
+ "1":["7:12","8:10"],
2119
+ "2":["8:11","9:3"],
2120
+ "3":["9:4","9:29"],
2121
+ "4":["10:1","10:11"],
2122
+ "5":["10:12","11:9"],
2123
+ "6":["11:10","11:21"],
2124
+ "7":["11:22","11:25"],
2125
+ "M":["11:22","11:25"]},
2126
+ "weekday":{
2127
+ "1":["7:12","7:21"],
2128
+ "2":["7:22","8:3"],
2129
+ "3":["8:4","8:10"]
2130
+ }},
2131
+ "Re'eh":{
2132
+ "num":47,
2133
+ "hebrew":"רְאֵה",
2134
+ "book":5,
2135
+ "haft":{"k":"Isaiah","b":"54:11","e":"55:5"},
2136
+ "fullkriyah":{
2137
+ "1":["11:26","12:10"],
2138
+ "2":["12:11","12:28"],
2139
+ "3":["12:29","13:19"],
2140
+ "4":["14:1","14:21"],
2141
+ "5":["14:22","14:29"],
2142
+ "6":["15:1","15:18"],
2143
+ "7":["15:19","16:17"],
2144
+ "M":["16:13","16:17"]},
2145
+ "weekday":{
2146
+ "1":["11:26","11:31"],
2147
+ "2":["11:32","12:5"],
2148
+ "3":["12:6","12:10"]
2149
+ }},
2150
+ "Shoftim":{
2151
+ "num":48,
2152
+ "hebrew":"שׁוֹפְטִים",
2153
+ "book":5,
2154
+ "haft":{"k":"Isaiah","b":"51:12","e":"52:12"},
2155
+ "fullkriyah":{
2156
+ "1":["16:18","17:13"],
2157
+ "2":["17:14","17:20"],
2158
+ "3":["18:1","18:5"],
2159
+ "4":["18:6","18:13"],
2160
+ "5":["18:14","19:13"],
2161
+ "6":["19:14","20:9"],
2162
+ "7":["20:10","21:9"],
2163
+ "M":["21:7","21:9"]},
2164
+ "weekday":{
2165
+ "1":["16:18","16:20"],
2166
+ "2":["16:21","17:10"],
2167
+ "3":["17:11","17:13"]
2168
+ }},
2169
+ "Ki Teitzei":{
2170
+ "num":49,
2171
+ "hebrew":"כִּי־תֵצֵא",
2172
+ "book":5,
2173
+ "haft":{"k":"Isaiah","b":"54:1","e":"54:10"},
2174
+ "fullkriyah":{
2175
+ "1":["21:10","21:21"],
2176
+ "2":["21:22","22:7"],
2177
+ "3":["22:8","23:7"],
2178
+ "4":["23:8","23:24"],
2179
+ "5":["23:25","24:4"],
2180
+ "6":["24:5","24:13"],
2181
+ "7":["24:14","25:19"],
2182
+ "M":["25:17","25:19"]},
2183
+ "weekday":{
2184
+ "1":["21:10","21:14"],
2185
+ "2":["21:15","21:17"],
2186
+ "3":["21:18","21:21"]
2187
+ }},
2188
+ "Ki Tavo":{
2189
+ "num":50,
2190
+ "hebrew":"כִּי־תָבוֹא",
2191
+ "book":5,
2192
+ "haft":{"k":"Isaiah","b":"60:1","e":"60:22"},
2193
+ "fullkriyah":{
2194
+ "1":["26:1","26:11"],
2195
+ "2":["26:12","26:15"],
2196
+ "3":["26:16","26:19"],
2197
+ "4":["27:1","27:10"],
2198
+ "5":["27:11","28:6"],
2199
+ "6":["28:7","28:69"],
2200
+ "7":["29:1","29:8"],
2201
+ "M":["29:6","29:8"]},
2202
+ "weekday":{
2203
+ "1":["26:1","26:3"],
2204
+ "2":["26:4","26:11"],
2205
+ "3":["26:12","26:15"]
2206
+ }},
2207
+ "Nitzavim":{
2208
+ "num":51,
2209
+ "hebrew":"נִצָּבִים",
2210
+ "book":5,
2211
+ "haft":{"k":"Isaiah","b":"61:10","e":"63:9"},
2212
+ "fullkriyah":{
2213
+ "1":["29:9","29:11"],
2214
+ "2":["29:12","29:14"],
2215
+ "3":["29:15","29:28"],
2216
+ "4":["30:1","30:6"],
2217
+ "5":["30:7","30:10"],
2218
+ "6":["30:11","30:14"],
2219
+ "7":["30:15","30:20"],
2220
+ "M":["30:15","30:20"]},
2221
+ "weekday":{
2222
+ "1":["29:9","29:11"],
2223
+ "2":["29:12","29:14"],
2224
+ "3":["29:15","29:28"]
2225
+ }},
2226
+ "Vayeilech":{
2227
+ "num":52,
2228
+ "hebrew":"וַיֵּלֶךְ",
2229
+ "book":5,
2230
+ "haft":{"k":"Isaiah","b":"55:6","e":"56:8"},
2231
+ "fullkriyah":{
2232
+ "1":["31:1","31:3"],
2233
+ "2":["31:4","31:6"],
2234
+ "3":["31:7","31:9"],
2235
+ "4":["31:10","31:13"],
2236
+ "5":["31:14","31:19"],
2237
+ "6":["31:20","31:24"],
2238
+ "7":["31:25","31:30"],
2239
+ "M":["31:28","31:30"]},
2240
+ "weekday":{
2241
+ "1":["31:1","31:3"],
2242
+ "2":["31:4","31:6"],
2243
+ "3":["31:7","31:13"]
2244
+ }},
2245
+ "Ha'azinu":{
2246
+ "num":53,
2247
+ "hebrew":"הַאֲזִינוּ",
2248
+ "book":5,
2249
+ "haft":{"k":"II Samuel","b":"22:1","e":"22:51"},
2250
+ "fullkriyah":{
2251
+ "1":["32:1","32:6"],
2252
+ "2":["32:7","32:12"],
2253
+ "3":["32:13","32:18"],
2254
+ "4":["32:19","32:28"],
2255
+ "5":["32:29","32:39"],
2256
+ "6":["32:40","32:43"],
2257
+ "7":["32:44","32:52"],
2258
+ "M":["32:48","32:52"]},
2259
+ "weekday":{
2260
+ "1":["32:1","32:3"],
2261
+ "2":["32:4","32:6"],
2262
+ "3":["32:7","32:12"]
2263
+ }},
2264
+ "Vezot Haberakhah":{
2265
+ "num":54,
2266
+ "hebrew":"וְזֹאת הַבְּרָכָה",
2267
+ "book":5,
2268
+ "haft":{"k":"Joshua","b":"1:1","e":"1:18"},
2269
+ "seph":{"k":"Joshua","b":"1:1","e":"1:9"},
2270
+ "fullkriyah":{
2271
+ "1":["33:1","33:7"],
2272
+ "2":["33:8","33:12"],
2273
+ "3":["33:13","33:17"],
2274
+ "4":["33:18","33:21"],
2275
+ "5":["33:22","33:26"],
2276
+ "6":["33:27","33:29"],
2277
+ "7":["34:1","34:12"]},
2278
+ "weekday":{
2279
+ "1":["33:1","33:7"],
2280
+ "2":["33:8","33:12"],
2281
+ "3":["33:13","33:17"]
2282
+ }},
2283
+ "Vayakhel-Pekudei":{
2284
+ "num":101,"combined":true,
2285
+ "p1":"Vayakhel",
2286
+ "p2":"Pekudei",
2287
+ "num1":22,
2288
+ "num2":23,
2289
+ "book":2,
2290
+ "fullkriyah":{
2291
+ "1":["35:1","35:29"],
2292
+ "2":["35:30","37:16"],
2293
+ "3":["37:17","37:29"],
2294
+ "4":["38:1","39:1"],
2295
+ "5":["39:2","39:21"],
2296
+ "6":["39:22","39:43"],
2297
+ "7":["40:1","40:38"],
2298
+ "M":["40:34","40:38"]}
2299
+ },
2300
+ "Tazria-Metzora":{
2301
+ "num":102,"combined":true,
2302
+ "p1":"Tazria",
2303
+ "p2":"Metzora",
2304
+ "num1":27,
2305
+ "num2":28,
2306
+ "book":3,
2307
+ "fullkriyah":{
2308
+ "1":["12:1","13:23"],
2309
+ "2":["13:24","13:39"],
2310
+ "3":["13:40","13:54"],
2311
+ "4":["13:55","14:20"],
2312
+ "5":["14:21","14:32"],
2313
+ "6":["14:33","15:15"],
2314
+ "7":["15:16","15:33"],
2315
+ "M":["15:31","15:33"]}
2316
+ },
2317
+ "Achrei Mot-Kedoshim":{
2318
+ "num":103,"combined":true,
2319
+ "p1":"Achrei Mot",
2320
+ "p2":"Kedoshim",
2321
+ "num1":29,
2322
+ "num2":30,
2323
+ "book":3,
2324
+ "fullkriyah":{
2325
+ "1":["16:1","16:24"],
2326
+ "2":["16:25","17:7"],
2327
+ "3":["17:8","18:21"],
2328
+ "4":["18:22","19:14"],
2329
+ "5":["19:15","19:32"],
2330
+ "6":["19:33","20:7"],
2331
+ "7":["20:8","20:27"],
2332
+ "M":["20:25","20:27"]}},
2333
+ "Behar-Bechukotai":{
2334
+ "num":104,"combined":true,
2335
+ "p1":"Behar",
2336
+ "p2":"Bechukotai",
2337
+ "num1":32,
2338
+ "num2":33,
2339
+ "book":3,
2340
+ "fullkriyah":{
2341
+ "1":["25:1","25:18"],
2342
+ "2":["25:19","25:28"],
2343
+ "3":["25:29","25:38"],
2344
+ "4":["25:39","26:9"],
2345
+ "5":["26:10","26:46"],
2346
+ "6":["27:1","27:15"],
2347
+ "7":["27:16","27:34"],
2348
+ "M":["27:32","27:34"]}
2349
+ },
2350
+ "Chukat-Balak":{
2351
+ "num":105,"combined":true,
2352
+ "p1":"Chukat",
2353
+ "p2":"Balak",
2354
+ "num1":39,
2355
+ "num2":40,
2356
+ "book":4,
2357
+ "fullkriyah":{
2358
+ "1":["19:1","20:6"],
2359
+ "2":["20:7","20:21"],
2360
+ "3":["20:22","21:20"],
2361
+ "4":["21:21","22:12"],
2362
+ "5":["22:13","22:38"],
2363
+ "6":["22:39","23:26"],
2364
+ "7":["23:27","25:9"],
2365
+ "M":["25:7","25:9"]}
2366
+ },
2367
+ "Matot-Masei":{
2368
+ "num":106,"combined":true,
2369
+ "p1":"Matot",
2370
+ "p2":"Masei",
2371
+ "num1":42,
2372
+ "num2":43,
2373
+ "book":4,
2374
+ "fullkriyah":{
2375
+ "1":["30:2","31:12"],
2376
+ "2":["31:13","31:54"],
2377
+ "3":["32:1","32:19"],
2378
+ "4":["32:20","33:49"],
2379
+ "5":["33:50","34:15"],
2380
+ "6":["34:16","35:8"],
2381
+ "7":["35:9","36:13"],
2382
+ "M":["36:11","36:13"]}
2383
+ },
2384
+ "Nitzavim-Vayeilech":{
2385
+ "num":107,"combined":true,
2386
+ "p1":"Nitzavim",
2387
+ "p2":"Vayeilech",
2388
+ "num1":51,
2389
+ "num2":52,
2390
+ "book":5,
2391
+ "fullkriyah":{
2392
+ "1":["29:9","29:28"],
2393
+ "2":["30:1","30:6"],
2394
+ "3":["30:7","30:14"],
2395
+ "4":["30:15","31:6"],
2396
+ "5":["31:7","31:13"],
2397
+ "6":["31:14","31:19"],
2398
+ "7":["31:20","31:30"],
2399
+ "M":["31:28","31:30"]}
2400
+ }
2401
+ };
2402
+
2403
+ /**
2404
+ * Represents an aliyah
2405
+ * @private
2406
+ * @typedef {Object} Aliyah
2407
+ * @property {string} k - Book (e.g. "Numbers")
2408
+ * @property {string} b - beginning verse (e.g. "28:9")
2409
+ * @property {string} e - ending verse (e.g. "28:15")
2410
+ * @property {number} [v] - number of verses
2411
+ * @property {number} [p] - parsha number (1=Bereshit, 54=Vezot HaBracha)
2412
+ */
2413
+
2414
+ /**
2415
+ * Name of the parsha hashavua or holiday
2416
+ * @typedef {Object} LeyningNames
2417
+ * @property {string} en English
2418
+ * @property {string} he Hebrew (with nikud)
2419
+ */
2420
+
2421
+ /**
2422
+ * Leyning for a parsha hashavua or holiday
2423
+ * @typedef {Object} Leyning
2424
+ * @property {LeyningNames} name
2425
+ * @property {string[]} [parsha] - An array of either 1 (regular) or 2 (doubled parsha).
2426
+ * `undefined` for holiday readings
2427
+ * @property {number|number[]} [parshaNum] - 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings
2428
+ * @property {string} summary - Such as `Genesis 1:1 - 6:8`
2429
+ * @property {Aliyah|Aliyah[]} haft - Haftarah object(s)
2430
+ * @property {string} haftara - Haftarah, such as `Isaiah 42:5 – 43:11`
2431
+ * @property {number} [haftaraNumV] - Number of verses in the Haftarah
2432
+ * @property {Aliyah|Aliyah[]} [seph] - Haftarah object(s) for Sephardim
2433
+ * @property {string} [sephardic] - Haftarah for Sephardim, such as `Isaiah 42:5 - 42:21`
2434
+ * @property {number} [sephardicNumV] - Number of verses in the Haftarah for Sephardim
2435
+ * @property {Object<string,Aliyah>} fullkriyah - Map of aliyot `1` through `7` plus `M` for maftir
2436
+ * @property {Object<string,Aliyah>} [weekday] - Optional map of weekday Torah Readings
2437
+ * aliyot `1` through `3` for Monday and Thursday
2438
+ * @property {Object<string,string>} [reason] - Explanations for special readings,
2439
+ * keyed by aliyah number, `M` for maftir or `haftara` for Haftarah
2440
+ * @property {Object<string,Aliyah>} [megillah] - Optional map of megillah reading.
2441
+ * Song of Songs is read on the sabbath of Passover week, the Book of Ruth on Shavuot,
2442
+ * Lamentations on Tisha be-Av, Ecclesiastes on the sabbath of the week of Sukkoth,
2443
+ * and the Book of Esther on Purim.
2444
+ */
2445
+
2446
+ /**
2447
+ * on doubled parshiot, read only the second Haftarah
2448
+ * except for Nitzavim-Vayelech
2449
+ * @private
2450
+ * @param {string[]} parsha
2451
+ * @return {string}
2452
+ */
2453
+ function getHaftaraKey(parsha) {
2454
+ if (parsha.length == 1 || parsha[0] == 'Nitzavim') {
2455
+ return parsha[0];
2456
+ } else {
2457
+ return parsha[1];
2458
+ }
2459
+ }
2460
+
2461
+ /**
2462
+ * Transliterated English and Hebrew names of this parsha
2463
+ * @param {string|string[]} parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2464
+ * @return {LeyningNames}
2465
+ */
2466
+ function makeLeyningNames(parsha) {
2467
+ const name = parshaToString(parsha);
2468
+ return {
2469
+ en: name,
2470
+ he: parsha.map((s) => core.Locale.lookupTranslation(s, 'he')).join('־'),
2471
+ };
2472
+ }
2473
+
2474
+ /**
2475
+ * Looks up regular leyning for a weekly parsha with no special readings
2476
+ * @private
2477
+ * @param {string|string[]} parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2478
+ * @return {Leyning} map of aliyot
2479
+ */
2480
+ function getLeyningForParshaShabbatOnly(parsha) {
2481
+ const raw = lookupParsha(parsha);
2482
+ const fullkriyah = {};
2483
+ const book = BOOK[raw.book];
2484
+ for (const [num, src] of Object.entries(raw.fullkriyah)) {
2485
+ const aliyah = {k: book, b: src[0], e: src[1]};
2486
+ calculateNumVerses(aliyah);
2487
+ fullkriyah[num] = aliyah;
2488
+ }
2489
+ const name = parshaToString(parsha);
2490
+ const parshaNameArray = raw.combined ? [raw.p1, raw.p2] : [name];
2491
+ const parts = makeLeyningParts(fullkriyah);
2492
+ const summary = makeSummaryFromParts(parts);
2493
+ /** @type {Leyning} */
2494
+ const result = {
2495
+ name: makeLeyningNames(parshaNameArray),
2496
+ parsha: parshaNameArray,
2497
+ parshaNum: raw.num,
2498
+ summary,
2499
+ fullkriyah: fullkriyah,
2500
+ };
2501
+ if (parts.length > 1) {
2502
+ result.summaryParts = parts;
2503
+ }
2504
+ const hkey = getHaftaraKey(parshaNameArray);
2505
+ const haft0 = parshiyotObj[hkey].haft;
2506
+ if (haft0) {
2507
+ const haft = result.haft = cloneHaftara(haft0);
2508
+ result.haftara = makeSummaryFromParts(haft);
2509
+ result.haftaraNumV = sumVerses(haft);
2510
+ }
2511
+ if (raw.seph) {
2512
+ const seph = result.seph = cloneHaftara(raw.seph);
2513
+ result.sephardic = makeSummaryFromParts(seph);
2514
+ result.sephardicNumV = sumVerses(seph);
2515
+ }
2516
+ return result;
2517
+ }
2518
+
2519
+ /**
2520
+ * Looks up Monday/Thursday aliyot for a regular parsha
2521
+ * @param {string|string[]} parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2522
+ * @return {Object<string,Aliyah>} map of aliyot
2523
+ */
2524
+ function getWeekdayReading(parsha) {
2525
+ const raw = lookupParsha(parsha);
2526
+ const parshaMeta = raw.combined ? lookupParsha(raw.p1) : raw;
2527
+ const aliyot = parshaMeta.weekday;
2528
+ if (!aliyot) {
2529
+ throw new Error(`Parsha missing weekday: ${parsha}`);
2530
+ }
2531
+ const book = BOOK[raw.book];
2532
+ const weekday = {};
2533
+ for (let i = 1; i <= 3; i++) {
2534
+ const num = '' + i;
2535
+ const src = aliyot[num];
2536
+ const aliyah = {k: book, b: src[0], e: src[1]};
2537
+ calculateNumVerses(aliyah);
2538
+ weekday[num] = aliyah;
2539
+ }
2540
+ return weekday;
2541
+ }
2542
+
2543
+ /**
2544
+ * Looks up regular leyning for a weekly parsha with no special readings
2545
+ * @param {string|string[]} parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2546
+ * @return {Leyning} map of aliyot
2547
+ */
2548
+ function getLeyningForParsha(parsha) {
2549
+ const result = getLeyningForParshaShabbatOnly(parsha);
2550
+ result.weekday = getWeekdayReading(parsha);
2551
+ return result;
2552
+ }
2553
+
2554
+ /**
2555
+ * Looks up leyning for a regular Shabbat parsha, including any special
2556
+ * maftir or Haftara.
2557
+ * @param {Event} ev the Hebcal event associated with this leyning
2558
+ * @param {boolean} [il] in Israel
2559
+ * @return {Leyning} map of aliyot
2560
+ */
2561
+ function getLeyningForParshaHaShavua(ev, il=false) {
2562
+ if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
2563
+ throw new TypeError(`Bad event argument: ${ev}`);
2564
+ } else if (ev.getFlags() != core.flags.PARSHA_HASHAVUA) {
2565
+ throw new TypeError(`Event must be parsha hashavua: ${ev.getDesc()}`);
2566
+ }
2567
+ // first, collect the default aliyot and haftara
2568
+ const parsha = ev.parsha;
2569
+ const result = getLeyningForParshaShabbatOnly(parsha);
2570
+ const hd = ev.getDate();
2571
+ // Now, check for special maftir or haftara on same date
2572
+ const special = specialReadings2(parsha, hd, il, result.fullkriyah);
2573
+ const reason = special.reason;
2574
+ if (special.haft) {
2575
+ const haft = result.haft = cloneHaftara(special.haft);
2576
+ result.haftara = makeSummaryFromParts(haft);
2577
+ result.haftaraNumV = sumVerses(haft);
2578
+ if (special.seph) {
2579
+ const seph = result.seph = cloneHaftara(special.seph);
2580
+ result.sephardic = makeSummaryFromParts(seph);
2581
+ result.sephardicNumV = sumVerses(seph);
2582
+ }
2583
+ }
2584
+ if (reason['7'] || reason['M']) {
2585
+ result.fullkriyah = special.aliyot;
2586
+ const parts = makeLeyningParts(result.fullkriyah);
2587
+ result.summary = makeSummaryFromParts(parts);
2588
+ result.summaryParts = parts;
2589
+ }
2590
+ const reasons = Object.keys(reason);
2591
+ if (reasons.length !== 0) {
2592
+ result.reason = reason;
2593
+ for (const num of reasons) {
2594
+ if (num === 'haftara' || num === 'sephardic') {
2595
+ const haftObj = result[num === 'haftara' ? 'haft' : 'seph'];
2596
+ const hafts = Array.isArray(haftObj) ? haftObj : [haftObj];
2597
+ for (const haft of hafts) {
2598
+ haft.reason = reason[num];
2599
+ }
2600
+ } else {
2601
+ const aliyah = result.fullkriyah[num];
2602
+ if (typeof aliyah === 'object') {
2603
+ aliyah.reason = reason[num];
2604
+ }
2605
+ }
2606
+ }
2607
+ }
2608
+ return result;
2609
+ }
2610
+
2611
+ /**
2612
+ * Parsha metadata
2613
+ * @typedef {Object} ParshaMeta
2614
+ * @property {number} num - 1 for Bereshit, 2 for Noach, etc. `undefined` for holiday readings
2615
+ * @property {string} hebrew - parsha name in Hebrew with niqud
2616
+ * @property {number} book - 1 for Genesis, 2 for Exodus, 5 for Deuteronomy
2617
+ * @property {Aliyah|Aliyah[]} haft - Haftarah object(s)
2618
+ * @property {Aliyah|Aliyah[]} [seph] - Haftarah object(s) for Sephardim
2619
+ * @property {Object<string,string[]>} fullkriyah - Map of aliyot `1` through `7` plus `M` for maftir
2620
+ * @property {Object<string,string[]>} weekday - Map of weekday Torah Readings
2621
+ * aliyot `1` through `3` for Monday and Thursday
2622
+ */
2623
+
2624
+ /**
2625
+ * Returns the parsha metadata
2626
+ * @param {string|string[]} parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2627
+ * @return {ParshaMeta}
2628
+ */
2629
+ function lookupParsha(parsha) {
2630
+ const name = parshaToString(parsha);
2631
+ const raw = parshiyotObj[name];
2632
+ if (typeof raw !== 'object') {
2633
+ throw new TypeError(`Bad parsha argument: ${parsha}`);
2634
+ }
2635
+ return raw;
2636
+ }
2637
+
2638
+ /**
2639
+ * @private
2640
+ * @param {HDate} saturday
2641
+ * @param {boolean} il
2642
+ * @return {Leyning}
2643
+ */
2644
+ function findParshaHaShavua(saturday, il) {
2645
+ const hyear = saturday.getFullYear();
2646
+ const sedra = core.HebrewCalendar.getSedra(hyear, il);
2647
+ const parsha = sedra.lookup(saturday);
2648
+ if (!parsha.chag) {
2649
+ return parsha;
2650
+ }
2651
+ // Special case between YK and Simchat Torah
2652
+ if (saturday.getMonth() === core.months.TISHREI) {
2653
+ const dd = saturday.getDate();
2654
+ const simchatTorah = il ? 22 : 23;
2655
+ if (dd > 10 && dd <= simchatTorah) {
2656
+ return {
2657
+ parsha: ['Vezot Haberakhah'],
2658
+ chag: false,
2659
+ num: 54,
2660
+ };
2661
+ }
2662
+ }
2663
+ // Search for next regular parsha, which could even spill into next year
2664
+ const endOfYear = new core.HDate(1, core.months.TISHREI, hyear + 1).abs() - 1;
2665
+ const endAbs = endOfYear + 30;
2666
+ for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {
2667
+ const sedra2 = sat2 > endOfYear ? core.HebrewCalendar.getSedra(hyear + 1, il) : sedra;
2668
+ const parsha2 = sedra2.lookup(sat2);
2669
+ if (!parsha2.chag) {
2670
+ return parsha2;
2671
+ }
2672
+ }
2673
+ /* NOTREACHED */
2674
+ return null;
2675
+ }
2676
+
2677
+ const __cache = new Map();
2678
+
2679
+ /**
2680
+ * Looks up leyning for a regular Shabbat, Monday/Thursday weekday or holiday.
2681
+ *
2682
+ * If `hdate` coincides with a holiday that has Torah reading, returns the
2683
+ * reading for that day (see {@link getLeyningForHoliday})
2684
+ *
2685
+ * Otherwise, if `hdate` is a Saturday, returns {@link getLeyningForParshaHaShavua}
2686
+ *
2687
+ * Otherwise, if `hdate` is a Monday or Thursday, returns {@link Leyning} for the
2688
+ * Parashat haShavua, containing only the `weekday` aliyot (no `fullkriyah`).
2689
+ *
2690
+ * Otherwise, returns `undefined`.
2691
+ *
2692
+ * @param {HDate} hdate Hebrew Date
2693
+ * @param {boolean} il in Israel
2694
+ * @param {boolean} [wantarray] to return an array of 0 or more readings
2695
+ * @return {Leyning|Leyning[]} map of aliyot
2696
+ */
2697
+ function getLeyningOnDate(hdate, il, wantarray = false) {
2698
+ const hdStr = hdate.toString();
2699
+ const cacheKey = `${hdStr}/${il ? 1 : 0}`;
2700
+ const cached = __cache.get(cacheKey);
2701
+ if (cached) {
2702
+ return wantarray ? cached : cached[0];
2703
+ }
2704
+ const dow = hdate.getDay();
2705
+ if (dow === 6) {
2706
+ const hyear = hdate.getFullYear();
2707
+ const sedra = core.HebrewCalendar.getSedra(hyear, il);
2708
+ const parsha = sedra.lookup(hdate);
2709
+ if (!parsha.chag) {
2710
+ const parshaEvent = new core.ParshaEvent(hdate, parsha.parsha, il);
2711
+ const reading = getLeyningForParshaHaShavua(parshaEvent, il);
2712
+ __cache.set(cacheKey, [reading]);
2713
+ return wantarray ? [reading] : reading;
2714
+ }
2715
+ }
2716
+ const events = core.HebrewCalendar.getHolidaysOnDate(hdate, il) || [];
2717
+ const arr = [];
2718
+ let hasFullKriyah = false;
2719
+ for (const ev of events) {
2720
+ const reading = getLeyningForHoliday(ev, il);
2721
+ if (reading) {
2722
+ arr.push(reading);
2723
+ if (reading.fullkriyah) {
2724
+ hasFullKriyah = true;
2725
+ }
2726
+ const mincha = getMincha(ev, il);
2727
+ if (mincha) {
2728
+ arr.push(mincha);
2729
+ }
2730
+ }
2731
+ }
2732
+ if (!hasFullKriyah && (dow === 1 || dow === 4)) {
2733
+ const saturday = hdate.onOrAfter(6);
2734
+ const parsha = findParshaHaShavua(saturday);
2735
+ const reading = {
2736
+ name: makeLeyningNames(parsha.parsha),
2737
+ parsha: parsha.parsha,
2738
+ parshaNum: parsha.num,
2739
+ weekday: getWeekdayReading(parsha.parsha),
2740
+ };
2741
+ arr.unshift(reading);
2742
+ }
2743
+ __cache.set(cacheKey, arr);
2744
+ return wantarray ? arr : arr[0];
2745
+ }
2746
+
2747
+ const minchaSuffix = ' (Mincha)';
2748
+
2749
+ /**
2750
+ * @private
2751
+ * @param {Event} ev
2752
+ * @param {boolean} il
2753
+ * @return {Leyning}
2754
+ */
2755
+ function getMincha(ev, il) {
2756
+ const desc = ev.getDesc() + minchaSuffix;
2757
+ const reading1 = getLeyningForHolidayKey(desc, ev.cholHaMoedDay, il);
2758
+ if (reading1) {
2759
+ return reading1;
2760
+ }
2761
+ const desc2 = getLeyningKeyForEvent(ev, il);
2762
+ if (desc2) {
2763
+ const reading2 = getLeyningForHolidayKey(desc2 + minchaSuffix, ev.cholHaMoedDay, il);
2764
+ if (reading2) {
2765
+ return reading2;
2766
+ }
2767
+ }
2768
+ return undefined;
2769
+ }
2770
+
2771
+ const fmt = new Intl.DateTimeFormat('en-US', {
2772
+ year: 'numeric', month: 'short', day: '2-digit',
2773
+ });
2774
+
2775
+ /**
2776
+ * @private
2777
+ * @param {Date} dt
2778
+ * @return {string}
2779
+ */
2780
+ function fmtDate(dt) {
2781
+ const s = fmt.format(dt).split(' ');
2782
+ return s[1].substring(0, 2) + '-' + s[0] + '-' + s[2];
2783
+ }
2784
+
2785
+ /**
2786
+ * @private
2787
+ * @param {Event[]} events
2788
+ * @return {Object<string,boolean>}
2789
+ */
2790
+ function getParshaDates(events) {
2791
+ const parshaEvents = events.filter((ev) => ev.getFlags() === core.flags.PARSHA_HASHAVUA);
2792
+ const parshaDates = parshaEvents.reduce((set, ev) => {
2793
+ set[ev.getDate().toString()] = true;
2794
+ return set;
2795
+ }, {});
2796
+ return parshaDates;
2797
+ }
2798
+
2799
+ /**
2800
+ * @private
2801
+ * @param {fs.WriteStream} stream
2802
+ * @param {number} hyear
2803
+ * @param {boolean} il
2804
+ */
2805
+ function writeFullKriyahCsv(stream, hyear, il) {
2806
+ const events0 = core.HebrewCalendar.calendar({
2807
+ year: hyear,
2808
+ isHebrewYear: true,
2809
+ sedrot: true,
2810
+ il: il,
2811
+ });
2812
+ const events = events0.filter((ev) => ev.getDesc() !== 'Rosh Chodesh Tevet');
2813
+ const parshaDates = getParshaDates(events);
2814
+ stream.write('"Date","Parashah","Aliyah","Reading","Verses"\r\n');
2815
+ for (const ev of events) {
2816
+ if (ev.getFlags() === core.flags.PARSHA_HASHAVUA || !parshaDates[ev.getDate().toString()]) {
2817
+ writeFullKriyahEvent(stream, ev, il);
2818
+ }
2819
+ }
2820
+ }
2821
+
2822
+ /**
2823
+ * @private
2824
+ * @param {Event} ev
2825
+ * @return {boolean}
2826
+ */
2827
+ function ignore(ev) {
2828
+ const mask = ev.getFlags();
2829
+ if (mask === core.flags.SPECIAL_SHABBAT) {
2830
+ return true;
2831
+ }
2832
+ if (mask !== core.flags.ROSH_CHODESH) {
2833
+ return false;
2834
+ }
2835
+ return ev.getDate().getDay() === 6;
2836
+ }
2837
+
2838
+ /**
2839
+ * @private
2840
+ * @param {fs.WriteStream} stream
2841
+ * @param {Event} ev
2842
+ * @param {boolean} il
2843
+ */
2844
+ function writeFullKriyahEvent(stream, ev, il) {
2845
+ if (ignore(ev)) {
2846
+ return;
2847
+ }
2848
+ const mask = ev.getFlags();
2849
+ const isParsha = mask === core.flags.PARSHA_HASHAVUA;
2850
+ const reading = isParsha ? getLeyningForParshaHaShavua(ev, il) : getLeyningForHoliday(ev, il);
2851
+ if (reading) {
2852
+ writeCsvLines(stream, ev, reading, il, isParsha);
2853
+ if (!isParsha) {
2854
+ writeHolidayMincha(stream, ev, il);
2855
+ }
2856
+ }
2857
+ }
2858
+
2859
+ /**
2860
+ * @private
2861
+ * @param {fs.WriteStream} stream
2862
+ * @param {Event} ev
2863
+ * @param {boolean} il
2864
+ */
2865
+ function writeHolidayMincha(stream, ev, il) {
2866
+ const desc = ev.getDesc();
2867
+ const minchaDesc1 = desc + ' (Mincha)';
2868
+ const readingMincha1 = getLeyningForHolidayKey(minchaDesc1, ev.cholHaMoedDay, il);
2869
+ const readingMincha = readingMincha1 ||
2870
+ getLeyningForHolidayKey(getLeyningKeyForEvent(ev, il) + ' (Mincha)', ev.cholHaMoedDay, il);
2871
+ if (readingMincha) {
2872
+ const minchaEv = new core.Event(ev.getDate(), minchaDesc1, core.flags.USER_EVENT);
2873
+ writeCsvLines(stream, minchaEv, readingMincha, il, false);
2874
+ }
2875
+ }
2876
+
2877
+ /**
2878
+ * Formats reading for CSV
2879
+ * @param {fs.WriteStream} stream
2880
+ * @param {Event} ev
2881
+ * @param {Leyning} reading
2882
+ * @param {boolean} il
2883
+ * @param {boolean} isParsha
2884
+ */
2885
+ function writeCsvLines(stream, ev, reading, il, isParsha) {
2886
+ const parsha = isParsha ? ev.basename() : getLeyningKeyForEvent(ev, il) || ev.render();
2887
+ const date = fmtDate(ev.getDate().greg());
2888
+ const lines = getFullKriyahLines(reading);
2889
+ for (const s of lines) {
2890
+ const code = s[0].charCodeAt(0);
2891
+ if (code < 48 || code > 57) {
2892
+ s[0] = `"${s[0]}"`;
2893
+ }
2894
+ stream.write(`${date},"${parsha}",${s[0]},"${s[1]}",${s[2]}\r\n`);
2895
+ }
2896
+ stream.write('\r\n');
2897
+ }
2898
+
2899
+ /**
2900
+ * @private
2901
+ * @param {any} reading
2902
+ * @return {any[]}
2903
+ */
2904
+ function getFullKriyahLines(reading) {
2905
+ const lines = [];
2906
+ if (reading.fullkriyah) {
2907
+ for (const [num, a] of Object.entries(reading.fullkriyah)) {
2908
+ if (typeof a !== 'undefined') {
2909
+ const k = num == 'M' ? 'maf' : num;
2910
+ let aliyah = formatAliyahWithBook(a);
2911
+ if (reading.reason?.[num]) {
2912
+ aliyah += ' | ' + reading.reason[num];
2913
+ }
2914
+ lines.push([k, aliyah, a.v || '']);
2915
+ }
2916
+ }
2917
+ }
2918
+ let specialHaftara = false;
2919
+ if (reading.haftara) {
2920
+ let haftara = reading.haftara.replace(/,/g, ';');
2921
+ if (reading.reason?.haftara) {
2922
+ specialHaftara = true;
2923
+ haftara += ' | ' + reading.reason.haftara;
2924
+ }
2925
+ lines.push(['Haftara', haftara, reading.haftaraNumV || '']);
2926
+ }
2927
+ if (reading.sephardic && !specialHaftara) {
2928
+ const sephardic = reading.sephardic.replace(/,/g, ';');
2929
+ lines.push(['Haftara for Sephardim', sephardic, reading.sephardicNumV || '']);
2930
+ }
2931
+ if (reading.triHaftara) {
2932
+ const haftara = reading.triHaftara.replace(/,/g, ';');
2933
+ lines.push(['Alternate Haftara', haftara, reading.triHaftaraNumV || '']);
2934
+ }
2935
+ if (reading.megillah) {
2936
+ for (const [num, a] of Object.entries(reading.megillah)) {
2937
+ if (typeof a !== 'undefined') {
2938
+ const aliyah = formatAliyahWithBook(a);
2939
+ lines.push([`Megillah Ch. ${num}`, aliyah, a.v || '']);
2940
+ }
2941
+ }
2942
+ }
2943
+ return lines;
2944
+ }
2945
+
2946
+ exports.BOOK = BOOK;
2947
+ exports.calculateNumVerses = calculateNumVerses;
2948
+ exports.clone = clone;
2949
+ exports.cloneHaftara = cloneHaftara;
2950
+ exports.formatAliyahShort = formatAliyahShort;
2951
+ exports.formatAliyahWithBook = formatAliyahWithBook;
2952
+ exports.getLeyningForHoliday = getLeyningForHoliday;
2953
+ exports.getLeyningForHolidayKey = getLeyningForHolidayKey;
2954
+ exports.getLeyningForParsha = getLeyningForParsha;
2955
+ exports.getLeyningForParshaHaShavua = getLeyningForParshaHaShavua;
2956
+ exports.getLeyningKeyForEvent = getLeyningKeyForEvent;
2957
+ exports.getLeyningOnDate = getLeyningOnDate;
2958
+ exports.getParshaDates = getParshaDates;
2959
+ exports.getWeekdayReading = getWeekdayReading;
2960
+ exports.hasFestival = hasFestival;
2961
+ exports.lookupFestival = lookupFestival;
2962
+ exports.lookupParsha = lookupParsha;
2963
+ exports.makeLeyningNames = makeLeyningNames;
2964
+ exports.makeLeyningParts = makeLeyningParts;
2965
+ exports.makeLeyningSummary = makeLeyningSummary;
2966
+ exports.makeSummaryFromParts = makeSummaryFromParts;
2967
+ exports.parshaToString = parshaToString;
2968
+ exports.specialReadings2 = specialReadings2;
2969
+ exports.sumVerses = sumVerses;
2970
+ exports.writeCsvLines = writeCsvLines;
2971
+ exports.writeFullKriyahCsv = writeFullKriyahCsv;
2972
+ exports.writeHolidayMincha = writeHolidayMincha;