@hebcal/rest-api 5.1.1 → 5.1.3

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,4 +1,4 @@
1
- /*! @hebcal/rest-api v5.1.1 */
1
+ /*! @hebcal/rest-api v5.1.3 */
2
2
  var hebcal__rest_api = (function (exports, core, leyning, triennial) {
3
3
  'use strict';
4
4
 
@@ -178,31 +178,32 @@ for (const [key, val] of Object.entries(alefbet)) {
178
178
  * negative numbers similar to how the JavaScript date formats
179
179
  * negative year numbers (e.g. `-37` is formatted as `-000037`).
180
180
  */
181
- function pad4(number) {
182
- if (number < 0) {
183
- return '-00' + pad4(-number);
181
+ function pad4(num) {
182
+ if (num < 0) {
183
+ return '-00' + pad4(-num);
184
184
  }
185
- else if (number < 10) {
186
- return '000' + number;
185
+ else if (num < 10) {
186
+ return '000' + num;
187
187
  }
188
- else if (number < 100) {
189
- return '00' + number;
188
+ else if (num < 100) {
189
+ return '00' + num;
190
190
  }
191
- else if (number < 1000) {
192
- return '0' + number;
191
+ else if (num < 1000) {
192
+ return '0' + num;
193
193
  }
194
- return String(number);
194
+ return String(num);
195
195
  }
196
196
  /**
197
197
  * Formats a number with leading zeros so the resulting string is 2 digits long.
198
198
  * Similar to `string.padStart(2, '0')`.
199
199
  */
200
- function pad2(number) {
201
- if (number < 10) {
202
- return '0' + number;
200
+ function pad2(num) {
201
+ if (num >= 0 && num < 10) {
202
+ return '0' + num;
203
203
  }
204
- return String(number);
204
+ return String(num);
205
205
  }
206
+
206
207
  /**
207
208
  * Returns YYYY-MM-DD in the local timezone
208
209
  */
@@ -234,6 +235,28 @@ const locales = new Map();
234
235
  let activeLocale;
235
236
  /** @private */
236
237
  let activeName;
238
+ /** @private */
239
+ function getEnOrdinal(n) {
240
+ const s = ['th', 'st', 'nd', 'rd'];
241
+ const v = n % 100;
242
+ return n + (s[(v - 20) % 10] || s[v] || s[0]);
243
+ }
244
+ /** @private */
245
+ function checkLocale(locale) {
246
+ if (typeof locale !== 'string') {
247
+ throw new TypeError(`Invalid locale name: ${locale}`);
248
+ }
249
+ return locale.toLowerCase();
250
+ }
251
+ /** @private */
252
+ function getExistingLocale(locale) {
253
+ const locale1 = checkLocale(locale);
254
+ const loc = locales.get(locale1);
255
+ if (!loc) {
256
+ throw new RangeError(`Locale '${locale}' not found`);
257
+ }
258
+ return loc;
259
+ }
237
260
  /**
238
261
  * A locale in Hebcal is used for translations/transliterations of
239
262
  * holidays. `@hebcal/hdate` supports four locales by default
@@ -276,14 +299,12 @@ class Locale {
276
299
  * @param data parsed data from a `.po` file.
277
300
  */
278
301
  static addLocale(locale, data) {
279
- if (typeof locale !== 'string') {
280
- throw new TypeError(`Invalid locale name: ${locale}`);
281
- }
302
+ locale = checkLocale(locale);
282
303
  if (typeof data.contexts !== 'object' ||
283
304
  typeof data.contexts[''] !== 'object') {
284
305
  throw new TypeError(`Locale '${locale}' invalid compact format`);
285
306
  }
286
- locales.set(locale.toLowerCase(), data.contexts['']);
307
+ locales.set(locale, data.contexts['']);
287
308
  }
288
309
  /**
289
310
  * Adds a translation to `locale`, replacing any previous translation.
@@ -292,15 +313,9 @@ class Locale {
292
313
  * @param translation Translation text
293
314
  */
294
315
  static addTranslation(locale, id, translation) {
295
- if (typeof locale !== 'string') {
296
- throw new TypeError(`Invalid locale name: ${locale}`);
297
- }
298
- const loc = locales.get(locale.toLowerCase());
299
- if (!loc) {
300
- throw new TypeError(`Unknown locale: ${locale}`);
301
- }
316
+ const loc = getExistingLocale(locale);
302
317
  if (typeof id !== 'string' || id.length === 0) {
303
- throw new TypeError(`Invalid id: ${id}`);
318
+ throw new TypeError(`Invalid id string: ${id}`);
304
319
  }
305
320
  const isArray = Array.isArray(translation);
306
321
  if (isArray) {
@@ -310,7 +325,7 @@ class Locale {
310
325
  }
311
326
  }
312
327
  else if (typeof translation !== 'string') {
313
- throw new TypeError(`Invalid translation: ${translation}`);
328
+ throw new TypeError(`Invalid translation string: ${translation}`);
314
329
  }
315
330
  loc[id] = isArray ? translation : [translation];
316
331
  }
@@ -320,13 +335,7 @@ class Locale {
320
335
  * @param data parsed data from a `.po` file.
321
336
  */
322
337
  static addTranslations(locale, data) {
323
- if (typeof locale !== 'string') {
324
- throw new TypeError(`Invalid locale name: ${locale}`);
325
- }
326
- const loc = locales.get(locale.toLowerCase());
327
- if (!loc) {
328
- throw new TypeError(`Unknown locale: ${locale}`);
329
- }
338
+ const loc = getExistingLocale(locale);
330
339
  if (typeof data.contexts !== 'object' ||
331
340
  typeof data.contexts[''] !== 'object') {
332
341
  throw new TypeError(`Locale '${locale}' invalid compact format`);
@@ -341,11 +350,8 @@ class Locale {
341
350
  * @param locale Locale name (i.e: `'he'`, `'fr'`)
342
351
  */
343
352
  static useLocale(locale) {
344
- const locale0 = locale.toLowerCase();
345
- const obj = locales.get(locale0);
346
- if (!obj) {
347
- throw new RangeError(`Locale '${locale}' not found`);
348
- }
353
+ const locale0 = checkLocale(locale);
354
+ const obj = getExistingLocale(locale0);
349
355
  activeName = alias[locale0] || locale0;
350
356
  activeLocale = obj;
351
357
  return activeLocale;
@@ -371,31 +377,24 @@ class Locale {
371
377
  const locale1 = locale === null || locale === void 0 ? void 0 : locale.toLowerCase();
372
378
  const locale0 = locale1 || activeName;
373
379
  if (!locale0) {
374
- return this.getEnOrdinal(n);
380
+ return getEnOrdinal(n);
375
381
  }
376
382
  switch (locale0) {
377
383
  case 'en':
378
384
  case 's':
379
385
  case 'a':
380
- case 'ashkenazi':
381
- case 'ashkenazi_litvish':
382
- case 'ashkenazi_poylish':
383
- case 'ashkenazi_standard':
384
- return this.getEnOrdinal(n);
386
+ return getEnOrdinal(n);
385
387
  case 'es':
386
388
  return n + 'º';
387
389
  case 'h':
388
390
  case 'he':
389
391
  case 'he-x-nonikud':
390
392
  return String(n);
391
- default:
392
- return n + '.';
393
393
  }
394
- }
395
- static getEnOrdinal(n) {
396
- const s = ['th', 'st', 'nd', 'rd'];
397
- const v = n % 100;
398
- return n + (s[(v - 20) % 10] || s[v] || s[0]);
394
+ if (locale0.startsWith('ashkenazi')) {
395
+ return getEnOrdinal(n);
396
+ }
397
+ return n + '.';
399
398
  }
400
399
  /**
401
400
  * Removes nekudot from Hebrew string
@@ -699,6 +698,82 @@ var holidayDescription0 = {
699
698
  "Yom Yerushalayim": "Jerusalem Day. Commemorates the re-unification of Jerusalem in 1967"
700
699
  };
701
700
 
701
+ /**
702
+ * Helper function to transform a string to make it more usable in a URL or filename.
703
+ * Converts to lowercase and replaces non-word characters with hyphen ('-').
704
+ * @example
705
+ * makeAnchor('Rosh Chodesh Adar II') // 'rosh-chodesh-adar-ii'
706
+ */
707
+ function makeAnchor(s) {
708
+ return s.toLowerCase()
709
+ .replace(/'/g, '')
710
+ .replace(/[^\w]/g, '-')
711
+ .replace(/-+/g, '-')
712
+ .replace(/^-/g, '')
713
+ .replace(/-$/g, '');
714
+ }
715
+
716
+ const parsha2id = new Map();
717
+ for (let id = 0; id < core.parshiot.length; id++) {
718
+ const name = core.parshiot[id];
719
+ parsha2id.set(makeAnchor(name), id + 1);
720
+ }
721
+ const doubledParshiyot = [
722
+ 'Vayakhel-Pekudei',
723
+ 'Tazria-Metzora',
724
+ 'Achrei Mot-Kedoshim',
725
+ 'Behar-Bechukotai',
726
+ 'Chukat-Balak',
727
+ 'Matot-Masei',
728
+ 'Nitzavim-Vayeilech',
729
+ ];
730
+ const doubled = new Set();
731
+ for (const name of doubledParshiyot) {
732
+ const anchor = makeAnchor(name);
733
+ doubled.add(anchor);
734
+ const [p1, p2] = anchor.split('-');
735
+ const id = parsha2id.get(p1);
736
+ parsha2id.set(anchor, id);
737
+ }
738
+ function parse8digitDateStr(date) {
739
+ const gy = date.substring(0, 4);
740
+ const gm = date.substring(4, 6);
741
+ const gd = date.substring(6, 8);
742
+ const yy = parseInt(gy, 10);
743
+ const mm = parseInt(gm, 10);
744
+ const dd = parseInt(gd, 10);
745
+ const dt = new Date(yy, mm - 1, dd);
746
+ if (yy < 100) {
747
+ dt.setFullYear(yy);
748
+ }
749
+ return dt;
750
+ }
751
+ function shortenSedrotUrl(u) {
752
+ const path = u.pathname;
753
+ const dash = path.lastIndexOf('-');
754
+ const dateStr = path.substring(dash + 1);
755
+ const name = path.substring(8, dash);
756
+ const id = parsha2id.get(name);
757
+ if (id && dateStr.length === 8) {
758
+ const dt = parse8digitDateStr(dateStr);
759
+ const hd = new core.HDate(dt);
760
+ let p = '/s/' + hd.getFullYear();
761
+ if (u.searchParams.get('i') === 'on') {
762
+ p += 'i';
763
+ u.searchParams.delete('i');
764
+ }
765
+ const id = parsha2id.get(name);
766
+ p += '/' + id;
767
+ if (doubled.has(name)) {
768
+ p += 'd';
769
+ }
770
+ u.pathname = p;
771
+ }
772
+ else {
773
+ u.pathname = '/s/' + path.substring(8);
774
+ }
775
+ }
776
+
702
777
  const LOC_FIELDS = ['elevation', 'admin1', 'asciiname', 'geo', 'zip', 'state', 'stateName', 'geonameid'];
703
778
  const holidayDescription = holidayDescription0;
704
779
  const countryNames = countryNames0;
@@ -729,20 +804,6 @@ function locationToPlainObj(location) {
729
804
  return { geo: 'none' };
730
805
  }
731
806
  }
732
- /**
733
- * Helper function to transform a string to make it more usable in a URL or filename.
734
- * Converts to lowercase and replaces non-word characters with hyphen ('-').
735
- * @example
736
- * makeAnchor('Rosh Chodesh Adar II') // 'rosh-chodesh-adar-ii'
737
- */
738
- function makeAnchor(s) {
739
- return s.toLowerCase()
740
- .replace(/'/g, '')
741
- .replace(/[^\w]/g, '-')
742
- .replace(/-+/g, '-')
743
- .replace(/^-/g, '')
744
- .replace(/-$/g, '');
745
- }
746
807
  function getDownloadFilename(options) {
747
808
  let fileName = 'hebcal';
748
809
  if (options.year) {
@@ -797,20 +858,30 @@ function getEventCategories(ev) {
797
858
  function renderTitleWithoutTime(ev) {
798
859
  return typeof ev.eventTime === 'undefined' ? ev.render() : ev.renderBrief();
799
860
  }
861
+ function shortLocationName(options) {
862
+ const loc = options.location;
863
+ if (!loc) {
864
+ return null;
865
+ }
866
+ if (options.preferAsciiName) {
867
+ const asciiname = loc.asciiname;
868
+ if (typeof asciiname === 'string') {
869
+ return asciiname;
870
+ }
871
+ }
872
+ return loc.getShortName();
873
+ }
800
874
  /**
801
875
  * Generates a title like "Hebcal 2020 Israel" or "Hebcal May 1993 Providence"
802
876
  */
803
877
  function getCalendarTitle(events, options) {
804
878
  let title = 'Hebcal';
805
- const location = options.location;
806
- const locationName = location === null || location === void 0 ? void 0 : location.getName();
879
+ const locationName = shortLocationName(options);
807
880
  if (options.yahrzeit) {
808
881
  title += ' Yahrzeits and Anniversaries';
809
882
  }
810
883
  else if (locationName) {
811
- const comma = locationName.indexOf(',');
812
- const name = (comma == -1) ? locationName : locationName.substring(0, comma);
813
- title += ' ' + name;
884
+ title += ' ' + locationName;
814
885
  }
815
886
  else if (options.il) {
816
887
  title += ' Israel';
@@ -905,7 +976,10 @@ function makeMemo(ev, il) {
905
976
  // fallthru
906
977
  }
907
978
  }
908
- return ev.memo || holidayDescription[ev.basename()];
979
+ if (ev.memo) {
980
+ return ev.memo;
981
+ }
982
+ return getHolidayDescription(ev);
909
983
  }
910
984
  /**
911
985
  * Appends utm_source and utm_medium parameters to a URL
@@ -927,7 +1001,7 @@ function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
927
1001
  u.pathname = '/h/' + path.substring(10);
928
1002
  }
929
1003
  else if (isSedrot) {
930
- u.pathname = '/s/' + path.substring(8);
1004
+ shortenSedrotUrl(u);
931
1005
  }
932
1006
  else { // isOmer
933
1007
  u.pathname = '/o/' + path.substring(6);
@@ -1023,8 +1097,9 @@ function eventToCsv(ev, options) {
1023
1097
  const mask = ev.getFlags();
1024
1098
  if (timed && typeof options.location === 'object') {
1025
1099
  const locationName = options.location.getShortName();
1026
- const comma = locationName.indexOf(',');
1027
- loc = (comma === -1) ? locationName : locationName.substring(0, comma);
1100
+ if (locationName) {
1101
+ loc = locationName;
1102
+ }
1028
1103
  }
1029
1104
  else {
1030
1105
  const category = CATEGORY[getEventCategories(ev)[0]];
@@ -1178,7 +1253,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
1178
1253
  d: core.gematriya(dd),
1179
1254
  };
1180
1255
  }
1181
- const memo = ev.memo || holidayDescription[ev.basename()];
1256
+ const memo = ev.memo || getHolidayDescription(ev);
1182
1257
  if (typeof memo === 'string' && memo.length !== 0) {
1183
1258
  result.memo = memo.normalize();
1184
1259
  }
@@ -1,2 +1,2 @@
1
- /*! @hebcal/rest-api v5.1.1 */
2
- var hebcal__rest_api=function(e,a,t,o){"use strict";const n=[0,31,28,31,30,31,30,31,31,30,31,30,31],r=[n,n.slice()];function i(e,a){return e-a*Math.floor(e/a)}function s(e,a){return Math.floor(e/a)}function h(e){return!(e%4||!(e%100)&&e%400)}function l(e){return"object"==typeof e&&Date.prototype.isPrototypeOf(e)}function d(e,a,t){const o=e-1;return 365*o+s(o,4)-s(o,100)+s(o,400)+s(367*a-362,12)+(a<=2?0:h(e)?-1:-2)+t}var c;r[1][2]=29,c||(c={}),c.abs2greg=function(e){if("number"!=typeof e)throw new TypeError(`Argument not a Number: ${e}`);const a=function(e){const a=e-1,t=s(a,146097),o=i(a,146097),n=s(o,36524),r=i(o,36524),h=s(r,1461),l=s(i(r,1461),365),d=400*t+100*n+4*h+l;return 4!==n&&4!==l?d+1:d}(e=Math.trunc(e)),t=s(12*(e-d(a,1,1)+(e<d(a,3,1)?0:h(a)?1:2))+373,367),o=e-d(a,t,1)+1,n=new Date(a,t-1,o);return a<100&&a>=0&&n.setFullYear(a),n},c.daysInMonth=function(e,a){return r[+h(a)][e]},c.greg2abs=function(e){if(!l(e))throw new TypeError(`Argument not a Date: ${e}`);return d(e.getFullYear(),e.getMonth()+1,e.getDate())},c.isDate=l,c.isLeapYear=h;const m={"א":1,"ב":2,"ג":3,"ד":4,"ה":5,"ו":6,"ז":7,"ח":8,"ט":9,"י":10,"כ":20,"ל":30,"מ":40,"נ":50,"ס":60,"ע":70,"פ":80,"צ":90,"ק":100,"ר":200,"ש":300,"ת":400},u=new Map,f=new Map;for(const[e,a]of Object.entries(m))u.set(e,a),f.set(a,e);function g(e){return e<0?"-00"+g(-e):e<10?"000"+e:e<100?"00"+e:e<1e3?"0"+e:String(e)}function b(e){return e<10?"0"+e:String(e)}function y(e){return g(e.getFullYear())+"-"+b(e.getMonth()+1)+"-"+b(e.getDate())}var p={headers:{"plural-forms":"nplurals=2; plural=(n > 1);"},contexts:{"":{Tevet:["Teves"]}}},w={headers:{"plural-forms":"nplurals=2; plural=(n > 1);"},contexts:{"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִּשְׁרֵי"]}}};const S={headers:{"plural-forms":"nplurals=2; plural=(n!=1);"},contexts:{"":{}}},v={h:"he",a:"ashkenazi",s:"en","":"en"},T=new Map;let H,A;class C{static lookupTranslation(e,a){const t=("string"==typeof a&&T.get(a.toLowerCase())||H)[e];if((null==t?void 0:t.length)&&t[0].length)return t[0]}static gettext(e,a){const t=this.lookupTranslation(e,a);return void 0===t?e:t}static addLocale(e,a){if("string"!=typeof e)throw new TypeError(`Invalid locale name: ${e}`);if("object"!=typeof a.contexts||"object"!=typeof a.contexts[""])throw new TypeError(`Locale '${e}' invalid compact format`);T.set(e.toLowerCase(),a.contexts[""])}static addTranslation(e,a,t){if("string"!=typeof e)throw new TypeError(`Invalid locale name: ${e}`);const o=T.get(e.toLowerCase());if(!o)throw new TypeError(`Unknown locale: ${e}`);if("string"!=typeof a||0===a.length)throw new TypeError(`Invalid id: ${a}`);const n=Array.isArray(t);if(n){const e=t[0];if("string"!=typeof e||0===e.length)throw new TypeError(`Invalid translation array: ${t}`)}else if("string"!=typeof t)throw new TypeError(`Invalid translation: ${t}`);o[a]=n?t:[t]}static addTranslations(e,a){if("string"!=typeof e)throw new TypeError(`Invalid locale name: ${e}`);const t=T.get(e.toLowerCase());if(!t)throw new TypeError(`Unknown locale: ${e}`);if("object"!=typeof a.contexts||"object"!=typeof a.contexts[""])throw new TypeError(`Locale '${e}' invalid compact format`);const o=a.contexts[""];Object.assign(t,o)}static useLocale(e){const a=e.toLowerCase(),t=T.get(a);if(!t)throw new RangeError(`Locale '${e}' not found`);return A=v[a]||a,H=t,H}static getLocaleName(){return A}static getLocaleNames(){return Array.from(T.keys()).sort(((e,a)=>e.localeCompare(a)))}static ordinal(e,a){const t=(null==a?void 0:a.toLowerCase())||A;if(!t)return this.getEnOrdinal(e);switch(t){case"en":case"s":case"a":case"ashkenazi":case"ashkenazi_litvish":case"ashkenazi_poylish":case"ashkenazi_standard":return this.getEnOrdinal(e);case"es":return e+"º";case"h":case"he":case"he-x-nonikud":return String(e);default:return e+"."}}static getEnOrdinal(e){const a=["th","st","nd","rd"],t=e%100;return e+(a[(t-20)%10]||a[t]||a[0])}static hebrewStripNikkud(e){return e.replace(/[\u0590-\u05bd]/g,"").replace(/[\u05bf-\u05c7]/g,"")}}C.addLocale("en",S),C.addLocale("s",S),C.addLocale("",S),C.useLocale("en"),C.addLocale("ashkenazi",p),C.addLocale("a",p),C.addLocale("he",w),C.addLocale("h",w);const I=w.contexts[""],M={};for(const[e,a]of Object.entries(I))M[e]=[C.hebrewStripNikkud(a[0])];const R={headers:w.headers,contexts:{"":M}};C.addLocale("he-x-NoNikud",R);const k=["elevation","admin1","asciiname","geo","zip","state","stateName","geonameid"],D={"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:"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)","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","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:"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","Purim Katan":"Minor Purim celebration during Adar I on leap years",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","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 1st month of the Hebrew year, 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 2nd month of the Hebrew year, 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 3rd month of the Hebrew year, 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 Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, 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 5th month of the Hebrew year, 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 6th month of the Hebrew year, 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 8th month of the Hebrew year, 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 9th month of the Hebrew year, 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 10th month of the Hebrew year, 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 11th month of the Hebrew year, 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 12th month of the Hebrew year, 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 12th month of the Hebrew year, occurs only on leap years, has 30 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 II":'Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes "Adar Bet" or "Adar Sheni", is the 13th month of the Hebrew year, 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:"Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai","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:"Ethiopian Jewish holiday occurring 50 days after Yom Kippur","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:"Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)","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"},B={AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"Democratic Republic of the Congo",CF:"Central African Republic",CG:"Republic of the Congo",CH:"Switzerland",CI:"Ivory Coast",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curacao",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GE:"Georgia",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MP:"Northern Mariana Islands",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PR:"Puerto Rico",PT:"Portugal",PY:"Paraguay",QA:"Qatar",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SK:"Slovakia",SL:"Sierra Leone",SN:"Senegal",SO:"Somalia",SR:"Suriname",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TM:"Turkmenistan",TN:"Tunisia",TR:"Turkey",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VN:"Vietnam",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"};function E(e){if("object"==typeof e&&null!==e&&"function"==typeof e.getLatitude){const a=e.getCountryCode(),t={title:e.getName(),city:e.getShortName(),tzid:e.getTzid(),latitude:e.getLatitude(),longitude:e.getLongitude(),cc:a,country:B[a]};for(const a of k){const o=e[a];o&&(t[a]=o)}return t}return{geo:"none"}}function N(e){return e.toLowerCase().replace(/'/g,"").replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-/g,"").replace(/-$/g,"")}function L(e){const a=e.getDesc();return"Purim"===a||"Erev Purim"===a?["holiday","major"]:e.getCategories()}function P(e,a){let t="Hebcal";const o=a.location,n=null==o?void 0:o.getName();if(a.yahrzeit)t+=" Yahrzeits and Anniversaries";else if(n){const e=n.indexOf(",");t+=" "+(-1==e?n:n.substring(0,e))}else a.il?t+=" Israel":t+=" Diaspora";if("1"==a.subscribe)return t;if(a.year&&(a.isHebrewYear||0==e.length))t+=" "+a.year;else if(e.length){const a=e[0].getDate().greg(),o=e[e.length-1].getDate().greg();if(a.getFullYear()!=o.getFullYear())t+=" "+a.getFullYear()+"-"+o.getFullYear();else if(a.getMonth()==o.getMonth()){t+=" "+new Intl.DateTimeFormat("en-US",{month:"long"}).format(a)+" "+a.getFullYear()}else t+=" "+a.getFullYear()}return t}function F(e,t=!1){const o=(e.getFlags()&a.flags.SHABBAT_MEVARCHIM?D["Shabbat Mevarchim Chodesh"]:D[e.getDesc()]||D[e.basename()]||"").normalize();if(t&&o){const e=o.indexOf(".");if(-1!=e)return o.substring(0,e)}return o}const Y=a.flags.DAF_YOMI|a.flags.OMER_COUNT|a.flags.SHABBAT_MEVARCHIM|a.flags.MOLAD|a.flags.USER_EVENT|a.flags.NACH_YOMI|a.flags.DAILY_LEARNING|a.flags.HEBREW_DATE|a.flags.YERUSHALMI_YOMI;function G(e,o){var n;const r=e.getFlags();if(r&Y||void 0!==e.eventTime)return"";const i=r&a.flags.PARSHA_HASHAVUA?t.getLeyningForParshaHaShavua(e,o):t.getLeyningForHoliday(e,o);let s="";return i&&(i.summary||i.haftara)&&(i.summary&&(s+=`Torah: ${i.summary}`),i.summary&&i.haftara&&(s+="\n"),i.haftara&&(s+="Haftarah: "+i.haftara,(null===(n=i.reason)||void 0===n?void 0:n.haftara)&&(s+=" | "+i.reason.haftara))),(null==i?void 0:i.sephardic)&&(s+="\nHaftarah for Sephardim: "+i.sephardic),s}function $(e,t){if(e.getFlags()&a.flags.PARSHA_HASHAVUA)try{const a=G(e,t);if(a)return a}catch(e){}return e.memo||D[e.basename()]}function O(e,a,t,o,n){const r=new URL(e),i="www.hebcal.com"===r.host;if(i){a&&r.searchParams.set("i","on");const e=r.pathname,i=e.startsWith("/holidays/"),s=e.startsWith("/sedrot/"),h=e.startsWith("/omer/");if(i||s||h)return r.host="hebcal.com",r.pathname=i?"/h/"+e.substring(10):s?"/s/"+e.substring(8):"/o/"+e.substring(6),n&&(n.startsWith("ical-")||n.startsWith("pdf-"))||(t&&r.searchParams.set("us",t),o&&r.searchParams.set("um",o)),n&&r.searchParams.set("uc",n),r.toString()}return(t=i?t:"hebcal.com")&&r.searchParams.set("utm_source",t),o&&r.searchParams.set("utm_medium",o),n&&r.searchParams.set("utm_campaign",n),r.toString()}function z(e){if(void 0!==e.eventTime)return!0;const t=e.getFlags();if(t&a.flags.HEBREW_DATE){return 1!==e.getDate().getDate()}return!!(t&(a.flags.DAILY_LEARNING|a.flags.DAF_YOMI|a.flags.YERUSHALMI_YOMI))||(!!(t&a.flags.MINOR_FAST&&"Yom Kippur Katan"===e.getDesc().substring(0,16))||!!(t&a.flags.SHABBAT_MEVARCHIM))}const U='"Subject","Start Date","Start Time","End Date","End Time","All day event","Description","Show time as","Location"',_={dafyomi:"Daf Yomi",mishnayomi:"Mishna Yomi",nachyomi:"Nach Yomi",yerushalmi:"Yerushalmi Yomi",hebdate:"Hebrew Date",holiday:"Jewish Holidays",mevarchim:"",molad:"",omer:"",parashat:"Torah Reading",roshchodesh:"Jewish Holidays",user:"Personal",zmanim:""};function J(e,t){const o=e.getDate().greg(),n=o.getDate(),r=o.getMonth()+1,i=String(o.getFullYear()).padStart(4,"0"),s=t.euro?`"${n}/${r}/${i}"`:`"${r}/${n}/${i}"`;let h="",l="",d="",c='"true"';const m=Boolean(e.eventTime);let u=z(e)?e.renderBrief(t.locale):e.render(t.locale);if(m){l=h=`"${a.HebrewCalendar.reformatTimeStr(e.eventTimeStr," PM",t)}"`,d=s,c='"false"'}let f="Jewish Holidays";const g=e.getFlags();if(m&&"object"==typeof t.location){const e=t.location.getShortName(),a=e.indexOf(",");f=-1===a?e:e.substring(0,a)}else{const a=_[L(e)[0]];"string"==typeof a&&(f=a)}if(u=u.replace(/,/g,"").replace(/"/g,"''"),t.appendHebrewToSubject){const a=e.renderBrief("he");a&&(u+=` / ${a}`)}let b=e.memo||F(e,!0);b||void 0===e.linkedEvent||(b=e.linkedEvent.render(t.locale));return`"${u}",${s},${h},${d},${l},${c},"${b.replace(/,/g,";").replace(/"/g,"''").replace(/\n/g," / ")}","${m||g&a.flags.CHAG?4:3}","${f}"`}function K(e){return y(e.getDate().greg())}function x(e,n,r=!0){const i=e.eventTime,s=Boolean(i),h=e.getDate(),l=h.greg(),d="object"==typeof n.location?n.location.getTzid():"UTC",c=s?a.Zmanim.formatISOWithTimeZone(d,i):y(l),m=L(e),u=e.getFlags();let f=z(e)?e.renderBrief(n.locale):e.render(n.locale);const g=e.getDesc(),b="Havdalah"===g||"Candle lighting"===g;if(b){f+=": "+a.HebrewCalendar.reformatTimeStr(e.eventTimeStr,"pm",n)}const p={title:f,date:c};s||(p.hdate=h.toString()),p.category=m[0],m.length>1&&(p.subcat=m[1]),"holiday"===m[0]&&u&a.flags.CHAG&&(p.yomtov=!0),f!=g&&(p.title_orig=g);const w=e.renderBrief("he");if(w&&(p.hebrew=a.Locale.hebrewStripNikkud(w)),!b){if(r){const r=n.il,i=u===a.flags.PARSHA_HASHAVUA,s=i?t.getLeyningForParshaHaShavua(e,r):t.getLeyningForHoliday(e,r);if(s){p.leyning=function(e){const a={};e.summary&&(a.torah=e.summary);e.haftara&&(a.haftarah=e.haftara);e.sephardic&&(a.haftarah_sephardic=e.sephardic);e.fullkriyah&&Z(a,e.fullkriyah);e.reason&&function(e,a){for(const t of["7","8","M"])if(a[t]){e["M"==t?"maftir":t]+=" | "+a[t]}a.haftara&&(e.haftarah+=" | "+a.haftara)}(a,e.reason);return a}(s);const a=h.getFullYear();if(i&&a>=5745){const a=o.getTriennialForParshaHaShavua(e,r);(null==a?void 0:a.aliyot)&&(p.leyning.triennial=Z({},a.aliyot))}}}const i=e.url();if(i){const e=n.utmSource||"js",a=n.utmMedium||"api",t=n.utmCampaign;p.link=O(i,Boolean(n.il),e,a,t)}}if(u&a.flags.OMER_COUNT){const a=e;p.omer={count:{he:a.getTodayIs("he"),en:a.getTodayIs("en")},sefira:{he:a.sefira("he"),translit:a.sefira("translit"),en:a.sefira("en")}}}if(u&a.flags.MOLAD){const t=e.molad,o=t.getYear();p.molad={hy:o,hm:a.HDate.getMonthName(t.getMonth(),o),dow:t.getDow(),hour:t.getHour(),minutes:t.getMinutes(),chalakim:t.getChalakim()},delete p.hebrew}if(n.heDateParts&&!s||u&a.flags.HEBREW_DATE){const e=h.getFullYear(),t=h.getMonthName(),o=h.getDate();p.heDateParts={y:a.gematriya(e),m:a.Locale.gettext(t,"he-x-NoNikud"),d:a.gematriya(o)}}const S=e.memo||D[e.basename()];return"string"==typeof S&&0!==S.length?p.memo=S.normalize():void 0!==e.linkedEvent&&(p.memo=e.linkedEvent.render(n.locale)),n.includeEvent&&(p.ev=e),p}function Z(e,a){for(const[o,n]of Object.entries(a))if(void 0!==n){e["M"==o?"maftir":o]=t.formatAliyahWithBook(n)}return e}const W={s:"en",a:"en","he-x-NoNikud":"he",h:"he",ah:"en",sh:"en"};function j(e,t){let o=e.render();const n=e.getDate().greg(),r=function(e,a,t,o){if(a){const a=e.eventTime;return a?a.toUTCString():t.toUTCString().replace(/ \S+ GMT$/," 00:00:00 GMT")}return o}(e,t.evPubDate,n,t.lastBuildDate),i=t.location,s=!!i&&i.getIsrael(),h=i?i.getTzid():"UTC",l=t.utmSource||"shabbat1c",d=t.utmMedium||"rss",c=function(e,t,o,n,r,i){let s,h;const l=e.eventTime||e.getDate().greg(),d=a.Zmanim.formatISOWithTimeZone(o,l),c=d.substring(0,d.indexOf("T")),m=`${c.replace(/-/g,"")}-${N(e.getDesc())}`,u=e.url();if(u)s=O(u,t,r,i).replace(/&/g,"&amp;"),h=`${u}#${m}`;else{const e=`${n}&dt=${c}`,a=O(e,t,r,i).replace(/&/g,"&amp;");h=e.replace(/&/g,"&amp;")+`#${m}`,s=`${a}#${m}`}return[s,h]}(e,s,h,t.mainUrl||"",l,d),m=c[0],u=c[1],f=L(e)[0],g=e.getDesc();let b;if("Havdalah"===g||"Candle lighting"===g){const t=o.indexOf(": ");if(-1!=t){const n={location:i,il:s,locale:a.Locale.getLocaleName()},r=a.HebrewCalendar.reformatTimeStr(e.eventTimeStr,"pm",n);o=o.substring(0,t)+": "+r}}else b=$(e,s);const y=t.dayFormat,p=b||y.format(n);return`<item>\n<title>${o}</title>\n<link>${m}</link>\n<guid isPermaLink="false">${u}</guid>\n<description>${-1===p.indexOf("<")?p:`<![CDATA[${p}]]>`}</description>\n<category>${f}</category>\n<pubDate>${r}</pubDate>\n${"candles"==f?`<geo:lat>${i.getLatitude()}</geo:lat>\n<geo:long>${i.getLongitude()}</geo:long>\n`:""}</item>\n`}return e.appendIsraelAndTracking=O,e.countryNames=B,e.eventToClassicApiObject=x,e.eventToCsv=J,e.eventToFullCalendar=function(e,t,o){const n=L(e),r=e.getFlags();"holiday"==n[0]&&r&a.flags.CHAG&&n.push("yomtov");const i=e.eventTime,s=Boolean(i),h={title:z(e)?e.renderBrief():e.render(),start:s?a.Zmanim.formatISOWithTimeZone(t,i):y(e.getDate().greg()),allDay:!s,className:n.join(" ")},l=e.renderBrief("he");l&&(h.hebrew=a.Locale.hebrewStripNikkud(l));const d=e.url();d&&(h.url=O(d,o,"js","fc"));const c=e.getDesc();if(!("Havdalah"===c||"Candle lighting"===c)){const a=$(e,o);a?h.description=a:void 0!==e.linkedEvent&&(h.description=e.linkedEvent.render())}return h},e.eventToRssItem2=j,e.eventsToClassicApi=function(e,a,t=!0){const o={title:P(e,a),date:(new Date).toISOString()};return o.location=E(a.location),e.length&&(o.range={start:K(e[0]),end:K(e[e.length-1])}),o.items=e.map((e=>x(e,a,t))),o},e.eventsToCsv=function(e,a){return[U].concat(e.map((e=>J(e,a)))).join("\r\n")+"\r\n"},e.eventsToRss2=function(e,a){a.dayFormat=new Intl.DateTimeFormat("en-US",{weekday:"long",day:"2-digit",month:"long",year:"numeric"});const t=a.location;if(!a.mainUrl||!a.selfUrl)throw new TypeError("mainUrl cannot be empty or blank");const o=a.buildDate=a.buildDate||new Date,n=o.getFullYear(),r=a.lastBuildDate=o.toUTCString(),i=a.title||P(e,a),s=a.description||i,h=a.utmSource||"shabbat1c",l=a.utmMedium||"rss";let d=`<?xml version="1.0" encoding="UTF-8"?>\n<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:atom="http://www.w3.org/2005/Atom">\n<channel>\n<title>${i}</title>\n<link>${O(a.mainUrl,Boolean(null==t?void 0:t.getIsrael()),h,l,a.utmCampaign).replace(/&/g,"&amp;")}</link>\n<atom:link href="${a.selfUrl.replace(/&/g,"&amp;")}" rel="self" type="application/rss+xml" />\n<description>${s}</description>\n<language>${a.lang||W[a.locale]||a.locale||"en-US"}</language>\n<copyright>Copyright (c) ${n} Michael J. Radwin. All rights reserved.</copyright>\n<lastBuildDate>${r}</lastBuildDate>\n`;for(const t of e)d+=j(t,a);return d+="</channel>\n</rss>\n",d},e.getCalendarTitle=P,e.getDownloadFilename=function(e){let t="hebcal";if(e.year)t+="_"+e.year,e.isHebrewYear&&(t+="h"),e.month&&(t+="_"+e.month);else if("object"==typeof e.start&&"object"==typeof e.end){const o=new a.HDate(e.start),n=new a.HDate(e.end),r=o.greg().getFullYear(),i=n.greg().getFullYear();t+=r===i?"_"+r:"_"+r+"_"+i}if("object"==typeof e.location){const a=e.location,o=a.zip||a.asciiname||a.getShortName();o&&(t+="_"+N(o).replace(/[-]/g,"_"))}return t},e.getEventCategories=L,e.getHolidayDescription=F,e.holidayDescription=D,e.locationToPlainObj=E,e.makeAnchor=N,e.makeMemo=$,e.makeTorahMemoText=G,e.pad2=b,e.pad4=g,e.renderTitleWithoutTime=function(e){return void 0===e.eventTime?e.render():e.renderBrief()},e.shouldRenderBrief=z,e.toISOString=function(e){return y(e)},e}({},hebcal,hebcal__leyning,hebcal__triennial);
1
+ /*! @hebcal/rest-api v5.1.3 */
2
+ var hebcal__rest_api=function(e,a,t,o){"use strict";const n=[0,31,28,31,30,31,30,31,31,30,31,30,31],r=[n,n.slice()];function i(e,a){return e-a*Math.floor(e/a)}function s(e,a){return Math.floor(e/a)}function h(e){return!(e%4||!(e%100)&&e%400)}function l(e){return"object"==typeof e&&Date.prototype.isPrototypeOf(e)}function c(e,a,t){const o=e-1;return 365*o+s(o,4)-s(o,100)+s(o,400)+s(367*a-362,12)+(a<=2?0:h(e)?-1:-2)+t}var d;r[1][2]=29,d||(d={}),d.abs2greg=function(e){if("number"!=typeof e)throw new TypeError(`Argument not a Number: ${e}`);const a=function(e){const a=e-1,t=s(a,146097),o=i(a,146097),n=s(o,36524),r=i(o,36524),h=s(r,1461),l=s(i(r,1461),365),c=400*t+100*n+4*h+l;return 4!==n&&4!==l?c+1:c}(e=Math.trunc(e)),t=s(12*(e-c(a,1,1)+(e<c(a,3,1)?0:h(a)?1:2))+373,367),o=e-c(a,t,1)+1,n=new Date(a,t-1,o);return a<100&&a>=0&&n.setFullYear(a),n},d.daysInMonth=function(e,a){return r[+h(a)][e]},d.greg2abs=function(e){if(!l(e))throw new TypeError(`Argument not a Date: ${e}`);return c(e.getFullYear(),e.getMonth()+1,e.getDate())},d.isDate=l,d.isLeapYear=h;const m={"א":1,"ב":2,"ג":3,"ד":4,"ה":5,"ו":6,"ז":7,"ח":8,"ט":9,"י":10,"כ":20,"ל":30,"מ":40,"נ":50,"ס":60,"ע":70,"פ":80,"צ":90,"ק":100,"ר":200,"ש":300,"ת":400},u=new Map,f=new Map;for(const[e,a]of Object.entries(m))u.set(e,a),f.set(a,e);function g(e){return e<0?"-00"+g(-e):e<10?"000"+e:e<100?"00"+e:e<1e3?"0"+e:String(e)}function b(e){return e>=0&&e<10?"0"+e:String(e)}function y(e){return g(e.getFullYear())+"-"+b(e.getMonth()+1)+"-"+b(e.getDate())}var p={headers:{"plural-forms":"nplurals=2; plural=(n > 1);"},contexts:{"":{Tevet:["Teves"]}}},S={headers:{"plural-forms":"nplurals=2; plural=(n > 1);"},contexts:{"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִּשְׁרֵי"]}}};const w={headers:{"plural-forms":"nplurals=2; plural=(n!=1);"},contexts:{"":{}}},v={h:"he",a:"ashkenazi",s:"en","":"en"},H=new Map;let T,A;function C(e){const a=["th","st","nd","rd"],t=e%100;return e+(a[(t-20)%10]||a[t]||a[0])}function M(e){if("string"!=typeof e)throw new TypeError(`Invalid locale name: ${e}`);return e.toLowerCase()}function I(e){const a=M(e),t=H.get(a);if(!t)throw new RangeError(`Locale '${e}' not found`);return t}class R{static lookupTranslation(e,a){const t=("string"==typeof a&&H.get(a.toLowerCase())||T)[e];if((null==t?void 0:t.length)&&t[0].length)return t[0]}static gettext(e,a){const t=this.lookupTranslation(e,a);return void 0===t?e:t}static addLocale(e,a){if(e=M(e),"object"!=typeof a.contexts||"object"!=typeof a.contexts[""])throw new TypeError(`Locale '${e}' invalid compact format`);H.set(e,a.contexts[""])}static addTranslation(e,a,t){const o=I(e);if("string"!=typeof a||0===a.length)throw new TypeError(`Invalid id string: ${a}`);const n=Array.isArray(t);if(n){const e=t[0];if("string"!=typeof e||0===e.length)throw new TypeError(`Invalid translation array: ${t}`)}else if("string"!=typeof t)throw new TypeError(`Invalid translation string: ${t}`);o[a]=n?t:[t]}static addTranslations(e,a){const t=I(e);if("object"!=typeof a.contexts||"object"!=typeof a.contexts[""])throw new TypeError(`Locale '${e}' invalid compact format`);const o=a.contexts[""];Object.assign(t,o)}static useLocale(e){const a=M(e),t=I(a);return A=v[a]||a,T=t,T}static getLocaleName(){return A}static getLocaleNames(){return Array.from(H.keys()).sort(((e,a)=>e.localeCompare(a)))}static ordinal(e,a){const t=(null==a?void 0:a.toLowerCase())||A;if(!t)return C(e);switch(t){case"en":case"s":case"a":return C(e);case"es":return e+"º";case"h":case"he":case"he-x-nonikud":return String(e)}return t.startsWith("ashkenazi")?C(e):e+"."}static hebrewStripNikkud(e){return e.replace(/[\u0590-\u05bd]/g,"").replace(/[\u05bf-\u05c7]/g,"")}}R.addLocale("en",w),R.addLocale("s",w),R.addLocale("",w),R.useLocale("en"),R.addLocale("ashkenazi",p),R.addLocale("a",p),R.addLocale("he",S),R.addLocale("h",S);const D=S.contexts[""],k={};for(const[e,a]of Object.entries(D))k[e]=[R.hebrewStripNikkud(a[0])];const B={headers:S.headers,contexts:{"":k}};R.addLocale("he-x-NoNikud",B);function N(e){return e.toLowerCase().replace(/'/g,"").replace(/[^\w]/g,"-").replace(/-+/g,"-").replace(/^-/g,"").replace(/-$/g,"")}const E=new Map;for(let e=0;e<a.parshiot.length;e++){const t=a.parshiot[e];E.set(N(t),e+1)}const P=["Vayakhel-Pekudei","Tazria-Metzora","Achrei Mot-Kedoshim","Behar-Bechukotai","Chukat-Balak","Matot-Masei","Nitzavim-Vayeilech"],L=new Set;for(const e of P){const a=N(e);L.add(a);const[t,o]=a.split("-"),n=E.get(t);E.set(a,n)}function F(e){const t=e.pathname,o=t.lastIndexOf("-"),n=t.substring(o+1),r=t.substring(8,o);if(E.get(r)&&8===n.length){const t=function(e){const a=e.substring(0,4),t=e.substring(4,6),o=e.substring(6,8),n=parseInt(a,10),r=parseInt(t,10),i=parseInt(o,10),s=new Date(n,r-1,i);return n<100&&s.setFullYear(n),s}(n);let o="/s/"+new a.HDate(t).getFullYear();"on"===e.searchParams.get("i")&&(o+="i",e.searchParams.delete("i"));o+="/"+E.get(r),L.has(r)&&(o+="d"),e.pathname=o}else e.pathname="/s/"+t.substring(8)}const Y=["elevation","admin1","asciiname","geo","zip","state","stateName","geonameid"],G={"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:"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)","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","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:"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","Purim Katan":"Minor Purim celebration during Adar I on leap years",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","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 1st month of the Hebrew year, 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 2nd month of the Hebrew year, 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 3rd month of the Hebrew year, 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 Tamuz on the Hebrew calendar. תַּמּוּז (transliterated Tamuz or Tammuz) is the 4th month of the Hebrew year, 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 5th month of the Hebrew year, 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 6th month of the Hebrew year, 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 8th month of the Hebrew year, 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 9th month of the Hebrew year, 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 10th month of the Hebrew year, 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 11th month of the Hebrew year, 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 12th month of the Hebrew year, 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 12th month of the Hebrew year, occurs only on leap years, has 30 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 II":'Start of month of Adar II (on leap years) on the Hebrew calendar. Adar II (אַדָר ב׳), sometimes "Adar Bet" or "Adar Sheni", is the 13th month of the Hebrew year, 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:"Festival of Weeks. Commemorates the giving of the Torah at Mount Sinai","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:"Ethiopian Jewish holiday occurring 50 days after Yom Kippur","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:"Feast of Booths. Also called the Feast of Tabernacles, the seven-day holiday is one of the Three Pilgrimage Festivals (Hebrew: שלוש רגלים, shalosh regalim)","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"},$={AD:"Andorra",AE:"United Arab Emirates",AF:"Afghanistan",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"Democratic Republic of the Congo",CF:"Central African Republic",CG:"Republic of the Congo",CH:"Switzerland",CI:"Ivory Coast",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cape Verde",CW:"Curacao",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FO:"Faroe Islands",FR:"France",GA:"Gabon",GB:"United Kingdom",GE:"Georgia",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MP:"Northern Mariana Islands",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PR:"Puerto Rico",PT:"Portugal",PY:"Paraguay",QA:"Qatar",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SK:"Slovakia",SL:"Sierra Leone",SN:"Senegal",SO:"Somalia",SR:"Suriname",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TM:"Turkmenistan",TN:"Tunisia",TR:"Turkey",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"British Virgin Islands",VN:"Vietnam",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"};function z(e){if("object"==typeof e&&null!==e&&"function"==typeof e.getLatitude){const a=e.getCountryCode(),t={title:e.getName(),city:e.getShortName(),tzid:e.getTzid(),latitude:e.getLatitude(),longitude:e.getLongitude(),cc:a,country:$[a]};for(const a of Y){const o=e[a];o&&(t[a]=o)}return t}return{geo:"none"}}function O(e){const a=e.getDesc();return"Purim"===a||"Erev Purim"===a?["holiday","major"]:e.getCategories()}function U(e,a){let t="Hebcal";const o=function(e){const a=e.location;if(!a)return null;if(e.preferAsciiName){const e=a.asciiname;if("string"==typeof e)return e}return a.getShortName()}(a);if(a.yahrzeit?t+=" Yahrzeits and Anniversaries":o?t+=" "+o:a.il?t+=" Israel":t+=" Diaspora","1"==a.subscribe)return t;if(a.year&&(a.isHebrewYear||0==e.length))t+=" "+a.year;else if(e.length){const a=e[0].getDate().greg(),o=e[e.length-1].getDate().greg();if(a.getFullYear()!=o.getFullYear())t+=" "+a.getFullYear()+"-"+o.getFullYear();else if(a.getMonth()==o.getMonth()){t+=" "+new Intl.DateTimeFormat("en-US",{month:"long"}).format(a)+" "+a.getFullYear()}else t+=" "+a.getFullYear()}return t}function J(e,t=!1){const o=(e.getFlags()&a.flags.SHABBAT_MEVARCHIM?G["Shabbat Mevarchim Chodesh"]:G[e.getDesc()]||G[e.basename()]||"").normalize();if(t&&o){const e=o.indexOf(".");if(-1!=e)return o.substring(0,e)}return o}const K=a.flags.DAF_YOMI|a.flags.OMER_COUNT|a.flags.SHABBAT_MEVARCHIM|a.flags.MOLAD|a.flags.USER_EVENT|a.flags.NACH_YOMI|a.flags.DAILY_LEARNING|a.flags.HEBREW_DATE|a.flags.YERUSHALMI_YOMI;function _(e,o){var n;const r=e.getFlags();if(r&K||void 0!==e.eventTime)return"";const i=r&a.flags.PARSHA_HASHAVUA?t.getLeyningForParshaHaShavua(e,o):t.getLeyningForHoliday(e,o);let s="";return i&&(i.summary||i.haftara)&&(i.summary&&(s+=`Torah: ${i.summary}`),i.summary&&i.haftara&&(s+="\n"),i.haftara&&(s+="Haftarah: "+i.haftara,(null===(n=i.reason)||void 0===n?void 0:n.haftara)&&(s+=" | "+i.reason.haftara))),(null==i?void 0:i.sephardic)&&(s+="\nHaftarah for Sephardim: "+i.sephardic),s}function x(e,t){if(e.getFlags()&a.flags.PARSHA_HASHAVUA)try{const a=_(e,t);if(a)return a}catch(e){}return e.memo?e.memo:J(e)}function W(e,a,t,o,n){const r=new URL(e),i="www.hebcal.com"===r.host;if(i){a&&r.searchParams.set("i","on");const e=r.pathname,i=e.startsWith("/holidays/"),s=e.startsWith("/sedrot/"),h=e.startsWith("/omer/");if(i||s||h)return r.host="hebcal.com",i?r.pathname="/h/"+e.substring(10):s?F(r):r.pathname="/o/"+e.substring(6),n&&(n.startsWith("ical-")||n.startsWith("pdf-"))||(t&&r.searchParams.set("us",t),o&&r.searchParams.set("um",o)),n&&r.searchParams.set("uc",n),r.toString()}return(t=i?t:"hebcal.com")&&r.searchParams.set("utm_source",t),o&&r.searchParams.set("utm_medium",o),n&&r.searchParams.set("utm_campaign",n),r.toString()}function Z(e){if(void 0!==e.eventTime)return!0;const t=e.getFlags();if(t&a.flags.HEBREW_DATE){return 1!==e.getDate().getDate()}return!!(t&(a.flags.DAILY_LEARNING|a.flags.DAF_YOMI|a.flags.YERUSHALMI_YOMI))||(!!(t&a.flags.MINOR_FAST&&"Yom Kippur Katan"===e.getDesc().substring(0,16))||!!(t&a.flags.SHABBAT_MEVARCHIM))}const j='"Subject","Start Date","Start Time","End Date","End Time","All day event","Description","Show time as","Location"',V={dafyomi:"Daf Yomi",mishnayomi:"Mishna Yomi",nachyomi:"Nach Yomi",yerushalmi:"Yerushalmi Yomi",hebdate:"Hebrew Date",holiday:"Jewish Holidays",mevarchim:"",molad:"",omer:"",parashat:"Torah Reading",roshchodesh:"Jewish Holidays",user:"Personal",zmanim:""};function Q(e,t){const o=e.getDate().greg(),n=o.getDate(),r=o.getMonth()+1,i=String(o.getFullYear()).padStart(4,"0"),s=t.euro?`"${n}/${r}/${i}"`:`"${r}/${n}/${i}"`;let h="",l="",c="",d='"true"';const m=Boolean(e.eventTime);let u=Z(e)?e.renderBrief(t.locale):e.render(t.locale);if(m){l=h=`"${a.HebrewCalendar.reformatTimeStr(e.eventTimeStr," PM",t)}"`,c=s,d='"false"'}let f="Jewish Holidays";const g=e.getFlags();if(m&&"object"==typeof t.location){const e=t.location.getShortName();e&&(f=e)}else{const a=V[O(e)[0]];"string"==typeof a&&(f=a)}if(u=u.replace(/,/g,"").replace(/"/g,"''"),t.appendHebrewToSubject){const a=e.renderBrief("he");a&&(u+=` / ${a}`)}let b=e.memo||J(e,!0);b||void 0===e.linkedEvent||(b=e.linkedEvent.render(t.locale));return`"${u}",${s},${h},${c},${l},${d},"${b.replace(/,/g,";").replace(/"/g,"''").replace(/\n/g," / ")}","${m||g&a.flags.CHAG?4:3}","${f}"`}function q(e){return y(e.getDate().greg())}function X(e,n,r=!0){const i=e.eventTime,s=Boolean(i),h=e.getDate(),l=h.greg(),c="object"==typeof n.location?n.location.getTzid():"UTC",d=s?a.Zmanim.formatISOWithTimeZone(c,i):y(l),m=O(e),u=e.getFlags();let f=Z(e)?e.renderBrief(n.locale):e.render(n.locale);const g=e.getDesc(),b="Havdalah"===g||"Candle lighting"===g;if(b){f+=": "+a.HebrewCalendar.reformatTimeStr(e.eventTimeStr,"pm",n)}const p={title:f,date:d};s||(p.hdate=h.toString()),p.category=m[0],m.length>1&&(p.subcat=m[1]),"holiday"===m[0]&&u&a.flags.CHAG&&(p.yomtov=!0),f!=g&&(p.title_orig=g);const S=e.renderBrief("he");if(S&&(p.hebrew=a.Locale.hebrewStripNikkud(S)),!b){if(r){const r=n.il,i=u===a.flags.PARSHA_HASHAVUA,s=i?t.getLeyningForParshaHaShavua(e,r):t.getLeyningForHoliday(e,r);if(s){p.leyning=function(e){const a={};e.summary&&(a.torah=e.summary);e.haftara&&(a.haftarah=e.haftara);e.sephardic&&(a.haftarah_sephardic=e.sephardic);e.fullkriyah&&ee(a,e.fullkriyah);e.reason&&function(e,a){for(const t of["7","8","M"])if(a[t]){e["M"==t?"maftir":t]+=" | "+a[t]}a.haftara&&(e.haftarah+=" | "+a.haftara)}(a,e.reason);return a}(s);const a=h.getFullYear();if(i&&a>=5745){const a=o.getTriennialForParshaHaShavua(e,r);(null==a?void 0:a.aliyot)&&(p.leyning.triennial=ee({},a.aliyot))}}}const i=e.url();if(i){const e=n.utmSource||"js",a=n.utmMedium||"api",t=n.utmCampaign;p.link=W(i,Boolean(n.il),e,a,t)}}if(u&a.flags.OMER_COUNT){const a=e;p.omer={count:{he:a.getTodayIs("he"),en:a.getTodayIs("en")},sefira:{he:a.sefira("he"),translit:a.sefira("translit"),en:a.sefira("en")}}}if(u&a.flags.MOLAD){const t=e.molad,o=t.getYear();p.molad={hy:o,hm:a.HDate.getMonthName(t.getMonth(),o),dow:t.getDow(),hour:t.getHour(),minutes:t.getMinutes(),chalakim:t.getChalakim()},delete p.hebrew}if(n.heDateParts&&!s||u&a.flags.HEBREW_DATE){const e=h.getFullYear(),t=h.getMonthName(),o=h.getDate();p.heDateParts={y:a.gematriya(e),m:a.Locale.gettext(t,"he-x-NoNikud"),d:a.gematriya(o)}}const w=e.memo||J(e);return"string"==typeof w&&0!==w.length?p.memo=w.normalize():void 0!==e.linkedEvent&&(p.memo=e.linkedEvent.render(n.locale)),n.includeEvent&&(p.ev=e),p}function ee(e,a){for(const[o,n]of Object.entries(a))if(void 0!==n){e["M"==o?"maftir":o]=t.formatAliyahWithBook(n)}return e}const ae={s:"en",a:"en","he-x-NoNikud":"he",h:"he",ah:"en",sh:"en"};function te(e,t){let o=e.render();const n=e.getDate().greg(),r=function(e,a,t,o){if(a){const a=e.eventTime;return a?a.toUTCString():t.toUTCString().replace(/ \S+ GMT$/," 00:00:00 GMT")}return o}(e,t.evPubDate,n,t.lastBuildDate),i=t.location,s=!!i&&i.getIsrael(),h=i?i.getTzid():"UTC",l=t.utmSource||"shabbat1c",c=t.utmMedium||"rss",d=function(e,t,o,n,r,i){let s,h;const l=e.eventTime||e.getDate().greg(),c=a.Zmanim.formatISOWithTimeZone(o,l),d=c.substring(0,c.indexOf("T")),m=`${d.replace(/-/g,"")}-${N(e.getDesc())}`,u=e.url();if(u)s=W(u,t,r,i).replace(/&/g,"&amp;"),h=`${u}#${m}`;else{const e=`${n}&dt=${d}`,a=W(e,t,r,i).replace(/&/g,"&amp;");h=e.replace(/&/g,"&amp;")+`#${m}`,s=`${a}#${m}`}return[s,h]}(e,s,h,t.mainUrl||"",l,c),m=d[0],u=d[1],f=O(e)[0],g=e.getDesc();let b;if("Havdalah"===g||"Candle lighting"===g){const t=o.indexOf(": ");if(-1!=t){const n={location:i,il:s,locale:a.Locale.getLocaleName()},r=a.HebrewCalendar.reformatTimeStr(e.eventTimeStr,"pm",n);o=o.substring(0,t)+": "+r}}else b=x(e,s);const y=t.dayFormat,p=b||y.format(n);return`<item>\n<title>${o}</title>\n<link>${m}</link>\n<guid isPermaLink="false">${u}</guid>\n<description>${-1===p.indexOf("<")?p:`<![CDATA[${p}]]>`}</description>\n<category>${f}</category>\n<pubDate>${r}</pubDate>\n${"candles"==f?`<geo:lat>${i.getLatitude()}</geo:lat>\n<geo:long>${i.getLongitude()}</geo:long>\n`:""}</item>\n`}return e.appendIsraelAndTracking=W,e.countryNames=$,e.eventToClassicApiObject=X,e.eventToCsv=Q,e.eventToFullCalendar=function(e,t,o){const n=O(e),r=e.getFlags();"holiday"==n[0]&&r&a.flags.CHAG&&n.push("yomtov");const i=e.eventTime,s=Boolean(i),h={title:Z(e)?e.renderBrief():e.render(),start:s?a.Zmanim.formatISOWithTimeZone(t,i):y(e.getDate().greg()),allDay:!s,className:n.join(" ")},l=e.renderBrief("he");l&&(h.hebrew=a.Locale.hebrewStripNikkud(l));const c=e.url();c&&(h.url=W(c,o,"js","fc"));const d=e.getDesc();if(!("Havdalah"===d||"Candle lighting"===d)){const a=x(e,o);a?h.description=a:void 0!==e.linkedEvent&&(h.description=e.linkedEvent.render())}return h},e.eventToRssItem2=te,e.eventsToClassicApi=function(e,a,t=!0){const o={title:U(e,a),date:(new Date).toISOString()};return o.location=z(a.location),e.length&&(o.range={start:q(e[0]),end:q(e[e.length-1])}),o.items=e.map((e=>X(e,a,t))),o},e.eventsToCsv=function(e,a){return[j].concat(e.map((e=>Q(e,a)))).join("\r\n")+"\r\n"},e.eventsToRss2=function(e,a){a.dayFormat=new Intl.DateTimeFormat("en-US",{weekday:"long",day:"2-digit",month:"long",year:"numeric"});const t=a.location;if(!a.mainUrl||!a.selfUrl)throw new TypeError("mainUrl cannot be empty or blank");const o=a.buildDate=a.buildDate||new Date,n=o.getFullYear(),r=a.lastBuildDate=o.toUTCString(),i=a.title||U(e,a),s=a.description||i,h=a.utmSource||"shabbat1c",l=a.utmMedium||"rss";let c=`<?xml version="1.0" encoding="UTF-8"?>\n<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:atom="http://www.w3.org/2005/Atom">\n<channel>\n<title>${i}</title>\n<link>${W(a.mainUrl,Boolean(null==t?void 0:t.getIsrael()),h,l,a.utmCampaign).replace(/&/g,"&amp;")}</link>\n<atom:link href="${a.selfUrl.replace(/&/g,"&amp;")}" rel="self" type="application/rss+xml" />\n<description>${s}</description>\n<language>${a.lang||ae[a.locale]||a.locale||"en-US"}</language>\n<copyright>Copyright (c) ${n} Michael J. Radwin. All rights reserved.</copyright>\n<lastBuildDate>${r}</lastBuildDate>\n`;for(const t of e)c+=te(t,a);return c+="</channel>\n</rss>\n",c},e.getCalendarTitle=U,e.getDownloadFilename=function(e){let t="hebcal";if(e.year)t+="_"+e.year,e.isHebrewYear&&(t+="h"),e.month&&(t+="_"+e.month);else if("object"==typeof e.start&&"object"==typeof e.end){const o=new a.HDate(e.start),n=new a.HDate(e.end),r=o.greg().getFullYear(),i=n.greg().getFullYear();t+=r===i?"_"+r:"_"+r+"_"+i}if("object"==typeof e.location){const a=e.location,o=a.zip||a.asciiname||a.getShortName();o&&(t+="_"+N(o).replace(/[-]/g,"_"))}return t},e.getEventCategories=O,e.getHolidayDescription=J,e.holidayDescription=G,e.locationToPlainObj=z,e.makeAnchor=N,e.makeMemo=x,e.makeTorahMemoText=_,e.pad2=b,e.pad4=g,e.renderTitleWithoutTime=function(e){return void 0===e.eventTime?e.render():e.renderBrief()},e.shouldRenderBrief=Z,e.toISOString=function(e){return y(e)},e}({},hebcal,hebcal__leyning,hebcal__triennial);
package/dist/common.d.ts CHANGED
@@ -21,6 +21,7 @@ export type RestApiEventOptions = {
21
21
  lastBuildDate?: string;
22
22
  evPubDate?: boolean;
23
23
  lang?: string;
24
+ preferAsciiName?: boolean;
24
25
  };
25
26
  export type RestApiOptions = CalOptions & RestApiEventOptions;
26
27
  /**
@@ -48,13 +49,6 @@ export declare const countryNames: StringMap;
48
49
  * Converts a @hebcal/core `Location` to a plain JS object.
49
50
  */
50
51
  export declare function locationToPlainObj(location: Location | undefined): LocationPlainObj;
51
- /**
52
- * Helper function to transform a string to make it more usable in a URL or filename.
53
- * Converts to lowercase and replaces non-word characters with hyphen ('-').
54
- * @example
55
- * makeAnchor('Rosh Chodesh Adar II') // 'rosh-chodesh-adar-ii'
56
- */
57
- export declare function makeAnchor(s: string): string;
58
52
  export declare function getDownloadFilename(options: RestApiOptions): string;
59
53
  /**
60
54
  * Returns just the date portion as YYYY-MM-DD