@hebcal/core 3.29.0 → 3.29.4

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.
@@ -1,1026 +1,9 @@
1
- /*! @hebcal/core v3.29.0 */
1
+ /*! @hebcal/core v3.29.4 */
2
2
  var hebcal = (function (exports) {
3
3
  'use strict';
4
4
 
5
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
-
7
- var check = function (it) {
8
- return it && it.Math == Math && it;
9
- };
10
-
11
- // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
- var global$o =
13
- // eslint-disable-next-line es/no-global-this -- safe
14
- check(typeof globalThis == 'object' && globalThis) ||
15
- check(typeof window == 'object' && window) ||
16
- // eslint-disable-next-line no-restricted-globals -- safe
17
- check(typeof self == 'object' && self) ||
18
- check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19
- // eslint-disable-next-line no-new-func -- fallback
20
- (function () { return this; })() || Function('return this')();
21
-
22
- var objectGetOwnPropertyDescriptor = {};
23
-
24
- var fails$6 = function (exec) {
25
- try {
26
- return !!exec();
27
- } catch (error) {
28
- return true;
29
- }
30
- };
31
-
32
- var fails$5 = fails$6;
33
-
34
- // Detect IE8's incomplete defineProperty implementation
35
- var descriptors = !fails$5(function () {
36
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
37
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
38
- });
39
-
40
- var call$4 = Function.prototype.call;
41
-
42
- var functionCall = call$4.bind ? call$4.bind(call$4) : function () {
43
- return call$4.apply(call$4, arguments);
44
- };
45
-
46
- var objectPropertyIsEnumerable = {};
47
-
48
- var $propertyIsEnumerable = {}.propertyIsEnumerable;
49
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
50
- var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
51
-
52
- // Nashorn ~ JDK8 bug
53
- var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
54
-
55
- // `Object.prototype.propertyIsEnumerable` method implementation
56
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
57
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
58
- var descriptor = getOwnPropertyDescriptor$1(this, V);
59
- return !!descriptor && descriptor.enumerable;
60
- } : $propertyIsEnumerable;
61
-
62
- var createPropertyDescriptor$2 = function (bitmap, value) {
63
- return {
64
- enumerable: !(bitmap & 1),
65
- configurable: !(bitmap & 2),
66
- writable: !(bitmap & 4),
67
- value: value
68
- };
69
- };
70
-
71
- var FunctionPrototype$1 = Function.prototype;
72
- var bind = FunctionPrototype$1.bind;
73
- var call$3 = FunctionPrototype$1.call;
74
- var callBind = bind && bind.bind(call$3);
75
-
76
- var functionUncurryThis = bind ? function (fn) {
77
- return fn && callBind(call$3, fn);
78
- } : function (fn) {
79
- return fn && function () {
80
- return call$3.apply(fn, arguments);
81
- };
82
- };
83
-
84
- var uncurryThis$a = functionUncurryThis;
85
-
86
- var toString$4 = uncurryThis$a({}.toString);
87
- var stringSlice = uncurryThis$a(''.slice);
88
-
89
- var classofRaw$1 = function (it) {
90
- return stringSlice(toString$4(it), 8, -1);
91
- };
92
-
93
- var global$n = global$o;
94
- var uncurryThis$9 = functionUncurryThis;
95
- var fails$4 = fails$6;
96
- var classof$2 = classofRaw$1;
97
-
98
- var Object$4 = global$n.Object;
99
- var split = uncurryThis$9(''.split);
100
-
101
- // fallback for non-array-like ES3 and non-enumerable old V8 strings
102
- var indexedObject = fails$4(function () {
103
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
104
- // eslint-disable-next-line no-prototype-builtins -- safe
105
- return !Object$4('z').propertyIsEnumerable(0);
106
- }) ? function (it) {
107
- return classof$2(it) == 'String' ? split(it, '') : Object$4(it);
108
- } : Object$4;
109
-
110
- var global$m = global$o;
111
-
112
- var TypeError$7 = global$m.TypeError;
113
-
114
- // `RequireObjectCoercible` abstract operation
115
- // https://tc39.es/ecma262/#sec-requireobjectcoercible
116
- var requireObjectCoercible$3 = function (it) {
117
- if (it == undefined) throw TypeError$7("Can't call method on " + it);
118
- return it;
119
- };
120
-
121
- // toObject with fallback for non-array-like ES3 strings
122
- var IndexedObject = indexedObject;
123
- var requireObjectCoercible$2 = requireObjectCoercible$3;
124
-
125
- var toIndexedObject$3 = function (it) {
126
- return IndexedObject(requireObjectCoercible$2(it));
127
- };
128
-
129
- // `IsCallable` abstract operation
130
- // https://tc39.es/ecma262/#sec-iscallable
131
- var isCallable$a = function (argument) {
132
- return typeof argument == 'function';
133
- };
134
-
135
- var isCallable$9 = isCallable$a;
136
-
137
- var isObject$5 = function (it) {
138
- return typeof it == 'object' ? it !== null : isCallable$9(it);
139
- };
140
-
141
- var global$l = global$o;
142
- var isCallable$8 = isCallable$a;
143
-
144
- var aFunction = function (argument) {
145
- return isCallable$8(argument) ? argument : undefined;
146
- };
147
-
148
- var getBuiltIn$3 = function (namespace, method) {
149
- return arguments.length < 2 ? aFunction(global$l[namespace]) : global$l[namespace] && global$l[namespace][method];
150
- };
151
-
152
- var uncurryThis$8 = functionUncurryThis;
153
-
154
- var objectIsPrototypeOf = uncurryThis$8({}.isPrototypeOf);
155
-
156
- var getBuiltIn$2 = getBuiltIn$3;
157
-
158
- var engineUserAgent = getBuiltIn$2('navigator', 'userAgent') || '';
159
-
160
- var global$k = global$o;
161
- var userAgent = engineUserAgent;
162
-
163
- var process = global$k.process;
164
- var Deno = global$k.Deno;
165
- var versions = process && process.versions || Deno && Deno.version;
166
- var v8 = versions && versions.v8;
167
- var match, version$1;
168
-
169
- if (v8) {
170
- match = v8.split('.');
171
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
172
- // but their correct versions are not interesting for us
173
- version$1 = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
174
- }
175
-
176
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
177
- // so check `userAgent` even if `.v8` exists, but 0
178
- if (!version$1 && userAgent) {
179
- match = userAgent.match(/Edge\/(\d+)/);
180
- if (!match || match[1] >= 74) {
181
- match = userAgent.match(/Chrome\/(\d+)/);
182
- if (match) version$1 = +match[1];
183
- }
184
- }
185
-
186
- var engineV8Version = version$1;
187
-
188
- /* eslint-disable es/no-symbol -- required for testing */
189
-
190
- var V8_VERSION = engineV8Version;
191
- var fails$3 = fails$6;
192
-
193
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
194
- var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$3(function () {
195
- var symbol = Symbol();
196
- // Chrome 38 Symbol has incorrect toString conversion
197
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
198
- return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
199
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
200
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
201
- });
202
-
203
- /* eslint-disable es/no-symbol -- required for testing */
204
-
205
- var NATIVE_SYMBOL$1 = nativeSymbol;
206
-
207
- var useSymbolAsUid = NATIVE_SYMBOL$1
208
- && !Symbol.sham
209
- && typeof Symbol.iterator == 'symbol';
210
-
211
- var global$j = global$o;
212
- var getBuiltIn$1 = getBuiltIn$3;
213
- var isCallable$7 = isCallable$a;
214
- var isPrototypeOf = objectIsPrototypeOf;
215
- var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
216
-
217
- var Object$3 = global$j.Object;
218
-
219
- var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
220
- return typeof it == 'symbol';
221
- } : function (it) {
222
- var $Symbol = getBuiltIn$1('Symbol');
223
- return isCallable$7($Symbol) && isPrototypeOf($Symbol.prototype, Object$3(it));
224
- };
225
-
226
- var global$i = global$o;
227
-
228
- var String$3 = global$i.String;
229
-
230
- var tryToString$1 = function (argument) {
231
- try {
232
- return String$3(argument);
233
- } catch (error) {
234
- return 'Object';
235
- }
236
- };
237
-
238
- var global$h = global$o;
239
- var isCallable$6 = isCallable$a;
240
- var tryToString = tryToString$1;
241
-
242
- var TypeError$6 = global$h.TypeError;
243
-
244
- // `Assert: IsCallable(argument) is true`
245
- var aCallable$1 = function (argument) {
246
- if (isCallable$6(argument)) return argument;
247
- throw TypeError$6(tryToString(argument) + ' is not a function');
248
- };
249
-
250
- var aCallable = aCallable$1;
251
-
252
- // `GetMethod` abstract operation
253
- // https://tc39.es/ecma262/#sec-getmethod
254
- var getMethod$1 = function (V, P) {
255
- var func = V[P];
256
- return func == null ? undefined : aCallable(func);
257
- };
258
-
259
- var global$g = global$o;
260
- var call$2 = functionCall;
261
- var isCallable$5 = isCallable$a;
262
- var isObject$4 = isObject$5;
263
-
264
- var TypeError$5 = global$g.TypeError;
265
-
266
- // `OrdinaryToPrimitive` abstract operation
267
- // https://tc39.es/ecma262/#sec-ordinarytoprimitive
268
- var ordinaryToPrimitive$1 = function (input, pref) {
269
- var fn, val;
270
- if (pref === 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
271
- if (isCallable$5(fn = input.valueOf) && !isObject$4(val = call$2(fn, input))) return val;
272
- if (pref !== 'string' && isCallable$5(fn = input.toString) && !isObject$4(val = call$2(fn, input))) return val;
273
- throw TypeError$5("Can't convert object to primitive value");
274
- };
275
-
276
- var shared$3 = {exports: {}};
277
-
278
- var global$f = global$o;
279
-
280
- // eslint-disable-next-line es/no-object-defineproperty -- safe
281
- var defineProperty = Object.defineProperty;
282
-
283
- var setGlobal$3 = function (key, value) {
284
- try {
285
- defineProperty(global$f, key, { value: value, configurable: true, writable: true });
286
- } catch (error) {
287
- global$f[key] = value;
288
- } return value;
289
- };
290
-
291
- var global$e = global$o;
292
- var setGlobal$2 = setGlobal$3;
293
-
294
- var SHARED = '__core-js_shared__';
295
- var store$3 = global$e[SHARED] || setGlobal$2(SHARED, {});
296
-
297
- var sharedStore = store$3;
298
-
299
- var store$2 = sharedStore;
300
-
301
- (shared$3.exports = function (key, value) {
302
- return store$2[key] || (store$2[key] = value !== undefined ? value : {});
303
- })('versions', []).push({
304
- version: '3.19.1',
305
- mode: 'global',
306
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
307
- });
308
-
309
- var global$d = global$o;
310
- var requireObjectCoercible$1 = requireObjectCoercible$3;
311
-
312
- var Object$2 = global$d.Object;
313
-
314
- // `ToObject` abstract operation
315
- // https://tc39.es/ecma262/#sec-toobject
316
- var toObject$1 = function (argument) {
317
- return Object$2(requireObjectCoercible$1(argument));
318
- };
319
-
320
- var uncurryThis$7 = functionUncurryThis;
321
- var toObject = toObject$1;
322
-
323
- var hasOwnProperty = uncurryThis$7({}.hasOwnProperty);
324
-
325
- // `HasOwnProperty` abstract operation
326
- // https://tc39.es/ecma262/#sec-hasownproperty
327
- var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
328
- return hasOwnProperty(toObject(it), key);
329
- };
330
-
331
- var uncurryThis$6 = functionUncurryThis;
332
-
333
- var id = 0;
334
- var postfix = Math.random();
335
- var toString$3 = uncurryThis$6(1.0.toString);
336
-
337
- var uid$2 = function (key) {
338
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
339
- };
340
-
341
- var global$c = global$o;
342
- var shared$2 = shared$3.exports;
343
- var hasOwn$6 = hasOwnProperty_1;
344
- var uid$1 = uid$2;
345
- var NATIVE_SYMBOL = nativeSymbol;
346
- var USE_SYMBOL_AS_UID = useSymbolAsUid;
347
-
348
- var WellKnownSymbolsStore = shared$2('wks');
349
- var Symbol$2 = global$c.Symbol;
350
- var symbolFor = Symbol$2 && Symbol$2['for'];
351
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
352
-
353
- var wellKnownSymbol$3 = function (name) {
354
- if (!hasOwn$6(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
355
- var description = 'Symbol.' + name;
356
- if (NATIVE_SYMBOL && hasOwn$6(Symbol$2, name)) {
357
- WellKnownSymbolsStore[name] = Symbol$2[name];
358
- } else if (USE_SYMBOL_AS_UID && symbolFor) {
359
- WellKnownSymbolsStore[name] = symbolFor(description);
360
- } else {
361
- WellKnownSymbolsStore[name] = createWellKnownSymbol(description);
362
- }
363
- } return WellKnownSymbolsStore[name];
364
- };
365
-
366
- var global$b = global$o;
367
- var call$1 = functionCall;
368
- var isObject$3 = isObject$5;
369
- var isSymbol$1 = isSymbol$2;
370
- var getMethod = getMethod$1;
371
- var ordinaryToPrimitive = ordinaryToPrimitive$1;
372
- var wellKnownSymbol$2 = wellKnownSymbol$3;
373
-
374
- var TypeError$4 = global$b.TypeError;
375
- var TO_PRIMITIVE = wellKnownSymbol$2('toPrimitive');
376
-
377
- // `ToPrimitive` abstract operation
378
- // https://tc39.es/ecma262/#sec-toprimitive
379
- var toPrimitive$1 = function (input, pref) {
380
- if (!isObject$3(input) || isSymbol$1(input)) return input;
381
- var exoticToPrim = getMethod(input, TO_PRIMITIVE);
382
- var result;
383
- if (exoticToPrim) {
384
- if (pref === undefined) pref = 'default';
385
- result = call$1(exoticToPrim, input, pref);
386
- if (!isObject$3(result) || isSymbol$1(result)) return result;
387
- throw TypeError$4("Can't convert object to primitive value");
388
- }
389
- if (pref === undefined) pref = 'number';
390
- return ordinaryToPrimitive(input, pref);
391
- };
392
-
393
- var toPrimitive = toPrimitive$1;
394
- var isSymbol = isSymbol$2;
395
-
396
- // `ToPropertyKey` abstract operation
397
- // https://tc39.es/ecma262/#sec-topropertykey
398
- var toPropertyKey$2 = function (argument) {
399
- var key = toPrimitive(argument, 'string');
400
- return isSymbol(key) ? key : key + '';
401
- };
402
-
403
- var global$a = global$o;
404
- var isObject$2 = isObject$5;
405
-
406
- var document = global$a.document;
407
- // typeof document.createElement is 'object' in old IE
408
- var EXISTS$1 = isObject$2(document) && isObject$2(document.createElement);
409
-
410
- var documentCreateElement = function (it) {
411
- return EXISTS$1 ? document.createElement(it) : {};
412
- };
413
-
414
- var DESCRIPTORS$4 = descriptors;
415
- var fails$2 = fails$6;
416
- var createElement = documentCreateElement;
417
-
418
- // Thank's IE8 for his funny defineProperty
419
- var ie8DomDefine = !DESCRIPTORS$4 && !fails$2(function () {
420
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
421
- return Object.defineProperty(createElement('div'), 'a', {
422
- get: function () { return 7; }
423
- }).a != 7;
424
- });
425
-
426
- var DESCRIPTORS$3 = descriptors;
427
- var call = functionCall;
428
- var propertyIsEnumerableModule = objectPropertyIsEnumerable;
429
- var createPropertyDescriptor$1 = createPropertyDescriptor$2;
430
- var toIndexedObject$2 = toIndexedObject$3;
431
- var toPropertyKey$1 = toPropertyKey$2;
432
- var hasOwn$5 = hasOwnProperty_1;
433
- var IE8_DOM_DEFINE$1 = ie8DomDefine;
434
-
435
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
436
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
437
-
438
- // `Object.getOwnPropertyDescriptor` method
439
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
440
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
441
- O = toIndexedObject$2(O);
442
- P = toPropertyKey$1(P);
443
- if (IE8_DOM_DEFINE$1) try {
444
- return $getOwnPropertyDescriptor(O, P);
445
- } catch (error) { /* empty */ }
446
- if (hasOwn$5(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
447
- };
448
-
449
- var objectDefineProperty = {};
450
-
451
- var global$9 = global$o;
452
- var isObject$1 = isObject$5;
453
-
454
- var String$2 = global$9.String;
455
- var TypeError$3 = global$9.TypeError;
456
-
457
- // `Assert: Type(argument) is Object`
458
- var anObject$2 = function (argument) {
459
- if (isObject$1(argument)) return argument;
460
- throw TypeError$3(String$2(argument) + ' is not an object');
461
- };
462
-
463
- var global$8 = global$o;
464
- var DESCRIPTORS$2 = descriptors;
465
- var IE8_DOM_DEFINE = ie8DomDefine;
466
- var anObject$1 = anObject$2;
467
- var toPropertyKey = toPropertyKey$2;
468
-
469
- var TypeError$2 = global$8.TypeError;
470
- // eslint-disable-next-line es/no-object-defineproperty -- safe
471
- var $defineProperty = Object.defineProperty;
472
-
473
- // `Object.defineProperty` method
474
- // https://tc39.es/ecma262/#sec-object.defineproperty
475
- objectDefineProperty.f = DESCRIPTORS$2 ? $defineProperty : function defineProperty(O, P, Attributes) {
476
- anObject$1(O);
477
- P = toPropertyKey(P);
478
- anObject$1(Attributes);
479
- if (IE8_DOM_DEFINE) try {
480
- return $defineProperty(O, P, Attributes);
481
- } catch (error) { /* empty */ }
482
- if ('get' in Attributes || 'set' in Attributes) throw TypeError$2('Accessors not supported');
483
- if ('value' in Attributes) O[P] = Attributes.value;
484
- return O;
485
- };
486
-
487
- var DESCRIPTORS$1 = descriptors;
488
- var definePropertyModule$1 = objectDefineProperty;
489
- var createPropertyDescriptor = createPropertyDescriptor$2;
490
-
491
- var createNonEnumerableProperty$3 = DESCRIPTORS$1 ? function (object, key, value) {
492
- return definePropertyModule$1.f(object, key, createPropertyDescriptor(1, value));
493
- } : function (object, key, value) {
494
- object[key] = value;
495
- return object;
496
- };
497
-
498
- var redefine$1 = {exports: {}};
499
-
500
- var uncurryThis$5 = functionUncurryThis;
501
- var isCallable$4 = isCallable$a;
502
- var store$1 = sharedStore;
503
-
504
- var functionToString = uncurryThis$5(Function.toString);
505
-
506
- // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
507
- if (!isCallable$4(store$1.inspectSource)) {
508
- store$1.inspectSource = function (it) {
509
- return functionToString(it);
510
- };
511
- }
512
-
513
- var inspectSource$2 = store$1.inspectSource;
514
-
515
- var global$7 = global$o;
516
- var isCallable$3 = isCallable$a;
517
- var inspectSource$1 = inspectSource$2;
518
-
519
- var WeakMap$1 = global$7.WeakMap;
520
-
521
- var nativeWeakMap = isCallable$3(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
522
-
523
- var shared$1 = shared$3.exports;
524
- var uid = uid$2;
525
-
526
- var keys = shared$1('keys');
527
-
528
- var sharedKey$1 = function (key) {
529
- return keys[key] || (keys[key] = uid(key));
530
- };
531
-
532
- var hiddenKeys$3 = {};
533
-
534
- var NATIVE_WEAK_MAP = nativeWeakMap;
535
- var global$6 = global$o;
536
- var uncurryThis$4 = functionUncurryThis;
537
- var isObject = isObject$5;
538
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$3;
539
- var hasOwn$4 = hasOwnProperty_1;
540
- var shared = sharedStore;
541
- var sharedKey = sharedKey$1;
542
- var hiddenKeys$2 = hiddenKeys$3;
543
-
544
- var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
545
- var TypeError$1 = global$6.TypeError;
546
- var WeakMap = global$6.WeakMap;
547
- var set, get, has;
548
-
549
- var enforce = function (it) {
550
- return has(it) ? get(it) : set(it, {});
551
- };
552
-
553
- var getterFor = function (TYPE) {
554
- return function (it) {
555
- var state;
556
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
557
- throw TypeError$1('Incompatible receiver, ' + TYPE + ' required');
558
- } return state;
559
- };
560
- };
561
-
562
- if (NATIVE_WEAK_MAP || shared.state) {
563
- var store = shared.state || (shared.state = new WeakMap());
564
- var wmget = uncurryThis$4(store.get);
565
- var wmhas = uncurryThis$4(store.has);
566
- var wmset = uncurryThis$4(store.set);
567
- set = function (it, metadata) {
568
- if (wmhas(store, it)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
569
- metadata.facade = it;
570
- wmset(store, it, metadata);
571
- return metadata;
572
- };
573
- get = function (it) {
574
- return wmget(store, it) || {};
575
- };
576
- has = function (it) {
577
- return wmhas(store, it);
578
- };
579
- } else {
580
- var STATE = sharedKey('state');
581
- hiddenKeys$2[STATE] = true;
582
- set = function (it, metadata) {
583
- if (hasOwn$4(it, STATE)) throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);
584
- metadata.facade = it;
585
- createNonEnumerableProperty$2(it, STATE, metadata);
586
- return metadata;
587
- };
588
- get = function (it) {
589
- return hasOwn$4(it, STATE) ? it[STATE] : {};
590
- };
591
- has = function (it) {
592
- return hasOwn$4(it, STATE);
593
- };
594
- }
595
-
596
- var internalState = {
597
- set: set,
598
- get: get,
599
- has: has,
600
- enforce: enforce,
601
- getterFor: getterFor
602
- };
603
-
604
- var DESCRIPTORS = descriptors;
605
- var hasOwn$3 = hasOwnProperty_1;
606
-
607
- var FunctionPrototype = Function.prototype;
608
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
609
- var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
610
-
611
- var EXISTS = hasOwn$3(FunctionPrototype, 'name');
612
- // additional protection from minified / mangled / dropped function names
613
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
614
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
615
-
616
- var functionName = {
617
- EXISTS: EXISTS,
618
- PROPER: PROPER,
619
- CONFIGURABLE: CONFIGURABLE
620
- };
621
-
622
- var global$5 = global$o;
623
- var isCallable$2 = isCallable$a;
624
- var hasOwn$2 = hasOwnProperty_1;
625
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$3;
626
- var setGlobal$1 = setGlobal$3;
627
- var inspectSource = inspectSource$2;
628
- var InternalStateModule = internalState;
629
- var CONFIGURABLE_FUNCTION_NAME = functionName.CONFIGURABLE;
630
-
631
- var getInternalState = InternalStateModule.get;
632
- var enforceInternalState = InternalStateModule.enforce;
633
- var TEMPLATE = String(String).split('String');
634
-
635
- (redefine$1.exports = function (O, key, value, options) {
636
- var unsafe = options ? !!options.unsafe : false;
637
- var simple = options ? !!options.enumerable : false;
638
- var noTargetGet = options ? !!options.noTargetGet : false;
639
- var name = options && options.name !== undefined ? options.name : key;
640
- var state;
641
- if (isCallable$2(value)) {
642
- if (String(name).slice(0, 7) === 'Symbol(') {
643
- name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
644
- }
645
- if (!hasOwn$2(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
646
- createNonEnumerableProperty$1(value, 'name', name);
647
- }
648
- state = enforceInternalState(value);
649
- if (!state.source) {
650
- state.source = TEMPLATE.join(typeof name == 'string' ? name : '');
651
- }
652
- }
653
- if (O === global$5) {
654
- if (simple) O[key] = value;
655
- else setGlobal$1(key, value);
656
- return;
657
- } else if (!unsafe) {
658
- delete O[key];
659
- } else if (!noTargetGet && O[key]) {
660
- simple = true;
661
- }
662
- if (simple) O[key] = value;
663
- else createNonEnumerableProperty$1(O, key, value);
664
- // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
665
- })(Function.prototype, 'toString', function toString() {
666
- return isCallable$2(this) && getInternalState(this).source || inspectSource(this);
667
- });
668
-
669
- var objectGetOwnPropertyNames = {};
670
-
671
- var ceil = Math.ceil;
672
- var floor = Math.floor;
673
-
674
- // `ToIntegerOrInfinity` abstract operation
675
- // https://tc39.es/ecma262/#sec-tointegerorinfinity
676
- var toIntegerOrInfinity$2 = function (argument) {
677
- var number = +argument;
678
- // eslint-disable-next-line no-self-compare -- safe
679
- return number !== number || number === 0 ? 0 : (number > 0 ? floor : ceil)(number);
680
- };
681
-
682
- var toIntegerOrInfinity$1 = toIntegerOrInfinity$2;
683
-
684
- var max = Math.max;
685
- var min$1 = Math.min;
686
-
687
- // Helper for a popular repeating case of the spec:
688
- // Let integer be ? ToInteger(index).
689
- // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
690
- var toAbsoluteIndex$1 = function (index, length) {
691
- var integer = toIntegerOrInfinity$1(index);
692
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
693
- };
694
-
695
- var toIntegerOrInfinity = toIntegerOrInfinity$2;
696
-
697
- var min = Math.min;
698
-
699
- // `ToLength` abstract operation
700
- // https://tc39.es/ecma262/#sec-tolength
701
- var toLength$1 = function (argument) {
702
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
703
- };
704
-
705
- var toLength = toLength$1;
706
-
707
- // `LengthOfArrayLike` abstract operation
708
- // https://tc39.es/ecma262/#sec-lengthofarraylike
709
- var lengthOfArrayLike$1 = function (obj) {
710
- return toLength(obj.length);
711
- };
712
-
713
- var toIndexedObject$1 = toIndexedObject$3;
714
- var toAbsoluteIndex = toAbsoluteIndex$1;
715
- var lengthOfArrayLike = lengthOfArrayLike$1;
716
-
717
- // `Array.prototype.{ indexOf, includes }` methods implementation
718
- var createMethod$1 = function (IS_INCLUDES) {
719
- return function ($this, el, fromIndex) {
720
- var O = toIndexedObject$1($this);
721
- var length = lengthOfArrayLike(O);
722
- var index = toAbsoluteIndex(fromIndex, length);
723
- var value;
724
- // Array#includes uses SameValueZero equality algorithm
725
- // eslint-disable-next-line no-self-compare -- NaN check
726
- if (IS_INCLUDES && el != el) while (length > index) {
727
- value = O[index++];
728
- // eslint-disable-next-line no-self-compare -- NaN check
729
- if (value != value) return true;
730
- // Array#indexOf ignores holes, Array#includes - not
731
- } else for (;length > index; index++) {
732
- if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
733
- } return !IS_INCLUDES && -1;
734
- };
735
- };
736
-
737
- var arrayIncludes = {
738
- // `Array.prototype.includes` method
739
- // https://tc39.es/ecma262/#sec-array.prototype.includes
740
- includes: createMethod$1(true),
741
- // `Array.prototype.indexOf` method
742
- // https://tc39.es/ecma262/#sec-array.prototype.indexof
743
- indexOf: createMethod$1(false)
744
- };
745
-
746
- var uncurryThis$3 = functionUncurryThis;
747
- var hasOwn$1 = hasOwnProperty_1;
748
- var toIndexedObject = toIndexedObject$3;
749
- var indexOf = arrayIncludes.indexOf;
750
- var hiddenKeys$1 = hiddenKeys$3;
751
-
752
- var push = uncurryThis$3([].push);
753
-
754
- var objectKeysInternal = function (object, names) {
755
- var O = toIndexedObject(object);
756
- var i = 0;
757
- var result = [];
758
- var key;
759
- for (key in O) !hasOwn$1(hiddenKeys$1, key) && hasOwn$1(O, key) && push(result, key);
760
- // Don't enum bug & hidden keys
761
- while (names.length > i) if (hasOwn$1(O, key = names[i++])) {
762
- ~indexOf(result, key) || push(result, key);
763
- }
764
- return result;
765
- };
766
-
767
- // IE8- don't enum bug keys
768
- var enumBugKeys$1 = [
769
- 'constructor',
770
- 'hasOwnProperty',
771
- 'isPrototypeOf',
772
- 'propertyIsEnumerable',
773
- 'toLocaleString',
774
- 'toString',
775
- 'valueOf'
776
- ];
777
-
778
- var internalObjectKeys = objectKeysInternal;
779
- var enumBugKeys = enumBugKeys$1;
780
-
781
- var hiddenKeys = enumBugKeys.concat('length', 'prototype');
782
-
783
- // `Object.getOwnPropertyNames` method
784
- // https://tc39.es/ecma262/#sec-object.getownpropertynames
785
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
786
- objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
787
- return internalObjectKeys(O, hiddenKeys);
788
- };
789
-
790
- var objectGetOwnPropertySymbols = {};
791
-
792
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
793
- objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
794
-
795
- var getBuiltIn = getBuiltIn$3;
796
- var uncurryThis$2 = functionUncurryThis;
797
- var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
798
- var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
799
- var anObject = anObject$2;
800
-
801
- var concat = uncurryThis$2([].concat);
802
-
803
- // all object keys, includes non-enumerable and symbols
804
- var ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
805
- var keys = getOwnPropertyNamesModule.f(anObject(it));
806
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
807
- return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
808
- };
809
-
810
- var hasOwn = hasOwnProperty_1;
811
- var ownKeys = ownKeys$1;
812
- var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
813
- var definePropertyModule = objectDefineProperty;
814
-
815
- var copyConstructorProperties$1 = function (target, source) {
816
- var keys = ownKeys(source);
817
- var defineProperty = definePropertyModule.f;
818
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
819
- for (var i = 0; i < keys.length; i++) {
820
- var key = keys[i];
821
- if (!hasOwn(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
822
- }
823
- };
824
-
825
- var fails$1 = fails$6;
826
- var isCallable$1 = isCallable$a;
827
-
828
- var replacement = /#|\.prototype\./;
829
-
830
- var isForced$1 = function (feature, detection) {
831
- var value = data[normalize(feature)];
832
- return value == POLYFILL ? true
833
- : value == NATIVE ? false
834
- : isCallable$1(detection) ? fails$1(detection)
835
- : !!detection;
836
- };
837
-
838
- var normalize = isForced$1.normalize = function (string) {
839
- return String(string).replace(replacement, '.').toLowerCase();
840
- };
841
-
842
- var data = isForced$1.data = {};
843
- var NATIVE = isForced$1.NATIVE = 'N';
844
- var POLYFILL = isForced$1.POLYFILL = 'P';
845
-
846
- var isForced_1 = isForced$1;
847
-
848
- var global$4 = global$o;
849
- var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
850
- var createNonEnumerableProperty = createNonEnumerableProperty$3;
851
- var redefine = redefine$1.exports;
852
- var setGlobal = setGlobal$3;
853
- var copyConstructorProperties = copyConstructorProperties$1;
854
- var isForced = isForced_1;
855
-
856
- /*
857
- options.target - name of the target object
858
- options.global - target is the global object
859
- options.stat - export as static methods of target
860
- options.proto - export as prototype methods of target
861
- options.real - real prototype method for the `pure` version
862
- options.forced - export even if the native feature is available
863
- options.bind - bind methods to the target, required for the `pure` version
864
- options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
865
- options.unsafe - use the simple assignment of property instead of delete + defineProperty
866
- options.sham - add a flag to not completely full polyfills
867
- options.enumerable - export as enumerable property
868
- options.noTargetGet - prevent calling a getter on target
869
- options.name - the .name of the function if it does not match the key
870
- */
871
- var _export = function (options, source) {
872
- var TARGET = options.target;
873
- var GLOBAL = options.global;
874
- var STATIC = options.stat;
875
- var FORCED, target, key, targetProperty, sourceProperty, descriptor;
876
- if (GLOBAL) {
877
- target = global$4;
878
- } else if (STATIC) {
879
- target = global$4[TARGET] || setGlobal(TARGET, {});
880
- } else {
881
- target = (global$4[TARGET] || {}).prototype;
882
- }
883
- if (target) for (key in source) {
884
- sourceProperty = source[key];
885
- if (options.noTargetGet) {
886
- descriptor = getOwnPropertyDescriptor(target, key);
887
- targetProperty = descriptor && descriptor.value;
888
- } else targetProperty = target[key];
889
- FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
890
- // contained in target
891
- if (!FORCED && targetProperty !== undefined) {
892
- if (typeof sourceProperty == typeof targetProperty) continue;
893
- copyConstructorProperties(sourceProperty, targetProperty);
894
- }
895
- // add a flag to not completely full polyfills
896
- if (options.sham || (targetProperty && targetProperty.sham)) {
897
- createNonEnumerableProperty(sourceProperty, 'sham', true);
898
- }
899
- // extend global
900
- redefine(target, key, sourceProperty, options);
901
- }
902
- };
903
-
904
- var wellKnownSymbol$1 = wellKnownSymbol$3;
905
-
906
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
907
- var test = {};
908
-
909
- test[TO_STRING_TAG$1] = 'z';
910
-
911
- var toStringTagSupport = String(test) === '[object z]';
912
-
913
- var global$3 = global$o;
914
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
915
- var isCallable = isCallable$a;
916
- var classofRaw = classofRaw$1;
917
- var wellKnownSymbol = wellKnownSymbol$3;
918
-
919
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
920
- var Object$1 = global$3.Object;
921
-
922
- // ES3 wrong here
923
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
924
-
925
- // fallback for IE11 Script Access Denied error
926
- var tryGet = function (it, key) {
927
- try {
928
- return it[key];
929
- } catch (error) { /* empty */ }
930
- };
931
-
932
- // getting tag from ES6+ `Object.prototype.toString`
933
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
934
- var O, tag, result;
935
- return it === undefined ? 'Undefined' : it === null ? 'Null'
936
- // @@toStringTag case
937
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
938
- // builtinTag case
939
- : CORRECT_ARGUMENTS ? classofRaw(O)
940
- // ES3 arguments fallback
941
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
942
- };
943
-
944
- var global$2 = global$o;
945
- var classof = classof$1;
946
-
947
- var String$1 = global$2.String;
948
-
949
- var toString$2 = function (argument) {
950
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
951
- return String$1(argument);
952
- };
953
-
954
- // a string of all valid unicode whitespaces
955
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
956
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
957
-
958
- var uncurryThis$1 = functionUncurryThis;
959
- var requireObjectCoercible = requireObjectCoercible$3;
960
- var toString$1 = toString$2;
961
- var whitespaces$1 = whitespaces$2;
962
-
963
- var replace = uncurryThis$1(''.replace);
964
- var whitespace = '[' + whitespaces$1 + ']';
965
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
966
- var rtrim = RegExp(whitespace + whitespace + '*$');
967
-
968
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
969
- var createMethod = function (TYPE) {
970
- return function ($this) {
971
- var string = toString$1(requireObjectCoercible($this));
972
- if (TYPE & 1) string = replace(string, ltrim, '');
973
- if (TYPE & 2) string = replace(string, rtrim, '');
974
- return string;
975
- };
976
- };
977
-
978
- var stringTrim = {
979
- // `String.prototype.{ trimLeft, trimStart }` methods
980
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
981
- start: createMethod(1),
982
- // `String.prototype.{ trimRight, trimEnd }` methods
983
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
984
- end: createMethod(2),
985
- // `String.prototype.trim` method
986
- // https://tc39.es/ecma262/#sec-string.prototype.trim
987
- trim: createMethod(3)
988
- };
989
-
990
- var global$1 = global$o;
991
- var fails = fails$6;
992
- var uncurryThis = functionUncurryThis;
993
- var toString = toString$2;
994
- var trim = stringTrim.trim;
995
- var whitespaces = whitespaces$2;
996
-
997
- var $parseInt$1 = global$1.parseInt;
998
- var Symbol$1 = global$1.Symbol;
999
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
1000
- var hex = /^[+-]?0x/i;
1001
- var exec = uncurryThis(hex.exec);
1002
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
1003
- // MS Edge 18- broken with boxed symbols
1004
- || (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
1005
-
1006
- // `parseInt` method
1007
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1008
- var numberParseInt = FORCED ? function parseInt(string, radix) {
1009
- var S = trim(toString(string));
1010
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1011
- } : $parseInt$1;
1012
-
1013
- var $ = _export;
1014
- var $parseInt = numberParseInt;
1015
-
1016
- // `parseInt` method
1017
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1018
- $({ global: true, forced: parseInt != $parseInt }, {
1019
- parseInt: $parseInt
1020
- });
1021
-
1022
- const GERESH = '׳';
1023
- const GERSHAYIM = '״';
5
+ var GERESH = '׳';
6
+ var GERSHAYIM = '״';
1024
7
  /**
1025
8
  * @private
1026
9
  * @param {number} num
@@ -1109,13 +92,13 @@ function num2heb(num) {
1109
92
 
1110
93
 
1111
94
  function gematriya(number) {
1112
- let num = parseInt(number, 10);
95
+ var num = parseInt(number, 10);
1113
96
 
1114
97
  if (!num) {
1115
98
  throw new TypeError("invalid parameter to gematriya ".concat(number));
1116
99
  }
1117
100
 
1118
- const digits = [];
101
+ var digits = [];
1119
102
  num = num % 1000;
1120
103
 
1121
104
  while (num > 0) {
@@ -1125,8 +108,8 @@ function gematriya(number) {
1125
108
  break;
1126
109
  }
1127
110
 
1128
- let incr = 100;
1129
- let i;
111
+ var incr = 100;
112
+ var i = void 0;
1130
113
 
1131
114
  for (i = 400; i > num; i -= incr) {
1132
115
  if (i === incr) {
@@ -1142,19 +125,57 @@ function gematriya(number) {
1142
125
  return num2heb(digits[0]) + GERESH;
1143
126
  }
1144
127
 
1145
- let str = '';
128
+ var str = '';
1146
129
 
1147
- for (let i = 0; i < digits.length; i++) {
1148
- if (i + 1 === digits.length) {
130
+ for (var _i = 0; _i < digits.length; _i++) {
131
+ if (_i + 1 === digits.length) {
1149
132
  str += GERSHAYIM;
1150
133
  }
1151
134
 
1152
- str += num2heb(digits[i]);
135
+ str += num2heb(digits[_i]);
1153
136
  }
1154
137
 
1155
138
  return str;
1156
139
  }
1157
140
 
141
+ function _typeof(obj) {
142
+ "@babel/helpers - typeof";
143
+
144
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
145
+ _typeof = function (obj) {
146
+ return typeof obj;
147
+ };
148
+ } else {
149
+ _typeof = function (obj) {
150
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
151
+ };
152
+ }
153
+
154
+ return _typeof(obj);
155
+ }
156
+
157
+ function _classCallCheck(instance, Constructor) {
158
+ if (!(instance instanceof Constructor)) {
159
+ throw new TypeError("Cannot call a class as a function");
160
+ }
161
+ }
162
+
163
+ function _defineProperties(target, props) {
164
+ for (var i = 0; i < props.length; i++) {
165
+ var descriptor = props[i];
166
+ descriptor.enumerable = descriptor.enumerable || false;
167
+ descriptor.configurable = true;
168
+ if ("value" in descriptor) descriptor.writable = true;
169
+ Object.defineProperty(target, descriptor.key, descriptor);
170
+ }
171
+ }
172
+
173
+ function _createClass(Constructor, protoProps, staticProps) {
174
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
175
+ if (staticProps) _defineProperties(Constructor, staticProps);
176
+ return Constructor;
177
+ }
178
+
1158
179
  /*
1159
180
  Hebcal - A Jewish Calendar Generator
1160
181
  Copyright (c) 1994-2020 Danny Sadinoff
@@ -1175,7 +196,7 @@ function gematriya(number) {
1175
196
  You should have received a copy of the GNU General Public License
1176
197
  along with this program. If not, see <http://www.gnu.org/licenses/>.
1177
198
  */
1178
- const monthLengths = [[0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]];
199
+ var monthLengths = [[0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]];
1179
200
  /**
1180
201
  * @private
1181
202
  * @param {number} x
@@ -1202,7 +223,7 @@ function quotient(x, y) {
1202
223
  */
1203
224
 
1204
225
 
1205
- const greg = {
226
+ var greg = {
1206
227
  /**
1207
228
  * Long names of the Gregorian months (1='January', 12='December')
1208
229
  * @readonly
@@ -1236,7 +257,7 @@ const greg = {
1236
257
  * @return {boolean}
1237
258
  */
1238
259
  isDate: function isDate(obj) {
1239
- return typeof obj === 'object' && Date.prototype === obj.__proto__;
260
+ return _typeof(obj) === 'object' && Date.prototype === obj.__proto__;
1240
261
  },
1241
262
 
1242
263
  /**
@@ -1249,7 +270,7 @@ const greg = {
1249
270
  throw new TypeError('Argument to greg.dayOfYear not a Date');
1250
271
  }
1251
272
 
1252
- let doy = date.getDate() + 31 * date.getMonth();
273
+ var doy = date.getDate() + 31 * date.getMonth();
1253
274
 
1254
275
  if (date.getMonth() > 1) {
1255
276
  // FEB
@@ -1273,7 +294,7 @@ const greg = {
1273
294
  throw new TypeError('Argument to greg.greg2abs not a Date');
1274
295
  }
1275
296
 
1276
- const year = date.getFullYear() - 1;
297
+ var year = date.getFullYear() - 1;
1277
298
  return this.dayOfYear(date) + // days this year
1278
299
  365 * year + ( // + days in prior years
1279
300
  Math.floor(year / 4) - // + Julian Leap years
@@ -1287,15 +308,15 @@ const greg = {
1287
308
  * @return {number}
1288
309
  */
1289
310
  yearFromFixed: function yearFromFixed(theDate) {
1290
- const l0 = theDate - 1;
1291
- const n400 = quotient(l0, 146097);
1292
- const d1 = mod(l0, 146097);
1293
- const n100 = quotient(d1, 36524);
1294
- const d2 = mod(d1, 36524);
1295
- const n4 = quotient(d2, 1461);
1296
- const d3 = mod(d2, 1461);
1297
- const n1 = quotient(d3, 365);
1298
- const year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
311
+ var l0 = theDate - 1;
312
+ var n400 = quotient(l0, 146097);
313
+ var d1 = mod(l0, 146097);
314
+ var n100 = quotient(d1, 36524);
315
+ var d2 = mod(d1, 36524);
316
+ var n4 = quotient(d2, 1461);
317
+ var d3 = mod(d2, 1461);
318
+ var n1 = quotient(d3, 365);
319
+ var year = 400 * n400 + 100 * n100 + 4 * n4 + n1;
1299
320
  return n100 != 4 && n1 != 4 ? year + 1 : year;
1300
321
  },
1301
322
 
@@ -1307,7 +328,7 @@ const greg = {
1307
328
  * @return {number}
1308
329
  */
1309
330
  toFixed: function toFixed(year, month, day) {
1310
- const py = year - 1;
331
+ var py = year - 1;
1311
332
  return 0 + 365 * py + quotient(py, 4) - quotient(py, 100) + quotient(py, 400) + quotient(367 * month - 362, 12) + Math.floor(month <= 2 ? 0 : this.isLeapYear(year) ? -1 : -2) + day;
1312
333
  },
1313
334
 
@@ -1326,12 +347,12 @@ const greg = {
1326
347
  }
1327
348
 
1328
349
  theDate = Math.trunc(theDate);
1329
- const year = this.yearFromFixed(theDate);
1330
- const priorDays = theDate - this.toFixed(year, 1, 1);
1331
- const correction = theDate < this.toFixed(year, 3, 1) ? 0 : this.isLeapYear(year) ? 1 : 2;
1332
- const month = quotient(12 * (priorDays + correction) + 373, 367);
1333
- const day = theDate - this.toFixed(year, month, 1) + 1;
1334
- const dt = new Date(year, month - 1, day);
350
+ var year = this.yearFromFixed(theDate);
351
+ var priorDays = theDate - this.toFixed(year, 1, 1);
352
+ var correction = theDate < this.toFixed(year, 3, 1) ? 0 : this.isLeapYear(year) ? 1 : 2;
353
+ var month = quotient(12 * (priorDays + correction) + 373, 367);
354
+ var day = theDate - this.toFixed(year, month, 1) + 1;
355
+ var dt = new Date(year, month - 1, day);
1335
356
 
1336
357
  if (year < 100 && year >= 0) {
1337
358
  dt.setFullYear(year);
@@ -1341,7 +362,7 @@ const greg = {
1341
362
  }
1342
363
  };
1343
364
 
1344
- const noopLocale = {
365
+ var noopLocale = {
1345
366
  headers: {
1346
367
  'plural-forms': 'nplurals=2; plural=(n!=1);'
1347
368
  },
@@ -1349,7 +370,7 @@ const noopLocale = {
1349
370
  '': {}
1350
371
  }
1351
372
  };
1352
- const alias = {
373
+ var alias = {
1353
374
  'h': 'he',
1354
375
  'a': 'ashkenazi',
1355
376
  's': 'en',
@@ -1365,7 +386,7 @@ const alias = {
1365
386
  * @namespace
1366
387
  */
1367
388
 
1368
- const Locale = {
389
+ var Locale = {
1369
390
  /** @private */
1370
391
  locales: Object.create(null),
1371
392
 
@@ -1383,9 +404,9 @@ const Locale = {
1383
404
  * @return {string}
1384
405
  */
1385
406
  lookupTranslation: function lookupTranslation(id, locale) {
1386
- const locale0 = locale && locale.toLowerCase();
1387
- const loc = typeof locale == 'string' && this.locales[locale0] || this.activeLocale;
1388
- const array = loc[id];
407
+ var locale0 = locale && locale.toLowerCase();
408
+ var loc = typeof locale == 'string' && this.locales[locale0] || this.activeLocale;
409
+ var array = loc[id];
1389
410
 
1390
411
  if (array && array.length && array[0].length) {
1391
412
  return array[0];
@@ -1401,7 +422,7 @@ const Locale = {
1401
422
  * @return {string}
1402
423
  */
1403
424
  gettext: function gettext(id, locale) {
1404
- const text = this.lookupTranslation(id, locale);
425
+ var text = this.lookupTranslation(id, locale);
1405
426
 
1406
427
  if (typeof text == 'undefined') {
1407
428
  return id;
@@ -1416,7 +437,7 @@ const Locale = {
1416
437
  * @param {LocaleDate} data parsed data from a `.po` file.
1417
438
  */
1418
439
  addLocale: function addLocale(locale, data) {
1419
- if (typeof data.contexts !== 'object' || typeof data.contexts[''] !== 'object') {
440
+ if (_typeof(data.contexts) !== 'object' || _typeof(data.contexts['']) !== 'object') {
1420
441
  throw new TypeError("Locale '".concat(locale, "' invalid compact format"));
1421
442
  }
1422
443
 
@@ -1431,8 +452,8 @@ const Locale = {
1431
452
  * @return {LocaleData}
1432
453
  */
1433
454
  useLocale: function useLocale(locale) {
1434
- const locale0 = locale.toLowerCase();
1435
- const obj = this.locales[locale0];
455
+ var locale0 = locale.toLowerCase();
456
+ var obj = this.locales[locale0];
1436
457
 
1437
458
  if (!obj) {
1438
459
  throw new RangeError("Locale '".concat(locale, "' not found"));
@@ -1457,8 +478,8 @@ const Locale = {
1457
478
  * @return {string}
1458
479
  */
1459
480
  ordinal: function ordinal(n, locale) {
1460
- const locale1 = locale && locale.toLowerCase();
1461
- const locale0 = locale1 || this.activeName;
481
+ var locale1 = locale && locale.toLowerCase();
482
+ var locale0 = locale1 || this.activeName;
1462
483
 
1463
484
  if (!locale0) {
1464
485
  return this.getEnOrdinal(n);
@@ -1493,8 +514,8 @@ const Locale = {
1493
514
  * @return {string}
1494
515
  */
1495
516
  getEnOrdinal: function getEnOrdinal(n) {
1496
- const s = ['th', 'st', 'nd', 'rd'];
1497
- const v = n % 100;
517
+ var s = ['th', 'st', 'nd', 'rd'];
518
+ var v = n % 100;
1498
519
  return n + (s[(v - 20) % 10] || s[v] || s[0]);
1499
520
  },
1500
521
 
@@ -1512,26 +533,26 @@ Locale.addLocale('s', noopLocale);
1512
533
  Locale.addLocale('', noopLocale);
1513
534
  Locale.useLocale('en');
1514
535
 
1515
- const NISAN = 1;
1516
- const IYYAR = 2;
1517
- const SIVAN = 3;
1518
- const TAMUZ = 4;
1519
- const AV = 5;
1520
- const ELUL = 6;
1521
- const TISHREI = 7;
1522
- const CHESHVAN = 8;
1523
- const KISLEV = 9;
1524
- const TEVET = 10;
1525
- const SHVAT = 11;
1526
- const ADAR_I = 12;
1527
- const ADAR_II = 13;
536
+ var NISAN = 1;
537
+ var IYYAR = 2;
538
+ var SIVAN = 3;
539
+ var TAMUZ = 4;
540
+ var AV = 5;
541
+ var ELUL = 6;
542
+ var TISHREI = 7;
543
+ var CHESHVAN = 8;
544
+ var KISLEV = 9;
545
+ var TEVET = 10;
546
+ var SHVAT = 11;
547
+ var ADAR_I = 12;
548
+ var ADAR_II = 13;
1528
549
  /**
1529
550
  * Hebrew months of the year (NISAN=1, TISHREI=7)
1530
551
  * @readonly
1531
552
  * @enum {number}
1532
553
  */
1533
554
 
1534
- const months = {
555
+ var months = {
1535
556
  /** Nissan / ניסן */
1536
557
  NISAN: 1,
1537
558
 
@@ -1571,34 +592,34 @@ const months = {
1571
592
  /** Adar Sheini (only on leap years) / אדר ב׳ */
1572
593
  ADAR_II: 13
1573
594
  };
1574
- const monthNames0 = ['', 'Nisan', 'Iyyar', 'Sivan', 'Tamuz', 'Av', 'Elul', 'Tishrei', 'Cheshvan', 'Kislev', 'Tevet', 'Sh\'vat'];
595
+ var monthNames0 = ['', 'Nisan', 'Iyyar', 'Sivan', 'Tamuz', 'Av', 'Elul', 'Tishrei', 'Cheshvan', 'Kislev', 'Tevet', 'Sh\'vat'];
1575
596
  /**
1576
597
  * Transliterations of Hebrew month names.
1577
598
  * Regular years are index 0 and leap years are index 1.
1578
599
  * @private
1579
600
  */
1580
601
 
1581
- const monthNames = [monthNames0.concat(['Adar', 'Nisan']), monthNames0.concat(['Adar I', 'Adar II', 'Nisan'])]; // eslint-disable-next-line require-jsdoc
602
+ var monthNames = [monthNames0.concat(['Adar', 'Nisan']), monthNames0.concat(['Adar I', 'Adar II', 'Nisan'])]; // eslint-disable-next-line require-jsdoc
1582
603
 
1583
604
  function throwTypeError(msg) {
1584
605
  throw new TypeError(msg);
1585
606
  }
1586
607
 
1587
- const edCache = Object.create(null);
1588
- const EPOCH = -1373428; // Avg year length in the cycle (19 solar years with 235 lunar months)
608
+ var edCache = Object.create(null);
609
+ var EPOCH = -1373428; // Avg year length in the cycle (19 solar years with 235 lunar months)
1589
610
 
1590
- const AVG_HEBYEAR_DAYS = 365.24682220597794;
1591
- const UNITS_DAY = 'day';
1592
- const UNITS_WEEK = 'week';
1593
- const UNITS_MONTH = 'month';
1594
- const UNITS_YEAR = 'year';
1595
- const UNITS_SINGLE = {
611
+ var AVG_HEBYEAR_DAYS = 365.24682220597794;
612
+ var UNITS_DAY = 'day';
613
+ var UNITS_WEEK = 'week';
614
+ var UNITS_MONTH = 'month';
615
+ var UNITS_YEAR = 'year';
616
+ var UNITS_SINGLE = {
1596
617
  d: UNITS_DAY,
1597
618
  w: UNITS_WEEK,
1598
619
  M: UNITS_MONTH,
1599
620
  y: UNITS_YEAR
1600
621
  };
1601
- const UNITS_VALID = {
622
+ var UNITS_VALID = {
1602
623
  day: UNITS_DAY,
1603
624
  week: UNITS_WEEK,
1604
625
  month: UNITS_MONTH,
@@ -1615,7 +636,7 @@ const UNITS_VALID = {
1615
636
 
1616
637
  /** Represents a Hebrew date */
1617
638
 
1618
- class HDate {
639
+ var HDate = /*#__PURE__*/function () {
1619
640
  /**
1620
641
  * Create a Hebrew date. There are 3 basic forms for the `HDate()` constructor.
1621
642
  *
@@ -1646,7 +667,9 @@ class HDate {
1646
667
  * @param {number|string} [month] - Hebrew month of year (1=NISAN, 7=TISHREI)
1647
668
  * @param {number} [year] - Hebrew year
1648
669
  */
1649
- constructor(day, month, year) {
670
+ function HDate(day, month, year) {
671
+ _classCallCheck(this, HDate);
672
+
1650
673
  if (arguments.length == 2 || arguments.length > 3) {
1651
674
  throw new TypeError('HDate constructor requires 0, 1 or 3 arguments');
1652
675
  }
@@ -1684,13 +707,13 @@ class HDate {
1684
707
  } // 1 argument
1685
708
 
1686
709
 
1687
- const abs0 = typeof day === 'number' && !isNaN(day) ? day : greg.isDate(day) ? greg.greg2abs(day) : HDate.isHDate(day) ? {
710
+ var abs0 = typeof day === 'number' && !isNaN(day) ? day : greg.isDate(day) ? greg.greg2abs(day) : HDate.isHDate(day) ? {
1688
711
  dd: day.day,
1689
712
  mm: day.month,
1690
713
  yy: day.year
1691
714
  } : throwTypeError("HDate called with bad argument: ".concat(day));
1692
- const isNumber = typeof abs0 === 'number';
1693
- const d = isNumber ? HDate.abs2hebrew(abs0) : abs0;
715
+ var isNumber = typeof abs0 === 'number';
716
+ var d = isNumber ? HDate.abs2hebrew(abs0) : abs0;
1694
717
  /**
1695
718
  * @private
1696
719
  * @type {number}
@@ -1725,806 +748,872 @@ class HDate {
1725
748
  */
1726
749
 
1727
750
 
1728
- getFullYear() {
1729
- return this.year;
1730
- }
1731
- /**
1732
- * Tests if this date occurs during a leap year
1733
- * @return {boolean}
1734
- */
1735
-
1736
-
1737
- isLeapYear() {
1738
- return HDate.isLeapYear(this.year);
1739
- }
1740
- /**
1741
- * Gets the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
1742
- * @return {number}
1743
- */
751
+ _createClass(HDate, [{
752
+ key: "getFullYear",
753
+ value: function getFullYear() {
754
+ return this.year;
755
+ }
756
+ /**
757
+ * Tests if this date occurs during a leap year
758
+ * @return {boolean}
759
+ */
760
+
761
+ }, {
762
+ key: "isLeapYear",
763
+ value: function isLeapYear() {
764
+ return HDate.isLeapYear(this.year);
765
+ }
766
+ /**
767
+ * Gets the Hebrew month (1=NISAN, 7=TISHREI) of this Hebrew date
768
+ * @return {number}
769
+ */
770
+
771
+ }, {
772
+ key: "getMonth",
773
+ value: function getMonth() {
774
+ return this.month;
775
+ }
776
+ /**
777
+ * The Tishrei-based month of the date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
778
+ * @return {number}
779
+ */
780
+
781
+ }, {
782
+ key: "getTishreiMonth",
783
+ value: function getTishreiMonth() {
784
+ var nummonths = HDate.monthsInYear(this.getFullYear());
785
+ return (this.getMonth() + nummonths - 6) % nummonths || nummonths;
786
+ }
787
+ /**
788
+ * Number of days in the month of this Hebrew date
789
+ * @return {number}
790
+ */
791
+
792
+ }, {
793
+ key: "daysInMonth",
794
+ value: function daysInMonth() {
795
+ return HDate.daysInMonth(this.getMonth(), this.getFullYear());
796
+ }
797
+ /**
798
+ * Gets the day within the month (1-30)
799
+ * @return {number}
800
+ */
801
+
802
+ }, {
803
+ key: "getDate",
804
+ value: function getDate() {
805
+ return this.day;
806
+ }
807
+ /**
808
+ * Gets the day of the week. 0=Sunday, 6=Saturday
809
+ * @return {number}
810
+ */
811
+
812
+ }, {
813
+ key: "getDay",
814
+ value: function getDay() {
815
+ return mod(this.abs(), 7);
816
+ }
817
+ /**
818
+ * Sets the year of the date. Returns the object it was called upon.
819
+ * @private
820
+ * @deprecated
821
+ * @param {number} year
822
+ * @return {HDate}
823
+ */
824
+
825
+ }, {
826
+ key: "setFullYear",
827
+ value: function setFullYear(year) {
828
+ this.year = year;
829
+ fix(this);
830
+ return this;
831
+ }
832
+ /**
833
+ * Sets the day of the month of the date. Returns the object it was called upon
834
+ * @private
835
+ * @param {number} month
836
+ * @return {HDate}
837
+ */
838
+
839
+ }, {
840
+ key: "setMonth",
841
+ value: function setMonth(month) {
842
+ this.month = HDate.monthNum(month);
843
+ fix(this);
844
+ return this;
845
+ }
846
+ /**
847
+ * @private
848
+ * @param {number} date
849
+ * @return {HDate}
850
+ */
851
+
852
+ }, {
853
+ key: "setDate",
854
+ value: function setDate(date) {
855
+ this.day = date;
856
+ fix(this);
857
+ return this;
858
+ }
859
+ /**
860
+ * Converts to Gregorian date
861
+ * @return {Date}
862
+ */
863
+
864
+ }, {
865
+ key: "greg",
866
+ value: function greg$1() {
867
+ return greg.abs2greg(this.abs());
868
+ }
869
+ /**
870
+ * Returns R.D. (Rata Die) fixed days.
871
+ * R.D. 1 == Monday, January 1, 1 (Gregorian)
872
+ * Note also that R.D. = Julian Date − 1,721,424.5
873
+ * https://en.wikipedia.org/wiki/Rata_Die#Dershowitz_and_Reingold
874
+ * @return {number}
875
+ */
876
+
877
+ }, {
878
+ key: "abs",
879
+ value: function abs() {
880
+ if (typeof this.abs0 !== 'number') {
881
+ this.abs0 = HDate.hebrew2abs(this.year, this.month, this.day);
882
+ }
1744
883
 
1745
-
1746
- getMonth() {
1747
- return this.month;
1748
- }
1749
- /**
1750
- * The Tishrei-based month of the date. 1 is Tishrei, 7 is Nisan, 13 is Elul in a leap year
1751
- * @return {number}
1752
- */
1753
-
1754
-
1755
- getTishreiMonth() {
1756
- const nummonths = HDate.monthsInYear(this.getFullYear());
1757
- return (this.getMonth() + nummonths - 6) % nummonths || nummonths;
1758
- }
1759
- /**
1760
- * Number of days in the month of this Hebrew date
1761
- * @return {number}
1762
- */
1763
-
1764
-
1765
- daysInMonth() {
1766
- return HDate.daysInMonth(this.getMonth(), this.getFullYear());
1767
- }
1768
- /**
1769
- * Gets the day within the month (1-30)
1770
- * @return {number}
1771
- */
1772
-
1773
-
1774
- getDate() {
1775
- return this.day;
1776
- }
1777
- /**
1778
- * Gets the day of the week. 0=Sunday, 6=Saturday
1779
- * @return {number}
1780
- */
1781
-
1782
-
1783
- getDay() {
1784
- return mod(this.abs(), 7);
1785
- }
1786
- /**
1787
- * Sets the year of the date. Returns the object it was called upon.
1788
- * @private
1789
- * @deprecated
1790
- * @param {number} year
1791
- * @return {HDate}
1792
- */
1793
-
1794
-
1795
- setFullYear(year) {
1796
- this.year = year;
1797
- fix(this);
1798
- return this;
1799
- }
1800
- /**
1801
- * Sets the day of the month of the date. Returns the object it was called upon
1802
- * @private
1803
- * @param {number} month
1804
- * @return {HDate}
1805
- */
1806
-
1807
-
1808
- setMonth(month) {
1809
- this.month = HDate.monthNum(month);
1810
- fix(this);
1811
- return this;
1812
- }
1813
- /**
1814
- * @private
1815
- * @param {number} date
1816
- * @return {HDate}
1817
- */
1818
-
1819
-
1820
- setDate(date) {
1821
- this.day = date;
1822
- fix(this);
1823
- return this;
1824
- }
1825
- /**
1826
- * Converts to Gregorian date
1827
- * @return {Date}
1828
- */
1829
-
1830
-
1831
- greg() {
1832
- return greg.abs2greg(this.abs());
1833
- }
1834
- /**
1835
- * Returns R.D. (Rata Die) fixed days.
1836
- * R.D. 1 == Monday, January 1, 1 (Gregorian)
1837
- * Note also that R.D. = Julian Date − 1,721,424.5
1838
- * https://en.wikipedia.org/wiki/Rata_Die#Dershowitz_and_Reingold
1839
- * @return {number}
1840
- */
1841
-
1842
-
1843
- abs() {
1844
- if (typeof this.abs0 !== 'number') {
1845
- this.abs0 = HDate.hebrew2abs(this.year, this.month, this.day);
884
+ return this.abs0;
1846
885
  }
1847
-
1848
- return this.abs0;
1849
- }
1850
- /**
1851
- * Converts Hebrew date to R.D. (Rata Die) fixed days.
1852
- * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
1853
- * Calendar.
1854
- * @param {number} year Hebrew year
1855
- * @param {number} month Hebrew month
1856
- * @param {number} day Hebrew date (1-30)
1857
- * @return {number}
1858
- */
1859
-
1860
-
1861
- static hebrew2abs(year, month, day) {
1862
- let tempabs = day;
1863
-
1864
- if (month < TISHREI) {
1865
- for (let m = TISHREI; m <= HDate.monthsInYear(year); m++) {
1866
- tempabs += HDate.daysInMonth(m, year);
1867
- }
1868
-
1869
- for (let m = NISAN; m < month; m++) {
1870
- tempabs += HDate.daysInMonth(m, year);
1871
- }
1872
- } else {
1873
- for (let m = TISHREI; m < month; m++) {
1874
- tempabs += HDate.daysInMonth(m, year);
886
+ /**
887
+ * Converts Hebrew date to R.D. (Rata Die) fixed days.
888
+ * R.D. 1 is the imaginary date Monday, January 1, 1 on the Gregorian
889
+ * Calendar.
890
+ * @param {number} year Hebrew year
891
+ * @param {number} month Hebrew month
892
+ * @param {number} day Hebrew date (1-30)
893
+ * @return {number}
894
+ */
895
+
896
+ }, {
897
+ key: "getMonthName",
898
+ value:
899
+ /**
900
+ * Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
901
+ * @return {string}
902
+ */
903
+ function getMonthName() {
904
+ return HDate.getMonthName(this.getMonth(), this.getFullYear());
905
+ }
906
+ /**
907
+ * Renders this Hebrew date as a translated or transliterated string,
908
+ * including ordinal e.g. `'15th of Cheshvan, 5769'`.
909
+ * @example
910
+ * import {HDate, months} from '@hebcal/core';
911
+ *
912
+ * const hd = new HDate(15, months.CHESHVAN, 5769);
913
+ * console.log(hd.render()); // '15th of Cheshvan, 5769'
914
+ * console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
915
+ * @param {string} [locale] Optional locale name (defaults to active locale).
916
+ * @param {boolean} [showYear=true] Display year (defaults to true).
917
+ * @return {string}
918
+ */
919
+
920
+ }, {
921
+ key: "render",
922
+ value: function render() {
923
+ var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
924
+ var showYear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
925
+ var locale0 = locale || Locale.getLocaleName();
926
+ var day = this.getDate();
927
+ var monthName = Locale.gettext(this.getMonthName(), locale0);
928
+ var nth = Locale.ordinal(day, locale0);
929
+ var dayOf = HDate.getDayOfTranslation(locale0);
930
+ var dateStr = "".concat(nth).concat(dayOf, " ").concat(monthName);
931
+
932
+ if (showYear) {
933
+ var fullYear = this.getFullYear();
934
+ return "".concat(dateStr, ", ").concat(fullYear);
935
+ } else {
936
+ return dateStr;
1875
937
  }
1876
938
  }
1877
-
1878
- return EPOCH + HDate.elapsedDays(year) + tempabs - 1;
1879
- }
1880
- /**
1881
- * @private
1882
- * @param {number} year
1883
- * @return {number}
1884
- */
1885
-
1886
-
1887
- static newYear(year) {
1888
- return EPOCH + HDate.elapsedDays(year) + HDate.newYearDelay(year);
1889
- }
1890
- /**
1891
- * @private
1892
- * @param {number} year
1893
- * @return {number}
1894
- */
1895
-
1896
-
1897
- static newYearDelay(year) {
1898
- const ny1 = HDate.elapsedDays(year);
1899
- const ny2 = HDate.elapsedDays(year + 1);
1900
-
1901
- if (ny2 - ny1 === 356) {
1902
- return 2;
1903
- } else {
1904
- const ny0 = HDate.elapsedDays(year - 1);
1905
- return ny1 - ny0 === 382 ? 1 : 0;
939
+ /**
940
+ * @private
941
+ * @param {string} locale
942
+ * @return {string}
943
+ */
944
+
945
+ }, {
946
+ key: "renderGematriya",
947
+ value:
948
+ /**
949
+ * Renders this Hebrew date in Hebrew gematriya, regardless of locale.
950
+ * @example
951
+ * import {HDate, months} from '@hebcal/core';
952
+ * const hd = new HDate(15, months.CHESHVAN, 5769);
953
+ * console.log(ev.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
954
+ * @return {string}
955
+ */
956
+ function renderGematriya() {
957
+ var d = this.getDate();
958
+ var m = Locale.gettext(this.getMonthName(), 'he');
959
+ var y = this.getFullYear();
960
+ return gematriya(d) + ' ' + m + ' ' + gematriya(y);
1906
961
  }
1907
- }
1908
- /**
1909
- * Converts absolute R.D. days to Hebrew date
1910
- * @private
1911
- * @param {number} abs absolute R.D. days
1912
- * @return {SimpleHebrewDate}
1913
- */
1914
-
1915
-
1916
- static abs2hebrew(abs) {
1917
- if (typeof abs !== 'number' || isNaN(abs)) {
1918
- throw new TypeError("invalid parameter to abs2hebrew ".concat(abs));
962
+ /**
963
+ * Returns an `HDate` representing the a dayNumber before the current date.
964
+ * Sunday=0, Saturday=6
965
+ * @example
966
+ * new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
967
+ * @param {number} day day of week
968
+ * @return {HDate}
969
+ */
970
+
971
+ }, {
972
+ key: "before",
973
+ value: function before(day) {
974
+ return _onOrBefore(day, this, -1);
1919
975
  }
1920
-
1921
- abs = Math.trunc(abs); // first, quickly approximate year
1922
-
1923
- let year = Math.floor((abs - EPOCH) / AVG_HEBYEAR_DAYS);
1924
-
1925
- while (HDate.newYear(year) <= abs) {
1926
- ++year;
976
+ /**
977
+ * Returns an `HDate` representing the a dayNumber on or before the current date.
978
+ * Sunday=0, Saturday=6
979
+ * @example
980
+ * new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
981
+ * new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
982
+ * new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
983
+ * @param {number} dow day of week
984
+ * @return {HDate}
985
+ */
986
+
987
+ }, {
988
+ key: "onOrBefore",
989
+ value: function onOrBefore(dow) {
990
+ return _onOrBefore(dow, this, 0);
1927
991
  }
1928
-
1929
- --year;
1930
- let month = abs < HDate.hebrew2abs(year, 1, 1) ? 7 : 1;
1931
-
1932
- while (abs > HDate.hebrew2abs(year, month, HDate.daysInMonth(month, year))) {
1933
- ++month;
992
+ /**
993
+ * Returns an `HDate` representing the nearest dayNumber to the current date
994
+ * Sunday=0, Saturday=6
995
+ * @example
996
+ * new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
997
+ * new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
998
+ * @param {number} dow day of week
999
+ * @return {HDate}
1000
+ */
1001
+
1002
+ }, {
1003
+ key: "nearest",
1004
+ value: function nearest(dow) {
1005
+ return _onOrBefore(dow, this, 3);
1934
1006
  }
1007
+ /**
1008
+ * Returns an `HDate` representing the a dayNumber on or after the current date.
1009
+ * Sunday=0, Saturday=6
1010
+ * @example
1011
+ * new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
1012
+ * new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
1013
+ * new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
1014
+ * @param {number} dow day of week
1015
+ * @return {HDate}
1016
+ */
1017
+
1018
+ }, {
1019
+ key: "onOrAfter",
1020
+ value: function onOrAfter(dow) {
1021
+ return _onOrBefore(dow, this, 6);
1022
+ }
1023
+ /**
1024
+ * Returns an `HDate` representing the a dayNumber after the current date.
1025
+ * Sunday=0, Saturday=6
1026
+ * @example
1027
+ * new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
1028
+ * new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
1029
+ * new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
1030
+ * @param {number} day day of week
1031
+ * @return {HDate}
1032
+ */
1033
+
1034
+ }, {
1035
+ key: "after",
1036
+ value: function after(day) {
1037
+ return _onOrBefore(day, this, 7);
1038
+ }
1039
+ /**
1040
+ * Returns the next Hebrew date
1041
+ * @return {HDate}
1042
+ */
1043
+
1044
+ }, {
1045
+ key: "next",
1046
+ value: function next() {
1047
+ return new HDate(this.abs() + 1);
1048
+ }
1049
+ /**
1050
+ * Returns the previous Hebrew date
1051
+ * @return {HDate}
1052
+ */
1053
+
1054
+ }, {
1055
+ key: "prev",
1056
+ value: function prev() {
1057
+ return new HDate(this.abs() - 1);
1058
+ }
1059
+ /**
1060
+ * Returns a cloned `HDate` object with a specified amount of time added
1061
+ *
1062
+ * Units are case insensitive, and support plural and short forms.
1063
+ * Note, short forms are case sensitive.
1064
+ *
1065
+ * | Unit | Shorthand | Description
1066
+ * | --- | --- | --- |
1067
+ * | `day` | `d` | days |
1068
+ * | `week` | `w` | weeks |
1069
+ * | `month` | `M` | months |
1070
+ * | `year` | `y` | years |
1071
+ * @param {number} number
1072
+ * @param {string} [units]
1073
+ * @return {HDate}
1074
+ */
1075
+
1076
+ }, {
1077
+ key: "add",
1078
+ value: function add(number) {
1079
+ var units = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'd';
1080
+ number = parseInt(number, 10);
1081
+
1082
+ if (!number) {
1083
+ return new HDate(this);
1084
+ }
1935
1085
 
1936
- const day = 1 + abs - HDate.hebrew2abs(year, month, 1);
1937
- return {
1938
- yy: year,
1939
- mm: month,
1940
- dd: day
1941
- };
1942
- }
1943
- /**
1944
- * Returns a transliterated Hebrew month name, e.g. `'Elul'` or `'Cheshvan'`.
1945
- * @return {string}
1946
- */
1947
-
1948
-
1949
- getMonthName() {
1950
- return HDate.getMonthName(this.getMonth(), this.getFullYear());
1951
- }
1952
- /**
1953
- * Renders this Hebrew date as a translated or transliterated string,
1954
- * including ordinal e.g. `'15th of Cheshvan, 5769'`.
1955
- * @example
1956
- * import {HDate, months} from '@hebcal/core';
1957
- *
1958
- * const hd = new HDate(15, months.CHESHVAN, 5769);
1959
- * console.log(hd.render()); // '15th of Cheshvan, 5769'
1960
- * console.log(hd.render('he')); // '15 חֶשְׁוָן, 5769'
1961
- * @param {string} [locale] Optional locale name (defaults to active locale).
1962
- * @param {boolean} [showYear=true] Display year (defaults to true).
1963
- * @return {string}
1964
- */
1965
-
1966
-
1967
- render() {
1968
- let locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1969
- let showYear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1970
- const locale0 = locale || Locale.getLocaleName();
1971
- const day = this.getDate();
1972
- const monthName = Locale.gettext(this.getMonthName(), locale);
1973
- const nth = Locale.ordinal(day, locale0);
1974
- let dayOf = '';
1975
-
1976
- if (locale0 === 'en' || locale0 === 's' || 'ashkenazi' == locale0.substring(0, 9)) {
1977
- dayOf = ' of';
1978
- } else {
1979
- const ofStr = Locale.lookupTranslation('of', locale0);
1086
+ units = HDate.standardizeUnits(units);
1087
+
1088
+ if (units === UNITS_DAY) {
1089
+ return new HDate(this.abs() + number);
1090
+ } else if (units === UNITS_WEEK) {
1091
+ return new HDate(this.abs() + 7 * number);
1092
+ } else if (units === UNITS_YEAR) {
1093
+ return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + number);
1094
+ } else if (units === UNITS_MONTH) {
1095
+ var hd = new HDate(this);
1096
+ var sign = number > 0 ? 1 : -1;
1097
+ number = Math.abs(number);
1098
+
1099
+ for (var i = 0; i < number; i++) {
1100
+ hd = new HDate(hd.abs() + sign * hd.daysInMonth());
1101
+ }
1980
1102
 
1981
- if (ofStr) {
1982
- dayOf = ' ' + ofStr;
1103
+ return hd;
1983
1104
  }
1984
1105
  }
1985
-
1986
- const dateStr = "".concat(nth).concat(dayOf, " ").concat(monthName);
1987
-
1988
- if (showYear) {
1989
- const fullYear = this.getFullYear();
1990
- return "".concat(dateStr, ", ").concat(fullYear);
1991
- } else {
1992
- return dateStr;
1106
+ /**
1107
+ * @private
1108
+ * @param {string} units
1109
+ * @return {string}
1110
+ */
1111
+
1112
+ }, {
1113
+ key: "subtract",
1114
+ value:
1115
+ /**
1116
+ * Returns a cloned `HDate` object with a specified amount of time subracted
1117
+ *
1118
+ * Units are case insensitive, and support plural and short forms.
1119
+ * Note, short forms are case sensitive.
1120
+ *
1121
+ * | Unit | Shorthand | Description
1122
+ * | --- | --- | --- |
1123
+ * | `day` | `d` | days |
1124
+ * | `week` | `w` | weeks |
1125
+ * | `month` | `M` | months |
1126
+ * | `year` | `y` | years |
1127
+ * @example
1128
+ * import {HDate, months} from '@hebcal/core';
1129
+ *
1130
+ * const hd1 = new HDate(15, months.CHESHVAN, 5769);
1131
+ * const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
1132
+ * const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
1133
+ * @param {number} number
1134
+ * @param {string} [units]
1135
+ * @return {HDate}
1136
+ */
1137
+ function subtract(number) {
1138
+ var units = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'd';
1139
+ return this.add(number * -1, units);
1993
1140
  }
1994
- }
1995
- /**
1996
- * Renders this Hebrew date in Hebrew gematriya, regardless of locale.
1997
- * @example
1998
- * import {HDate, months} from '@hebcal/core';
1999
- * const hd = new HDate(15, months.CHESHVAN, 5769);
2000
- * console.log(ev.renderGematriya()); // 'ט״ו חֶשְׁוָן תשס״ט'
2001
- * @return {string}
2002
- */
2003
-
2004
-
2005
- renderGematriya() {
2006
- const d = this.getDate();
2007
- const m = Locale.gettext(this.getMonthName(), 'he');
2008
- const y = this.getFullYear();
2009
- return gematriya(d) + ' ' + m + ' ' + gematriya(y);
2010
- }
2011
- /**
2012
- * Returns an `HDate` representing the a dayNumber before the current date.
2013
- * Sunday=0, Saturday=6
2014
- * @example
2015
- * new HDate(new Date('Wednesday February 19, 2014')).before(6).greg() // Sat Feb 15 2014
2016
- * @param {number} day day of week
2017
- * @return {HDate}
2018
- */
2019
-
2020
-
2021
- before(day) {
2022
- return onOrBefore(day, this, -1);
2023
- }
2024
- /**
2025
- * Returns an `HDate` representing the a dayNumber on or before the current date.
2026
- * Sunday=0, Saturday=6
2027
- * @example
2028
- * new HDate(new Date('Wednesday February 19, 2014')).onOrBefore(6).greg() // Sat Feb 15 2014
2029
- * new HDate(new Date('Saturday February 22, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
2030
- * new HDate(new Date('Sunday February 23, 2014')).onOrBefore(6).greg() // Sat Feb 22 2014
2031
- * @param {number} dow day of week
2032
- * @return {HDate}
2033
- */
2034
-
2035
-
2036
- onOrBefore(dow) {
2037
- return onOrBefore(dow, this, 0);
2038
- }
2039
- /**
2040
- * Returns an `HDate` representing the nearest dayNumber to the current date
2041
- * Sunday=0, Saturday=6
2042
- * @example
2043
- * new HDate(new Date('Wednesday February 19, 2014')).nearest(6).greg() // Sat Feb 22 2014
2044
- * new HDate(new Date('Tuesday February 18, 2014')).nearest(6).greg() // Sat Feb 15 2014
2045
- * @param {number} dow day of week
2046
- * @return {HDate}
2047
- */
2048
-
2049
-
2050
- nearest(dow) {
2051
- return onOrBefore(dow, this, 3);
2052
- }
2053
- /**
2054
- * Returns an `HDate` representing the a dayNumber on or after the current date.
2055
- * Sunday=0, Saturday=6
2056
- * @example
2057
- * new HDate(new Date('Wednesday February 19, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
2058
- * new HDate(new Date('Saturday February 22, 2014')).onOrAfter(6).greg() // Sat Feb 22 2014
2059
- * new HDate(new Date('Sunday February 23, 2014')).onOrAfter(6).greg() // Sat Mar 01 2014
2060
- * @param {number} dow day of week
2061
- * @return {HDate}
2062
- */
2063
-
2064
-
2065
- onOrAfter(dow) {
2066
- return onOrBefore(dow, this, 6);
2067
- }
2068
- /**
2069
- * Returns an `HDate` representing the a dayNumber after the current date.
2070
- * Sunday=0, Saturday=6
2071
- * @example
2072
- * new HDate(new Date('Wednesday February 19, 2014')).after(6).greg() // Sat Feb 22 2014
2073
- * new HDate(new Date('Saturday February 22, 2014')).after(6).greg() // Sat Mar 01 2014
2074
- * new HDate(new Date('Sunday February 23, 2014')).after(6).greg() // Sat Mar 01 2014
2075
- * @param {number} day day of week
2076
- * @return {HDate}
2077
- */
2078
-
2079
-
2080
- after(day) {
2081
- return onOrBefore(day, this, 7);
2082
- }
2083
- /**
2084
- * Returns the next Hebrew date
2085
- * @return {HDate}
2086
- */
2087
-
2088
-
2089
- next() {
2090
- return new HDate(this.abs() + 1);
2091
- }
2092
- /**
2093
- * Returns the previous Hebrew date
2094
- * @return {HDate}
2095
- */
2096
-
2097
-
2098
- prev() {
2099
- return new HDate(this.abs() - 1);
2100
- }
2101
- /**
2102
- * Returns a cloned `HDate` object with a specified amount of time added
2103
- *
2104
- * Units are case insensitive, and support plural and short forms.
2105
- * Note, short forms are case sensitive.
2106
- *
2107
- * | Unit | Shorthand | Description
2108
- * | --- | --- | --- |
2109
- * | `day` | `d` | days |
2110
- * | `week` | `w` | weeks |
2111
- * | `month` | `M` | months |
2112
- * | `year` | `y` | years |
2113
- * @param {number} number
2114
- * @param {string} [units]
2115
- * @return {HDate}
2116
- */
2117
-
2118
-
2119
- add(number) {
2120
- let units = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'd';
2121
- number = parseInt(number, 10);
1141
+ /**
1142
+ * Returns the difference in days between the two given HDates.
1143
+ *
1144
+ * The result is positive if `this` date is comes chronologically
1145
+ * after the `other` date, and negative
1146
+ * if the order of the two dates is reversed.
1147
+ *
1148
+ * The result is zero if the two dates are identical.
1149
+ * @example
1150
+ * import {HDate, months} from '@hebcal/core';
1151
+ *
1152
+ * const hd1 = new HDate(25, months.KISLEV, 5770);
1153
+ * const hd2 = new HDate(15, months.CHESHVAN, 5769);
1154
+ * const days = hd1.deltaDays(hd2); // 394
1155
+ * @param {HDate} other Hebrew date to compare
1156
+ * @return {number}
1157
+ */
1158
+
1159
+ }, {
1160
+ key: "deltaDays",
1161
+ value: function deltaDays(other) {
1162
+ if (!HDate.isHDate(other)) {
1163
+ throw new TypeError("Bad argument: ".concat(other));
1164
+ }
2122
1165
 
2123
- if (!number) {
2124
- return new HDate(this);
1166
+ return this.abs() - other.abs();
2125
1167
  }
2126
-
2127
- units = HDate.standardizeUnits(units);
2128
-
2129
- if (units === UNITS_DAY) {
2130
- return new HDate(this.abs() + number);
2131
- } else if (units === UNITS_WEEK) {
2132
- return new HDate(this.abs() + 7 * number);
2133
- } else if (units === UNITS_YEAR) {
2134
- return new HDate(this.getDate(), this.getMonth(), this.getFullYear() + number);
2135
- } else if (units === UNITS_MONTH) {
2136
- let hd = new HDate(this);
2137
- const sign = number > 0 ? 1 : -1;
2138
- number = Math.abs(number);
2139
-
2140
- for (let i = 0; i < number; i++) {
2141
- hd = new HDate(hd.abs() + sign * hd.daysInMonth());
1168
+ /**
1169
+ * Compares this date to another date, returning `true` if the dates match.
1170
+ * @param {HDate} other Hebrew date to compare
1171
+ * @return {boolean}
1172
+ */
1173
+
1174
+ }, {
1175
+ key: "isSameDate",
1176
+ value: function isSameDate(other) {
1177
+ if (HDate.isHDate(other)) {
1178
+ return this.year == other.year && this.month == other.month && this.day == other.day;
2142
1179
  }
2143
1180
 
2144
- return hd;
1181
+ return false;
2145
1182
  }
2146
- }
2147
- /**
2148
- * @private
2149
- * @param {string} units
2150
- * @return {string}
2151
- */
2152
-
2153
-
2154
- static standardizeUnits(units) {
2155
- const full = UNITS_SINGLE[units] || String(units || '').toLowerCase().replace(/s$/, '');
2156
- return UNITS_VALID[full] || throwTypeError("Invalid units '".concat(units, "'"));
2157
- }
2158
- /**
2159
- * Returns a cloned `HDate` object with a specified amount of time subracted
2160
- *
2161
- * Units are case insensitive, and support plural and short forms.
2162
- * Note, short forms are case sensitive.
2163
- *
2164
- * | Unit | Shorthand | Description
2165
- * | --- | --- | --- |
2166
- * | `day` | `d` | days |
2167
- * | `week` | `w` | weeks |
2168
- * | `month` | `M` | months |
2169
- * | `year` | `y` | years |
2170
- * @example
2171
- * import {HDate, months} from '@hebcal/core';
2172
- *
2173
- * const hd1 = new HDate(15, months.CHESHVAN, 5769);
2174
- * const hd2 = hd1.add(1, 'weeks'); // 7 Kislev 5769
2175
- * const hd3 = hd1.add(-3, 'M'); // 30 Av 5768
2176
- * @param {number} number
2177
- * @param {string} [units]
2178
- * @return {HDate}
2179
- */
2180
-
2181
-
2182
- subtract(number) {
2183
- let units = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'd';
2184
- return this.add(number * -1, units);
2185
- }
2186
- /**
2187
- * Returns the difference in days between the two given HDates.
2188
- *
2189
- * The result is positive if `this` date is comes chronologically
2190
- * after the `other` date, and negative
2191
- * if the order of the two dates is reversed.
2192
- *
2193
- * The result is zero if the two dates are identical.
2194
- * @example
2195
- * import {HDate, months} from '@hebcal/core';
2196
- *
2197
- * const hd1 = new HDate(25, months.KISLEV, 5770);
2198
- * const hd2 = new HDate(15, months.CHESHVAN, 5769);
2199
- * const days = hd1.deltaDays(hd2); // 394
2200
- * @param {HDate} other Hebrew date to compare
2201
- * @return {number}
2202
- */
2203
-
2204
-
2205
- deltaDays(other) {
2206
- if (!HDate.isHDate(other)) {
2207
- throw new TypeError("Bad argument: ".concat(other));
1183
+ /** @return {string} */
1184
+
1185
+ }, {
1186
+ key: "toString",
1187
+ value: function toString() {
1188
+ var day = this.getDate();
1189
+ var fullYear = this.getFullYear();
1190
+ var monthName = this.getMonthName();
1191
+ return "".concat(day, " ").concat(monthName, " ").concat(fullYear);
2208
1192
  }
1193
+ /**
1194
+ * Returns true if Hebrew year is a leap year
1195
+ * @param {number} year Hebrew year
1196
+ * @return {boolean}
1197
+ */
1198
+
1199
+ }], [{
1200
+ key: "hebrew2abs",
1201
+ value: function hebrew2abs(year, month, day) {
1202
+ var tempabs = day;
1203
+
1204
+ if (month < TISHREI) {
1205
+ for (var m = TISHREI; m <= HDate.monthsInYear(year); m++) {
1206
+ tempabs += HDate.daysInMonth(m, year);
1207
+ }
2209
1208
 
2210
- return this.abs() - other.abs();
2211
- }
2212
- /**
2213
- * Compares this date to another date, returning `true` if the dates match.
2214
- * @param {HDate} other Hebrew date to compare
2215
- * @return {boolean}
2216
- */
2217
-
1209
+ for (var _m = NISAN; _m < month; _m++) {
1210
+ tempabs += HDate.daysInMonth(_m, year);
1211
+ }
1212
+ } else {
1213
+ for (var _m2 = TISHREI; _m2 < month; _m2++) {
1214
+ tempabs += HDate.daysInMonth(_m2, year);
1215
+ }
1216
+ }
2218
1217
 
2219
- isSameDate(other) {
2220
- if (HDate.isHDate(other)) {
2221
- return this.year == other.year && this.month == other.month && this.day == other.day;
1218
+ return EPOCH + HDate.elapsedDays(year) + tempabs - 1;
2222
1219
  }
2223
-
2224
- return false;
2225
- }
2226
- /** @return {string} */
2227
-
2228
-
2229
- toString() {
2230
- const day = this.getDate();
2231
- const fullYear = this.getFullYear();
2232
- const monthName = this.getMonthName();
2233
- return "".concat(day, " ").concat(monthName, " ").concat(fullYear);
2234
- }
2235
- /**
2236
- * Returns true if Hebrew year is a leap year
2237
- * @param {number} year Hebrew year
2238
- * @return {boolean}
2239
- */
2240
-
2241
-
2242
- static isLeapYear(year) {
2243
- return (1 + year * 7) % 19 < 7;
2244
- }
2245
- /**
2246
- * Number of months in this Hebrew year (either 12 or 13 depending on leap year)
2247
- * @param {number} year Hebrew year
2248
- * @return {number}
2249
- */
2250
-
2251
-
2252
- static monthsInYear(year) {
2253
- return 12 + HDate.isLeapYear(year); // boolean is cast to 1 or 0
2254
- }
2255
- /**
2256
- * Number of days in Hebrew month in a given year (29 or 30)
2257
- * @param {number} month Hebrew month (e.g. months.TISHREI)
2258
- * @param {number} year Hebrew year
2259
- * @return {number}
2260
- */
2261
-
2262
-
2263
- static daysInMonth(month, year) {
2264
- if (month == IYYAR || month == TAMUZ || month == ELUL || month == TEVET || month == ADAR_II || month == ADAR_I && !HDate.isLeapYear(year) || month == CHESHVAN && !HDate.longCheshvan(year) || month == KISLEV && HDate.shortKislev(year)) {
2265
- return 29;
2266
- } else {
2267
- return 30;
1220
+ /**
1221
+ * @private
1222
+ * @param {number} year
1223
+ * @return {number}
1224
+ */
1225
+
1226
+ }, {
1227
+ key: "newYear",
1228
+ value: function newYear(year) {
1229
+ return EPOCH + HDate.elapsedDays(year) + HDate.newYearDelay(year);
2268
1230
  }
2269
- }
2270
- /**
2271
- * Returns a transliterated string name of Hebrew month in year,
2272
- * for example 'Elul' or 'Cheshvan'.
2273
- * @param {number} month Hebrew month (e.g. months.TISHREI)
2274
- * @param {number} year Hebrew year
2275
- * @return {string}
2276
- */
2277
-
2278
-
2279
- static getMonthName(month, year) {
2280
- if (typeof month !== 'number' || month < 1 || month > 14) {
2281
- throw new TypeError("bad month argument ".concat(month));
1231
+ /**
1232
+ * @private
1233
+ * @param {number} year
1234
+ * @return {number}
1235
+ */
1236
+
1237
+ }, {
1238
+ key: "newYearDelay",
1239
+ value: function newYearDelay(year) {
1240
+ var ny1 = HDate.elapsedDays(year);
1241
+ var ny2 = HDate.elapsedDays(year + 1);
1242
+
1243
+ if (ny2 - ny1 === 356) {
1244
+ return 2;
1245
+ } else {
1246
+ var ny0 = HDate.elapsedDays(year - 1);
1247
+ return ny1 - ny0 === 382 ? 1 : 0;
1248
+ }
2282
1249
  }
1250
+ /**
1251
+ * Converts absolute R.D. days to Hebrew date
1252
+ * @private
1253
+ * @param {number} abs absolute R.D. days
1254
+ * @return {SimpleHebrewDate}
1255
+ */
1256
+
1257
+ }, {
1258
+ key: "abs2hebrew",
1259
+ value: function abs2hebrew(abs) {
1260
+ if (typeof abs !== 'number' || isNaN(abs)) {
1261
+ throw new TypeError("invalid parameter to abs2hebrew ".concat(abs));
1262
+ }
2283
1263
 
2284
- return monthNames[+HDate.isLeapYear(year)][month];
2285
- }
2286
- /**
2287
- * Returns the Hebrew month number (NISAN=1, TISHREI=7)
2288
- * @param {number|string} month A number, or Hebrew month name string
2289
- * @return {number}
2290
- */
2291
-
2292
-
2293
- static monthNum(month) {
2294
- return typeof month === 'number' ? month : month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 ?
2295
- /* number */
2296
- parseInt(month, 10) : HDate.monthFromName(month);
2297
- }
2298
- /**
2299
- * Days from sunday prior to start of Hebrew calendar to mean
2300
- * conjunction of Tishrei in Hebrew YEAR
2301
- * @param {number} year Hebrew year
2302
- * @return {number}
2303
- */
2304
-
2305
-
2306
- static elapsedDays(year) {
2307
- const elapsed = edCache[year] = edCache[year] || HDate.elapsedDays0(year);
2308
- return elapsed;
2309
- }
2310
- /**
2311
- * Days from sunday prior to start of Hebrew calendar to mean
2312
- * conjunction of Tishrei in Hebrew YEAR
2313
- * @private
2314
- * @param {number} year Hebrew year
2315
- * @return {number}
2316
- */
1264
+ abs = Math.trunc(abs); // first, quickly approximate year
2317
1265
 
1266
+ var year = Math.floor((abs - EPOCH) / AVG_HEBYEAR_DAYS);
2318
1267
 
2319
- static elapsedDays0(year) {
2320
- const prevYear = year - 1;
2321
- const mElapsed = 235 * Math.floor(prevYear / 19) + // Months in complete 19 year lunar (Metonic) cycles so far
2322
- 12 * (prevYear % 19) + // Regular months in this cycle
2323
- Math.floor((prevYear % 19 * 7 + 1) / 19); // Leap months this cycle
1268
+ while (HDate.newYear(year) <= abs) {
1269
+ ++year;
1270
+ }
2324
1271
 
2325
- const pElapsed = 204 + 793 * (mElapsed % 1080);
2326
- const hElapsed = 5 + 12 * mElapsed + 793 * Math.floor(mElapsed / 1080) + Math.floor(pElapsed / 1080);
2327
- const parts = pElapsed % 1080 + 1080 * (hElapsed % 24);
2328
- const day = 1 + 29 * mElapsed + Math.floor(hElapsed / 24);
2329
- const altDay = day + (parts >= 19440 || 2 == day % 7 && parts >= 9924 && !HDate.isLeapYear(year) || 1 == day % 7 && parts >= 16789 && HDate.isLeapYear(prevYear));
2330
- return altDay + (altDay % 7 === 0 || altDay % 7 == 3 || altDay % 7 == 5);
2331
- }
2332
- /**
2333
- * Number of days in the hebrew YEAR
2334
- * @param {number} year Hebrew year
2335
- * @return {number}
2336
- */
1272
+ --year;
1273
+ var month = abs < HDate.hebrew2abs(year, 1, 1) ? 7 : 1;
2337
1274
 
1275
+ while (abs > HDate.hebrew2abs(year, month, HDate.daysInMonth(month, year))) {
1276
+ ++month;
1277
+ }
2338
1278
 
2339
- static daysInYear(year) {
2340
- return HDate.elapsedDays(year + 1) - HDate.elapsedDays(year);
2341
- }
2342
- /**
2343
- * true if Cheshvan is long in Hebrew year
2344
- * @param {number} year Hebrew year
2345
- * @return {boolean}
2346
- */
1279
+ var day = 1 + abs - HDate.hebrew2abs(year, month, 1);
1280
+ return {
1281
+ yy: year,
1282
+ mm: month,
1283
+ dd: day
1284
+ };
1285
+ }
1286
+ }, {
1287
+ key: "getDayOfTranslation",
1288
+ value: function getDayOfTranslation(locale) {
1289
+ switch (locale) {
1290
+ case 'en':
1291
+ case 's':
1292
+ case 'a':
1293
+ case 'ashkenazi':
1294
+ return ' of';
1295
+ }
2347
1296
 
1297
+ var ofStr = Locale.lookupTranslation('of', locale);
2348
1298
 
2349
- static longCheshvan(year) {
2350
- return HDate.daysInYear(year) % 10 == 5;
2351
- }
2352
- /**
2353
- * true if Kislev is short in Hebrew year
2354
- * @param {number} year Hebrew year
2355
- * @return {boolean}
2356
- */
1299
+ if (ofStr) {
1300
+ return ' ' + ofStr;
1301
+ }
2357
1302
 
1303
+ if ('ashkenazi' === locale.substring(0, 9)) {
1304
+ return ' of';
1305
+ }
2358
1306
 
2359
- static shortKislev(year) {
2360
- return HDate.daysInYear(year) % 10 == 3;
2361
- }
2362
- /**
2363
- * Converts Hebrew month string name to numeric
2364
- * @param {string} monthName monthName
2365
- * @return {number}
2366
- */
1307
+ return '';
1308
+ }
1309
+ }, {
1310
+ key: "standardizeUnits",
1311
+ value: function standardizeUnits(units) {
1312
+ var full = UNITS_SINGLE[units] || String(units || '').toLowerCase().replace(/s$/, '');
1313
+ return UNITS_VALID[full] || throwTypeError("Invalid units '".concat(units, "'"));
1314
+ }
1315
+ }, {
1316
+ key: "isLeapYear",
1317
+ value: function isLeapYear(year) {
1318
+ return (1 + year * 7) % 19 < 7;
1319
+ }
1320
+ /**
1321
+ * Number of months in this Hebrew year (either 12 or 13 depending on leap year)
1322
+ * @param {number} year Hebrew year
1323
+ * @return {number}
1324
+ */
1325
+
1326
+ }, {
1327
+ key: "monthsInYear",
1328
+ value: function monthsInYear(year) {
1329
+ return 12 + HDate.isLeapYear(year); // boolean is cast to 1 or 0
1330
+ }
1331
+ /**
1332
+ * Number of days in Hebrew month in a given year (29 or 30)
1333
+ * @param {number} month Hebrew month (e.g. months.TISHREI)
1334
+ * @param {number} year Hebrew year
1335
+ * @return {number}
1336
+ */
1337
+
1338
+ }, {
1339
+ key: "daysInMonth",
1340
+ value: function daysInMonth(month, year) {
1341
+ if (month == IYYAR || month == TAMUZ || month == ELUL || month == TEVET || month == ADAR_II || month == ADAR_I && !HDate.isLeapYear(year) || month == CHESHVAN && !HDate.longCheshvan(year) || month == KISLEV && HDate.shortKislev(year)) {
1342
+ return 29;
1343
+ } else {
1344
+ return 30;
1345
+ }
1346
+ }
1347
+ /**
1348
+ * Returns a transliterated string name of Hebrew month in year,
1349
+ * for example 'Elul' or 'Cheshvan'.
1350
+ * @param {number} month Hebrew month (e.g. months.TISHREI)
1351
+ * @param {number} year Hebrew year
1352
+ * @return {string}
1353
+ */
1354
+
1355
+ }, {
1356
+ key: "getMonthName",
1357
+ value: function getMonthName(month, year) {
1358
+ if (typeof month !== 'number' || month < 1 || month > 14) {
1359
+ throw new TypeError("bad month argument ".concat(month));
1360
+ }
2367
1361
 
1362
+ return monthNames[+HDate.isLeapYear(year)][month];
1363
+ }
1364
+ /**
1365
+ * Returns the Hebrew month number (NISAN=1, TISHREI=7)
1366
+ * @param {number|string} month A number, or Hebrew month name string
1367
+ * @return {number}
1368
+ */
1369
+
1370
+ }, {
1371
+ key: "monthNum",
1372
+ value: function monthNum(month) {
1373
+ return typeof month === 'number' ? month : month.charCodeAt(0) >= 48 && month.charCodeAt(0) <= 57 ?
1374
+ /* number */
1375
+ parseInt(month, 10) : HDate.monthFromName(month);
1376
+ }
1377
+ /**
1378
+ * Days from sunday prior to start of Hebrew calendar to mean
1379
+ * conjunction of Tishrei in Hebrew YEAR
1380
+ * @param {number} year Hebrew year
1381
+ * @return {number}
1382
+ */
1383
+
1384
+ }, {
1385
+ key: "elapsedDays",
1386
+ value: function elapsedDays(year) {
1387
+ var elapsed = edCache[year] = edCache[year] || HDate.elapsedDays0(year);
1388
+ return elapsed;
1389
+ }
1390
+ /**
1391
+ * Days from sunday prior to start of Hebrew calendar to mean
1392
+ * conjunction of Tishrei in Hebrew YEAR
1393
+ * @private
1394
+ * @param {number} year Hebrew year
1395
+ * @return {number}
1396
+ */
1397
+
1398
+ }, {
1399
+ key: "elapsedDays0",
1400
+ value: function elapsedDays0(year) {
1401
+ var prevYear = year - 1;
1402
+ var mElapsed = 235 * Math.floor(prevYear / 19) + // Months in complete 19 year lunar (Metonic) cycles so far
1403
+ 12 * (prevYear % 19) + // Regular months in this cycle
1404
+ Math.floor((prevYear % 19 * 7 + 1) / 19); // Leap months this cycle
1405
+
1406
+ var pElapsed = 204 + 793 * (mElapsed % 1080);
1407
+ var hElapsed = 5 + 12 * mElapsed + 793 * Math.floor(mElapsed / 1080) + Math.floor(pElapsed / 1080);
1408
+ var parts = pElapsed % 1080 + 1080 * (hElapsed % 24);
1409
+ var day = 1 + 29 * mElapsed + Math.floor(hElapsed / 24);
1410
+ var altDay = day + (parts >= 19440 || 2 == day % 7 && parts >= 9924 && !HDate.isLeapYear(year) || 1 == day % 7 && parts >= 16789 && HDate.isLeapYear(prevYear));
1411
+ return altDay + (altDay % 7 === 0 || altDay % 7 == 3 || altDay % 7 == 5);
1412
+ }
1413
+ /**
1414
+ * Number of days in the hebrew YEAR
1415
+ * @param {number} year Hebrew year
1416
+ * @return {number}
1417
+ */
1418
+
1419
+ }, {
1420
+ key: "daysInYear",
1421
+ value: function daysInYear(year) {
1422
+ return HDate.elapsedDays(year + 1) - HDate.elapsedDays(year);
1423
+ }
1424
+ /**
1425
+ * true if Cheshvan is long in Hebrew year
1426
+ * @param {number} year Hebrew year
1427
+ * @return {boolean}
1428
+ */
1429
+
1430
+ }, {
1431
+ key: "longCheshvan",
1432
+ value: function longCheshvan(year) {
1433
+ return HDate.daysInYear(year) % 10 == 5;
1434
+ }
1435
+ /**
1436
+ * true if Kislev is short in Hebrew year
1437
+ * @param {number} year Hebrew year
1438
+ * @return {boolean}
1439
+ */
1440
+
1441
+ }, {
1442
+ key: "shortKislev",
1443
+ value: function shortKislev(year) {
1444
+ return HDate.daysInYear(year) % 10 == 3;
1445
+ }
1446
+ /**
1447
+ * Converts Hebrew month string name to numeric
1448
+ * @param {string} monthName monthName
1449
+ * @return {number}
1450
+ */
1451
+
1452
+ }, {
1453
+ key: "monthFromName",
1454
+ value: function monthFromName(monthName) {
1455
+ if (typeof monthName === 'number') return monthName;
1456
+ var c = monthName.toLowerCase();
1457
+ /*
1458
+ the Hebrew months are unique to their second letter
1459
+ N Nisan (November?)
1460
+ I Iyyar
1461
+ E Elul
1462
+ C Cheshvan
1463
+ K Kislev
1464
+ 1 1Adar
1465
+ 2 2Adar
1466
+ Si Sh Sivan, Shvat
1467
+ Ta Ti Te Tamuz, Tishrei, Tevet
1468
+ Av Ad Av, Adar
1469
+ אב אד אי אל אב אדר אייר אלול
1470
+ ח חשון
1471
+ ט טבת
1472
+ כ כסלו
1473
+ נ ניסן
1474
+ ס סיון
1475
+ ש שבט
1476
+ תמ תש תמוז תשרי
1477
+ */
1478
+
1479
+ switch (c[0]) {
1480
+ case 'n':
1481
+ case 'נ':
1482
+ if (c[1] == 'o') {
1483
+ break;
1484
+ /* this catches "november" */
1485
+ }
1486
+
1487
+ return NISAN;
1488
+
1489
+ case 'i':
1490
+ return IYYAR;
1491
+
1492
+ case 'e':
1493
+ return ELUL;
1494
+
1495
+ case 'c':
1496
+ case 'ח':
1497
+ return CHESHVAN;
1498
+
1499
+ case 'k':
1500
+ case 'כ':
1501
+ return KISLEV;
1502
+
1503
+ case 's':
1504
+ switch (c[1]) {
1505
+ case 'i':
1506
+ return SIVAN;
1507
+
1508
+ case 'h':
1509
+ return SHVAT;
1510
+ }
1511
+
1512
+ case 't':
1513
+ switch (c[1]) {
1514
+ case 'a':
1515
+ return TAMUZ;
1516
+
1517
+ case 'i':
1518
+ return TISHREI;
1519
+
1520
+ case 'e':
1521
+ return TEVET;
1522
+ }
2368
1523
 
2369
- static monthFromName(monthName) {
2370
- if (typeof monthName === 'number') return monthName;
2371
- const c = monthName.toLowerCase();
2372
- /*
2373
- the Hebrew months are unique to their second letter
2374
- N Nisan (November?)
2375
- I Iyyar
2376
- E Elul
2377
- C Cheshvan
2378
- K Kislev
2379
- 1 1Adar
2380
- 2 2Adar
2381
- Si Sh Sivan, Shvat
2382
- Ta Ti Te Tamuz, Tishrei, Tevet
2383
- Av Ad Av, Adar
2384
- אב אד אי אל אב אדר אייר אלול
2385
- ח חשון
2386
- ט טבת
2387
- כ כסלו
2388
- נ ניסן
2389
- ס סיון
2390
- ש שבט
2391
- תמ תש תמוז תשרי
2392
- */
2393
-
2394
- switch (c[0]) {
2395
- case 'n':
2396
- case 'נ':
2397
- if (c[1] == 'o') {
2398
1524
  break;
2399
- /* this catches "november" */
2400
- }
2401
-
2402
- return NISAN;
2403
-
2404
- case 'i':
2405
- return IYYAR;
2406
-
2407
- case 'e':
2408
- return ELUL;
2409
-
2410
- case 'c':
2411
- case 'ח':
2412
- return CHESHVAN;
2413
-
2414
- case 'k':
2415
- case 'כ':
2416
- return KISLEV;
2417
-
2418
- case 's':
2419
- switch (c[1]) {
2420
- case 'i':
2421
- return SIVAN;
2422
-
2423
- case 'h':
2424
- return SHVAT;
2425
- }
2426
1525
 
2427
- case 't':
2428
- switch (c[1]) {
2429
- case 'a':
2430
- return TAMUZ;
1526
+ case 'a':
1527
+ switch (c[1]) {
1528
+ case 'v':
1529
+ return AV;
2431
1530
 
2432
- case 'i':
2433
- return TISHREI;
1531
+ case 'd':
1532
+ if (/(1|[^i]i|a|א)$/i.test(monthName)) {
1533
+ return ADAR_I;
1534
+ }
2434
1535
 
2435
- case 'e':
2436
- return TEVET;
2437
- }
2438
-
2439
- break;
1536
+ return ADAR_II;
1537
+ // else assume sheini
1538
+ }
2440
1539
 
2441
- case 'a':
2442
- switch (c[1]) {
2443
- case 'v':
2444
- return AV;
2445
-
2446
- case 'd':
2447
- if (/(1|[^i]i|a|א)$/i.test(monthName)) {
2448
- return ADAR_I;
2449
- }
2450
-
2451
- return ADAR_II;
2452
- // else assume sheini
2453
- }
1540
+ break;
2454
1541
 
2455
- break;
1542
+ case 'ס':
1543
+ return SIVAN;
2456
1544
 
2457
- case 'ס':
2458
- return SIVAN;
1545
+ case 'ט':
1546
+ return TEVET;
2459
1547
 
2460
- case 'ט':
2461
- return TEVET;
1548
+ case 'ש':
1549
+ return SHVAT;
2462
1550
 
2463
- case 'ש':
2464
- return SHVAT;
1551
+ case 'א':
1552
+ switch (c[1]) {
1553
+ case 'ב':
1554
+ return AV;
2465
1555
 
2466
- case 'א':
2467
- switch (c[1]) {
2468
- case 'ב':
2469
- return AV;
1556
+ case 'ד':
1557
+ if (/(1|[^i]i|a|א)$/i.test(monthName)) {
1558
+ return ADAR_I;
1559
+ }
2470
1560
 
2471
- case 'ד':
2472
- if (/(1|[^i]i|a|א)$/i.test(monthName)) {
2473
- return ADAR_I;
2474
- }
1561
+ return ADAR_II;
1562
+ // else assume sheini
2475
1563
 
2476
- return ADAR_II;
2477
- // else assume sheini
1564
+ case 'י':
1565
+ return IYYAR;
2478
1566
 
2479
- case 'י':
2480
- return IYYAR;
1567
+ case 'ל':
1568
+ return ELUL;
1569
+ }
2481
1570
 
2482
- case 'ל':
2483
- return ELUL;
2484
- }
1571
+ break;
2485
1572
 
2486
- break;
1573
+ case 'ת':
1574
+ switch (c[1]) {
1575
+ case 'מ':
1576
+ return TAMUZ;
2487
1577
 
2488
- case 'ת':
2489
- switch (c[1]) {
2490
- case 'מ':
2491
- return TAMUZ;
1578
+ case 'ש':
1579
+ return TISHREI;
1580
+ }
2492
1581
 
2493
- case 'ש':
2494
- return TISHREI;
2495
- }
1582
+ break;
1583
+ }
2496
1584
 
2497
- break;
1585
+ throw new RangeError("Unable to parse month name: ".concat(monthName));
2498
1586
  }
1587
+ /**
1588
+ * Note: Applying this function to d+6 gives us the DAYNAME on or after an
1589
+ * absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to
1590
+ * absolute date d, applying it to d-1 gives the DAYNAME previous to absolute
1591
+ * date d, and applying it to d+7 gives the DAYNAME following absolute date d.
1592
+ * @param {number} dayOfWeek
1593
+ * @param {number} absdate
1594
+ * @return {number}
1595
+ */
1596
+
1597
+ }, {
1598
+ key: "dayOnOrBefore",
1599
+ value: function dayOnOrBefore(dayOfWeek, absdate) {
1600
+ return absdate - (absdate - dayOfWeek) % 7;
1601
+ }
1602
+ /**
1603
+ * Tests if the object is an instance of `HDate`
1604
+ * @param {any} obj
1605
+ * @return {boolean}
1606
+ */
1607
+
1608
+ }, {
1609
+ key: "isHDate",
1610
+ value: function isHDate(obj) {
1611
+ return obj !== null && _typeof(obj) === 'object' && typeof obj.year === 'number' && typeof obj.month === 'number' && typeof obj.day === 'number' && typeof obj.greg === 'function' && typeof obj.abs === 'function';
1612
+ }
1613
+ }]);
2499
1614
 
2500
- throw new RangeError("Unable to parse month name: ".concat(monthName));
2501
- }
2502
- /**
2503
- * Note: Applying this function to d+6 gives us the DAYNAME on or after an
2504
- * absolute day d. Similarly, applying it to d+3 gives the DAYNAME nearest to
2505
- * absolute date d, applying it to d-1 gives the DAYNAME previous to absolute
2506
- * date d, and applying it to d+7 gives the DAYNAME following absolute date d.
2507
- * @param {number} dayOfWeek
2508
- * @param {number} absdate
2509
- * @return {number}
2510
- */
2511
-
2512
-
2513
- static dayOnOrBefore(dayOfWeek, absdate) {
2514
- return absdate - (absdate - dayOfWeek) % 7;
2515
- }
2516
- /**
2517
- * Tests if the object is an instance of `HDate`
2518
- * @param {any} obj
2519
- * @return {boolean}
2520
- */
2521
-
2522
-
2523
- static isHDate(obj) {
2524
- return obj !== null && typeof obj === 'object' && typeof obj.year === 'number' && typeof obj.month === 'number' && typeof obj.day === 'number' && typeof obj.greg === 'function' && typeof obj.abs === 'function';
2525
- }
2526
-
2527
- }
1615
+ return HDate;
1616
+ }();
2528
1617
  /**
2529
1618
  * @private
2530
1619
  * @param {HDate} date
@@ -2595,11 +1684,11 @@ function fixMonth(date) {
2595
1684
  */
2596
1685
 
2597
1686
 
2598
- function onOrBefore(day, t, offset) {
1687
+ function _onOrBefore(day, t, offset) {
2599
1688
  return new HDate(HDate.dayOnOrBefore(day, t.abs() + offset));
2600
1689
  }
2601
1690
 
2602
- var version="3.29.0";
1691
+ var version="3.29.4";
2603
1692
 
2604
1693
  var headers={"plural-forms":"nplurals=2; plural=(n > 1);",language:"he"};var contexts={"":{Adar:["אַדָר"],"Adar I":["אַדָר א׳"],"Adar II":["אַדָר ב׳"],Av:["אָב"],Cheshvan:["חֶשְׁוָן"],Elul:["אֱלוּל"],Iyyar:["אִיָיר"],Kislev:["כִּסְלֵו"],Nisan:["נִיסָן"],"Sh'vat":["שְׁבָט"],Sivan:["סִיוָן"],Tamuz:["תַּמּוּז"],Tevet:["טֵבֵת"],Tishrei:["תִשְׁרֵי"]}};var poHeMin = {headers:headers,contexts:contexts};
2605
1694