@hebcal/core 6.5.3 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +4 -4
  2. package/dist/bundle.js +6525 -5562
  3. package/dist/bundle.js.map +1 -1
  4. package/dist/bundle.min.js +18 -18
  5. package/dist/bundle.min.js.map +1 -1
  6. package/dist/esm/CalOptions.d.ts +15 -3
  7. package/dist/esm/DailyLearning.js +1 -1
  8. package/dist/esm/HebrewDateEvent.js +1 -1
  9. package/dist/esm/HolidayEvent.js +7 -6
  10. package/dist/esm/HolidayEvent.js.map +1 -1
  11. package/dist/esm/MevarchimChodeshEvent.js +3 -2
  12. package/dist/esm/MevarchimChodeshEvent.js.map +1 -1
  13. package/dist/esm/ParshaEvent.js +18 -7
  14. package/dist/esm/ParshaEvent.js.map +1 -1
  15. package/dist/esm/TimedEvent.js +1 -1
  16. package/dist/esm/TimedEvent.js.map +1 -1
  17. package/dist/esm/YomKippurKatanEvent.js +3 -2
  18. package/dist/esm/YomKippurKatanEvent.js.map +1 -1
  19. package/dist/esm/ashkenazi.po.js +2 -2
  20. package/dist/esm/ashkenazi.po.js.map +1 -1
  21. package/dist/esm/calendar.js +14 -20
  22. package/dist/esm/calendar.js.map +1 -1
  23. package/dist/esm/candles.d.ts +8 -3
  24. package/dist/esm/candles.js +65 -11
  25. package/dist/esm/candles.js.map +1 -1
  26. package/dist/esm/cities.json.js +1 -1
  27. package/dist/esm/event.js +1 -1
  28. package/dist/esm/getStartAndEnd.js +1 -1
  29. package/dist/esm/hallel.js +1 -1
  30. package/dist/esm/he-x-NoNikud.po.js +1 -1
  31. package/dist/esm/he.po.d.ts +0 -1
  32. package/dist/esm/he.po.js +2 -2
  33. package/dist/esm/he.po.js.map +1 -1
  34. package/dist/esm/hebcal.js +1 -1
  35. package/dist/esm/holidays.js +1 -1
  36. package/dist/esm/holidays.js.map +1 -1
  37. package/dist/esm/index.js +1 -1
  38. package/dist/esm/isAssurBemlacha.js +1 -1
  39. package/dist/esm/isAveilut.js +1 -1
  40. package/dist/esm/isFastDay.js +1 -1
  41. package/dist/esm/locale.js +1 -1
  42. package/dist/esm/location.js +1 -1
  43. package/dist/esm/location.js.map +1 -1
  44. package/dist/esm/modern.js +1 -1
  45. package/dist/esm/molad.d.ts +1 -1
  46. package/dist/esm/molad.js +4 -3
  47. package/dist/esm/molad.js.map +1 -1
  48. package/dist/esm/moladBase.js +1 -1
  49. package/dist/esm/moladDate.d.ts +1 -1
  50. package/dist/esm/moladDate.js +2 -2
  51. package/dist/esm/moladDate.js.map +1 -1
  52. package/dist/esm/omer.js +1 -1
  53. package/dist/esm/parshaName.js +3 -2
  54. package/dist/esm/parshaName.js.map +1 -1
  55. package/dist/esm/parshaYear.js +1 -1
  56. package/dist/esm/pkgVersion.d.ts +1 -1
  57. package/dist/esm/pkgVersion.js +2 -2
  58. package/dist/esm/pkgVersion.js.map +1 -1
  59. package/dist/esm/reformatTimeStr.js +1 -1
  60. package/dist/esm/reformatTimeStr.js.map +1 -1
  61. package/dist/esm/sedra.d.ts +14 -0
  62. package/dist/esm/sedra.js +62 -1
  63. package/dist/esm/sedra.js.map +1 -1
  64. package/dist/esm/sefira.json.js +1 -1
  65. package/dist/esm/staticHolidays.js +1 -1
  66. package/dist/esm/string.d.ts +2 -0
  67. package/dist/esm/string.js +10 -0
  68. package/dist/esm/string.js.map +1 -0
  69. package/dist/esm/tachanun.js +1 -1
  70. package/dist/esm/tachanun.js.map +1 -1
  71. package/dist/esm/zmanim.d.ts +1 -1
  72. package/dist/esm/zmanim.js +3 -4
  73. package/dist/esm/zmanim.js.map +1 -1
  74. package/package.json +18 -21
  75. package/po/ashkenazi.po +1 -12
  76. package/po/he.po +0 -3
  77. package/dist/eslint.config.d.mts +0 -83
  78. package/dist/eslint.config.mjs +0 -29
  79. package/dist/esm/temporal-shim.d.ts +0 -1
  80. package/dist/esm/temporal-shim.js +0 -11
  81. package/dist/esm/temporal-shim.js.map +0 -1
  82. package/dist/po2json.d.ts +0 -1
  83. package/dist/po2json.js +0 -40
  84. package/dist/src/CalOptions.d.ts +0 -171
  85. package/dist/src/CalOptions.js +0 -1
  86. package/dist/src/DailyLearning.d.ts +0 -69
  87. package/dist/src/DailyLearning.js +0 -92
  88. package/dist/src/HebrewDateEvent.d.ts +0 -37
  89. package/dist/src/HebrewDateEvent.js +0 -72
  90. package/dist/src/HolidayEvent.d.ts +0 -117
  91. package/dist/src/HolidayEvent.js +0 -235
  92. package/dist/src/MevarchimChodeshEvent.d.ts +0 -26
  93. package/dist/src/MevarchimChodeshEvent.js +0 -51
  94. package/dist/src/ParshaEvent.d.ts +0 -24
  95. package/dist/src/ParshaEvent.js +0 -49
  96. package/dist/src/TimedEvent.d.ts +0 -76
  97. package/dist/src/TimedEvent.js +0 -134
  98. package/dist/src/YomKippurKatanEvent.d.ts +0 -23
  99. package/dist/src/YomKippurKatanEvent.js +0 -39
  100. package/dist/src/ashkenazi.po.d.ts +0 -84
  101. package/dist/src/ashkenazi.po.js +0 -1
  102. package/dist/src/calendar.d.ts +0 -112
  103. package/dist/src/calendar.js +0 -721
  104. package/dist/src/candles.d.ts +0 -57
  105. package/dist/src/candles.js +0 -185
  106. package/dist/src/cities.json +0 -67
  107. package/dist/src/event.d.ts +0 -233
  108. package/dist/src/event.js +0 -295
  109. package/dist/src/getStartAndEnd.d.ts +0 -6
  110. package/dist/src/getStartAndEnd.js +0 -105
  111. package/dist/src/hallel.d.ts +0 -6
  112. package/dist/src/hallel.js +0 -39
  113. package/dist/src/he-x-NoNikud.po.d.ts +0 -28
  114. package/dist/src/he-x-NoNikud.po.js +0 -1
  115. package/dist/src/he.po.d.ts +0 -218
  116. package/dist/src/he.po.js +0 -1
  117. package/dist/src/hebcal.d.ts +0 -338
  118. package/dist/src/hebcal.js +0 -413
  119. package/dist/src/holidays.d.ts +0 -41
  120. package/dist/src/holidays.js +0 -324
  121. package/dist/src/index.d.ts +0 -30
  122. package/dist/src/index.js +0 -29
  123. package/dist/src/isAssurBemlacha.d.ts +0 -29
  124. package/dist/src/isAssurBemlacha.js +0 -82
  125. package/dist/src/isAveilut.d.ts +0 -22
  126. package/dist/src/isAveilut.js +0 -48
  127. package/dist/src/isFastDay.d.ts +0 -21
  128. package/dist/src/isFastDay.js +0 -31
  129. package/dist/src/locale.d.ts +0 -1
  130. package/dist/src/locale.js +0 -11
  131. package/dist/src/location.d.ts +0 -167
  132. package/dist/src/location.js +0 -342
  133. package/dist/src/modern.d.ts +0 -18
  134. package/dist/src/modern.js +0 -59
  135. package/dist/src/molad.d.ts +0 -164
  136. package/dist/src/molad.js +0 -297
  137. package/dist/src/moladBase.d.ts +0 -15
  138. package/dist/src/moladBase.js +0 -78
  139. package/dist/src/moladDate.d.ts +0 -12
  140. package/dist/src/moladDate.js +0 -58
  141. package/dist/src/omer.d.ts +0 -128
  142. package/dist/src/omer.js +0 -385
  143. package/dist/src/parshaName.d.ts +0 -2
  144. package/dist/src/parshaName.js +0 -12
  145. package/dist/src/parshaYear.d.ts +0 -20
  146. package/dist/src/parshaYear.js +0 -35
  147. package/dist/src/pkgVersion.d.ts +0 -2
  148. package/dist/src/pkgVersion.js +0 -2
  149. package/dist/src/reformatTimeStr.d.ts +0 -8
  150. package/dist/src/reformatTimeStr.js +0 -47
  151. package/dist/src/sedra.d.ts +0 -175
  152. package/dist/src/sedra.js +0 -563
  153. package/dist/src/sefira.json +0 -63
  154. package/dist/src/staticHolidays.d.ts +0 -192
  155. package/dist/src/staticHolidays.js +0 -637
  156. package/dist/src/tachanun.d.ts +0 -29
  157. package/dist/src/tachanun.js +0 -120
  158. package/dist/src/temporal-shim.d.ts +0 -1
  159. package/dist/src/temporal-shim.js +0 -8
  160. package/dist/src/zmanim.d.ts +0 -620
  161. package/dist/src/zmanim.js +0 -1003
  162. package/dist/version.d.ts +0 -1
  163. package/dist/version.js +0 -8
@@ -1,5 +1,6 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import './locale.js';
3
+ import { smartApostrophe } from './string.js';
3
4
  import { Locale } from '@hebcal/hdate';
4
5
 
5
6
  /** @private */
@@ -9,7 +10,7 @@ function renderParshaName(parsha, locale) {
9
10
  const hyphen = Locale.isHebrewLocale(locale) ? '־' : '-';
10
11
  name += hyphen + Locale.gettext(parsha[1], locale);
11
12
  }
12
- name = name.replace(/'/g, '’');
13
+ name = smartApostrophe(name);
13
14
  const str = Locale.gettext('Parashat', locale) + ' ' + name;
14
15
  return str.normalize();
15
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parshaName.js","sources":["../../../src/parshaName.ts"],"sourcesContent":["import {Locale} from './locale';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n let name = Locale.gettext(parsha[0], locale);\n if (parsha.length === 2) {\n const hyphen = Locale.isHebrewLocale(locale) ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale);\n }\n name = name.replace(/'/g, '’');\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n"],"names":[],"mappings":";;;;AAEA;AACM,SAAU,gBAAgB,CAAC,MAAgB,EAAE,MAAe,EAAA;AAChE,IAAA,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;AAC5C,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;AACvB,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG;AACxD,QAAA,IAAI,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpD;IACA,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC9B,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI;AAC3D,IAAA,OAAO,GAAG,CAAC,SAAS,EAAE;AACxB;;;;"}
1
+ {"version":3,"file":"parshaName.js","sources":["../../../src/parshaName.ts"],"sourcesContent":["import {Locale} from './locale';\nimport {smartApostrophe} from './string';\n\n/** @private */\nexport function renderParshaName(parsha: string[], locale?: string): string {\n let name = Locale.gettext(parsha[0], locale);\n if (parsha.length === 2) {\n const hyphen = Locale.isHebrewLocale(locale) ? '־' : '-';\n name += hyphen + Locale.gettext(parsha[1], locale);\n }\n name = smartApostrophe(name);\n const str = Locale.gettext('Parashat', locale) + ' ' + name;\n return str.normalize();\n}\n"],"names":[],"mappings":";;;;;AAGA;AACM,SAAU,gBAAgB,CAAC,MAAgB,EAAE,MAAe,EAAA;AAChE,IAAA,IAAI,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;AAC5C,IAAA,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;AACvB,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG;AACxD,QAAA,IAAI,IAAI,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;IACpD;AACA,IAAA,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;AAC5B,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI;AAC3D,IAAA,OAAO,GAAG,CAAC,SAAS,EAAE;AACxB;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import { ParshaEvent } from './ParshaEvent.js';
4
4
  import { getSedra } from './sedra.js';
@@ -1,2 +1,2 @@
1
1
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
2
- export declare const version = "6.5.3";
2
+ export declare const version = "6.7.0";
@@ -1,6 +1,6 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  /** DO NOT EDIT THIS AUTO-GENERATED FILE! */
3
- const version = '6.5.3';
3
+ const version = '6.7.0';
4
4
 
5
5
  export { version };
6
6
  //# sourceMappingURL=pkgVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.5.3';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"pkgVersion.js","sources":["../../../src/pkgVersion.ts"],"sourcesContent":["/** DO NOT EDIT THIS AUTO-GENERATED FILE! */\nexport const version = '6.7.0';\n"],"names":[],"mappings":";AAAA;AACO,MAAM,OAAO,GAAG;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const hour12cc = {
3
3
  US: 1,
4
4
  CA: 1,
@@ -1 +1 @@
1
- {"version":3,"file":"reformatTimeStr.js","sources":["../../../src/reformatTimeStr.ts"],"sourcesContent":["import {CalOptions} from './CalOptions';\n\nconst hour12cc: Record<string, number> = {\n US: 1,\n CA: 1,\n BR: 1,\n AU: 1,\n NZ: 1,\n DO: 1,\n PR: 1,\n GR: 1,\n IN: 1,\n KR: 1,\n NP: 1,\n ZA: 1,\n} as const;\n\n/**\n * @private\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string')\n throw new TypeError(`Bad timeStr: ${timeStr}`);\n const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');\n const hour12 = options?.hour12;\n if (hour12 !== undefined && !hour12) {\n return timeStr;\n }\n if (!hour12 && hour12cc[cc] === undefined) {\n return timeStr;\n }\n const hm = timeStr.split(':');\n let hour: string | number = parseInt(hm[0], 10);\n if (hour < 12 && suffix) {\n suffix = suffix.replace('p', 'a').replace('P', 'A');\n if (hour === 0) {\n hour = 12;\n }\n } else if (hour > 12) {\n hour = hour % 12;\n } else if (hour === 0) {\n hour = '00';\n }\n return `${hour}:${hm[1]}${suffix}`;\n}\n"],"names":[],"mappings":";AAEA,MAAM,QAAQ,GAA2B;AACvC,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;CACG;AAEV;;;;;AAKG;SACa,eAAe,CAC7B,OAAe,EACf,MAAc,EACd,OAAoB,EAAA;IAEpB,IAAI,OAAO,OAAO,KAAK,QAAQ;AAC7B,QAAA,MAAM,IAAI,SAAS,CAAC,gBAAgB,OAAO,CAAA,CAAE,CAAC;IAChD,MAAM,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7E,IAAA,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM;AAC9B,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,EAAE;AACnC,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE;AACzC,QAAA,OAAO,OAAO;IAChB;IACA,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7B,IAAI,IAAI,GAAoB,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC/C,IAAA,IAAI,IAAI,GAAG,EAAE,IAAI,MAAM,EAAE;AACvB,QAAA,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AACnD,QAAA,IAAI,IAAI,KAAK,CAAC,EAAE;YACd,IAAI,GAAG,EAAE;QACX;IACF;AAAO,SAAA,IAAI,IAAI,GAAG,EAAE,EAAE;AACpB,QAAA,IAAI,GAAG,IAAI,GAAG,EAAE;IAClB;AAAO,SAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,IAAI,GAAG,IAAI;IACb;IACA,OAAO,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,EAAE,CAAC,CAAC,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE;AACpC;;;;"}
1
+ {"version":3,"file":"reformatTimeStr.js","sources":["../../../src/reformatTimeStr.ts"],"sourcesContent":["import {CalOptions} from './CalOptions';\n\nconst hour12cc: Record<string, number> = {\n US: 1,\n CA: 1,\n BR: 1,\n AU: 1,\n NZ: 1,\n DO: 1,\n PR: 1,\n GR: 1,\n IN: 1,\n KR: 1,\n NP: 1,\n ZA: 1,\n} as const;\n\n/**\n * @private\n * @param timeStr - original time like \"20:30\"\n * @param suffix - \"p\" or \"pm\" or \" P.M.\". Add leading space if you want it\n * @param options\n */\nexport function reformatTimeStr(\n timeStr: string,\n suffix: string,\n options?: CalOptions\n): string {\n if (typeof timeStr !== 'string') throw new TypeError(`Bad timeStr: ${timeStr}`);\n const cc = options?.location?.getCountryCode() || (options?.il ? 'IL' : 'US');\n const hour12 = options?.hour12;\n if (hour12 !== undefined && !hour12) {\n return timeStr;\n }\n if (!hour12 && hour12cc[cc] === undefined) {\n return timeStr;\n }\n const hm = timeStr.split(':');\n let hour: string | number = parseInt(hm[0], 10);\n if (hour < 12 && suffix) {\n suffix = suffix.replace('p', 'a').replace('P', 'A');\n if (hour === 0) {\n hour = 12;\n }\n } else if (hour > 12) {\n hour = hour % 12;\n } else if (hour === 0) {\n hour = '00';\n }\n return `${hour}:${hm[1]}${suffix}`;\n}\n"],"names":[],"mappings":";AAEA,MAAM,QAAQ,GAA2B;AACvC,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,EAAE,EAAE,CAAC;CACG;AAEV;;;;;AAKG;SACa,eAAe,CAC7B,OAAe,EACf,MAAc,EACd,OAAoB,EAAA;IAEpB,IAAI,OAAO,OAAO,KAAK,QAAQ;AAAE,QAAA,MAAM,IAAI,SAAS,CAAC,gBAAgB,OAAO,CAAA,CAAE,CAAC;IAC/E,MAAM,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7E,IAAA,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM;AAC9B,IAAA,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,EAAE;AACnC,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,MAAM,IAAI,QAAQ,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE;AACzC,QAAA,OAAO,OAAO;IAChB;IACA,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;IAC7B,IAAI,IAAI,GAAoB,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAC/C,IAAA,IAAI,IAAI,GAAG,EAAE,IAAI,MAAM,EAAE;AACvB,QAAA,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AACnD,QAAA,IAAI,IAAI,KAAK,CAAC,EAAE;YACd,IAAI,GAAG,EAAE;QACX;IACF;AAAO,SAAA,IAAI,IAAI,GAAG,EAAE,EAAE;AACpB,QAAA,IAAI,GAAG,IAAI,GAAG,EAAE;IAClB;AAAO,SAAA,IAAI,IAAI,KAAK,CAAC,EAAE;QACrB,IAAI,GAAG,IAAI;IACb;IACA,OAAO,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,EAAE,CAAC,CAAC,CAAC,CAAA,EAAG,MAAM,CAAA,CAAE;AACpC;;;;"}
@@ -145,6 +145,20 @@ export declare class Sedra {
145
145
  * @param hd Hebrew date or R.D. days
146
146
  */
147
147
  lookup(hd: HDate | number): SedraResult;
148
+ /**
149
+ * Returns details about the parsha read on Monday or Thursday for `hd`, or
150
+ * `undefined` if `hd` is not a Monday or Thursday.
151
+ *
152
+ * Weekday Torah readings generally begin the upcoming Shabbat parsha. When
153
+ * the upcoming Shabbat is a holiday, this method returns the next regular
154
+ * parsha instead.
155
+ *
156
+ * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday
157
+ * reading is *Vezot Haberakhah* even though it is not read on Shabbat.
158
+ * @param hd Hebrew date or R.D. days
159
+ */
160
+ lookupWeekday(hd: HDate | number): SedraResult | undefined;
161
+ private findWeekdayParsha;
148
162
  }
149
163
  /**
150
164
  * The 54 parshiyot of the Torah as transilterated strings.
package/dist/esm/sedra.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import QuickLRU from 'quick-lru';
4
4
  import './locale.js';
@@ -326,6 +326,67 @@ class Sedra {
326
326
  il: this.il,
327
327
  };
328
328
  }
329
+ /**
330
+ * Returns details about the parsha read on Monday or Thursday for `hd`, or
331
+ * `undefined` if `hd` is not a Monday or Thursday.
332
+ *
333
+ * Weekday Torah readings generally begin the upcoming Shabbat parsha. When
334
+ * the upcoming Shabbat is a holiday, this method returns the next regular
335
+ * parsha instead.
336
+ *
337
+ * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday
338
+ * reading is *Vezot Haberakhah* even though it is not read on Shabbat.
339
+ * @param hd Hebrew date or R.D. days
340
+ */
341
+ lookupWeekday(hd) {
342
+ const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;
343
+ if (isNaN(abs)) {
344
+ throw new TypeError(`Bad date argument: ${hd}`);
345
+ }
346
+ else if (abs < this.rh) {
347
+ throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);
348
+ }
349
+ const hdate = new HDate(abs);
350
+ const day = hdate.getDay();
351
+ if (day !== 1 && day !== 4) {
352
+ return undefined;
353
+ }
354
+ const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));
355
+ const parsha = this.lookup(saturday);
356
+ if (!parsha.chag) {
357
+ return parsha;
358
+ }
359
+ return this.findWeekdayParsha(saturday);
360
+ }
361
+ findWeekdayParsha(saturday) {
362
+ const hyear = saturday.getFullYear();
363
+ const il = this.il;
364
+ if (saturday.getMonth() === months.TISHREI) {
365
+ const dd = saturday.getDate();
366
+ const simchatTorah = il ? 22 : 23;
367
+ if (dd > 2 && dd <= simchatTorah) {
368
+ return {
369
+ parsha: ['Vezot Haberakhah'],
370
+ chag: false,
371
+ num: 54,
372
+ hdate: saturday,
373
+ il,
374
+ };
375
+ }
376
+ }
377
+ const sedra = hyear === this.year ? this : getSedra(hyear, il);
378
+ const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;
379
+ const endAbs = endOfYear + 30;
380
+ for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {
381
+ const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;
382
+ const parsha2 = sedra2.lookup(sat2);
383
+ if (!parsha2.chag) {
384
+ return parsha2;
385
+ }
386
+ }
387
+ /* NOTREACHED */
388
+ throw new Error(`can't find weekday parsha for ${saturday}/${il}`);
389
+ }
329
390
  }
330
391
  /**
331
392
  * The 54 parshiyot of the Torah as transilterated strings.
@@ -1 +1 @@
1
- {"version":3,"file":"sedra.js","sources":["../../../src/sedra.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(\n `improper sedra year type ${key} calculated for ${hyear}`\n );\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(\n `Invalid parsha argument: ${JSON.stringify(parsha)}`\n );\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs =\n typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(\n `Date ${hd} before start of Hebrew year ${this.year}`\n );\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;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ACuE;AACvE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AAE5B;AACuE;AACvE;AACA,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAC7B;AACuE;AACvE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAE7B;AACoE;AACpE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AAE5B,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAgB,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AAE9D;;;;;;;;;;;;;AAaG;AACG,SAAU,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;IACzC,IAAI,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"sedra.js","sources":["../../../src/sedra.ts"],"sourcesContent":["/*\n Hebcal - A Jewish Calendar Generator\n Copyright (c) 1994-2020 Danny Sadinoff\n Portions copyright Eyal Schachter and Michael J. Radwin\n\n https://github.com/hebcal/hebcal-es6\n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n * Many of the following algorithms were taken from hebrew calendar\n * routines by Maimonedes, from his Mishneh Torah, and implemented by\n * Nachum Dershowitz Department of Computer Science\n * (217) 333-4219 University of Illinois at Urbana-Champaign\n * nachum@cs.uiuedu 1304 West Springfield Avenue\n * Urbana, Illinois 61801\n *\n * The routines were included in the emacs 19 distribution.\n *\n */\nimport {HDate, months} from '@hebcal/hdate';\nimport QuickLRU from 'quick-lru';\nimport './locale'; // Adds Hebrew and Ashkenazic translations\n\nconst INCOMPLETE = 0;\nconst REGULAR = 1;\nconst COMPLETE = 2;\n\nfunction yearType(hyear: number): number {\n const longC = HDate.longCheshvan(hyear);\n const shortK = HDate.shortKislev(hyear);\n if (longC && !shortK) {\n return COMPLETE;\n } else if (!longC && shortK) {\n return INCOMPLETE;\n } else {\n return REGULAR;\n }\n}\n\n/** The result from `Sedra.lookup()` */\nexport type SedraResult = {\n /**\n * Name of the parsha (or parshiyot) read on\n * Hebrew date, e.g. `['Noach']` or `['Matot', 'Masei']`\n */\n parsha: string[];\n /**\n * False if this is a regular parashat HaShavua reading.\n * True if it's a special holiday reading.\n */\n chag: boolean;\n /**\n * The parsha number (or numbers) using 1-indexing.\n * A `number` for a regular (single) parsha, and a `number[]`\n * for a doubled parsha.\n * For Parashat *Bereshit*, `num` would be equal to `1`, and for\n * *Matot-Masei* it would be `[42, 43]`\n * For a chag (holiday) reading, `num` will be `0`.\n */\n num: number | number[];\n /** The date of the Shabbat this parsha is read */\n hdate: HDate;\n /** true if Israel, false for Diaspora */\n il: boolean;\n};\n\n/**\n * Represents the weekly Torah-reading (Parashat HaShavua) schedule for an\n * entire Hebrew year.\n *\n * The schedule depends on the year's *keviyah* — the day of week of Rosh\n * Hashana, whether the year is leap, whether Cheshvan/Kislev are long or\n * short, and whether the schedule is for Israel or the Diaspora (since\n * Israel and the Diaspora diverge in some years when the 8th day of Pesach\n * or the 2nd day of Shavuot fall on Shabbat).\n *\n * Prefer {@link getSedra} (or {@link HebrewCalendar.getSedra}) over\n * calling this constructor directly, since both cache their results.\n *\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * const result = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n */\nexport class Sedra {\n private readonly year: number;\n private readonly il: boolean;\n private readonly rh: number;\n private readonly firstSaturday: number;\n private readonly theSedraArray: readonly NumberOrString[];\n private readonly yearKey: string;\n /**\n * Calculates the Parashat HaShavua schedule for an entire Hebrew year.\n * @param hyear - Hebrew year (e.g. 5749)\n * @param il - Use Israel sedra schedule (false for Diaspora)\n */\n constructor(hyear: number, il: boolean) {\n hyear = +hyear;\n this.year = hyear;\n\n const rh0 = new HDate(1, months.TISHREI, hyear);\n const rh = (this.rh = rh0.abs());\n const rhDay = rh0.getDay() + 1;\n\n // find the first Saturday on or after Rosh Hashana\n this.firstSaturday = HDate.dayOnOrBefore(6, rh + 6);\n const leap = +HDate.isLeapYear(hyear);\n this.il = Boolean(il);\n\n const type = yearType(hyear);\n let key = `${leap}${rhDay}${type}`;\n if (types[key]) {\n this.theSedraArray = types[key];\n this.yearKey = key;\n } else {\n key = key + +this.il; // cast to num, then concat\n this.theSedraArray = types[key];\n this.yearKey = key;\n }\n\n if (!this.theSedraArray) {\n throw new Error(`improper sedra year type ${key} calculated for ${hyear}`);\n }\n }\n\n /**\n * Returns the date a parsha is read this year, or `null` if it does not\n * occur in this year's schedule.\n *\n * A doubled parsha (e.g. `'Matot-Masei'`) will only return a date in years\n * where that pair is actually read together; in years where they are read\n * separately, this returns `null`. Use {@link findContaining} to find the\n * date a parsha is read regardless of whether it is doubled.\n *\n * Throws `RangeError` for an out-of-range numeric input or an invalid\n * doubled-parsha pair, and `TypeError` for a malformed array argument.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * sedra.find('Noach')?.toString(); // '15 Cheshvan 5784'\n * sedra.find(1)?.toString(); // same, by 0-based index\n * sedra.find('Matot-Masei')?.toString(); // null in 5784 — read separately\n * sedra.find(['Matot', 'Masei']); // also null in 5784\n * @param parsha if a `string`, specified with Sephardic transliterations\n * like `'Noach'` or `'Matot-Masei'`. If an array, must be a 1- or 2-element\n * array such as `['Noach']` or `['Matot', 'Masei']`. If a `number`, should\n * be a 0-based parsha index (`0` for Bereshit, `1` for Noach) or a negative\n * number for a doubled parsha (e.g. `-21` for Vayakhel-Pekudei)\n */\n find(parsha: number | string | string[]): HDate | null {\n if (typeof parsha === 'number') {\n if (parsha >= parshiot.length || (parsha < 0 && !isValidDouble(parsha))) {\n throw new RangeError(`Invalid parsha number: ${parsha}`);\n }\n return this.findInternal(parsha);\n } else if (typeof parsha === 'string') {\n const num = parsha2id.get(parsha);\n if (typeof num === 'number') {\n return this.find(num);\n } else if (parsha.includes('-')) {\n if (parsha === CHMPESACH || parsha === CHMSUKOT) {\n return this.findInternal(parsha);\n }\n return this.find(parsha.split('-'));\n } else {\n // try to find Saturday holiday like 'Yom Kippur'\n return this.findInternal(parsha);\n }\n } else if (Array.isArray(parsha)) {\n const plen = parsha.length;\n if ((plen !== 1 && plen !== 2) || typeof parsha[0] !== 'string') {\n throw new TypeError(`Invalid parsha argument: ${JSON.stringify(parsha)}`);\n }\n if (plen === 1) {\n return this.find(parsha[0]);\n }\n const p1 = parsha[0];\n const p2 = parsha[1];\n const num1 = parsha2id.get(p1);\n const num2 = parsha2id.get(p2);\n if (\n typeof num1 !== 'number' ||\n typeof num2 !== 'number' ||\n num2 !== num1 + 1 ||\n !isValidDouble(-num1)\n ) {\n throw new RangeError(`Unrecognized parsha name: ${p1}-${p2}`);\n }\n return this.find(-num1);\n }\n return null; /* NOTREACHED */\n }\n\n private findInternal(parsha: NumberOrString): HDate | null {\n const idx = this.theSedraArray.indexOf(parsha);\n if (idx === -1) {\n return null; // doesn't occur this year\n }\n return new HDate(this.firstSaturday + idx * 7);\n }\n\n /**\n * Returns the date a parsha is read this year, looking through both\n * single and doubled forms.\n *\n * For example, if `'Matot'` is read individually this year, this returns\n * its date; if it is read as part of `'Matot-Masei'` this year, this\n * returns the date of `'Matot-Masei'` (and similarly for `'Masei'`).\n * Conversely, asking for `'Matot-Masei'` in a year where they are split\n * will return the date of `'Matot'` alone.\n * @example\n * import {Sedra} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // Matot-Masei is split in 5784; both individual halves resolve:\n * sedra.findContaining('Matot')?.toString(); // '22 Tamuz 5784'\n * sedra.findContaining('Masei')?.toString(); // '29 Tamuz 5784'\n * // Asking for the doubled name returns the date of the first half:\n * sedra.findContaining('Matot-Masei')?.toString(); // '22 Tamuz 5784'\n */\n findContaining(parsha: number | string): HDate | null {\n const hdate = this.find(parsha);\n if (hdate) {\n return hdate;\n }\n if (typeof parsha === 'number') {\n // a valid negative number (double parsha in a year where they are\n // combined) would've been found above, and a invalid negative number\n // would've thrown an error, so this parsha must be a positive number\n // representing either p1 or p2\n const p1 = -parsha;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n // this must be the second individual parsha of a doubled pair\n // for example 29 for Kedoshim, so check for -28 for Achrei Mot-Kedoshim\n return this.find(p1 + 1);\n }\n } else {\n const num = parsha2id.get(parsha);\n if (num) {\n // parsha is either the first or second individual parsha of\n // a pair that is doubled this year\n const p1 = -num;\n if (isValidDouble(p1)) {\n return this.find(p1);\n } else {\n return this.find(p1 + 1);\n }\n } else {\n // this was indeed a doubled parsha, so return date of the first half\n const [p1] = parsha.split('-');\n return this.find(p1);\n }\n }\n }\n\n /**\n * Returns the underlying annual reading schedule as an array, where each\n * entry corresponds to one Saturday (starting from the first Shabbat on\n * or after Rosh Hashana). Entries are either:\n * - a non-negative `number`: a 0-based parsha index (e.g. `0` for\n * *Bereshit*)\n * - a negative `number`: the negated first index of a doubled parsha\n * (e.g. `-21` for *Vayakhel-Pekudei*)\n * - a `string`: a holiday name when a Yom Tov displaces the weekly reading\n * (e.g. `'Pesach Shabbat Chol ha-Moed'`, `'Yom Kippur'`)\n *\n * Used by `@hebcal/triennial`.\n */\n getSedraArray(): readonly NumberOrString[] {\n return this.theSedraArray;\n }\n\n /**\n * Returns the R.D. (Rata Die / Fixed Date) absolute day number of the\n * first Saturday on or after Rosh Hashana of this year. This is the\n * anchor point for {@link getSedraArray} — index `0` of that array\n * corresponds to this date.\n */\n getFirstSaturday(): number {\n return this.firstSaturday;\n }\n\n /** Returns the Hebrew year this `Sedra` instance covers. */\n getYear(): number {\n return this.year;\n }\n\n /**\n * Returns details about the parsha read on the first Saturday on or after\n * `hd`. If `hd` is itself a Saturday, the reading for that date is\n * returned; otherwise the reading for the upcoming Saturday is returned.\n *\n * If the given date falls in the final days of the Hebrew year (after\n * the last reading of this year's schedule), this method transparently\n * delegates to the next year's `Sedra`.\n * @example\n * import {Sedra, HDate, months} from '@hebcal/core';\n * const sedra = new Sedra(5784, false);\n * // A weekday — returns the upcoming Shabbat's reading\n * const result = sedra.lookup(new HDate(13, months.CHESHVAN, 5784));\n * console.log(result.parsha); // ['Lech-Lecha']\n * console.log(result.chag); // false\n * console.log(result.hdate.toString()); // '15 Cheshvan 5784' (Saturday)\n * @param hd Hebrew date or R.D. days\n */\n lookup(hd: HDate | number): SedraResult {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n // find the first saturday on or after today's date\n const saturday = HDate.dayOnOrBefore(6, abs + 6);\n\n const weekNum = (saturday - this.firstSaturday) / 7;\n const index = this.theSedraArray[weekNum];\n\n if (index === undefined) {\n const sedra = getSedra(this.year + 1, this.il);\n return sedra.lookup(saturday); // must be next year\n }\n const hdate = new HDate(saturday);\n if (typeof index === 'string') {\n // Shabbat has a chag. Return a description\n return {parsha: [index], chag: true, hdate, il: this.il, num: 0};\n }\n if (index >= 0) {\n return {\n parsha: [parshiot[index]],\n chag: false,\n num: index + 1,\n hdate,\n il: this.il,\n };\n }\n\n const p1 = D(index); // undouble the parsha\n return {\n parsha: [parshiot[p1], parshiot[p1 + 1]],\n chag: false,\n num: [p1 + 1, p1 + 2],\n hdate,\n il: this.il,\n };\n }\n\n /**\n * Returns details about the parsha read on Monday or Thursday for `hd`, or\n * `undefined` if `hd` is not a Monday or Thursday.\n *\n * Weekday Torah readings generally begin the upcoming Shabbat parsha. When\n * the upcoming Shabbat is a holiday, this method returns the next regular\n * parsha instead.\n *\n * For the Tishrei weekdays before Sukkot or Simchat Torah, the weekday\n * reading is *Vezot Haberakhah* even though it is not read on Shabbat.\n * @param hd Hebrew date or R.D. days\n */\n lookupWeekday(hd: HDate | number): SedraResult | undefined {\n const abs = typeof hd === 'number' ? hd : HDate.isHDate(hd) ? hd.abs() : NaN;\n\n if (isNaN(abs)) {\n throw new TypeError(`Bad date argument: ${hd}`);\n } else if (abs < this.rh) {\n throw new RangeError(`Date ${hd} before start of Hebrew year ${this.year}`);\n }\n\n const hdate = new HDate(abs);\n const day = hdate.getDay();\n if (day !== 1 && day !== 4) {\n return undefined;\n }\n\n const saturday = new HDate(HDate.dayOnOrBefore(6, abs + 6));\n const parsha = this.lookup(saturday);\n if (!parsha.chag) {\n return parsha;\n }\n return this.findWeekdayParsha(saturday);\n }\n\n private findWeekdayParsha(saturday: HDate): SedraResult {\n const hyear = saturday.getFullYear();\n const il = this.il;\n\n if (saturday.getMonth() === months.TISHREI) {\n const dd = saturday.getDate();\n const simchatTorah = il ? 22 : 23;\n if (dd > 2 && dd <= simchatTorah) {\n return {\n parsha: ['Vezot Haberakhah'],\n chag: false,\n num: 54,\n hdate: saturday,\n il,\n };\n }\n }\n\n const sedra = hyear === this.year ? this : getSedra(hyear, il);\n const endOfYear = new HDate(1, months.TISHREI, hyear + 1).abs() - 1;\n const endAbs = endOfYear + 30;\n for (let sat2 = saturday.abs() + 7; sat2 <= endAbs; sat2 += 7) {\n const sedra2 = sat2 > endOfYear ? getSedra(hyear + 1, il) : sedra;\n const parsha2 = sedra2.lookup(sat2);\n if (!parsha2.chag) {\n return parsha2;\n }\n }\n /* NOTREACHED */\n throw new Error(`can't find weekday parsha for ${saturday}/${il}`);\n }\n}\n\n/**\n * The 54 parshiyot of the Torah as transilterated strings.\n * * parshiot[0] == `Bereshit`\n * * parshiot[1] == `Noach`\n * * parshiot[52] == `Ha'azinu`\n * * parshiot[53] == `Vezot Haberakhah`\n * @readonly\n * @type {string[]}\n */\nexport const parshiot: readonly string[] = [\n 'Bereshit',\n 'Noach',\n 'Lech-Lecha',\n 'Vayera',\n 'Chayei Sara',\n 'Toldot',\n 'Vayetzei',\n 'Vayishlach',\n 'Vayeshev',\n 'Miketz',\n 'Vayigash',\n 'Vayechi',\n 'Shemot',\n 'Vaera',\n 'Bo',\n 'Beshalach',\n 'Yitro',\n 'Mishpatim',\n 'Terumah',\n 'Tetzaveh',\n 'Ki Tisa',\n 'Vayakhel',\n 'Pekudei',\n 'Vayikra',\n 'Tzav',\n 'Shmini',\n 'Tazria',\n 'Metzora',\n 'Achrei Mot',\n 'Kedoshim',\n 'Emor',\n 'Behar',\n 'Bechukotai',\n 'Bamidbar',\n 'Nasso',\n \"Beha'alotcha\",\n \"Sh'lach\",\n 'Korach',\n 'Chukat',\n 'Balak',\n 'Pinchas',\n 'Matot',\n 'Masei',\n 'Devarim',\n 'Vaetchanan',\n 'Eikev',\n \"Re'eh\",\n 'Shoftim',\n 'Ki Teitzei',\n 'Ki Tavo',\n 'Nitzavim',\n 'Vayeilech',\n \"Ha'azinu\",\n 'Vezot Haberakhah',\n] as const;\n\n// 0-based parsha IDs\nconst parsha2id = new Map<string, number>();\nfor (let id = 0; id < parshiot.length; id++) {\n const name = parshiot[id];\n parsha2id.set(name, id);\n}\n\n// 0-based parsha IDs\nconst doubles = new Set([\n 21, // Vayakhel-Pekudei\n 26, // Tazria-Metzora\n 28, // Achrei Mot-Kedoshim\n 31, // Behar-Bechukotai\n 38, // Chukat-Balak\n 41, // Matot-Masei\n 50, // Nitzavim-Vayeilech\n]);\n\n/**\n * @private\n * @param id a negative number\n */\nfunction isValidDouble(id: number): boolean {\n return doubles.has(-id);\n}\n\n/**\n * parsha doubler/undoubler\n * @private\n * @param p\n */\nfunction D(p: number): number {\n return -p;\n}\n\nconst RH = 'Rosh Hashana'; // 0\nconst YK = 'Yom Kippur'; // 1\n\nconst SUKKOT = 'Sukkot'; // 0\nconst CHMSUKOT = 'Sukkot Shabbat Chol ha-Moed'; // 0\nconst SHMINI = 'Shmini Atzeret'; // 0\n\nconst PESACH = 'Pesach'; // 25\nconst PESACH1 = 'Pesach I';\nconst CHMPESACH = 'Pesach Shabbat Chol ha-Moed'; // 25\nconst PESACH7 = 'Pesach VII'; // 25\nconst PESACH8 = 'Pesach VIII';\nconst SHAVUOT = 'Shavuot'; // 33\n\n/**\n * Returns an array from start to end\n * @private\n * @param start beginning number, inclusive\n * @param stop ending number, inclusive\n */\nfunction range(start: number, stop: number): readonly number[] {\n return Array.from({length: stop - start + 1}, (v, k) => k + start);\n}\n\ntype NumberOrString = number | string;\n\nconst yearStartVayeilech: readonly NumberOrString[] = [51, 52, CHMSUKOT];\nconst yearStartHaazinu: readonly NumberOrString[] = [52, YK, CHMSUKOT];\nconst yearStartRH: readonly NumberOrString[] = [RH, 52, SUKKOT, SHMINI];\nconst r020 = range(0, 20);\nconst r027 = range(0, 27);\nconst r3340 = range(33, 40);\nconst r4349 = range(43, 49);\nconst r4350 = range(43, 50);\n\n/**\n * The ordinary year types (keviot)\n * names are leap/nonleap - day - incomplete/regular/complete - diaspora/Israel\n * @private\n * @readonly\n */\nconst types: Record<string, readonly NumberOrString[]> = {\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g. 5753\n '020': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n // e.g. 5756\n '0220': yearStartVayeilech.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n 33,\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5701\n '0510': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH1,\n PESACH8,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n // e.g. 5745\n '0511': yearStartHaazinu.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH,\n 25,\n D(26),\n D(28),\n range(30, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Sunday. */\n // e.g. 5754\n '052': yearStartHaazinu.concat(\n range(0, 24),\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev\n * each have 29 days), and has Passover start on Sunday. */\n // e.g. 5761\n '070': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n PESACH7,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Tuesday. */\n // e.g. 5716\n '072': yearStartRH.concat(\n r020,\n D(21),\n 23,\n 24,\n CHMPESACH,\n 25,\n D(26),\n D(28),\n 30,\n D(31),\n r3340,\n D(41),\n r4349,\n D(50)\n ),\n\n /* -- The leap year types (keviot) -- */\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1200': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Thursday. */\n // e.g. 5746\n '1201': yearStartVayeilech.concat(\n r027,\n CHMPESACH,\n range(28, 40),\n D(41),\n r4349,\n D(50)\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1220': yearStartVayeilech.concat(\n r027,\n PESACH1,\n PESACH8,\n range(28, 40),\n D(41),\n r4350\n ),\n\n /* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Saturday. */\n // e.g.5752\n '1221': yearStartVayeilech.concat(r027, PESACH, range(28, 50)),\n\n /* Hebrew year that starts on Thursday, is `incomplete' (Heshvan and\n * Kislev both have 29 days), and has Passover start on Sunday. */\n // e.g. 5768\n '150': yearStartHaazinu.concat(range(0, 28), PESACH7, range(29, 50)),\n\n /* Hebrew year that starts on Thursday, is `complete' (Heshvan and\n * Kislev both have 30 days), and has Passover start on Tuesday. */\n // eg. 5771\n '152': yearStartHaazinu.concat(range(0, 28), CHMPESACH, range(29, 49), D(50)),\n\n /* Hebrew year that starts on Saturday, is `incomplete' (Heshvan and\n * Kislev each have 29 days), and has Passover start on Tuesday. */\n // e.g.5757\n '170': yearStartRH.concat(r027, CHMPESACH, range(28, 40), D(41), r4349, D(50)),\n\n /* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\n '1720': yearStartRH.concat(\n r027,\n CHMPESACH,\n range(28, 33),\n SHAVUOT,\n range(34, 37),\n D(38),\n 40,\n D(41),\n r4349,\n D(50)\n ),\n} as const;\n\n/* Hebrew year that starts on Monday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['0221'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\n// e.g. 5715\ntypes['0310'] = types['0220'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Thursday. */\ntypes['0311'] = types['020'];\n\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\n// e.g. 5715\ntypes['1310'] = types['1220'];\n/* Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29\n * days and Kislev has 30 days), and has Passover start on Saturday. */\ntypes['1311'] = types['1221'];\n\n/* Hebrew year that starts on Saturday, is `complete' (Heshvan and\n * Kislev each have 30 days), and has Passover start on Thursday. */\ntypes['1721'] = types['170'];\n\nconst sedraCache = new QuickLRU<string, Sedra>({maxSize: 120});\n\n/**\n * Convenience function to create an instance of {@link Sedra} or reuse a\n * previously created and cached instance for the same year and schedule.\n *\n * Prefer this over `new Sedra(...)` when calling repeatedly — an internal\n * LRU cache (~120 entries) avoids recomputing the keviyah-specific schedule.\n * @example\n * import {getSedra, HDate, months} from '@hebcal/core';\n * const sedra = getSedra(5784, false);\n * const {parsha} = sedra.lookup(new HDate(15, months.CHESHVAN, 5784));\n * console.log(parsha); // ['Lech-Lecha']\n * @param hyear Hebrew year\n * @param il Use Israel sedra schedule (`false` for Diaspora)\n */\nexport function getSedra(hyear: number, il: boolean): Sedra {\n const cacheKey = `${hyear}-${il ? 1 : 0}`;\n let sedra = sedraCache.get(cacheKey);\n if (!sedra) {\n sedra = new Sedra(hyear, il);\n sedraCache.set(cacheKey, sedra);\n }\n return sedra;\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;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E;AACvE;AACA,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAC7B;AACuE;AACvE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;AAE7B;AACoE;AACpE,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;AAE5B,MAAM,UAAU,GAAG,IAAI,QAAQ,CAAgB,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AAE9D;;;;;;;;;;;;;AAaG;AACG,SAAU,QAAQ,CAAC,KAAa,EAAE,EAAW,EAAA;AACjD,IAAA,MAAM,QAAQ,GAAG,CAAA,EAAG,KAAK,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE;IACzC,IAAI,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpC,IAAI,CAAC,KAAK,EAAE;QACV,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;AAC5B,QAAA,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjC;AACA,IAAA,OAAO,KAAK;AACd;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  const ps67lines=["אֱלֹהִים יְחָנֵּנוּ וִיבָרְכֵנוּ יָאֵר־פָּנָיו אִתָּנוּ סֶלָה","לָדַעַת בָּאָרֶץ דַּרְכֶּךָ בְּכָל־גּוֹיִם יְשׁוּעָתֶךָ","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","יִשְׂמְחוּ וִירַנְּנוּ לְאֻמִּים כִּי־תִשְׁפֹּט עַמִּים מִישׁוֹר וּלְאֻמִּים בָּאָרֶץ תַּנחֵם סֶלָה","יוֹדוּךָ עַמִּים אֱלֹהִים יוֹדוּךָ עַמִּים כֻּלָּם","אֶרֶץ נָתְנָה יְבוּלָהּ יְבָרְכֵנוּ אֱלֹהִים אֱלֹהֵינוּ","יְבָרְכֵנוּ אֱלֹהִים וְיִירְאוּ אוֹתוֹ כָּל־אַפְסֵי־אָרֶץ"];const lamnatzeachLetters="ישמחווירננולאמיםכיתשפוטעמיםמישורולאמיםבארץתנחםסלה";const anaBekoach=["אָנָּא","בְּכֹחַ","גְּדֻלַּת","יְמִינְךָ","תַּתִּיר","צְרוּרָה","אב״ג ית״ץ","קַבֵּל","רִנַּת","עַמְּךָ","שַׂגְּבֵנוּ","טַהֲרֵנוּ","נוֹרָא","קר״ע שט״ן","נָא","גִבּוֹר","דּוֹרְשֵׁי","יִחוּדְךָ","כְּבָבַת","שָׁמְרֵם","נג״ד יכ״ש","בָּרְכֵם","טַהֲרֵם","רַחֲמֵי","צִדְקָתְךָ","תָּמִיד","גָּמְלֵם","בט״ר צת״ג","חֲסִין","קָדוֹשׁ","בְּרֹב","טוּבְךָ","נַהֵל","עֲדָתֶךָ","חק״ב תנ״ע","יָחִיד","גֵּאֶה","לְעַמְּךָ","פְּנֵה","זוֹכְרֵי","קְדֻשָּׁתֶךָ","יג״ל פז״ק","שַׁוְעָתֵנוּ","קַבֵּל","וּשְׁמַע","צַעֲקָתֵנוּ","יוֹדֵעַ","תַּעֲלוּמוֹת","שק״ו צי״ת"];var sefira = {ps67lines:ps67lines,lamnatzeachLetters:lamnatzeachLetters,anaBekoach:anaBekoach};
3
3
 
4
4
  export { anaBekoach, sefira as default, lamnatzeachLetters, ps67lines };
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { months } from '@hebcal/hdate';
3
3
  import { flags } from './event.js';
4
4
 
@@ -0,0 +1,2 @@
1
+ export declare function smartApostrophe(str: string): string;
2
+ export declare function urlFriendly(str: string): string;
@@ -0,0 +1,10 @@
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
+ function smartApostrophe(str) {
3
+ return str.replaceAll("'", '’');
4
+ }
5
+ function urlFriendly(str) {
6
+ return str.toLowerCase().replaceAll("'", '').replaceAll(' ', '-');
7
+ }
8
+
9
+ export { smartApostrophe, urlFriendly };
10
+ //# sourceMappingURL=string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.js","sources":["../../../src/string.ts"],"sourcesContent":["export function smartApostrophe(str: string): string {\n return str.replaceAll(\"'\", '’');\n}\n\nexport function urlFriendly(str: string): string {\n return str.toLowerCase().replaceAll(\"'\", '').replaceAll(' ', '-');\n}\n"],"names":[],"mappings":";AAAM,SAAU,eAAe,CAAC,GAAW,EAAA;IACzC,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;AACjC;AAEM,SAAU,WAAW,CAAC,GAAW,EAAA;AACrC,IAAA,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;AACnE;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
2
  import { HDate, months } from '@hebcal/hdate';
3
3
  import { dateYomHaZikaron } from './modern.js';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"tachanun.js","sources":["../../../src/tachanun.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern';\n\nfunction range(start: number, end: number): readonly number[] {\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/**\n * Is *tachanun* said today?\n */\nexport type TachanunResult = {\n /** Tachanun is said at Shacharit */\n shacharit: boolean;\n /** Tachanun is said at Mincha */\n mincha: boolean;\n /** All congregations say Tachanun on the day */\n allCongs: boolean;\n};\n\nconst NONE: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n} as const;\n\n/**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n */\nexport function tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun0(hdate, il, true);\n}\n\nfunction tachanun0(\n hdate: HDate,\n il: boolean,\n checkNext: boolean\n): TachanunResult {\n const year = hdate.yy;\n const dates = tachanunYear(year, il);\n const abs = hdate.abs();\n if (dates.none.includes(abs)) {\n return NONE;\n }\n const dow = hdate.getDay();\n const ret: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n };\n if (!dates.some.includes(abs)) {\n ret.allCongs = true;\n }\n if (dow !== 6) {\n ret.shacharit = true;\n }\n const tomorrow = abs + 1;\n if (checkNext && !dates.yesPrev.includes(tomorrow)) {\n const tmp = tachanun0(new HDate(tomorrow), il, false);\n ret.mincha = tmp.shacharit;\n } else {\n ret.mincha = dow !== 5;\n }\n if (ret.allCongs && !ret.mincha && !ret.shacharit) {\n return NONE;\n }\n return ret;\n}\n\ntype TachanunYear = {\n none: number[];\n some: number[];\n yesPrev: number[];\n};\n\nfunction tachanunYear(year: number, il: boolean): TachanunYear {\n const leap = HDate.isLeapYear(year);\n const monthsInYear = HDate.monthsInYear(year);\n let av9dt = new HDate(9, months.AV, year);\n if (av9dt.getDay() === 6) {\n av9dt = av9dt.next();\n }\n let shushPurim = new HDate(15, months.ADAR_II, year);\n if (shushPurim.getDay() === 6) {\n shushPurim = shushPurim.next();\n }\n const none: readonly HDate[] = [\n new HDate(2, months.TISHREI, year), // Rosh Hashana II\n ].concat(\n // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)\n range(1, monthsInYear).map(month => new HDate(1, month, year)),\n // Rosh Chodesh - 30th of months that have one\n range(1, monthsInYear)\n .filter(month => HDate.daysInMonth(month, year) === 30)\n .map(month => new HDate(30, month, year)),\n // entire month of Nisan\n range(1, HDate.daysInMonth(months.NISAN, year)).map(\n mday => new HDate(mday, months.NISAN, year)\n ),\n new HDate(18, months.IYYAR, year), // Lag BaOmer\n // Rosh Chodesh Sivan thru Isru Chag\n range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)),\n av9dt, // Tisha B'Av\n new HDate(15, months.AV, year), // Tu B'Av\n new HDate(29, months.ELUL, year), // Erev Rosh Hashanah\n // Erev Yom Kippur thru Isru Chag\n range(9, 24 - (il ? 1 : 0)).map(\n mday => new HDate(mday, months.TISHREI, year)\n ),\n // Chanukah\n range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)),\n new HDate(15, months.SHVAT, year), // Tu BiShvat\n new HDate(14, months.ADAR_II, year), // Purim\n shushPurim,\n leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan\n );\n const some: readonly HDate[] = [\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ].concat(\n // Until 14 Sivan\n range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),\n // Until after Rosh Chodesh Cheshvan\n range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),\n // Yom HaAtzma'ut, which changes based on day of week\n year >= 5708 ? (dateYomHaZikaron(year) as HDate).next() : [],\n // Yom Yerushalayim\n year >= 5727 ? new HDate(28, months.IYYAR, year) : []\n );\n const yesPrev: readonly HDate[] = [\n new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah\n new HDate(9, months.TISHREI, year), // Erev Yom Kippur\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ];\n return {\n none: none.map(hd => hd.abs()).sort((a, b) => a - b),\n some: some.map(hd => hd.abs()).sort((a, b) => a - b),\n yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),\n };\n}\n"],"names":[],"mappings":";;;;AAGA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAA;IACvC,MAAM,GAAG,GAAG,EAAE;AACd,IAAA,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;AACjC,QAAA,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACb;AACA,IAAA,OAAO,GAAG;AACZ;AAcA,MAAM,IAAI,GAAmB;AAC3B,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,QAAQ,EAAE,KAAK;CACP;AAEV;;;;;;;;;;;;;;;AAeG;AACG,SAAU,QAAQ,CAAC,KAAY,EAAE,EAAW,EAAA;IAChD,OAAO,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC;AACnC;AAEA,SAAS,SAAS,CAChB,KAAY,EACZ,EAAW,EACX,SAAkB,EAAA;AAElB,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE;IACrB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;AACpC,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE;IACvB,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,QA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IAAA,IAAI,IAAI,IAAI,GAAI,gBAAgB,CAAC,IAAI,CAAW,CAAC,IAAI,EAAE,GAAG,EAAE;;IAE5D,IAAI,IAAI,IAAI,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,CACtD;AACD,IAAA,MAAM,OAAO,GAAqB;AAChC,QAAA,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC;QAClC,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;KAClC;IACD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC3D;AACH;;;;"}
1
+ {"version":3,"file":"tachanun.js","sources":["../../../src/tachanun.ts"],"sourcesContent":["import {HDate, months} from '@hebcal/hdate';\nimport {dateYomHaZikaron} from './modern';\n\nfunction range(start: number, end: number): readonly number[] {\n const arr = [];\n for (let i = start; i <= end; i++) {\n arr.push(i);\n }\n return arr;\n}\n\n/**\n * Is *tachanun* said today?\n */\nexport type TachanunResult = {\n /** Tachanun is said at Shacharit */\n shacharit: boolean;\n /** Tachanun is said at Mincha */\n mincha: boolean;\n /** All congregations say Tachanun on the day */\n allCongs: boolean;\n};\n\nconst NONE: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n} as const;\n\n/**\n * Return details on what Tachanun (or Tzidchatcha on Shabbat) is said on `hdate`.\n *\n * Tachanun is not said on Rosh Chodesh, the month of Nisan, Lag Baomer,\n * Rosh Chodesh Sivan until Isru Chag, Tisha B'av, 15 Av, Erev Rosh Hashanah,\n * Rosh Hashanah, Erev Yom Kippur until after Simchat Torah, Chanukah,\n * Tu B'shvat, Purim and Shushan Purim, and Purim and Shushan Purim Katan.\n *\n * In some congregations Tachanun is not said until from Rosh Chodesh Sivan\n * until 14th Sivan, Sukkot until after Rosh Chodesh Cheshvan, Pesach Sheini,\n * Yom Ha'atzmaut, and Yom Yerushalayim.\n *\n * Tachanun is not said at Mincha on days before it is not said at Shacharit.\n *\n * Tachanun is not said at Shacharit on Shabbat, but is at Mincha, usually.\n */\nexport function tachanun(hdate: HDate, il: boolean): TachanunResult {\n return tachanun0(hdate, il, true);\n}\n\nfunction tachanun0(hdate: HDate, il: boolean, checkNext: boolean): TachanunResult {\n const year = hdate.yy;\n const dates = tachanunYear(year, il);\n const abs = hdate.abs();\n if (dates.none.includes(abs)) {\n return NONE;\n }\n const dow = hdate.getDay();\n const ret: TachanunResult = {\n shacharit: false,\n mincha: false,\n allCongs: false,\n };\n if (!dates.some.includes(abs)) {\n ret.allCongs = true;\n }\n if (dow !== 6) {\n ret.shacharit = true;\n }\n const tomorrow = abs + 1;\n if (checkNext && !dates.yesPrev.includes(tomorrow)) {\n const tmp = tachanun0(new HDate(tomorrow), il, false);\n ret.mincha = tmp.shacharit;\n } else {\n ret.mincha = dow !== 5;\n }\n if (ret.allCongs && !ret.mincha && !ret.shacharit) {\n return NONE;\n }\n return ret;\n}\n\ntype TachanunYear = {\n none: number[];\n some: number[];\n yesPrev: number[];\n};\n\nfunction tachanunYear(year: number, il: boolean): TachanunYear {\n const leap = HDate.isLeapYear(year);\n const monthsInYear = HDate.monthsInYear(year);\n let av9dt = new HDate(9, months.AV, year);\n if (av9dt.getDay() === 6) {\n av9dt = av9dt.next();\n }\n let shushPurim = new HDate(15, months.ADAR_II, year);\n if (shushPurim.getDay() === 6) {\n shushPurim = shushPurim.next();\n }\n const none: readonly HDate[] = [\n new HDate(2, months.TISHREI, year), // Rosh Hashana II\n ].concat(\n // Rosh Chodesh - 1st of every month. Also includes RH day 1 (1 Tishrei)\n range(1, monthsInYear).map(month => new HDate(1, month, year)),\n // Rosh Chodesh - 30th of months that have one\n range(1, monthsInYear)\n .filter(month => HDate.daysInMonth(month, year) === 30)\n .map(month => new HDate(30, month, year)),\n // entire month of Nisan\n range(1, HDate.daysInMonth(months.NISAN, year)).map(\n mday => new HDate(mday, months.NISAN, year)\n ),\n new HDate(18, months.IYYAR, year), // Lag BaOmer\n // Rosh Chodesh Sivan thru Isru Chag\n range(1, 8 - (il ? 1 : 0)).map(mday => new HDate(mday, months.SIVAN, year)),\n av9dt, // Tisha B'Av\n new HDate(15, months.AV, year), // Tu B'Av\n new HDate(29, months.ELUL, year), // Erev Rosh Hashanah\n // Erev Yom Kippur thru Isru Chag\n range(9, 24 - (il ? 1 : 0)).map(mday => new HDate(mday, months.TISHREI, year)),\n // Chanukah\n range(25, 33).map(mday => new HDate(mday, months.KISLEV, year)),\n new HDate(15, months.SHVAT, year), // Tu BiShvat\n new HDate(14, months.ADAR_II, year), // Purim\n shushPurim,\n leap ? new HDate(14, months.ADAR_I, year) : [] // Purim Katan\n );\n const some: readonly HDate[] = [\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ].concat(\n // Until 14 Sivan\n range(1, 13).map(mday => new HDate(mday, months.SIVAN, year)),\n // Until after Rosh Chodesh Cheshvan\n range(20, 31).map(mday => new HDate(mday, months.TISHREI, year)),\n // Yom HaAtzma'ut, which changes based on day of week\n year >= 5708 ? (dateYomHaZikaron(year) as HDate).next() : [],\n // Yom Yerushalayim\n year >= 5727 ? new HDate(28, months.IYYAR, year) : []\n );\n const yesPrev: readonly HDate[] = [\n new HDate(29, months.ELUL, year - 1), // Erev Rosh Hashanah\n new HDate(9, months.TISHREI, year), // Erev Yom Kippur\n new HDate(14, months.IYYAR, year), // Pesach Sheini\n ];\n return {\n none: none.map(hd => hd.abs()).sort((a, b) => a - b),\n some: some.map(hd => hd.abs()).sort((a, b) => a - b),\n yesPrev: yesPrev.map(hd => hd.abs()).sort((a, b) => a - b),\n };\n}\n"],"names":[],"mappings":";;;;AAGA,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAA;IACvC,MAAM,GAAG,GAAG,EAAE;AACd,IAAA,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,EAAE,EAAE;AACjC,QAAA,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACb;AACA,IAAA,OAAO,GAAG;AACZ;AAcA,MAAM,IAAI,GAAmB;AAC3B,IAAA,SAAS,EAAE,KAAK;AAChB,IAAA,MAAM,EAAE,KAAK;AACb,IAAA,QAAQ,EAAE,KAAK;CACP;AAEV;;;;;;;;;;;;;;;AAeG;AACG,SAAU,QAAQ,CAAC,KAAY,EAAE,EAAW,EAAA;IAChD,OAAO,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC;AACnC;AAEA,SAAS,SAAS,CAAC,KAAY,EAAE,EAAW,EAAE,SAAkB,EAAA;AAC9D,IAAA,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE;IACrB,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC;AACpC,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE;IACvB,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC5B,QAAA,OAAO,IAAI;IACb;AACA,IAAA,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE;AAC1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G,EAAE;;IAE5D,IAAI,IAAI,IAAI,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,CACtD;AACD,IAAA,MAAM,OAAO,GAAqB;AAChC,QAAA,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC;QAClC,IAAI,KAAK,CAAC,EAAE,EAAE,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;KAClC;IACD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpD,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC3D;AACH;;;;"}
@@ -1,4 +1,4 @@
1
- import './temporal-shim';
1
+ import 'temporal-polyfill/global';
2
2
  import { GeoLocation } from '@hebcal/noaa';
3
3
  import { HDate } from '@hebcal/hdate';
4
4
  /**
@@ -1,5 +1,5 @@
1
- /*! @hebcal/core v6.5.3, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
- import './temporal-shim.js';
1
+ /*! @hebcal/core v6.7.0, distributed under GPLv2 https://www.gnu.org/licenses/gpl-2.0.txt */
2
+ import 'temporal-polyfill/global';
3
3
  import { NOAACalculator } from '@hebcal/noaa';
4
4
  import { HDate, isDate, getTimezoneOffset, pad2, getPseudoISO } from '@hebcal/hdate';
5
5
  import { Molad } from './molad.js';
@@ -921,8 +921,7 @@ class Zmanim {
921
921
  if (isNaN(date.getTime())) {
922
922
  return '0000-00-00T00:00:00Z';
923
923
  }
924
- return (getPseudoISO(tzid, date).substring(0, 19) +
925
- Zmanim.timeZoneOffset(tzid, date));
924
+ return (getPseudoISO(tzid, date).substring(0, 19) + Zmanim.timeZoneOffset(tzid, date));
926
925
  }
927
926
  /**
928
927
  * Returns sunrise + `offset` minutes (either positive or negative).