@atawi/react-date-picker 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1352 @@
1
+ import me, { useState as U, useCallback as Ze, useEffect as Ue, useRef as Be } from "react";
2
+ import { isSameDay as q, isWithinInterval as Pe, subDays as Tr, eachDayOfInterval as Qe, startOfWeek as er, endOfWeek as rr, isSameWeek as Sr, format as G, endOfDay as qe, startOfDay as Je, differenceInDays as Or, setHours as ye, setMinutes as tr, addYears as ze, addMonths as De, addDays as be, setYear as $r, setMonth as Ar, subMonths as Fr } from "date-fns";
3
+ import { usePopper as Mr } from "react-popper";
4
+ var Ne = { exports: {} }, de = {};
5
+ /**
6
+ * @license React
7
+ * react-jsx-runtime.production.min.js
8
+ *
9
+ * Copyright (c) Facebook, Inc. and its affiliates.
10
+ *
11
+ * This source code is licensed under the MIT license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ var Ge;
15
+ function Ir() {
16
+ if (Ge) return de;
17
+ Ge = 1;
18
+ var r = me, o = Symbol.for("react.element"), n = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function m(j, u, R) {
20
+ var y, N = {}, F = null, S = null;
21
+ R !== void 0 && (F = "" + R), u.key !== void 0 && (F = "" + u.key), u.ref !== void 0 && (S = u.ref);
22
+ for (y in u) d.call(u, y) && !g.hasOwnProperty(y) && (N[y] = u[y]);
23
+ if (j && j.defaultProps) for (y in u = j.defaultProps, u) N[y] === void 0 && (N[y] = u[y]);
24
+ return { $$typeof: o, type: j, key: F, ref: S, props: N, _owner: i.current };
25
+ }
26
+ return de.Fragment = n, de.jsx = m, de.jsxs = m, de;
27
+ }
28
+ var pe = {};
29
+ /**
30
+ * @license React
31
+ * react-jsx-runtime.development.js
32
+ *
33
+ * Copyright (c) Facebook, Inc. and its affiliates.
34
+ *
35
+ * This source code is licensed under the MIT license found in the
36
+ * LICENSE file in the root directory of this source tree.
37
+ */
38
+ var Xe;
39
+ function Wr() {
40
+ return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && function() {
41
+ var r = me, o = Symbol.for("react.element"), n = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), j = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), R = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), K = Symbol.iterator, M = "@@iterator";
42
+ function V(e) {
43
+ if (e === null || typeof e != "object")
44
+ return null;
45
+ var t = K && e[K] || e[M];
46
+ return typeof t == "function" ? t : null;
47
+ }
48
+ var A = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
49
+ function c(e) {
50
+ {
51
+ for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), l = 1; l < t; l++)
52
+ s[l - 1] = arguments[l];
53
+ x("error", e, s);
54
+ }
55
+ }
56
+ function x(e, t, s) {
57
+ {
58
+ var l = A.ReactDebugCurrentFrame, k = l.getStackAddendum();
59
+ k !== "" && (t += "%s", s = s.concat([k]));
60
+ var _ = s.map(function(v) {
61
+ return String(v);
62
+ });
63
+ _.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, _);
64
+ }
65
+ }
66
+ var p = !1, D = !1, $ = !1, X = !1, ee = !1, J;
67
+ J = Symbol.for("react.module.reference");
68
+ function re(e) {
69
+ return !!(typeof e == "string" || typeof e == "function" || e === d || e === g || ee || e === i || e === R || e === y || X || e === S || p || D || $ || typeof e == "object" && e !== null && (e.$$typeof === F || e.$$typeof === N || e.$$typeof === m || e.$$typeof === j || e.$$typeof === u || // This needs to include all possible module reference object
70
+ // types supported by any Flight configuration anywhere since
71
+ // we don't know which Flight build this will end up being used
72
+ // with.
73
+ e.$$typeof === J || e.getModuleId !== void 0));
74
+ }
75
+ function te(e, t, s) {
76
+ var l = e.displayName;
77
+ if (l)
78
+ return l;
79
+ var k = t.displayName || t.name || "";
80
+ return k !== "" ? s + "(" + k + ")" : s;
81
+ }
82
+ function ne(e) {
83
+ return e.displayName || "Context";
84
+ }
85
+ function Y(e) {
86
+ if (e == null)
87
+ return null;
88
+ if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
89
+ return e.displayName || e.name || null;
90
+ if (typeof e == "string")
91
+ return e;
92
+ switch (e) {
93
+ case d:
94
+ return "Fragment";
95
+ case n:
96
+ return "Portal";
97
+ case g:
98
+ return "Profiler";
99
+ case i:
100
+ return "StrictMode";
101
+ case R:
102
+ return "Suspense";
103
+ case y:
104
+ return "SuspenseList";
105
+ }
106
+ if (typeof e == "object")
107
+ switch (e.$$typeof) {
108
+ case j:
109
+ var t = e;
110
+ return ne(t) + ".Consumer";
111
+ case m:
112
+ var s = e;
113
+ return ne(s._context) + ".Provider";
114
+ case u:
115
+ return te(e, e.render, "ForwardRef");
116
+ case N:
117
+ var l = e.displayName || null;
118
+ return l !== null ? l : Y(e.type) || "Memo";
119
+ case F: {
120
+ var k = e, _ = k._payload, v = k._init;
121
+ try {
122
+ return Y(v(_));
123
+ } catch {
124
+ return null;
125
+ }
126
+ }
127
+ }
128
+ return null;
129
+ }
130
+ var L = Object.assign, B = 0, ae, f, w, b, P, E, C;
131
+ function z() {
132
+ }
133
+ z.__reactDisabledLog = !0;
134
+ function ke() {
135
+ {
136
+ if (B === 0) {
137
+ ae = console.log, f = console.info, w = console.warn, b = console.error, P = console.group, E = console.groupCollapsed, C = console.groupEnd;
138
+ var e = {
139
+ configurable: !0,
140
+ enumerable: !0,
141
+ value: z,
142
+ writable: !0
143
+ };
144
+ Object.defineProperties(console, {
145
+ info: e,
146
+ log: e,
147
+ warn: e,
148
+ error: e,
149
+ group: e,
150
+ groupCollapsed: e,
151
+ groupEnd: e
152
+ });
153
+ }
154
+ B++;
155
+ }
156
+ }
157
+ function xe() {
158
+ {
159
+ if (B--, B === 0) {
160
+ var e = {
161
+ configurable: !0,
162
+ enumerable: !0,
163
+ writable: !0
164
+ };
165
+ Object.defineProperties(console, {
166
+ log: L({}, e, {
167
+ value: ae
168
+ }),
169
+ info: L({}, e, {
170
+ value: f
171
+ }),
172
+ warn: L({}, e, {
173
+ value: w
174
+ }),
175
+ error: L({}, e, {
176
+ value: b
177
+ }),
178
+ group: L({}, e, {
179
+ value: P
180
+ }),
181
+ groupCollapsed: L({}, e, {
182
+ value: E
183
+ }),
184
+ groupEnd: L({}, e, {
185
+ value: C
186
+ })
187
+ });
188
+ }
189
+ B < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
+ }
191
+ }
192
+ var le = A.ReactCurrentDispatcher, se;
193
+ function Z(e, t, s) {
194
+ {
195
+ if (se === void 0)
196
+ try {
197
+ throw Error();
198
+ } catch (k) {
199
+ var l = k.stack.trim().match(/\n( *(at )?)/);
200
+ se = l && l[1] || "";
201
+ }
202
+ return `
203
+ ` + se + e;
204
+ }
205
+ }
206
+ var ue = !1, oe;
207
+ {
208
+ var Ee = typeof WeakMap == "function" ? WeakMap : Map;
209
+ oe = new Ee();
210
+ }
211
+ function he(e, t) {
212
+ if (!e || ue)
213
+ return "";
214
+ {
215
+ var s = oe.get(e);
216
+ if (s !== void 0)
217
+ return s;
218
+ }
219
+ var l;
220
+ ue = !0;
221
+ var k = Error.prepareStackTrace;
222
+ Error.prepareStackTrace = void 0;
223
+ var _;
224
+ _ = le.current, le.current = null, ke();
225
+ try {
226
+ if (t) {
227
+ var v = function() {
228
+ throw Error();
229
+ };
230
+ if (Object.defineProperty(v.prototype, "props", {
231
+ set: function() {
232
+ throw Error();
233
+ }
234
+ }), typeof Reflect == "object" && Reflect.construct) {
235
+ try {
236
+ Reflect.construct(v, []);
237
+ } catch (W) {
238
+ l = W;
239
+ }
240
+ Reflect.construct(e, [], v);
241
+ } else {
242
+ try {
243
+ v.call();
244
+ } catch (W) {
245
+ l = W;
246
+ }
247
+ e.call(v.prototype);
248
+ }
249
+ } else {
250
+ try {
251
+ throw Error();
252
+ } catch (W) {
253
+ l = W;
254
+ }
255
+ e();
256
+ }
257
+ } catch (W) {
258
+ if (W && l && typeof W.stack == "string") {
259
+ for (var h = W.stack.split(`
260
+ `), I = l.stack.split(`
261
+ `), T = h.length - 1, O = I.length - 1; T >= 1 && O >= 0 && h[T] !== I[O]; )
262
+ O--;
263
+ for (; T >= 1 && O >= 0; T--, O--)
264
+ if (h[T] !== I[O]) {
265
+ if (T !== 1 || O !== 1)
266
+ do
267
+ if (T--, O--, O < 0 || h[T] !== I[O]) {
268
+ var H = `
269
+ ` + h[T].replace(" at new ", " at ");
270
+ return e.displayName && H.includes("<anonymous>") && (H = H.replace("<anonymous>", e.displayName)), typeof e == "function" && oe.set(e, H), H;
271
+ }
272
+ while (T >= 1 && O >= 0);
273
+ break;
274
+ }
275
+ }
276
+ } finally {
277
+ ue = !1, le.current = _, xe(), Error.prepareStackTrace = k;
278
+ }
279
+ var ce = e ? e.displayName || e.name : "", Q = ce ? Z(ce) : "";
280
+ return typeof e == "function" && oe.set(e, Q), Q;
281
+ }
282
+ function ir(e, t, s) {
283
+ return he(e, !1);
284
+ }
285
+ function cr(e) {
286
+ var t = e.prototype;
287
+ return !!(t && t.isReactComponent);
288
+ }
289
+ function ve(e, t, s) {
290
+ if (e == null)
291
+ return "";
292
+ if (typeof e == "function")
293
+ return he(e, cr(e));
294
+ if (typeof e == "string")
295
+ return Z(e);
296
+ switch (e) {
297
+ case R:
298
+ return Z("Suspense");
299
+ case y:
300
+ return Z("SuspenseList");
301
+ }
302
+ if (typeof e == "object")
303
+ switch (e.$$typeof) {
304
+ case u:
305
+ return ir(e.render);
306
+ case N:
307
+ return ve(e.type, t, s);
308
+ case F: {
309
+ var l = e, k = l._payload, _ = l._init;
310
+ try {
311
+ return ve(_(k), t, s);
312
+ } catch {
313
+ }
314
+ }
315
+ }
316
+ return "";
317
+ }
318
+ var fe = Object.prototype.hasOwnProperty, Te = {}, Se = A.ReactDebugCurrentFrame;
319
+ function ge(e) {
320
+ if (e) {
321
+ var t = e._owner, s = ve(e.type, e._source, t ? t.type : null);
322
+ Se.setExtraStackFrame(s);
323
+ } else
324
+ Se.setExtraStackFrame(null);
325
+ }
326
+ function lr(e, t, s, l, k) {
327
+ {
328
+ var _ = Function.call.bind(fe);
329
+ for (var v in e)
330
+ if (_(e, v)) {
331
+ var h = void 0;
332
+ try {
333
+ if (typeof e[v] != "function") {
334
+ var I = Error((l || "React class") + ": " + s + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
335
+ throw I.name = "Invariant Violation", I;
336
+ }
337
+ h = e[v](t, v, l, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
+ } catch (T) {
339
+ h = T;
340
+ }
341
+ h && !(h instanceof Error) && (ge(k), c("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", l || "React class", s, v, typeof h), ge(null)), h instanceof Error && !(h.message in Te) && (Te[h.message] = !0, ge(k), c("Failed %s type: %s", s, h.message), ge(null));
342
+ }
343
+ }
344
+ }
345
+ var ur = Array.isArray;
346
+ function je(e) {
347
+ return ur(e);
348
+ }
349
+ function fr(e) {
350
+ {
351
+ var t = typeof Symbol == "function" && Symbol.toStringTag, s = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
352
+ return s;
353
+ }
354
+ }
355
+ function dr(e) {
356
+ try {
357
+ return Oe(e), !1;
358
+ } catch {
359
+ return !0;
360
+ }
361
+ }
362
+ function Oe(e) {
363
+ return "" + e;
364
+ }
365
+ function $e(e) {
366
+ if (dr(e))
367
+ return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fr(e)), Oe(e);
368
+ }
369
+ var Ae = A.ReactCurrentOwner, pr = {
370
+ key: !0,
371
+ ref: !0,
372
+ __self: !0,
373
+ __source: !0
374
+ }, Fe, Me;
375
+ function mr(e) {
376
+ if (fe.call(e, "ref")) {
377
+ var t = Object.getOwnPropertyDescriptor(e, "ref").get;
378
+ if (t && t.isReactWarning)
379
+ return !1;
380
+ }
381
+ return e.ref !== void 0;
382
+ }
383
+ function hr(e) {
384
+ if (fe.call(e, "key")) {
385
+ var t = Object.getOwnPropertyDescriptor(e, "key").get;
386
+ if (t && t.isReactWarning)
387
+ return !1;
388
+ }
389
+ return e.key !== void 0;
390
+ }
391
+ function vr(e, t) {
392
+ typeof e.ref == "string" && Ae.current;
393
+ }
394
+ function gr(e, t) {
395
+ {
396
+ var s = function() {
397
+ Fe || (Fe = !0, c("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
398
+ };
399
+ s.isReactWarning = !0, Object.defineProperty(e, "key", {
400
+ get: s,
401
+ configurable: !0
402
+ });
403
+ }
404
+ }
405
+ function br(e, t) {
406
+ {
407
+ var s = function() {
408
+ Me || (Me = !0, c("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
409
+ };
410
+ s.isReactWarning = !0, Object.defineProperty(e, "ref", {
411
+ get: s,
412
+ configurable: !0
413
+ });
414
+ }
415
+ }
416
+ var yr = function(e, t, s, l, k, _, v) {
417
+ var h = {
418
+ // This tag allows us to uniquely identify this as a React Element
419
+ $$typeof: o,
420
+ // Built-in properties that belong on the element
421
+ type: e,
422
+ key: t,
423
+ ref: s,
424
+ props: v,
425
+ // Record the component responsible for creating this element.
426
+ _owner: _
427
+ };
428
+ return h._store = {}, Object.defineProperty(h._store, "validated", {
429
+ configurable: !1,
430
+ enumerable: !1,
431
+ writable: !0,
432
+ value: !1
433
+ }), Object.defineProperty(h, "_self", {
434
+ configurable: !1,
435
+ enumerable: !1,
436
+ writable: !1,
437
+ value: l
438
+ }), Object.defineProperty(h, "_source", {
439
+ configurable: !1,
440
+ enumerable: !1,
441
+ writable: !1,
442
+ value: k
443
+ }), Object.freeze && (Object.freeze(h.props), Object.freeze(h)), h;
444
+ };
445
+ function kr(e, t, s, l, k) {
446
+ {
447
+ var _, v = {}, h = null, I = null;
448
+ s !== void 0 && ($e(s), h = "" + s), hr(t) && ($e(t.key), h = "" + t.key), mr(t) && (I = t.ref, vr(t, k));
449
+ for (_ in t)
450
+ fe.call(t, _) && !pr.hasOwnProperty(_) && (v[_] = t[_]);
451
+ if (e && e.defaultProps) {
452
+ var T = e.defaultProps;
453
+ for (_ in T)
454
+ v[_] === void 0 && (v[_] = T[_]);
455
+ }
456
+ if (h || I) {
457
+ var O = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
458
+ h && gr(v, O), I && br(v, O);
459
+ }
460
+ return yr(e, h, I, k, l, Ae.current, v);
461
+ }
462
+ }
463
+ var we = A.ReactCurrentOwner, Ie = A.ReactDebugCurrentFrame;
464
+ function ie(e) {
465
+ if (e) {
466
+ var t = e._owner, s = ve(e.type, e._source, t ? t.type : null);
467
+ Ie.setExtraStackFrame(s);
468
+ } else
469
+ Ie.setExtraStackFrame(null);
470
+ }
471
+ var _e;
472
+ _e = !1;
473
+ function Ce(e) {
474
+ return typeof e == "object" && e !== null && e.$$typeof === o;
475
+ }
476
+ function We() {
477
+ {
478
+ if (we.current) {
479
+ var e = Y(we.current.type);
480
+ if (e)
481
+ return `
482
+
483
+ Check the render method of \`` + e + "`.";
484
+ }
485
+ return "";
486
+ }
487
+ }
488
+ function xr(e) {
489
+ return "";
490
+ }
491
+ var Ye = {};
492
+ function Er(e) {
493
+ {
494
+ var t = We();
495
+ if (!t) {
496
+ var s = typeof e == "string" ? e : e.displayName || e.name;
497
+ s && (t = `
498
+
499
+ Check the top-level render call using <` + s + ">.");
500
+ }
501
+ return t;
502
+ }
503
+ }
504
+ function Le(e, t) {
505
+ {
506
+ if (!e._store || e._store.validated || e.key != null)
507
+ return;
508
+ e._store.validated = !0;
509
+ var s = Er(t);
510
+ if (Ye[s])
511
+ return;
512
+ Ye[s] = !0;
513
+ var l = "";
514
+ e && e._owner && e._owner !== we.current && (l = " It was passed a child from " + Y(e._owner.type) + "."), ie(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, l), ie(null);
515
+ }
516
+ }
517
+ function He(e, t) {
518
+ {
519
+ if (typeof e != "object")
520
+ return;
521
+ if (je(e))
522
+ for (var s = 0; s < e.length; s++) {
523
+ var l = e[s];
524
+ Ce(l) && Le(l, t);
525
+ }
526
+ else if (Ce(e))
527
+ e._store && (e._store.validated = !0);
528
+ else if (e) {
529
+ var k = V(e);
530
+ if (typeof k == "function" && k !== e.entries)
531
+ for (var _ = k.call(e), v; !(v = _.next()).done; )
532
+ Ce(v.value) && Le(v.value, t);
533
+ }
534
+ }
535
+ }
536
+ function jr(e) {
537
+ {
538
+ var t = e.type;
539
+ if (t == null || typeof t == "string")
540
+ return;
541
+ var s;
542
+ if (typeof t == "function")
543
+ s = t.propTypes;
544
+ else if (typeof t == "object" && (t.$$typeof === u || // Note: Memo only checks outer props here.
545
+ // Inner props are checked in the reconciler.
546
+ t.$$typeof === N))
547
+ s = t.propTypes;
548
+ else
549
+ return;
550
+ if (s) {
551
+ var l = Y(t);
552
+ lr(s, e.props, "prop", l, e);
553
+ } else if (t.PropTypes !== void 0 && !_e) {
554
+ _e = !0;
555
+ var k = Y(t);
556
+ c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
557
+ }
558
+ typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
559
+ }
560
+ }
561
+ function wr(e) {
562
+ {
563
+ for (var t = Object.keys(e.props), s = 0; s < t.length; s++) {
564
+ var l = t[s];
565
+ if (l !== "children" && l !== "key") {
566
+ ie(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", l), ie(null);
567
+ break;
568
+ }
569
+ }
570
+ e.ref !== null && (ie(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), ie(null));
571
+ }
572
+ }
573
+ var Ke = {};
574
+ function Ve(e, t, s, l, k, _) {
575
+ {
576
+ var v = re(e);
577
+ if (!v) {
578
+ var h = "";
579
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (h += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
580
+ var I = xr();
581
+ I ? h += I : h += We();
582
+ var T;
583
+ e === null ? T = "null" : je(e) ? T = "array" : e !== void 0 && e.$$typeof === o ? (T = "<" + (Y(e.type) || "Unknown") + " />", h = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, h);
584
+ }
585
+ var O = kr(e, t, s, k, _);
586
+ if (O == null)
587
+ return O;
588
+ if (v) {
589
+ var H = t.children;
590
+ if (H !== void 0)
591
+ if (l)
592
+ if (je(H)) {
593
+ for (var ce = 0; ce < H.length; ce++)
594
+ He(H[ce], e);
595
+ Object.freeze && Object.freeze(H);
596
+ } else
597
+ c("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
598
+ else
599
+ He(H, e);
600
+ }
601
+ if (fe.call(t, "key")) {
602
+ var Q = Y(e), W = Object.keys(t).filter(function(Nr) {
603
+ return Nr !== "key";
604
+ }), Re = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
605
+ if (!Ke[Q + Re]) {
606
+ var Dr = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
607
+ c(`A props object containing a "key" prop is being spread into JSX:
608
+ let props = %s;
609
+ <%s {...props} />
610
+ React keys must be passed directly to JSX without using spread:
611
+ let props = %s;
612
+ <%s key={someKey} {...props} />`, Re, Q, Dr, Q), Ke[Q + Re] = !0;
613
+ }
614
+ }
615
+ return e === d ? wr(O) : jr(O), O;
616
+ }
617
+ }
618
+ function _r(e, t, s) {
619
+ return Ve(e, t, s, !0);
620
+ }
621
+ function Cr(e, t, s) {
622
+ return Ve(e, t, s, !1);
623
+ }
624
+ var Rr = Cr, Pr = _r;
625
+ pe.Fragment = d, pe.jsx = Rr, pe.jsxs = Pr;
626
+ }()), pe;
627
+ }
628
+ process.env.NODE_ENV === "production" ? Ne.exports = Ir() : Ne.exports = Wr();
629
+ var a = Ne.exports;
630
+ const nr = ({ isOpen: r, onClose: o, children: n, content: d }) => {
631
+ const [i, g] = me.useState(null), [m, j] = me.useState(null), { styles: u, attributes: R } = Mr(i, m, {
632
+ placement: "bottom-start",
633
+ modifiers: [
634
+ {
635
+ name: "offset",
636
+ options: {
637
+ offset: [0, 8]
638
+ }
639
+ }
640
+ ]
641
+ });
642
+ return me.useEffect(() => {
643
+ const y = (N) => {
644
+ m && !m.contains(N.target) && i && !i.contains(N.target) && o();
645
+ };
646
+ return r && document.addEventListener("mousedown", y), () => {
647
+ document.removeEventListener("mousedown", y);
648
+ };
649
+ }, [r, o, m, i]), /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
650
+ /* @__PURE__ */ a.jsx("div", { ref: g, children: n }),
651
+ r && /* @__PURE__ */ a.jsx(
652
+ "div",
653
+ {
654
+ ref: j,
655
+ style: u.popper,
656
+ ...R.popper,
657
+ className: "z-50",
658
+ children: d
659
+ }
660
+ )
661
+ ] });
662
+ }, Yr = ({ size: r = 24, className: o = "" }) => /* @__PURE__ */ a.jsx(
663
+ "svg",
664
+ {
665
+ width: r,
666
+ height: r,
667
+ viewBox: "0 0 24 24",
668
+ fill: "none",
669
+ stroke: "currentColor",
670
+ strokeWidth: "2",
671
+ strokeLinecap: "round",
672
+ strokeLinejoin: "round",
673
+ className: o,
674
+ children: /* @__PURE__ */ a.jsx("path", { d: "M15 18l-6-6 6-6" })
675
+ }
676
+ ), Lr = ({ size: r = 24, className: o = "" }) => /* @__PURE__ */ a.jsx(
677
+ "svg",
678
+ {
679
+ width: r,
680
+ height: r,
681
+ viewBox: "0 0 24 24",
682
+ fill: "none",
683
+ stroke: "currentColor",
684
+ strokeWidth: "2",
685
+ strokeLinecap: "round",
686
+ strokeLinejoin: "round",
687
+ className: o,
688
+ children: /* @__PURE__ */ a.jsx("path", { d: "M9 18l6-6-6-6" })
689
+ }
690
+ ), ar = ({ size: r = 24, className: o = "" }) => /* @__PURE__ */ a.jsxs(
691
+ "svg",
692
+ {
693
+ width: r,
694
+ height: r,
695
+ viewBox: "0 0 24 24",
696
+ fill: "none",
697
+ stroke: "currentColor",
698
+ strokeWidth: "2",
699
+ strokeLinecap: "round",
700
+ strokeLinejoin: "round",
701
+ className: o,
702
+ children: [
703
+ /* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "10" }),
704
+ /* @__PURE__ */ a.jsx("path", { d: "M12 6v6l4 2" })
705
+ ]
706
+ }
707
+ ), sr = (r, o) => {
708
+ for (const n of o)
709
+ if ("date" in n && q(n.date, r) || "startDate" in n && "endDate" in n && Pe(r, { start: n.startDate, end: n.endDate }))
710
+ return n.note;
711
+ return null;
712
+ }, Hr = (r, o) => sr(r, o) !== null, rt = (r, o = 3) => {
713
+ const n = Array.from(
714
+ { length: o },
715
+ (i, g) => Tr(/* @__PURE__ */ new Date(), g)
716
+ ), d = r.flatMap(
717
+ ([i, g]) => Qe({ start: i, end: g })
718
+ );
719
+ return [...n, ...d];
720
+ }, tt = (r, o) => o.some((n) => q(r, n)), or = (r) => [er(r), rr(r)], Kr = (r, o) => Sr(r, o), nt = (r) => {
721
+ const [o, n] = or(r);
722
+ return Qe({ start: o, end: n });
723
+ }, Vr = ({
724
+ content: r,
725
+ className: o = ""
726
+ }) => /* @__PURE__ */ a.jsxs("div", { className: `tooltip ${o}`, children: [
727
+ r,
728
+ /* @__PURE__ */ a.jsx("div", { className: "tooltip-arrow" })
729
+ ] }), Ur = ({
730
+ currentDate: r,
731
+ selectedDate: o,
732
+ selectedRange: n = [null, null],
733
+ hoverDate: d,
734
+ mode: i,
735
+ disabledDates: g,
736
+ locale: m,
737
+ onDateClick: j,
738
+ onDateHover: u,
739
+ onPrevMonth: R,
740
+ onNextMonth: y,
741
+ onMonthSelect: N,
742
+ onYearSelect: F,
743
+ styles: S = {},
744
+ notes: K = [],
745
+ darkMode: M = !1
746
+ }) => {
747
+ const [V, A] = U("days"), [c, x] = U(null), p = Array.from(
748
+ { length: 12 },
749
+ (f, w) => r.getFullYear() - 5 + w
750
+ ), D = Array.from({ length: 12 }, (f, w) => w), $ = (f, w) => {
751
+ try {
752
+ return G(f, w, { locale: m });
753
+ } catch (b) {
754
+ return console.error("Date formatting error: ", b), G(f, w);
755
+ }
756
+ }, X = (f) => g.some((w) => q(f, w)), ee = (f) => {
757
+ if (i === "week" && d) {
758
+ const [E, C] = or(d);
759
+ return Pe(f, {
760
+ start: Je(E),
761
+ end: qe(C)
762
+ });
763
+ }
764
+ if (i !== "range" || !n[0]) return !1;
765
+ const w = n[1] || d;
766
+ if (!w) return !1;
767
+ const b = n[0], P = w;
768
+ return Pe(f, {
769
+ start: Je(b < P ? b : P),
770
+ end: qe(b < P ? P : b)
771
+ });
772
+ }, J = (f, w) => Math.abs(Or(f, w)), re = () => {
773
+ if (!n[0]) return "";
774
+ const f = n[1] || d;
775
+ if (!f) return "";
776
+ const w = J(n[0], f);
777
+ return `${w} night${w !== 1 ? "s" : ""}`;
778
+ }, te = (f) => {
779
+ u && u(f), i === "range" && n[1] && q(f, n[1]) ? x(f) : x(null);
780
+ }, ne = () => {
781
+ u && u(null), x(null);
782
+ }, Y = (f, w, b, P, E) => {
783
+ let C = `calendar-day ${S.dayClassName || ""}`;
784
+ return M && (C += " dark-mode"), f && (C += ` selected ${S.selectedDayClassName || ""}`), w && i !== "single" && (C += ` in-range ${S.rangeClassName || ""}`), b && i !== "single" && (C += " range-start"), P && i !== "single" && (C += " range-end"), E && (C += ` disabled ${S.disabledClassName || ""}`), C;
785
+ }, L = () => {
786
+ const f = [], w = new Date(
787
+ r.getFullYear(),
788
+ r.getMonth(),
789
+ 1
790
+ ), b = new Date(
791
+ r.getFullYear(),
792
+ r.getMonth() + 1,
793
+ 0
794
+ ), P = Array.from({ length: 7 }, (E, C) => {
795
+ const z = new Date(2024, 0, C + 1);
796
+ return $(z, "EEE");
797
+ });
798
+ for (let E = 0; E < w.getDay(); E++)
799
+ f.push(/* @__PURE__ */ a.jsx("div", { className: "calendar-day empty" }, `empty-${E}`));
800
+ for (let E = 1; E <= b.getDate(); E++) {
801
+ const C = new Date(
802
+ r.getFullYear(),
803
+ r.getMonth(),
804
+ E
805
+ ), z = X(C), ke = i === "single" && o ? q(C, o) : !1, xe = ee(C), le = n[0] && q(C, n[0]), se = n[1] && q(C, n[1]) || d && q(C, d), Z = re(), ue = i === "range" && (n[0] && !n[1] && d && se || n[1] && c && q(C, c)), oe = Hr(C, K), Ee = i === "week" && d && Kr(C, d), he = /* @__PURE__ */ a.jsxs("div", { className: "calendar-day-container", children: [
806
+ /* @__PURE__ */ a.jsxs(
807
+ "button",
808
+ {
809
+ type: "button",
810
+ onClick: () => !z && j(C),
811
+ onMouseEnter: () => te(C),
812
+ onMouseLeave: ne,
813
+ className: Y(
814
+ ke,
815
+ !!(xe || Ee),
816
+ !!le,
817
+ !!se,
818
+ z
819
+ ),
820
+ disabled: z,
821
+ children: [
822
+ E,
823
+ oe && /* @__PURE__ */ a.jsx("span", { className: "note-indicator" })
824
+ ]
825
+ }
826
+ ),
827
+ ue && Z && // <div className="tooltip">
828
+ // {tooltipText}
829
+ // <div className="tooltip-arrow" />
830
+ // </div>
831
+ /* @__PURE__ */ a.jsx(Vr, { content: Z })
832
+ ] }, E);
833
+ f.push(he);
834
+ }
835
+ return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
836
+ /* @__PURE__ */ a.jsx("div", { className: "calendar-weekdays", children: P.map((E) => /* @__PURE__ */ a.jsx("div", { className: "weekday", children: E }, E)) }),
837
+ /* @__PURE__ */ a.jsx("div", { className: "calendar-days", children: f })
838
+ ] });
839
+ }, B = () => /* @__PURE__ */ a.jsx("div", { className: "calendar-months", children: D.map((f) => {
840
+ const w = new Date(2024, f);
841
+ return /* @__PURE__ */ a.jsx(
842
+ "button",
843
+ {
844
+ type: "button",
845
+ className: `calendar-month ${f === r.getMonth() ? "selected" : ""}`,
846
+ onClick: () => {
847
+ N(f), A("days");
848
+ },
849
+ children: $(w, "MMM")
850
+ },
851
+ f
852
+ );
853
+ }) }), ae = () => /* @__PURE__ */ a.jsx("div", { className: "calendar-years", children: p.map((f) => /* @__PURE__ */ a.jsx(
854
+ "button",
855
+ {
856
+ type: "button",
857
+ className: `calendar-year ${f === r.getFullYear() ? "selected" : ""}`,
858
+ onClick: () => {
859
+ F(f), A("months");
860
+ },
861
+ children: f
862
+ },
863
+ f
864
+ )) });
865
+ return /* @__PURE__ */ a.jsxs("div", { className: "calendar", children: [
866
+ /* @__PURE__ */ a.jsxs("div", { className: "calendar-header", children: [
867
+ /* @__PURE__ */ a.jsx(
868
+ "button",
869
+ {
870
+ className: "calendar-nav-button",
871
+ onClick: R,
872
+ type: "button",
873
+ "aria-label": "Previous month",
874
+ children: /* @__PURE__ */ a.jsx(Yr, { size: 20 })
875
+ }
876
+ ),
877
+ /* @__PURE__ */ a.jsxs("div", { className: "calendar-title-group", children: [
878
+ /* @__PURE__ */ a.jsx(
879
+ "button",
880
+ {
881
+ type: "button",
882
+ className: "calendar-title-button",
883
+ onClick: () => A("months"),
884
+ children: $(r, "MMMM")
885
+ }
886
+ ),
887
+ /* @__PURE__ */ a.jsx(
888
+ "button",
889
+ {
890
+ type: "button",
891
+ className: "calendar-title-button",
892
+ onClick: () => A("years"),
893
+ children: $(r, "yyyy")
894
+ }
895
+ )
896
+ ] }),
897
+ /* @__PURE__ */ a.jsx(
898
+ "button",
899
+ {
900
+ className: "calendar-nav-button",
901
+ onClick: y,
902
+ type: "button",
903
+ "aria-label": "Next month",
904
+ children: /* @__PURE__ */ a.jsx(Lr, { size: 20 })
905
+ }
906
+ )
907
+ ] }),
908
+ V === "days" && L(),
909
+ V === "months" && B(),
910
+ V === "years" && ae()
911
+ ] });
912
+ }, Br = ({
913
+ value: r,
914
+ onChange: o,
915
+ use24Hour: n = !1,
916
+ locale: d,
917
+ className: i = "",
918
+ darkMode: g = !1
919
+ }) => {
920
+ const [m, j] = U(!0), [u, R] = U(!1), y = n ? Array.from({ length: 24 }, (c, x) => x) : Array.from({ length: 12 }, (c, x) => x + 1), N = Array.from({ length: 12 }, (c, x) => x * 5), F = r.getHours() >= 12 ? "PM" : "AM", S = (c, x) => {
921
+ try {
922
+ return G(c, x, { locale: d });
923
+ } catch (p) {
924
+ return console.error("Time formatting error: ", p), G(c, x);
925
+ }
926
+ }, K = (c) => {
927
+ const x = !n && F === "PM" ? c % 12 + 12 : c, p = ye(r, x);
928
+ o(p), j(!1);
929
+ }, M = (c) => {
930
+ const x = tr(r, c);
931
+ o(x), R(!1);
932
+ }, V = () => {
933
+ const c = r.getHours(), x = c >= 12 ? c - 12 : c + 12, p = ye(r, x);
934
+ o(p);
935
+ }, A = () => S(r, n ? "HH:mm" : "hh:mm a");
936
+ return /* @__PURE__ */ a.jsxs(
937
+ "div",
938
+ {
939
+ className: `time-picker-container ${g ? "dark-mode" : ""} ${i}`,
940
+ children: [
941
+ /* @__PURE__ */ a.jsxs("div", { className: "time-picker-input", children: [
942
+ /* @__PURE__ */ a.jsx(ar, { size: 16 }),
943
+ /* @__PURE__ */ a.jsx(
944
+ "button",
945
+ {
946
+ type: "button",
947
+ className: "time-display",
948
+ onClick: () => R(!u),
949
+ children: A()
950
+ }
951
+ )
952
+ ] }),
953
+ u && /* @__PURE__ */ a.jsxs("div", { className: `time-picker-dropdown ${g ? "dark-mode" : ""}`, children: [
954
+ /* @__PURE__ */ a.jsxs("div", { className: "time-picker-header", children: [
955
+ /* @__PURE__ */ a.jsx(
956
+ "button",
957
+ {
958
+ type: "button",
959
+ className: `time-segment ${m ? "active" : ""}`,
960
+ onClick: () => j(!0),
961
+ children: S(r, n ? "HH" : "hh")
962
+ }
963
+ ),
964
+ /* @__PURE__ */ a.jsx("span", { children: ":" }),
965
+ /* @__PURE__ */ a.jsx(
966
+ "button",
967
+ {
968
+ type: "button",
969
+ className: `time-segment ${m ? "" : "active"}`,
970
+ onClick: () => j(!1),
971
+ children: S(r, "mm")
972
+ }
973
+ ),
974
+ !n && /* @__PURE__ */ a.jsx(
975
+ "button",
976
+ {
977
+ type: "button",
978
+ className: "period-toggle",
979
+ onClick: V,
980
+ children: F
981
+ }
982
+ )
983
+ ] }),
984
+ /* @__PURE__ */ a.jsx("div", { className: "time-picker-body", children: /* @__PURE__ */ a.jsx("div", { className: "time-numbers", children: (m ? y : N).map((c) => /* @__PURE__ */ a.jsx(
985
+ "button",
986
+ {
987
+ type: "button",
988
+ className: `time-number ${m && r.getHours() === c || !m && r.getMinutes() === c ? "selected" : ""}`,
989
+ onClick: () => m ? K(c) : M(c),
990
+ children: c.toString().padStart(2, "0")
991
+ },
992
+ c
993
+ )) }) })
994
+ ] })
995
+ ]
996
+ }
997
+ );
998
+ }, qr = ({
999
+ notes: r,
1000
+ hoveredDate: o,
1001
+ selectedDate: n,
1002
+ selectedRange: d
1003
+ }) => {
1004
+ const i = o || n || d && d[0];
1005
+ if (!i) return null;
1006
+ const g = sr(i, r);
1007
+ return g ? /* @__PURE__ */ a.jsx("div", { className: "date-note", children: /* @__PURE__ */ a.jsx("div", { children: g }) }) : null;
1008
+ }, Jr = (r, o, n, d) => {
1009
+ const i = Ze(
1010
+ (g) => {
1011
+ var m;
1012
+ if (r)
1013
+ switch (g.key) {
1014
+ case "Escape":
1015
+ g.preventDefault(), o(), (m = n.current) == null || m.focus();
1016
+ break;
1017
+ case "Tab":
1018
+ if (!d.current) return;
1019
+ const j = d.current.querySelectorAll(
1020
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
1021
+ ), u = j[0], R = j[j.length - 1];
1022
+ g.shiftKey && document.activeElement === u ? (g.preventDefault(), R == null || R.focus()) : !g.shiftKey && document.activeElement === R && (g.preventDefault(), u == null || u.focus());
1023
+ break;
1024
+ }
1025
+ },
1026
+ [r, o, n, d]
1027
+ );
1028
+ return Ue(() => (document.addEventListener("keydown", i), () => document.removeEventListener("keydown", i)), [i]), Ue(() => {
1029
+ var g;
1030
+ if (r) {
1031
+ const m = (g = d.current) == null ? void 0 : g.querySelector(
1032
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
1033
+ );
1034
+ m == null || m.focus();
1035
+ }
1036
+ }, [r, d]), {
1037
+ role: "dialog",
1038
+ "aria-modal": !0,
1039
+ "aria-label": "Date and time picker"
1040
+ };
1041
+ }, zr = (r, o, n) => Ze(
1042
+ (i) => {
1043
+ switch (i.key) {
1044
+ case "ArrowLeft":
1045
+ i.preventDefault(), o(be(r, -1));
1046
+ break;
1047
+ case "ArrowRight":
1048
+ i.preventDefault(), o(be(r, 1));
1049
+ break;
1050
+ case "ArrowUp":
1051
+ i.preventDefault(), o(be(r, -7));
1052
+ break;
1053
+ case "ArrowDown":
1054
+ i.preventDefault(), o(be(r, 7));
1055
+ break;
1056
+ case "PageUp":
1057
+ i.preventDefault(), i.shiftKey ? n(ze(r, -1)) : n(De(r, -1));
1058
+ break;
1059
+ case "PageDown":
1060
+ i.preventDefault(), i.shiftKey ? n(ze(r, 1)) : n(De(r, 1));
1061
+ break;
1062
+ case "Home":
1063
+ i.preventDefault(), o(new Date(r.getFullYear(), r.getMonth(), 1));
1064
+ break;
1065
+ case "End":
1066
+ i.preventDefault(), o(new Date(r.getFullYear(), r.getMonth() + 1, 0));
1067
+ break;
1068
+ }
1069
+ },
1070
+ [r, o, n]
1071
+ ), Gr = {
1072
+ containerClassName: "",
1073
+ triggerClassName: "",
1074
+ calendarClassName: "",
1075
+ dayClassName: "",
1076
+ selectedDayClassName: "",
1077
+ rangeClassName: "",
1078
+ timePickerClassName: ""
1079
+ }, at = ({
1080
+ value: r = /* @__PURE__ */ new Date(),
1081
+ onChange: o,
1082
+ mode: n = "single",
1083
+ showTime: d = !0,
1084
+ use24Hour: i = !1,
1085
+ disabled: g = !1,
1086
+ disabledDates: m = [],
1087
+ locale: j,
1088
+ styles: u = Gr,
1089
+ notes: R = [],
1090
+ onDateHover: y,
1091
+ isOpen: N,
1092
+ onOpenChange: F,
1093
+ footer: S,
1094
+ className: K = "",
1095
+ darkMode: M = !1
1096
+ }) => {
1097
+ const [V, A] = U(!1), c = N !== void 0 ? N : V, x = F || A, [p, D] = U(
1098
+ n === "single" ? r : r[0]
1099
+ ), [$, X] = U(
1100
+ n === "range" || n === "week" ? Array.isArray(r) ? [r[0], r[1]] : [null, null] : [null, null]
1101
+ ), [ee, J] = U(null), re = Be(null), te = Be(null), ne = Jr(
1102
+ c,
1103
+ () => x(!1),
1104
+ re,
1105
+ te
1106
+ ), Y = (b) => {
1107
+ J(b), y && y(b);
1108
+ }, L = (b) => {
1109
+ if (n === "single") {
1110
+ const P = new Date(b);
1111
+ r instanceof Date && P.setHours(r.getHours(), r.getMinutes()), o(P), !d && !S && x(!1);
1112
+ } else if (n === "week") {
1113
+ const P = er(b), E = rr(b);
1114
+ X([P, E]), o([P, E]), S || x(!1);
1115
+ } else if (!$[0] || $[0] && $[1])
1116
+ X([b, null]), J(null);
1117
+ else {
1118
+ const P = $[0];
1119
+ if (P) {
1120
+ const E = P > b ? [b, P] : [P, b];
1121
+ X([E[0], E[1]]), o(E), J(null), S || x(!1);
1122
+ }
1123
+ }
1124
+ }, B = zr(
1125
+ p,
1126
+ L,
1127
+ D
1128
+ ), ae = (b) => {
1129
+ n === "single" && o(b);
1130
+ }, f = (b, P) => {
1131
+ try {
1132
+ return G(b, P, { locale: j });
1133
+ } catch (E) {
1134
+ return console.error("Date formatting error: ", E), G(b, P);
1135
+ }
1136
+ }, w = () => n === "single" && r instanceof Date ? f(r, d ? i ? "PPpp" : "PP p" : "PP") : (n === "range" || n === "week") && Array.isArray(r) ? `${f(r[0], "PP")} - ${f(r[1], "PP")}` : "Select date";
1137
+ return /* @__PURE__ */ a.jsx(
1138
+ "div",
1139
+ {
1140
+ className: `date-time-picker ${M ? "dark-mode" : ""} ${(u == null ? void 0 : u.containerClassName) || ""} ${K}`,
1141
+ onKeyDown: B,
1142
+ children: /* @__PURE__ */ a.jsx(
1143
+ nr,
1144
+ {
1145
+ isOpen: c,
1146
+ onClose: () => x(!1),
1147
+ content: /* @__PURE__ */ a.jsxs(
1148
+ "div",
1149
+ {
1150
+ ref: te,
1151
+ className: `calendar-container ${M ? "dark-mode" : ""} ${(u == null ? void 0 : u.calendarClassName) || ""}`,
1152
+ ...ne,
1153
+ children: [
1154
+ /* @__PURE__ */ a.jsx(
1155
+ Ur,
1156
+ {
1157
+ currentDate: p,
1158
+ selectedDate: n === "single" ? r : void 0,
1159
+ selectedRange: n === "range" || n === "week" ? $ : void 0,
1160
+ hoverDate: ee,
1161
+ mode: n,
1162
+ disabledDates: m,
1163
+ onDateClick: L,
1164
+ onDateHover: Y,
1165
+ onPrevMonth: () => D(Fr(p, 1)),
1166
+ onNextMonth: () => D(De(p, 1)),
1167
+ onMonthSelect: (b) => D(Ar(p, b)),
1168
+ onYearSelect: (b) => D($r(p, b)),
1169
+ locale: j,
1170
+ notes: R,
1171
+ styles: u,
1172
+ darkMode: M
1173
+ }
1174
+ ),
1175
+ d && n === "single" && r instanceof Date && /* @__PURE__ */ a.jsx(
1176
+ Br,
1177
+ {
1178
+ value: r,
1179
+ onChange: ae,
1180
+ use24Hour: i,
1181
+ locale: j,
1182
+ className: u.timePickerClassName,
1183
+ darkMode: M
1184
+ }
1185
+ ),
1186
+ /* @__PURE__ */ a.jsx(
1187
+ qr,
1188
+ {
1189
+ notes: R,
1190
+ hoveredDate: ee,
1191
+ selectedDate: n === "single" ? r : void 0,
1192
+ selectedRange: n === "range" || n === "week" ? r : void 0,
1193
+ darkMode: M
1194
+ }
1195
+ ),
1196
+ S
1197
+ ]
1198
+ }
1199
+ ),
1200
+ children: /* @__PURE__ */ a.jsx(
1201
+ "button",
1202
+ {
1203
+ ref: re,
1204
+ className: `date-picker-trigger ${M ? "dark-mode" : ""} ${(u == null ? void 0 : u.triggerClassName) || ""}`,
1205
+ onClick: () => !g && x(!c),
1206
+ disabled: g,
1207
+ "aria-haspopup": "dialog",
1208
+ "aria-expanded": c,
1209
+ "aria-label": "Choose date and time",
1210
+ children: w()
1211
+ }
1212
+ )
1213
+ }
1214
+ )
1215
+ }
1216
+ );
1217
+ }, Xr = {
1218
+ containerClassName: "",
1219
+ triggerClassName: "",
1220
+ popoverClassName: ""
1221
+ }, st = ({
1222
+ value: r,
1223
+ onChange: o,
1224
+ use24Hour: n = !1,
1225
+ locale: d,
1226
+ disabled: i = !1,
1227
+ className: g = "",
1228
+ styles: m = Xr,
1229
+ darkMode: j = !1
1230
+ }) => {
1231
+ const [u, R] = U(!1), [y, N] = U(!0), F = n ? Array.from({ length: 24 }, (p, D) => D) : Array.from({ length: 12 }, (p, D) => D + 1), S = Array.from({ length: 12 }, (p, D) => D * 5), K = r.getHours() >= 12 ? "PM" : "AM", M = (p, D) => {
1232
+ try {
1233
+ return G(p, D, { locale: d });
1234
+ } catch ($) {
1235
+ return console.error("Time formatting error: ", $), G(p, D);
1236
+ }
1237
+ }, V = (p) => {
1238
+ const D = !n && K === "PM" ? p % 12 + 12 : p, $ = ye(r, D);
1239
+ o($), N(!1);
1240
+ }, A = (p) => {
1241
+ const D = tr(r, p);
1242
+ o(D), R(!1);
1243
+ }, c = () => {
1244
+ const p = r.getHours(), D = p >= 12 ? p - 12 : p + 12, $ = ye(r, D);
1245
+ o($);
1246
+ }, x = () => M(r, n ? "HH:mm" : "hh:mm a");
1247
+ return /* @__PURE__ */ a.jsx(
1248
+ "div",
1249
+ {
1250
+ className: `time-picker ${j ? "dark-mode" : ""} ${(m == null ? void 0 : m.containerClassName) || ""} ${g}`,
1251
+ children: /* @__PURE__ */ a.jsx(
1252
+ nr,
1253
+ {
1254
+ isOpen: u,
1255
+ onClose: () => R(!1),
1256
+ content: /* @__PURE__ */ a.jsxs(
1257
+ "div",
1258
+ {
1259
+ className: `time-picker-dropdown ${j ? "dark-mode" : ""} ${(m == null ? void 0 : m.popoverClassName) || ""}`,
1260
+ children: [
1261
+ /* @__PURE__ */ a.jsxs("div", { className: "time-picker-header", children: [
1262
+ /* @__PURE__ */ a.jsx(
1263
+ "button",
1264
+ {
1265
+ type: "button",
1266
+ className: `time-segment ${y ? "active" : ""}`,
1267
+ onClick: () => N(!0),
1268
+ children: M(r, n ? "HH" : "hh")
1269
+ }
1270
+ ),
1271
+ /* @__PURE__ */ a.jsx("span", { children: ":" }),
1272
+ /* @__PURE__ */ a.jsx(
1273
+ "button",
1274
+ {
1275
+ type: "button",
1276
+ className: `time-segment ${y ? "" : "active"}`,
1277
+ onClick: () => N(!1),
1278
+ children: M(r, "mm")
1279
+ }
1280
+ ),
1281
+ !n && /* @__PURE__ */ a.jsx(
1282
+ "button",
1283
+ {
1284
+ type: "button",
1285
+ className: "period-toggle",
1286
+ onClick: c,
1287
+ children: K
1288
+ }
1289
+ )
1290
+ ] }),
1291
+ /* @__PURE__ */ a.jsx("div", { className: "time-picker-body", children: /* @__PURE__ */ a.jsx("div", { className: "time-numbers", children: (y ? F : S).map((p) => /* @__PURE__ */ a.jsx(
1292
+ "button",
1293
+ {
1294
+ type: "button",
1295
+ className: `time-number ${y && (n ? r.getHours() === p : (r.getHours() % 12 || 12) === p) || !y && r.getMinutes() === p ? "selected" : ""}`,
1296
+ onClick: () => y ? V(p) : A(p),
1297
+ children: p.toString().padStart(2, "0")
1298
+ },
1299
+ p
1300
+ )) }) })
1301
+ ]
1302
+ }
1303
+ ),
1304
+ children: /* @__PURE__ */ a.jsxs(
1305
+ "button",
1306
+ {
1307
+ className: `time-picker-trigger ${j ? "dark-mode" : ""} ${(m == null ? void 0 : m.triggerClassName) || ""}`,
1308
+ onClick: () => !i && R(!u),
1309
+ disabled: i,
1310
+ children: [
1311
+ /* @__PURE__ */ a.jsx(ar, { size: 16 }),
1312
+ /* @__PURE__ */ a.jsx("span", { children: x() })
1313
+ ]
1314
+ }
1315
+ )
1316
+ }
1317
+ )
1318
+ }
1319
+ );
1320
+ }, ot = ({
1321
+ onConfirm: r,
1322
+ className: o = "",
1323
+ children: n = "OK",
1324
+ darkMode: d = !1
1325
+ }) => /* @__PURE__ */ a.jsx(
1326
+ "button",
1327
+ {
1328
+ type: "button",
1329
+ onClick: r,
1330
+ className: `confirm-button ${d ? "dark-mode" : ""} ${o}`,
1331
+ children: n
1332
+ }
1333
+ );
1334
+ export {
1335
+ Ur as Calendar,
1336
+ ot as ConfirmButton,
1337
+ qr as DateNote,
1338
+ at as DateTimePicker,
1339
+ nr as Popover,
1340
+ st as TimePicker,
1341
+ Vr as Tooltip,
1342
+ sr as findNoteForDate,
1343
+ rt as generateDisabledDates,
1344
+ nt as getWeekDays,
1345
+ or as getWeekRange,
1346
+ Hr as hasNote,
1347
+ tt as isDateDisabled,
1348
+ Kr as isDateInWeek,
1349
+ Jr as useA11y,
1350
+ zr as useKeyboardNavigation
1351
+ };
1352
+ //# sourceMappingURL=index.js.map