@hebcal/rest-api 6.3.0 → 6.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -1,11 +1,7 @@
1
- /*! @hebcal/rest-api v6.3.0 */
2
- var hebcal__rest_api = (function (exports, event, reformatTimeStr, hdate, leyning, getLeyningForHoliday, sedra, zmanim, pkgVersion, locale, common) {
1
+ /*! @hebcal/rest-api v6.4.1 */
2
+ var hebcal__rest_api = (function (exports, event, reformatTimeStr, hdate, leyning, getLeyningForHoliday, sedra, zmanim, pkgVersion, locale, common, summary) {
3
3
  'use strict';
4
4
 
5
- const AD="Andorra";const AE="United Arab Emirates";const AF="Afghanistan";const AI="Anguilla";const AL="Albania";const AM="Armenia";const AO="Angola";const AR="Argentina";const AS="American Samoa";const AT="Austria";const AU="Australia";const AW="Aruba";const AZ="Azerbaijan";const BA="Bosnia and Herzegovina";const BB="Barbados";const BD="Bangladesh";const BE="Belgium";const BF="Burkina Faso";const BG="Bulgaria";const BH="Bahrain";const BI="Burundi";const BJ="Benin";const BM="Bermuda";const BN="Brunei";const BO="Bolivia";const BR="Brazil";const BS="Bahamas";const BT="Bhutan";const BW="Botswana";const BY="Belarus";const BZ="Belize";const CA="Canada";const CD="Democratic Republic of the Congo";const CF="Central African Republic";const CG="Republic of the Congo";const CH="Switzerland";const CI="Ivory Coast";const CK="Cook Islands";const CL="Chile";const CM="Cameroon";const CN="China";const CO="Colombia";const CR="Costa Rica";const CU="Cuba";const CV="Cape Verde";const CW="Curacao";const CY="Cyprus";const CZ="Czech Republic";const DE="Germany";const DK="Denmark";const DM="Dominica";const DO="Dominican Republic";const DZ="Algeria";const EC="Ecuador";const EE="Estonia";const EG="Egypt";const ER="Eritrea";const ES="Spain";const ET="Ethiopia";const FI="Finland";const FJ="Fiji";const FK="Falkland Islands";const FO="Faroe Islands";const FR="France";const GA="Gabon";const GB="United Kingdom";const GE="Georgia";const GH="Ghana";const GI="Gibraltar";const GL="Greenland";const GM="Gambia";const GN="Guinea";const GQ="Equatorial Guinea";const GR="Greece";const GT="Guatemala";const GW="Guinea-Bissau";const GY="Guyana";const HK="Hong Kong";const HN="Honduras";const HR="Croatia";const HT="Haiti";const HU="Hungary";const ID="Indonesia";const IE="Ireland";const IL="Israel";const IM="Isle of Man";const IN="India";const IQ="Iraq";const IR="Iran";const IS="Iceland";const IT="Italy";const JM="Jamaica";const JO="Jordan";const JP="Japan";const KE="Kenya";const KG="Kyrgyzstan";const KH="Cambodia";const KM="Comoros";const KN="Saint Kitts and Nevis";const KP="North Korea";const KR="South Korea";const KW="Kuwait";const KY="Cayman Islands";const KZ="Kazakhstan";const LA="Laos";const LB="Lebanon";const LC="Saint Lucia";const LI="Liechtenstein";const LR="Liberia";const LS="Lesotho";const LT="Lithuania";const LU="Luxembourg";const LV="Latvia";const LY="Libya";const MA="Morocco";const MD="Moldova";const ME="Montenegro";const MG="Madagascar";const MK="Macedonia";const ML="Mali";const MM="Myanmar";const MN="Mongolia";const MP="Northern Mariana Islands";const MR="Mauritania";const MS="Montserrat";const MT="Malta";const MU="Mauritius";const MW="Malawi";const MX="Mexico";const MY="Malaysia";const MZ="Mozambique";const NA="Namibia";const NC="New Caledonia";const NE="Niger";const NG="Nigeria";const NI="Nicaragua";const NL="Netherlands";const NO="Norway";const NP="Nepal";const NU="Niue";const NZ="New Zealand";const OM="Oman";const PA="Panama";const PE="Peru";const PF="French Polynesia";const PG="Papua New Guinea";const PH="Philippines";const PK="Pakistan";const PL="Poland";const PR="Puerto Rico";const PT="Portugal";const PY="Paraguay";const QA="Qatar";const RO="Romania";const RS="Serbia";const RU="Russia";const RW="Rwanda";const SA="Saudi Arabia";const SB="Solomon Islands";const SC="Seychelles";const SD="Sudan";const SE="Sweden";const SG="Singapore";const SH="Saint Helena";const SI="Slovenia";const SK="Slovakia";const SL="Sierra Leone";const SN="Senegal";const SO="Somalia";const SR="Suriname";const ST="Sao Tome and Principe";const SV="El Salvador";const SY="Syria";const SZ="Swaziland";const TC="Turks and Caicos Islands";const TD="Chad";const TG="Togo";const TH="Thailand";const TJ="Tajikistan";const TM="Turkmenistan";const TN="Tunisia";const TR="Turkey";const TV="Tuvalu";const TW="Taiwan";const TZ="Tanzania";const UA="Ukraine";const UG="Uganda";const US="United States";const UY="Uruguay";const UZ="Uzbekistan";const VC="Saint Vincent and the Grenadines";const VE="Venezuela";const VG="British Virgin Islands";const VN="Vietnam";const WS="Samoa";const YE="Yemen";const YT="Mayotte";const ZA="South Africa";const ZM="Zambia";const ZW="Zimbabwe";var countryNames0 = {AD:AD,AE:AE,AF:AF,AI:AI,AL:AL,AM:AM,AO:AO,AR:AR,AS:AS,AT:AT,AU:AU,AW:AW,AZ:AZ,BA:BA,BB:BB,BD:BD,BE:BE,BF:BF,BG:BG,BH:BH,BI:BI,BJ:BJ,BM:BM,BN:BN,BO:BO,BR:BR,BS:BS,BT:BT,BW:BW,BY:BY,BZ:BZ,CA:CA,CD:CD,CF:CF,CG:CG,CH:CH,CI:CI,CK:CK,CL:CL,CM:CM,CN:CN,CO:CO,CR:CR,CU:CU,CV:CV,CW:CW,CY:CY,CZ:CZ,DE:DE,DK:DK,DM:DM,DO:DO,DZ:DZ,EC:EC,EE:EE,EG:EG,ER:ER,ES:ES,ET:ET,FI:FI,FJ:FJ,FK:FK,FO:FO,FR:FR,GA:GA,GB:GB,GE:GE,GH:GH,GI:GI,GL:GL,GM:GM,GN:GN,GQ:GQ,GR:GR,GT:GT,GW:GW,GY:GY,HK:HK,HN:HN,HR:HR,HT:HT,HU:HU,ID:ID,IE:IE,IL:IL,IM:IM,IN:IN,IQ:IQ,IR:IR,IS:IS,IT:IT,JM:JM,JO:JO,JP:JP,KE:KE,KG:KG,KH:KH,KM:KM,KN:KN,KP:KP,KR:KR,KW:KW,KY:KY,KZ:KZ,LA:LA,LB:LB,LC:LC,LI:LI,LR:LR,LS:LS,LT:LT,LU:LU,LV:LV,LY:LY,MA:MA,MD:MD,ME:ME,MG:MG,MK:MK,ML:ML,MM:MM,MN:MN,MP:MP,MR:MR,MS:MS,MT:MT,MU:MU,MW:MW,MX:MX,MY:MY,MZ:MZ,NA:NA,NC:NC,NE:NE,NG:NG,NI:NI,NL:NL,NO:NO,NP:NP,NU:NU,NZ:NZ,OM:OM,PA:PA,PE:PE,PF:PF,PG:PG,PH:PH,PK:PK,PL:PL,PR:PR,PT:PT,PY:PY,QA:QA,RO:RO,RS:RS,RU:RU,RW:RW,SA:SA,SB:SB,SC:SC,SD:SD,SE:SE,SG:SG,SH:SH,SI:SI,SK:SK,SL:SL,SN:SN,SO:SO,SR:SR,ST:ST,SV:SV,SY:SY,SZ:SZ,TC:TC,TD:TD,TG:TG,TH:TH,TJ:TJ,TM:TM,TN:TN,TR:TR,TV:TV,TW:TW,TZ:TZ,UA:UA,UG:UG,US:US,UY:UY,UZ:UZ,VC:VC,VE:VE,VG:VG,VN:VN,WS:WS,YE:YE,YT:YT,ZA:ZA,ZM:ZM,ZW:ZW};
6
-
7
- const Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights, the eight-day festival is observed by lighting the candles of a hanukkiah (menorah)";const Pesach="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";const Purim="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";const Shavuot="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";const Sigd="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";const Sukkot="Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)";var holidayDescription0 = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem","Ben-Gurion Day":"Commemorates the life and vision of Israel’s first Prime Minister David Ben-Gurion","Birkat Hachamah":"A rare Jewish blessing recited once every 28 years thanking G-d for creating the sun","Chag HaBanot":"North African Chanukah festival of daughters. Called Eid al-Banat in Arabic, the holiday was most preserved in Tunisia",Chanukah:Chanukah,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot. Also called Sefirat HaOmer, it is a practice that consists of a verbal counting of each of the forty-nine days between the two holidays","Erev Yom Kippur":"Evening of Yom Kippur (Day of Atonement), which includes the Kol Nidre service. The Yom Kippur fast begins at sundown and continues for 25 hours","Family Day":"Yom HaMishpacha, a day to honor the family unit","Hebrew Language Day":"Promotes the Hebrew language in Israel and around the world. Occurs on the birthday of Eliezer Ben Yehuda, the father of modern spoken Hebrew","Herzl Day":"Commemorates the life and vision of Zionist leader Theodor Herzl","Jabotinsky Day":"Commemorates the life and vision of Zionist leader Ze’ev Jabotinsky","Lag BaOmer":"33rd day of counting the Omer. The holiday is a temporary break from the semi-mourning period the counting of the Omer. Practices include lighting bonfires, getting haircuts, and Jewish weddings","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim,"Purim Meshulash":"Triple Purim, spanning 3 days in Jerusalem and walled cities. It occurs when the 15th of Adar coincides with Shabbat","Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 7th month of the civil Hebrew year (8th on leap years) and the 1st month of the biblical Hebrew year. It has 30 days and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָּיר (transliterated Iyyar or Iyar) is the 8th month of the civil Hebrew year (9th on leap years) and the 2nd month of the biblical Hebrew year. It has 29 days and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 9th month of the civil Hebrew year (10th on leap years) and the 3rd month of the biblical Hebrew year. It has 30 days and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tammuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 10th month of the civil Hebrew year (11th on leap years) and the 4th month of the biblical Hebrew year. It has 29 days and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 11th month of the civil Hebrew year (12th on leap years) and the 5th month of the biblical Hebrew year. It has 30 days and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 12th month of the civil Hebrew year (13th on leap years) and the 6th month of the biblical Hebrew year. It has 29 days and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 2nd month of the civil Hebrew year and the 8th month of the biblical Hebrew year. It has 29 or 30 days and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 3rd month of the civil Hebrew year and the 9th month of the biblical Hebrew year. It has 30 or 29 days and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 4th month of the civil Hebrew year and the 10th month of the biblical Hebrew year. It has 29 days and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh’vat on the Hebrew calendar. שְׁבָט (transliterated Sh’vat or Shevat) is the 5th month of the civil Hebrew year and the 11th month of the biblical Hebrew year. It has 30 days and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אֲדָר) is the 6th month of the civil Hebrew year and the 12th month of the biblical Hebrew year. It has 29 days and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אֲדָר א׳) is the 6th month of the civil Hebrew year and the 12th month of the biblical Hebrew year. It has 30 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אֲדָר ב׳), sometimes “Adar Bet” or “Adar Sheni”, is the 7th month of the civil Hebrew year and the 13th month of the Hebrew year. It has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat of Prophecy/Shabbat of Vision. Shabbat before Tish’a B’Av","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan. Read in preparation for Passover","Shabbat HaGadol":"Shabbat before Pesach (The Great Shabbat)","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Mevarchim Chodesh":"Shabbat that precedes Rosh Chodesh. The congregation blesses the forthcoming new month","Shabbat Nachamu":"Shabbat after Tish’a B’Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (“Comfort, oh comfort my people”)","Shabbat Parah":"Shabbat of the Red Heifer. Shabbat before Shabbat HaChodesh, in preparation for Passover","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar. Read in preparation for Purim","Shabbat Shirah":"Shabbat of Song. Shabbat that includes Parashat Beshalach","Shabbat Shuva":"Shabbat of Returning. Shabbat that occurs during the Ten Days of Repentance between Rosh Hashanah and Yom Kippur","Shabbat Zachor":"Shabbat of Remembrance. Shabbat before Purim",Shavuot:Shavuot,"Shmini Atzeret":"Eighth Day of Assembly. Immediately following Sukkot, it is observed as a separate holiday in the Diaspora and is combined with Simchat Torah in Israel","Shushan Purim":"Purim celebrated in Jerusalem and walled cities","Shushan Purim Katan":"Minor Purim celebration during Adar I on leap years in Jerusalem and walled cities",Sigd:Sigd,"Simchat Torah":"Day of Celebrating the Torah. Celebration marking the conclusion of the annual cycle of public Torah readings, and the beginning of a new cycle",Sukkot:Sukkot,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees. Tu BiShvat is one of four “New Years” mentioned in the Mishnah","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yitzhak Rabin Memorial Day":"Commemorates the life of Israeli Prime Minister Yitzhak Rabin","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma’ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma’arakhot Yisrael ul’Nifge’ei Pe’ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma’ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement. The holiest day of the year in Judaism, traditionally observed with a 25-hour period of fasting and intensive prayer","Yom Kippur Katan":"Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
8
-
9
5
  /**
10
6
  * Helper function to transform a string to make it more usable in a URL or filename.
11
7
  * Converts to lowercase and replaces non-word characters with hyphen ('-').
@@ -15,115 +11,13 @@ const Chanukah="Hanukkah, the Jewish festival of rededication. Also known as the
15
11
  function makeAnchor(s) {
16
12
  return s
17
13
  .toLowerCase()
18
- .replace(/'/g, '')
19
- .replace(/[^\w]/g, '-')
20
- .replace(/-+/g, '-')
21
- .replace(/^-/g, '')
22
- .replace(/-$/g, '');
14
+ .replaceAll("'", '')
15
+ .replaceAll(/[^\w]/g, '-')
16
+ .replaceAll(/-+/g, '-')
17
+ .replaceAll(/^-/g, '')
18
+ .replaceAll(/-$/g, '');
23
19
  }
24
20
 
25
- const parsha2id = new Map();
26
- for (let id = 0; id < sedra.parshiot.length; id++) {
27
- const name = sedra.parshiot[id];
28
- parsha2id.set(makeAnchor(name), id + 1);
29
- }
30
- const doubledParshiyot = [
31
- 'Vayakhel-Pekudei',
32
- 'Tazria-Metzora',
33
- 'Achrei Mot-Kedoshim',
34
- 'Behar-Bechukotai',
35
- 'Chukat-Balak',
36
- 'Matot-Masei',
37
- 'Nitzavim-Vayeilech',
38
- ];
39
- const doubled = new Set();
40
- for (const name of doubledParshiyot) {
41
- const anchor = makeAnchor(name);
42
- doubled.add(anchor);
43
- const [p1] = anchor.split('-');
44
- const id = parsha2id.get(p1);
45
- parsha2id.set(anchor, id);
46
- }
47
- function parse8digitDateStr(date) {
48
- const gy = date.substring(0, 4);
49
- const gm = date.substring(4, 6);
50
- const gd = date.substring(6, 8);
51
- const yy = parseInt(gy, 10);
52
- const mm = parseInt(gm, 10);
53
- const dd = parseInt(gd, 10);
54
- const dt = new Date(yy, mm - 1, dd);
55
- if (yy < 100) {
56
- dt.setFullYear(yy);
57
- }
58
- return dt;
59
- }
60
- function shortenSedrotUrl(u) {
61
- const path = u.pathname;
62
- const dash = path.lastIndexOf('-');
63
- const dateStr = path.substring(dash + 1);
64
- const name = path.substring(8, dash);
65
- const id = parsha2id.get(name);
66
- if (id && dateStr.length === 8) {
67
- const dt = parse8digitDateStr(dateStr);
68
- const hd = new hdate.HDate(dt);
69
- let p = '/s/' + hd.getFullYear();
70
- if (u.searchParams.get('i') === 'on') {
71
- p += 'i';
72
- u.searchParams.delete('i');
73
- }
74
- const id = parsha2id.get(name);
75
- p += '/' + id;
76
- if (doubled.has(name)) {
77
- p += 'd';
78
- }
79
- u.pathname = p;
80
- }
81
- else {
82
- u.pathname = '/s/' + path.substring(8);
83
- }
84
- }
85
-
86
- const LOC_FIELDS = [
87
- 'elevation',
88
- 'admin1',
89
- 'asciiname',
90
- 'geo',
91
- 'zip',
92
- 'state',
93
- 'stateName',
94
- 'geonameid',
95
- ];
96
- const holidayDescription = holidayDescription0;
97
- const countryNames = countryNames0;
98
- /**
99
- * Converts a @hebcal/core `Location` to a plain JS object.
100
- */
101
- function locationToPlainObj(location) {
102
- if (typeof location === 'object' &&
103
- location !== null &&
104
- typeof location.getLatitude === 'function') {
105
- const cc = location.getCountryCode();
106
- const o = {
107
- title: location.getName(),
108
- city: location.getShortName(),
109
- tzid: location.getTzid(),
110
- latitude: location.getLatitude(),
111
- longitude: location.getLongitude(),
112
- cc: cc,
113
- country: countryNames[cc],
114
- };
115
- for (const k of LOC_FIELDS) {
116
- const val = location[k];
117
- if (val) {
118
- o[k] = val;
119
- }
120
- }
121
- return o;
122
- }
123
- else {
124
- return { geo: 'none' };
125
- }
126
- }
127
21
  function getDownloadFilename(options) {
128
22
  let fileName = 'hebcal';
129
23
  if (options.year) {
@@ -150,9 +44,9 @@ function getDownloadFilename(options) {
150
44
  }
151
45
  if (typeof options.location === 'object') {
152
46
  const loc = options.location;
153
- const name = loc.zip || loc.asciiname || loc.getShortName();
47
+ const name = loc.zip || loc.asciiname || loc.getShortName() || '';
154
48
  if (name) {
155
- fileName += '_' + makeAnchor(name).replace(/[-]/g, '_');
49
+ fileName += '_' + makeAnchor(name).replaceAll(/[-]/g, '_');
156
50
  }
157
51
  }
158
52
  return fileName;
@@ -179,7 +73,7 @@ function getEventCategories(ev) {
179
73
  * @deprecated
180
74
  */
181
75
  function renderTitleWithoutTime(ev, locale) {
182
- return typeof ev.eventTime === 'undefined'
76
+ return ev.eventTime === undefined
183
77
  ? ev.render(locale)
184
78
  : ev.renderBrief(locale);
185
79
  }
@@ -222,8 +116,8 @@ function getCalendarTitle(events, options) {
222
116
  title += ' ' + options.year;
223
117
  }
224
118
  else if (events.length) {
225
- const start = events[0].getDate().greg();
226
- const end = events[events.length - 1].getDate().greg();
119
+ const start = events[0].greg();
120
+ const end = events[events.length - 1].greg();
227
121
  if (start.getFullYear() !== end.getFullYear()) {
228
122
  title += ' ' + start.getFullYear() + '-' + end.getFullYear();
229
123
  }
@@ -238,15 +132,50 @@ function getCalendarTitle(events, options) {
238
132
  }
239
133
  return title;
240
134
  }
135
+ /**
136
+ * Bitmask for learning events (Daf Yomi, Nach Yomi, Mishna Yomi, Daily Learning, Yerushalmi Yomi)
137
+ */
138
+ const LEARNING_MASK = event.flags.DAF_YOMI |
139
+ event.flags.NACH_YOMI |
140
+ event.flags.MISHNA_YOMI |
141
+ event.flags.DAILY_LEARNING |
142
+ event.flags.YERUSHALMI_YOMI;
143
+ function shouldRenderBrief(ev) {
144
+ if (ev.eventTime !== undefined) {
145
+ return true;
146
+ }
147
+ const mask = ev.getFlags();
148
+ if (mask & event.flags.HEBREW_DATE) {
149
+ const hd = ev.getDate();
150
+ return hd.getDate() !== 1;
151
+ }
152
+ else if (mask & (LEARNING_MASK | event.flags.SHABBAT_MEVARCHIM)) {
153
+ return true;
154
+ }
155
+ else if (mask & event.flags.MINOR_FAST &&
156
+ ev.getDesc().startsWith('Yom Kippur Katan')) {
157
+ return true;
158
+ }
159
+ else {
160
+ return false;
161
+ }
162
+ }
163
+
164
+ const Chanukah$1="Hanukkah, the Jewish festival of rededication. Also known as the Festival of Lights, the eight-day festival is observed by lighting the candles of a hanukkiah (menorah)";const Pesach$1="Passover, the Feast of Unleavened Bread. Also called Chag HaMatzot (the Festival of Matzah), it commemorates the Exodus and freedom of the Israelites from ancient Egypt";const Purim$1="Celebration of Jewish deliverance as told by Megilat Esther. It commemorates a time when the Jewish people living in Persia were saved from extermination";const Shavuot$1="Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai";const Sigd$1="Ethiopian Jewish holiday occurring 50 days after Yom Kippur";const Sukkot$1="Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)";var holidayDescription0 = {"Asara B'Tevet":"Fast commemorating the siege of Jerusalem","Ben-Gurion Day":"Commemorates the life and vision of Israel’s first Prime Minister David Ben-Gurion","Birkat Hachamah":"A rare Jewish blessing recited once every 28 years thanking G-d for creating the sun","Chag HaBanot":"North African Chanukah festival of daughters. Called Eid al-Banat in Arabic, the holiday was most preserved in Tunisia",Chanukah:Chanukah$1,"Days of the Omer":"7 weeks from the second night of Pesach to the day before Shavuot. Also called Sefirat HaOmer, it is a practice that consists of a verbal counting of each of the forty-nine days between the two holidays","Erev Yom Kippur":"Evening of Yom Kippur (Day of Atonement), which includes the Kol Nidre service. The Yom Kippur fast begins at sundown and continues for 25 hours","Family Day":"Yom HaMishpacha, a day to honor the family unit","Hebrew Language Day":"Promotes the Hebrew language in Israel and around the world. Occurs on the birthday of Eliezer Ben Yehuda, the father of modern spoken Hebrew","Herzl Day":"Commemorates the life and vision of Zionist leader Theodor Herzl","Jabotinsky Day":"Commemorates the life and vision of Zionist leader Ze’ev Jabotinsky","Lag BaOmer":"33rd day of counting the Omer. The holiday is a temporary break from the semi-mourning period the counting of the Omer. Practices include lighting bonfires, getting haircuts, and Jewish weddings","Leil Selichot":"Prayers for forgiveness in preparation for the High Holidays","Pesach Sheni":"Second Passover, one month after Passover",Pesach:Pesach$1,"Purim Katan":"Minor Purim celebration during Adar I on leap years",Purim:Purim$1,"Purim Meshulash":"Triple Purim, spanning 3 days in Jerusalem and walled cities. It occurs when the 15th of Adar coincides with Shabbat","Rosh Chodesh Nisan":"Start of month of Nisan on the Hebrew calendar. נִיסָן (transliterated Nisan or Nissan) is the 7th month of the civil Hebrew year (8th on leap years) and the 1st month of the biblical Hebrew year. It has 30 days and corresponds to March or April on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Iyyar":"Start of month of Iyyar on the Hebrew calendar. אִיָּיר (transliterated Iyyar or Iyar) is the 8th month of the civil Hebrew year (9th on leap years) and the 2nd month of the biblical Hebrew year. It has 29 days and corresponds to April or May on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sivan":"Start of month of Sivan on the Hebrew calendar. Sivan (סִיוָן) is the 9th month of the civil Hebrew year (10th on leap years) and the 3rd month of the biblical Hebrew year. It has 30 days and corresponds to May or June on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tamuz":"Start of month of Tammuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 10th month of the civil Hebrew year (11th on leap years) and the 4th month of the biblical Hebrew year. It has 29 days and corresponds to June or July on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Av":"Start of month of Av on the Hebrew calendar. Av (אָב) is the 11th month of the civil Hebrew year (12th on leap years) and the 5th month of the biblical Hebrew year. It has 30 days and corresponds to July or August on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Elul":"Start of month of Elul on the Hebrew calendar. Elul (אֱלוּל) is the 12th month of the civil Hebrew year (13th on leap years) and the 6th month of the biblical Hebrew year. It has 29 days and corresponds to August or September on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Cheshvan":"Start of month of Cheshvan on the Hebrew calendar. חֶשְׁוָן (transliterated Cheshvan or Heshvan) is the 2nd month of the civil Hebrew year and the 8th month of the biblical Hebrew year. It has 29 or 30 days and corresponds to October or November on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Kislev":"Start of month of Kislev on the Hebrew calendar. Kislev (כִּסְלֵו) is the 3rd month of the civil Hebrew year and the 9th month of the biblical Hebrew year. It has 30 or 29 days and corresponds to November or December on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Tevet":"Start of month of Tevet on the Hebrew calendar. Tevet (טֵבֵת) is the 4th month of the civil Hebrew year and the 10th month of the biblical Hebrew year. It has 29 days and corresponds to December or January on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Sh'vat":"Start of month of Sh’vat on the Hebrew calendar. שְׁבָט (transliterated Sh’vat or Shevat) is the 5th month of the civil Hebrew year and the 11th month of the biblical Hebrew year. It has 30 days and corresponds to January or February on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar":"Start of month of Adar on the Hebrew calendar. Adar (אֲדָר) is the 6th month of the civil Hebrew year and the 12th month of the biblical Hebrew year. It has 29 days and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar I":"Start of month of Adar I (on leap years) on the Hebrew calendar. Adar I (אֲדָר א׳) is the 6th month of the civil Hebrew year and the 12th month of the biblical Hebrew year. It has 30 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Chodesh Adar II":"Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אֲדָר ב׳), sometimes “Adar Bet” or “Adar Sheni”, is the 7th month of the civil Hebrew year and the 13th month of the Hebrew year. It has 29 days, occurs only on leap years, and corresponds to February or March on the Gregorian calendar. רֹאשׁ חוֹדֶשׁ, transliterated Rosh Chodesh or Rosh Hodesh, is a minor holiday that occurs at the beginning of every month in the Hebrew calendar. It is marked by the birth of a new moon","Rosh Hashana":"The Jewish New Year. Also spelled Rosh Hashanah","Rosh Hashana LaBehemot":"New Year for Tithing Animals","Shabbat Chazon":"Shabbat of Prophecy/Shabbat of Vision. Shabbat before Tish’a B’Av","Shabbat HaChodesh":"Shabbat before Rosh Chodesh Nissan. Read in preparation for Passover","Shabbat HaGadol":"Shabbat before Pesach (The Great Shabbat)","Shabbat Machar Chodesh":"When Shabbat falls the day before Rosh Chodesh","Shabbat Mevarchim Chodesh":"Shabbat that precedes Rosh Chodesh. The congregation blesses the forthcoming new month","Shabbat Nachamu":"Shabbat after Tish’a B’Av (Shabbat of Consolation). The first of seven Shabbatot leading up to Rosh Hashanah. Named after the Haftarah (from Isaiah 40) which begins with the verse נַחֲמוּ נַחֲמוּ, עַמִּי (“Comfort, oh comfort my people”)","Shabbat Parah":"Shabbat of the Red Heifer. Shabbat before Shabbat HaChodesh, in preparation for Passover","Shabbat Rosh Chodesh":"When Shabbat falls on Rosh Chodesh","Shabbat Shekalim":"Shabbat before Rosh Chodesh Adar. Read in preparation for Purim","Shabbat Shirah":"Shabbat of Song. Shabbat that includes Parashat Beshalach","Shabbat Shuva":"Shabbat of Returning. Shabbat that occurs during the Ten Days of Repentance between Rosh Hashanah and Yom Kippur","Shabbat Zachor":"Shabbat of Remembrance. Shabbat before Purim",Shavuot:Shavuot$1,"Shmini Atzeret":"Eighth Day of Assembly. Immediately following Sukkot, it is observed as a separate holiday in the Diaspora and is combined with Simchat Torah in Israel","Shushan Purim":"Purim celebrated in Jerusalem and walled cities","Shushan Purim Katan":"Minor Purim celebration during Adar I on leap years in Jerusalem and walled cities",Sigd:Sigd$1,"Simchat Torah":"Day of Celebrating the Torah. Celebration marking the conclusion of the annual cycle of public Torah readings, and the beginning of a new cycle",Sukkot:Sukkot$1,"Ta'anit Bechorot":"Fast of the First Born","Ta'anit Esther":"Fast of Esther","Tish'a B'Av":"The Ninth of Av. Fast commemorating the destruction of the two Temples","Tu B'Av":"Minor Jewish holiday of love. Observed on the 15th day of the Hebrew month of Av","Tu BiShvat":"New Year for Trees. Tu BiShvat is one of four “New Years” mentioned in the Mishnah","Tzom Gedaliah":"Fast of the Seventh Month. Commemorates the assassination of the Jewish governor of Judah","Tzom Tammuz":"Fast commemorating breaching of the walls of Jerusalem before the destruction of the Second Temple","Yitzhak Rabin Memorial Day":"Commemorates the life of Israeli Prime Minister Yitzhak Rabin","Yom HaAliyah":"Recognizes Aliyah, immigration to the Jewish State of Israel","Yom HaAliyah School Observance":"Aliyah Day observed in Israeli schools","Yom HaAtzma'ut":"Israeli Independence Day. Commemorates the declaration of independence of Israel in 1948. Although Yom HaAtzma’ut is normally observed on the 5th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaZikaron, which always precedes it) would conflict with Shabbat","Yom HaShoah":"Holocaust Memorial Day","Yom HaZikaron":"Israeli Memorial Day. Remembers those who died in the War of Independence and other wars in Israel. The full name of the holiday is Yom HaZikaron LeHalalei Ma’arakhot Yisrael ul’Nifge’ei Pe’ulot HaEivah (Hebrew: יוֹם הזִּכָּרוֹן לְחַלְלֵי מַעֲרָכוֹת יִשְׂרָאֵל וּלְנִפְגְעֵי פְּעֻלּוֹת הָאֵיבָה), Memorial Day for the Fallen Soldiers of the Wars of Israel and Victims of Actions of Terrorism. Although Yom Hazikaron is normally observed on the 4th of Iyyar, it may be moved earlier or postponed if observance of the holiday (or Yom HaAtzma’ut, which always follows it) would conflict with Shabbat","Yom Kippur":"Day of Atonement. The holiest day of the year in Judaism, traditionally observed with a 25-hour period of fasting and intensive prayer","Yom Kippur Katan":"Minor day of atonement occurring monthly on the day preceeding each Rosh Chodesh","Yom Yerushalayim":"Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"};
165
+
166
+ const Chanukah="חנוכה, חג החנוכה מחדש היהודי. ידוע גם כחג האורים; החג נחגג במשך שמונה ימים על ידי הדלקת נרות בחנוכייה";const Pesach="פסח, חג המצות. מציין את יציאת מצרים ושחרור בני ישראל ממצרים העתיקה";const Purim="חגיגת ההצלה היהודית כפי שמסופר במגילת אסתר. מציין תקופה שבה העם היהודי שחי בפרס ניצל מהשמדה";const Shavuot="חג השבועות. מציין את מתן תורה בהר סיני";const Sigd="הסיגד, חג של יהדות אתיופיה החל 50 יום לאחר יום הכיפורים";const Sukkot="חג הסוכות. החג שנמשך שבעה ימים הוא אחד משלושת הרגלים";var holidayDescHe0 = {"Asara B'Tevet":"צום המציין את המצור על ירושלים","Ben-Gurion Day":"יום המציין את חייו וחזונו של ראש הממשלה הראשון של ישראל, דוד בן-גוריון","Birkat Hachamah":"ברכה יהודית נדירה הנאמרת אחת ל-28 שנים כהודיה לאל על בריאת החמה","Chag HaBanot":"חג הבנות של חנוכה (עיד אל-בנאת), שמקורו ביהדות צפון אפריקה ונשתמר בעיקר בתוניסיה",Chanukah:Chanukah,"Days of the Omer":"7 שבועות מהלילה השני של פסח ועד ליום לפני שבועות. נקרא גם ספירת העומר; מנהג הכולל ספירה מילולית של כל אחד מארבעים ותשעה הימים בין שני החגים","Erev Yom Kippur":"ערב יום הכיפורים, הכולל את תפילת כל נדרי. צום יום הכיפורים מתחיל עם שקיעת החמה ונמשך 25 שעות","Family Day":"יום המשפחה, יום להוקרת התא המשפחתי","Hebrew Language Day":"יום לקידום השפה העברית בישראל וברחבי העולם. חל ביום הולדתו של אליעזר בן יהודה, מחייה השפה העברית","Herzl Day":"יום המציין את חייו וחזונו של המנהיג הציוני בנימין זאב הרצל","Jabotinsky Day":"יום המציין את חייו וחזונו של המנהיג הציוני זאב ז'בוטינסקי","Lag BaOmer":"היום ה-33 לספירת העומר. החג מהווה הפוגה זמנית ממנהגי האבלות של תקופת ספירת העומר. המנהגים כוללים הדלקת מדורות, תספורות וחתונות","Leil Selichot":"תפילות סליחה כהכנה לימים הנוראים","Pesach Sheni":"פסח שני, חודש לאחר חג הפסח",Pesach:Pesach,"Purim Katan":"חגיגת פורים קטן המצוינת במהלך חודש אדר א' בשנים מעוברות",Purim:Purim,"Purim Meshulash":"פורים משולש, הנפרש על פני 3 ימים בירושלים ובערים מוקפות חומה. חל כאשר ט״ו באדר נופל בשבת","Rosh Chodesh Nisan":"תחילת חודש ניסן בלוח העברי. ניסן הוא החודש ה-7 בשנה העברית האזרחית (ה-8 בשנים מעוברות) והחודש ה-1 בשנה העברית המקראית. יש בו 30 ימים והוא מקביל למרץ או אפריל בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Iyyar":"תחילת חודש אייר בלוח העברי. אייר הוא החודש ה-8 בשנה העברית האזרחית (ה-9 בשנים מעוברות) והחודש ה-2 בשנה העברית המקראית. יש בו 29 ימים והוא מקביל לאפריל או מאי בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Sivan":"תחילת חודש סיוון בלוח העברי. סיוון הוא החודש ה-9 בשנה העברית האזרחית (ה-10 בשנים מעוברות) והחודש ה-3 בשנה העברית המקראית. יש בו 30 ימים והוא מקביל למאי או יוני בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Tamuz":"תחילת חודש תמוז בלוח העברי. תמוז הוא החודש ה-10 בשנה העברית האזרחית (ה-11 בשנים מעוברות) והחודש ה-4 בשנה העברית המקראית. יש בו 29 ימים והוא מקביל ליוני או יולי בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Av":"תחילת חודש אב בלוח העברי. אב הוא החודש ה-11 בשנה העברית האזרחית (ה-12 בשנים מעוברות) והחודש ה-5 בשנה העברית המקראית. יש בו 30 ימים והוא מקביל ליולי או אוגוסט בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Elul":"תחילת חודש אלול בלוח העברי. אלול הוא החודש ה-12 בשנה העברית האזרחית (ה-13 בשנים מעוברות) והחודש ה-6 בשנה העברית המקראית. יש בו 29 ימים והוא מקביל לאוגוסט או ספטמבר בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Cheshvan":"תחילת חודש חשוון בלוח העברי. חשוון הוא החודש ה-2 בשנה העברית האזרחית והחודש ה-8 בשנה העברית המקראית. יש בו 29 או 30 ימים והוא מקביל לאוקטובר או נובמבר בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Kislev":"תחילת חודש כסלו בלוח העברי. כסלו הוא החודש ה-3 בשנה העברית האזרחית והחודש ה-9 בשנה העברית המקראית. יש בו 30 או 29 ימים והוא מקביל לנובמבר או דצמבר בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Tevet":"תחילת חודש טבת בלוח העברי. טבת הוא החודש ה-4 בשנה העברית האזרחית והחודש ה-10 בשנה העברית המקראית. יש בו 29 ימים והוא מקביל לדצמבר או ינואר בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Sh'vat":"תחילת חודש שבט בלוח העברי. שבט הוא החודש ה-5 בשנה העברית האזרחית והחודש ה-11 בשנה העברית המקראית. יש בו 30 ימים והוא מקביל לינואר או פברואר בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Adar":"תחילת חודש אדר בלוח העברי. אדר הוא החודש ה-6 בשנה העברית האזרחית והחודש ה-12 בשנה העברית המקראית. יש בו 29 ימים והוא מקביל לפברואר או מרץ בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Adar I":"תחילת חודש אדר א' (בשנים מעוברות) בלוח העברי. אדר א' הוא החודש ה-6 בשנה העברית האזרחית והחודש ה-12 בשנה העברית המקראית. יש בו 30 ימים, הוא חל רק בשנים מעוברות ומקביל לפברואר או מרץ בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Chodesh Adar II":"תחילת חודש אדר ב' (בשנים מעוברות) בלוח העברי. אדר ב', נקרא לעיתים “אדר שני”, הוא החודש ה-7 בשנה העברית האזרחית והחודש ה-13 בשנה העברית. יש בו 29 ימים, הוא חל רק בשנים מעוברות ומקביל לפברואר או מרץ בלוח הגרגוריאני. ראש חודש הוא מועד המצוין בתחילת כל חודש בלוח העברי ומסומן על ידי מולד הלבנה","Rosh Hashana":"ראש השנה היהודי","Rosh Hashana LaBehemot":"ראש השנה למעשר בהמה","Shabbat Chazon":"שבת חזון (שבת הנבואה). השבת שלפני תשעה באב","Shabbat HaChodesh":"שבת החודש. השבת שלפני ראש חודש ניסן. נקראת כהכנה לפסח","Shabbat HaGadol":"שבת הגדול. השבת שלפני חג הפסח","Shabbat Machar Chodesh":"שבת מחר חודש. כאשר שבת חלה ביום שלפני ראש חודש","Shabbat Mevarchim Chodesh":"שבת מברכים. השבת שקודמת לראש חודש, בה הקהל מברך את החודש החדש שבפתח","Shabbat Nachamu":"שבת נחמו. השבת שלאחר תשעה באב (שבת של נחמה). הראשונה מבין שבע שבתות המובילות לראש השנה. נקראת על שם ההפטרה (ישעיהו מ') הפותחת בפסוק “נַחֲמוּ נַחֲמוּ, עַמִּי”","Shabbat Parah":"שבת פרה (אדומה). השבת שלפני שבת החודש, כהכנה לפסח","Shabbat Rosh Chodesh":"שבת ראש חודש. כאשר שבת חלה בראש חודש","Shabbat Shekalim":"שבת שקלים. השבת שלפני ראש חודש אדר. נקראת כהכנה לפורים","Shabbat Shirah":"שבת שירה. השבת הכוללת את פרשת בשלח (ושירת הים)","Shabbat Shuva":"שבת שובה. השבת שחלה במהלך עשרת ימי תשובה בין ראש השנה ליום כיפור","Shabbat Zachor":"שבת זכור. השבת שלפני פורים",Shavuot:Shavuot,"Shmini Atzeret":"שמיני עצרת. חל מיד לאחר סוכות; בתפוצות נחגג כחג נפרד ובישראל משולב עם שמחת תורה","Shushan Purim":"פורים הנחגג בירושלים ובערים מוקxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxים ובערים מוקפות חומה (בשנה מעוברת)",Sigd:Sigd,"Simchat Torah":"שמחת תורה. חגיגה המציינת את סיום המחזור השנתי של קריאת התורה בציבור, ותחילתו של מחזור חדש",Sukkot:Sukkot,"Ta'anit Bechorot":"תענית בכורות","Ta'anit Esther":"תענית אסתר","Tish'a B'Av":"תשעה באב. צום המציין את חורבן שני בתי המקדש","Tu B'Av":"ט״ו באב, חג האהבה היהודי. מצוין בט״ו בחודש אב העברי","Tu BiShvat":"ראש השנה לאילנות. ט״ו בשבט הוא אחד מארבעת “ראשי השנה” המוזכרים במשנה","Tzom Gedaliah":"צום גדליה (צום החודש השביעי). מציין את רצח המושל היהודי של יהודה","Tzom Tammuz":"צום י״ז בתמוז. צום המציין את הבקעת חומות ירושלים לפני חורבן בית המקדש השני","Yitzhak Rabin Memorial Day":"יום הזיכרון ליצחק רבין. מציין את חייו של ראש ממשלת ישראל יצחק רבין","Yom HaAliyah":"מציין את העלייה למדינת ישראל","Yom HaAliyah School Observance":"יום העלייה כפי שמצוין בבתי הספר בישראל","Yom HaAtzma'ut":"יום העצמאות. מציין את הכרזת העצמאות של ישראל בשנת 1948. למרות שיום העצמאות מצוין בדרך כלל בה' באייר, הוא עשוי להיות מוקדם או להידחות אם קיום החג (או יום הזיכרון שתמיד קודם לו) יתנגש עם השבת","Yom HaShoah":"יום הזיכרון לשואה ולגבורה","Yom HaZikaron":"יום הזיכרון לחללי מערכות ישראל. זוכר את אלו שנפלו במלחמת העצמאות ובמלחמות ישראל האחרות. השם המלא של החג הוא “יום הזיכרון לחללי מערכות ישראל ולנפגעי פעולות האיבה״. למרות שיום הזיכרון מצוין בדרך כלל בד' באייר, הוא עשוי להיות מוקדם או להידחות אם קיום היום (או יום העצמאות שבא תמיד אחריו) יתנגש עם השבת","Yom Kippur":"יום הכיפורים. היום הקדוש ביותר בשנה ביהדות, המצוין באופן מסורתי בצום של 25 שעות ותפילה אינטנסיבית","Yom Kippur Katan":"יום כיפור קטן. יום כפרה החל מדי חודש ביום שלפני כל ראש חודש","Yom Yerushalayim":"יום ירושלים. מציין את איחודה מחדש של ירושלים בשנת 1967"};
167
+
168
+ const holidayDescription = holidayDescription0;
169
+ const holidayDescriptionHe = holidayDescHe0;
241
170
  /**
242
171
  * Returns an English language description of the holiday
243
172
  */
244
- function getHolidayDescription(ev, firstSentence = false) {
173
+ function getHolidayDescription(ev, firstSentence = false, locale) {
174
+ const he = locale === 'h' || locale === 'he' || locale === 'he-x-NoNikud';
175
+ const strs = he ? holidayDescriptionHe : holidayDescription;
245
176
  const str0 = ev.getFlags() & event.flags.SHABBAT_MEVARCHIM
246
- ? holidayDescription['Shabbat Mevarchim Chodesh']
247
- : holidayDescription[ev.getDesc()] ||
248
- holidayDescription[ev.basename()] ||
249
- '';
177
+ ? strs['Shabbat Mevarchim Chodesh']
178
+ : strs[ev.getDesc()] || strs[ev.basename()] || '';
250
179
  const str = str0.normalize();
251
180
  if (firstSentence && str) {
252
181
  const dot = str.indexOf('.');
@@ -256,11 +185,91 @@ function getHolidayDescription(ev, firstSentence = false) {
256
185
  }
257
186
  return str;
258
187
  }
259
- const LEARNING_MASK = event.flags.DAF_YOMI |
260
- event.flags.NACH_YOMI |
261
- event.flags.MISHNA_YOMI |
262
- event.flags.DAILY_LEARNING |
263
- event.flags.YERUSHALMI_YOMI;
188
+
189
+ const csvHeader = '"Subject","Start Date","Start Time","End Date","End Time","All day event","Description","Show time as","Location"';
190
+ const CATEGORY = {
191
+ dafyomi: 'Daf Yomi',
192
+ mishnayomi: 'Mishna Yomi',
193
+ nachyomi: 'Nach Yomi',
194
+ yerushalmi: 'Yerushalmi Yomi',
195
+ hebdate: 'Hebrew Date',
196
+ holiday: 'Jewish Holidays',
197
+ mevarchim: '',
198
+ molad: '',
199
+ omer: '',
200
+ parashat: 'Torah Reading',
201
+ roshchodesh: 'Jewish Holidays',
202
+ user: 'Personal',
203
+ zmanim: '',
204
+ };
205
+ /**
206
+ * Renders an Event as a string
207
+ */
208
+ function eventToCsv(ev, options) {
209
+ const d = ev.greg();
210
+ const mday = d.getDate();
211
+ const mon = d.getMonth() + 1;
212
+ const year = String(d.getFullYear()).padStart(4, '0');
213
+ const date = options.euro
214
+ ? `"${mday}/${mon}/${year}"`
215
+ : `"${mon}/${mday}/${year}"`;
216
+ let startTime = '';
217
+ let endTime = '';
218
+ let endDate = '';
219
+ let allDay = '"true"';
220
+ const timedEv = ev;
221
+ const timed = Boolean(timedEv.eventTime);
222
+ let subj = shouldRenderBrief(ev)
223
+ ? ev.renderBrief(options.locale)
224
+ : ev.render(options.locale);
225
+ if (timed) {
226
+ const timeStr = reformatTimeStr.reformatTimeStr(timedEv.eventTimeStr, ' PM', options);
227
+ endTime = startTime = `"${timeStr}"`;
228
+ endDate = date;
229
+ allDay = '"false"';
230
+ }
231
+ let loc = 'Jewish Holidays';
232
+ const mask = ev.getFlags();
233
+ if (timed && typeof options.location === 'object') {
234
+ const locationName = options.location.getShortName();
235
+ if (locationName) {
236
+ loc = locationName;
237
+ }
238
+ }
239
+ else {
240
+ const cats = getEventCategories(ev);
241
+ for (const cat of cats) {
242
+ const category = CATEGORY[cat];
243
+ if (typeof category === 'string') {
244
+ loc = category;
245
+ break;
246
+ }
247
+ }
248
+ }
249
+ subj = subj.replaceAll(',', '').replaceAll('"', "''");
250
+ if (options.appendHebrewToSubject) {
251
+ const hebrew = ev.renderBrief('he');
252
+ if (hebrew) {
253
+ subj += ` / ${hebrew}`;
254
+ }
255
+ }
256
+ let memo0 = ev.memo || getHolidayDescription(ev, true, options.locale);
257
+ if (!memo0 && timedEv.linkedEvent !== undefined) {
258
+ memo0 = timedEv.linkedEvent.render(options.locale);
259
+ }
260
+ const memo = memo0
261
+ .replaceAll(',', ';')
262
+ .replaceAll('"', "''")
263
+ .replaceAll('\n', ' / ');
264
+ const isChag = Boolean(mask & event.flags.CHAG);
265
+ const showTimeAs = timed || isChag ? 4 : 3;
266
+ return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
267
+ }
268
+ function eventsToCsv(events, options) {
269
+ return ([csvHeader].concat(events.map(ev => eventToCsv(ev, options))).join('\r\n') +
270
+ '\r\n');
271
+ }
272
+
264
273
  const HOLIDAY_IGNORE_MASK = event.flags.OMER_COUNT |
265
274
  event.flags.SHABBAT_MEVARCHIM |
266
275
  event.flags.MOLAD |
@@ -274,7 +283,7 @@ function makeTorahMemoText(ev, il) {
274
283
  var _a;
275
284
  const mask = ev.getFlags();
276
285
  if (mask & HOLIDAY_IGNORE_MASK ||
277
- typeof ev.eventTime !== 'undefined') {
286
+ ev.eventTime !== undefined) {
278
287
  return '';
279
288
  }
280
289
  const reading = mask & event.flags.PARSHA_HASHAVUA
@@ -307,15 +316,77 @@ function makeMemo(ev, il) {
307
316
  if (memo) {
308
317
  return memo;
309
318
  }
319
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
310
320
  }
311
- catch (err) {
321
+ catch (_a) {
312
322
  // fallthru
313
323
  }
314
324
  }
315
325
  if (ev.memo) {
316
326
  return ev.memo;
317
327
  }
318
- return getHolidayDescription(ev);
328
+ return getHolidayDescription(ev, false, 'en');
329
+ }
330
+
331
+ const parsha2id = new Map();
332
+ for (let id = 0; id < sedra.parshiot.length; id++) {
333
+ const name = sedra.parshiot[id];
334
+ parsha2id.set(makeAnchor(name), id + 1);
335
+ }
336
+ const doubledParshiyot = [
337
+ 'Vayakhel-Pekudei',
338
+ 'Tazria-Metzora',
339
+ 'Achrei Mot-Kedoshim',
340
+ 'Behar-Bechukotai',
341
+ 'Chukat-Balak',
342
+ 'Matot-Masei',
343
+ 'Nitzavim-Vayeilech',
344
+ ];
345
+ const doubled = new Set();
346
+ for (const name of doubledParshiyot) {
347
+ const anchor = makeAnchor(name);
348
+ doubled.add(anchor);
349
+ const [p1] = anchor.split('-');
350
+ const id = parsha2id.get(p1);
351
+ parsha2id.set(anchor, id);
352
+ }
353
+ function parse8digitDateStr(date) {
354
+ const gy = date.substring(0, 4);
355
+ const gm = date.substring(4, 6);
356
+ const gd = date.substring(6, 8);
357
+ const yy = parseInt(gy, 10);
358
+ const mm = parseInt(gm, 10);
359
+ const dd = parseInt(gd, 10);
360
+ const dt = new Date(yy, mm - 1, dd);
361
+ if (yy < 100) {
362
+ dt.setFullYear(yy);
363
+ }
364
+ return dt;
365
+ }
366
+ function shortenSedrotUrl(u) {
367
+ const path = u.pathname;
368
+ const dash = path.lastIndexOf('-');
369
+ const dateStr = path.substring(dash + 1);
370
+ const name = path.substring(8, dash);
371
+ const id = parsha2id.get(name);
372
+ if (id && dateStr.length === 8) {
373
+ const dt = parse8digitDateStr(dateStr);
374
+ const hd = new hdate.HDate(dt);
375
+ let p = '/s/' + hd.getFullYear();
376
+ if (u.searchParams.get('i') === 'on') {
377
+ p += 'i';
378
+ u.searchParams.delete('i');
379
+ }
380
+ const id = parsha2id.get(name);
381
+ p += '/' + id;
382
+ if (doubled.has(name)) {
383
+ p += 'd';
384
+ }
385
+ u.pathname = p;
386
+ }
387
+ else {
388
+ u.pathname = '/s/' + path.substring(8);
389
+ }
319
390
  }
320
391
  /**
321
392
  * Appends utm_source and utm_medium parameters to a URL
@@ -372,118 +443,52 @@ function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
372
443
  }
373
444
  return u.toString();
374
445
  }
375
- function shouldRenderBrief(ev) {
376
- if (typeof ev.eventTime !== 'undefined') {
377
- return true;
378
- }
379
- const mask = ev.getFlags();
380
- if (mask & event.flags.HEBREW_DATE) {
381
- const hd = ev.getDate();
382
- return hd.getDate() !== 1;
383
- }
384
- else if (mask &
385
- (event.flags.DAILY_LEARNING | event.flags.DAF_YOMI | event.flags.YERUSHALMI_YOMI)) {
386
- return true;
387
- }
388
- else if (mask & event.flags.MINOR_FAST &&
389
- ev.getDesc().substring(0, 16) === 'Yom Kippur Katan') {
390
- return true;
391
- }
392
- else if (mask & event.flags.SHABBAT_MEVARCHIM) {
393
- return true;
394
- }
395
- else {
396
- return false;
397
- }
398
- }
399
446
 
400
- // eslint-disable-next-line max-len
401
- const csvHeader = '"Subject","Start Date","Start Time","End Date","End Time","All day event","Description","Show time as","Location"';
402
- const CATEGORY = {
403
- dafyomi: 'Daf Yomi',
404
- mishnayomi: 'Mishna Yomi',
405
- nachyomi: 'Nach Yomi',
406
- yerushalmi: 'Yerushalmi Yomi',
407
- hebdate: 'Hebrew Date',
408
- holiday: 'Jewish Holidays',
409
- mevarchim: '',
410
- molad: '',
411
- omer: '',
412
- parashat: 'Torah Reading',
413
- roshchodesh: 'Jewish Holidays',
414
- user: 'Personal',
415
- zmanim: '',
416
- };
447
+ const AD="Andorra";const AE="United Arab Emirates";const AF="Afghanistan";const AI="Anguilla";const AL="Albania";const AM="Armenia";const AO="Angola";const AR="Argentina";const AS="American Samoa";const AT="Austria";const AU="Australia";const AW="Aruba";const AZ="Azerbaijan";const BA="Bosnia and Herzegovina";const BB="Barbados";const BD="Bangladesh";const BE="Belgium";const BF="Burkina Faso";const BG="Bulgaria";const BH="Bahrain";const BI="Burundi";const BJ="Benin";const BM="Bermuda";const BN="Brunei";const BO="Bolivia";const BR="Brazil";const BS="Bahamas";const BT="Bhutan";const BW="Botswana";const BY="Belarus";const BZ="Belize";const CA="Canada";const CD="Democratic Republic of the Congo";const CF="Central African Republic";const CG="Republic of the Congo";const CH="Switzerland";const CI="Ivory Coast";const CK="Cook Islands";const CL="Chile";const CM="Cameroon";const CN="China";const CO="Colombia";const CR="Costa Rica";const CU="Cuba";const CV="Cape Verde";const CW="Curacao";const CY="Cyprus";const CZ="Czech Republic";const DE="Germany";const DK="Denmark";const DM="Dominica";const DO="Dominican Republic";const DZ="Algeria";const EC="Ecuador";const EE="Estonia";const EG="Egypt";const ER="Eritrea";const ES="Spain";const ET="Ethiopia";const FI="Finland";const FJ="Fiji";const FK="Falkland Islands";const FO="Faroe Islands";const FR="France";const GA="Gabon";const GB="United Kingdom";const GE="Georgia";const GH="Ghana";const GI="Gibraltar";const GL="Greenland";const GM="Gambia";const GN="Guinea";const GQ="Equatorial Guinea";const GR="Greece";const GT="Guatemala";const GW="Guinea-Bissau";const GY="Guyana";const HK="Hong Kong";const HN="Honduras";const HR="Croatia";const HT="Haiti";const HU="Hungary";const ID="Indonesia";const IE="Ireland";const IL="Israel";const IM="Isle of Man";const IN="India";const IQ="Iraq";const IR="Iran";const IS="Iceland";const IT="Italy";const JM="Jamaica";const JO="Jordan";const JP="Japan";const KE="Kenya";const KG="Kyrgyzstan";const KH="Cambodia";const KM="Comoros";const KN="Saint Kitts and Nevis";const KP="North Korea";const KR="South Korea";const KW="Kuwait";const KY="Cayman Islands";const KZ="Kazakhstan";const LA="Laos";const LB="Lebanon";const LC="Saint Lucia";const LI="Liechtenstein";const LR="Liberia";const LS="Lesotho";const LT="Lithuania";const LU="Luxembourg";const LV="Latvia";const LY="Libya";const MA="Morocco";const MD="Moldova";const ME="Montenegro";const MG="Madagascar";const MK="Macedonia";const ML="Mali";const MM="Myanmar";const MN="Mongolia";const MP="Northern Mariana Islands";const MR="Mauritania";const MS="Montserrat";const MT="Malta";const MU="Mauritius";const MW="Malawi";const MX="Mexico";const MY="Malaysia";const MZ="Mozambique";const NA="Namibia";const NC="New Caledonia";const NE="Niger";const NG="Nigeria";const NI="Nicaragua";const NL="Netherlands";const NO="Norway";const NP="Nepal";const NU="Niue";const NZ="New Zealand";const OM="Oman";const PA="Panama";const PE="Peru";const PF="French Polynesia";const PG="Papua New Guinea";const PH="Philippines";const PK="Pakistan";const PL="Poland";const PR="Puerto Rico";const PT="Portugal";const PY="Paraguay";const QA="Qatar";const RO="Romania";const RS="Serbia";const RU="Russia";const RW="Rwanda";const SA="Saudi Arabia";const SB="Solomon Islands";const SC="Seychelles";const SD="Sudan";const SE="Sweden";const SG="Singapore";const SH="Saint Helena";const SI="Slovenia";const SK="Slovakia";const SL="Sierra Leone";const SN="Senegal";const SO="Somalia";const SR="Suriname";const ST="Sao Tome and Principe";const SV="El Salvador";const SY="Syria";const SZ="Swaziland";const TC="Turks and Caicos Islands";const TD="Chad";const TG="Togo";const TH="Thailand";const TJ="Tajikistan";const TM="Turkmenistan";const TN="Tunisia";const TR="Turkey";const TV="Tuvalu";const TW="Taiwan";const TZ="Tanzania";const UA="Ukraine";const UG="Uganda";const US="United States";const UY="Uruguay";const UZ="Uzbekistan";const VC="Saint Vincent and the Grenadines";const VE="Venezuela";const VG="British Virgin Islands";const VN="Vietnam";const WS="Samoa";const YE="Yemen";const YT="Mayotte";const ZA="South Africa";const ZM="Zambia";const ZW="Zimbabwe";var countryNames0 = {AD:AD,AE:AE,AF:AF,AI:AI,AL:AL,AM:AM,AO:AO,AR:AR,AS:AS,AT:AT,AU:AU,AW:AW,AZ:AZ,BA:BA,BB:BB,BD:BD,BE:BE,BF:BF,BG:BG,BH:BH,BI:BI,BJ:BJ,BM:BM,BN:BN,BO:BO,BR:BR,BS:BS,BT:BT,BW:BW,BY:BY,BZ:BZ,CA:CA,CD:CD,CF:CF,CG:CG,CH:CH,CI:CI,CK:CK,CL:CL,CM:CM,CN:CN,CO:CO,CR:CR,CU:CU,CV:CV,CW:CW,CY:CY,CZ:CZ,DE:DE,DK:DK,DM:DM,DO:DO,DZ:DZ,EC:EC,EE:EE,EG:EG,ER:ER,ES:ES,ET:ET,FI:FI,FJ:FJ,FK:FK,FO:FO,FR:FR,GA:GA,GB:GB,GE:GE,GH:GH,GI:GI,GL:GL,GM:GM,GN:GN,GQ:GQ,GR:GR,GT:GT,GW:GW,GY:GY,HK:HK,HN:HN,HR:HR,HT:HT,HU:HU,ID:ID,IE:IE,IL:IL,IM:IM,IN:IN,IQ:IQ,IR:IR,IS:IS,IT:IT,JM:JM,JO:JO,JP:JP,KE:KE,KG:KG,KH:KH,KM:KM,KN:KN,KP:KP,KR:KR,KW:KW,KY:KY,KZ:KZ,LA:LA,LB:LB,LC:LC,LI:LI,LR:LR,LS:LS,LT:LT,LU:LU,LV:LV,LY:LY,MA:MA,MD:MD,ME:ME,MG:MG,MK:MK,ML:ML,MM:MM,MN:MN,MP:MP,MR:MR,MS:MS,MT:MT,MU:MU,MW:MW,MX:MX,MY:MY,MZ:MZ,NA:NA,NC:NC,NE:NE,NG:NG,NI:NI,NL:NL,NO:NO,NP:NP,NU:NU,NZ:NZ,OM:OM,PA:PA,PE:PE,PF:PF,PG:PG,PH:PH,PK:PK,PL:PL,PR:PR,PT:PT,PY:PY,QA:QA,RO:RO,RS:RS,RU:RU,RW:RW,SA:SA,SB:SB,SC:SC,SD:SD,SE:SE,SG:SG,SH:SH,SI:SI,SK:SK,SL:SL,SN:SN,SO:SO,SR:SR,ST:ST,SV:SV,SY:SY,SZ:SZ,TC:TC,TD:TD,TG:TG,TH:TH,TJ:TJ,TM:TM,TN:TN,TR:TR,TV:TV,TW:TW,TZ:TZ,UA:UA,UG:UG,US:US,UY:UY,UZ:UZ,VC:VC,VE:VE,VG:VG,VN:VN,WS:WS,YE:YE,YT:YT,ZA:ZA,ZM:ZM,ZW:ZW};
448
+
449
+ const countryNames = countryNames0;
450
+ const LOC_FIELDS = [
451
+ 'elevation',
452
+ 'admin1',
453
+ 'asciiname',
454
+ 'geo',
455
+ 'zip',
456
+ 'state',
457
+ 'stateName',
458
+ 'geonameid',
459
+ ];
417
460
  /**
418
- * Renders an Event as a string
461
+ * Converts a @hebcal/core `Location` to a plain JS object.
419
462
  */
420
- function eventToCsv(ev, options) {
421
- const d = ev.getDate().greg();
422
- const mday = d.getDate();
423
- const mon = d.getMonth() + 1;
424
- const year = String(d.getFullYear()).padStart(4, '0');
425
- const date = options.euro
426
- ? `"${mday}/${mon}/${year}"`
427
- : `"${mon}/${mday}/${year}"`;
428
- let startTime = '';
429
- let endTime = '';
430
- let endDate = '';
431
- let allDay = '"true"';
432
- const timedEv = ev;
433
- const timed = Boolean(timedEv.eventTime);
434
- let subj = shouldRenderBrief(ev)
435
- ? ev.renderBrief(options.locale)
436
- : ev.render(options.locale);
437
- if (timed) {
438
- const timeStr = reformatTimeStr.reformatTimeStr(timedEv.eventTimeStr, ' PM', options);
439
- endTime = startTime = `"${timeStr}"`;
440
- endDate = date;
441
- allDay = '"false"';
442
- }
443
- let loc = 'Jewish Holidays';
444
- const mask = ev.getFlags();
445
- if (timed && typeof options.location === 'object') {
446
- const locationName = options.location.getShortName();
447
- if (locationName) {
448
- loc = locationName;
449
- }
450
- }
451
- else {
452
- const cats = getEventCategories(ev);
453
- for (const cat of cats) {
454
- const category = CATEGORY[cat];
455
- if (typeof category === 'string') {
456
- loc = category;
457
- break;
463
+ function locationToPlainObj(location) {
464
+ if (typeof location === 'object' &&
465
+ location !== null &&
466
+ typeof location.getLatitude === 'function') {
467
+ const cc = location.getCountryCode();
468
+ const o = {
469
+ title: location.getName(),
470
+ city: location.getShortName(),
471
+ tzid: location.getTzid(),
472
+ latitude: location.getLatitude(),
473
+ longitude: location.getLongitude(),
474
+ cc: cc,
475
+ country: countryNames[cc],
476
+ };
477
+ for (const k of LOC_FIELDS) {
478
+ const val = location[k];
479
+ if (val) {
480
+ o[k] = val;
458
481
  }
459
482
  }
483
+ return o;
460
484
  }
461
- subj = subj.replace(/,/g, '').replace(/"/g, "''");
462
- if (options.appendHebrewToSubject) {
463
- const hebrew = ev.renderBrief('he');
464
- if (hebrew) {
465
- subj += ` / ${hebrew}`;
466
- }
467
- }
468
- let memo0 = ev.memo || getHolidayDescription(ev, true);
469
- if (!memo0 && typeof timedEv.linkedEvent !== 'undefined') {
470
- memo0 = timedEv.linkedEvent.render(options.locale);
485
+ else {
486
+ return { geo: 'none' };
471
487
  }
472
- const memo = memo0
473
- .replace(/,/g, ';')
474
- .replace(/"/g, "''")
475
- .replace(/\n/g, ' / ');
476
- const isChag = Boolean(mask & event.flags.CHAG);
477
- const showTimeAs = timed || isChag ? 4 : 3;
478
- return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
479
- }
480
- function eventsToCsv(events, options) {
481
- return ([csvHeader].concat(events.map(ev => eventToCsv(ev, options))).join('\r\n') +
482
- '\r\n');
483
488
  }
484
489
 
485
490
  function eventIsoDate(ev) {
486
- return hdate.isoDateString(ev.getDate().greg());
491
+ return hdate.isoDateString(ev.greg());
487
492
  }
488
493
  /**
489
494
  * Formats a list events for the classic Hebcal.com JSON API response
@@ -616,11 +621,11 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
616
621
  d: hdate.gematriya(dd),
617
622
  };
618
623
  }
619
- const memo = ev.memo || getHolidayDescription(ev);
624
+ const memo = ev.memo || getHolidayDescription(ev, false, options.locale);
620
625
  if (typeof memo === 'string' && memo.length !== 0) {
621
626
  result.memo = memo.normalize();
622
627
  }
623
- else if (typeof timedEv.linkedEvent !== 'undefined') {
628
+ else if (timedEv.linkedEvent) {
624
629
  result.memo = timedEv.linkedEvent.render(options.locale);
625
630
  }
626
631
  if (options.includeEvent) {
@@ -630,7 +635,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
630
635
  }
631
636
  function formatAliyot(result, aliyot) {
632
637
  for (const [num, aliyah] of Object.entries(aliyot)) {
633
- if (typeof aliyah !== 'undefined') {
638
+ if (aliyah) {
634
639
  const k = num === 'M' ? 'maftir' : num;
635
640
  result[k] = common.formatAliyahWithBook(aliyah);
636
641
  }
@@ -660,6 +665,9 @@ function formatLeyningResult(reading) {
660
665
  if (reading.sephardic) {
661
666
  result.haftarah_sephardic = reading.sephardic;
662
667
  }
668
+ if (reading.chabad) {
669
+ result.haftarah_chabad = summary.makeSummaryFromParts(reading.chabad);
670
+ }
663
671
  if (reading.fullkriyah) {
664
672
  formatAliyot(result, reading.fullkriyah);
665
673
  }
@@ -673,21 +681,21 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
673
681
  let link;
674
682
  let guid;
675
683
  const eventTime = ev.eventTime;
676
- const dt = eventTime || ev.getDate().greg();
684
+ const dt = eventTime || ev.greg();
677
685
  const isoDateTime = zmanim.Zmanim.formatISOWithTimeZone(tzid, dt);
678
686
  const dtStr = isoDateTime.substring(0, isoDateTime.indexOf('T'));
679
- const dtAnchor = dtStr.replace(/-/g, '');
687
+ const dtAnchor = dtStr.replaceAll('-', '');
680
688
  const descAnchor = makeAnchor(ev.getDesc());
681
689
  const anchor = `${dtAnchor}-${descAnchor}`;
682
690
  const url0 = ev.url();
683
691
  if (url0) {
684
- link = appendIsraelAndTracking(url0, il, utmSource, utmMedium).replace(/&/g, '&amp;');
692
+ link = appendIsraelAndTracking(url0, il, utmSource, utmMedium).replaceAll('&', '&amp;');
685
693
  guid = `${url0}#${anchor}`;
686
694
  }
687
695
  else {
688
696
  const url1 = `${mainUrl}&dt=${dtStr}`;
689
- const url = appendIsraelAndTracking(url1, il, utmSource, utmMedium).replace(/&/g, '&amp;');
690
- guid = url1.replace(/&/g, '&amp;') + `#${anchor}`;
697
+ const url = appendIsraelAndTracking(url1, il, utmSource, utmMedium).replaceAll('&', '&amp;');
698
+ guid = url1.replaceAll('&', '&amp;') + `#${anchor}`;
691
699
  link = `${url}#${anchor}`;
692
700
  }
693
701
  return [link, guid];
@@ -718,8 +726,8 @@ function eventsToRss2(events, options) {
718
726
  const description = options.description || title;
719
727
  const utmSource = options.utmSource || 'shabbat1c';
720
728
  const utmMedium = options.utmMedium || 'rss';
721
- const mainUrlEsc = appendIsraelAndTracking(options.mainUrl, Boolean(location === null || location === void 0 ? void 0 : location.getIsrael()), utmSource, utmMedium, options.utmCampaign).replace(/&/g, '&amp;');
722
- const selfUrlEsc = options.selfUrl.replace(/&/g, '&amp;');
729
+ const mainUrlEsc = appendIsraelAndTracking(options.mainUrl, Boolean(location === null || location === void 0 ? void 0 : location.getIsrael()), utmSource, utmMedium, options.utmCampaign).replaceAll('&', '&amp;');
730
+ const selfUrlEsc = options.selfUrl.replaceAll('&', '&amp;');
723
731
  const lang = options.lang || localeToLg[options.locale] || options.locale || 'en-US';
724
732
  let str = `<?xml version="1.0" encoding="UTF-8"?>
725
733
  <rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:atom="http://www.w3.org/2005/Atom">
@@ -750,7 +758,7 @@ function getPubDate(ev, evPubDate, evDate, lastBuildDate) {
750
758
  }
751
759
  function eventToRssItem2(ev, options) {
752
760
  let subj = ev.render(options.locale);
753
- const evDate = ev.getDate().greg();
761
+ const evDate = ev.greg();
754
762
  const pubDate = getPubDate(ev, options.evPubDate, evDate, options.lastBuildDate);
755
763
  const location = options.location;
756
764
  const il = location ? location.getIsrael() : false;
@@ -828,7 +836,7 @@ function eventToFullCalendar(ev, tzid, options) {
828
836
  : ev.render(options.locale);
829
837
  const start = timed
830
838
  ? zmanim.Zmanim.formatISOWithTimeZone(tzid, eventTime)
831
- : hdate.isoDateString(ev.getDate().greg());
839
+ : hdate.isoDateString(ev.greg());
832
840
  const result = {
833
841
  title,
834
842
  start,
@@ -853,7 +861,7 @@ function eventToFullCalendar(ev, tzid, options) {
853
861
  if (memo) {
854
862
  result.description = memo;
855
863
  }
856
- else if (typeof timedEv.linkedEvent !== 'undefined') {
864
+ else if (timedEv.linkedEvent !== undefined) {
857
865
  result.description = timedEv.linkedEvent.render(options.locale);
858
866
  }
859
867
  }
@@ -883,10 +891,8 @@ exports.getCalendarTitle = getCalendarTitle;
883
891
  exports.getDownloadFilename = getDownloadFilename;
884
892
  exports.getEventCategories = getEventCategories;
885
893
  exports.getHolidayDescription = getHolidayDescription;
886
- exports.holidayDescription = holidayDescription;
887
894
  exports.locationToPlainObj = locationToPlainObj;
888
895
  exports.makeAnchor = makeAnchor;
889
- exports.makeMemo = makeMemo;
890
896
  exports.makeTorahMemoText = makeTorahMemoText;
891
897
  exports.renderTitleWithoutTime = renderTitleWithoutTime;
892
898
  exports.shouldRenderBrief = shouldRenderBrief;
@@ -894,4 +900,4 @@ exports.toISOString = toISOString;
894
900
 
895
901
  return exports;
896
902
 
897
- })({}, hebcal, hebcal, hebcal, hebcal__leyning, hebcal__leyning, hebcal, hebcal, hebcal, hebcal, hebcal__leyning);
903
+ })({}, hebcal, hebcal, hebcal, hebcal__leyning, hebcal__leyning, hebcal, hebcal, hebcal, hebcal, hebcal__leyning, hebcal__leyning);