@lanrenbang/basecoat-ultra 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var xe = [
1
+ var ke = [
2
2
  "onChange",
3
3
  "onClose",
4
4
  "onDayCreate",
@@ -11,7 +11,7 @@ var xe = [
11
11
  "onValueUpdate",
12
12
  "onYearChange",
13
13
  "onPreCalendarPosition"
14
- ], $ = {
14
+ ], G = {
15
15
  _disable: [],
16
16
  allowInput: !1,
17
17
  allowInvalidPreload: !1,
@@ -73,7 +73,7 @@ var xe = [
73
73
  time_24hr: !1,
74
74
  weekNumbers: !1,
75
75
  wrap: !1
76
- }, te = {
76
+ }, ie = {
77
77
  weekdays: {
78
78
  shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
79
79
  longhand: [
@@ -143,21 +143,21 @@ var xe = [
143
143
  hourAriaLabel: "Hour",
144
144
  minuteAriaLabel: "Minute",
145
145
  time_24hr: !1
146
- }, I = function(a, r) {
146
+ }, S = function(a, r) {
147
147
  return r === void 0 && (r = 2), ("000" + a).slice(r * -1);
148
148
  }, O = function(a) {
149
149
  return a === !0 ? 1 : 0;
150
150
  };
151
- function Ke(a, r) {
151
+ function Be(a, r) {
152
152
  var e;
153
153
  return function() {
154
- var d = this, h = arguments;
154
+ var s = this, m = arguments;
155
155
  clearTimeout(e), e = setTimeout(function() {
156
- return a.apply(d, h);
156
+ return a.apply(s, m);
157
157
  }, r);
158
158
  };
159
159
  }
160
- var Ee = function(a) {
160
+ var Te = function(a) {
161
161
  return a instanceof Array ? a : [a];
162
162
  };
163
163
  function T(a, r, e) {
@@ -166,25 +166,25 @@ function T(a, r, e) {
166
166
  a.classList.remove(r);
167
167
  }
168
168
  function v(a, r, e) {
169
- var d = window.document.createElement(a);
170
- return r = r || "", e = e || "", d.className = r, e !== void 0 && (d.textContent = e), d;
169
+ var s = window.document.createElement(a);
170
+ return r = r || "", e = e || "", s.className = r, e !== void 0 && (s.textContent = e), s;
171
171
  }
172
- function ce(a) {
172
+ function ge(a) {
173
173
  for (; a.firstChild; )
174
174
  a.removeChild(a.firstChild);
175
175
  }
176
- function Ue(a, r) {
176
+ function Ve(a, r) {
177
177
  if (r(a))
178
178
  return a;
179
179
  if (a.parentNode)
180
- return Ue(a.parentNode, r);
180
+ return Ve(a.parentNode, r);
181
181
  }
182
- function de(a, r) {
183
- var e = v("div", "numInputWrapper"), d = v("input", "numInput " + a), h = v("span", "arrowUp"), g = v("span", "arrowDown");
184
- if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ? d.type = "number" : (d.type = "text", d.pattern = "\\d*"), r !== void 0)
185
- for (var b in r)
186
- d.setAttribute(b, r[b]);
187
- return e.appendChild(d), e.appendChild(h), e.appendChild(g), e;
182
+ function me(a, r) {
183
+ var e = v("div", "numInputWrapper"), s = v("input", "numInput " + a), m = v("span", "arrowUp"), g = v("span", "arrowDown");
184
+ if (navigator.userAgent.indexOf("MSIE 9.0") === -1 ? s.type = "number" : (s.type = "text", s.pattern = "\\d*"), r !== void 0)
185
+ for (var w in r)
186
+ s.setAttribute(w, r[w]);
187
+ return e.appendChild(s), e.appendChild(m), e.appendChild(g), e;
188
188
  }
189
189
  function _(a) {
190
190
  try {
@@ -197,11 +197,11 @@ function _(a) {
197
197
  return a.target;
198
198
  }
199
199
  }
200
- var ke = function() {
201
- }, ge = function(a, r, e) {
200
+ var Se = function() {
201
+ }, pe = function(a, r, e) {
202
202
  return e.months[r ? "shorthand" : "longhand"][a];
203
- }, kn = {
204
- D: ke,
203
+ }, _n = {
204
+ D: Se,
205
205
  F: function(a, r, e) {
206
206
  a.setMonth(e.months.longhand.indexOf(r));
207
207
  },
@@ -227,8 +227,8 @@ var ke = function() {
227
227
  return new Date(parseFloat(r) * 1e3);
228
228
  },
229
229
  W: function(a, r, e) {
230
- var d = parseInt(r), h = new Date(a.getFullYear(), 0, 2 + (d - 1) * 7, 0, 0, 0, 0);
231
- return h.setDate(h.getDate() - h.getDay() + e.firstDayOfWeek), h;
230
+ var s = parseInt(r), m = new Date(a.getFullYear(), 0, 2 + (s - 1) * 7, 0, 0, 0, 0);
231
+ return m.setDate(m.getDate() - m.getDay() + e.firstDayOfWeek), m;
232
232
  },
233
233
  Y: function(a, r) {
234
234
  a.setFullYear(parseFloat(r));
@@ -248,7 +248,7 @@ var ke = function() {
248
248
  j: function(a, r) {
249
249
  a.setDate(parseFloat(r));
250
250
  },
251
- l: ke,
251
+ l: Se,
252
252
  m: function(a, r) {
253
253
  a.setMonth(parseFloat(r) - 1);
254
254
  },
@@ -261,11 +261,11 @@ var ke = function() {
261
261
  u: function(a, r) {
262
262
  return new Date(parseFloat(r));
263
263
  },
264
- w: ke,
264
+ w: Se,
265
265
  y: function(a, r) {
266
266
  a.setFullYear(2e3 + parseFloat(r));
267
267
  }
268
- }, K = {
268
+ }, B = {
269
269
  D: "",
270
270
  F: "",
271
271
  G: "(\\d\\d|\\d)",
@@ -289,21 +289,21 @@ var ke = function() {
289
289
  u: "(.+)",
290
290
  w: "(\\d\\d|\\d)",
291
291
  y: "(\\d{2})"
292
- }, ne = {
292
+ }, ae = {
293
293
  Z: function(a) {
294
294
  return a.toISOString();
295
295
  },
296
296
  D: function(a, r, e) {
297
- return r.weekdays.shorthand[ne.w(a, r, e)];
297
+ return r.weekdays.shorthand[ae.w(a, r, e)];
298
298
  },
299
299
  F: function(a, r, e) {
300
- return ge(ne.n(a, r, e) - 1, !1, r);
300
+ return pe(ae.n(a, r, e) - 1, !1, r);
301
301
  },
302
302
  G: function(a, r, e) {
303
- return I(ne.h(a, r, e));
303
+ return S(ae.h(a, r, e));
304
304
  },
305
305
  H: function(a) {
306
- return I(a.getHours());
306
+ return S(a.getHours());
307
307
  },
308
308
  J: function(a, r) {
309
309
  return r.ordinal !== void 0 ? a.getDate() + r.ordinal(a.getDate()) : a.getDate();
@@ -312,10 +312,10 @@ var ke = function() {
312
312
  return r.amPM[O(a.getHours() > 11)];
313
313
  },
314
314
  M: function(a, r) {
315
- return ge(a.getMonth(), !0, r);
315
+ return pe(a.getMonth(), !0, r);
316
316
  },
317
317
  S: function(a) {
318
- return I(a.getSeconds());
318
+ return S(a.getSeconds());
319
319
  },
320
320
  U: function(a) {
321
321
  return a.getTime() / 1e3;
@@ -324,16 +324,16 @@ var ke = function() {
324
324
  return e.getWeek(a);
325
325
  },
326
326
  Y: function(a) {
327
- return I(a.getFullYear(), 4);
327
+ return S(a.getFullYear(), 4);
328
328
  },
329
329
  d: function(a) {
330
- return I(a.getDate());
330
+ return S(a.getDate());
331
331
  },
332
332
  h: function(a) {
333
333
  return a.getHours() % 12 ? a.getHours() % 12 : 12;
334
334
  },
335
335
  i: function(a) {
336
- return I(a.getMinutes());
336
+ return S(a.getMinutes());
337
337
  },
338
338
  j: function(a) {
339
339
  return a.getDate();
@@ -342,7 +342,7 @@ var ke = function() {
342
342
  return r.weekdays.longhand[a.getDay()];
343
343
  },
344
344
  m: function(a) {
345
- return I(a.getMonth() + 1);
345
+ return S(a.getMonth() + 1);
346
346
  },
347
347
  n: function(a) {
348
348
  return a.getMonth() + 1;
@@ -359,138 +359,138 @@ var ke = function() {
359
359
  y: function(a) {
360
360
  return String(a.getFullYear()).substring(2);
361
361
  }
362
- }, qe = function(a) {
363
- var r = a.config, e = r === void 0 ? $ : r, d = a.l10n, h = d === void 0 ? te : d, g = a.isMobile, b = g === void 0 ? !1 : g;
364
- return function(C, E, Z) {
365
- var y = Z || h;
366
- return e.formatDate !== void 0 && !b ? e.formatDate(C, E, y) : E.split("").map(function(A, N, Y) {
367
- return ne[A] && Y[N - 1] !== "\\" ? ne[A](C, y, e) : A !== "\\" ? A : "";
362
+ }, Ze = function(a) {
363
+ var r = a.config, e = r === void 0 ? G : r, s = a.l10n, m = s === void 0 ? ie : s, g = a.isMobile, w = g === void 0 ? !1 : g;
364
+ return function(y, x, L) {
365
+ var C = L || m;
366
+ return e.formatDate !== void 0 && !w ? e.formatDate(y, x, C) : x.split("").map(function(A, N, Y) {
367
+ return ae[A] && Y[N - 1] !== "\\" ? ae[A](y, C, e) : A !== "\\" ? A : "";
368
368
  }).join("");
369
369
  };
370
- }, _e = function(a) {
371
- var r = a.config, e = r === void 0 ? $ : r, d = a.l10n, h = d === void 0 ? te : d;
372
- return function(g, b, C, E) {
370
+ }, Fe = function(a) {
371
+ var r = a.config, e = r === void 0 ? G : r, s = a.l10n, m = s === void 0 ? ie : s;
372
+ return function(g, w, y, x) {
373
373
  if (!(g !== 0 && !g)) {
374
- var Z = E || h, y, A = g;
374
+ var L = x || m, C, A = g;
375
375
  if (g instanceof Date)
376
- y = new Date(g.getTime());
376
+ C = new Date(g.getTime());
377
377
  else if (typeof g != "string" && g.toFixed !== void 0)
378
- y = new Date(g);
378
+ C = new Date(g);
379
379
  else if (typeof g == "string") {
380
- var N = b || (e || $).dateFormat, Y = String(g).trim();
380
+ var N = w || (e || G).dateFormat, Y = String(g).trim();
381
381
  if (Y === "today")
382
- y = /* @__PURE__ */ new Date(), C = !0;
382
+ C = /* @__PURE__ */ new Date(), y = !0;
383
383
  else if (e && e.parseDate)
384
- y = e.parseDate(g, N);
384
+ C = e.parseDate(g, N);
385
385
  else if (/Z$/.test(Y) || /GMT$/.test(Y))
386
- y = new Date(g);
386
+ C = new Date(g);
387
387
  else {
388
- for (var ae = void 0, D = [], j = 0, me = 0, L = ""; j < N.length; j++) {
389
- var R = N[j], J = R === "\\", pe = N[j - 1] === "\\" || J;
390
- if (K[R] && !pe) {
391
- L += K[R];
392
- var W = new RegExp(L).exec(g);
393
- W && (ae = !0) && D[R !== "Y" ? "push" : "unshift"]({
394
- fn: kn[R],
395
- val: W[++me]
388
+ for (var re = void 0, D = [], R = 0, he = 0, j = ""; R < N.length; R++) {
389
+ var W = N[R], K = W === "\\", ve = N[R - 1] === "\\" || K;
390
+ if (B[W] && !ve) {
391
+ j += B[W];
392
+ var J = new RegExp(j).exec(g);
393
+ J && (re = !0) && D[W !== "Y" ? "push" : "unshift"]({
394
+ fn: _n[W],
395
+ val: J[++he]
396
396
  });
397
- } else J || (L += ".");
397
+ } else K || (j += ".");
398
398
  }
399
- y = !e || !e.noCalendar ? new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1, 0, 0, 0, 0) : new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)), D.forEach(function(U) {
400
- var q = U.fn, he = U.val;
401
- return y = q(y, he, Z) || y;
402
- }), y = ae ? y : void 0;
399
+ C = !e || !e.noCalendar ? new Date((/* @__PURE__ */ new Date()).getFullYear(), 0, 1, 0, 0, 0, 0) : new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)), D.forEach(function(q) {
400
+ var U = q.fn, De = q.val;
401
+ return C = U(C, De, L) || C;
402
+ }), C = re ? C : void 0;
403
403
  }
404
404
  }
405
- if (!(y instanceof Date && !isNaN(y.getTime()))) {
405
+ if (!(C instanceof Date && !isNaN(C.getTime()))) {
406
406
  e.errorHandler(new Error("Invalid date provided: " + A));
407
407
  return;
408
408
  }
409
- return C === !0 && y.setHours(0, 0, 0, 0), y;
409
+ return y === !0 && C.setHours(0, 0, 0, 0), C;
410
410
  }
411
411
  };
412
412
  };
413
413
  function F(a, r, e) {
414
414
  return e === void 0 && (e = !0), e !== !1 ? new Date(a.getTime()).setHours(0, 0, 0, 0) - new Date(r.getTime()).setHours(0, 0, 0, 0) : a.getTime() - r.getTime();
415
415
  }
416
- var Tn = function(a, r, e) {
416
+ var Fn = function(a, r, e) {
417
417
  return a > Math.min(r, e) && a < Math.max(r, e);
418
- }, Te = function(a, r, e) {
418
+ }, Ie = function(a, r, e) {
419
419
  return a * 3600 + r * 60 + e;
420
- }, In = function(a) {
420
+ }, On = function(a) {
421
421
  var r = Math.floor(a / 3600), e = (a - r * 3600) / 60;
422
422
  return [r, e, a - r * 3600 - e * 60];
423
- }, Sn = {
423
+ }, An = {
424
424
  DAY: 864e5
425
425
  };
426
- function Ie(a) {
427
- var r = a.defaultHour, e = a.defaultMinute, d = a.defaultSeconds;
426
+ function _e(a) {
427
+ var r = a.defaultHour, e = a.defaultMinute, s = a.defaultSeconds;
428
428
  if (a.minDate !== void 0) {
429
- var h = a.minDate.getHours(), g = a.minDate.getMinutes(), b = a.minDate.getSeconds();
430
- r < h && (r = h), r === h && e < g && (e = g), r === h && e === g && d < b && (d = a.minDate.getSeconds());
429
+ var m = a.minDate.getHours(), g = a.minDate.getMinutes(), w = a.minDate.getSeconds();
430
+ r < m && (r = m), r === m && e < g && (e = g), r === m && e === g && s < w && (s = a.minDate.getSeconds());
431
431
  }
432
432
  if (a.maxDate !== void 0) {
433
- var C = a.maxDate.getHours(), E = a.maxDate.getMinutes();
434
- r = Math.min(r, C), r === C && (e = Math.min(E, e)), r === C && e === E && (d = a.maxDate.getSeconds());
433
+ var y = a.maxDate.getHours(), x = a.maxDate.getMinutes();
434
+ r = Math.min(r, y), r === y && (e = Math.min(x, e)), r === y && e === x && (s = a.maxDate.getSeconds());
435
435
  }
436
- return { hours: r, minutes: e, seconds: d };
436
+ return { hours: r, minutes: e, seconds: s };
437
437
  }
438
438
  typeof Object.assign != "function" && (Object.assign = function(a) {
439
439
  for (var r = [], e = 1; e < arguments.length; e++)
440
440
  r[e - 1] = arguments[e];
441
441
  if (!a)
442
442
  throw TypeError("Cannot convert undefined or null to object");
443
- for (var d = function(C) {
444
- C && Object.keys(C).forEach(function(E) {
445
- return a[E] = C[E];
443
+ for (var s = function(y) {
444
+ y && Object.keys(y).forEach(function(x) {
445
+ return a[x] = y[x];
446
446
  });
447
- }, h = 0, g = r; h < g.length; h++) {
448
- var b = g[h];
449
- d(b);
447
+ }, m = 0, g = r; m < g.length; m++) {
448
+ var w = g[m];
449
+ s(w);
450
450
  }
451
451
  return a;
452
452
  });
453
453
  var k = function() {
454
454
  return k = Object.assign || function(a) {
455
- for (var r, e = 1, d = arguments.length; e < d; e++) {
455
+ for (var r, e = 1, s = arguments.length; e < s; e++) {
456
456
  r = arguments[e];
457
- for (var h in r) Object.prototype.hasOwnProperty.call(r, h) && (a[h] = r[h]);
457
+ for (var m in r) Object.prototype.hasOwnProperty.call(r, m) && (a[m] = r[m]);
458
458
  }
459
459
  return a;
460
460
  }, k.apply(this, arguments);
461
- }, Je = function() {
461
+ }, Ke = function() {
462
462
  for (var a = 0, r = 0, e = arguments.length; r < e; r++) a += arguments[r].length;
463
- for (var d = Array(a), h = 0, r = 0; r < e; r++)
464
- for (var g = arguments[r], b = 0, C = g.length; b < C; b++, h++)
465
- d[h] = g[b];
466
- return d;
467
- }, _n = 300;
468
- function Fn(a, r) {
463
+ for (var s = Array(a), m = 0, r = 0; r < e; r++)
464
+ for (var g = arguments[r], w = 0, y = g.length; w < y; w++, m++)
465
+ s[m] = g[w];
466
+ return s;
467
+ }, Nn = 300;
468
+ function Pn(a, r) {
469
469
  var e = {
470
- config: k(k({}, $), x.defaultConfig),
471
- l10n: te
470
+ config: k(k({}, G), E.defaultConfig),
471
+ l10n: ie
472
472
  };
473
- e.parseDate = _e({ config: e.config, l10n: e.l10n }), e._handlers = [], e.pluginElements = [], e.loadedPlugins = [], e._bind = D, e._setHoursFromDate = N, e._positionCalendar = fe, e.changeMonth = ve, e.changeYear = re, e.clear = Qe, e.close = Xe, e.onMouseOver = le, e._createElement = v, e.createDay = W, e.destroy = en, e.isEnabled = B, e.jumpToDate = L, e.updateValue = H, e.open = an, e.redraw = Le, e.set = fn, e.setDate = un, e.toggle = gn;
474
- function d() {
473
+ e.parseDate = Fe({ config: e.config, l10n: e.l10n }), e._handlers = [], e.pluginElements = [], e.loadedPlugins = [], e._bind = D, e._setHoursFromDate = N, e._positionCalendar = de, e.changeMonth = be, e.changeYear = le, e.clear = tn, e.close = an, e.onMouseOver = fe, e._createElement = v, e.createDay = J, e.destroy = rn, e.isEnabled = z, e.jumpToDate = j, e.updateValue = H, e.open = un, e.redraw = Le, e.set = cn, e.setDate = gn, e.toggle = vn;
474
+ function s() {
475
475
  e.utils = {
476
476
  getDaysInMonth: function(n, t) {
477
477
  return n === void 0 && (n = e.currentMonth), t === void 0 && (t = e.currentYear), n === 1 && (t % 4 === 0 && t % 100 !== 0 || t % 400 === 0) ? 29 : e.l10n.daysInMonth[n];
478
478
  }
479
479
  };
480
480
  }
481
- function h() {
482
- e.element = e.input = a, e.isOpen = !1, rn(), He(), cn(), sn(), d(), e.isMobile || pe(), me(), (e.selectedDates.length || e.config.noCalendar) && (e.config.enableTime && N(e.config.noCalendar ? e.latestSelectedDateObj : void 0), H(!1)), C();
481
+ function m() {
482
+ e.element = e.input = a, e.isOpen = !1, fn(), je(), pn(), mn(), s(), e.isMobile || ve(), he(), (e.selectedDates.length || e.config.noCalendar) && (e.config.enableTime && N(e.config.noCalendar ? e.latestSelectedDateObj : void 0), H(!1)), y();
483
483
  var n = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
484
- !e.isMobile && n && fe(), M("onReady");
484
+ !e.isMobile && n && de(), M("onReady");
485
485
  }
486
486
  function g() {
487
487
  var n;
488
488
  return ((n = e.calendarContainer) === null || n === void 0 ? void 0 : n.getRootNode()).activeElement || document.activeElement;
489
489
  }
490
- function b(n) {
490
+ function w(n) {
491
491
  return n.bind(e);
492
492
  }
493
- function C() {
493
+ function y() {
494
494
  var n = e.config;
495
495
  n.weekNumbers === !1 && n.showMonths === 1 || n.noCalendar !== !0 && window.requestAnimationFrame(function() {
496
496
  if (e.calendarContainer !== void 0 && (e.calendarContainer.style.visibility = "hidden", e.calendarContainer.style.display = "block"), e.daysContainer !== void 0) {
@@ -499,19 +499,19 @@ function Fn(a, r) {
499
499
  }
500
500
  });
501
501
  }
502
- function E(n) {
502
+ function x(n) {
503
503
  if (e.selectedDates.length === 0) {
504
- var t = e.config.minDate === void 0 || F(/* @__PURE__ */ new Date(), e.config.minDate) >= 0 ? /* @__PURE__ */ new Date() : new Date(e.config.minDate.getTime()), i = Ie(e.config);
504
+ var t = e.config.minDate === void 0 || F(/* @__PURE__ */ new Date(), e.config.minDate) >= 0 ? /* @__PURE__ */ new Date() : new Date(e.config.minDate.getTime()), i = _e(e.config);
505
505
  t.setHours(i.hours, i.minutes, i.seconds, t.getMilliseconds()), e.selectedDates = [t], e.latestSelectedDateObj = t;
506
506
  }
507
- n !== void 0 && n.type !== "blur" && hn(n);
507
+ n !== void 0 && n.type !== "blur" && wn(n);
508
508
  var o = e._input.value;
509
509
  A(), H(), e._input.value !== o && e._debouncedChange();
510
510
  }
511
- function Z(n, t) {
511
+ function L(n, t) {
512
512
  return n % 12 + 12 * O(t === e.l10n.amPM[1]);
513
513
  }
514
- function y(n) {
514
+ function C(n) {
515
515
  switch (n % 24) {
516
516
  case 0:
517
517
  case 12:
@@ -523,18 +523,18 @@ function Fn(a, r) {
523
523
  function A() {
524
524
  if (!(e.hourElement === void 0 || e.minuteElement === void 0)) {
525
525
  var n = (parseInt(e.hourElement.value.slice(-2), 10) || 0) % 24, t = (parseInt(e.minuteElement.value, 10) || 0) % 60, i = e.secondElement !== void 0 ? (parseInt(e.secondElement.value, 10) || 0) % 60 : 0;
526
- e.amPM !== void 0 && (n = Z(n, e.amPM.textContent));
526
+ e.amPM !== void 0 && (n = L(n, e.amPM.textContent));
527
527
  var o = e.config.minTime !== void 0 || e.config.minDate && e.minDateHasTime && e.latestSelectedDateObj && F(e.latestSelectedDateObj, e.config.minDate, !0) === 0, l = e.config.maxTime !== void 0 || e.config.maxDate && e.maxDateHasTime && e.latestSelectedDateObj && F(e.latestSelectedDateObj, e.config.maxDate, !0) === 0;
528
528
  if (e.config.maxTime !== void 0 && e.config.minTime !== void 0 && e.config.minTime > e.config.maxTime) {
529
- var f = Te(e.config.minTime.getHours(), e.config.minTime.getMinutes(), e.config.minTime.getSeconds()), m = Te(e.config.maxTime.getHours(), e.config.maxTime.getMinutes(), e.config.maxTime.getSeconds()), s = Te(n, t, i);
530
- if (s > m && s < f) {
531
- var p = In(f);
532
- n = p[0], t = p[1], i = p[2];
529
+ var u = Ie(e.config.minTime.getHours(), e.config.minTime.getMinutes(), e.config.minTime.getSeconds()), p = Ie(e.config.maxTime.getHours(), e.config.maxTime.getMinutes(), e.config.maxTime.getSeconds()), d = Ie(n, t, i);
530
+ if (d > p && d < u) {
531
+ var h = On(u);
532
+ n = h[0], t = h[1], i = h[2];
533
533
  }
534
534
  } else {
535
535
  if (l) {
536
- var u = e.config.maxTime !== void 0 ? e.config.maxTime : e.config.maxDate;
537
- n = Math.min(n, u.getHours()), n === u.getHours() && (t = Math.min(t, u.getMinutes())), t === u.getMinutes() && (i = Math.min(i, u.getSeconds()));
536
+ var f = e.config.maxTime !== void 0 ? e.config.maxTime : e.config.maxDate;
537
+ n = Math.min(n, f.getHours()), n === f.getHours() && (t = Math.min(t, f.getMinutes())), t === f.getMinutes() && (i = Math.min(i, f.getSeconds()));
538
538
  }
539
539
  if (o) {
540
540
  var c = e.config.minTime !== void 0 ? e.config.minTime : e.config.minDate;
@@ -549,11 +549,11 @@ function Fn(a, r) {
549
549
  t && t instanceof Date && Y(t.getHours(), t.getMinutes(), t.getSeconds());
550
550
  }
551
551
  function Y(n, t, i) {
552
- e.latestSelectedDateObj !== void 0 && e.latestSelectedDateObj.setHours(n % 24, t, i || 0, 0), !(!e.hourElement || !e.minuteElement || e.isMobile) && (e.hourElement.value = I(e.config.time_24hr ? n : (12 + n) % 12 + 12 * O(n % 12 === 0)), e.minuteElement.value = I(t), e.amPM !== void 0 && (e.amPM.textContent = e.l10n.amPM[O(n >= 12)]), e.secondElement !== void 0 && (e.secondElement.value = I(i)));
552
+ e.latestSelectedDateObj !== void 0 && e.latestSelectedDateObj.setHours(n % 24, t, i || 0, 0), !(!e.hourElement || !e.minuteElement || e.isMobile) && (e.hourElement.value = S(e.config.time_24hr ? n : (12 + n) % 12 + 12 * O(n % 12 === 0)), e.minuteElement.value = S(t), e.amPM !== void 0 && (e.amPM.textContent = e.l10n.amPM[O(n >= 12)]), e.secondElement !== void 0 && (e.secondElement.value = S(i)));
553
553
  }
554
- function ae(n) {
554
+ function re(n) {
555
555
  var t = _(n), i = parseInt(t.value) + (n.delta || 0);
556
- (i / 1e3 > 1 || n.key === "Enter" && !/[^\d]/.test(i.toString())) && re(i);
556
+ (i / 1e3 > 1 || n.key === "Enter" && !/[^\d]/.test(i.toString())) && le(i);
557
557
  }
558
558
  function D(n, t, i, o) {
559
559
  if (t instanceof Array)
@@ -570,113 +570,113 @@ function Fn(a, r) {
570
570
  }
571
571
  });
572
572
  }
573
- function j() {
573
+ function R() {
574
574
  M("onChange");
575
575
  }
576
- function me() {
576
+ function he() {
577
577
  if (e.config.wrap && ["open", "close", "toggle", "clear"].forEach(function(i) {
578
578
  Array.prototype.forEach.call(e.element.querySelectorAll("[data-" + i + "]"), function(o) {
579
579
  return D(o, "click", e[i]);
580
580
  });
581
581
  }), e.isMobile) {
582
- dn();
582
+ hn();
583
583
  return;
584
584
  }
585
- var n = Ke(tn, 50);
586
- if (e._debouncedChange = Ke(j, _n), e.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && D(e.daysContainer, "mouseover", function(i) {
587
- e.config.mode === "range" && le(_(i));
588
- }), D(e._input, "keydown", Ne), e.calendarContainer !== void 0 && D(e.calendarContainer, "keydown", Ne), !e.config.inline && !e.config.static && D(window, "resize", n), window.ontouchstart !== void 0 ? D(window.document, "touchstart", De) : D(window.document, "mousedown", De), D(window.document, "focus", De, { capture: !0 }), e.config.clickOpens === !0 && (D(e._input, "focus", e.open), D(e._input, "click", e.open)), e.daysContainer !== void 0 && (D(e.monthNav, "click", pn), D(e.monthNav, ["keyup", "increment"], ae), D(e.daysContainer, "click", je)), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0) {
585
+ var n = Be(ln, 50);
586
+ if (e._debouncedChange = Be(R, Nn), e.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent) && D(e.daysContainer, "mouseover", function(i) {
587
+ e.config.mode === "range" && fe(_(i));
588
+ }), D(e._input, "keydown", Pe), e.calendarContainer !== void 0 && D(e.calendarContainer, "keydown", Pe), !e.config.inline && !e.config.static && D(window, "resize", n), window.ontouchstart !== void 0 ? D(window.document, "touchstart", we) : D(window.document, "mousedown", we), D(window.document, "focus", we, { capture: !0 }), e.config.clickOpens === !0 && (D(e._input, "focus", e.open), D(e._input, "click", e.open)), e.daysContainer !== void 0 && (D(e.monthNav, "click", bn), D(e.monthNav, ["keyup", "increment"], re), D(e.daysContainer, "click", Re)), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0) {
589
589
  var t = function(i) {
590
590
  return _(i).select();
591
591
  };
592
- D(e.timeContainer, ["increment"], E), D(e.timeContainer, "blur", E, { capture: !0 }), D(e.timeContainer, "click", R), D([e.hourElement, e.minuteElement], ["focus", "click"], t), e.secondElement !== void 0 && D(e.secondElement, "focus", function() {
592
+ D(e.timeContainer, ["increment"], x), D(e.timeContainer, "blur", x, { capture: !0 }), D(e.timeContainer, "click", W), D([e.hourElement, e.minuteElement], ["focus", "click"], t), e.secondElement !== void 0 && D(e.secondElement, "focus", function() {
593
593
  return e.secondElement && e.secondElement.select();
594
594
  }), e.amPM !== void 0 && D(e.amPM, "click", function(i) {
595
- E(i);
595
+ x(i);
596
596
  });
597
597
  }
598
- e.config.allowInput && D(e._input, "blur", nn);
598
+ e.config.allowInput && D(e._input, "blur", on);
599
599
  }
600
- function L(n, t) {
600
+ function j(n, t) {
601
601
  var i = n !== void 0 ? e.parseDate(n) : e.latestSelectedDateObj || (e.config.minDate && e.config.minDate > e.now ? e.config.minDate : e.config.maxDate && e.config.maxDate < e.now ? e.config.maxDate : e.now), o = e.currentYear, l = e.currentMonth;
602
602
  try {
603
603
  i !== void 0 && (e.currentYear = i.getFullYear(), e.currentMonth = i.getMonth());
604
- } catch (f) {
605
- f.message = "Invalid date supplied: " + i, e.config.errorHandler(f);
604
+ } catch (u) {
605
+ u.message = "Invalid date supplied: " + i, e.config.errorHandler(u);
606
606
  }
607
607
  t && e.currentYear !== o && (M("onYearChange"), V()), t && (e.currentYear !== o || e.currentMonth !== l) && M("onMonthChange"), e.redraw();
608
608
  }
609
- function R(n) {
609
+ function W(n) {
610
610
  var t = _(n);
611
- ~t.className.indexOf("arrow") && J(n, t.classList.contains("arrowUp") ? 1 : -1);
611
+ ~t.className.indexOf("arrow") && K(n, t.classList.contains("arrowUp") ? 1 : -1);
612
612
  }
613
- function J(n, t, i) {
614
- var o = n && _(n), l = i || o && o.parentNode && o.parentNode.firstChild, f = be("increment");
615
- f.delta = t, l && l.dispatchEvent(f);
613
+ function K(n, t, i) {
614
+ var o = n && _(n), l = i || o && o.parentNode && o.parentNode.firstChild, u = ye("increment");
615
+ u.delta = t, l && l.dispatchEvent(u);
616
616
  }
617
- function pe() {
617
+ function ve() {
618
618
  var n = window.document.createDocumentFragment();
619
619
  if (e.calendarContainer = v("div", "flatpickr-calendar"), e.calendarContainer.tabIndex = -1, !e.config.noCalendar) {
620
- if (n.appendChild($e()), e.innerContainer = v("div", "flatpickr-innerContainer"), e.config.weekNumbers) {
621
- var t = Ze(), i = t.weekWrapper, o = t.weekNumbers;
620
+ if (n.appendChild(Xe()), e.innerContainer = v("div", "flatpickr-innerContainer"), e.config.weekNumbers) {
621
+ var t = nn(), i = t.weekWrapper, o = t.weekNumbers;
622
622
  e.innerContainer.appendChild(i), e.weekNumbers = o, e.weekWrapper = i;
623
623
  }
624
- e.rContainer = v("div", "flatpickr-rContainer"), e.rContainer.appendChild(Oe()), e.daysContainer || (e.daysContainer = v("div", "flatpickr-days"), e.daysContainer.tabIndex = -1), ie(), e.rContainer.appendChild(e.daysContainer), e.innerContainer.appendChild(e.rContainer), n.appendChild(e.innerContainer);
624
+ e.rContainer = v("div", "flatpickr-rContainer"), e.rContainer.appendChild(Ae()), e.daysContainer || (e.daysContainer = v("div", "flatpickr-days"), e.daysContainer.tabIndex = -1), oe(), e.rContainer.appendChild(e.daysContainer), e.innerContainer.appendChild(e.rContainer), n.appendChild(e.innerContainer);
625
625
  }
626
- e.config.enableTime && n.appendChild(Ge()), T(e.calendarContainer, "rangeMode", e.config.mode === "range"), T(e.calendarContainer, "animate", e.config.animate === !0), T(e.calendarContainer, "multiMonth", e.config.showMonths > 1), e.calendarContainer.appendChild(n);
626
+ e.config.enableTime && n.appendChild(en()), T(e.calendarContainer, "rangeMode", e.config.mode === "range"), T(e.calendarContainer, "animate", e.config.animate === !0), T(e.calendarContainer, "multiMonth", e.config.showMonths > 1), e.calendarContainer.appendChild(n);
627
627
  var l = e.config.appendTo !== void 0 && e.config.appendTo.nodeType !== void 0;
628
628
  if ((e.config.inline || e.config.static) && (e.calendarContainer.classList.add(e.config.inline ? "inline" : "static"), e.config.inline && (!l && e.element.parentNode ? e.element.parentNode.insertBefore(e.calendarContainer, e._input.nextSibling) : e.config.appendTo !== void 0 && e.config.appendTo.appendChild(e.calendarContainer)), e.config.static)) {
629
- var f = v("div", "flatpickr-wrapper");
630
- e.element.parentNode && e.element.parentNode.insertBefore(f, e.element), f.appendChild(e.element), e.altInput && f.appendChild(e.altInput), f.appendChild(e.calendarContainer);
629
+ var u = v("div", "flatpickr-wrapper");
630
+ e.element.parentNode && e.element.parentNode.insertBefore(u, e.element), u.appendChild(e.element), e.altInput && u.appendChild(e.altInput), u.appendChild(e.calendarContainer);
631
631
  }
632
632
  !e.config.static && !e.config.inline && (e.config.appendTo !== void 0 ? e.config.appendTo : window.document.body).appendChild(e.calendarContainer);
633
633
  }
634
- function W(n, t, i, o) {
635
- var l = B(t, !0), f = v("span", n, t.getDate().toString());
636
- return f.dateObj = t, f.$i = o, f.setAttribute("aria-label", e.formatDate(t, e.config.ariaDateFormat)), n.indexOf("hidden") === -1 && F(t, e.now) === 0 && (e.todayDateElem = f, f.classList.add("today"), f.setAttribute("aria-current", "date")), l ? (f.tabIndex = -1, Me(t) && (f.classList.add("selected"), e.selectedDateElem = f, e.config.mode === "range" && (T(f, "startRange", e.selectedDates[0] && F(t, e.selectedDates[0], !0) === 0), T(f, "endRange", e.selectedDates[1] && F(t, e.selectedDates[1], !0) === 0), n === "nextMonthDay" && f.classList.add("inRange")))) : f.classList.add("flatpickr-disabled"), e.config.mode === "range" && mn(t) && !Me(t) && f.classList.add("inRange"), e.weekNumbers && e.config.showMonths === 1 && n !== "prevMonthDay" && o % 7 === 6 && e.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + e.config.getWeek(t) + "</span>"), M("onDayCreate", f), f;
637
- }
638
- function U(n) {
639
- n.focus(), e.config.mode === "range" && le(n);
634
+ function J(n, t, i, o) {
635
+ var l = z(t, !0), u = v("span", n, t.getDate().toString());
636
+ return u.dateObj = t, u.$i = o, u.setAttribute("aria-label", e.formatDate(t, e.config.ariaDateFormat)), n.indexOf("hidden") === -1 && F(t, e.now) === 0 && (e.todayDateElem = u, u.classList.add("today"), u.setAttribute("aria-current", "date")), l ? (u.tabIndex = -1, Ce(t) && (u.classList.add("selected"), e.selectedDateElem = u, e.config.mode === "range" && (T(u, "startRange", e.selectedDates[0] && F(t, e.selectedDates[0], !0) === 0), T(u, "endRange", e.selectedDates[1] && F(t, e.selectedDates[1], !0) === 0), n === "nextMonthDay" && u.classList.add("inRange")))) : u.classList.add("flatpickr-disabled"), e.config.mode === "range" && Dn(t) && !Ce(t) && u.classList.add("inRange"), e.weekNumbers && e.config.showMonths === 1 && n !== "prevMonthDay" && o % 7 === 6 && e.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + e.config.getWeek(t) + "</span>"), M("onDayCreate", u), u;
640
637
  }
641
638
  function q(n) {
639
+ n.focus(), e.config.mode === "range" && fe(n);
640
+ }
641
+ function U(n) {
642
642
  for (var t = n > 0 ? 0 : e.config.showMonths - 1, i = n > 0 ? e.config.showMonths : -1, o = t; o != i; o += n)
643
- for (var l = e.daysContainer.children[o], f = n > 0 ? 0 : l.children.length - 1, m = n > 0 ? l.children.length : -1, s = f; s != m; s += n) {
644
- var p = l.children[s];
645
- if (p.className.indexOf("hidden") === -1 && B(p.dateObj))
646
- return p;
643
+ for (var l = e.daysContainer.children[o], u = n > 0 ? 0 : l.children.length - 1, p = n > 0 ? l.children.length : -1, d = u; d != p; d += n) {
644
+ var h = l.children[d];
645
+ if (h.className.indexOf("hidden") === -1 && z(h.dateObj))
646
+ return h;
647
647
  }
648
648
  }
649
- function he(n, t) {
650
- for (var i = n.className.indexOf("Month") === -1 ? n.dateObj.getMonth() : e.currentMonth, o = t > 0 ? e.config.showMonths : -1, l = t > 0 ? 1 : -1, f = i - e.currentMonth; f != o; f += l)
651
- for (var m = e.daysContainer.children[f], s = i - e.currentMonth === f ? n.$i + t : t < 0 ? m.children.length - 1 : 0, p = m.children.length, u = s; u >= 0 && u < p && u != (t > 0 ? p : -1); u += l) {
652
- var c = m.children[u];
653
- if (c.className.indexOf("hidden") === -1 && B(c.dateObj) && Math.abs(n.$i - u) >= Math.abs(t))
654
- return U(c);
649
+ function De(n, t) {
650
+ for (var i = n.className.indexOf("Month") === -1 ? n.dateObj.getMonth() : e.currentMonth, o = t > 0 ? e.config.showMonths : -1, l = t > 0 ? 1 : -1, u = i - e.currentMonth; u != o; u += l)
651
+ for (var p = e.daysContainer.children[u], d = i - e.currentMonth === u ? n.$i + t : t < 0 ? p.children.length - 1 : 0, h = p.children.length, f = d; f >= 0 && f < h && f != (t > 0 ? h : -1); f += l) {
652
+ var c = p.children[f];
653
+ if (c.className.indexOf("hidden") === -1 && z(c.dateObj) && Math.abs(n.$i - f) >= Math.abs(t))
654
+ return q(c);
655
655
  }
656
- e.changeMonth(l), Q(q(l), 0);
656
+ e.changeMonth(l), Q(U(l), 0);
657
657
  }
658
658
  function Q(n, t) {
659
- var i = g(), o = oe(i || document.body), l = n !== void 0 ? n : o ? i : e.selectedDateElem !== void 0 && oe(e.selectedDateElem) ? e.selectedDateElem : e.todayDateElem !== void 0 && oe(e.todayDateElem) ? e.todayDateElem : q(t > 0 ? 1 : -1);
660
- l === void 0 ? e._input.focus() : o ? he(l, t) : U(l);
661
- }
662
- function Ve(n, t) {
663
- for (var i = (new Date(n, t, 1).getDay() - e.l10n.firstDayOfWeek + 7) % 7, o = e.utils.getDaysInMonth((t - 1 + 12) % 12, n), l = e.utils.getDaysInMonth(t, n), f = window.document.createDocumentFragment(), m = e.config.showMonths > 1, s = m ? "prevMonthDay hidden" : "prevMonthDay", p = m ? "nextMonthDay hidden" : "nextMonthDay", u = o + 1 - i, c = 0; u <= o; u++, c++)
664
- f.appendChild(W("flatpickr-day " + s, new Date(n, t - 1, u), u, c));
665
- for (u = 1; u <= l; u++, c++)
666
- f.appendChild(W("flatpickr-day", new Date(n, t, u), u, c));
667
- for (var w = l + 1; w <= 42 - i && (e.config.showMonths === 1 || c % 7 !== 0); w++, c++)
668
- f.appendChild(W("flatpickr-day " + p, new Date(n, t + 1, w % l), w, c));
659
+ var i = g(), o = ue(i || document.body), l = n !== void 0 ? n : o ? i : e.selectedDateElem !== void 0 && ue(e.selectedDateElem) ? e.selectedDateElem : e.todayDateElem !== void 0 && ue(e.todayDateElem) ? e.todayDateElem : U(t > 0 ? 1 : -1);
660
+ l === void 0 ? e._input.focus() : o ? De(l, t) : q(l);
661
+ }
662
+ function $e(n, t) {
663
+ for (var i = (new Date(n, t, 1).getDay() - e.l10n.firstDayOfWeek + 7) % 7, o = e.utils.getDaysInMonth((t - 1 + 12) % 12, n), l = e.utils.getDaysInMonth(t, n), u = window.document.createDocumentFragment(), p = e.config.showMonths > 1, d = p ? "prevMonthDay hidden" : "prevMonthDay", h = p ? "nextMonthDay hidden" : "nextMonthDay", f = o + 1 - i, c = 0; f <= o; f++, c++)
664
+ u.appendChild(J("flatpickr-day " + d, new Date(n, t - 1, f), f, c));
665
+ for (f = 1; f <= l; f++, c++)
666
+ u.appendChild(J("flatpickr-day", new Date(n, t, f), f, c));
667
+ for (var b = l + 1; b <= 42 - i && (e.config.showMonths === 1 || c % 7 !== 0); b++, c++)
668
+ u.appendChild(J("flatpickr-day " + h, new Date(n, t + 1, b % l), b, c));
669
669
  var P = v("div", "dayContainer");
670
- return P.appendChild(f), P;
670
+ return P.appendChild(u), P;
671
671
  }
672
- function ie() {
672
+ function oe() {
673
673
  if (e.daysContainer !== void 0) {
674
- ce(e.daysContainer), e.weekNumbers && ce(e.weekNumbers);
674
+ ge(e.daysContainer), e.weekNumbers && ge(e.weekNumbers);
675
675
  for (var n = document.createDocumentFragment(), t = 0; t < e.config.showMonths; t++) {
676
676
  var i = new Date(e.currentYear, e.currentMonth, 1);
677
- i.setMonth(e.currentMonth + t), n.appendChild(Ve(i.getFullYear(), i.getMonth()));
677
+ i.setMonth(e.currentMonth + t), n.appendChild($e(i.getFullYear(), i.getMonth()));
678
678
  }
679
- e.daysContainer.appendChild(n), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 && le();
679
+ e.daysContainer.appendChild(n), e.days = e.daysContainer.firstChild, e.config.mode === "range" && e.selectedDates.length === 1 && fe();
680
680
  }
681
681
  }
682
682
  function V() {
@@ -688,35 +688,35 @@ function Fn(a, r) {
688
688
  for (var t = 0; t < 12; t++)
689
689
  if (n(t)) {
690
690
  var i = v("option", "flatpickr-monthDropdown-month");
691
- i.value = new Date(e.currentYear, t).getMonth().toString(), i.textContent = ge(t, e.config.shorthandCurrentMonth, e.l10n), i.tabIndex = -1, e.currentMonth === t && (i.selected = !0), e.monthsDropdownContainer.appendChild(i);
691
+ i.value = new Date(e.currentYear, t).getMonth().toString(), i.textContent = pe(t, e.config.shorthandCurrentMonth, e.l10n), i.tabIndex = -1, e.currentMonth === t && (i.selected = !0), e.monthsDropdownContainer.appendChild(i);
692
692
  }
693
693
  }
694
694
  }
695
- function ze() {
695
+ function Qe() {
696
696
  var n = v("div", "flatpickr-month"), t = window.document.createDocumentFragment(), i;
697
- e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? i = v("span", "cur-month") : (e.monthsDropdownContainer = v("select", "flatpickr-monthDropdown-months"), e.monthsDropdownContainer.setAttribute("aria-label", e.l10n.monthAriaLabel), D(e.monthsDropdownContainer, "change", function(m) {
698
- var s = _(m), p = parseInt(s.value, 10);
699
- e.changeMonth(p - e.currentMonth), M("onMonthChange");
697
+ e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? i = v("span", "cur-month") : (e.monthsDropdownContainer = v("select", "flatpickr-monthDropdown-months"), e.monthsDropdownContainer.setAttribute("aria-label", e.l10n.monthAriaLabel), D(e.monthsDropdownContainer, "change", function(p) {
698
+ var d = _(p), h = parseInt(d.value, 10);
699
+ e.changeMonth(h - e.currentMonth), M("onMonthChange");
700
700
  }), V(), i = e.monthsDropdownContainer);
701
- var o = de("cur-year", { tabindex: "-1" }), l = o.getElementsByTagName("input")[0];
701
+ var o = me("cur-year", { tabindex: "-1" }), l = o.getElementsByTagName("input")[0];
702
702
  l.setAttribute("aria-label", e.l10n.yearAriaLabel), e.config.minDate && l.setAttribute("min", e.config.minDate.getFullYear().toString()), e.config.maxDate && (l.setAttribute("max", e.config.maxDate.getFullYear().toString()), l.disabled = !!e.config.minDate && e.config.minDate.getFullYear() === e.config.maxDate.getFullYear());
703
- var f = v("div", "flatpickr-current-month");
704
- return f.appendChild(i), f.appendChild(o), t.appendChild(f), n.appendChild(t), {
703
+ var u = v("div", "flatpickr-current-month");
704
+ return u.appendChild(i), u.appendChild(o), t.appendChild(u), n.appendChild(t), {
705
705
  container: n,
706
706
  yearElement: l,
707
707
  monthElement: i
708
708
  };
709
709
  }
710
- function Fe() {
711
- ce(e.monthNav), e.monthNav.appendChild(e.prevMonthNav), e.config.showMonths && (e.yearElements = [], e.monthElements = []);
710
+ function Oe() {
711
+ ge(e.monthNav), e.monthNav.appendChild(e.prevMonthNav), e.config.showMonths && (e.yearElements = [], e.monthElements = []);
712
712
  for (var n = e.config.showMonths; n--; ) {
713
- var t = ze();
713
+ var t = Qe();
714
714
  e.yearElements.push(t.yearElement), e.monthElements.push(t.monthElement), e.monthNav.appendChild(t.container);
715
715
  }
716
716
  e.monthNav.appendChild(e.nextMonthNav);
717
717
  }
718
- function $e() {
719
- return e.monthNav = v("div", "flatpickr-months"), e.yearElements = [], e.monthElements = [], e.prevMonthNav = v("span", "flatpickr-prev-month"), e.prevMonthNav.innerHTML = e.config.prevArrow, e.nextMonthNav = v("span", "flatpickr-next-month"), e.nextMonthNav.innerHTML = e.config.nextArrow, Fe(), Object.defineProperty(e, "_hidePrevMonthArrow", {
718
+ function Xe() {
719
+ return e.monthNav = v("div", "flatpickr-months"), e.yearElements = [], e.monthElements = [], e.prevMonthNav = v("span", "flatpickr-prev-month"), e.prevMonthNav.innerHTML = e.config.prevArrow, e.nextMonthNav = v("span", "flatpickr-next-month"), e.nextMonthNav.innerHTML = e.config.nextArrow, Oe(), Object.defineProperty(e, "_hidePrevMonthArrow", {
720
720
  get: function() {
721
721
  return e.__hidePrevMonthArrow;
722
722
  },
@@ -730,38 +730,38 @@ function Fn(a, r) {
730
730
  set: function(n) {
731
731
  e.__hideNextMonthArrow !== n && (T(e.nextMonthNav, "flatpickr-disabled", n), e.__hideNextMonthArrow = n);
732
732
  }
733
- }), e.currentYearElement = e.yearElements[0], se(), e.monthNav;
733
+ }), e.currentYearElement = e.yearElements[0], ce(), e.monthNav;
734
734
  }
735
- function Ge() {
735
+ function en() {
736
736
  e.calendarContainer.classList.add("hasTime"), e.config.noCalendar && e.calendarContainer.classList.add("noCalendar");
737
- var n = Ie(e.config);
737
+ var n = _e(e.config);
738
738
  e.timeContainer = v("div", "flatpickr-time"), e.timeContainer.tabIndex = -1;
739
- var t = v("span", "flatpickr-time-separator", ":"), i = de("flatpickr-hour", {
739
+ var t = v("span", "flatpickr-time-separator", ":"), i = me("flatpickr-hour", {
740
740
  "aria-label": e.l10n.hourAriaLabel
741
741
  });
742
742
  e.hourElement = i.getElementsByTagName("input")[0];
743
- var o = de("flatpickr-minute", {
743
+ var o = me("flatpickr-minute", {
744
744
  "aria-label": e.l10n.minuteAriaLabel
745
745
  });
746
- if (e.minuteElement = o.getElementsByTagName("input")[0], e.hourElement.tabIndex = e.minuteElement.tabIndex = -1, e.hourElement.value = I(e.latestSelectedDateObj ? e.latestSelectedDateObj.getHours() : e.config.time_24hr ? n.hours : y(n.hours)), e.minuteElement.value = I(e.latestSelectedDateObj ? e.latestSelectedDateObj.getMinutes() : n.minutes), e.hourElement.setAttribute("step", e.config.hourIncrement.toString()), e.minuteElement.setAttribute("step", e.config.minuteIncrement.toString()), e.hourElement.setAttribute("min", e.config.time_24hr ? "0" : "1"), e.hourElement.setAttribute("max", e.config.time_24hr ? "23" : "12"), e.hourElement.setAttribute("maxlength", "2"), e.minuteElement.setAttribute("min", "0"), e.minuteElement.setAttribute("max", "59"), e.minuteElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(i), e.timeContainer.appendChild(t), e.timeContainer.appendChild(o), e.config.time_24hr && e.timeContainer.classList.add("time24hr"), e.config.enableSeconds) {
746
+ if (e.minuteElement = o.getElementsByTagName("input")[0], e.hourElement.tabIndex = e.minuteElement.tabIndex = -1, e.hourElement.value = S(e.latestSelectedDateObj ? e.latestSelectedDateObj.getHours() : e.config.time_24hr ? n.hours : C(n.hours)), e.minuteElement.value = S(e.latestSelectedDateObj ? e.latestSelectedDateObj.getMinutes() : n.minutes), e.hourElement.setAttribute("step", e.config.hourIncrement.toString()), e.minuteElement.setAttribute("step", e.config.minuteIncrement.toString()), e.hourElement.setAttribute("min", e.config.time_24hr ? "0" : "1"), e.hourElement.setAttribute("max", e.config.time_24hr ? "23" : "12"), e.hourElement.setAttribute("maxlength", "2"), e.minuteElement.setAttribute("min", "0"), e.minuteElement.setAttribute("max", "59"), e.minuteElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(i), e.timeContainer.appendChild(t), e.timeContainer.appendChild(o), e.config.time_24hr && e.timeContainer.classList.add("time24hr"), e.config.enableSeconds) {
747
747
  e.timeContainer.classList.add("hasSeconds");
748
- var l = de("flatpickr-second");
749
- e.secondElement = l.getElementsByTagName("input")[0], e.secondElement.value = I(e.latestSelectedDateObj ? e.latestSelectedDateObj.getSeconds() : n.seconds), e.secondElement.setAttribute("step", e.minuteElement.getAttribute("step")), e.secondElement.setAttribute("min", "0"), e.secondElement.setAttribute("max", "59"), e.secondElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(v("span", "flatpickr-time-separator", ":")), e.timeContainer.appendChild(l);
748
+ var l = me("flatpickr-second");
749
+ e.secondElement = l.getElementsByTagName("input")[0], e.secondElement.value = S(e.latestSelectedDateObj ? e.latestSelectedDateObj.getSeconds() : n.seconds), e.secondElement.setAttribute("step", e.minuteElement.getAttribute("step")), e.secondElement.setAttribute("min", "0"), e.secondElement.setAttribute("max", "59"), e.secondElement.setAttribute("maxlength", "2"), e.timeContainer.appendChild(v("span", "flatpickr-time-separator", ":")), e.timeContainer.appendChild(l);
750
750
  }
751
751
  return e.config.time_24hr || (e.amPM = v("span", "flatpickr-am-pm", e.l10n.amPM[O((e.latestSelectedDateObj ? e.hourElement.value : e.config.defaultHour) > 11)]), e.amPM.title = e.l10n.toggleTitle, e.amPM.tabIndex = -1, e.timeContainer.appendChild(e.amPM)), e.timeContainer;
752
752
  }
753
- function Oe() {
754
- e.weekdayContainer ? ce(e.weekdayContainer) : e.weekdayContainer = v("div", "flatpickr-weekdays");
753
+ function Ae() {
754
+ e.weekdayContainer ? ge(e.weekdayContainer) : e.weekdayContainer = v("div", "flatpickr-weekdays");
755
755
  for (var n = e.config.showMonths; n--; ) {
756
756
  var t = v("div", "flatpickr-weekdaycontainer");
757
757
  e.weekdayContainer.appendChild(t);
758
758
  }
759
- return Ae(), e.weekdayContainer;
759
+ return Ne(), e.weekdayContainer;
760
760
  }
761
- function Ae() {
761
+ function Ne() {
762
762
  if (e.weekdayContainer) {
763
- var n = e.l10n.firstDayOfWeek, t = Je(e.l10n.weekdays.shorthand);
764
- n > 0 && n < t.length && (t = Je(t.splice(n, t.length), t.splice(0, n)));
763
+ var n = e.l10n.firstDayOfWeek, t = Ke(e.l10n.weekdays.shorthand);
764
+ n > 0 && n < t.length && (t = Ke(t.splice(n, t.length), t.splice(0, n)));
765
765
  for (var i = e.config.showMonths; i--; )
766
766
  e.weekdayContainer.children[i].innerHTML = `
767
767
  <span class='flatpickr-weekday'>
@@ -770,7 +770,7 @@ function Fn(a, r) {
770
770
  `;
771
771
  }
772
772
  }
773
- function Ze() {
773
+ function nn() {
774
774
  e.calendarContainer.classList.add("hasWeeks");
775
775
  var n = v("div", "flatpickr-weekwrapper");
776
776
  n.appendChild(v("span", "flatpickr-weekday", e.l10n.weekAbbreviation));
@@ -780,22 +780,22 @@ function Fn(a, r) {
780
780
  weekNumbers: t
781
781
  };
782
782
  }
783
- function ve(n, t) {
783
+ function be(n, t) {
784
784
  t === void 0 && (t = !0);
785
785
  var i = t ? n : n - e.currentMonth;
786
- i < 0 && e._hidePrevMonthArrow === !0 || i > 0 && e._hideNextMonthArrow === !0 || (e.currentMonth += i, (e.currentMonth < 0 || e.currentMonth > 11) && (e.currentYear += e.currentMonth > 11 ? 1 : -1, e.currentMonth = (e.currentMonth + 12) % 12, M("onYearChange"), V()), ie(), M("onMonthChange"), se());
786
+ i < 0 && e._hidePrevMonthArrow === !0 || i > 0 && e._hideNextMonthArrow === !0 || (e.currentMonth += i, (e.currentMonth < 0 || e.currentMonth > 11) && (e.currentYear += e.currentMonth > 11 ? 1 : -1, e.currentMonth = (e.currentMonth + 12) % 12, M("onYearChange"), V()), oe(), M("onMonthChange"), ce());
787
787
  }
788
- function Qe(n, t) {
788
+ function tn(n, t) {
789
789
  if (n === void 0 && (n = !0), t === void 0 && (t = !0), e.input.value = "", e.altInput !== void 0 && (e.altInput.value = ""), e.mobileInput !== void 0 && (e.mobileInput.value = ""), e.selectedDates = [], e.latestSelectedDateObj = void 0, t === !0 && (e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth()), e.config.enableTime === !0) {
790
- var i = Ie(e.config), o = i.hours, l = i.minutes, f = i.seconds;
791
- Y(o, l, f);
790
+ var i = _e(e.config), o = i.hours, l = i.minutes, u = i.seconds;
791
+ Y(o, l, u);
792
792
  }
793
793
  e.redraw(), n && M("onChange");
794
794
  }
795
- function Xe() {
795
+ function an() {
796
796
  e.isOpen = !1, e.isMobile || (e.calendarContainer !== void 0 && e.calendarContainer.classList.remove("open"), e._input !== void 0 && e._input.classList.remove("active")), M("onClose");
797
797
  }
798
- function en() {
798
+ function rn() {
799
799
  e.config !== void 0 && M("onDestroy");
800
800
  for (var n = e._handlers.length; n--; )
801
801
  e._handlers[n].remove();
@@ -851,21 +851,21 @@ function Fn(a, r) {
851
851
  function X(n) {
852
852
  return e.calendarContainer.contains(n);
853
853
  }
854
- function De(n) {
854
+ function we(n) {
855
855
  if (e.isOpen && !e.config.inline) {
856
- var t = _(n), i = X(t), o = t === e.input || t === e.altInput || e.element.contains(t) || n.path && n.path.indexOf && (~n.path.indexOf(e.input) || ~n.path.indexOf(e.altInput)), l = !o && !i && !X(n.relatedTarget), f = !e.config.ignoredFocusElements.some(function(m) {
857
- return m.contains(t);
856
+ var t = _(n), i = X(t), o = t === e.input || t === e.altInput || e.element.contains(t) || n.path && n.path.indexOf && (~n.path.indexOf(e.input) || ~n.path.indexOf(e.altInput)), l = !o && !i && !X(n.relatedTarget), u = !e.config.ignoredFocusElements.some(function(p) {
857
+ return p.contains(t);
858
858
  });
859
- l && f && (e.config.allowInput && e.setDate(e._input.value, !1, e.config.altInput ? e.config.altFormat : e.config.dateFormat), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0 && e.input.value !== "" && e.input.value !== void 0 && E(), e.close(), e.config && e.config.mode === "range" && e.selectedDates.length === 1 && e.clear(!1));
859
+ l && u && (e.config.allowInput && e.setDate(e._input.value, !1, e.config.altInput ? e.config.altFormat : e.config.dateFormat), e.timeContainer !== void 0 && e.minuteElement !== void 0 && e.hourElement !== void 0 && e.input.value !== "" && e.input.value !== void 0 && x(), e.close(), e.config && e.config.mode === "range" && e.selectedDates.length === 1 && e.clear(!1));
860
860
  }
861
861
  }
862
- function re(n) {
862
+ function le(n) {
863
863
  if (!(!n || e.config.minDate && n < e.config.minDate.getFullYear() || e.config.maxDate && n > e.config.maxDate.getFullYear())) {
864
864
  var t = n, i = e.currentYear !== t;
865
865
  e.currentYear = t || e.currentYear, e.config.maxDate && e.currentYear === e.config.maxDate.getFullYear() ? e.currentMonth = Math.min(e.config.maxDate.getMonth(), e.currentMonth) : e.config.minDate && e.currentYear === e.config.minDate.getFullYear() && (e.currentMonth = Math.max(e.config.minDate.getMonth(), e.currentMonth)), i && (e.redraw(), M("onYearChange"), V());
866
866
  }
867
867
  }
868
- function B(n, t) {
868
+ function z(n, t) {
869
869
  var i;
870
870
  t === void 0 && (t = !0);
871
871
  var o = e.parseDate(n, void 0, t);
@@ -875,40 +875,40 @@ function Fn(a, r) {
875
875
  return !0;
876
876
  if (o === void 0)
877
877
  return !1;
878
- for (var l = !!e.config.enable, f = (i = e.config.enable) !== null && i !== void 0 ? i : e.config.disable, m = 0, s = void 0; m < f.length; m++) {
879
- if (s = f[m], typeof s == "function" && s(o))
878
+ for (var l = !!e.config.enable, u = (i = e.config.enable) !== null && i !== void 0 ? i : e.config.disable, p = 0, d = void 0; p < u.length; p++) {
879
+ if (d = u[p], typeof d == "function" && d(o))
880
880
  return l;
881
- if (s instanceof Date && o !== void 0 && s.getTime() === o.getTime())
881
+ if (d instanceof Date && o !== void 0 && d.getTime() === o.getTime())
882
882
  return l;
883
- if (typeof s == "string") {
884
- var p = e.parseDate(s, void 0, !0);
885
- return p && p.getTime() === o.getTime() ? l : !l;
886
- } else if (typeof s == "object" && o !== void 0 && s.from && s.to && o.getTime() >= s.from.getTime() && o.getTime() <= s.to.getTime())
883
+ if (typeof d == "string") {
884
+ var h = e.parseDate(d, void 0, !0);
885
+ return h && h.getTime() === o.getTime() ? l : !l;
886
+ } else if (typeof d == "object" && o !== void 0 && d.from && d.to && o.getTime() >= d.from.getTime() && o.getTime() <= d.to.getTime())
887
887
  return l;
888
888
  }
889
889
  return !l;
890
890
  }
891
- function oe(n) {
891
+ function ue(n) {
892
892
  return e.daysContainer !== void 0 ? n.className.indexOf("hidden") === -1 && n.className.indexOf("flatpickr-disabled") === -1 && e.daysContainer.contains(n) : !1;
893
893
  }
894
- function nn(n) {
895
- var t = n.target === e._input, i = e._input.value.trimEnd() !== Ce();
894
+ function on(n) {
895
+ var t = n.target === e._input, i = e._input.value.trimEnd() !== Ee();
896
896
  t && i && !(n.relatedTarget && X(n.relatedTarget)) && e.setDate(e._input.value, !0, n.target === e.altInput ? e.config.altFormat : e.config.dateFormat);
897
897
  }
898
- function Ne(n) {
899
- var t = _(n), i = e.config.wrap ? a.contains(t) : t === e._input, o = e.config.allowInput, l = e.isOpen && (!o || !i), f = e.config.inline && i && !o;
898
+ function Pe(n) {
899
+ var t = _(n), i = e.config.wrap ? a.contains(t) : t === e._input, o = e.config.allowInput, l = e.isOpen && (!o || !i), u = e.config.inline && i && !o;
900
900
  if (n.keyCode === 13 && i) {
901
901
  if (o)
902
902
  return e.setDate(e._input.value, !0, t === e.altInput ? e.config.altFormat : e.config.dateFormat), e.close(), t.blur();
903
903
  e.open();
904
- } else if (X(t) || l || f) {
905
- var m = !!e.timeContainer && e.timeContainer.contains(t);
904
+ } else if (X(t) || l || u) {
905
+ var p = !!e.timeContainer && e.timeContainer.contains(t);
906
906
  switch (n.keyCode) {
907
907
  case 13:
908
- m ? (n.preventDefault(), E(), we()) : je(n);
908
+ p ? (n.preventDefault(), x(), Me()) : Re(n);
909
909
  break;
910
910
  case 27:
911
- n.preventDefault(), we();
911
+ n.preventDefault(), Me();
912
912
  break;
913
913
  case 8:
914
914
  case 46:
@@ -916,33 +916,33 @@ function Fn(a, r) {
916
916
  break;
917
917
  case 37:
918
918
  case 39:
919
- if (!m && !i) {
919
+ if (!p && !i) {
920
920
  n.preventDefault();
921
- var s = g();
922
- if (e.daysContainer !== void 0 && (o === !1 || s && oe(s))) {
923
- var p = n.keyCode === 39 ? 1 : -1;
924
- n.ctrlKey ? (n.stopPropagation(), ve(p), Q(q(1), 0)) : Q(void 0, p);
921
+ var d = g();
922
+ if (e.daysContainer !== void 0 && (o === !1 || d && ue(d))) {
923
+ var h = n.keyCode === 39 ? 1 : -1;
924
+ n.ctrlKey ? (n.stopPropagation(), be(h), Q(U(1), 0)) : Q(void 0, h);
925
925
  }
926
926
  } else e.hourElement && e.hourElement.focus();
927
927
  break;
928
928
  case 38:
929
929
  case 40:
930
930
  n.preventDefault();
931
- var u = n.keyCode === 40 ? 1 : -1;
932
- e.daysContainer && t.$i !== void 0 || t === e.input || t === e.altInput ? n.ctrlKey ? (n.stopPropagation(), re(e.currentYear - u), Q(q(1), 0)) : m || Q(void 0, u * 7) : t === e.currentYearElement ? re(e.currentYear - u) : e.config.enableTime && (!m && e.hourElement && e.hourElement.focus(), E(n), e._debouncedChange());
931
+ var f = n.keyCode === 40 ? 1 : -1;
932
+ e.daysContainer && t.$i !== void 0 || t === e.input || t === e.altInput ? n.ctrlKey ? (n.stopPropagation(), le(e.currentYear - f), Q(U(1), 0)) : p || Q(void 0, f * 7) : t === e.currentYearElement ? le(e.currentYear - f) : e.config.enableTime && (!p && e.hourElement && e.hourElement.focus(), x(n), e._debouncedChange());
933
933
  break;
934
934
  case 9:
935
- if (m) {
935
+ if (p) {
936
936
  var c = [
937
937
  e.hourElement,
938
938
  e.minuteElement,
939
939
  e.secondElement,
940
940
  e.amPM
941
- ].concat(e.pluginElements).filter(function(S) {
942
- return S;
943
- }), w = c.indexOf(t);
944
- if (w !== -1) {
945
- var P = c[w + (n.shiftKey ? -1 : 1)];
941
+ ].concat(e.pluginElements).filter(function(I) {
942
+ return I;
943
+ }), b = c.indexOf(t);
944
+ if (b !== -1) {
945
+ var P = c[b + (n.shiftKey ? -1 : 1)];
946
946
  n.preventDefault(), (P || e._input).focus();
947
947
  }
948
948
  } else !e.config.noCalendar && e.daysContainer && e.daysContainer.contains(t) && n.shiftKey && (n.preventDefault(), e._input.focus());
@@ -962,30 +962,30 @@ function Fn(a, r) {
962
962
  }
963
963
  (i || X(t)) && M("onKeyDown", n);
964
964
  }
965
- function le(n, t) {
965
+ function fe(n, t) {
966
966
  if (t === void 0 && (t = "flatpickr-day"), !(e.selectedDates.length !== 1 || n && (!n.classList.contains(t) || n.classList.contains("flatpickr-disabled")))) {
967
- for (var i = n ? n.dateObj.getTime() : e.days.firstElementChild.dateObj.getTime(), o = e.parseDate(e.selectedDates[0], void 0, !0).getTime(), l = Math.min(i, e.selectedDates[0].getTime()), f = Math.max(i, e.selectedDates[0].getTime()), m = !1, s = 0, p = 0, u = l; u < f; u += Sn.DAY)
968
- B(new Date(u), !0) || (m = m || u > l && u < f, u < o && (!s || u > s) ? s = u : u > o && (!p || u < p) && (p = u));
967
+ for (var i = n ? n.dateObj.getTime() : e.days.firstElementChild.dateObj.getTime(), o = e.parseDate(e.selectedDates[0], void 0, !0).getTime(), l = Math.min(i, e.selectedDates[0].getTime()), u = Math.max(i, e.selectedDates[0].getTime()), p = !1, d = 0, h = 0, f = l; f < u; f += An.DAY)
968
+ z(new Date(f), !0) || (p = p || f > l && f < u, f < o && (!d || f > d) ? d = f : f > o && (!h || f < h) && (h = f));
969
969
  var c = Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+" + e.config.showMonths + ") > ." + t));
970
- c.forEach(function(w) {
971
- var P = w.dateObj, S = P.getTime(), ee = s > 0 && S < s || p > 0 && S > p;
970
+ c.forEach(function(b) {
971
+ var P = b.dateObj, I = P.getTime(), ee = d > 0 && I < d || h > 0 && I > h;
972
972
  if (ee) {
973
- w.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach(function(z) {
974
- w.classList.remove(z);
973
+ b.classList.add("notAllowed"), ["inRange", "startRange", "endRange"].forEach(function(Z) {
974
+ b.classList.remove(Z);
975
975
  });
976
976
  return;
977
- } else if (m && !ee)
977
+ } else if (p && !ee)
978
978
  return;
979
- ["startRange", "inRange", "endRange", "notAllowed"].forEach(function(z) {
980
- w.classList.remove(z);
981
- }), n !== void 0 && (n.classList.add(i <= e.selectedDates[0].getTime() ? "startRange" : "endRange"), o < i && S === o ? w.classList.add("startRange") : o > i && S === o && w.classList.add("endRange"), S >= s && (p === 0 || S <= p) && Tn(S, o, i) && w.classList.add("inRange"));
979
+ ["startRange", "inRange", "endRange", "notAllowed"].forEach(function(Z) {
980
+ b.classList.remove(Z);
981
+ }), n !== void 0 && (n.classList.add(i <= e.selectedDates[0].getTime() ? "startRange" : "endRange"), o < i && I === o ? b.classList.add("startRange") : o > i && I === o && b.classList.add("endRange"), I >= d && (h === 0 || I <= h) && Fn(I, o, i) && b.classList.add("inRange"));
982
982
  });
983
983
  }
984
984
  }
985
- function tn() {
986
- e.isOpen && !e.config.static && !e.config.inline && fe();
985
+ function ln() {
986
+ e.isOpen && !e.config.static && !e.config.inline && de();
987
987
  }
988
- function an(n, t) {
988
+ function un(n, t) {
989
989
  if (t === void 0 && (t = e._positionElement), e.isMobile === !0) {
990
990
  if (n) {
991
991
  n.preventDefault();
@@ -997,19 +997,19 @@ function Fn(a, r) {
997
997
  } else if (e._input.disabled || e.config.inline)
998
998
  return;
999
999
  var o = e.isOpen;
1000
- e.isOpen = !0, o || (e.calendarContainer.classList.add("open"), e._input.classList.add("active"), M("onOpen"), fe(t)), e.config.enableTime === !0 && e.config.noCalendar === !0 && e.config.allowInput === !1 && (n === void 0 || !e.timeContainer.contains(n.relatedTarget)) && setTimeout(function() {
1000
+ e.isOpen = !0, o || (e.calendarContainer.classList.add("open"), e._input.classList.add("active"), M("onOpen"), de(t)), e.config.enableTime === !0 && e.config.noCalendar === !0 && e.config.allowInput === !1 && (n === void 0 || !e.timeContainer.contains(n.relatedTarget)) && setTimeout(function() {
1001
1001
  return e.hourElement.select();
1002
1002
  }, 50);
1003
1003
  }
1004
- function Pe(n) {
1004
+ function Ye(n) {
1005
1005
  return function(t) {
1006
1006
  var i = e.config["_" + n + "Date"] = e.parseDate(t, e.config.dateFormat), o = e.config["_" + (n === "min" ? "max" : "min") + "Date"];
1007
1007
  i !== void 0 && (e[n === "min" ? "minDateHasTime" : "maxDateHasTime"] = i.getHours() > 0 || i.getMinutes() > 0 || i.getSeconds() > 0), e.selectedDates && (e.selectedDates = e.selectedDates.filter(function(l) {
1008
- return B(l);
1008
+ return z(l);
1009
1009
  }), !e.selectedDates.length && n === "min" && N(i), H()), e.daysContainer && (Le(), i !== void 0 ? e.currentYearElement[n] = i.getFullYear().toString() : e.currentYearElement.removeAttribute(n), e.currentYearElement.disabled = !!o && i !== void 0 && o.getFullYear() === i.getFullYear());
1010
1010
  };
1011
1011
  }
1012
- function rn() {
1012
+ function fn() {
1013
1013
  var n = [
1014
1014
  "wrap",
1015
1015
  "weekNumbers",
@@ -1031,102 +1031,102 @@ function Fn(a, r) {
1031
1031
  return e.config._enable;
1032
1032
  },
1033
1033
  set: function(c) {
1034
- e.config._enable = We(c);
1034
+ e.config._enable = Je(c);
1035
1035
  }
1036
1036
  }), Object.defineProperty(e.config, "disable", {
1037
1037
  get: function() {
1038
1038
  return e.config._disable;
1039
1039
  },
1040
1040
  set: function(c) {
1041
- e.config._disable = We(c);
1041
+ e.config._disable = Je(c);
1042
1042
  }
1043
1043
  });
1044
1044
  var o = t.mode === "time";
1045
1045
  if (!t.dateFormat && (t.enableTime || o)) {
1046
- var l = x.defaultConfig.dateFormat || $.dateFormat;
1046
+ var l = E.defaultConfig.dateFormat || G.dateFormat;
1047
1047
  i.dateFormat = t.noCalendar || o ? "H:i" + (t.enableSeconds ? ":S" : "") : l + " H:i" + (t.enableSeconds ? ":S" : "");
1048
1048
  }
1049
1049
  if (t.altInput && (t.enableTime || o) && !t.altFormat) {
1050
- var f = x.defaultConfig.altFormat || $.altFormat;
1051
- i.altFormat = t.noCalendar || o ? "h:i" + (t.enableSeconds ? ":S K" : " K") : f + (" h:i" + (t.enableSeconds ? ":S" : "") + " K");
1050
+ var u = E.defaultConfig.altFormat || G.altFormat;
1051
+ i.altFormat = t.noCalendar || o ? "h:i" + (t.enableSeconds ? ":S K" : " K") : u + (" h:i" + (t.enableSeconds ? ":S" : "") + " K");
1052
1052
  }
1053
1053
  Object.defineProperty(e.config, "minDate", {
1054
1054
  get: function() {
1055
1055
  return e.config._minDate;
1056
1056
  },
1057
- set: Pe("min")
1057
+ set: Ye("min")
1058
1058
  }), Object.defineProperty(e.config, "maxDate", {
1059
1059
  get: function() {
1060
1060
  return e.config._maxDate;
1061
1061
  },
1062
- set: Pe("max")
1062
+ set: Ye("max")
1063
1063
  });
1064
- var m = function(c) {
1065
- return function(w) {
1066
- e.config[c === "min" ? "_minTime" : "_maxTime"] = e.parseDate(w, "H:i:S");
1064
+ var p = function(c) {
1065
+ return function(b) {
1066
+ e.config[c === "min" ? "_minTime" : "_maxTime"] = e.parseDate(b, "H:i:S");
1067
1067
  };
1068
1068
  };
1069
1069
  Object.defineProperty(e.config, "minTime", {
1070
1070
  get: function() {
1071
1071
  return e.config._minTime;
1072
1072
  },
1073
- set: m("min")
1073
+ set: p("min")
1074
1074
  }), Object.defineProperty(e.config, "maxTime", {
1075
1075
  get: function() {
1076
1076
  return e.config._maxTime;
1077
1077
  },
1078
- set: m("max")
1078
+ set: p("max")
1079
1079
  }), t.mode === "time" && (e.config.noCalendar = !0, e.config.enableTime = !0), Object.assign(e.config, i, t);
1080
- for (var s = 0; s < n.length; s++)
1081
- e.config[n[s]] = e.config[n[s]] === !0 || e.config[n[s]] === "true";
1082
- xe.filter(function(c) {
1080
+ for (var d = 0; d < n.length; d++)
1081
+ e.config[n[d]] = e.config[n[d]] === !0 || e.config[n[d]] === "true";
1082
+ ke.filter(function(c) {
1083
1083
  return e.config[c] !== void 0;
1084
1084
  }).forEach(function(c) {
1085
- e.config[c] = Ee(e.config[c] || []).map(b);
1085
+ e.config[c] = Te(e.config[c] || []).map(w);
1086
1086
  }), e.isMobile = !e.config.disableMobile && !e.config.inline && e.config.mode === "single" && !e.config.disable.length && !e.config.enable && !e.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1087
- for (var s = 0; s < e.config.plugins.length; s++) {
1088
- var p = e.config.plugins[s](e) || {};
1089
- for (var u in p)
1090
- xe.indexOf(u) > -1 ? e.config[u] = Ee(p[u]).map(b).concat(e.config[u]) : typeof t[u] > "u" && (e.config[u] = p[u]);
1087
+ for (var d = 0; d < e.config.plugins.length; d++) {
1088
+ var h = e.config.plugins[d](e) || {};
1089
+ for (var f in h)
1090
+ ke.indexOf(f) > -1 ? e.config[f] = Te(h[f]).map(w).concat(e.config[f]) : typeof t[f] > "u" && (e.config[f] = h[f]);
1091
1091
  }
1092
- t.altInputClass || (e.config.altInputClass = Ye().className + " " + e.config.altInputClass), M("onParseConfig");
1092
+ t.altInputClass || (e.config.altInputClass = He().className + " " + e.config.altInputClass), M("onParseConfig");
1093
1093
  }
1094
- function Ye() {
1094
+ function He() {
1095
1095
  return e.config.wrap ? a.querySelector("[data-input]") : a;
1096
1096
  }
1097
- function He() {
1098
- typeof e.config.locale != "object" && typeof x.l10ns[e.config.locale] > "u" && e.config.errorHandler(new Error("flatpickr: invalid locale " + e.config.locale)), e.l10n = k(k({}, x.l10ns.default), typeof e.config.locale == "object" ? e.config.locale : e.config.locale !== "default" ? x.l10ns[e.config.locale] : void 0), K.D = "(" + e.l10n.weekdays.shorthand.join("|") + ")", K.l = "(" + e.l10n.weekdays.longhand.join("|") + ")", K.M = "(" + e.l10n.months.shorthand.join("|") + ")", K.F = "(" + e.l10n.months.longhand.join("|") + ")", K.K = "(" + e.l10n.amPM[0] + "|" + e.l10n.amPM[1] + "|" + e.l10n.amPM[0].toLowerCase() + "|" + e.l10n.amPM[1].toLowerCase() + ")";
1097
+ function je() {
1098
+ typeof e.config.locale != "object" && typeof E.l10ns[e.config.locale] > "u" && e.config.errorHandler(new Error("flatpickr: invalid locale " + e.config.locale)), e.l10n = k(k({}, E.l10ns.default), typeof e.config.locale == "object" ? e.config.locale : e.config.locale !== "default" ? E.l10ns[e.config.locale] : void 0), B.D = "(" + e.l10n.weekdays.shorthand.join("|") + ")", B.l = "(" + e.l10n.weekdays.longhand.join("|") + ")", B.M = "(" + e.l10n.months.shorthand.join("|") + ")", B.F = "(" + e.l10n.months.longhand.join("|") + ")", B.K = "(" + e.l10n.amPM[0] + "|" + e.l10n.amPM[1] + "|" + e.l10n.amPM[0].toLowerCase() + "|" + e.l10n.amPM[1].toLowerCase() + ")";
1099
1099
  var n = k(k({}, r), JSON.parse(JSON.stringify(a.dataset || {})));
1100
- n.time_24hr === void 0 && x.defaultConfig.time_24hr === void 0 && (e.config.time_24hr = e.l10n.time_24hr), e.formatDate = qe(e), e.parseDate = _e({ config: e.config, l10n: e.l10n });
1100
+ n.time_24hr === void 0 && E.defaultConfig.time_24hr === void 0 && (e.config.time_24hr = e.l10n.time_24hr), e.formatDate = Ze(e), e.parseDate = Fe({ config: e.config, l10n: e.l10n });
1101
1101
  }
1102
- function fe(n) {
1102
+ function de(n) {
1103
1103
  if (typeof e.config.position == "function")
1104
1104
  return void e.config.position(e, n);
1105
1105
  if (e.calendarContainer !== void 0) {
1106
1106
  M("onPreCalendarPosition");
1107
- var t = n || e._positionElement, i = Array.prototype.reduce.call(e.calendarContainer.children, (function(xn, En) {
1108
- return xn + En.offsetHeight;
1109
- }), 0), o = e.calendarContainer.offsetWidth, l = e.config.position.split(" "), f = l[0], m = l.length > 1 ? l[1] : null, s = t.getBoundingClientRect(), p = window.innerHeight - s.bottom, u = f === "above" || f !== "below" && p < i && s.top > i, c = window.pageYOffset + s.top + (u ? -i - 2 : t.offsetHeight + 2);
1110
- if (T(e.calendarContainer, "arrowTop", !u), T(e.calendarContainer, "arrowBottom", u), !e.config.inline) {
1111
- var w = window.pageXOffset + s.left, P = !1, S = !1;
1112
- m === "center" ? (w -= (o - s.width) / 2, P = !0) : m === "right" && (w -= o - s.width, S = !0), T(e.calendarContainer, "arrowLeft", !P && !S), T(e.calendarContainer, "arrowCenter", P), T(e.calendarContainer, "arrowRight", S);
1113
- var ee = window.document.body.offsetWidth - (window.pageXOffset + s.right), z = w + o > window.document.body.offsetWidth, vn = ee + o > window.document.body.offsetWidth;
1114
- if (T(e.calendarContainer, "rightMost", z), !e.config.static)
1115
- if (e.calendarContainer.style.top = c + "px", !z)
1116
- e.calendarContainer.style.left = w + "px", e.calendarContainer.style.right = "auto";
1117
- else if (!vn)
1107
+ var t = n || e._positionElement, i = Array.prototype.reduce.call(e.calendarContainer.children, (function(Sn, In) {
1108
+ return Sn + In.offsetHeight;
1109
+ }), 0), o = e.calendarContainer.offsetWidth, l = e.config.position.split(" "), u = l[0], p = l.length > 1 ? l[1] : null, d = t.getBoundingClientRect(), h = window.innerHeight - d.bottom, f = u === "above" || u !== "below" && h < i && d.top > i, c = window.pageYOffset + d.top + (f ? -i - 2 : t.offsetHeight + 2);
1110
+ if (T(e.calendarContainer, "arrowTop", !f), T(e.calendarContainer, "arrowBottom", f), !e.config.inline) {
1111
+ var b = window.pageXOffset + d.left, P = !1, I = !1;
1112
+ p === "center" ? (b -= (o - d.width) / 2, P = !0) : p === "right" && (b -= o - d.width, I = !0), T(e.calendarContainer, "arrowLeft", !P && !I), T(e.calendarContainer, "arrowCenter", P), T(e.calendarContainer, "arrowRight", I);
1113
+ var ee = window.document.body.offsetWidth - (window.pageXOffset + d.right), Z = b + o > window.document.body.offsetWidth, Mn = ee + o > window.document.body.offsetWidth;
1114
+ if (T(e.calendarContainer, "rightMost", Z), !e.config.static)
1115
+ if (e.calendarContainer.style.top = c + "px", !Z)
1116
+ e.calendarContainer.style.left = b + "px", e.calendarContainer.style.right = "auto";
1117
+ else if (!Mn)
1118
1118
  e.calendarContainer.style.left = "auto", e.calendarContainer.style.right = ee + "px";
1119
1119
  else {
1120
- var ye = on();
1121
- if (ye === void 0)
1120
+ var xe = dn();
1121
+ if (xe === void 0)
1122
1122
  return;
1123
- var Dn = window.document.body.offsetWidth, wn = Math.max(0, Dn / 2 - o / 2), bn = ".flatpickr-calendar.centerMost:before", Mn = ".flatpickr-calendar.centerMost:after", Cn = ye.cssRules.length, yn = "{left:" + s.left + "px;right:auto;}";
1124
- T(e.calendarContainer, "rightMost", !1), T(e.calendarContainer, "centerMost", !0), ye.insertRule(bn + "," + Mn + yn, Cn), e.calendarContainer.style.left = wn + "px", e.calendarContainer.style.right = "auto";
1123
+ var yn = window.document.body.offsetWidth, Cn = Math.max(0, yn / 2 - o / 2), En = ".flatpickr-calendar.centerMost:before", xn = ".flatpickr-calendar.centerMost:after", kn = xe.cssRules.length, Tn = "{left:" + d.left + "px;right:auto;}";
1124
+ T(e.calendarContainer, "rightMost", !1), T(e.calendarContainer, "centerMost", !0), xe.insertRule(En + "," + xn + Tn, kn), e.calendarContainer.style.left = Cn + "px", e.calendarContainer.style.right = "auto";
1125
1125
  }
1126
1126
  }
1127
1127
  }
1128
1128
  }
1129
- function on() {
1129
+ function dn() {
1130
1130
  for (var n = null, t = 0; t < document.styleSheets.length; t++) {
1131
1131
  var i = document.styleSheets[t];
1132
1132
  if (i.cssRules) {
@@ -1139,70 +1139,70 @@ function Fn(a, r) {
1139
1139
  break;
1140
1140
  }
1141
1141
  }
1142
- return n ?? ln();
1142
+ return n ?? sn();
1143
1143
  }
1144
- function ln() {
1144
+ function sn() {
1145
1145
  var n = document.createElement("style");
1146
1146
  return document.head.appendChild(n), n.sheet;
1147
1147
  }
1148
1148
  function Le() {
1149
- e.config.noCalendar || e.isMobile || (V(), se(), ie());
1149
+ e.config.noCalendar || e.isMobile || (V(), ce(), oe());
1150
1150
  }
1151
- function we() {
1151
+ function Me() {
1152
1152
  e._input.focus(), window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== void 0 ? setTimeout(e.close, 0) : e.close();
1153
1153
  }
1154
- function je(n) {
1154
+ function Re(n) {
1155
1155
  n.preventDefault(), n.stopPropagation();
1156
1156
  var t = function(c) {
1157
1157
  return c.classList && c.classList.contains("flatpickr-day") && !c.classList.contains("flatpickr-disabled") && !c.classList.contains("notAllowed");
1158
- }, i = Ue(_(n), t);
1158
+ }, i = Ve(_(n), t);
1159
1159
  if (i !== void 0) {
1160
- var o = i, l = e.latestSelectedDateObj = new Date(o.dateObj.getTime()), f = (l.getMonth() < e.currentMonth || l.getMonth() > e.currentMonth + e.config.showMonths - 1) && e.config.mode !== "range";
1160
+ var o = i, l = e.latestSelectedDateObj = new Date(o.dateObj.getTime()), u = (l.getMonth() < e.currentMonth || l.getMonth() > e.currentMonth + e.config.showMonths - 1) && e.config.mode !== "range";
1161
1161
  if (e.selectedDateElem = o, e.config.mode === "single")
1162
1162
  e.selectedDates = [l];
1163
1163
  else if (e.config.mode === "multiple") {
1164
- var m = Me(l);
1165
- m ? e.selectedDates.splice(parseInt(m), 1) : e.selectedDates.push(l);
1166
- } else e.config.mode === "range" && (e.selectedDates.length === 2 && e.clear(!1, !1), e.latestSelectedDateObj = l, e.selectedDates.push(l), F(l, e.selectedDates[0], !0) !== 0 && e.selectedDates.sort(function(c, w) {
1167
- return c.getTime() - w.getTime();
1164
+ var p = Ce(l);
1165
+ p ? e.selectedDates.splice(parseInt(p), 1) : e.selectedDates.push(l);
1166
+ } else e.config.mode === "range" && (e.selectedDates.length === 2 && e.clear(!1, !1), e.latestSelectedDateObj = l, e.selectedDates.push(l), F(l, e.selectedDates[0], !0) !== 0 && e.selectedDates.sort(function(c, b) {
1167
+ return c.getTime() - b.getTime();
1168
1168
  }));
1169
- if (A(), f) {
1170
- var s = e.currentYear !== l.getFullYear();
1171
- e.currentYear = l.getFullYear(), e.currentMonth = l.getMonth(), s && (M("onYearChange"), V()), M("onMonthChange");
1169
+ if (A(), u) {
1170
+ var d = e.currentYear !== l.getFullYear();
1171
+ e.currentYear = l.getFullYear(), e.currentMonth = l.getMonth(), d && (M("onYearChange"), V()), M("onMonthChange");
1172
1172
  }
1173
- if (se(), ie(), H(), !f && e.config.mode !== "range" && e.config.showMonths === 1 ? U(o) : e.selectedDateElem !== void 0 && e.hourElement === void 0 && e.selectedDateElem && e.selectedDateElem.focus(), e.hourElement !== void 0 && e.hourElement !== void 0 && e.hourElement.focus(), e.config.closeOnSelect) {
1174
- var p = e.config.mode === "single" && !e.config.enableTime, u = e.config.mode === "range" && e.selectedDates.length === 2 && !e.config.enableTime;
1175
- (p || u) && we();
1173
+ if (ce(), oe(), H(), !u && e.config.mode !== "range" && e.config.showMonths === 1 ? q(o) : e.selectedDateElem !== void 0 && e.hourElement === void 0 && e.selectedDateElem && e.selectedDateElem.focus(), e.hourElement !== void 0 && e.hourElement !== void 0 && e.hourElement.focus(), e.config.closeOnSelect) {
1174
+ var h = e.config.mode === "single" && !e.config.enableTime, f = e.config.mode === "range" && e.selectedDates.length === 2 && !e.config.enableTime;
1175
+ (h || f) && Me();
1176
1176
  }
1177
- j();
1177
+ R();
1178
1178
  }
1179
1179
  }
1180
- var ue = {
1181
- locale: [He, Ae],
1182
- showMonths: [Fe, C, Oe],
1183
- minDate: [L],
1184
- maxDate: [L],
1185
- positionElement: [Be],
1180
+ var se = {
1181
+ locale: [je, Ne],
1182
+ showMonths: [Oe, y, Ae],
1183
+ minDate: [j],
1184
+ maxDate: [j],
1185
+ positionElement: [ze],
1186
1186
  clickOpens: [
1187
1187
  function() {
1188
1188
  e.config.clickOpens === !0 ? (D(e._input, "focus", e.open), D(e._input, "click", e.open)) : (e._input.removeEventListener("focus", e.open), e._input.removeEventListener("click", e.open));
1189
1189
  }
1190
1190
  ]
1191
1191
  };
1192
- function fn(n, t) {
1192
+ function cn(n, t) {
1193
1193
  if (n !== null && typeof n == "object") {
1194
1194
  Object.assign(e.config, n);
1195
1195
  for (var i in n)
1196
- ue[i] !== void 0 && ue[i].forEach(function(o) {
1196
+ se[i] !== void 0 && se[i].forEach(function(o) {
1197
1197
  return o();
1198
1198
  });
1199
1199
  } else
1200
- e.config[n] = t, ue[n] !== void 0 ? ue[n].forEach(function(o) {
1200
+ e.config[n] = t, se[n] !== void 0 ? se[n].forEach(function(o) {
1201
1201
  return o();
1202
- }) : xe.indexOf(n) > -1 && (e.config[n] = Ee(t));
1202
+ }) : ke.indexOf(n) > -1 && (e.config[n] = Te(t));
1203
1203
  e.redraw(), H(!0);
1204
1204
  }
1205
- function Re(n, t) {
1205
+ function We(n, t) {
1206
1206
  var i = [];
1207
1207
  if (n instanceof Array)
1208
1208
  i = n.map(function(o) {
@@ -1230,17 +1230,17 @@ function Fn(a, r) {
1230
1230
  else
1231
1231
  e.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(n)));
1232
1232
  e.selectedDates = e.config.allowInvalidPreload ? i : i.filter(function(o) {
1233
- return o instanceof Date && B(o, !1);
1233
+ return o instanceof Date && z(o, !1);
1234
1234
  }), e.config.mode === "range" && e.selectedDates.sort(function(o, l) {
1235
1235
  return o.getTime() - l.getTime();
1236
1236
  });
1237
1237
  }
1238
- function un(n, t, i) {
1238
+ function gn(n, t, i) {
1239
1239
  if (t === void 0 && (t = !1), i === void 0 && (i = e.config.dateFormat), n !== 0 && !n || n instanceof Array && n.length === 0)
1240
1240
  return e.clear(t);
1241
- Re(n, i), e.latestSelectedDateObj = e.selectedDates[e.selectedDates.length - 1], e.redraw(), L(void 0, t), N(), e.selectedDates.length === 0 && e.clear(!1), H(t), t && M("onChange");
1241
+ We(n, i), e.latestSelectedDateObj = e.selectedDates[e.selectedDates.length - 1], e.redraw(), j(void 0, t), N(), e.selectedDates.length === 0 && e.clear(!1), H(t), t && M("onChange");
1242
1242
  }
1243
- function We(n) {
1243
+ function Je(n) {
1244
1244
  return n.slice().map(function(t) {
1245
1245
  return typeof t == "string" || typeof t == "number" || t instanceof Date ? e.parseDate(t, void 0, !0) : t && typeof t == "object" && t.from && t.to ? {
1246
1246
  from: e.parseDate(t.from, void 0),
@@ -1250,22 +1250,22 @@ function Fn(a, r) {
1250
1250
  return t;
1251
1251
  });
1252
1252
  }
1253
- function sn() {
1253
+ function mn() {
1254
1254
  e.selectedDates = [], e.now = e.parseDate(e.config.now) || /* @__PURE__ */ new Date();
1255
1255
  var n = e.config.defaultDate || ((e.input.nodeName === "INPUT" || e.input.nodeName === "TEXTAREA") && e.input.placeholder && e.input.value === e.input.placeholder ? null : e.input.value);
1256
- n && Re(n, e.config.dateFormat), e._initialDate = e.selectedDates.length > 0 ? e.selectedDates[0] : e.config.minDate && e.config.minDate.getTime() > e.now.getTime() ? e.config.minDate : e.config.maxDate && e.config.maxDate.getTime() < e.now.getTime() ? e.config.maxDate : e.now, e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth(), e.selectedDates.length > 0 && (e.latestSelectedDateObj = e.selectedDates[0]), e.config.minTime !== void 0 && (e.config.minTime = e.parseDate(e.config.minTime, "H:i")), e.config.maxTime !== void 0 && (e.config.maxTime = e.parseDate(e.config.maxTime, "H:i")), e.minDateHasTime = !!e.config.minDate && (e.config.minDate.getHours() > 0 || e.config.minDate.getMinutes() > 0 || e.config.minDate.getSeconds() > 0), e.maxDateHasTime = !!e.config.maxDate && (e.config.maxDate.getHours() > 0 || e.config.maxDate.getMinutes() > 0 || e.config.maxDate.getSeconds() > 0);
1256
+ n && We(n, e.config.dateFormat), e._initialDate = e.selectedDates.length > 0 ? e.selectedDates[0] : e.config.minDate && e.config.minDate.getTime() > e.now.getTime() ? e.config.minDate : e.config.maxDate && e.config.maxDate.getTime() < e.now.getTime() ? e.config.maxDate : e.now, e.currentYear = e._initialDate.getFullYear(), e.currentMonth = e._initialDate.getMonth(), e.selectedDates.length > 0 && (e.latestSelectedDateObj = e.selectedDates[0]), e.config.minTime !== void 0 && (e.config.minTime = e.parseDate(e.config.minTime, "H:i")), e.config.maxTime !== void 0 && (e.config.maxTime = e.parseDate(e.config.maxTime, "H:i")), e.minDateHasTime = !!e.config.minDate && (e.config.minDate.getHours() > 0 || e.config.minDate.getMinutes() > 0 || e.config.minDate.getSeconds() > 0), e.maxDateHasTime = !!e.config.maxDate && (e.config.maxDate.getHours() > 0 || e.config.maxDate.getMinutes() > 0 || e.config.maxDate.getSeconds() > 0);
1257
1257
  }
1258
- function cn() {
1259
- if (e.input = Ye(), !e.input) {
1258
+ function pn() {
1259
+ if (e.input = He(), !e.input) {
1260
1260
  e.config.errorHandler(new Error("Invalid input element specified"));
1261
1261
  return;
1262
1262
  }
1263
- e.input._type = e.input.type, e.input.type = "text", e.input.classList.add("flatpickr-input"), e._input = e.input, e.config.altInput && (e.altInput = v(e.input.nodeName, e.config.altInputClass), e._input = e.altInput, e.altInput.placeholder = e.input.placeholder, e.altInput.disabled = e.input.disabled, e.altInput.required = e.input.required, e.altInput.tabIndex = e.input.tabIndex, e.altInput.type = "text", e.input.setAttribute("type", "hidden"), !e.config.static && e.input.parentNode && e.input.parentNode.insertBefore(e.altInput, e.input.nextSibling)), e.config.allowInput || e._input.setAttribute("readonly", "readonly"), Be();
1263
+ e.input._type = e.input.type, e.input.type = "text", e.input.classList.add("flatpickr-input"), e._input = e.input, e.config.altInput && (e.altInput = v(e.input.nodeName, e.config.altInputClass), e._input = e.altInput, e.altInput.placeholder = e.input.placeholder, e.altInput.disabled = e.input.disabled, e.altInput.required = e.input.required, e.altInput.tabIndex = e.input.tabIndex, e.altInput.type = "text", e.input.setAttribute("type", "hidden"), !e.config.static && e.input.parentNode && e.input.parentNode.insertBefore(e.altInput, e.input.nextSibling)), e.config.allowInput || e._input.setAttribute("readonly", "readonly"), ze();
1264
1264
  }
1265
- function Be() {
1265
+ function ze() {
1266
1266
  e._positionElement = e.config.positionElement || e._input;
1267
1267
  }
1268
- function dn() {
1268
+ function hn() {
1269
1269
  var n = e.config.enableTime ? e.config.noCalendar ? "time" : "datetime-local" : "date";
1270
1270
  e.mobileInput = v("input", e.input.className + " flatpickr-mobile"), e.mobileInput.tabIndex = 1, e.mobileInput.type = n, e.mobileInput.disabled = e.input.disabled, e.mobileInput.required = e.input.required, e.mobileInput.placeholder = e.input.placeholder, e.mobileFormatStr = n === "datetime-local" ? "Y-m-d\\TH:i:S" : n === "date" ? "Y-m-d" : "H:i:S", e.selectedDates.length > 0 && (e.mobileInput.defaultValue = e.mobileInput.value = e.formatDate(e.selectedDates[0], e.mobileFormatStr)), e.config.minDate && (e.mobileInput.min = e.formatDate(e.config.minDate, "Y-m-d")), e.config.maxDate && (e.mobileInput.max = e.formatDate(e.config.maxDate, "Y-m-d")), e.input.getAttribute("step") && (e.mobileInput.step = String(e.input.getAttribute("step"))), e.input.type = "hidden", e.altInput !== void 0 && (e.altInput.type = "hidden");
1271
1271
  try {
@@ -1276,7 +1276,7 @@ function Fn(a, r) {
1276
1276
  e.setDate(_(t).value, !1, e.mobileFormatStr), M("onChange"), M("onClose");
1277
1277
  });
1278
1278
  }
1279
- function gn(n) {
1279
+ function vn(n) {
1280
1280
  if (e.isOpen === !0)
1281
1281
  return e.close();
1282
1282
  e.open(n);
@@ -1287,14 +1287,14 @@ function Fn(a, r) {
1287
1287
  if (i !== void 0 && i.length > 0)
1288
1288
  for (var o = 0; i[o] && o < i.length; o++)
1289
1289
  i[o](e.selectedDates, e.input.value, e, t);
1290
- n === "onChange" && (e.input.dispatchEvent(be("change")), e.input.dispatchEvent(be("input")));
1290
+ n === "onChange" && (e.input.dispatchEvent(ye("change")), e.input.dispatchEvent(ye("input")));
1291
1291
  }
1292
1292
  }
1293
- function be(n) {
1293
+ function ye(n) {
1294
1294
  var t = document.createEvent("Event");
1295
1295
  return t.initEvent(n, !0, !0), t;
1296
1296
  }
1297
- function Me(n) {
1297
+ function Ce(n) {
1298
1298
  for (var t = 0; t < e.selectedDates.length; t++) {
1299
1299
  var i = e.selectedDates[t];
1300
1300
  if (i instanceof Date && F(i, n) === 0)
@@ -1302,16 +1302,16 @@ function Fn(a, r) {
1302
1302
  }
1303
1303
  return !1;
1304
1304
  }
1305
- function mn(n) {
1305
+ function Dn(n) {
1306
1306
  return e.config.mode !== "range" || e.selectedDates.length < 2 ? !1 : F(n, e.selectedDates[0]) >= 0 && F(n, e.selectedDates[1]) <= 0;
1307
1307
  }
1308
- function se() {
1308
+ function ce() {
1309
1309
  e.config.noCalendar || e.isMobile || !e.monthNav || (e.yearElements.forEach(function(n, t) {
1310
1310
  var i = new Date(e.currentYear, e.currentMonth, 1);
1311
- i.setMonth(e.currentMonth + t), e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? e.monthElements[t].textContent = ge(i.getMonth(), e.config.shorthandCurrentMonth, e.l10n) + " " : e.monthsDropdownContainer.value = i.getMonth().toString(), n.value = i.getFullYear().toString();
1311
+ i.setMonth(e.currentMonth + t), e.config.showMonths > 1 || e.config.monthSelectorType === "static" ? e.monthElements[t].textContent = pe(i.getMonth(), e.config.shorthandCurrentMonth, e.l10n) + " " : e.monthsDropdownContainer.value = i.getMonth().toString(), n.value = i.getFullYear().toString();
1312
1312
  }), e._hidePrevMonthArrow = e.config.minDate !== void 0 && (e.currentYear === e.config.minDate.getFullYear() ? e.currentMonth <= e.config.minDate.getMonth() : e.currentYear < e.config.minDate.getFullYear()), e._hideNextMonthArrow = e.config.maxDate !== void 0 && (e.currentYear === e.config.maxDate.getFullYear() ? e.currentMonth + 1 > e.config.maxDate.getMonth() : e.currentYear > e.config.maxDate.getFullYear()));
1313
1313
  }
1314
- function Ce(n) {
1314
+ function Ee(n) {
1315
1315
  var t = n || (e.config.altInput ? e.config.altFormat : e.config.dateFormat);
1316
1316
  return e.selectedDates.map(function(i) {
1317
1317
  return e.formatDate(i, t);
@@ -1320,103 +1320,246 @@ function Fn(a, r) {
1320
1320
  }).join(e.config.mode !== "range" ? e.config.conjunction : e.l10n.rangeSeparator);
1321
1321
  }
1322
1322
  function H(n) {
1323
- n === void 0 && (n = !0), e.mobileInput !== void 0 && e.mobileFormatStr && (e.mobileInput.value = e.latestSelectedDateObj !== void 0 ? e.formatDate(e.latestSelectedDateObj, e.mobileFormatStr) : ""), e.input.value = Ce(e.config.dateFormat), e.altInput !== void 0 && (e.altInput.value = Ce(e.config.altFormat)), n !== !1 && M("onValueUpdate");
1323
+ n === void 0 && (n = !0), e.mobileInput !== void 0 && e.mobileFormatStr && (e.mobileInput.value = e.latestSelectedDateObj !== void 0 ? e.formatDate(e.latestSelectedDateObj, e.mobileFormatStr) : ""), e.input.value = Ee(e.config.dateFormat), e.altInput !== void 0 && (e.altInput.value = Ee(e.config.altFormat)), n !== !1 && M("onValueUpdate");
1324
1324
  }
1325
- function pn(n) {
1325
+ function bn(n) {
1326
1326
  var t = _(n), i = e.prevMonthNav.contains(t), o = e.nextMonthNav.contains(t);
1327
- i || o ? ve(i ? -1 : 1) : e.yearElements.indexOf(t) >= 0 ? t.select() : t.classList.contains("arrowUp") ? e.changeYear(e.currentYear + 1) : t.classList.contains("arrowDown") && e.changeYear(e.currentYear - 1);
1327
+ i || o ? be(i ? -1 : 1) : e.yearElements.indexOf(t) >= 0 ? t.select() : t.classList.contains("arrowUp") ? e.changeYear(e.currentYear + 1) : t.classList.contains("arrowDown") && e.changeYear(e.currentYear - 1);
1328
1328
  }
1329
- function hn(n) {
1329
+ function wn(n) {
1330
1330
  n.preventDefault();
1331
1331
  var t = n.type === "keydown", i = _(n), o = i;
1332
1332
  e.amPM !== void 0 && i === e.amPM && (e.amPM.textContent = e.l10n.amPM[O(e.amPM.textContent === e.l10n.amPM[0])]);
1333
- var l = parseFloat(o.getAttribute("min")), f = parseFloat(o.getAttribute("max")), m = parseFloat(o.getAttribute("step")), s = parseInt(o.value, 10), p = n.delta || (t ? n.which === 38 ? 1 : -1 : 0), u = s + m * p;
1333
+ var l = parseFloat(o.getAttribute("min")), u = parseFloat(o.getAttribute("max")), p = parseFloat(o.getAttribute("step")), d = parseInt(o.value, 10), h = n.delta || (t ? n.which === 38 ? 1 : -1 : 0), f = d + p * h;
1334
1334
  if (typeof o.value < "u" && o.value.length === 2) {
1335
- var c = o === e.hourElement, w = o === e.minuteElement;
1336
- u < l ? (u = f + u + O(!c) + (O(c) && O(!e.amPM)), w && J(void 0, -1, e.hourElement)) : u > f && (u = o === e.hourElement ? u - f - O(!e.amPM) : l, w && J(void 0, 1, e.hourElement)), e.amPM && c && (m === 1 ? u + s === 23 : Math.abs(u - s) > m) && (e.amPM.textContent = e.l10n.amPM[O(e.amPM.textContent === e.l10n.amPM[0])]), o.value = I(u);
1335
+ var c = o === e.hourElement, b = o === e.minuteElement;
1336
+ f < l ? (f = u + f + O(!c) + (O(c) && O(!e.amPM)), b && K(void 0, -1, e.hourElement)) : f > u && (f = o === e.hourElement ? f - u - O(!e.amPM) : l, b && K(void 0, 1, e.hourElement)), e.amPM && c && (p === 1 ? f + d === 23 : Math.abs(f - d) > p) && (e.amPM.textContent = e.l10n.amPM[O(e.amPM.textContent === e.l10n.amPM[0])]), o.value = S(f);
1337
1337
  }
1338
1338
  }
1339
- return h(), e;
1339
+ return m(), e;
1340
1340
  }
1341
- function G(a, r) {
1342
- for (var e = Array.prototype.slice.call(a).filter(function(b) {
1343
- return b instanceof HTMLElement;
1344
- }), d = [], h = 0; h < e.length; h++) {
1345
- var g = e[h];
1341
+ function $(a, r) {
1342
+ for (var e = Array.prototype.slice.call(a).filter(function(w) {
1343
+ return w instanceof HTMLElement;
1344
+ }), s = [], m = 0; m < e.length; m++) {
1345
+ var g = e[m];
1346
1346
  try {
1347
1347
  if (g.getAttribute("data-fp-omit") !== null)
1348
1348
  continue;
1349
- g._flatpickr !== void 0 && (g._flatpickr.destroy(), g._flatpickr = void 0), g._flatpickr = Fn(g, r || {}), d.push(g._flatpickr);
1350
- } catch (b) {
1351
- console.error(b);
1349
+ g._flatpickr !== void 0 && (g._flatpickr.destroy(), g._flatpickr = void 0), g._flatpickr = Pn(g, r || {}), s.push(g._flatpickr);
1350
+ } catch (w) {
1351
+ console.error(w);
1352
1352
  }
1353
1353
  }
1354
- return d.length === 1 ? d[0] : d;
1354
+ return s.length === 1 ? s[0] : s;
1355
1355
  }
1356
1356
  typeof HTMLElement < "u" && typeof HTMLCollection < "u" && typeof NodeList < "u" && (HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function(a) {
1357
- return G(this, a);
1357
+ return $(this, a);
1358
1358
  }, HTMLElement.prototype.flatpickr = function(a) {
1359
- return G([this], a);
1359
+ return $([this], a);
1360
1360
  });
1361
- var x = function(a, r) {
1362
- return typeof a == "string" ? G(window.document.querySelectorAll(a), r) : a instanceof Node ? G([a], r) : G(a, r);
1361
+ var E = function(a, r) {
1362
+ return typeof a == "string" ? $(window.document.querySelectorAll(a), r) : a instanceof Node ? $([a], r) : $(a, r);
1363
1363
  };
1364
- x.defaultConfig = {};
1365
- x.l10ns = {
1366
- en: k({}, te),
1367
- default: k({}, te)
1364
+ E.defaultConfig = {};
1365
+ E.l10ns = {
1366
+ en: k({}, ie),
1367
+ default: k({}, ie)
1368
1368
  };
1369
- x.localize = function(a) {
1370
- x.l10ns.default = k(k({}, x.l10ns.default), a);
1369
+ E.localize = function(a) {
1370
+ E.l10ns.default = k(k({}, E.l10ns.default), a);
1371
1371
  };
1372
- x.setDefaults = function(a) {
1373
- x.defaultConfig = k(k({}, x.defaultConfig), a);
1372
+ E.setDefaults = function(a) {
1373
+ E.defaultConfig = k(k({}, E.defaultConfig), a);
1374
1374
  };
1375
- x.parseDate = _e({});
1376
- x.formatDate = qe({});
1377
- x.compareDates = F;
1375
+ E.parseDate = Fe({});
1376
+ E.formatDate = Ze({});
1377
+ E.compareDates = F;
1378
1378
  typeof jQuery < "u" && typeof jQuery.fn < "u" && (jQuery.fn.flatpickr = function(a) {
1379
- return G(this, a);
1379
+ return $(this, a);
1380
1380
  });
1381
1381
  Date.prototype.fp_incr = function(a) {
1382
1382
  return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof a == "string" ? parseInt(a, 10) : a));
1383
1383
  };
1384
- typeof window < "u" && (window.flatpickr = x);
1385
- const Se = (a = document) => {
1386
- a.querySelectorAll(".datepicker").forEach((e) => {
1387
- if (e._flatpickr) return;
1388
- const d = e.dataset.mode || "single", h = e.dataset.enableTime === "true", g = e.dataset.noCalendar === "true", b = e.dataset.inline === "true", C = e.dataset.dateFormat || (h && g ? "H:i" : "Y-m-d");
1389
- x(e, {
1390
- mode: d,
1391
- enableTime: h,
1392
- noCalendar: g,
1393
- inline: b,
1394
- dateFormat: C,
1395
- allowInput: !0,
1396
- // Allow manual typing
1397
- shorthandCurrentMonth: !0,
1398
- // Display month shorthand (e.g. "Dec" instead of "December")
1399
- prevArrow: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4"><path d="m15 18-6-6 6-6"/></svg>',
1400
- nextArrow: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-4 h-4"><path d="m9 18 6-6-6-6"/></svg>',
1401
- static: !0
1402
- // Position relative to wrapper, helps with scroll
1403
- // Custom class names to hook into our CSS
1404
- // flatpickr doesn't fully support class replacements, but we can append
1405
- });
1406
- });
1384
+ typeof window < "u" && (window.flatpickr = E);
1385
+ var ne = { exports: {} }, Yn = ne.exports, qe;
1386
+ function Hn() {
1387
+ return qe || (qe = 1, (function(a, r) {
1388
+ (function(e, s) {
1389
+ s(r);
1390
+ })(Yn, (function(e) {
1391
+ var s = typeof window < "u" && window.flatpickr !== void 0 ? window.flatpickr : {
1392
+ l10ns: {}
1393
+ }, m = {
1394
+ weekdays: {
1395
+ shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
1396
+ longhand: [
1397
+ "星期日",
1398
+ "星期一",
1399
+ "星期二",
1400
+ "星期三",
1401
+ "星期四",
1402
+ "星期五",
1403
+ "星期六"
1404
+ ]
1405
+ },
1406
+ months: {
1407
+ shorthand: [
1408
+ "一月",
1409
+ "二月",
1410
+ "三月",
1411
+ "四月",
1412
+ "五月",
1413
+ "六月",
1414
+ "七月",
1415
+ "八月",
1416
+ "九月",
1417
+ "十月",
1418
+ "十一月",
1419
+ "十二月"
1420
+ ],
1421
+ longhand: [
1422
+ "一月",
1423
+ "二月",
1424
+ "三月",
1425
+ "四月",
1426
+ "五月",
1427
+ "六月",
1428
+ "七月",
1429
+ "八月",
1430
+ "九月",
1431
+ "十月",
1432
+ "十一月",
1433
+ "十二月"
1434
+ ]
1435
+ },
1436
+ rangeSeparator: " 至 ",
1437
+ weekAbbreviation: "周",
1438
+ scrollTitle: "滚动切换",
1439
+ toggleTitle: "点击切换 12/24 小时时制"
1440
+ };
1441
+ s.l10ns.zh = m;
1442
+ var g = s.l10ns;
1443
+ e.Mandarin = m, e.default = g, Object.defineProperty(e, "__esModule", { value: !0 });
1444
+ }));
1445
+ })(ne, ne.exports)), ne.exports;
1446
+ }
1447
+ var jn = Hn(), te = { exports: {} }, Ln = te.exports, Ue;
1448
+ function Rn() {
1449
+ return Ue || (Ue = 1, (function(a, r) {
1450
+ (function(e, s) {
1451
+ s(r);
1452
+ })(Ln, (function(e) {
1453
+ var s = typeof window < "u" && window.flatpickr !== void 0 ? window.flatpickr : {
1454
+ l10ns: {}
1455
+ }, m = {
1456
+ weekdays: {
1457
+ shorthand: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"],
1458
+ longhand: [
1459
+ "星期日",
1460
+ "星期一",
1461
+ "星期二",
1462
+ "星期三",
1463
+ "星期四",
1464
+ "星期五",
1465
+ "星期六"
1466
+ ]
1467
+ },
1468
+ months: {
1469
+ shorthand: [
1470
+ "一月",
1471
+ "二月",
1472
+ "三月",
1473
+ "四月",
1474
+ "五月",
1475
+ "六月",
1476
+ "七月",
1477
+ "八月",
1478
+ "九月",
1479
+ "十月",
1480
+ "十一月",
1481
+ "十二月"
1482
+ ],
1483
+ longhand: [
1484
+ "一月",
1485
+ "二月",
1486
+ "三月",
1487
+ "四月",
1488
+ "五月",
1489
+ "六月",
1490
+ "七月",
1491
+ "八月",
1492
+ "九月",
1493
+ "十月",
1494
+ "十一月",
1495
+ "十二月"
1496
+ ]
1497
+ },
1498
+ rangeSeparator: " 至 ",
1499
+ weekAbbreviation: "週",
1500
+ scrollTitle: "滾動切換",
1501
+ toggleTitle: "點擊切換 12/24 小時時制"
1502
+ };
1503
+ s.l10ns.zh_tw = m;
1504
+ var g = s.l10ns;
1505
+ e.MandarinTraditional = m, e.default = g, Object.defineProperty(e, "__esModule", { value: !0 });
1506
+ }));
1507
+ })(te, te.exports)), te.exports;
1508
+ }
1509
+ var Wn = Rn();
1510
+ const Jn = {
1511
+ weekdays: {
1512
+ shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1513
+ longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
1514
+ },
1515
+ months: {
1516
+ shorthand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
1517
+ longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
1518
+ }
1519
+ }, Ge = {
1520
+ weekdays: {
1521
+ shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1522
+ longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
1523
+ },
1524
+ months: {
1525
+ shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
1526
+ longhand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
1527
+ }
1528
+ }, zn = {
1529
+ zh: jn.Mandarin,
1530
+ "zh-tw": Wn.MandarinTraditional,
1531
+ "en-full": Jn,
1532
+ "en-short": Ge
1533
+ }, Bn = (a) => {
1534
+ if (a._flatpickr || a.dataset.datepickerInitialized) return;
1535
+ const r = a.dataset.mode || "single", e = a.dataset.enableTime === "true", s = a.dataset.noCalendar === "true", m = a.dataset.inline === "true", g = a.dataset.dateFormat || (e && s ? "H:i" : "Y-m-d"), w = a.dataset.locale || "en-short", y = zn[w] || Ge;
1536
+ E(a, {
1537
+ mode: r,
1538
+ enableTime: e,
1539
+ noCalendar: s,
1540
+ inline: m,
1541
+ dateFormat: g,
1542
+ allowInput: !0,
1543
+ shorthandCurrentMonth: w === "en-short",
1544
+ static: !m,
1545
+ locale: y,
1546
+ onOpen: () => {
1547
+ document.dispatchEvent(new CustomEvent("basecoat:popover", { detail: { source: a } }));
1548
+ },
1549
+ onChange: (x, L) => {
1550
+ a.dispatchEvent(new CustomEvent("change", {
1551
+ bubbles: !0,
1552
+ detail: { value: L, dates: x }
1553
+ }));
1554
+ }
1555
+ }), a.dataset.datepickerInitialized = "true", a.dispatchEvent(new CustomEvent("basecoat:initialized"));
1407
1556
  };
1408
- if (typeof window < "u") {
1409
- const a = new MutationObserver((r) => {
1410
- r.forEach((e) => {
1411
- e.type === "childList" && e.addedNodes.forEach((d) => {
1412
- d.nodeType === 1 && (d.classList?.contains("datepicker") ? Se(d.parentNode) : d.querySelector?.(".datepicker") && Se(d));
1413
- });
1414
- });
1557
+ window.basecoat && (window.basecoat.register("datepicker", ".datepicker:not([data-datepicker-initialized])", Bn), (document.readyState === "complete" || document.readyState === "interactive") && window.basecoat.init("datepicker"));
1558
+ document.addEventListener("basecoat:popover", (a) => {
1559
+ document.querySelectorAll(".datepicker").forEach((r) => {
1560
+ r._flatpickr && r._flatpickr.isOpen && a.detail?.source !== r && r._flatpickr.close();
1415
1561
  });
1416
- document.addEventListener("DOMContentLoaded", () => {
1417
- Se(), a.observe(document.body, { childList: !0, subtree: !0 });
1418
- });
1419
- }
1562
+ });
1420
1563
  export {
1421
- Se as initDatepicker
1564
+ Bn as initDatepicker
1422
1565
  };