@theengineerguy/chronos-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.
@@ -0,0 +1,1113 @@
1
+ import Ke, { useMemo as ge, useState as z, useEffect as le, useRef as Le, useCallback as xe } from "react";
2
+ import { DateTime as Y } from "luxon";
3
+ var Te = { exports: {} }, Z = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var Ue;
14
+ function xr() {
15
+ if (Ue) return Z;
16
+ Ue = 1;
17
+ var o = Ke, l = Symbol.for("react.element"), d = Symbol.for("react.fragment"), c = Object.prototype.hasOwnProperty, m = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function v(S, b, M) {
19
+ var x, w = {}, O = null, _ = null;
20
+ M !== void 0 && (O = "" + M), b.key !== void 0 && (O = "" + b.key), b.ref !== void 0 && (_ = b.ref);
21
+ for (x in b) c.call(b, x) && !j.hasOwnProperty(x) && (w[x] = b[x]);
22
+ if (S && S.defaultProps) for (x in b = S.defaultProps, b) w[x] === void 0 && (w[x] = b[x]);
23
+ return { $$typeof: l, type: S, key: O, ref: _, props: w, _owner: m.current };
24
+ }
25
+ return Z.Fragment = d, Z.jsx = v, Z.jsxs = v, Z;
26
+ }
27
+ var X = {};
28
+ /**
29
+ * @license React
30
+ * react-jsx-runtime.development.js
31
+ *
32
+ * Copyright (c) Facebook, Inc. and its affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var ze;
38
+ function Er() {
39
+ return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var o = Ke, l = Symbol.for("react.element"), d = Symbol.for("react.portal"), c = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), v = Symbol.for("react.provider"), S = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), C = Symbol.iterator, A = "@@iterator";
41
+ function y(e) {
42
+ if (e === null || typeof e != "object")
43
+ return null;
44
+ var r = C && e[C] || e[A];
45
+ return typeof r == "function" ? r : null;
46
+ }
47
+ var i = o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function n(e) {
49
+ {
50
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), s = 1; s < r; s++)
51
+ t[s - 1] = arguments[s];
52
+ P("error", e, t);
53
+ }
54
+ }
55
+ function P(e, r, t) {
56
+ {
57
+ var s = i.ReactDebugCurrentFrame, h = s.getStackAddendum();
58
+ h !== "" && (r += "%s", t = t.concat([h]));
59
+ var p = t.map(function(f) {
60
+ return String(f);
61
+ });
62
+ p.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, p);
63
+ }
64
+ }
65
+ var k = !1, L = !1, V = !1, H = !1, ce = !1, Q;
66
+ Q = Symbol.for("react.module.reference");
67
+ function ue(e) {
68
+ return !!(typeof e == "string" || typeof e == "function" || e === c || e === j || ce || e === m || e === M || e === x || H || e === _ || k || L || V || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === w || e.$$typeof === v || e.$$typeof === S || e.$$typeof === b || // This needs to include all possible module reference object
69
+ // types supported by any Flight configuration anywhere since
70
+ // we don't know which Flight build this will end up being used
71
+ // with.
72
+ e.$$typeof === Q || e.getModuleId !== void 0));
73
+ }
74
+ function ee(e, r, t) {
75
+ var s = e.displayName;
76
+ if (s)
77
+ return s;
78
+ var h = r.displayName || r.name || "";
79
+ return h !== "" ? t + "(" + h + ")" : t;
80
+ }
81
+ function re(e) {
82
+ return e.displayName || "Context";
83
+ }
84
+ function I(e) {
85
+ if (e == null)
86
+ return null;
87
+ if (typeof e.tag == "number" && n("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
88
+ return e.displayName || e.name || null;
89
+ if (typeof e == "string")
90
+ return e;
91
+ switch (e) {
92
+ case c:
93
+ return "Fragment";
94
+ case d:
95
+ return "Portal";
96
+ case j:
97
+ return "Profiler";
98
+ case m:
99
+ return "StrictMode";
100
+ case M:
101
+ return "Suspense";
102
+ case x:
103
+ return "SuspenseList";
104
+ }
105
+ if (typeof e == "object")
106
+ switch (e.$$typeof) {
107
+ case S:
108
+ var r = e;
109
+ return re(r) + ".Consumer";
110
+ case v:
111
+ var t = e;
112
+ return re(t._context) + ".Provider";
113
+ case b:
114
+ return ee(e, e.render, "ForwardRef");
115
+ case w:
116
+ var s = e.displayName || null;
117
+ return s !== null ? s : I(e.type) || "Memo";
118
+ case O: {
119
+ var h = e, p = h._payload, f = h._init;
120
+ try {
121
+ return I(f(p));
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ var W = Object.assign, B = 0, E, g, F, U, te, je, _e;
130
+ function Re() {
131
+ }
132
+ Re.__reactDisabledLog = !0;
133
+ function Je() {
134
+ {
135
+ if (B === 0) {
136
+ E = console.log, g = console.info, F = console.warn, U = console.error, te = console.group, je = console.groupCollapsed, _e = console.groupEnd;
137
+ var e = {
138
+ configurable: !0,
139
+ enumerable: !0,
140
+ value: Re,
141
+ writable: !0
142
+ };
143
+ Object.defineProperties(console, {
144
+ info: e,
145
+ log: e,
146
+ warn: e,
147
+ error: e,
148
+ group: e,
149
+ groupCollapsed: e,
150
+ groupEnd: e
151
+ });
152
+ }
153
+ B++;
154
+ }
155
+ }
156
+ function Ge() {
157
+ {
158
+ if (B--, B === 0) {
159
+ var e = {
160
+ configurable: !0,
161
+ enumerable: !0,
162
+ writable: !0
163
+ };
164
+ Object.defineProperties(console, {
165
+ log: W({}, e, {
166
+ value: E
167
+ }),
168
+ info: W({}, e, {
169
+ value: g
170
+ }),
171
+ warn: W({}, e, {
172
+ value: F
173
+ }),
174
+ error: W({}, e, {
175
+ value: U
176
+ }),
177
+ group: W({}, e, {
178
+ value: te
179
+ }),
180
+ groupCollapsed: W({}, e, {
181
+ value: je
182
+ }),
183
+ groupEnd: W({}, e, {
184
+ value: _e
185
+ })
186
+ });
187
+ }
188
+ B < 0 && n("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ }
190
+ }
191
+ var fe = i.ReactCurrentDispatcher, de;
192
+ function ne(e, r, t) {
193
+ {
194
+ if (de === void 0)
195
+ try {
196
+ throw Error();
197
+ } catch (h) {
198
+ var s = h.stack.trim().match(/\n( *(at )?)/);
199
+ de = s && s[1] || "";
200
+ }
201
+ return `
202
+ ` + de + e;
203
+ }
204
+ }
205
+ var he = !1, ae;
206
+ {
207
+ var qe = typeof WeakMap == "function" ? WeakMap : Map;
208
+ ae = new qe();
209
+ }
210
+ function Se(e, r) {
211
+ if (!e || he)
212
+ return "";
213
+ {
214
+ var t = ae.get(e);
215
+ if (t !== void 0)
216
+ return t;
217
+ }
218
+ var s;
219
+ he = !0;
220
+ var h = Error.prepareStackTrace;
221
+ Error.prepareStackTrace = void 0;
222
+ var p;
223
+ p = fe.current, fe.current = null, Je();
224
+ try {
225
+ if (r) {
226
+ var f = function() {
227
+ throw Error();
228
+ };
229
+ if (Object.defineProperty(f.prototype, "props", {
230
+ set: function() {
231
+ throw Error();
232
+ }
233
+ }), typeof Reflect == "object" && Reflect.construct) {
234
+ try {
235
+ Reflect.construct(f, []);
236
+ } catch (D) {
237
+ s = D;
238
+ }
239
+ Reflect.construct(e, [], f);
240
+ } else {
241
+ try {
242
+ f.call();
243
+ } catch (D) {
244
+ s = D;
245
+ }
246
+ e.call(f.prototype);
247
+ }
248
+ } else {
249
+ try {
250
+ throw Error();
251
+ } catch (D) {
252
+ s = D;
253
+ }
254
+ e();
255
+ }
256
+ } catch (D) {
257
+ if (D && s && typeof D.stack == "string") {
258
+ for (var u = D.stack.split(`
259
+ `), N = s.stack.split(`
260
+ `), T = u.length - 1, R = N.length - 1; T >= 1 && R >= 0 && u[T] !== N[R]; )
261
+ R--;
262
+ for (; T >= 1 && R >= 0; T--, R--)
263
+ if (u[T] !== N[R]) {
264
+ if (T !== 1 || R !== 1)
265
+ do
266
+ if (T--, R--, R < 0 || u[T] !== N[R]) {
267
+ var $ = `
268
+ ` + u[T].replace(" at new ", " at ");
269
+ return e.displayName && $.includes("<anonymous>") && ($ = $.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, $), $;
270
+ }
271
+ while (T >= 1 && R >= 0);
272
+ break;
273
+ }
274
+ }
275
+ } finally {
276
+ he = !1, fe.current = p, Ge(), Error.prepareStackTrace = h;
277
+ }
278
+ var G = e ? e.displayName || e.name : "", K = G ? ne(G) : "";
279
+ return typeof e == "function" && ae.set(e, K), K;
280
+ }
281
+ function Ze(e, r, t) {
282
+ return Se(e, !1);
283
+ }
284
+ function Xe(e) {
285
+ var r = e.prototype;
286
+ return !!(r && r.isReactComponent);
287
+ }
288
+ function oe(e, r, t) {
289
+ if (e == null)
290
+ return "";
291
+ if (typeof e == "function")
292
+ return Se(e, Xe(e));
293
+ if (typeof e == "string")
294
+ return ne(e);
295
+ switch (e) {
296
+ case M:
297
+ return ne("Suspense");
298
+ case x:
299
+ return ne("SuspenseList");
300
+ }
301
+ if (typeof e == "object")
302
+ switch (e.$$typeof) {
303
+ case b:
304
+ return Ze(e.render);
305
+ case w:
306
+ return oe(e.type, r, t);
307
+ case O: {
308
+ var s = e, h = s._payload, p = s._init;
309
+ try {
310
+ return oe(p(h), r, t);
311
+ } catch {
312
+ }
313
+ }
314
+ }
315
+ return "";
316
+ }
317
+ var q = Object.prototype.hasOwnProperty, ke = {}, we = i.ReactDebugCurrentFrame;
318
+ function se(e) {
319
+ if (e) {
320
+ var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
321
+ we.setExtraStackFrame(t);
322
+ } else
323
+ we.setExtraStackFrame(null);
324
+ }
325
+ function He(e, r, t, s, h) {
326
+ {
327
+ var p = Function.call.bind(q);
328
+ for (var f in e)
329
+ if (p(e, f)) {
330
+ var u = void 0;
331
+ try {
332
+ if (typeof e[f] != "function") {
333
+ var N = Error((s || "React class") + ": " + t + " type `" + f + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[f] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw N.name = "Invariant Violation", N;
335
+ }
336
+ u = e[f](r, f, s, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch (T) {
338
+ u = T;
339
+ }
340
+ u && !(u instanceof Error) && (se(h), n("%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).", s || "React class", t, f, typeof u), se(null)), u instanceof Error && !(u.message in ke) && (ke[u.message] = !0, se(h), n("Failed %s type: %s", t, u.message), se(null));
341
+ }
342
+ }
343
+ }
344
+ var Qe = Array.isArray;
345
+ function ve(e) {
346
+ return Qe(e);
347
+ }
348
+ function er(e) {
349
+ {
350
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
351
+ return t;
352
+ }
353
+ }
354
+ function rr(e) {
355
+ try {
356
+ return Oe(e), !1;
357
+ } catch {
358
+ return !0;
359
+ }
360
+ }
361
+ function Oe(e) {
362
+ return "" + e;
363
+ }
364
+ function Ce(e) {
365
+ if (rr(e))
366
+ return n("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Oe(e);
367
+ }
368
+ var Pe = i.ReactCurrentOwner, tr = {
369
+ key: !0,
370
+ ref: !0,
371
+ __self: !0,
372
+ __source: !0
373
+ }, Me, Ne;
374
+ function nr(e) {
375
+ if (q.call(e, "ref")) {
376
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
377
+ if (r && r.isReactWarning)
378
+ return !1;
379
+ }
380
+ return e.ref !== void 0;
381
+ }
382
+ function ar(e) {
383
+ if (q.call(e, "key")) {
384
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
385
+ if (r && r.isReactWarning)
386
+ return !1;
387
+ }
388
+ return e.key !== void 0;
389
+ }
390
+ function or(e, r) {
391
+ typeof e.ref == "string" && Pe.current;
392
+ }
393
+ function sr(e, r) {
394
+ {
395
+ var t = function() {
396
+ Me || (Me = !0, n("%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)", r));
397
+ };
398
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
399
+ get: t,
400
+ configurable: !0
401
+ });
402
+ }
403
+ }
404
+ function ir(e, r) {
405
+ {
406
+ var t = function() {
407
+ Ne || (Ne = !0, n("%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)", r));
408
+ };
409
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
410
+ get: t,
411
+ configurable: !0
412
+ });
413
+ }
414
+ }
415
+ var lr = function(e, r, t, s, h, p, f) {
416
+ var u = {
417
+ // This tag allows us to uniquely identify this as a React Element
418
+ $$typeof: l,
419
+ // Built-in properties that belong on the element
420
+ type: e,
421
+ key: r,
422
+ ref: t,
423
+ props: f,
424
+ // Record the component responsible for creating this element.
425
+ _owner: p
426
+ };
427
+ return u._store = {}, Object.defineProperty(u._store, "validated", {
428
+ configurable: !1,
429
+ enumerable: !1,
430
+ writable: !0,
431
+ value: !1
432
+ }), Object.defineProperty(u, "_self", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !1,
436
+ value: s
437
+ }), Object.defineProperty(u, "_source", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: h
442
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
443
+ };
444
+ function cr(e, r, t, s, h) {
445
+ {
446
+ var p, f = {}, u = null, N = null;
447
+ t !== void 0 && (Ce(t), u = "" + t), ar(r) && (Ce(r.key), u = "" + r.key), nr(r) && (N = r.ref, or(r, h));
448
+ for (p in r)
449
+ q.call(r, p) && !tr.hasOwnProperty(p) && (f[p] = r[p]);
450
+ if (e && e.defaultProps) {
451
+ var T = e.defaultProps;
452
+ for (p in T)
453
+ f[p] === void 0 && (f[p] = T[p]);
454
+ }
455
+ if (u || N) {
456
+ var R = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
457
+ u && sr(f, R), N && ir(f, R);
458
+ }
459
+ return lr(e, u, N, h, s, Pe.current, f);
460
+ }
461
+ }
462
+ var pe = i.ReactCurrentOwner, De = i.ReactDebugCurrentFrame;
463
+ function J(e) {
464
+ if (e) {
465
+ var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
466
+ De.setExtraStackFrame(t);
467
+ } else
468
+ De.setExtraStackFrame(null);
469
+ }
470
+ var me;
471
+ me = !1;
472
+ function be(e) {
473
+ return typeof e == "object" && e !== null && e.$$typeof === l;
474
+ }
475
+ function Ae() {
476
+ {
477
+ if (pe.current) {
478
+ var e = I(pe.current.type);
479
+ if (e)
480
+ return `
481
+
482
+ Check the render method of \`` + e + "`.";
483
+ }
484
+ return "";
485
+ }
486
+ }
487
+ function ur(e) {
488
+ return "";
489
+ }
490
+ var $e = {};
491
+ function fr(e) {
492
+ {
493
+ var r = Ae();
494
+ if (!r) {
495
+ var t = typeof e == "string" ? e : e.displayName || e.name;
496
+ t && (r = `
497
+
498
+ Check the top-level render call using <` + t + ">.");
499
+ }
500
+ return r;
501
+ }
502
+ }
503
+ function Ie(e, r) {
504
+ {
505
+ if (!e._store || e._store.validated || e.key != null)
506
+ return;
507
+ e._store.validated = !0;
508
+ var t = fr(r);
509
+ if ($e[t])
510
+ return;
511
+ $e[t] = !0;
512
+ var s = "";
513
+ e && e._owner && e._owner !== pe.current && (s = " It was passed a child from " + I(e._owner.type) + "."), J(e), n('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, s), J(null);
514
+ }
515
+ }
516
+ function Fe(e, r) {
517
+ {
518
+ if (typeof e != "object")
519
+ return;
520
+ if (ve(e))
521
+ for (var t = 0; t < e.length; t++) {
522
+ var s = e[t];
523
+ be(s) && Ie(s, r);
524
+ }
525
+ else if (be(e))
526
+ e._store && (e._store.validated = !0);
527
+ else if (e) {
528
+ var h = y(e);
529
+ if (typeof h == "function" && h !== e.entries)
530
+ for (var p = h.call(e), f; !(f = p.next()).done; )
531
+ be(f.value) && Ie(f.value, r);
532
+ }
533
+ }
534
+ }
535
+ function dr(e) {
536
+ {
537
+ var r = e.type;
538
+ if (r == null || typeof r == "string")
539
+ return;
540
+ var t;
541
+ if (typeof r == "function")
542
+ t = r.propTypes;
543
+ else if (typeof r == "object" && (r.$$typeof === b || // Note: Memo only checks outer props here.
544
+ // Inner props are checked in the reconciler.
545
+ r.$$typeof === w))
546
+ t = r.propTypes;
547
+ else
548
+ return;
549
+ if (t) {
550
+ var s = I(r);
551
+ He(t, e.props, "prop", s, e);
552
+ } else if (r.PropTypes !== void 0 && !me) {
553
+ me = !0;
554
+ var h = I(r);
555
+ n("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", h || "Unknown");
556
+ }
557
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && n("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ }
559
+ }
560
+ function hr(e) {
561
+ {
562
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
563
+ var s = r[t];
564
+ if (s !== "children" && s !== "key") {
565
+ J(e), n("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", s), J(null);
566
+ break;
567
+ }
568
+ }
569
+ e.ref !== null && (J(e), n("Invalid attribute `ref` supplied to `React.Fragment`."), J(null));
570
+ }
571
+ }
572
+ var We = {};
573
+ function Ye(e, r, t, s, h, p) {
574
+ {
575
+ var f = ue(e);
576
+ if (!f) {
577
+ var u = "";
578
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (u += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
579
+ var N = ur();
580
+ N ? u += N : u += Ae();
581
+ var T;
582
+ e === null ? T = "null" : ve(e) ? T = "array" : e !== void 0 && e.$$typeof === l ? (T = "<" + (I(e.type) || "Unknown") + " />", u = " Did you accidentally export a JSX literal instead of a component?") : T = typeof e, n("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, u);
583
+ }
584
+ var R = cr(e, r, t, h, p);
585
+ if (R == null)
586
+ return R;
587
+ if (f) {
588
+ var $ = r.children;
589
+ if ($ !== void 0)
590
+ if (s)
591
+ if (ve($)) {
592
+ for (var G = 0; G < $.length; G++)
593
+ Fe($[G], e);
594
+ Object.freeze && Object.freeze($);
595
+ } else
596
+ n("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
+ else
598
+ Fe($, e);
599
+ }
600
+ if (q.call(r, "key")) {
601
+ var K = I(e), D = Object.keys(r).filter(function(gr) {
602
+ return gr !== "key";
603
+ }), ye = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
604
+ if (!We[K + ye]) {
605
+ var yr = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
606
+ n(`A props object containing a "key" prop is being spread into JSX:
607
+ let props = %s;
608
+ <%s {...props} />
609
+ React keys must be passed directly to JSX without using spread:
610
+ let props = %s;
611
+ <%s key={someKey} {...props} />`, ye, K, yr, K), We[K + ye] = !0;
612
+ }
613
+ }
614
+ return e === c ? hr(R) : dr(R), R;
615
+ }
616
+ }
617
+ function vr(e, r, t) {
618
+ return Ye(e, r, t, !0);
619
+ }
620
+ function pr(e, r, t) {
621
+ return Ye(e, r, t, !1);
622
+ }
623
+ var mr = pr, br = vr;
624
+ X.Fragment = c, X.jsx = mr, X.jsxs = br;
625
+ }()), X;
626
+ }
627
+ process.env.NODE_ENV === "production" ? Te.exports = xr() : Te.exports = Er();
628
+ var a = Te.exports;
629
+ const Tr = "Asia/Kolkata", Ve = [
630
+ { value: "Asia/Kolkata", label: "India (IST)" },
631
+ { value: "America/New_York", label: "Eastern Time (ET)" },
632
+ { value: "America/Chicago", label: "Central Time (CT)" },
633
+ { value: "America/Denver", label: "Mountain Time (MT)" },
634
+ { value: "America/Los_Angeles", label: "Pacific Time (PT)" },
635
+ { value: "Europe/London", label: "London (GMT/BST)" },
636
+ { value: "Europe/Paris", label: "Central Europe (CET)" },
637
+ { value: "Asia/Dubai", label: "Dubai (GST)" },
638
+ { value: "Asia/Singapore", label: "Singapore (SGT)" },
639
+ { value: "Asia/Tokyo", label: "Tokyo (JST)" },
640
+ { value: "Australia/Sydney", label: "Sydney (AEDT)" },
641
+ { value: "UTC", label: "UTC" }
642
+ ];
643
+ function ie(o, l) {
644
+ return Y.isDateTime(o) ? o.setZone(l) : typeof o == "string" ? Y.fromISO(o, { zone: l }) : Y.fromJSDate(o, { zone: l });
645
+ }
646
+ function Ee(o) {
647
+ return Y.now().setZone(o);
648
+ }
649
+ function Be(o) {
650
+ const d = Y.now().setZone(o).offset, c = Math.floor(Math.abs(d) / 60), m = Math.abs(d) % 60;
651
+ return `UTC${d >= 0 ? "+" : "-"}${c}${m > 0 ? `:${m.toString().padStart(2, "0")}` : ""}`;
652
+ }
653
+ function jr(o, l, d, c, m, j) {
654
+ const v = Y.fromObject(
655
+ { year: o, month: l, day: 1 },
656
+ { zone: d }
657
+ ), S = v.startOf("week"), M = v.endOf("month").endOf("week"), x = Y.now().setZone(d).startOf("day"), w = [];
658
+ let O = [], _ = S;
659
+ for (; _ <= M; ) {
660
+ const C = _.month === l, A = _.hasSame(x, "day"), y = c ? _.hasSame(c, "day") : !1;
661
+ let i = !1;
662
+ m && _ < m.startOf("day") && (i = !0), j && _ > j.endOf("day") && (i = !0), O.push({
663
+ date: _,
664
+ isCurrentMonth: C,
665
+ isToday: A,
666
+ isSelected: y,
667
+ isDisabled: i
668
+ }), O.length === 7 && (w.push(O), O = []), _ = _.plus({ days: 1 });
669
+ }
670
+ return w;
671
+ }
672
+ function _r() {
673
+ const o = Y.now().startOf("week"), l = [];
674
+ for (let d = 0; d < 7; d++) {
675
+ const c = o.plus({ days: d });
676
+ l.push(c.toFormat("ccc"));
677
+ }
678
+ return l;
679
+ }
680
+ function Rr() {
681
+ const o = [];
682
+ for (let l = 1; l <= 12; l++) {
683
+ const d = Y.fromObject({ month: l });
684
+ o.push(d.toFormat("MMMM"));
685
+ }
686
+ return o;
687
+ }
688
+ const Sr = ({
689
+ viewDate: o,
690
+ selectedDate: l,
691
+ onDateSelect: d,
692
+ onViewDateChange: c,
693
+ timezone: m,
694
+ minDate: j,
695
+ maxDate: v
696
+ }) => {
697
+ const S = ge(() => jr(
698
+ o.year,
699
+ o.month,
700
+ m,
701
+ l ?? void 0,
702
+ j,
703
+ v
704
+ ), [o, l, m, j, v]), b = ge(() => _r(), []), M = ge(() => Rr(), []), x = () => {
705
+ c(o.minus({ months: 1 }));
706
+ }, w = () => {
707
+ c(o.plus({ months: 1 }));
708
+ }, O = (n) => {
709
+ const P = parseInt(n.target.value, 10);
710
+ c(o.set({ month: P }));
711
+ }, _ = (n) => {
712
+ const P = parseInt(n.target.value, 10);
713
+ c(o.set({ year: P }));
714
+ }, C = (n, P) => {
715
+ P || d(n);
716
+ }, A = (n, P, k) => {
717
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), C(P, k));
718
+ }, y = o.year, i = Array.from({ length: 21 }, (n, P) => y - 10 + P);
719
+ return /* @__PURE__ */ a.jsxs("div", { className: "chronos-calendar", role: "region", "aria-label": "Calendar", children: [
720
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-calendar-header", children: [
721
+ /* @__PURE__ */ a.jsx(
722
+ "button",
723
+ {
724
+ type: "button",
725
+ className: "chronos-nav-button",
726
+ onClick: x,
727
+ "aria-label": "Previous month",
728
+ children: "‹"
729
+ }
730
+ ),
731
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-month-year-selectors", children: [
732
+ /* @__PURE__ */ a.jsx(
733
+ "select",
734
+ {
735
+ className: "chronos-month-select",
736
+ value: o.month,
737
+ onChange: O,
738
+ "aria-label": "Select month",
739
+ children: M.map((n, P) => /* @__PURE__ */ a.jsx("option", { value: P + 1, children: n }, P))
740
+ }
741
+ ),
742
+ /* @__PURE__ */ a.jsx(
743
+ "select",
744
+ {
745
+ className: "chronos-year-select",
746
+ value: o.year,
747
+ onChange: _,
748
+ "aria-label": "Select year",
749
+ children: i.map((n) => /* @__PURE__ */ a.jsx("option", { value: n, children: n }, n))
750
+ }
751
+ )
752
+ ] }),
753
+ /* @__PURE__ */ a.jsx(
754
+ "button",
755
+ {
756
+ type: "button",
757
+ className: "chronos-nav-button",
758
+ onClick: w,
759
+ "aria-label": "Next month",
760
+ children: "›"
761
+ }
762
+ )
763
+ ] }),
764
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-calendar-grid", children: [
765
+ /* @__PURE__ */ a.jsx("div", { className: "chronos-weekday-row", children: b.map((n) => /* @__PURE__ */ a.jsx("div", { className: "chronos-weekday", children: n }, n)) }),
766
+ S.map((n, P) => /* @__PURE__ */ a.jsx("div", { className: "chronos-week-row", children: n.map((k, L) => /* @__PURE__ */ a.jsx(
767
+ "button",
768
+ {
769
+ type: "button",
770
+ className: `chronos-day ${k.isSelected ? "selected" : ""} ${k.isToday ? "today" : ""} ${k.isCurrentMonth ? "" : "other-month"} ${k.isDisabled ? "disabled" : ""}`,
771
+ onClick: () => C(k.date, k.isDisabled),
772
+ onKeyDown: (V) => A(V, k.date, k.isDisabled),
773
+ disabled: k.isDisabled,
774
+ "aria-label": k.date.toFormat("MMMM d, yyyy"),
775
+ "aria-selected": k.isSelected,
776
+ "aria-current": k.isToday ? "date" : void 0,
777
+ children: k.date.day
778
+ },
779
+ L
780
+ )) }, P))
781
+ ] })
782
+ ] });
783
+ }, kr = ({
784
+ value: o,
785
+ onChange: l,
786
+ use24Hour: d
787
+ }) => {
788
+ const [c, m] = z((o == null ? void 0 : o.hour) ?? 12), [j, v] = z((o == null ? void 0 : o.minute) ?? 0), [S, b] = z(
789
+ o && o.hour >= 12 ? "PM" : "AM"
790
+ );
791
+ le(() => {
792
+ o && (m(o.hour), v(o.minute), b(o.hour >= 12 ? "PM" : "AM"));
793
+ }, [o]);
794
+ const M = (i) => {
795
+ m(i);
796
+ let n = i;
797
+ d || (S === "PM" && i !== 12 ? n = i + 12 : S === "AM" && i === 12 && (n = 0)), l(n, j);
798
+ }, x = (i) => {
799
+ v(i), l(c, i);
800
+ }, w = () => {
801
+ const i = S === "AM" ? "PM" : "AM";
802
+ b(i);
803
+ let n = c;
804
+ i === "PM" && c !== 12 ? n = c + 12 : i === "AM" && c === 12 ? n = 0 : i === "AM" && c > 12 && (n = c - 12), l(n, j);
805
+ }, O = d ? c : c % 12 || 12, _ = d ? 23 : 12, C = d ? 0 : 1, A = Array.from({ length: _ - C + 1 }, (i, n) => C + n), y = Array.from({ length: 60 }, (i, n) => n);
806
+ return /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-picker", role: "group", "aria-label": "Time picker", children: [
807
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-header", children: [
808
+ /* @__PURE__ */ a.jsxs(
809
+ "svg",
810
+ {
811
+ className: "chronos-clock-icon",
812
+ xmlns: "http://www.w3.org/2000/svg",
813
+ viewBox: "0 0 24 24",
814
+ fill: "none",
815
+ stroke: "currentColor",
816
+ strokeWidth: "2",
817
+ children: [
818
+ /* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "10" }),
819
+ /* @__PURE__ */ a.jsx("polyline", { points: "12 6 12 12 16 14" })
820
+ ]
821
+ }
822
+ ),
823
+ /* @__PURE__ */ a.jsx("span", { children: "Time" })
824
+ ] }),
825
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-controls", children: [
826
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-input-group", children: [
827
+ /* @__PURE__ */ a.jsx("label", { htmlFor: "chronos-hour-select", className: "chronos-time-label", children: "Hour" }),
828
+ /* @__PURE__ */ a.jsx(
829
+ "select",
830
+ {
831
+ id: "chronos-hour-select",
832
+ className: "chronos-time-select",
833
+ value: O,
834
+ onChange: (i) => M(parseInt(i.target.value, 10)),
835
+ "aria-label": "Select hour",
836
+ children: A.map((i) => /* @__PURE__ */ a.jsx("option", { value: i, children: i.toString().padStart(2, "0") }, i))
837
+ }
838
+ )
839
+ ] }),
840
+ /* @__PURE__ */ a.jsx("span", { className: "chronos-time-separator", children: ":" }),
841
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-time-input-group", children: [
842
+ /* @__PURE__ */ a.jsx("label", { htmlFor: "chronos-minute-select", className: "chronos-time-label", children: "Minute" }),
843
+ /* @__PURE__ */ a.jsx(
844
+ "select",
845
+ {
846
+ id: "chronos-minute-select",
847
+ className: "chronos-time-select",
848
+ value: j,
849
+ onChange: (i) => x(parseInt(i.target.value, 10)),
850
+ "aria-label": "Select minute",
851
+ children: y.map((i) => /* @__PURE__ */ a.jsx("option", { value: i, children: i.toString().padStart(2, "0") }, i))
852
+ }
853
+ )
854
+ ] }),
855
+ !d && /* @__PURE__ */ a.jsx(
856
+ "button",
857
+ {
858
+ type: "button",
859
+ className: "chronos-period-toggle",
860
+ onClick: w,
861
+ "aria-label": `Switch to ${S === "AM" ? "PM" : "AM"}`,
862
+ children: S
863
+ }
864
+ )
865
+ ] })
866
+ ] });
867
+ }, wr = ({
868
+ value: o,
869
+ onChange: l
870
+ }) => {
871
+ const [d, c] = z(!1), m = Ve.find((v) => v.value === o) || {
872
+ label: o
873
+ }, j = (v) => {
874
+ l(v), c(!1);
875
+ };
876
+ return /* @__PURE__ */ a.jsxs("div", { className: "chronos-timezone-selector", children: [
877
+ /* @__PURE__ */ a.jsxs("div", { className: "chronos-timezone-header", children: [
878
+ /* @__PURE__ */ a.jsxs(
879
+ "svg",
880
+ {
881
+ className: "chronos-globe-icon",
882
+ xmlns: "http://www.w3.org/2000/svg",
883
+ viewBox: "0 0 24 24",
884
+ fill: "none",
885
+ stroke: "currentColor",
886
+ strokeWidth: "2",
887
+ children: [
888
+ /* @__PURE__ */ a.jsx("circle", { cx: "12", cy: "12", r: "10" }),
889
+ /* @__PURE__ */ a.jsx("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
890
+ /* @__PURE__ */ a.jsx("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
891
+ ]
892
+ }
893
+ ),
894
+ /* @__PURE__ */ a.jsx("span", { children: "Timezone" })
895
+ ] }),
896
+ /* @__PURE__ */ a.jsxs(
897
+ "button",
898
+ {
899
+ type: "button",
900
+ className: "chronos-timezone-button",
901
+ onClick: () => c(!d),
902
+ "aria-expanded": d,
903
+ "aria-label": "Select timezone",
904
+ children: [
905
+ /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-label", children: m.label }),
906
+ /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-offset", children: Be(o) }),
907
+ /* @__PURE__ */ a.jsx(
908
+ "svg",
909
+ {
910
+ className: `chronos-chevron ${d ? "expanded" : ""}`,
911
+ xmlns: "http://www.w3.org/2000/svg",
912
+ viewBox: "0 0 24 24",
913
+ fill: "none",
914
+ stroke: "currentColor",
915
+ strokeWidth: "2",
916
+ children: /* @__PURE__ */ a.jsx("polyline", { points: "6 9 12 15 18 9" })
917
+ }
918
+ )
919
+ ]
920
+ }
921
+ ),
922
+ d && /* @__PURE__ */ a.jsx("div", { className: "chronos-timezone-list", role: "listbox", children: Ve.map((v) => /* @__PURE__ */ a.jsxs(
923
+ "button",
924
+ {
925
+ type: "button",
926
+ className: `chronos-timezone-option ${v.value === o ? "selected" : ""}`,
927
+ onClick: () => j(v.value),
928
+ role: "option",
929
+ "aria-selected": v.value === o,
930
+ children: [
931
+ /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-option-label", children: v.label }),
932
+ /* @__PURE__ */ a.jsx("span", { className: "chronos-timezone-option-offset", children: Be(v.value) })
933
+ ]
934
+ },
935
+ v.value
936
+ )) })
937
+ ] });
938
+ }, Pr = ({
939
+ value: o,
940
+ onChange: l,
941
+ timezone: d = Tr,
942
+ dateFormat: c = "DD",
943
+ timeFormat: m = "HH:mm",
944
+ minDate: j,
945
+ maxDate: v,
946
+ placeholder: S = "Select date and time",
947
+ disabled: b = !1,
948
+ showTime: M = !0,
949
+ use24Hour: x = !0,
950
+ className: w = "",
951
+ ariaLabel: O = "Date and time picker",
952
+ showTimezoneSelector: _ = !1
953
+ }) => {
954
+ const [C, A] = z(!1), [y, i] = z(() => o ? ie(o, d) : null), [n, P] = z(d), [k, L] = z(() => y || Ee(d)), V = Le(null), H = Le(null);
955
+ le(() => {
956
+ o && i(ie(o, n));
957
+ }, [o, n]), le(() => {
958
+ const E = (g) => {
959
+ V.current && !V.current.contains(g.target) && A(!1);
960
+ };
961
+ if (C)
962
+ return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
963
+ }, [C]), le(() => {
964
+ const E = (g) => {
965
+ var F;
966
+ g.key === "Escape" && C && (A(!1), (F = H.current) == null || F.focus());
967
+ };
968
+ return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
969
+ }, [C]);
970
+ const ce = xe((E) => {
971
+ let g = E;
972
+ if (y && (g = E.set({
973
+ hour: y.hour,
974
+ minute: y.minute,
975
+ second: y.second
976
+ })), i(g), L(g), M || A(!1), l) {
977
+ const F = {
978
+ iso: g.toISO() || "",
979
+ formatted: g.toFormat(`${c} ${m}`),
980
+ timestamp: g.toMillis(),
981
+ dateTime: g
982
+ };
983
+ l(F);
984
+ }
985
+ }, [y, M, l, c, m]), Q = xe((E, g) => {
986
+ const U = (y || Ee(n)).set({ hour: E, minute: g, second: 0 });
987
+ if (i(U), l) {
988
+ const te = {
989
+ iso: U.toISO() || "",
990
+ formatted: U.toFormat(`${c} ${m}`),
991
+ timestamp: U.toMillis(),
992
+ dateTime: U
993
+ };
994
+ l(te);
995
+ }
996
+ }, [y, n, l, c, m]), ue = xe((E) => {
997
+ if (P(E), y) {
998
+ const g = y.setZone(E);
999
+ if (i(g), L(g), l) {
1000
+ const F = {
1001
+ iso: g.toISO() || "",
1002
+ formatted: g.toFormat(`${c} ${m}`),
1003
+ timestamp: g.toMillis(),
1004
+ dateTime: g
1005
+ };
1006
+ l(F);
1007
+ }
1008
+ } else
1009
+ L(Ee(E));
1010
+ }, [y, l, c, m]), ee = () => {
1011
+ b || A(!C);
1012
+ }, re = (E) => {
1013
+ (E.key === "Enter" || E.key === " ") && (E.preventDefault(), ee());
1014
+ }, I = y ? y.toFormat(`${c} ${M ? m : ""}`) : "", W = j ? ie(j, n) : void 0, B = v ? ie(v, n) : void 0;
1015
+ return /* @__PURE__ */ a.jsxs(
1016
+ "div",
1017
+ {
1018
+ ref: V,
1019
+ className: `chronos-picker ${w}`,
1020
+ "data-disabled": b,
1021
+ children: [
1022
+ /* @__PURE__ */ a.jsxs(
1023
+ "div",
1024
+ {
1025
+ className: "chronos-input-wrapper",
1026
+ onClick: ee,
1027
+ children: [
1028
+ /* @__PURE__ */ a.jsx(
1029
+ "input",
1030
+ {
1031
+ ref: H,
1032
+ type: "text",
1033
+ className: "chronos-input",
1034
+ value: I,
1035
+ placeholder: S,
1036
+ readOnly: !0,
1037
+ disabled: b,
1038
+ onKeyDown: re,
1039
+ "aria-label": O,
1040
+ "aria-expanded": C,
1041
+ "aria-haspopup": "dialog",
1042
+ role: "combobox"
1043
+ }
1044
+ ),
1045
+ /* @__PURE__ */ a.jsxs(
1046
+ "svg",
1047
+ {
1048
+ className: "chronos-calendar-icon",
1049
+ xmlns: "http://www.w3.org/2000/svg",
1050
+ viewBox: "0 0 24 24",
1051
+ fill: "none",
1052
+ stroke: "currentColor",
1053
+ strokeWidth: "2",
1054
+ children: [
1055
+ /* @__PURE__ */ a.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
1056
+ /* @__PURE__ */ a.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
1057
+ /* @__PURE__ */ a.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
1058
+ /* @__PURE__ */ a.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
1059
+ ]
1060
+ }
1061
+ )
1062
+ ]
1063
+ }
1064
+ ),
1065
+ C && /* @__PURE__ */ a.jsxs(
1066
+ "div",
1067
+ {
1068
+ className: "chronos-dropdown",
1069
+ role: "dialog",
1070
+ "aria-label": "Date and time picker dialog",
1071
+ children: [
1072
+ /* @__PURE__ */ a.jsx(
1073
+ Sr,
1074
+ {
1075
+ viewDate: k,
1076
+ selectedDate: y,
1077
+ onDateSelect: ce,
1078
+ onViewDateChange: L,
1079
+ timezone: n,
1080
+ minDate: W,
1081
+ maxDate: B
1082
+ }
1083
+ ),
1084
+ M && /* @__PURE__ */ a.jsx(
1085
+ kr,
1086
+ {
1087
+ value: y,
1088
+ onChange: Q,
1089
+ use24Hour: x,
1090
+ timezone: n
1091
+ }
1092
+ ),
1093
+ _ && /* @__PURE__ */ a.jsx(
1094
+ wr,
1095
+ {
1096
+ value: n,
1097
+ onChange: ue
1098
+ }
1099
+ )
1100
+ ]
1101
+ }
1102
+ )
1103
+ ]
1104
+ }
1105
+ );
1106
+ };
1107
+ export {
1108
+ Ve as COMMON_TIMEZONES,
1109
+ Tr as DEFAULT_TIMEZONE,
1110
+ Pr as DateTimePicker,
1111
+ ie as convertToTimezone,
1112
+ Ee as nowInTimezone
1113
+ };