@hebcal/leyning 9.3.0 → 9.4.0

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/bundle.js CHANGED
@@ -1,8 +1,8 @@
1
- /*! @hebcal/leyning v9.3.0 */
1
+ /*! @hebcal/leyning v9.4.0 */
2
2
  var hebcal__leyning = (function (exports, locale, event, holidays, sedra, ParshaEvent) {
3
3
  'use strict';
4
4
 
5
- var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat Machar Chodesh": ["שַׁבָּת מָחָר חוֹדֶשׁ"], "Shabbat Rosh Chodesh": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Pesach I (on Shabbat)": ["פֶּסַח יוֹם א׳ (בְּשַׁבָּת)"], "Pesach Chol ha-Moed Day 1": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם א׳"], "Pesach Chol ha-Moed Day 2": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳"], "Pesach Chol ha-Moed Day 2 on Sunday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳ (בְּיוֹם רִאשׁוֹן)"], "Pesach Chol ha-Moed Day 3": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳"], "Pesach Chol ha-Moed Day 3 on Monday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳ (בְּיוֹם שָׁנִי)"], "Pesach Chol ha-Moed Day 4": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ד׳"], "Pesach Chol ha-Moed Day 5": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ה׳"], "Pesach Shabbat Chol ha-Moed": ["פֶּסַח שַׁבָּת חוֹל הַמּוֹעֵד"], "Pesach VII (on Shabbat)": ["פֶּסַח ז׳ (בְּשַׁבָּת)"], "Pesach VIII (on Shabbat)": ["פֶּסַח ח׳ (בְּשַׁבָּת)"], "Shavuot II (on Shabbat)": ["שָׁבוּעוֹת יוֹם ב׳ (בְּשַׁבָּת)"], "Rosh Hashana I (on Shabbat)": ["רֹאשׁ הַשָּׁנָה יוֹם א׳ (בְּשַׁבָּת)"], "Yom Kippur (on Shabbat)": ["יוֹם כִּפּוּר (בְּשַׁבָּת)"], "Yom Kippur (Mincha, Traditional)": ["יוֹם כִּפּוּר מִנחָה"], "Yom Kippur (Mincha, Alternate)": ["יוֹם כִּפּוּר מִנחָה"], "Sukkot I (on Shabbat)": ["סוּכּוֹת יוֹם א׳ (בְּשַׁבָּת)"], "Sukkot Chol ha-Moed Day 1": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם א׳"], "Sukkot Chol ha-Moed Day 2": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ב׳"], "Sukkot Chol ha-Moed Day 3": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ג׳"], "Sukkot Chol ha-Moed Day 4": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ד׳"], "Sukkot Chol ha-Moed Day 5": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ה׳"], "Sukkot Shabbat Chol ha-Moed": ["סוּכּוֹת שַׁבָּת חוֹל הַמּוֹעֵד"], "Sukkot Final Day (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Shmini Atzeret (on Shabbat)": ["שְׁמִינִי עֲצֶרֶת (בְּשַׁבָּת)"], "Chanukah Day 1": ["חֲנוּכָּה יוֹם א׳"], "Chanukah Day 2": ["חֲנוּכָּה יוֹם ב׳"], "Chanukah Day 3": ["חֲנוּכָּה יוֹם ג׳"], "Chanukah Day 4": ["חֲנוּכָּה יוֹם ד׳"], "Chanukah Day 5": ["חֲנוּכָּה יוֹם ה׳"], "Chanukah Day 6": ["חֲנוּכָּה יוֹם ו׳"], "Chanukah Day 7": ["חֲנוּכָּה יוֹם ז׳"], "Chanukah Day 7 (on Rosh Chodesh)": ["חֲנוּכָּה יוֹם ז׳ (רֹאשׁ חוֹדֶשׁ)"], "Chanukah Day 8": ["חֲנוּכָּה יוֹם ח׳"], "Chanukah Day 1 (on Shabbat)": ["חֲנוּכָּה יוֹם א׳ (בְּשַׁבָּת)"], "Chanukah Day 2 (on Shabbat)": ["חֲנוּכָּה יוֹם ב׳ (בְּשַׁבָּת)"], "Chanukah Day 3 (on Shabbat)": ["חֲנוּכָּה יוֹם ג׳ (בְּשַׁבָּת)"], "Chanukah Day 4 (on Shabbat)": ["חֲנוּכָּה יוֹם ד׳ (בְּשַׁבָּת)"], "Chanukah Day 5 (on Shabbat)": ["חֲנוּכָּה יוֹם ה׳ (בְּשַׁבָּת)"], "Chanukah Day 7 (on Shabbat)": ["חֲנוּכָּה יוֹם ז׳ (בְּשַׁבָּת)"], "Chanukah Day 8 (on Shabbat)": ["חֲנוּכָּה יוֹם ח׳ (בְּשַׁבָּת)"], "Shabbat Rosh Chodesh Chanukah": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ חֲנוּכָּה"], "Yom Kippur (Mincha)": ["יוֹם כִּפּוּר מִנחָה"], "Tish'a B'Av (Mincha)": ["תִּשְׁעָה בְּאָב מִנחָה"], "Asara B'Tevet (Mincha)": ["עֲשָׂרָה בְּטֵבֵת מִנחָה"], "Ta'anit Bechorot (Mincha)": ["תַּעֲנִית בְּכוֹרוֹת מִנחָה"], "Ta'anit Esther (Mincha)": ["תַּעֲנִית אֶסְתֵּר מִנחָה"], "Tzom Gedaliah (Mincha)": ["צוֹם גְּדַלְיָה מִנחָה"], "Tzom Tammuz (Mincha)": ["צוֹם י״ז בְּתַמּוּז מִנחָה"] } } };
5
+ var poHe$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he_IL" }, "contexts": { "": { "Shabbat Machar Chodesh": ["שַׁבָּת מָחָר חוֹדֶשׁ"], "Shabbat Rosh Chodesh": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Pesach I (on Shabbat)": ["פֶּסַח יוֹם א׳ (בְּשַׁבָּת)"], "Pesach Chol ha-Moed Day 1": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם א׳"], "Pesach Chol ha-Moed Day 2": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳"], "Pesach Chol ha-Moed Day 2 on Sunday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ב׳ (בְּיוֹם רִאשׁוֹן)"], "Pesach Chol ha-Moed Day 3": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳"], "Pesach Chol ha-Moed Day 3 on Monday": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ג׳ (בְּיוֹם שָׁנִי)"], "Pesach Chol ha-Moed Day 4": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ד׳"], "Pesach Chol ha-Moed Day 5": ["פֶּסַח חוֹל הַמּוֹעֵד יוֹם ה׳"], "Pesach VII (on Shabbat)": ["פֶּסַח ז׳ (בְּשַׁבָּת)"], "Pesach VIII (on Shabbat)": ["פֶּסַח ח׳ (בְּשַׁבָּת)"], "Shavuot II (on Shabbat)": ["שָׁבוּעוֹת יוֹם ב׳ (בְּשַׁבָּת)"], "Fast Day (Morning)": ["תַּעֲנִית (שַׁחֲרִית)"], "Fast Day (Afternoon)": ["תַּעֲנִית (מִנְחָה)"], "Rosh Hashana I (on Shabbat)": ["רֹאשׁ הַשָּׁנָה א׳ (בְּשַׁבָּת)"], "Yom Kippur (on Shabbat)": ["יוֹם כִּפּוּר (בְּשַׁבָּת)"], "Yom Kippur (Mincha, Traditional)": ["יוֹם כִּפּוּר מִנְחָה"], "Yom Kippur (Mincha, Alternate)": ["יוֹם כִּפּוּר מִנְחָה"], "Sukkot I (on Shabbat)": ["סוּכּוֹת יוֹם א׳ (בְּשַׁבָּת)"], "Sukkot Chol ha-Moed Day 1": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם א׳"], "Sukkot Chol ha-Moed Day 2": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ב׳"], "Sukkot Chol ha-Moed Day 3": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ג׳"], "Sukkot Chol ha-Moed Day 4": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ד׳"], "Sukkot Chol ha-Moed Day 5": ["סוּכּוֹת חוֹל הַמּוֹעֵד יוֹם ה׳"], "Sukkot Final Day (Hoshana Raba)": ["סוּכּוֹת ז׳ (הוֹשַׁעְנָא רַבָּה)"], "Shmini Atzeret (on Shabbat)": ["שְׁמִינִי עֲצֶרֶת (בְּשַׁבָּת)"], "Simchat Torah (on Shabbat)": ["שִׂמְחַת תּוֹרָה (בְּשַׁבָּת)"], "Chanukah Day 1": ["חֲנוּכָּה יוֹם א׳"], "Chanukah Day 2": ["חֲנוּכָּה יוֹם ב׳"], "Chanukah Day 3": ["חֲנוּכָּה יוֹם ג׳"], "Chanukah Day 4": ["חֲנוּכָּה יוֹם ד׳"], "Chanukah Day 5": ["חֲנוּכָּה יוֹם ה׳"], "Chanukah Day 6": ["חֲנוּכָּה יוֹם ו׳"], "Chanukah Day 7": ["חֲנוּכָּה יוֹם ז׳"], "Chanukah Day 7 (on Rosh Chodesh)": ["חֲנוּכָּה יוֹם ז׳ (רֹאשׁ חוֹדֶשׁ)"], "Chanukah Day 8": ["חֲנוּכָּה יוֹם ח׳"], "Chanukah Day 1 (on Shabbat)": ["חֲנוּכָּה יוֹם א׳ (בְּשַׁבָּת)"], "Chanukah Day 2 (on Shabbat)": ["חֲנוּכָּה יוֹם ב׳ (בְּשַׁבָּת)"], "Chanukah Day 3 (on Shabbat)": ["חֲנוּכָּה יוֹם ג׳ (בְּשַׁבָּת)"], "Chanukah Day 4 (on Shabbat)": ["חֲנוּכָּה יוֹם ד׳ (בְּשַׁבָּת)"], "Chanukah Day 5 (on Shabbat)": ["חֲנוּכָּה יוֹם ה׳ (בְּשַׁבָּת)"], "Chanukah Day 7 (on Shabbat)": ["חֲנוּכָּה יוֹם ז׳ (בְּשַׁבָּת)"], "Chanukah Day 8 (on Shabbat)": ["חֲנוּכָּה יוֹם ח׳ (בְּשַׁבָּת)"], "Shabbat Rosh Chodesh Chanukah": ["שַׁבָּת רֹאשׁ חוֹדֶשׁ חֲנוּכָּה"], "Shushan Purim (on Shabbat)": ["שׁוּשַׁן פּוּרִים (בְּשַׁבָּת)"], "Yom Kippur (Mincha)": ["יוֹם כִּפּוּר (מִנְחָה)"], "Tish'a B'Av (Mincha)": ["תִּשְׁעָה בְּאָב (מִנְחָה)"], "Asara B'Tevet (Mincha)": ["עֲשָׂרָה בְּטֵבֵת (מִנְחָה)"], "Ta'anit Bechorot (Mincha)": ["תַּעֲנִית בְּכוֹרוֹת (מִנְחָה)"], "Ta'anit Esther (Mincha)": ["תַּעֲנִית אֶסְתֵּר (מִנְחָה)"], "Tzom Gedaliah (Mincha)": ["צוֹם גְּדַלְיָה (מִנְחָה)"], "Tzom Tammuz (Mincha)": ["צוֹם י״ז בְּתַמּוּז (מִנְחָה)"], "Genesis": ["בְּרֵאשִׁית"], "Exodus": ["שְׁמוֹת"], "Leviticus": ["וַיִּקְרָא"], "Numbers": ["בְּמִדְבַּר"], "Deuteronomy": ["דְּבָרִים"], "Joshua": ["יְהוֹשֻׁעַ"], "Judges": ["שׁוֹפְטִים"], "I Samuel": ["שְׁמוּאֵל א"], "II Samuel": ["שְׁמוּאֵל ב"], "I Kings": ["מְלָכִים א"], "II Kings": ["מְלָכִים ב"], "Isaiah": ["יְשַׁעְיָהוּ"], "Jeremiah": ["יִרְמְיָהוּ"], "Ezekiel": ["יְחֶזְקֵאל"], "Hosea": ["הוֹשֵׁעַ"], "Joel": ["יוֹאֵל"], "Amos": ["עָמוֹס"], "Obadiah": ["עוֹבַדְיָה"], "Jonah": ["יוֹנָה"], "Micah": ["מִיכָה"], "Nachum": ["נַחוּם"], "Habakkuk": ["חֲבַקּוּק"], "Zephaniah": ["צְפַנְיָה"], "Haggai": ["חַגַּי"], "Zechariah": ["זְכַרְיָה"], "Malachi": ["מַלְאָכִי"], "Song of Songs": ["שִׁיר הַשִּׁירִים"], "Ruth": ["רוּת"], "Lamentations": ["אֵיכָה"], "Ecclesiastes": ["קֹהֶלֶת"], "Esther": ["אֶסְתֵּר"], "Pinchas occurring after 17 Tammuz": ["פִּינְחָס מתרחש לאחר יז׳ בְּתַמּוּז"], "Kedoshim following Special Shabbat": ["קְדֹשִׁים לאחר שַׁבָּת מיוחדת"], "Masei on Shabbat Rosh Chodesh": ["מַסְעֵי בְּשַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Matot-Masei on Shabbat Rosh Chodesh": ["מַטּוֹת־מַסְעֵי בְּשַׁבָּת רֹאשׁ חוֹדֶשׁ"], "Ki Teitzei with 3rd Haftarah of Consolation": ["כִּי־תֵצֵא עם הַפְטָרָה שְׁלִישִׁית שֶׁל נֶחָמָה"], "Shabbat HaChodesh (on Rosh Chodesh)": ["שַׁבָּת הַחוֹדֶשׁ (בְּרֹאשׁ חוֹדֶשׁ)"], "Shabbat Shekalim (on Rosh Chodesh)": ["שַׁבָּת שְׁקָלִים (רֹאשׁ חוֹדֶשׁ)"], "Shabbat Shuva (with Vayeilech)": ["שַׁבַּת שׁוּבָה (עם וַיֵּלֶךְ)"], "Shabbat Shuva (with Ha'azinu)": ["שַׁבַּת שׁוּבָה (עם הַאֲזִינוּ)"] } } };
6
6
 
7
7
  var poAshkenazi$1 = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Shabbat Machar Chodesh": ["Shabbos Machar Chodesh"], "Shabbat Rosh Chodesh": ["Shabbos Rosh Chodesh"], "Pesach I (on Shabbat)": ["Pesach I (on Shabbos)"], "Pesach Shabbat Chol ha-Moed": ["Pesach Shabbos Chol ha-Moed"], "Pesach VII (on Shabbat)": ["Pesach VII (on Shabbos)"], "Pesach VIII (on Shabbat)": ["Pesach VIII (on Shabbos)"], "Shavuot II (on Shabbat)": ["Shavuos II (on Shabbos)"], "Rosh Hashana I (on Shabbat)": ["Rosh Hashana I (on Shabbos)"], "Yom Kippur (on Shabbat)": ["Yom Kippur (on Shabbos)"], "Sukkot I (on Shabbat)": ["Sukkos I (on Shabbos)"], "Sukkot Chol ha-Moed Day 1": ["Sukkos Chol ha-Moed Day 1"], "Sukkot Chol ha-Moed Day 2": ["Sukkos Chol ha-Moed Day 2"], "Sukkot Chol ha-Moed Day 3": ["Sukkos Chol ha-Moed Day 3"], "Sukkot Chol ha-Moed Day 4": ["Sukkos Chol ha-Moed Day 4"], "Sukkot Chol ha-Moed Day 5": ["Sukkos Chol ha-Moed Day 5"], "Sukkot Shabbat Chol ha-Moed": ["Sukkos Shabbos Chol ha-Moed"], "Sukkot Final Day (Hoshana Raba)": ["Sukkos Final Day (Hoshana Raba)"], "Shmini Atzeret (on Shabbat)": ["Shmini Atzeres (on Shabbos)"], "Chanukah Day 1 (on Shabbat)": ["Chanukah Day 1 (on Shabbos)"], "Chanukah Day 2 (on Shabbat)": ["Chanukah Day 2 (on Shabbos)"], "Chanukah Day 3 (on Shabbat)": ["Chanukah Day 3 (on Shabbos)"], "Chanukah Day 4 (on Shabbat)": ["Chanukah Day 4 (on Shabbos)"], "Chanukah Day 5 (on Shabbat)": ["Chanukah Day 5 (on Shabbos)"], "Chanukah Day 7 (on Shabbat)": ["Chanukah Day 7 (on Shabbos)"], "Chanukah Day 8 (on Shabbat)": ["Chanukah Day 8 (on Shabbos)"], "Shabbat Rosh Chodesh Chanukah": ["Shabbos Rosh Chodesh Chanukah"], "Asara B'Tevet (Mincha)": ["Asara B’Teves (Mincha)"], "Ta'anit Bechorot (Mincha)": ["Ta’anis Bechorot (Mincha)"], "Ta'anit Esther (Mincha)": ["Ta’anis Esther (Mincha)"] } } };
8
8
 
@@ -11,295 +11,7 @@ locale.Locale.addTranslations('he', poHe$1);
11
11
  const poHeNoNikud$1 = locale.Locale.copyLocaleNoNikud(poHe$1);
12
12
  locale.Locale.addTranslations('he-x-NoNikud', poHeNoNikud$1);
13
13
 
14
- const Genesis=[0,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26];const Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,23,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];const Leviticus=[0,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34];const Numbers=[0,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13];const Deuteronomy=[0,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12];const 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];const Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];const Ruth=[0,22,23,18,22];const 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];const 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];const Lamentations=[0,22,22,66,22,22];const Esther=[0,22,23,15,17,14,14,10,17,32,3];const Ecclesiastes=[0,18,26,22,17,19,12,29,17,18,20,10,14];const 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];const Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];const Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];const Joel=[0,20,27,5,21];const Amos=[0,15,16,15,13,27,14,17,14,15];const Obadiah=[0,21];const Jonah=[0,16,11,10,11];const Micah=[0,16,13,12,14,14,16,20];const Nachum=[0,14,14,19];const Habakkuk=[0,17,20,19];const Zephaniah=[0,18,15,20];const Haggai=[0,15,23];const Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];const Malachi=[0,14,17,24];var numverses = {Genesis:Genesis,Exodus:Exodus,Leviticus:Leviticus,Numbers:Numbers,Deuteronomy:Deuteronomy,Joshua:Joshua,Judges:Judges,Ruth:Ruth,"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],"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],"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],"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],Isaiah:Isaiah,Jeremiah:Jeremiah,Lamentations:Lamentations,Esther:Esther,Ecclesiastes:Ecclesiastes,"Song of Songs":[0,17,17,11,16,16,12,14,14],Ezekiel:Ezekiel,Daniel:Daniel,Hosea:Hosea,Joel:Joel,Amos:Amos,Obadiah:Obadiah,Jonah:Jonah,Micah:Micah,Nachum:Nachum,Habakkuk:Habakkuk,Zephaniah:Zephaniah,Haggai:Haggai,Zechariah:Zechariah,Malachi:Malachi};
15
-
16
- /**
17
- * Names of the books of the Torah.
18
- *
19
- * `BOOK[1] === 'Genesis'`
20
- * @readonly
21
- */
22
- const BOOK = [
23
- '',
24
- 'Genesis',
25
- 'Exodus',
26
- 'Leviticus',
27
- 'Numbers',
28
- 'Deuteronomy',
29
- ];
30
- /**
31
- * The number of verses in each book of the Tanakh.
32
- * Indexed by English transliterated name of book,
33
- * and arrays are 1-based.
34
- *
35
- * There are 51 chapters in Genesis, so
36
- * `NUM_VERSES['Genesis'].length === 51`.
37
- *
38
- * There are 26 verses in Genesis chapter 4,
39
- * so `NUM_VERSES['Genesis'][4] === 26`.
40
- * @readonly
41
- */
42
- const NUM_VERSES = numverses;
43
- /**
44
- * Formats parsha as a string
45
- * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
46
- */
47
- function parshaToString(parsha) {
48
- if (typeof parsha === 'string') {
49
- return parsha;
50
- }
51
- else if (!Array.isArray(parsha) ||
52
- parsha.length === 0 ||
53
- parsha.length > 2) {
54
- throw new TypeError(`Bad parsha argument: ${parsha}`);
55
- }
56
- let s = parsha[0];
57
- if (parsha.length === 2) {
58
- s += '-' + parsha[1];
59
- }
60
- return s;
61
- }
62
- /**
63
- * Calculates the number of verses in an aliyah or haftara based on
64
- * the `b` (begin verse), `e` (end verse) and `k` (book).
65
- * Modifies `aliyah` by setting the `v` field.
66
- */
67
- function calculateNumVerses(aliyah) {
68
- if (aliyah.v) {
69
- return aliyah.v;
70
- }
71
- aliyah.v = subtractVerses(aliyah.k, aliyah.b, aliyah.e) + 1;
72
- return aliyah.v;
73
- }
74
- /**
75
- * Finds the number of verses between two locations in the same book.
76
- * @param book The English name of the book (e.g. "Numbers")
77
- * @param from The starting verse (e.g. "28:9")
78
- * @param to The ending verse (e.g. "28:15")
79
- * @returns The number of verses between the two locations, excluding the `to` verse.
80
- */
81
- function subtractVerses(book, from, to) {
82
- const chapVerseBegin = from.split(':');
83
- const chapVerseEnd = to.split(':');
84
- const c1 = parseInt(chapVerseBegin[0], 10);
85
- const c2 = parseInt(chapVerseEnd[0], 10);
86
- const v1 = parseInt(chapVerseBegin[1], 10);
87
- const v2 = parseInt(chapVerseEnd[1], 10);
88
- let result = 0;
89
- if (c1 === c2) {
90
- return v2 - v1;
91
- }
92
- const numv = NUM_VERSES[book];
93
- if (typeof numv !== 'object' || !numv.length) {
94
- throw new ReferenceError(`Can't find numverses for ${book}`);
95
- }
96
- let total = numv[c1] - v1;
97
- for (let chap = c1 + 1; chap < c2; chap++) {
98
- total += numv[chap];
99
- }
100
- total += v2;
101
- result = total;
102
- return result;
103
- }
104
- /**
105
- * Calculates the next verse after adding a number of verses to a given location.
106
- * @param book The English name of the book (e.g. "Numbers")
107
- * @param from The starting verse (e.g. "28:9")
108
- * @param numVerses The number of verses to add; must be nonnegative.
109
- * @returns The next verse after adding the specified number of verses,
110
- * or null if the resulting verse exceeds the number of verses
111
- * in the book.
112
- */
113
- function addVerses(book, from, numVerses) {
114
- const chapVerseBegin = from.split(':');
115
- const c1 = parseInt(chapVerseBegin[0], 10);
116
- const v1 = parseInt(chapVerseBegin[1], 10);
117
- const numv = NUM_VERSES[book];
118
- if (typeof numv !== 'object' || !numv.length) {
119
- throw new ReferenceError(`Can't find numverses for ${book}`);
120
- }
121
- let total = v1 + numVerses;
122
- let c2 = c1;
123
- while (total > numv[c2]) {
124
- total -= numv[c2];
125
- c2++;
126
- if (!numv[c2])
127
- return null;
128
- }
129
- return `${c2}:${total}`;
130
- }
131
- /**
132
- * Formats an aliyah object like "Numbers 28:9-28:15"
133
- */
134
- function formatAliyahWithBook(a) {
135
- return `${a.k} ${a.b}-${a.e}`;
136
- }
137
- /**
138
- * Formats an aliyah object like "Numbers 28:9-15"
139
- */
140
- function formatAliyahShort(aliyah, showBook) {
141
- const begin = aliyah.b;
142
- const end0 = aliyah.e;
143
- const prefix = showBook ? aliyah.k + ' ' : '';
144
- if (begin === end0) {
145
- return `${prefix}${begin}`;
146
- }
147
- const cv1 = begin.split(':');
148
- const cv2 = end0.split(':');
149
- const end = cv1[0] === cv2[0] ? cv2[1] : end0;
150
- return `${prefix}${begin}-${end}`;
151
- }
152
-
153
- /**
154
- * @private
155
- */
156
- function isChapVerseBefore(a, b) {
157
- const cv1 = a.split(':').map(x => +x);
158
- const cv2 = b.split(':').map(x => +x);
159
- return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
160
- }
161
- /**
162
- * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
163
- * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
164
- */
165
- function makeLeyningParts(aliyot) {
166
- const nums = Object.keys(aliyot).filter(x => {
167
- if (x.length === 1) {
168
- return true;
169
- }
170
- const code = x.charCodeAt(0);
171
- return code >= 48 && code <= 57;
172
- });
173
- let start = aliyot[nums[0]];
174
- let end = start;
175
- const parts = [];
176
- for (let i = 0; i < nums.length; i++) {
177
- const num = nums[i];
178
- const aliyah = aliyot[num];
179
- if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
180
- // short-circuit when final aliyah is within the previous (e.g. M inside of 7)
181
- continue;
182
- }
183
- const prevEndChap = +end.e.split(':')[0];
184
- const curStartChap = +aliyah.b.split(':')[0];
185
- const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
186
- if (i !== 0 &&
187
- (aliyah.k !== start.k ||
188
- isChapVerseBefore(aliyah.b, start.e) ||
189
- !sameOrNextChap)) {
190
- parts.push({ k: start.k, b: start.b, e: end.e });
191
- start = aliyah;
192
- }
193
- end = aliyah;
194
- }
195
- parts.push({ k: start.k, b: start.b, e: end.e });
196
- return parts;
197
- }
198
- /**
199
- * Returns a string representation of the leyning parts.
200
- * Separate verse ranges read from the same book are separated
201
- * by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
202
- * Verse ranges from different books are separated by semicolons,
203
- * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
204
- */
205
- function makeSummaryFromParts(parts) {
206
- if (!Array.isArray(parts)) {
207
- parts = [parts];
208
- }
209
- let prev = parts[0];
210
- let summary = formatAliyahShort(prev, true);
211
- for (let i = 1; i < parts.length; i++) {
212
- const part = parts[i];
213
- if (part.k === prev.k) {
214
- summary += ', ';
215
- }
216
- else {
217
- summary += `; ${part.k} `;
218
- }
219
- summary += formatAliyahShort(part, false);
220
- prev = part;
221
- }
222
- return summary;
223
- }
224
- /**
225
- * Makes a summary of the leyning, like "Genesis 6:9-11:32"
226
- */
227
- function makeLeyningSummary(aliyot) {
228
- const parts = makeLeyningParts(aliyot);
229
- return makeSummaryFromParts(parts);
230
- }
231
-
232
- /**
233
- * Makes a deep copy of the src object using JSON stringify and parse
234
- */
235
- function clone(src) {
236
- return JSON.parse(JSON.stringify(src));
237
- }
238
- function cloneHaftara(haft) {
239
- if (!haft) {
240
- return haft;
241
- }
242
- const dest = clone(haft);
243
- if (Array.isArray(dest)) {
244
- dest.forEach(calculateNumVerses);
245
- }
246
- else {
247
- calculateNumVerses(dest);
248
- }
249
- return dest;
250
- }
251
- /**
252
- * Returns the total number of verses in an array of Aliyah (or haftarah) objects
253
- */
254
- function sumVerses(aliyot) {
255
- return Array.isArray(aliyot)
256
- ? aliyot.reduce((prev, cur) => prev + cur.v, 0)
257
- : aliyot.v;
258
- }
259
-
260
- const Shavuot={note:"Israel only",il:true,megillah:"Ruth",haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}};const Purim={megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}};var festivals0 = {"Pesach I":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:36"},"4":{p:15,k:2,b:"12:37",e:"12:42"},"5":{p:15,k:2,b:"12:43",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach I (on Shabbat)":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:32"},"4":{p:15,k:2,b:"12:33",e:"12:36"},"5":{p:15,k:2,b:"12:37",e:"12:42"},"6":{p:15,k:2,b:"12:43",e:"12:47"},"7":{p:15,k:2,b:"12:48",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II":{haft:[{k:"II Kings",b:"23:1",e:"23:9"},{k:"II Kings",b:"23:21",e:"23:25"}],fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II (CH''M)":{note:"Israel only - according to Vaani T'fillati Siddur Yisraeli",il:true,fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:8"},"2":{p:31,k:3,b:"23:9",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:44"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 1":{fullkriyah:{"1":{p:15,k:2,b:"13:1",e:"13:4"},"2":{p:15,k:2,b:"13:5",e:"13:10"},"3":{p:15,k:2,b:"13:11",e:"13:16"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 2":{fullkriyah:{"1":{p:18,k:2,b:"22:24",e:"22:26"},"2":{p:18,k:2,b:"22:27",e:"23:5"},"3":{p:18,k:2,b:"23:6",e:"23:19"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 3":{fullkriyah:{"1":{p:21,k:2,b:"34:1",e:"34:10"},"2":{p:21,k:2,b:"34:11",e:"34:17"},"3":{p:21,k:2,b:"34:18",e:"34:26"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 4":{fullkriyah:{"1":{p:36,k:4,b:"9:1",e:"9:5"},"2":{p:36,k:4,b:"9:6",e:"9:8"},"3":{p:36,k:4,b:"9:9",e:"9:14"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Shabbat Chol ha-Moed":{megillah:"Song of Songs",haft:{k:"Ezekiel",b:"37:1",e:"37:14"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII":{haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:22"},"2":{p:16,k:2,b:"14:1",e:"14:8"},"3":{p:16,k:2,b:"14:9",e:"14:14"},"4":{p:16,k:2,b:"14:15",e:"14:25"},"5":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:19"},"2":{p:16,k:2,b:"13:20",e:"13:22"},"3":{p:16,k:2,b:"14:1",e:"14:4"},"4":{p:16,k:2,b:"14:5",e:"14:8"},"5":{p:16,k:2,b:"14:9",e:"14:14"},"6":{p:16,k:2,b:"14:15",e:"14:25"},"7":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII":{haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach III (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 1"},"Pesach IV (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 2"},"Pesach V (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 3"},"Pesach VI (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 4"},"Pesach Chol ha-Moed Day 2 on Sunday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 1"},"Pesach Chol ha-Moed Day 3 on Monday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 2"},Shavuot:Shavuot,"Shavuot I":{haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II (on Shabbat)":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Fast Day (Morning)":{fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},"3":{p:21,k:2,b:"34:4",e:"34:10"}}},"Fast Day (Afternoon)":{haft:{k:"Isaiah",b:"55:6",e:"56:8"},fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},M:{p:21,k:2,b:"34:4",e:"34:10"}}},"Asara B'Tevet":{alias:true,key:"Fast Day (Morning)"},"Ta'anit Esther":{alias:true,key:"Fast Day (Morning)"},"Tzom Gedaliah":{alias:true,key:"Fast Day (Morning)"},"Tzom Tammuz":{alias:true,key:"Fast Day (Morning)"},"Asara B'Tevet (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Ta'anit Esther (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Gedaliah (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Tammuz (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Erev Tish'a B'Av":{megillah:"Lamentations"},"Tish'a B'Av":{haft:{k:"Jeremiah",b:"8:13",e:"9:23"},fullkriyah:{"1":{p:45,k:5,b:"4:25",e:"4:29"},"2":{p:45,k:5,b:"4:30",e:"4:35"},"3":{p:45,k:5,b:"4:36",e:"4:40"}},megillah:"Lamentations"},"Tish'a B'Av (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Rosh Hashana I":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:12"},"3":{p:4,k:1,b:"21:13",e:"21:21"},"4":{p:4,k:1,b:"21:22",e:"21:27"},"5":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana I (on Shabbat)":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:8"},"3":{p:4,k:1,b:"21:9",e:"21:12"},"4":{p:4,k:1,b:"21:13",e:"21:17"},"5":{p:4,k:1,b:"21:18",e:"21:21"},"6":{p:4,k:1,b:"21:22",e:"21:27"},"7":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana II":{haft:{k:"Jeremiah",b:"31:2",e:"31:20",note:"labeled 31:1–19 in some books"},fullkriyah:{"1":{p:4,k:1,b:"22:1",e:"22:3"},"2":{p:4,k:1,b:"22:4",e:"22:8"},"3":{p:4,k:1,b:"22:9",e:"22:14"},"4":{p:4,k:1,b:"22:15",e:"22:19"},"5":{p:4,k:1,b:"22:20",e:"22:24"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Yom Kippur":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:6"},"2":{p:29,k:3,b:"16:7",e:"16:11"},"3":{p:29,k:3,b:"16:12",e:"16:17"},"4":{p:29,k:3,b:"16:18",e:"16:24"},"5":{p:29,k:3,b:"16:25",e:"16:30"},"6":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (on Shabbat)":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:3"},"2":{p:29,k:3,b:"16:4",e:"16:6"},"3":{p:29,k:3,b:"16:7",e:"16:11"},"4":{p:29,k:3,b:"16:12",e:"16:17"},"5":{p:29,k:3,b:"16:18",e:"16:24"},"6":{p:29,k:3,b:"16:25",e:"16:30"},"7":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (Mincha)":{alias:true,key:"Yom Kippur (Mincha, Traditional)"},"Yom Kippur (Mincha, Traditional)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:29,k:3,b:"18:1",e:"18:5"},"2":{p:29,k:3,b:"18:6",e:"18:21"},M:{p:29,k:3,b:"18:22",e:"18:30"}}},"Yom Kippur (Mincha, Alternate)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:30,k:3,b:"19:1",e:"19:4"},"2":{p:30,k:3,b:"19:5",e:"19:10"},M:{p:30,k:3,b:"19:11",e:"19:18"}}},"Sukkot I":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot I (on Shabbat)":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"22:33"},"2":{p:31,k:3,b:"23:1",e:"23:3"},"3":{p:31,k:3,b:"23:4",e:"23:8"},"4":{p:31,k:3,b:"23:9",e:"23:14"},"5":{p:31,k:3,b:"23:15",e:"23:22"},"6":{p:31,k:3,b:"23:23",e:"23:32"},"7":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot II":{haft:{k:"I Kings",b:"8:2",e:"8:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot Chol ha-Moed Day 1":{fullkriyah:{"1":{p:41,k:4,b:"29:17",e:"29:19"},"2":{p:41,k:4,b:"29:20",e:"29:22"},"3":{p:41,k:4,b:"29:23",e:"29:25"},"4":{p:41,k:4,b:"29:17",e:"29:22"}}},"Sukkot Chol ha-Moed Day 2":{fullkriyah:{"1":{p:41,k:4,b:"29:20",e:"29:22"},"2":{p:41,k:4,b:"29:23",e:"29:25"},"3":{p:41,k:4,b:"29:26",e:"29:28"},"4":{p:41,k:4,b:"29:20",e:"29:25"}}},"Sukkot Chol ha-Moed Day 3":{fullkriyah:{"1":{p:41,k:4,b:"29:23",e:"29:25"},"2":{p:41,k:4,b:"29:26",e:"29:28"},"3":{p:41,k:4,b:"29:29",e:"29:31"},"4":{p:41,k:4,b:"29:23",e:"29:28"}}},"Sukkot Chol ha-Moed Day 4":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:26",e:"29:31"}}},"Sukkot Chol ha-Moed Day 5":{fullkriyah:{"1":{p:41,k:4,b:"29:29",e:"29:31"},"2":{p:41,k:4,b:"29:32",e:"29:34"},"3":{p:41,k:4,b:"29:35",e:"29:37"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Shabbat Chol ha-Moed":{megillah:"Ecclesiastes",haft:{k:"Ezekiel",b:"38:18",e:"39:16"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},"M-day1":{p:41,k:4,b:"29:17",e:"29:22"},"M-day2":{p:41,k:4,b:"29:20",e:"29:25"},"M-day3":{p:41,k:4,b:"29:23",e:"29:28"},"M-day4":{p:41,k:4,b:"29:26",e:"29:31"},"M-day5":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Final Day (Hoshana Raba)":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Shmini Atzeret":{haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"16:3"},"4":{p:47,k:5,b:"16:4",e:"16:8"},"5":{p:47,k:5,b:"16:9",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}},alt:{"1":{p:47,k:5,b:"14:22",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shmini Atzeret (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Erev Simchat Torah":{fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"}}},"Simchat Torah":{haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"34:12"},"7":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Simchat Torah (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"33:29"},"7":{p:54,k:5,b:"34:1",e:"34:12"},"8":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shabbat Rosh Chodesh Chanukah":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 1":{fullkriyah:{"1":{p:35,k:4,b:"7:1",e:"7:11"},"2":{p:35,k:4,b:"7:12",e:"7:14"},"3":{p:35,k:4,b:"7:15",e:"7:17"}},alt:{"1":{p:35,k:4,b:"7:1",e:"7:3"},"2":{p:35,k:4,b:"7:4",e:"7:11"},"3":{p:35,k:4,b:"7:12",e:"7:17"}}},"Chanukah Day 1 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:1",e:"7:17"}}},"Chanukah Day 2":{fullkriyah:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:24",e:"7:29"}},alt:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 2 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 3":{fullkriyah:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:30",e:"7:35"}},alt:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 3 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 4":{fullkriyah:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:36",e:"7:41"}},alt:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 4 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 5":{fullkriyah:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:42",e:"7:47"}},alt:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 5 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 6":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 7":{fullkriyah:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:54",e:"7:59"}},alt:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Rosh Chodesh)":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 8":{fullkriyah:{"1":{p:35,k:4,b:"7:54",e:"7:56"},"2":{p:35,k:4,b:"7:57",e:"7:59"},"3":{p:35,k:4,b:"7:60",e:"8:4"}}},"Chanukah Day 8 (on Shabbat)":{haft:{k:"I Kings",b:"7:40",e:"7:50"},fullkriyah:{M:{p:35,k:4,b:"7:54",e:"8:4"}}},"Erev Purim":{megillah:"Esther"},Purim:Purim,"Shushan Purim":{note:"Jerusalem & walled cities only",il:true,megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}},"Shushan Purim (on Shabbat)":{il:true,note:"Jerusalem & walled cities only: special maftir Exodus 17:8-16, same Haftara as Shabbat Zachor"},"Shabbat HaChodesh":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaChodesh (on Rosh Chodesh)":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaGadol":{haft:{k:"Malachi",b:"3:4",e:"3:24"}},"Shabbat Parah":{haft:{k:"Ezekiel",b:"36:16",e:"36:38"},seph:{k:"Ezekiel",b:"36:16",e:"36:36"},fullkriyah:{M:{p:39,k:4,b:"19:1",e:"19:22"}}},"Shabbat Shekalim":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shekalim (on Rosh Chodesh)":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shuva (with Vayeilech)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva (with Ha'azinu)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Joel",b:"2:15",e:"2:27"}],seph:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"},{k:"Joel",b:"2:15",e:"2:27"}]},"Shabbat Zachor":{haft:{k:"I Samuel",b:"15:2",e:"15:34"},seph:{k:"I Samuel",b:"15:1",e:"15:34"},fullkriyah:{M:{p:49,k:5,b:"25:17",e:"25:19"}}},"Pinchas occurring after 17 Tammuz":{haft:{k:"Jeremiah",b:"1:1",e:"2:3"}},"Kedoshim following Special Shabbat":{haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"}},"Masei on Shabbat Rosh Chodesh":{haft:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"3:4",e:"3:4"}],seph:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"4:1",e:"4:2"},{k:"Isaiah",b:"66:1",e:"66:1"},{k:"Isaiah",b:"66:23",e:"66:23"}],fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Matot-Masei on Shabbat Rosh Chodesh":{alias:true,key:"Masei on Shabbat Rosh Chodesh"},"Ki Teitzei with 3rd Haftarah of Consolation":{haft:[{k:"Isaiah",b:"54:1",e:"54:10"},{k:"Isaiah",b:"54:11",e:"55:5"}]},"Rosh Chodesh":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:3"},"2":{p:41,k:4,b:"28:3",e:"28:5"},"3":{p:41,k:4,b:"28:6",e:"28:10"},"4":{p:41,k:4,b:"28:11",e:"28:15"}}},"Rosh Chodesh Nisan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Iyyar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sivan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tamuz":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Av":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Elul":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tishrei":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Cheshvan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Kislev":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sh'vat":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar I":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar II":{alias:true,key:"Rosh Chodesh"},"Shabbat Rosh Chodesh":{haft:{k:"Isaiah",b:"66:1",e:"66:24"},fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Shabbat Machar Chodesh":{haft:{k:"I Samuel",b:"20:18",e:"20:42"}}};
261
-
262
- const festivals = festivals0;
263
- /**
264
- * Is there a special festival Torah Reading for `holiday`?
265
- */
266
- function hasFestival(holiday) {
267
- return typeof festivals[holiday] === 'object';
268
- }
269
- function aliyotBookNumToStr(aliyot) {
270
- if (aliyot) {
271
- for (const aliyah of Object.values(aliyot)) {
272
- if (typeof aliyah.k === 'number') {
273
- aliyah.k = BOOK[aliyah.k];
274
- }
275
- }
276
- }
277
- }
278
- /**
279
- * Returns the raw metadata for festival reading for `holiday`
280
- */
281
- function lookupFestival(holiday) {
282
- let src = festivals[holiday];
283
- if (typeof src === 'undefined') {
284
- return undefined;
285
- }
286
- if (src.alias) {
287
- const tmp = festivals[src.key];
288
- if (typeof tmp === 'undefined') {
289
- throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
290
- }
291
- src = tmp;
292
- }
293
- const result = src.fullkriyah ? clone(src) : src;
294
- aliyotBookNumToStr(result.fullkriyah);
295
- aliyotBookNumToStr(result.alt);
296
- if (src.note) {
297
- result.note = src.note;
298
- }
299
- return result;
300
- }
301
-
302
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
14
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
303
15
  /* eslint-disable @typescript-eslint/no-namespace, no-inner-declarations */
304
16
  /** @private */
305
17
  const lengths = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
@@ -440,7 +152,7 @@ function abs2greg(abs) {
440
152
  return dt;
441
153
  }
442
154
 
443
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
155
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
444
156
 
445
157
  /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-namespace */
446
158
  /**
@@ -455,7 +167,7 @@ greg.greg2abs = greg2abs;
455
167
  greg.isDate = isDate;
456
168
  greg.isLeapYear = isGregLeapYear;
457
169
 
458
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
170
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
459
171
  /**
460
172
  * Removes niqqud from Hebrew string
461
173
  */
@@ -465,7 +177,7 @@ function hebrewStripNikkud(str) {
465
177
  return a.replace(/[\u0590-\u05bd]/g, '').replace(/[\u05bf-\u05c7]/g, '');
466
178
  }
467
179
 
468
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
180
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
469
181
 
470
182
  /*
471
183
  * More minimal HDate
@@ -834,7 +546,7 @@ function monthFromName(monthName) {
834
546
  throw new RangeError(`bad monthName: ${monthName}`);
835
547
  }
836
548
 
837
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
549
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
838
550
  const GERESH = '׳';
839
551
  const GERSHAYIM = '״';
840
552
  const heb2num = {
@@ -947,13 +659,13 @@ function gematriyaStrToNum(str) {
947
659
  return num;
948
660
  }
949
661
 
950
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
662
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
951
663
  var poAshkenazi = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "en_CA@ashkenazi" }, "contexts": { "": { "Tevet": ["Teves"] } } };
952
664
 
953
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
665
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
954
666
  var poHe = { "headers": { "plural-forms": "nplurals=2; plural=(n > 1);", "language": "he" }, "contexts": { "": { "Adar": ["אֲדָר"], "Adar I": ["אֲדָר א׳"], "Adar II": ["אֲדָר ב׳"], "Av": ["אָב"], "Cheshvan": ["חֶשְׁוָן"], "Elul": ["אֱלוּל"], "Iyyar": ["אִיָּיר"], "Kislev": ["כִּסְלֵו"], "Nisan": ["נִיסָן"], "Sh'vat": ["שְׁבָט"], "Sivan": ["סִיוָן"], "Tamuz": ["תַּמּוּז"], "Tevet": ["טֵבֵת"], "Tishrei": ["תִּשְׁרֵי"] } } };
955
667
 
956
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
668
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
957
669
 
958
670
  const noopLocale = {
959
671
  headers: { 'plural-forms': 'nplurals=2; plural=(n!=1);' },
@@ -1145,7 +857,7 @@ Locale.addLocale('he', poHe);
1145
857
  const poHeNoNikud = Locale.copyLocaleNoNikud(poHe);
1146
858
  Locale.addLocale('he-x-NoNikud', poHeNoNikud);
1147
859
 
1148
- /*! @hebcal/hdate v0.21.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
860
+ /*! @hebcal/hdate v0.21.1, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1149
861
 
1150
862
  /*
1151
863
  Hebcal - A Jewish Calendar Generator
@@ -1435,18 +1147,25 @@ class HDate {
1435
1147
  }
1436
1148
  /**
1437
1149
  * Renders this Hebrew date in Hebrew gematriya, regardless of locale.
1150
+ * @param suppressNikud - suppress nekudot (default false)
1151
+ * @param suppressYear - suppress Hebrew year (default false)
1438
1152
  * @example
1439
1153
  * import {HDate, months} from '@hebcal/hdate';
1440
1154
  * const hd = new HDate(15, months.CHESHVAN, 5769);
1441
1155
  * hd.renderGematriya(); // 'ט״ו חֶשְׁוָן תשס״ט'
1442
1156
  * hd.renderGematriya(true); // 'ט״ו חשון תשס״ט'
1157
+ * hd.renderGematriya(false, true); // 'ט״ו חֶשְׁוָן'
1443
1158
  */
1444
- renderGematriya(suppressNikud = false) {
1159
+ renderGematriya(suppressNikud = false, suppressYear = false) {
1445
1160
  const d = this.getDate();
1446
1161
  const locale = suppressNikud ? 'he-x-NoNikud' : 'he';
1447
1162
  const m = Locale.gettext(this.getMonthName(), locale);
1163
+ const prefix = gematriya(d) + ' ' + m;
1164
+ if (suppressYear) {
1165
+ return prefix;
1166
+ }
1448
1167
  const y = this.getFullYear();
1449
- return gematriya(d) + ' ' + m + ' ' + gematriya(y);
1168
+ return prefix + ' ' + gematriya(y);
1450
1169
  }
1451
1170
  /**
1452
1171
  * Returns an `HDate` corresponding to the specified day of week
@@ -1787,109 +1506,390 @@ class HDate {
1787
1506
  }
1788
1507
  return new HDate(day, month, year);
1789
1508
  }
1790
- }
1791
- function standardizeUnits(units) {
1792
- switch (units) {
1793
- case 'd':
1794
- return UNITS_DAY;
1795
- case 'w':
1796
- return UNITS_WEEK;
1797
- case 'M':
1798
- return UNITS_MONTH;
1799
- case 'y':
1800
- return UNITS_YEAR;
1509
+ }
1510
+ function standardizeUnits(units) {
1511
+ switch (units) {
1512
+ case 'd':
1513
+ return UNITS_DAY;
1514
+ case 'w':
1515
+ return UNITS_WEEK;
1516
+ case 'M':
1517
+ return UNITS_MONTH;
1518
+ case 'y':
1519
+ return UNITS_YEAR;
1520
+ }
1521
+ const str = String(units || '')
1522
+ .toLowerCase()
1523
+ .replace(/s$/, '');
1524
+ switch (str) {
1525
+ case UNITS_DAY:
1526
+ case UNITS_WEEK:
1527
+ case UNITS_MONTH:
1528
+ case UNITS_YEAR:
1529
+ return str;
1530
+ }
1531
+ throw new TypeError(`Invalid units '${units}'`);
1532
+ }
1533
+ function getDayOfTranslation(locale) {
1534
+ switch (locale) {
1535
+ case 'en':
1536
+ case 's':
1537
+ case 'a':
1538
+ case 'ashkenazi':
1539
+ return ' of';
1540
+ }
1541
+ const ofStr = Locale.lookupTranslation('of', locale);
1542
+ if (ofStr) {
1543
+ return ' ' + ofStr;
1544
+ }
1545
+ if (locale.startsWith('ashkenazi')) {
1546
+ return ' of';
1547
+ }
1548
+ return '';
1549
+ }
1550
+ /**
1551
+ * Sets the day of the month of the date. Returns the object it was called upon
1552
+ * @private
1553
+ * @param month A number, or Hebrew month name string
1554
+ */
1555
+ function setMonth(hd, month) {
1556
+ hd.mm = HDate.monthNum(month);
1557
+ fix(hd);
1558
+ return hd;
1559
+ }
1560
+ function setDate(hd, date) {
1561
+ hd.dd = date;
1562
+ fix(hd);
1563
+ return hd;
1564
+ }
1565
+ function fix(hd) {
1566
+ fixMonth(hd);
1567
+ fixDate(hd);
1568
+ }
1569
+ function fixDate(hd) {
1570
+ if (hd.dd < 1) {
1571
+ if (hd.mm === months.TISHREI) {
1572
+ hd.yy -= 1;
1573
+ }
1574
+ hd.dd += daysInMonth(hd.mm, hd.yy);
1575
+ hd.mm -= 1;
1576
+ fix(hd);
1577
+ }
1578
+ if (hd.dd > daysInMonth(hd.mm, hd.yy)) {
1579
+ if (hd.mm === months.ELUL) {
1580
+ hd.yy += 1;
1581
+ }
1582
+ hd.dd -= daysInMonth(hd.mm, hd.yy);
1583
+ if (hd.mm === monthsInYear(hd.yy)) {
1584
+ hd.mm = 1; // rollover to NISAN
1585
+ }
1586
+ else {
1587
+ hd.mm += 1;
1588
+ }
1589
+ fix(hd);
1590
+ }
1591
+ fixMonth(hd);
1592
+ }
1593
+ function fixMonth(hd) {
1594
+ if (hd.mm === months.ADAR_II && !hd.isLeapYear()) {
1595
+ hd.mm -= 1; // to Adar I
1596
+ fix(hd);
1597
+ }
1598
+ else if (hd.mm < 1) {
1599
+ hd.mm += monthsInYear(hd.yy);
1600
+ hd.yy -= 1;
1601
+ fix(hd);
1602
+ }
1603
+ else if (hd.mm > monthsInYear(hd.yy)) {
1604
+ hd.mm -= monthsInYear(hd.yy);
1605
+ hd.yy += 1;
1606
+ fix(hd);
1607
+ }
1608
+ delete hd.rd;
1609
+ }
1610
+ function onOrBefore(day, t, offset) {
1611
+ return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
1612
+ }
1613
+
1614
+ function gematriya2(num) {
1615
+ const str = gematriya(num);
1616
+ return str.replaceAll(/[׳״]/g, '');
1617
+ }
1618
+ function formatVerseToHebrew(chapVerse) {
1619
+ if (chapVerse === undefined || chapVerse === null) {
1620
+ return '';
1621
+ }
1622
+ const cv = chapVerse.split(':');
1623
+ const chapter = parseInt(cv[0], 10);
1624
+ const verse = parseInt(cv[1], 10);
1625
+ // if not number return empty string
1626
+ if (isNaN(chapter) || isNaN(verse)) {
1627
+ return chapVerse;
1628
+ }
1629
+ return `${gematriya2(chapter)}:${gematriya2(verse)}`;
1630
+ }
1631
+ /**
1632
+ * Formats an aliyah object like "Numbers 28:9-15"
1633
+ */
1634
+ function formatAliyahShort(aliyah, showBook, language = 'en') {
1635
+ const isEnglish = language === 'en';
1636
+ const begin = isEnglish ? aliyah.b : formatVerseToHebrew(aliyah.b);
1637
+ const end0 = isEnglish ? aliyah.e : formatVerseToHebrew(aliyah.e);
1638
+ const prefix = showBook ? locale.Locale.gettext(aliyah.k, language) + ' ' : '';
1639
+ if (begin === end0) {
1640
+ return `${prefix}${begin}`;
1641
+ }
1642
+ const cv1 = begin.split(':');
1643
+ const cv2 = end0.split(':');
1644
+ const end = cv1[0] === cv2[0] ? cv2[1] : end0;
1645
+ return `${prefix}${begin}-${end}`;
1646
+ }
1647
+
1648
+ const Genesis=[0,31,25,24,26,32,22,24,22,29,32,32,20,18,24,21,16,27,33,38,18,34,24,20,67,34,35,46,22,35,43,54,33,20,31,29,43,36,30,23,23,57,38,34,34,28,34,31,22,33,26];const Exodus=[0,22,25,22,31,23,30,29,28,35,29,10,51,22,31,27,36,16,27,25,23,37,30,33,18,40,37,21,43,46,38,18,35,23,35,35,38,29,31,43,38];const Leviticus=[0,17,16,17,35,26,23,38,36,24,20,47,8,59,57,33,34,16,30,37,27,24,33,44,23,55,46,34];const Numbers=[0,54,34,51,49,31,27,89,26,23,36,35,16,33,45,41,35,28,32,22,29,35,41,30,25,19,65,23,31,39,17,54,42,56,29,34,13];const Deuteronomy=[0,46,37,29,49,30,25,26,20,29,22,32,31,19,29,23,22,20,22,21,20,23,29,26,22,19,19,26,69,28,20,30,52,29,12];const 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];const Judges=[0,36,23,31,24,31,40,25,35,57,18,40,15,25,20,20,31,13,31,30,48,25];const Ruth=[0,22,23,18,22];const 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];const 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];const Lamentations=[0,22,22,66,22,22];const Esther=[0,22,23,15,17,14,14,10,17,32,3];const Ecclesiastes=[0,18,26,22,17,19,12,29,17,18,20,10,14];const 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];const Daniel=[0,21,49,100,34,30,29,28,27,27,21,45,13,64,42];const Hosea=[0,9,25,5,19,15,11,16,14,17,15,11,15,15,10];const Joel=[0,20,27,5,21];const Amos=[0,15,16,15,13,27,14,17,14,15];const Obadiah=[0,21];const Jonah=[0,16,11,10,11];const Micah=[0,16,13,12,14,14,16,20];const Nachum=[0,14,14,19];const Habakkuk=[0,17,20,19];const Zephaniah=[0,18,15,20];const Haggai=[0,15,23];const Zechariah=[0,17,17,10,14,11,15,14,23,17,12,17,14,9,21];const Malachi=[0,14,17,24];var numverses = {Genesis:Genesis,Exodus:Exodus,Leviticus:Leviticus,Numbers:Numbers,Deuteronomy:Deuteronomy,Joshua:Joshua,Judges:Judges,Ruth:Ruth,"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],"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],"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],"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],Isaiah:Isaiah,Jeremiah:Jeremiah,Lamentations:Lamentations,Esther:Esther,Ecclesiastes:Ecclesiastes,"Song of Songs":[0,17,17,11,16,16,12,14,14],Ezekiel:Ezekiel,Daniel:Daniel,Hosea:Hosea,Joel:Joel,Amos:Amos,Obadiah:Obadiah,Jonah:Jonah,Micah:Micah,Nachum:Nachum,Habakkuk:Habakkuk,Zephaniah:Zephaniah,Haggai:Haggai,Zechariah:Zechariah,Malachi:Malachi};
1649
+
1650
+ /**
1651
+ * Names of the books of the Torah.
1652
+ *
1653
+ * `BOOK[1] === 'Genesis'`
1654
+ * @readonly
1655
+ */
1656
+ const BOOK = [
1657
+ '',
1658
+ 'Genesis',
1659
+ 'Exodus',
1660
+ 'Leviticus',
1661
+ 'Numbers',
1662
+ 'Deuteronomy',
1663
+ ];
1664
+ /**
1665
+ * The number of verses in each book of the Tanakh.
1666
+ * Indexed by English transliterated name of book,
1667
+ * and arrays are 1-based.
1668
+ *
1669
+ * There are 51 chapters in Genesis, so
1670
+ * `NUM_VERSES['Genesis'].length === 51`.
1671
+ *
1672
+ * There are 26 verses in Genesis chapter 4,
1673
+ * so `NUM_VERSES['Genesis'][4] === 26`.
1674
+ * @readonly
1675
+ */
1676
+ const NUM_VERSES = numverses;
1677
+ /**
1678
+ * Formats parsha as a string
1679
+ * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
1680
+ */
1681
+ function parshaToString(parsha) {
1682
+ if (typeof parsha === 'string') {
1683
+ return parsha;
1684
+ }
1685
+ else if (!Array.isArray(parsha) ||
1686
+ parsha.length === 0 ||
1687
+ parsha.length > 2) {
1688
+ throw new TypeError(`Bad parsha argument: ${parsha}`);
1689
+ }
1690
+ let s = parsha[0];
1691
+ if (parsha.length === 2) {
1692
+ s += '-' + parsha[1];
1693
+ }
1694
+ return s;
1695
+ }
1696
+ /**
1697
+ * Calculates the number of verses in an aliyah or haftara based on
1698
+ * the `b` (begin verse), `e` (end verse) and `k` (book).
1699
+ * Modifies `aliyah` by setting the `v` field.
1700
+ */
1701
+ function calculateNumVerses(aliyah) {
1702
+ if (aliyah.v) {
1703
+ return aliyah.v;
1704
+ }
1705
+ aliyah.v = subtractVerses(aliyah.k, aliyah.b, aliyah.e) + 1;
1706
+ return aliyah.v;
1707
+ }
1708
+ /**
1709
+ * Finds the number of verses between two locations in the same book.
1710
+ * @param book The English name of the book (e.g. "Numbers")
1711
+ * @param from The starting verse (e.g. "28:9")
1712
+ * @param to The ending verse (e.g. "28:15")
1713
+ * @returns The number of verses between the two locations, excluding the `to` verse.
1714
+ */
1715
+ function subtractVerses(book, from, to) {
1716
+ const chapVerseBegin = from.split(':');
1717
+ const chapVerseEnd = to.split(':');
1718
+ const c1 = parseInt(chapVerseBegin[0], 10);
1719
+ const c2 = parseInt(chapVerseEnd[0], 10);
1720
+ const v1 = parseInt(chapVerseBegin[1], 10);
1721
+ const v2 = parseInt(chapVerseEnd[1], 10);
1722
+ let result = 0;
1723
+ if (c1 === c2) {
1724
+ return v2 - v1;
1725
+ }
1726
+ const numv = NUM_VERSES[book];
1727
+ if (typeof numv !== 'object' || !numv.length) {
1728
+ throw new ReferenceError(`Can't find numverses for ${book}`);
1729
+ }
1730
+ let total = numv[c1] - v1;
1731
+ for (let chap = c1 + 1; chap < c2; chap++) {
1732
+ total += numv[chap];
1733
+ }
1734
+ total += v2;
1735
+ result = total;
1736
+ return result;
1737
+ }
1738
+ /**
1739
+ * Calculates the next verse after adding a number of verses to a given location.
1740
+ * @param book The English name of the book (e.g. "Numbers")
1741
+ * @param from The starting verse (e.g. "28:9")
1742
+ * @param numVerses The number of verses to add; must be nonnegative.
1743
+ * @returns The next verse after adding the specified number of verses,
1744
+ * or null if the resulting verse exceeds the number of verses
1745
+ * in the book.
1746
+ */
1747
+ function addVerses(book, from, numVerses) {
1748
+ const chapVerseBegin = from.split(':');
1749
+ const c1 = parseInt(chapVerseBegin[0], 10);
1750
+ const v1 = parseInt(chapVerseBegin[1], 10);
1751
+ const numv = NUM_VERSES[book];
1752
+ if (typeof numv !== 'object' || !numv.length) {
1753
+ throw new ReferenceError(`Can't find numverses for ${book}`);
1754
+ }
1755
+ let total = v1 + numVerses;
1756
+ let c2 = c1;
1757
+ while (total > numv[c2]) {
1758
+ total -= numv[c2];
1759
+ c2++;
1760
+ if (!numv[c2])
1761
+ return null;
1801
1762
  }
1802
- const str = String(units || '')
1803
- .toLowerCase()
1804
- .replace(/s$/, '');
1805
- switch (str) {
1806
- case UNITS_DAY:
1807
- case UNITS_WEEK:
1808
- case UNITS_MONTH:
1809
- case UNITS_YEAR:
1810
- return str;
1763
+ return `${c2}:${total}`;
1764
+ }
1765
+ /**
1766
+ * Formats an aliyah object like "Numbers 28:9-28:15"
1767
+ */
1768
+ function formatAliyahWithBook(a) {
1769
+ return `${a.k} ${a.b}-${a.e}`;
1770
+ }
1771
+
1772
+ const Shavuot={note:"Israel only",il:true,megillah:"Ruth",haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}};const Purim={megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}};var festivals0 = {"Pesach I":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:36"},"4":{p:15,k:2,b:"12:37",e:"12:42"},"5":{p:15,k:2,b:"12:43",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach I (on Shabbat)":{haft:[{k:"Joshua",b:"3:5",e:"3:7"},{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],seph:[{k:"Joshua",b:"5:2",e:"6:1"},{k:"Joshua",b:"6:27",e:"6:27"}],fullkriyah:{"1":{p:15,k:2,b:"12:21",e:"12:24"},"2":{p:15,k:2,b:"12:25",e:"12:28"},"3":{p:15,k:2,b:"12:29",e:"12:32"},"4":{p:15,k:2,b:"12:33",e:"12:36"},"5":{p:15,k:2,b:"12:37",e:"12:42"},"6":{p:15,k:2,b:"12:43",e:"12:47"},"7":{p:15,k:2,b:"12:48",e:"12:51"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II":{haft:[{k:"II Kings",b:"23:1",e:"23:9"},{k:"II Kings",b:"23:21",e:"23:25"}],fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"28:16",e:"28:25"}}},"Pesach II (CH''M)":{note:"Israel only - according to Vaani T'fillati Siddur Yisraeli",il:true,fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:8"},"2":{p:31,k:3,b:"23:9",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:44"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 1":{fullkriyah:{"1":{p:15,k:2,b:"13:1",e:"13:4"},"2":{p:15,k:2,b:"13:5",e:"13:10"},"3":{p:15,k:2,b:"13:11",e:"13:16"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 2":{fullkriyah:{"1":{p:18,k:2,b:"22:24",e:"22:26"},"2":{p:18,k:2,b:"22:27",e:"23:5"},"3":{p:18,k:2,b:"23:6",e:"23:19"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 3":{fullkriyah:{"1":{p:21,k:2,b:"34:1",e:"34:10"},"2":{p:21,k:2,b:"34:11",e:"34:17"},"3":{p:21,k:2,b:"34:18",e:"34:26"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Chol ha-Moed Day 4":{fullkriyah:{"1":{p:36,k:4,b:"9:1",e:"9:5"},"2":{p:36,k:4,b:"9:6",e:"9:8"},"3":{p:36,k:4,b:"9:9",e:"9:14"},"4":{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach Shabbat Chol ha-Moed":{megillah:"Song of Songs",haft:{k:"Ezekiel",b:"37:1",e:"37:14"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII":{haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:22"},"2":{p:16,k:2,b:"14:1",e:"14:8"},"3":{p:16,k:2,b:"14:9",e:"14:14"},"4":{p:16,k:2,b:"14:15",e:"14:25"},"5":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"II Samuel",b:"22:1",e:"22:51"},fullkriyah:{"1":{p:16,k:2,b:"13:17",e:"13:19"},"2":{p:16,k:2,b:"13:20",e:"13:22"},"3":{p:16,k:2,b:"14:1",e:"14:4"},"4":{p:16,k:2,b:"14:5",e:"14:8"},"5":{p:16,k:2,b:"14:9",e:"14:14"},"6":{p:16,k:2,b:"14:15",e:"14:25"},"7":{p:16,k:2,b:"14:26",e:"15:26"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII":{haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach VIII (on Shabbat)":{megillah:"Song of Songs",haft:{k:"Isaiah",b:"10:32",e:"12:6"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:19",e:"28:25"}}},"Pesach III (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 1"},"Pesach IV (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 2"},"Pesach V (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 3"},"Pesach VI (CH''M)":{alias:true,il:true,key:"Pesach Chol ha-Moed Day 4"},"Pesach Chol ha-Moed Day 2 on Sunday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 1"},"Pesach Chol ha-Moed Day 3 on Monday":{alias:true,il:false,key:"Pesach Chol ha-Moed Day 2"},Shavuot:Shavuot,"Shavuot I":{haft:[{k:"Ezekiel",b:"1:1",e:"1:28"},{k:"Ezekiel",b:"3:12",e:"3:12"}],fullkriyah:{"1":{p:17,k:2,b:"19:1",e:"19:6"},"2":{p:17,k:2,b:"19:7",e:"19:13"},"3":{p:17,k:2,b:"19:14",e:"19:19"},"4":{p:17,k:2,b:"19:20",e:"20:14"},"5":{p:17,k:2,b:"20:15",e:"20:23"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"15:19",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Shavuot II (on Shabbat)":{megillah:"Ruth",haft:{k:"Habakkuk",b:"3:1",e:"3:19"},seph:{k:"Habakkuk",b:"2:20",e:"3:19"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"28:26",e:"28:31"}}},"Fast Day (Morning)":{fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},"3":{p:21,k:2,b:"34:4",e:"34:10"}}},"Fast Day (Afternoon)":{haft:{k:"Isaiah",b:"55:6",e:"56:8"},fullkriyah:{"1":{p:21,k:2,b:"32:11",e:"32:14"},"2":{p:21,k:2,b:"34:1",e:"34:3"},M:{p:21,k:2,b:"34:4",e:"34:10"}}},"Asara B'Tevet":{alias:true,key:"Fast Day (Morning)"},"Ta'anit Esther":{alias:true,key:"Fast Day (Morning)"},"Tzom Gedaliah":{alias:true,key:"Fast Day (Morning)"},"Tzom Tammuz":{alias:true,key:"Fast Day (Morning)"},"Asara B'Tevet (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Ta'anit Esther (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Gedaliah (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Tzom Tammuz (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Erev Tish'a B'Av":{megillah:"Lamentations"},"Tish'a B'Av":{haft:{k:"Jeremiah",b:"8:13",e:"9:23"},fullkriyah:{"1":{p:45,k:5,b:"4:25",e:"4:29"},"2":{p:45,k:5,b:"4:30",e:"4:35"},"3":{p:45,k:5,b:"4:36",e:"4:40"}},megillah:"Lamentations"},"Tish'a B'Av (Mincha)":{alias:true,key:"Fast Day (Afternoon)"},"Rosh Hashana I":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:12"},"3":{p:4,k:1,b:"21:13",e:"21:21"},"4":{p:4,k:1,b:"21:22",e:"21:27"},"5":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana I (on Shabbat)":{haft:{k:"I Samuel",b:"1:1",e:"2:10"},fullkriyah:{"1":{p:4,k:1,b:"21:1",e:"21:4"},"2":{p:4,k:1,b:"21:5",e:"21:8"},"3":{p:4,k:1,b:"21:9",e:"21:12"},"4":{p:4,k:1,b:"21:13",e:"21:17"},"5":{p:4,k:1,b:"21:18",e:"21:21"},"6":{p:4,k:1,b:"21:22",e:"21:27"},"7":{p:4,k:1,b:"21:28",e:"21:34"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Rosh Hashana II":{haft:{k:"Jeremiah",b:"31:2",e:"31:20",note:"labeled 31:1–19 in some books"},fullkriyah:{"1":{p:4,k:1,b:"22:1",e:"22:3"},"2":{p:4,k:1,b:"22:4",e:"22:8"},"3":{p:4,k:1,b:"22:9",e:"22:14"},"4":{p:4,k:1,b:"22:15",e:"22:19"},"5":{p:4,k:1,b:"22:20",e:"22:24"},M:{p:41,k:4,b:"29:1",e:"29:6"}}},"Yom Kippur":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:6"},"2":{p:29,k:3,b:"16:7",e:"16:11"},"3":{p:29,k:3,b:"16:12",e:"16:17"},"4":{p:29,k:3,b:"16:18",e:"16:24"},"5":{p:29,k:3,b:"16:25",e:"16:30"},"6":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (on Shabbat)":{haft:{k:"Isaiah",b:"57:14",e:"58:14"},fullkriyah:{"1":{p:29,k:3,b:"16:1",e:"16:3"},"2":{p:29,k:3,b:"16:4",e:"16:6"},"3":{p:29,k:3,b:"16:7",e:"16:11"},"4":{p:29,k:3,b:"16:12",e:"16:17"},"5":{p:29,k:3,b:"16:18",e:"16:24"},"6":{p:29,k:3,b:"16:25",e:"16:30"},"7":{p:29,k:3,b:"16:31",e:"16:34"},M:{p:41,k:4,b:"29:7",e:"29:11"}}},"Yom Kippur (Mincha)":{alias:true,key:"Yom Kippur (Mincha, Traditional)"},"Yom Kippur (Mincha, Traditional)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:29,k:3,b:"18:1",e:"18:5"},"2":{p:29,k:3,b:"18:6",e:"18:21"},M:{p:29,k:3,b:"18:22",e:"18:30"}}},"Yom Kippur (Mincha, Alternate)":{haft:[{k:"Jonah",b:"1:1",e:"4:11"},{k:"Micah",b:"7:18",e:"7:20"}],fullkriyah:{"1":{p:30,k:3,b:"19:1",e:"19:4"},"2":{p:30,k:3,b:"19:5",e:"19:10"},M:{p:30,k:3,b:"19:11",e:"19:18"}}},"Sukkot I":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot I (on Shabbat)":{haft:{k:"Zechariah",b:"14:1",e:"14:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"22:33"},"2":{p:31,k:3,b:"23:1",e:"23:3"},"3":{p:31,k:3,b:"23:4",e:"23:8"},"4":{p:31,k:3,b:"23:9",e:"23:14"},"5":{p:31,k:3,b:"23:15",e:"23:22"},"6":{p:31,k:3,b:"23:23",e:"23:32"},"7":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot II":{haft:{k:"I Kings",b:"8:2",e:"8:21"},fullkriyah:{"1":{p:31,k:3,b:"22:26",e:"23:3"},"2":{p:31,k:3,b:"23:4",e:"23:14"},"3":{p:31,k:3,b:"23:15",e:"23:22"},"4":{p:31,k:3,b:"23:23",e:"23:32"},"5":{p:31,k:3,b:"23:33",e:"23:44"},M:{p:41,k:4,b:"29:12",e:"29:16"}}},"Sukkot Chol ha-Moed Day 1":{fullkriyah:{"1":{p:41,k:4,b:"29:17",e:"29:19"},"2":{p:41,k:4,b:"29:20",e:"29:22"},"3":{p:41,k:4,b:"29:23",e:"29:25"},"4":{p:41,k:4,b:"29:17",e:"29:22"}}},"Sukkot Chol ha-Moed Day 2":{fullkriyah:{"1":{p:41,k:4,b:"29:20",e:"29:22"},"2":{p:41,k:4,b:"29:23",e:"29:25"},"3":{p:41,k:4,b:"29:26",e:"29:28"},"4":{p:41,k:4,b:"29:20",e:"29:25"}}},"Sukkot Chol ha-Moed Day 3":{fullkriyah:{"1":{p:41,k:4,b:"29:23",e:"29:25"},"2":{p:41,k:4,b:"29:26",e:"29:28"},"3":{p:41,k:4,b:"29:29",e:"29:31"},"4":{p:41,k:4,b:"29:23",e:"29:28"}}},"Sukkot Chol ha-Moed Day 4":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:26",e:"29:31"}}},"Sukkot Chol ha-Moed Day 5":{fullkriyah:{"1":{p:41,k:4,b:"29:29",e:"29:31"},"2":{p:41,k:4,b:"29:32",e:"29:34"},"3":{p:41,k:4,b:"29:35",e:"29:37"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Shabbat Chol ha-Moed":{megillah:"Ecclesiastes",haft:{k:"Ezekiel",b:"38:18",e:"39:16"},fullkriyah:{"1":{p:21,k:2,b:"33:12",e:"33:16"},"2":{p:21,k:2,b:"33:17",e:"33:19"},"3":{p:21,k:2,b:"33:20",e:"33:23"},"4":{p:21,k:2,b:"34:1",e:"34:3"},"5":{p:21,k:2,b:"34:4",e:"34:10"},"6":{p:21,k:2,b:"34:11",e:"34:17"},"7":{p:21,k:2,b:"34:18",e:"34:26"},"M-day1":{p:41,k:4,b:"29:17",e:"29:22"},"M-day2":{p:41,k:4,b:"29:20",e:"29:25"},"M-day3":{p:41,k:4,b:"29:23",e:"29:28"},"M-day4":{p:41,k:4,b:"29:26",e:"29:31"},"M-day5":{p:41,k:4,b:"29:29",e:"29:34"}}},"Sukkot Final Day (Hoshana Raba)":{fullkriyah:{"1":{p:41,k:4,b:"29:26",e:"29:28"},"2":{p:41,k:4,b:"29:29",e:"29:31"},"3":{p:41,k:4,b:"29:32",e:"29:34"},"4":{p:41,k:4,b:"29:29",e:"29:34"}}},"Shmini Atzeret":{haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"16:3"},"4":{p:47,k:5,b:"16:4",e:"16:8"},"5":{p:47,k:5,b:"16:9",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}},alt:{"1":{p:47,k:5,b:"14:22",e:"15:23"},"2":{p:47,k:5,b:"16:1",e:"16:3"},"3":{p:47,k:5,b:"16:4",e:"16:8"},"4":{p:47,k:5,b:"16:9",e:"16:12"},"5":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shmini Atzeret (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"I Kings",b:"8:54",e:"8:66"},fullkriyah:{"1":{p:47,k:5,b:"14:22",e:"14:29"},"2":{p:47,k:5,b:"15:1",e:"15:18"},"3":{p:47,k:5,b:"15:19",e:"15:23"},"4":{p:47,k:5,b:"16:1",e:"16:3"},"5":{p:47,k:5,b:"16:4",e:"16:8"},"6":{p:47,k:5,b:"16:9",e:"16:12"},"7":{p:47,k:5,b:"16:13",e:"16:17"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Erev Simchat Torah":{fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"}}},"Simchat Torah":{haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"34:12"},"7":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Simchat Torah (on Shabbat)":{megillah:"Ecclesiastes",haft:{k:"Joshua",b:"1:1",e:"1:18"},fullkriyah:{"1":{p:54,k:5,b:"33:1",e:"33:7"},"2":{p:54,k:5,b:"33:8",e:"33:12"},"3":{p:54,k:5,b:"33:13",e:"33:17"},"4":{p:54,k:5,b:"33:18",e:"33:21"},"5":{p:54,k:5,b:"33:22",e:"33:26"},"6":{p:54,k:5,b:"33:27",e:"33:29"},"7":{p:54,k:5,b:"34:1",e:"34:12"},"8":{p:1,k:1,b:"1:1",e:"2:3"},M:{p:41,k:4,b:"29:35",e:"30:1"}}},"Shabbat Rosh Chodesh Chanukah":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 1":{fullkriyah:{"1":{p:35,k:4,b:"7:1",e:"7:11"},"2":{p:35,k:4,b:"7:12",e:"7:14"},"3":{p:35,k:4,b:"7:15",e:"7:17"}},alt:{"1":{p:35,k:4,b:"7:1",e:"7:3"},"2":{p:35,k:4,b:"7:4",e:"7:11"},"3":{p:35,k:4,b:"7:12",e:"7:17"}}},"Chanukah Day 1 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:1",e:"7:17"}}},"Chanukah Day 2":{fullkriyah:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:24",e:"7:29"}},alt:{"1":{p:35,k:4,b:"7:18",e:"7:20"},"2":{p:35,k:4,b:"7:21",e:"7:23"},"3":{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 2 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:18",e:"7:23"}}},"Chanukah Day 3":{fullkriyah:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:30",e:"7:35"}},alt:{"1":{p:35,k:4,b:"7:24",e:"7:26"},"2":{p:35,k:4,b:"7:27",e:"7:29"},"3":{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 3 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:24",e:"7:29"}}},"Chanukah Day 4":{fullkriyah:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:36",e:"7:41"}},alt:{"1":{p:35,k:4,b:"7:30",e:"7:32"},"2":{p:35,k:4,b:"7:33",e:"7:35"},"3":{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 4 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:30",e:"7:35"}}},"Chanukah Day 5":{fullkriyah:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:42",e:"7:47"}},alt:{"1":{p:35,k:4,b:"7:36",e:"7:38"},"2":{p:35,k:4,b:"7:39",e:"7:41"},"3":{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 5 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:36",e:"7:41"}}},"Chanukah Day 6":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:42",e:"7:47"}}},"Chanukah Day 7":{fullkriyah:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:54",e:"7:59"}},alt:{"1":{p:35,k:4,b:"7:48",e:"7:50"},"2":{p:35,k:4,b:"7:51",e:"7:53"},"3":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Rosh Chodesh)":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:5"},"2":{p:41,k:4,b:"28:6",e:"28:10"},"3":{p:41,k:4,b:"28:11",e:"28:15"},"4":{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 7 (on Shabbat)":{haft:{k:"Zechariah",b:"2:14",e:"4:7"},fullkriyah:{M:{p:35,k:4,b:"7:48",e:"7:53"}}},"Chanukah Day 8":{fullkriyah:{"1":{p:35,k:4,b:"7:54",e:"7:56"},"2":{p:35,k:4,b:"7:57",e:"7:59"},"3":{p:35,k:4,b:"7:60",e:"8:4"}}},"Chanukah Day 8 (on Shabbat)":{haft:{k:"I Kings",b:"7:40",e:"7:50"},fullkriyah:{M:{p:35,k:4,b:"7:54",e:"8:4"}}},"Erev Purim":{megillah:"Esther"},Purim:Purim,"Shushan Purim":{note:"Jerusalem & walled cities only",il:true,megillah:"Esther",fullkriyah:{"1":{p:16,k:2,b:"17:8",e:"17:10"},"2":{p:16,k:2,b:"17:11",e:"17:13"},"3":{p:16,k:2,b:"17:14",e:"17:16"}}},"Shushan Purim (on Shabbat)":{il:true,note:"Jerusalem & walled cities only: special maftir Exodus 17:8-16, same Haftara as Shabbat Zachor"},"Shabbat HaChodesh":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaChodesh (on Rosh Chodesh)":{haft:{k:"Ezekiel",b:"45:16",e:"46:18"},seph:{k:"Ezekiel",b:"45:18",e:"46:15"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:15,k:2,b:"12:1",e:"12:20"}}},"Shabbat HaGadol":{haft:{k:"Malachi",b:"3:4",e:"3:24"}},"Shabbat Parah":{haft:{k:"Ezekiel",b:"36:16",e:"36:38"},seph:{k:"Ezekiel",b:"36:16",e:"36:36"},fullkriyah:{M:{p:39,k:4,b:"19:1",e:"19:22"}}},"Shabbat Shekalim":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shekalim (on Rosh Chodesh)":{haft:{k:"II Kings",b:"12:1",e:"12:17"},seph:{k:"II Kings",b:"11:17",e:"12:17"},fullkriyah:{"7":{p:41,k:4,b:"28:9",e:"28:15"},M:{p:21,k:2,b:"30:11",e:"30:16"}}},"Shabbat Shuva (with Vayeilech)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva (with Ha'azinu)":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Joel",b:"2:15",e:"2:27"}],seph:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"}]},"Shabbat Shuva":{haft:[{k:"Hosea",b:"14:2",e:"14:10"},{k:"Micah",b:"7:18",e:"7:20"},{k:"Joel",b:"2:15",e:"2:27"}]},"Shabbat Zachor":{haft:{k:"I Samuel",b:"15:2",e:"15:34"},seph:{k:"I Samuel",b:"15:1",e:"15:34"},fullkriyah:{M:{p:49,k:5,b:"25:17",e:"25:19"}}},"Pinchas occurring after 17 Tammuz":{haft:{k:"Jeremiah",b:"1:1",e:"2:3"}},"Kedoshim following Special Shabbat":{haft:{k:"Amos",b:"9:7",e:"9:15"},seph:{k:"Ezekiel",b:"20:2",e:"20:20"}},"Masei on Shabbat Rosh Chodesh":{haft:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"3:4",e:"3:4"}],seph:[{k:"Jeremiah",b:"2:4",e:"2:28"},{k:"Jeremiah",b:"4:1",e:"4:2"},{k:"Isaiah",b:"66:1",e:"66:1"},{k:"Isaiah",b:"66:23",e:"66:23"}],fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Matot-Masei on Shabbat Rosh Chodesh":{alias:true,key:"Masei on Shabbat Rosh Chodesh"},"Ki Teitzei with 3rd Haftarah of Consolation":{haft:[{k:"Isaiah",b:"54:1",e:"54:10"},{k:"Isaiah",b:"54:11",e:"55:5"}]},"Rosh Chodesh":{fullkriyah:{"1":{p:41,k:4,b:"28:1",e:"28:3"},"2":{p:41,k:4,b:"28:3",e:"28:5"},"3":{p:41,k:4,b:"28:6",e:"28:10"},"4":{p:41,k:4,b:"28:11",e:"28:15"}}},"Rosh Chodesh Nisan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Iyyar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sivan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tamuz":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Av":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Elul":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Tishrei":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Cheshvan":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Kislev":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Sh'vat":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar I":{alias:true,key:"Rosh Chodesh"},"Rosh Chodesh Adar II":{alias:true,key:"Rosh Chodesh"},"Shabbat Rosh Chodesh":{haft:{k:"Isaiah",b:"66:1",e:"66:24"},fullkriyah:{M:{p:41,k:4,b:"28:9",e:"28:15"}}},"Shabbat Machar Chodesh":{haft:{k:"I Samuel",b:"20:18",e:"20:42"}}};
1773
+
1774
+ const festivals = festivals0;
1775
+ /**
1776
+ * Is there a special festival Torah Reading for `holiday`?
1777
+ */
1778
+ function hasFestival(holiday) {
1779
+ return typeof festivals[holiday] === 'object';
1780
+ }
1781
+ function aliyotBookNumToStr(aliyot) {
1782
+ if (aliyot) {
1783
+ for (const aliyah of Object.values(aliyot)) {
1784
+ if (typeof aliyah.k === 'number') {
1785
+ aliyah.k = BOOK[aliyah.k];
1786
+ }
1787
+ }
1811
1788
  }
1812
- throw new TypeError(`Invalid units '${units}'`);
1813
1789
  }
1814
- function getDayOfTranslation(locale) {
1815
- switch (locale) {
1816
- case 'en':
1817
- case 's':
1818
- case 'a':
1819
- case 'ashkenazi':
1820
- return ' of';
1790
+ /**
1791
+ * Returns the raw metadata for festival reading for `holiday`
1792
+ */
1793
+ function lookupFestival(holiday) {
1794
+ let src = festivals[holiday];
1795
+ if (!src) {
1796
+ return undefined;
1821
1797
  }
1822
- const ofStr = Locale.lookupTranslation('of', locale);
1823
- if (ofStr) {
1824
- return ' ' + ofStr;
1798
+ if (src.alias) {
1799
+ const tmp = festivals[src.key];
1800
+ if (!tmp) {
1801
+ throw new Error(`Leyning alias ${holiday} => ${src.key} not found`);
1802
+ }
1803
+ src = tmp;
1825
1804
  }
1826
- if (locale.startsWith('ashkenazi')) {
1827
- return ' of';
1805
+ const result = src.fullkriyah
1806
+ ? structuredClone(src)
1807
+ : src;
1808
+ aliyotBookNumToStr(result.fullkriyah);
1809
+ aliyotBookNumToStr(result.alt);
1810
+ if (src.note) {
1811
+ result.note = src.note;
1828
1812
  }
1829
- return '';
1813
+ return result;
1830
1814
  }
1815
+
1831
1816
  /**
1832
- * Sets the day of the month of the date. Returns the object it was called upon
1833
1817
  * @private
1834
- * @param month A number, or Hebrew month name string
1835
1818
  */
1836
- function setMonth(hd, month) {
1837
- hd.mm = HDate.monthNum(month);
1838
- fix(hd);
1839
- return hd;
1840
- }
1841
- function setDate(hd, date) {
1842
- hd.dd = date;
1843
- fix(hd);
1844
- return hd;
1845
- }
1846
- function fix(hd) {
1847
- fixMonth(hd);
1848
- fixDate(hd);
1819
+ function isChapVerseBefore(a, b) {
1820
+ const cv1 = a.split(':').map(x => +x);
1821
+ const cv2 = b.split(':').map(x => +x);
1822
+ return cv1[0] * 100 + cv1[1] < cv2[0] * 100 + cv2[1];
1849
1823
  }
1850
- function fixDate(hd) {
1851
- if (hd.dd < 1) {
1852
- if (hd.mm === months.TISHREI) {
1853
- hd.yy -= 1;
1854
- }
1855
- hd.dd += daysInMonth(hd.mm, hd.yy);
1856
- hd.mm -= 1;
1857
- fix(hd);
1824
+ /**
1825
+ * Returns a string representation of the leyning parts.
1826
+ * Separate verse ranges read from the same book are separated
1827
+ * by commas, e.g. `Isaiah 6:1-7:6, 9:5-6`.
1828
+ * Verse ranges from different books are separated by semicolons,
1829
+ * e.g. `Genesis 21:1-34; Numbers 29:1-6`.
1830
+ */
1831
+ function makeSummaryFromParts(parts, language = 'en') {
1832
+ if (!Array.isArray(parts)) {
1833
+ parts = [parts];
1858
1834
  }
1859
- if (hd.dd > daysInMonth(hd.mm, hd.yy)) {
1860
- if (hd.mm === months.ELUL) {
1861
- hd.yy += 1;
1862
- }
1863
- hd.dd -= daysInMonth(hd.mm, hd.yy);
1864
- if (hd.mm === monthsInYear(hd.yy)) {
1865
- hd.mm = 1; // rollover to NISAN
1835
+ let prev = parts[0];
1836
+ let summary = formatAliyahShort(prev, true, language);
1837
+ for (let i = 1; i < parts.length; i++) {
1838
+ const part = parts[i];
1839
+ if (part.k === prev.k) {
1840
+ summary += ', ';
1866
1841
  }
1867
1842
  else {
1868
- hd.mm += 1;
1843
+ summary += `; ${locale.Locale.gettext(part.k, language)} `;
1869
1844
  }
1870
- fix(hd);
1845
+ summary += formatAliyahShort(part, false, language);
1846
+ prev = part;
1871
1847
  }
1872
- fixMonth(hd);
1848
+ return summary;
1873
1849
  }
1874
- function fixMonth(hd) {
1875
- if (hd.mm === months.ADAR_II && !hd.isLeapYear()) {
1876
- hd.mm -= 1; // to Adar I
1877
- fix(hd);
1878
- }
1879
- else if (hd.mm < 1) {
1880
- hd.mm += monthsInYear(hd.yy);
1881
- hd.yy -= 1;
1882
- fix(hd);
1883
- }
1884
- else if (hd.mm > monthsInYear(hd.yy)) {
1885
- hd.mm -= monthsInYear(hd.yy);
1886
- hd.yy += 1;
1887
- fix(hd);
1850
+ /**
1851
+ * Summarizes an `AliyotMap` by collapsing all adjacent aliyot.
1852
+ * Finds any non-overlapping parts (e.g. special 7th aliyah or maftir)
1853
+ */
1854
+ function makeLeyningParts(aliyot) {
1855
+ const nums = Object.keys(aliyot).filter(x => {
1856
+ if (x.length === 1) {
1857
+ return true;
1858
+ }
1859
+ const code = x.charCodeAt(0);
1860
+ return code >= 48 && code <= 57;
1861
+ });
1862
+ let start = aliyot[nums[0]];
1863
+ let end = start;
1864
+ const parts = [];
1865
+ for (let i = 0; i < nums.length; i++) {
1866
+ const num = nums[i];
1867
+ const aliyah = aliyot[num];
1868
+ if (i === nums.length - 1 && aliyah.k === end.k && aliyah.e === end.e) {
1869
+ // short-circuit when final aliyah is within the previous (e.g. M inside of 7)
1870
+ continue;
1871
+ }
1872
+ const prevEndChap = +end.e.split(':')[0];
1873
+ const curStartChap = +aliyah.b.split(':')[0];
1874
+ const sameOrNextChap = curStartChap === prevEndChap || curStartChap === prevEndChap + 1;
1875
+ if (i !== 0 &&
1876
+ (aliyah.k !== start.k ||
1877
+ isChapVerseBefore(aliyah.b, start.e) ||
1878
+ !sameOrNextChap)) {
1879
+ parts.push({ k: start.k, b: start.b, e: end.e });
1880
+ start = aliyah;
1881
+ }
1882
+ end = aliyah;
1888
1883
  }
1889
- delete hd.rd;
1884
+ parts.push({ k: start.k, b: start.b, e: end.e });
1885
+ return parts;
1890
1886
  }
1891
- function onOrBefore(day, t, offset) {
1892
- return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
1887
+ /**
1888
+ * Makes a summary of the leyning, like "Genesis 6:9-11:32"
1889
+ */
1890
+ function makeLeyningSummary(aliyot) {
1891
+ const parts = makeLeyningParts(aliyot);
1892
+ return makeSummaryFromParts(parts);
1893
1893
  }
1894
1894
 
1895
1895
  const HOLIDAY_IGNORE_MASK = event.flags.DAF_YOMI |
@@ -1908,7 +1908,8 @@ const HOLIDAY_IGNORE_MASK = event.flags.DAF_YOMI |
1908
1908
  * @returns key to look up in holiday-reading.json
1909
1909
  */
1910
1910
  function getLeyningKeyForEvent(ev, il = false) {
1911
- if (typeof ev.eventTime !== 'undefined') {
1911
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1912
+ if (ev.eventTime !== undefined) {
1912
1913
  return undefined;
1913
1914
  }
1914
1915
  const mask = ev.getFlags();
@@ -1939,6 +1940,7 @@ function getLeyningKeyForEvent(ev, il = false) {
1939
1940
  if (day === 1 && month === months.TISHREI) {
1940
1941
  return isShabbat ? 'Rosh Hashana I (on Shabbat)' : 'Rosh Hashana I';
1941
1942
  }
1943
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1942
1944
  const cholHaMoedDay = ev.cholHaMoedDay;
1943
1945
  if (typeof cholHaMoedDay === 'number') {
1944
1946
  // Sukkot or Pesach
@@ -1958,6 +1960,7 @@ function getLeyningKeyForEvent(ev, il = false) {
1958
1960
  }
1959
1961
  return `${holiday} Chol ha-Moed Day ${cholHaMoedDay}`;
1960
1962
  }
1963
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1961
1964
  const chanukahDay = ev.chanukahDay;
1962
1965
  if (typeof chanukahDay === 'number') {
1963
1966
  if (isShabbat && isRoshChodesh) {
@@ -2027,8 +2030,37 @@ function getLeyningKeyForEvent(ev, il = false) {
2027
2030
  return undefined;
2028
2031
  }
2029
2032
 
2033
+ /**
2034
+ * Makes a deep copy of the src object using JSON stringify and parse
2035
+ * @deprecated Use structuredClone instead
2036
+ */
2037
+ function clone(src) {
2038
+ return structuredClone(src);
2039
+ }
2040
+ function cloneHaftara(haft) {
2041
+ if (!haft) {
2042
+ return haft;
2043
+ }
2044
+ const dest = structuredClone(haft);
2045
+ if (Array.isArray(dest)) {
2046
+ dest.forEach(calculateNumVerses);
2047
+ }
2048
+ else {
2049
+ calculateNumVerses(dest);
2050
+ }
2051
+ return dest;
2052
+ }
2053
+ /**
2054
+ * Returns the total number of verses in an array of Aliyah (or haftarah) objects
2055
+ */
2056
+ function sumVerses(aliyot) {
2057
+ return Array.isArray(aliyot)
2058
+ ? aliyot.reduce((prev, cur) => prev + cur.v, 0)
2059
+ : aliyot.v;
2060
+ }
2061
+
2030
2062
  function aliyotCombine67(aliyot) {
2031
- const a6 = clone(aliyot['6']);
2063
+ const a6 = structuredClone(aliyot['6']);
2032
2064
  const a7 = aliyot['7'];
2033
2065
  if (a6.k !== a7.k) {
2034
2066
  throw new Error('Impossible to combine aliyot 6 & 7: ' + JSON.stringify(aliyot));
@@ -2046,11 +2078,11 @@ function aliyotCombine67(aliyot) {
2046
2078
  function mergeAliyotWithSpecial(aliyot, special) {
2047
2079
  if (special['7']) {
2048
2080
  aliyotCombine67(aliyot);
2049
- aliyot['7'] = clone(special['7']);
2081
+ aliyot['7'] = structuredClone(special['7']);
2050
2082
  calculateNumVerses(aliyot['7']);
2051
2083
  }
2052
2084
  if (special['M']) {
2053
- aliyot['M'] = clone(special['M']);
2085
+ aliyot['M'] = structuredClone(special['M']);
2054
2086
  calculateNumVerses(aliyot['M']);
2055
2087
  }
2056
2088
  }
@@ -2089,7 +2121,7 @@ function specialReadings2(parsha, hd, il, aliyot) {
2089
2121
  }
2090
2122
  }
2091
2123
  if (special.fullkriyah) {
2092
- const aliyotMap = clone(aliyot);
2124
+ const aliyotMap = structuredClone(aliyot);
2093
2125
  mergeAliyotWithSpecial(aliyotMap, special.fullkriyah);
2094
2126
  for (const num of Object.keys(special.fullkriyah)) {
2095
2127
  reason[num] = key;
@@ -2159,18 +2191,120 @@ function specialReadings2(parsha, hd, il, aliyot) {
2159
2191
  return { aliyot, reason, haft, seph };
2160
2192
  }
2161
2193
 
2194
+ /**
2195
+ * Translates an aliyah's book name and verse numbers to the target language.
2196
+ * Modifies the aliyah object in place.
2197
+ * @param aliyah - The aliyah object to translate
2198
+ * @param language - The target language code (e.g., 'he' for Hebrew)
2199
+ * @param translateBook - Whether to translate the book name (default true)
2200
+ */
2201
+ function translateAliyah(aliyah, language) {
2202
+ if (language === 'he') {
2203
+ aliyah.k = locale.Locale.gettext(aliyah.k, language);
2204
+ aliyah.b = formatVerseToHebrew(aliyah.b);
2205
+ aliyah.e = formatVerseToHebrew(aliyah.e);
2206
+ }
2207
+ return aliyah;
2208
+ }
2209
+ /**
2210
+ * Translates aliyah(s) - handles single Aliyah, arrays, and AliyotMap.
2211
+ * For non-English languages, translates book names and converts verse numbers to Hebrew numerals.
2212
+ * Returns a new translated copy, leaving the original unchanged.
2213
+ * @param aliyahOrArray - Single Aliyah, array of Aliyah objects, AliyotMap, or undefined
2214
+ * @param language - The target language code (e.g., 'he' for Hebrew)
2215
+ * @param translateBook - Whether to translate the book name (default true)
2216
+ * @returns Translated copy of the input, or undefined if input was undefined
2217
+ */
2218
+ function translateAliyahOrArray(aliyahOrArray, language = 'en') {
2219
+ // Handle array of Aliyah objects
2220
+ if (Array.isArray(aliyahOrArray)) {
2221
+ const result = aliyahOrArray.map(aliyah => {
2222
+ const copy = Object.assign({}, aliyah);
2223
+ return translateAliyah(copy, language);
2224
+ });
2225
+ return result;
2226
+ }
2227
+ // Handle single Aliyah object (has 'k' or 'b' property)
2228
+ if ('k' in aliyahOrArray || 'b' in aliyahOrArray) {
2229
+ const copy = Object.assign({}, aliyahOrArray);
2230
+ return translateAliyah(copy, language);
2231
+ }
2232
+ // Handle AliyotMap (Record<string, Aliyah>)
2233
+ const result = {};
2234
+ for (const [key, aliyah] of Object.entries(aliyahOrArray)) {
2235
+ const copy = Object.assign({}, aliyah);
2236
+ result[key] = translateAliyah(copy, language);
2237
+ }
2238
+ return result;
2239
+ }
2240
+ /**
2241
+ * Translates a Leyning object to the target language.
2242
+ * @param leyning - The Leyning object to translate
2243
+ * @param language - The target language code (e.g., 'he' for Hebrew)
2244
+ * @returns The translated Leyning object
2245
+ * @example
2246
+ * const leyning: Leyning = {
2247
+ * seph: [{k: 'Genesis', b: '1:1', e: '1:5'}],
2248
+ * haft: [{k: 'Genesis', b: '1:6', e: '1:10'}],
2249
+ * megillah: [{k: 'Genesis', b: '1:11', e: '1:15'}],
2250
+ * fullkriyah: [{k: 'Genesis', b: '1:16', e: '1:20'}],
2251
+ * };
2252
+ * const translatedLeyning = translateLeyning(leyning, 'he');
2253
+ * @todo add reason translation
2254
+ */
2255
+ function translateLeyning(leyning, language) {
2256
+ if (language === 'en') {
2257
+ return leyning;
2258
+ }
2259
+ if (leyning.seph) {
2260
+ leyning.sephardic = makeSummaryFromParts(leyning.seph, language);
2261
+ leyning.seph = translateAliyahOrArray(leyning.seph, language);
2262
+ }
2263
+ if (leyning.haft) {
2264
+ leyning.haftara = makeSummaryFromParts(leyning.haft, language);
2265
+ leyning.haft = translateAliyahOrArray(leyning.haft, language);
2266
+ }
2267
+ if (leyning.megillah) {
2268
+ const parts = makeLeyningParts(leyning.megillah);
2269
+ const megillahSummary = makeSummaryFromParts(parts, language);
2270
+ leyning.megillah = translateAliyahOrArray(leyning.megillah, language);
2271
+ leyning.summary = megillahSummary;
2272
+ }
2273
+ if (leyning.fullkriyah) {
2274
+ const parts = makeLeyningParts(leyning.fullkriyah);
2275
+ // TODO: add check for summary in those cases getLeyningForHolidayKey
2276
+ if (typeof leyning.fullkriyah['1'] === 'object') {
2277
+ leyning.summary = makeSummaryFromParts(parts, language);
2278
+ }
2279
+ leyning.fullkriyah = translateAliyahOrArray(leyning.fullkriyah, language);
2280
+ if (leyning.summaryParts) {
2281
+ leyning.summaryParts = translateAliyahOrArray(leyning.summaryParts, language);
2282
+ leyning.summary = makeSummaryFromParts(leyning.summaryParts, language);
2283
+ }
2284
+ }
2285
+ if (leyning.weekday) {
2286
+ const parts = makeLeyningParts(leyning.weekday);
2287
+ leyning.weekday = translateAliyahOrArray(leyning.weekday, language);
2288
+ leyning.summary = makeSummaryFromParts(parts, language);
2289
+ }
2290
+ return leyning;
2291
+ }
2292
+
2162
2293
  /**
2163
2294
  * Looks up leyning for a given holiday key. Key should be an
2164
2295
  * (untranslated) string used in holiday-readings.json. Returns some
2165
2296
  * of full kriyah aliyot, special Maftir, special Haftarah
2166
2297
  * @param key name from `holiday-readings.json` to find
2298
+ * @param cholHaMoedDay
2299
+ * @param il true if Israel holiday scheme
2300
+ * @param language language for summary (default 'en')
2167
2301
  */
2168
- function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
2302
+ function getLeyningForHolidayKey(key, cholHaMoedDay, il, language = 'en') {
2169
2303
  if (typeof key !== 'string') {
2170
2304
  return undefined;
2171
2305
  }
2172
2306
  const src = lookupFestival(key);
2173
- if (typeof src === 'undefined') {
2307
+ if (!src) {
2174
2308
  return undefined;
2175
2309
  }
2176
2310
  const israelOnly = src.il;
@@ -2187,7 +2321,7 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
2187
2321
  type: 'holiday',
2188
2322
  };
2189
2323
  if (src.fullkriyah) {
2190
- leyning.fullkriyah = clone(src.fullkriyah);
2324
+ leyning.fullkriyah = structuredClone(src.fullkriyah);
2191
2325
  if (key === 'Sukkot Shabbat Chol ha-Moed' && cholHaMoedDay) {
2192
2326
  leyning.fullkriyah['M'] = leyning.fullkriyah[`M-day${cholHaMoedDay}`];
2193
2327
  for (let day = 1; day <= 5; day++) {
@@ -2201,7 +2335,7 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
2201
2335
  }
2202
2336
  Object.values(leyning.fullkriyah).forEach(aliyah => calculateNumVerses(aliyah));
2203
2337
  if (src.alt) {
2204
- leyning.alt = clone(src.alt);
2338
+ leyning.alt = structuredClone(src.alt);
2205
2339
  for (const aliyah of Object.values(leyning.alt)) {
2206
2340
  calculateNumVerses(aliyah);
2207
2341
  }
@@ -2240,20 +2374,23 @@ function getLeyningForHolidayKey(key, cholHaMoedDay, il) {
2240
2374
  if (src.note) {
2241
2375
  leyning.note = src.note;
2242
2376
  }
2243
- return leyning;
2377
+ return translateLeyning(leyning, language);
2244
2378
  }
2245
2379
  /**
2246
2380
  * Looks up leyning for a given holiday. Returns some
2247
2381
  * of full kriyah aliyot, special Maftir, special Haftarah
2248
2382
  * @param ev the Hebcal event associated with this leyning
2249
2383
  * @param [il] true if Israel holiday scheme
2384
+ * @param [language] language for summary (default 'en')
2250
2385
  * @returns map of aliyot
2251
2386
  */
2252
- function getLeyningForHoliday(ev, il = false) {
2387
+ function getLeyningForHoliday(ev, il = false, language = 'en') {
2253
2388
  if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
2254
2389
  throw new TypeError(`Bad event argument: ${JSON.stringify(ev)}`);
2390
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2255
2391
  }
2256
- else if (typeof ev.eventTime !== 'undefined') {
2392
+ else if (ev.eventTime !== undefined) {
2393
+ // Events with eventTime are not supported for leyning lookup
2257
2394
  return undefined;
2258
2395
  }
2259
2396
  else if (ev.getFlags() & event.flags.PARSHA_HASHAVUA) {
@@ -2263,7 +2400,8 @@ function getLeyningForHoliday(ev, il = false) {
2263
2400
  return undefined;
2264
2401
  }
2265
2402
  const key = getLeyningKeyForEvent(ev, il);
2266
- const leyning = getLeyningForHolidayKey(key, ev.cholHaMoedDay, il);
2403
+ const leyning = getLeyningForHolidayKey(key, ev.cholHaMoedDay, // eslint-disable-line @typescript-eslint/no-explicit-any
2404
+ il, language);
2267
2405
  return leyning;
2268
2406
  }
2269
2407
 
@@ -2304,7 +2442,7 @@ function makeLeyningNames(parsha) {
2304
2442
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2305
2443
  * @returns map of aliyot
2306
2444
  */
2307
- function getLeyningForParshaShabbatOnly(parsha) {
2445
+ function getLeyningForParshaShabbatOnly(parsha, language = 'en') {
2308
2446
  const raw = lookupParsha(parsha);
2309
2447
  const fullkriyah = {};
2310
2448
  const book = BOOK[raw.book];
@@ -2346,13 +2484,13 @@ function getLeyningForParshaShabbatOnly(parsha) {
2346
2484
  result.sephardic = makeSummaryFromParts(seph);
2347
2485
  result.sephardicNumV = sumVerses(seph);
2348
2486
  }
2349
- return result;
2487
+ return translateLeyning(result, language);
2350
2488
  }
2351
2489
  /**
2352
2490
  * Looks up Monday/Thursday aliyot for a regular parsha
2353
2491
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2354
2492
  */
2355
- function getWeekdayReading(parsha) {
2493
+ function getWeekdayReading(parsha, language = 'en') {
2356
2494
  const raw = lookupParsha(parsha);
2357
2495
  const parshaMeta = raw.combined ? lookupParsha(raw.p1) : raw;
2358
2496
  const aliyot = parshaMeta.weekday;
@@ -2368,14 +2506,14 @@ function getWeekdayReading(parsha) {
2368
2506
  calculateNumVerses(aliyah);
2369
2507
  weekday[num] = aliyah;
2370
2508
  }
2371
- return weekday;
2509
+ return translateAliyahOrArray(weekday, language);
2372
2510
  }
2373
2511
  /**
2374
2512
  * Looks up regular leyning for a weekly parsha with no special readings
2375
2513
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2376
2514
  */
2377
- function getLeyningForParsha(parsha) {
2378
- const result = getLeyningForParshaShabbatOnly(parsha);
2515
+ function getLeyningForParsha(parsha, language = 'en') {
2516
+ const result = getLeyningForParshaShabbatOnly(parsha, language);
2379
2517
  result.weekday = getWeekdayReading(parsha);
2380
2518
  return result;
2381
2519
  }
@@ -2386,7 +2524,7 @@ function getLeyningForParsha(parsha) {
2386
2524
  * @param [il] in Israel
2387
2525
  * @returns map of aliyot
2388
2526
  */
2389
- function getLeyningForParshaHaShavua(ev, il = false) {
2527
+ function getLeyningForParshaHaShavua(ev, il = false, language = 'en') {
2390
2528
  if (typeof ev !== 'object' || typeof ev.getFlags !== 'function') {
2391
2529
  throw new TypeError(`Bad event argument: ${ev}`);
2392
2530
  }
@@ -2423,30 +2561,35 @@ function getLeyningForParshaHaShavua(ev, il = false) {
2423
2561
  }
2424
2562
  const reasons = Object.keys(reason);
2425
2563
  if (reasons.length !== 0) {
2426
- result.reason = reason;
2564
+ // Translate reason strings to target language if not English
2565
+ const translatedReason = {};
2566
+ for (const [key, val] of Object.entries(reason)) {
2567
+ translatedReason[key] = locale.Locale.gettext(val, language);
2568
+ }
2569
+ result.reason = translatedReason;
2427
2570
  for (const num of reasons) {
2428
2571
  if (num === 'haftara' || num === 'sephardic') {
2429
2572
  const haftObj = result[num === 'haftara' ? 'haft' : 'seph'];
2430
2573
  const hafts = Array.isArray(haftObj) ? haftObj : [haftObj];
2431
2574
  for (const haft of hafts) {
2432
- haft.reason = reason[num];
2575
+ haft.reason = translatedReason[num];
2433
2576
  }
2434
2577
  }
2435
2578
  else {
2436
2579
  const aliyah = result.fullkriyah[num];
2437
2580
  if (typeof aliyah === 'object') {
2438
- aliyah.reason = reason[num];
2581
+ aliyah.reason = translatedReason[num];
2439
2582
  }
2440
2583
  }
2441
2584
  }
2442
2585
  }
2443
- return result;
2586
+ return translateLeyning(result, language);
2444
2587
  }
2445
2588
  /**
2446
2589
  * Returns the parsha metadata
2447
2590
  * @param parsha untranslated name like 'Pinchas' or ['Pinchas'] or ['Matot','Masei']
2448
2591
  */
2449
- function lookupParsha(parsha) {
2592
+ function lookupParsha(parsha, language = 'en') {
2450
2593
  const name = parshaToString(parsha);
2451
2594
  const raw = parshiyotObj[name];
2452
2595
  if (typeof raw !== 'object') {
@@ -2459,12 +2602,16 @@ function lookupParsha(parsha) {
2459
2602
  }
2460
2603
  if (!raw.haft) {
2461
2604
  const haftKey = p1 === 'Nitzavim' ? p1 : p2;
2462
- raw.haft = lookupParsha(haftKey).haft;
2605
+ raw.haft = lookupParsha(haftKey, language).haft;
2463
2606
  }
2464
2607
  }
2465
2608
  else {
2466
2609
  raw.hebrew = locale.Locale.gettext(name, 'he');
2467
2610
  }
2611
+ raw.haft = translateAliyahOrArray(raw.haft, language);
2612
+ if (raw.seph) {
2613
+ raw.seph = translateAliyahOrArray(raw.seph, language);
2614
+ }
2468
2615
  return raw;
2469
2616
  }
2470
2617
 
@@ -2505,7 +2652,7 @@ function findParshaHaShavua(saturday, il) {
2505
2652
  /* NOTREACHED */
2506
2653
  throw new Error(`can't findParshaHaShavua for ${saturday}/${il}`);
2507
2654
  }
2508
- function getLeyningOnDate(hdate, il, wantarray = false) {
2655
+ function getLeyningOnDate(hdate, il, wantarray = false, language = 'en') {
2509
2656
  const dow = hdate.getDay();
2510
2657
  const arr = [];
2511
2658
  let hasParshaHaShavua = false;
@@ -2515,7 +2662,7 @@ function getLeyningOnDate(hdate, il, wantarray = false) {
2515
2662
  const parsha = sedra$1.lookup(hdate);
2516
2663
  if (!parsha.chag) {
2517
2664
  const parshaEvent = new ParshaEvent.ParshaEvent(parsha);
2518
- const reading = getLeyningForParshaHaShavua(parshaEvent, il);
2665
+ const reading = getLeyningForParshaHaShavua(parshaEvent, il, language);
2519
2666
  if (wantarray) {
2520
2667
  hasParshaHaShavua = true;
2521
2668
  arr.push(reading);
@@ -2573,7 +2720,14 @@ function getLeyningOnDate(hdate, il, wantarray = false) {
2573
2720
  };
2574
2721
  arr.unshift(reading);
2575
2722
  }
2576
- return wantarray ? arr : arr[0];
2723
+ // call translateLeyning on arr or arr[0]
2724
+ if (arr.length === 0) {
2725
+ return wantarray ? arr : arr[0];
2726
+ }
2727
+ if (wantarray) {
2728
+ return arr.map(reading => translateLeyning(reading, language));
2729
+ }
2730
+ return translateLeyning(arr[0], language);
2577
2731
  }
2578
2732
  const minchaSuffix = ' (Mincha)';
2579
2733
  function getMincha(ev, il) {