@hebcal/rest-api 5.1.4 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +119 -77
- package/dist/bundle.min.js +2 -2
- package/dist/common.d.ts +1 -1
- package/dist/fullcalendar.js +39 -26
- package/dist/fullcalendar.min.js +2 -2
- package/dist/index.cjs +119 -77
- package/dist/index.mjs +120 -78
- package/dist/module.d.ts +1 -1
- package/package.json +12 -7
package/dist/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @hebcal/rest-api v5.
|
|
1
|
+
/*! @hebcal/rest-api v5.2.0 */
|
|
2
2
|
var hebcal__rest_api = (function (exports, core, leyning, triennial) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -705,7 +705,8 @@ var holidayDescription0 = {
|
|
|
705
705
|
* makeAnchor('Rosh Chodesh Adar II') // 'rosh-chodesh-adar-ii'
|
|
706
706
|
*/
|
|
707
707
|
function makeAnchor(s) {
|
|
708
|
-
return s
|
|
708
|
+
return s
|
|
709
|
+
.toLowerCase()
|
|
709
710
|
.replace(/'/g, '')
|
|
710
711
|
.replace(/[^\w]/g, '-')
|
|
711
712
|
.replace(/-+/g, '-')
|
|
@@ -731,7 +732,7 @@ const doubled = new Set();
|
|
|
731
732
|
for (const name of doubledParshiyot) {
|
|
732
733
|
const anchor = makeAnchor(name);
|
|
733
734
|
doubled.add(anchor);
|
|
734
|
-
const [p1
|
|
735
|
+
const [p1] = anchor.split('-');
|
|
735
736
|
const id = parsha2id.get(p1);
|
|
736
737
|
parsha2id.set(anchor, id);
|
|
737
738
|
}
|
|
@@ -774,14 +775,25 @@ function shortenSedrotUrl(u) {
|
|
|
774
775
|
}
|
|
775
776
|
}
|
|
776
777
|
|
|
777
|
-
const LOC_FIELDS = [
|
|
778
|
+
const LOC_FIELDS = [
|
|
779
|
+
'elevation',
|
|
780
|
+
'admin1',
|
|
781
|
+
'asciiname',
|
|
782
|
+
'geo',
|
|
783
|
+
'zip',
|
|
784
|
+
'state',
|
|
785
|
+
'stateName',
|
|
786
|
+
'geonameid',
|
|
787
|
+
];
|
|
778
788
|
const holidayDescription = holidayDescription0;
|
|
779
789
|
const countryNames = countryNames0;
|
|
780
790
|
/**
|
|
781
791
|
* Converts a @hebcal/core `Location` to a plain JS object.
|
|
782
792
|
*/
|
|
783
793
|
function locationToPlainObj(location) {
|
|
784
|
-
if (typeof location === 'object' &&
|
|
794
|
+
if (typeof location === 'object' &&
|
|
795
|
+
location !== null &&
|
|
796
|
+
typeof location.getLatitude === 'function') {
|
|
785
797
|
const cc = location.getCountryCode();
|
|
786
798
|
const o = {
|
|
787
799
|
title: location.getName(),
|
|
@@ -815,7 +827,8 @@ function getDownloadFilename(options) {
|
|
|
815
827
|
fileName += '_' + options.month;
|
|
816
828
|
}
|
|
817
829
|
}
|
|
818
|
-
else if (typeof options.start === 'object' &&
|
|
830
|
+
else if (typeof options.start === 'object' &&
|
|
831
|
+
typeof options.end === 'object') {
|
|
819
832
|
const start = new core.HDate(options.start);
|
|
820
833
|
const end = new core.HDate(options.end);
|
|
821
834
|
const y1 = start.greg().getFullYear();
|
|
@@ -856,7 +869,9 @@ function getEventCategories(ev) {
|
|
|
856
869
|
* Renders the event title in default locale, but strips off time
|
|
857
870
|
*/
|
|
858
871
|
function renderTitleWithoutTime(ev) {
|
|
859
|
-
return typeof ev.eventTime === 'undefined'
|
|
872
|
+
return typeof ev.eventTime === 'undefined'
|
|
873
|
+
? ev.render()
|
|
874
|
+
: ev.renderBrief();
|
|
860
875
|
}
|
|
861
876
|
function shortLocationName(options) {
|
|
862
877
|
const loc = options.location;
|
|
@@ -889,19 +904,20 @@ function getCalendarTitle(events, options) {
|
|
|
889
904
|
else {
|
|
890
905
|
title += ' Diaspora';
|
|
891
906
|
}
|
|
892
|
-
|
|
907
|
+
const sub = options.subscribe;
|
|
908
|
+
if (sub === '1' || sub === 1 || sub === true) {
|
|
893
909
|
return title;
|
|
894
910
|
}
|
|
895
|
-
if (options.year && (options.isHebrewYear || events.length
|
|
911
|
+
if (options.year && (options.isHebrewYear || events.length === 0)) {
|
|
896
912
|
title += ' ' + options.year;
|
|
897
913
|
}
|
|
898
914
|
else if (events.length) {
|
|
899
915
|
const start = events[0].getDate().greg();
|
|
900
916
|
const end = events[events.length - 1].getDate().greg();
|
|
901
|
-
if (start.getFullYear()
|
|
917
|
+
if (start.getFullYear() !== end.getFullYear()) {
|
|
902
918
|
title += ' ' + start.getFullYear() + '-' + end.getFullYear();
|
|
903
919
|
}
|
|
904
|
-
else if (start.getMonth()
|
|
920
|
+
else if (start.getMonth() === end.getMonth()) {
|
|
905
921
|
const monthFormat = new Intl.DateTimeFormat('en-US', { month: 'long' });
|
|
906
922
|
const startMonth = monthFormat.format(start);
|
|
907
923
|
title += ' ' + startMonth + ' ' + start.getFullYear();
|
|
@@ -916,34 +932,42 @@ function getCalendarTitle(events, options) {
|
|
|
916
932
|
* Returns an English language description of the holiday
|
|
917
933
|
*/
|
|
918
934
|
function getHolidayDescription(ev, firstSentence = false) {
|
|
919
|
-
const str0 = ev.getFlags() & core.flags.SHABBAT_MEVARCHIM
|
|
920
|
-
holidayDescription['Shabbat Mevarchim Chodesh']
|
|
921
|
-
holidayDescription[ev.getDesc()] ||
|
|
935
|
+
const str0 = ev.getFlags() & core.flags.SHABBAT_MEVARCHIM
|
|
936
|
+
? holidayDescription['Shabbat Mevarchim Chodesh']
|
|
937
|
+
: holidayDescription[ev.getDesc()] ||
|
|
938
|
+
holidayDescription[ev.basename()] ||
|
|
939
|
+
'';
|
|
922
940
|
const str = str0.normalize();
|
|
923
941
|
if (firstSentence && str) {
|
|
924
942
|
const dot = str.indexOf('.');
|
|
925
|
-
if (dot
|
|
943
|
+
if (dot !== -1) {
|
|
926
944
|
return str.substring(0, dot);
|
|
927
945
|
}
|
|
928
946
|
}
|
|
929
947
|
return str;
|
|
930
948
|
}
|
|
931
|
-
const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI |
|
|
932
|
-
core.flags.
|
|
933
|
-
core.flags.
|
|
934
|
-
core.flags.
|
|
949
|
+
const HOLIDAY_IGNORE_MASK = core.flags.DAF_YOMI |
|
|
950
|
+
core.flags.OMER_COUNT |
|
|
951
|
+
core.flags.SHABBAT_MEVARCHIM |
|
|
952
|
+
core.flags.MOLAD |
|
|
953
|
+
core.flags.USER_EVENT |
|
|
954
|
+
core.flags.NACH_YOMI |
|
|
955
|
+
core.flags.DAILY_LEARNING |
|
|
956
|
+
core.flags.HEBREW_DATE |
|
|
957
|
+
core.flags.YERUSHALMI_YOMI;
|
|
935
958
|
/**
|
|
936
959
|
* Makes mulit-line text that summarizes Torah & Haftarah
|
|
937
960
|
*/
|
|
938
961
|
function makeTorahMemoText(ev, il) {
|
|
939
962
|
var _a;
|
|
940
963
|
const mask = ev.getFlags();
|
|
941
|
-
if (
|
|
964
|
+
if (mask & HOLIDAY_IGNORE_MASK ||
|
|
965
|
+
typeof ev.eventTime !== 'undefined') {
|
|
942
966
|
return '';
|
|
943
967
|
}
|
|
944
|
-
const reading =
|
|
945
|
-
leyning.getLeyningForParshaHaShavua(ev, il)
|
|
946
|
-
leyning.getLeyningForHoliday(ev, il);
|
|
968
|
+
const reading = mask & core.flags.PARSHA_HASHAVUA
|
|
969
|
+
? leyning.getLeyningForParshaHaShavua(ev, il)
|
|
970
|
+
: leyning.getLeyningForHoliday(ev, il);
|
|
947
971
|
let memo = '';
|
|
948
972
|
if (reading && (reading.summary || reading.haftara)) {
|
|
949
973
|
if (reading.summary) {
|
|
@@ -1003,10 +1027,12 @@ function appendIsraelAndTracking(url, il, utmSource, utmMedium, utmCampaign) {
|
|
|
1003
1027
|
else if (isSedrot) {
|
|
1004
1028
|
shortenSedrotUrl(u);
|
|
1005
1029
|
}
|
|
1006
|
-
else {
|
|
1030
|
+
else {
|
|
1031
|
+
// isOmer
|
|
1007
1032
|
u.pathname = '/o/' + path.substring(6);
|
|
1008
1033
|
}
|
|
1009
|
-
if (!utmCampaign ||
|
|
1034
|
+
if (!utmCampaign ||
|
|
1035
|
+
!(utmCampaign.startsWith('ical-') || utmCampaign.startsWith('pdf-'))) {
|
|
1010
1036
|
if (utmSource) {
|
|
1011
1037
|
u.searchParams.set('us', utmSource);
|
|
1012
1038
|
}
|
|
@@ -1039,12 +1065,14 @@ function shouldRenderBrief(ev) {
|
|
|
1039
1065
|
const mask = ev.getFlags();
|
|
1040
1066
|
if (mask & core.flags.HEBREW_DATE) {
|
|
1041
1067
|
const hd = ev.getDate();
|
|
1042
|
-
return
|
|
1068
|
+
return hd.getDate() === 1 ? false : true;
|
|
1043
1069
|
}
|
|
1044
|
-
else if (mask &
|
|
1070
|
+
else if (mask &
|
|
1071
|
+
(core.flags.DAILY_LEARNING | core.flags.DAF_YOMI | core.flags.YERUSHALMI_YOMI)) {
|
|
1045
1072
|
return true;
|
|
1046
1073
|
}
|
|
1047
|
-
else if (mask & core.flags.MINOR_FAST &&
|
|
1074
|
+
else if (mask & core.flags.MINOR_FAST &&
|
|
1075
|
+
ev.getDesc().substring(0, 16) === 'Yom Kippur Katan') {
|
|
1048
1076
|
return true;
|
|
1049
1077
|
}
|
|
1050
1078
|
else if (mask & core.flags.SHABBAT_MEVARCHIM) {
|
|
@@ -1080,15 +1108,20 @@ function eventToCsv(ev, options) {
|
|
|
1080
1108
|
const mday = d.getDate();
|
|
1081
1109
|
const mon = d.getMonth() + 1;
|
|
1082
1110
|
const year = String(d.getFullYear()).padStart(4, '0');
|
|
1083
|
-
const date = options.euro
|
|
1111
|
+
const date = options.euro
|
|
1112
|
+
? `"${mday}/${mon}/${year}"`
|
|
1113
|
+
: `"${mon}/${mday}/${year}"`;
|
|
1084
1114
|
let startTime = '';
|
|
1085
1115
|
let endTime = '';
|
|
1086
1116
|
let endDate = '';
|
|
1087
1117
|
let allDay = '"true"';
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1118
|
+
const timedEv = ev;
|
|
1119
|
+
const timed = Boolean(timedEv.eventTime);
|
|
1120
|
+
let subj = shouldRenderBrief(ev)
|
|
1121
|
+
? ev.renderBrief(options.locale)
|
|
1122
|
+
: ev.render(options.locale);
|
|
1090
1123
|
if (timed) {
|
|
1091
|
-
const timeStr = core.HebrewCalendar.reformatTimeStr(
|
|
1124
|
+
const timeStr = core.HebrewCalendar.reformatTimeStr(timedEv.eventTimeStr, ' PM', options);
|
|
1092
1125
|
endTime = startTime = `"${timeStr}"`;
|
|
1093
1126
|
endDate = date;
|
|
1094
1127
|
allDay = '"false"';
|
|
@@ -1107,7 +1140,7 @@ function eventToCsv(ev, options) {
|
|
|
1107
1140
|
loc = category;
|
|
1108
1141
|
}
|
|
1109
1142
|
}
|
|
1110
|
-
subj = subj.replace(/,/g, '').replace(/"/g, '
|
|
1143
|
+
subj = subj.replace(/,/g, '').replace(/"/g, "''");
|
|
1111
1144
|
if (options.appendHebrewToSubject) {
|
|
1112
1145
|
const hebrew = ev.renderBrief('he');
|
|
1113
1146
|
if (hebrew) {
|
|
@@ -1115,15 +1148,19 @@ function eventToCsv(ev, options) {
|
|
|
1115
1148
|
}
|
|
1116
1149
|
}
|
|
1117
1150
|
let memo0 = ev.memo || getHolidayDescription(ev, true);
|
|
1118
|
-
if (!memo0 && typeof
|
|
1119
|
-
memo0 =
|
|
1120
|
-
}
|
|
1121
|
-
const memo = memo0
|
|
1122
|
-
|
|
1151
|
+
if (!memo0 && typeof timedEv.linkedEvent !== 'undefined') {
|
|
1152
|
+
memo0 = timedEv.linkedEvent.render(options.locale);
|
|
1153
|
+
}
|
|
1154
|
+
const memo = memo0
|
|
1155
|
+
.replace(/,/g, ';')
|
|
1156
|
+
.replace(/"/g, "''")
|
|
1157
|
+
.replace(/\n/g, ' / ');
|
|
1158
|
+
const showTimeAs = timed || mask & core.flags.CHAG ? 4 : 3;
|
|
1123
1159
|
return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
|
|
1124
1160
|
}
|
|
1125
1161
|
function eventsToCsv(events, options) {
|
|
1126
|
-
return [csvHeader].concat(events.map(
|
|
1162
|
+
return ([csvHeader].concat(events.map(ev => eventToCsv(ev, options))).join('\r\n') +
|
|
1163
|
+
'\r\n');
|
|
1127
1164
|
}
|
|
1128
1165
|
|
|
1129
1166
|
function eventIsoDate(ev) {
|
|
@@ -1136,6 +1173,7 @@ function eventsToClassicApi(events, options, leyning = true) {
|
|
|
1136
1173
|
const result = {
|
|
1137
1174
|
title: getCalendarTitle(events, options),
|
|
1138
1175
|
date: new Date().toISOString(),
|
|
1176
|
+
version: core.version,
|
|
1139
1177
|
};
|
|
1140
1178
|
result.location = locationToPlainObj(options.location);
|
|
1141
1179
|
if (events.length) {
|
|
@@ -1144,28 +1182,31 @@ function eventsToClassicApi(events, options, leyning = true) {
|
|
|
1144
1182
|
end: eventIsoDate(events[events.length - 1]),
|
|
1145
1183
|
};
|
|
1146
1184
|
}
|
|
1147
|
-
result.items = events.map(
|
|
1185
|
+
result.items = events.map(ev => eventToClassicApiObject(ev, options, leyning));
|
|
1148
1186
|
return result;
|
|
1149
1187
|
}
|
|
1150
1188
|
/**
|
|
1151
1189
|
* Converts a Hebcal event to a classic Hebcal.com JSON API object
|
|
1152
1190
|
*/
|
|
1153
1191
|
function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
1154
|
-
const
|
|
1192
|
+
const timedEv = ev;
|
|
1193
|
+
const eventTime = timedEv.eventTime;
|
|
1155
1194
|
const timed = Boolean(eventTime);
|
|
1156
1195
|
const hd = ev.getDate();
|
|
1157
1196
|
const dt = hd.greg();
|
|
1158
1197
|
const tzid = typeof options.location === 'object' ? options.location.getTzid() : 'UTC';
|
|
1159
|
-
const date = timed
|
|
1160
|
-
core.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
1161
|
-
isoDateString(dt);
|
|
1198
|
+
const date = timed
|
|
1199
|
+
? core.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
1200
|
+
: isoDateString(dt);
|
|
1162
1201
|
const categories = getEventCategories(ev);
|
|
1163
1202
|
const mask = ev.getFlags();
|
|
1164
|
-
let title = shouldRenderBrief(ev)
|
|
1203
|
+
let title = shouldRenderBrief(ev)
|
|
1204
|
+
? ev.renderBrief(options.locale)
|
|
1205
|
+
: ev.render(options.locale);
|
|
1165
1206
|
const desc = ev.getDesc();
|
|
1166
1207
|
const candles = desc === 'Havdalah' || desc === 'Candle lighting';
|
|
1167
1208
|
if (candles) {
|
|
1168
|
-
const time = core.HebrewCalendar.reformatTimeStr(
|
|
1209
|
+
const time = core.HebrewCalendar.reformatTimeStr(timedEv.eventTimeStr, 'pm', options);
|
|
1169
1210
|
title += ': ' + time;
|
|
1170
1211
|
}
|
|
1171
1212
|
const result = {
|
|
@@ -1179,10 +1220,10 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1179
1220
|
if (categories.length > 1) {
|
|
1180
1221
|
result.subcat = categories[1];
|
|
1181
1222
|
}
|
|
1182
|
-
if (categories[0] === 'holiday' &&
|
|
1223
|
+
if (categories[0] === 'holiday' && mask & core.flags.CHAG) {
|
|
1183
1224
|
result.yomtov = true;
|
|
1184
1225
|
}
|
|
1185
|
-
if (title
|
|
1226
|
+
if (title !== desc) {
|
|
1186
1227
|
result.title_orig = desc;
|
|
1187
1228
|
}
|
|
1188
1229
|
const hebrew = ev.renderBrief('he');
|
|
@@ -1192,10 +1233,10 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1192
1233
|
if (!candles) {
|
|
1193
1234
|
if (leyning$1) {
|
|
1194
1235
|
const il = options.il;
|
|
1195
|
-
const isParsha =
|
|
1196
|
-
const reading = isParsha
|
|
1197
|
-
leyning.getLeyningForParshaHaShavua(ev, il)
|
|
1198
|
-
leyning.getLeyningForHoliday(ev, il);
|
|
1236
|
+
const isParsha = mask === core.flags.PARSHA_HASHAVUA;
|
|
1237
|
+
const reading = isParsha
|
|
1238
|
+
? leyning.getLeyningForParshaHaShavua(ev, il)
|
|
1239
|
+
: leyning.getLeyningForHoliday(ev, il);
|
|
1199
1240
|
if (reading) {
|
|
1200
1241
|
result.leyning = formatLeyningResult(reading);
|
|
1201
1242
|
const hyear = hd.getFullYear();
|
|
@@ -1243,7 +1284,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1243
1284
|
};
|
|
1244
1285
|
delete result.hebrew;
|
|
1245
1286
|
}
|
|
1246
|
-
if ((options.heDateParts && !timed) ||
|
|
1287
|
+
if ((options.heDateParts && !timed) || mask & core.flags.HEBREW_DATE) {
|
|
1247
1288
|
const yy = hd.getFullYear();
|
|
1248
1289
|
const mm = hd.getMonthName();
|
|
1249
1290
|
const dd = hd.getDate();
|
|
@@ -1257,8 +1298,8 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1257
1298
|
if (typeof memo === 'string' && memo.length !== 0) {
|
|
1258
1299
|
result.memo = memo.normalize();
|
|
1259
1300
|
}
|
|
1260
|
-
else if (typeof
|
|
1261
|
-
result.memo =
|
|
1301
|
+
else if (typeof timedEv.linkedEvent !== 'undefined') {
|
|
1302
|
+
result.memo = timedEv.linkedEvent.render(options.locale);
|
|
1262
1303
|
}
|
|
1263
1304
|
if (options.includeEvent) {
|
|
1264
1305
|
result.ev = ev;
|
|
@@ -1268,7 +1309,7 @@ function eventToClassicApiObject(ev, options, leyning$1 = true) {
|
|
|
1268
1309
|
function formatAliyot(result, aliyot) {
|
|
1269
1310
|
for (const [num, aliyah] of Object.entries(aliyot)) {
|
|
1270
1311
|
if (typeof aliyah !== 'undefined') {
|
|
1271
|
-
const k = num
|
|
1312
|
+
const k = num === 'M' ? 'maftir' : num;
|
|
1272
1313
|
result[k] = leyning.formatAliyahWithBook(aliyah);
|
|
1273
1314
|
}
|
|
1274
1315
|
}
|
|
@@ -1277,7 +1318,7 @@ function formatAliyot(result, aliyot) {
|
|
|
1277
1318
|
function formatReasons(result, reason) {
|
|
1278
1319
|
for (const num of ['7', '8', 'M']) {
|
|
1279
1320
|
if (reason[num]) {
|
|
1280
|
-
const k = num
|
|
1321
|
+
const k = num === 'M' ? 'maftir' : num;
|
|
1281
1322
|
result[k] += ' | ' + reason[num];
|
|
1282
1323
|
}
|
|
1283
1324
|
}
|
|
@@ -1330,12 +1371,12 @@ function getLinkAndGuid(ev, il, tzid, mainUrl, utmSource, utmMedium) {
|
|
|
1330
1371
|
return [link, guid];
|
|
1331
1372
|
}
|
|
1332
1373
|
const localeToLg = {
|
|
1333
|
-
|
|
1334
|
-
|
|
1374
|
+
s: 'en',
|
|
1375
|
+
a: 'en',
|
|
1335
1376
|
'he-x-NoNikud': 'he',
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1377
|
+
h: 'he',
|
|
1378
|
+
ah: 'en',
|
|
1379
|
+
sh: 'en',
|
|
1339
1380
|
};
|
|
1340
1381
|
function eventsToRss2(events, options) {
|
|
1341
1382
|
options.dayFormat = new Intl.DateTimeFormat('en-US', {
|
|
@@ -1348,9 +1389,9 @@ function eventsToRss2(events, options) {
|
|
|
1348
1389
|
if (!options.mainUrl || !options.selfUrl) {
|
|
1349
1390
|
throw new TypeError('mainUrl cannot be empty or blank');
|
|
1350
1391
|
}
|
|
1351
|
-
const buildDate = options.buildDate = options.buildDate || new Date();
|
|
1392
|
+
const buildDate = (options.buildDate = options.buildDate || new Date());
|
|
1352
1393
|
const thisYear = buildDate.getFullYear();
|
|
1353
|
-
const lastBuildDate = options.lastBuildDate = buildDate.toUTCString();
|
|
1394
|
+
const lastBuildDate = (options.lastBuildDate = buildDate.toUTCString());
|
|
1354
1395
|
const title = options.title || getCalendarTitle(events, options);
|
|
1355
1396
|
const description = options.description || title;
|
|
1356
1397
|
const utmSource = options.utmSource || 'shabbat1c';
|
|
@@ -1405,7 +1446,7 @@ function eventToRssItem2(ev, options) {
|
|
|
1405
1446
|
let memo;
|
|
1406
1447
|
if (candles) {
|
|
1407
1448
|
const colon = subj.indexOf(': ');
|
|
1408
|
-
if (colon
|
|
1449
|
+
if (colon !== -1) {
|
|
1409
1450
|
const options = { location, il, locale: core.Locale.getLocaleName() };
|
|
1410
1451
|
const time = core.HebrewCalendar.reformatTimeStr(ev.eventTimeStr, 'pm', options);
|
|
1411
1452
|
subj = subj.substring(0, colon) + ': ' + time;
|
|
@@ -1415,11 +1456,11 @@ function eventToRssItem2(ev, options) {
|
|
|
1415
1456
|
memo = makeMemo(ev, il);
|
|
1416
1457
|
}
|
|
1417
1458
|
const dayFormat = options.dayFormat;
|
|
1418
|
-
const
|
|
1419
|
-
const description =
|
|
1420
|
-
const geoTags =
|
|
1421
|
-
`<geo:lat>${location.getLatitude()}</geo:lat>\n<geo:long>${location.getLongitude()}</geo:long>\n`
|
|
1422
|
-
'';
|
|
1459
|
+
const tmp = memo || dayFormat.format(evDate);
|
|
1460
|
+
const description = tmp.indexOf('<') === -1 ? tmp : `<![CDATA[${tmp}]]>`;
|
|
1461
|
+
const geoTags = cat0 === 'candles'
|
|
1462
|
+
? `<geo:lat>${location.getLatitude()}</geo:lat>\n<geo:long>${location.getLongitude()}</geo:long>\n`
|
|
1463
|
+
: '';
|
|
1423
1464
|
return `<item>
|
|
1424
1465
|
<title>${subj}</title>
|
|
1425
1466
|
<link>${link}</link>
|
|
@@ -1437,15 +1478,16 @@ ${geoTags}</item>
|
|
|
1437
1478
|
function eventToFullCalendar(ev, tzid, il) {
|
|
1438
1479
|
const classes = getEventCategories(ev);
|
|
1439
1480
|
const mask = ev.getFlags();
|
|
1440
|
-
if (classes[0]
|
|
1481
|
+
if (classes[0] === 'holiday' && mask & core.flags.CHAG) {
|
|
1441
1482
|
classes.push('yomtov');
|
|
1442
1483
|
}
|
|
1443
|
-
const
|
|
1484
|
+
const timedEv = ev;
|
|
1485
|
+
const eventTime = timedEv.eventTime;
|
|
1444
1486
|
const timed = Boolean(eventTime);
|
|
1445
1487
|
const title = shouldRenderBrief(ev) ? ev.renderBrief() : ev.render();
|
|
1446
|
-
const start = timed
|
|
1447
|
-
core.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
1448
|
-
isoDateString(ev.getDate().greg());
|
|
1488
|
+
const start = timed
|
|
1489
|
+
? core.Zmanim.formatISOWithTimeZone(tzid, eventTime)
|
|
1490
|
+
: isoDateString(ev.getDate().greg());
|
|
1449
1491
|
const result = {
|
|
1450
1492
|
title,
|
|
1451
1493
|
start,
|
|
@@ -1467,8 +1509,8 @@ function eventToFullCalendar(ev, tzid, il) {
|
|
|
1467
1509
|
if (memo) {
|
|
1468
1510
|
result.description = memo;
|
|
1469
1511
|
}
|
|
1470
|
-
else if (typeof
|
|
1471
|
-
result.description =
|
|
1512
|
+
else if (typeof timedEv.linkedEvent !== 'undefined') {
|
|
1513
|
+
result.description = timedEv.linkedEvent.render();
|
|
1472
1514
|
}
|
|
1473
1515
|
}
|
|
1474
1516
|
return result;
|
package/dist/bundle.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @hebcal/rest-api v5.
|
|
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,"&"),h=`${u}#${m}`;else{const e=`${n}&dt=${d}`,a=W(e,t,r,i).replace(/&/g,"&");h=e.replace(/&/g,"&")+`#${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,"&")}</link>\n<atom:link href="${a.selfUrl.replace(/&/g,"&")}" 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);
|
|
1
|
+
/*! @hebcal/rest-api v5.2.0 */
|
|
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]=a.split("-"),o=E.get(t);E.set(a,o)}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);a.yahrzeit?t+=" Yahrzeits and Anniversaries":o?t+=" "+o:a.il?t+=" Israel":t+=" Diaspora";const n=a.subscribe;if("1"===n||1===n||!0===n)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=e,u=Boolean(m.eventTime);let f=Z(e)?e.renderBrief(t.locale):e.render(t.locale);if(u){l=h=`"${a.HebrewCalendar.reformatTimeStr(m.eventTimeStr," PM",t)}"`,c=s,d='"false"'}let g="Jewish Holidays";const b=e.getFlags();if(u&&"object"==typeof t.location){const e=t.location.getShortName();e&&(g=e)}else{const a=V[O(e)[0]];"string"==typeof a&&(g=a)}if(f=f.replace(/,/g,"").replace(/"/g,"''"),t.appendHebrewToSubject){const a=e.renderBrief("he");a&&(f+=` / ${a}`)}let y=e.memo||J(e,!0);y||void 0===m.linkedEvent||(y=m.linkedEvent.render(t.locale));return`"${f}",${s},${h},${c},${l},${d},"${y.replace(/,/g,";").replace(/"/g,"''").replace(/\n/g," / ")}","${u||b&a.flags.CHAG?4:3}","${g}"`}function q(e){return y(e.getDate().greg())}function X(e,n,r=!0){const i=e,s=i.eventTime,h=Boolean(s),l=e.getDate(),c=l.greg(),d="object"==typeof n.location?n.location.getTzid():"UTC",m=h?a.Zmanim.formatISOWithTimeZone(d,s):y(c),u=O(e),f=e.getFlags();let g=Z(e)?e.renderBrief(n.locale):e.render(n.locale);const b=e.getDesc(),p="Havdalah"===b||"Candle lighting"===b;if(p){g+=": "+a.HebrewCalendar.reformatTimeStr(i.eventTimeStr,"pm",n)}const S={title:g,date:m};h||(S.hdate=l.toString()),S.category=u[0],u.length>1&&(S.subcat=u[1]),"holiday"===u[0]&&f&a.flags.CHAG&&(S.yomtov=!0),g!==b&&(S.title_orig=b);const w=e.renderBrief("he");if(w&&(S.hebrew=a.Locale.hebrewStripNikkud(w)),!p){if(r){const r=n.il,i=f===a.flags.PARSHA_HASHAVUA,s=i?t.getLeyningForParshaHaShavua(e,r):t.getLeyningForHoliday(e,r);if(s){S.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=l.getFullYear();if(i&&a>=5745){const a=o.getTriennialForParshaHaShavua(e,r);(null==a?void 0:a.aliyot)&&(S.leyning.triennial=ee({},a.aliyot))}}}const i=e.url();if(i){const e=n.utmSource||"js",a=n.utmMedium||"api",t=n.utmCampaign;S.link=W(i,Boolean(n.il),e,a,t)}}if(f&a.flags.OMER_COUNT){const a=e;S.omer={count:{he:a.getTodayIs("he"),en:a.getTodayIs("en")},sefira:{he:a.sefira("he"),translit:a.sefira("translit"),en:a.sefira("en")}}}if(f&a.flags.MOLAD){const t=e.molad,o=t.getYear();S.molad={hy:o,hm:a.HDate.getMonthName(t.getMonth(),o),dow:t.getDow(),hour:t.getHour(),minutes:t.getMinutes(),chalakim:t.getChalakim()},delete S.hebrew}if(n.heDateParts&&!h||f&a.flags.HEBREW_DATE){const e=l.getFullYear(),t=l.getMonthName(),o=l.getDate();S.heDateParts={y:a.gematriya(e),m:a.Locale.gettext(t,"he-x-NoNikud"),d:a.gematriya(o)}}const v=e.memo||J(e);return"string"==typeof v&&0!==v.length?S.memo=v.normalize():void 0!==i.linkedEvent&&(S.memo=i.linkedEvent.render(n.locale)),n.includeEvent&&(S.ev=e),S}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,"&"),h=`${u}#${m}`;else{const e=`${n}&dt=${d}`,a=W(e,t,r,i).replace(/&/g,"&");h=e.replace(/&/g,"&")+`#${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,s=i.eventTime,h=Boolean(s),l={title:Z(e)?e.renderBrief():e.render(),start:h?a.Zmanim.formatISOWithTimeZone(t,s):y(e.getDate().greg()),allDay:!h,className:n.join(" ")},c=e.renderBrief("he");c&&(l.hebrew=a.Locale.hebrewStripNikkud(c));const d=e.url();d&&(l.url=W(d,o,"js","fc"));const m=e.getDesc();if(!("Havdalah"===m||"Candle lighting"===m)){const a=x(e,o);a?l.description=a:void 0!==i.linkedEvent&&(l.description=i.linkedEvent.render())}return l},e.eventToRssItem2=te,e.eventsToClassicApi=function(e,t,o=!0){const n={title:U(e,t),date:(new Date).toISOString(),version:a.version};return n.location=z(t.location),e.length&&(n.range={start:q(e[0]),end:q(e[e.length-1])}),n.items=e.map((e=>X(e,t,o))),n},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,"&")}</link>\n<atom:link href="${a.selfUrl.replace(/&/g,"&")}" 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
|
@@ -8,7 +8,7 @@ export type RestApiEventOptions = {
|
|
|
8
8
|
utmCampaign?: string;
|
|
9
9
|
appendHebrewToSubject?: boolean;
|
|
10
10
|
yahrzeit?: boolean;
|
|
11
|
-
subscribe?: string | boolean;
|
|
11
|
+
subscribe?: string | number | boolean;
|
|
12
12
|
heDateParts?: boolean;
|
|
13
13
|
includeEvent?: boolean;
|
|
14
14
|
euro?: boolean;
|