@editora/ui-core 0.1.12 → 0.1.14

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.
Files changed (141) hide show
  1. package/README.md +95 -5
  2. package/dist/alert-dialog.cjs.js +18 -18
  3. package/dist/alert-dialog.esm.js +130 -117
  4. package/dist/app-header.cjs.js +22 -2
  5. package/dist/app-header.esm.js +22 -2
  6. package/dist/badge.cjs.js +5 -5
  7. package/dist/badge.esm.js +9 -8
  8. package/dist/color-picker.cjs.js +4 -4
  9. package/dist/color-picker.esm.js +40 -31
  10. package/dist/combobox.cjs.js +21 -21
  11. package/dist/combobox.esm.js +79 -40
  12. package/dist/command-palette.cjs.js +1 -1
  13. package/dist/command-palette.esm.js +2 -2
  14. package/dist/components/date-time-utils.d.ts +2 -1
  15. package/dist/components/date-time-utils.d.ts.map +1 -1
  16. package/dist/components/ui-alert-dialog.d.ts +2 -0
  17. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  18. package/dist/components/ui-app-header.d.ts.map +1 -1
  19. package/dist/components/ui-badge.d.ts.map +1 -1
  20. package/dist/components/ui-color-picker.d.ts.map +1 -1
  21. package/dist/components/ui-combobox.d.ts +4 -1
  22. package/dist/components/ui-combobox.d.ts.map +1 -1
  23. package/dist/components/ui-context-menu.d.ts +6 -0
  24. package/dist/components/ui-context-menu.d.ts.map +1 -1
  25. package/dist/components/ui-date-picker.d.ts +3 -0
  26. package/dist/components/ui-date-picker.d.ts.map +1 -1
  27. package/dist/components/ui-date-range-picker.d.ts +3 -0
  28. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  29. package/dist/components/ui-date-range-time-picker.d.ts +3 -0
  30. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  31. package/dist/components/ui-date-time-picker.d.ts +3 -0
  32. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  33. package/dist/components/ui-dialog.d.ts +3 -0
  34. package/dist/components/ui-dialog.d.ts.map +1 -1
  35. package/dist/components/ui-drawer.d.ts +14 -0
  36. package/dist/components/ui-drawer.d.ts.map +1 -1
  37. package/dist/components/ui-floating-toolbar.d.ts +3 -0
  38. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  39. package/dist/components/ui-gantt.d.ts +30 -1
  40. package/dist/components/ui-gantt.d.ts.map +1 -1
  41. package/dist/components/ui-hover-card.d.ts +3 -0
  42. package/dist/components/ui-hover-card.d.ts.map +1 -1
  43. package/dist/components/ui-menu.d.ts +1 -0
  44. package/dist/components/ui-menu.d.ts.map +1 -1
  45. package/dist/components/ui-menubar.d.ts +1 -0
  46. package/dist/components/ui-menubar.d.ts.map +1 -1
  47. package/dist/components/ui-positioner.d.ts.map +1 -1
  48. package/dist/components/ui-quick-actions.d.ts.map +1 -1
  49. package/dist/components/ui-radio.d.ts +47 -0
  50. package/dist/components/ui-radio.d.ts.map +1 -0
  51. package/dist/components/ui-select.d.ts +8 -0
  52. package/dist/components/ui-select.d.ts.map +1 -1
  53. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  54. package/dist/components/ui-stepper.d.ts.map +1 -1
  55. package/dist/components/ui-time-picker.d.ts +3 -0
  56. package/dist/components/ui-time-picker.d.ts.map +1 -1
  57. package/dist/context-menu.cjs.js +12 -12
  58. package/dist/context-menu.esm.js +160 -133
  59. package/dist/date-field.cjs.js +1 -1
  60. package/dist/date-field.esm.js +3 -2
  61. package/dist/date-picker.cjs.js +13 -13
  62. package/dist/date-picker.esm.js +101 -67
  63. package/dist/date-range-picker.cjs.js +14 -14
  64. package/dist/date-range-picker.esm.js +99 -65
  65. package/dist/date-range-time-picker.cjs.js +13 -13
  66. package/dist/date-range-time-picker.esm.js +77 -45
  67. package/dist/date-time-picker.cjs.js +13 -13
  68. package/dist/date-time-picker.esm.js +133 -101
  69. package/dist/date-time-utils-66480de4.js +1 -0
  70. package/dist/date-time-utils-a2c7af25.mjs +307 -0
  71. package/dist/dialog.cjs.js +29 -20
  72. package/dist/dialog.esm.js +90 -70
  73. package/dist/drawer.cjs.js +16 -16
  74. package/dist/drawer.esm.js +216 -98
  75. package/dist/floating-toolbar.cjs.js +6 -16
  76. package/dist/floating-toolbar.esm.js +57 -40
  77. package/dist/gantt.cjs.js +656 -74
  78. package/dist/gantt.esm.js +1050 -100
  79. package/dist/hover-card.cjs.js +4 -4
  80. package/dist/hover-card.esm.js +62 -39
  81. package/dist/index.cjs.js +1 -1
  82. package/dist/index.d.ts +2 -0
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.esm.js +300 -286
  85. package/dist/menu.cjs.js +2 -2
  86. package/dist/menu.esm.js +118 -110
  87. package/dist/menubar.cjs.js +5 -5
  88. package/dist/menubar.esm.js +83 -78
  89. package/dist/{overlayManager-ece06517.js → overlayManager-0eda4e08.js} +1 -1
  90. package/dist/{overlayManager-86454af7.mjs → overlayManager-5bbd4dc3.mjs} +1 -1
  91. package/dist/popover.cjs.js +1 -1
  92. package/dist/popover.esm.js +2 -2
  93. package/dist/portal-c69756c0.js +1 -0
  94. package/dist/portal-fe73e5cc.mjs +123 -0
  95. package/dist/portal.d.ts +29 -3
  96. package/dist/portal.d.ts.map +1 -1
  97. package/dist/positioner-33529bb8.js +1 -0
  98. package/dist/positioner-e9770c66.mjs +582 -0
  99. package/dist/positioner.cjs.js +2 -2
  100. package/dist/positioner.esm.js +36 -26
  101. package/dist/primitives/positioner.d.ts +199 -1
  102. package/dist/primitives/positioner.d.ts.map +1 -1
  103. package/dist/quick-actions.cjs.js +10 -4
  104. package/dist/quick-actions.esm.js +27 -21
  105. package/dist/radio.cjs.js +259 -0
  106. package/dist/radio.esm.js +455 -0
  107. package/dist/{runtime-4ac0107b.mjs → runtime-161f68a2.mjs} +24 -23
  108. package/dist/runtime-3f13807b.js +1 -0
  109. package/dist/runtime.cjs.js +1 -1
  110. package/dist/runtime.d.ts +2 -0
  111. package/dist/runtime.d.ts.map +1 -1
  112. package/dist/runtime.esm.js +39 -24
  113. package/dist/scroll-lock-31da444f.mjs +56 -0
  114. package/dist/scroll-lock-d7b0df21.js +1 -0
  115. package/dist/scroll-lock.d.ts.map +1 -1
  116. package/dist/select.cjs.js +14 -15
  117. package/dist/select.esm.js +117 -97
  118. package/dist/selection-popup.cjs.js +4 -7
  119. package/dist/selection-popup.esm.js +8 -11
  120. package/dist/split-button.cjs.js +1 -1
  121. package/dist/split-button.esm.js +2 -2
  122. package/dist/standalone/radio.d.ts +2 -0
  123. package/dist/standalone/radio.d.ts.map +1 -0
  124. package/dist/stepper.cjs.js +19 -50
  125. package/dist/stepper.esm.js +17 -48
  126. package/dist/time-field.cjs.js +1 -1
  127. package/dist/time-field.esm.js +3 -2
  128. package/dist/time-picker.cjs.js +15 -15
  129. package/dist/time-picker.esm.js +100 -68
  130. package/dist/tooltip.cjs.js +1 -1
  131. package/dist/tooltip.esm.js +2 -1
  132. package/package.json +1 -1
  133. package/dist/date-time-utils-5cf58cd0.js +0 -1
  134. package/dist/date-time-utils-bdceb7af.mjs +0 -273
  135. package/dist/portal-1cf392ca.mjs +0 -114
  136. package/dist/portal-d8d7fbca.js +0 -1
  137. package/dist/positioner-accc6e5f.js +0 -1
  138. package/dist/positioner-fbd61bf1.mjs +0 -132
  139. package/dist/runtime-5f282bc8.js +0 -1
  140. package/dist/scroll-lock-48793569.js +0 -1
  141. package/dist/scroll-lock-9de6d328.mjs +0 -53
@@ -1,17 +1,19 @@
1
- import { E as Y } from "./ElementBase-909688f3.mjs";
2
- import { r as W } from "./calendar-2c11b824.mjs";
3
- import { r as J, i as v, s as G, b as Q, f as X, t as tt, n as E, d as et, p as F, m as N, a as it, k as L, h as j, j as Z, o as y, l as nt, c as st } from "./date-time-utils-bdceb7af.mjs";
4
- import "./scroll-lock-9de6d328.mjs";
5
- let rt = 0;
6
- const at = `
1
+ import { E as W } from "./ElementBase-909688f3.mjs";
2
+ import { c as Y } from "./dismissable-layer-9c7e6b58.mjs";
3
+ import { r as J } from "./calendar-2c11b824.mjs";
4
+ import { r as G, e as Q, i as v, s as X, b as tt, f as et, t as it, n as R, d as st, p as F, o as N, a as nt, m as E, j as Z, k as j, q as y, l as rt, c as at } from "./date-time-utils-a2c7af25.mjs";
5
+ import "./scroll-lock-31da444f.mjs";
6
+ import "./positioner-e9770c66.mjs";
7
+ let ot = 0;
8
+ const lt = `
7
9
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
8
10
  <path d="M6 2a1 1 0 0 1 1 1v1h6V3a1 1 0 1 1 2 0v1h.5A2.5 2.5 0 0 1 18 6.5v9A2.5 2.5 0 0 1 15.5 18h-11A2.5 2.5 0 0 1 2 15.5v-9A2.5 2.5 0 0 1 4.5 4H5V3a1 1 0 0 1 1-1Zm10 7H4v6.5c0 .276.224.5.5.5h11a.5.5 0 0 0 .5-.5V9ZM4.5 6a.5.5 0 0 0-.5.5V7h12v-.5a.5.5 0 0 0-.5-.5h-11Z" fill="currentColor"/>
9
11
  </svg>
10
- `, ot = `
12
+ `, dt = `
11
13
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
12
14
  <path d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.12l3.71-3.9a.75.75 0 1 1 1.08 1.04l-4.25 4.47a.75.75 0 0 1-1.08 0L5.2 8.27a.75.75 0 0 1 .02-1.06Z" fill="currentColor"/>
13
15
  </svg>
14
- `, lt = `
16
+ `, ut = `
15
17
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
16
18
  <path d="M5.22 5.22a.75.75 0 0 1 1.06 0L10 8.94l3.72-3.72a.75.75 0 1 1 1.06 1.06L11.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06L10 11.06l-3.72 3.72a.75.75 0 1 1-1.06-1.06L8.94 10 5.22 6.28a.75.75 0 0 1 0-1.06Z" fill="currentColor"/>
17
19
  </svg>
@@ -19,7 +21,7 @@ const at = `
19
21
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
20
22
  <path d="M10 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16Zm0 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13Zm.75 2.75a.75.75 0 0 0-1.5 0v3.88c0 .2.08.4.22.54l2.5 2.5a.75.75 0 1 0 1.06-1.06l-2.28-2.28V6.25Z" fill="currentColor"/>
21
23
  </svg>
22
- `, dt = `
24
+ `, ct = `
23
25
  :host {
24
26
  --ui-dtp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
25
27
  --ui-dtp-surface: linear-gradient(
@@ -285,7 +287,7 @@ const at = `
285
287
  outline-color: Highlight;
286
288
  }
287
289
  }
288
- `, ut = `
290
+ `, pt = `
289
291
  .overlay { position: fixed; z-index: var(--ui-dtp-z, 1600); pointer-events: none; }
290
292
  .panel {
291
293
  pointer-events: auto;
@@ -455,15 +457,17 @@ function c(h) {
455
457
  return h.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
456
458
  }
457
459
  function U(h) {
458
- const t = Z(h);
460
+ const t = j(h);
459
461
  return t ? { date: t.date, time: t.time } : { date: null, time: null };
460
462
  }
461
463
  function x(h) {
462
- return j(h.date, h.time);
464
+ return Z(h.date, h.time);
463
465
  }
464
- class ct extends Y {
466
+ class ht extends W {
465
467
  constructor() {
466
- super(...arguments), this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-dtp-${++rt}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = J(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = () => this._schedulePosition.run();
468
+ super(...arguments), this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._open = !1, this._syncing = !1, this._overlay = null, this._dismissableLayer = null, this._releaseScrollLock = null, this._isInitialized = !1, this._hasView = !1, this._restoreFocusEl = null, this._overlayKey = null, this._uid = `ui-dtp-${++ot}`, this._inputId = `${this._uid}-input`, this._labelId = `${this._uid}-label`, this._hintId = `${this._uid}-hint`, this._errorId = `${this._uid}-error`, this._panelId = `${this._uid}-panel`, this._schedulePosition = G(() => this._positionOverlay()), this._onRootClickBound = (t) => this._onRootClick(t), this._onRootInputBound = (t) => this._onRootInput(t), this._onRootChangeBound = (t) => this._onRootChange(t), this._onRootBlurBound = (t) => this._onRootBlur(t), this._onRootKeyDownBound = (t) => this._onRootKeyDown(t), this._onOverlayClickBound = (t) => this._onOverlayClick(t), this._onOverlayChangeBound = (t) => this._onOverlayChange(t), this._onOverlayCalendarBound = (t) => this._onOverlayCalendar(t), this._onDocumentPointerDownBound = (t) => this._onDocumentPointerDown(t), this._onDocumentKeyDownBound = (t) => this._onDocumentKeyDown(t), this._onWindowResizeBound = () => this._schedulePosition.run(), this._onWindowScrollBound = (t) => {
469
+ Q(t, [this._overlay]) || this._schedulePosition.run();
470
+ };
467
471
  }
468
472
  static get observedAttributes() {
469
473
  return [
@@ -520,7 +524,7 @@ class ct extends Y {
520
524
  return (this.getAttribute("mode") || "popover") === "inline";
521
525
  }
522
526
  _isMobileSheet() {
523
- return G(this.getAttribute("mode"));
527
+ return X(this.getAttribute("mode"));
524
528
  }
525
529
  _isDisabled() {
526
530
  return this.hasAttribute("disabled");
@@ -554,10 +558,10 @@ class ct extends Y {
554
558
  return v(this.getAttribute("bare"), !1);
555
559
  }
556
560
  _locale() {
557
- return Q(this.getAttribute("locale"));
561
+ return tt(this.getAttribute("locale"));
558
562
  }
559
563
  _translations() {
560
- return W(
564
+ return J(
561
565
  this.getAttribute("locale"),
562
566
  this.getAttribute("translations")
563
567
  );
@@ -569,24 +573,24 @@ class ct extends Y {
569
573
  _formatDisplay(t) {
570
574
  if (!t.date || !t.time)
571
575
  return "";
572
- const e = X(t.date, this._locale(), "locale", null);
573
- return this._is12h() ? `${e} ${tt(t.time, this._locale())}` : `${e} ${t.time}`;
576
+ const e = et(t.date, this._locale(), "locale", null);
577
+ return this._is12h() ? `${e} ${it(t.time, this._locale())}` : `${e} ${t.time}`;
574
578
  }
575
579
  _is12h() {
576
580
  return (this.getAttribute("format") || "24h") === "12h";
577
581
  }
578
582
  _parseDateInput(t) {
579
- const e = E(t);
583
+ const e = R(t);
580
584
  if (e)
581
585
  return e;
582
- const i = et(t, this._locale());
586
+ const i = st(t, this._locale());
583
587
  if (i)
584
588
  return i;
585
- const n = new Date(t);
586
- if (!Number.isFinite(n.getTime()))
589
+ const s = new Date(t);
590
+ if (!Number.isFinite(s.getTime()))
587
591
  return null;
588
- const a = n.getFullYear(), o = String(n.getMonth() + 1).padStart(2, "0"), s = String(n.getDate()).padStart(2, "0");
589
- return `${a}-${o}-${s}`;
592
+ const a = s.getFullYear(), o = String(s.getMonth() + 1).padStart(2, "0"), n = String(s.getDate()).padStart(2, "0");
593
+ return `${a}-${o}-${n}`;
590
594
  }
591
595
  _syncOpenAttribute(t) {
592
596
  this._syncing = !0;
@@ -645,16 +649,16 @@ class ct extends Y {
645
649
  _clampState(t) {
646
650
  if (!t.date)
647
651
  return { date: null, time: t.time };
648
- const e = this._minDate(), i = this._maxDate(), n = it(t.date, e, i), a = t.time || "00:00";
649
- let o = this._minDateTime(), s = this._maxDateTime();
650
- if (o && s && L(o, s) > 0) {
652
+ const e = this._minDate(), i = this._maxDate(), s = nt(t.date, e, i), a = t.time || "00:00";
653
+ let o = this._minDateTime(), n = this._maxDateTime();
654
+ if (o && n && E(o, n) > 0) {
651
655
  const b = o;
652
- o = s, s = b;
656
+ o = n, n = b;
653
657
  }
654
- let r = j(n, a) || `${n}T00:00`;
655
- o && L(r, o) < 0 && (r = o), s && L(r, s) > 0 && (r = s);
656
- const d = Z(r);
657
- return d ? { date: d.date, time: d.time } : { date: n, time: a };
658
+ let r = Z(s, a) || `${s}T00:00`;
659
+ o && E(r, o) < 0 && (r = o), n && E(r, n) > 0 && (r = n);
660
+ const d = j(r);
661
+ return d ? { date: d.date, time: d.time } : { date: s, time: a };
658
662
  }
659
663
  _commit(t, e) {
660
664
  if (this._isInteractionBlocked() || this._isReadonly())
@@ -663,15 +667,15 @@ class ct extends Y {
663
667
  this._value = { date: null, time: null }, this._pending = { date: null, time: null }, this._draft = "", this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
664
668
  return;
665
669
  }
666
- const i = y(t.time || "", !0), n = this._clampState({
667
- date: E(t.date),
670
+ const i = y(t.time || "", !0), s = this._clampState({
671
+ date: R(t.date),
668
672
  time: i ? `${p(i.hours)}:${p(i.minutes)}` : null
669
673
  });
670
- if (!n.date || !n.time) {
674
+ if (!s.date || !s.time) {
671
675
  this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(JSON.stringify(t), "parse"), this._updateHostState();
672
676
  return;
673
677
  }
674
- this._value = n, this._pending = { ...n }, this._draft = this._formatDisplay(n), this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
678
+ this._value = s, this._pending = { ...s }, this._draft = this._formatDisplay(s), this._inlineError = "", this._syncValueAttribute(this._value), this._emitInput(e), this._emitChange(e), this._updateHostState();
675
679
  }
676
680
  _setOpen(t, e) {
677
681
  t && this._isInteractionBlocked() || this._open !== t && (this._open = t, this._syncOpenAttribute(t), this._syncOverlay(e), this._updateHostState(), this.dispatchEvent(new CustomEvent(t ? "open" : "close", { bubbles: !0, composed: !0 })));
@@ -697,10 +701,31 @@ class ct extends Y {
697
701
  if (this._overlay || typeof document > "u")
698
702
  return;
699
703
  const t = document.createElement("div");
700
- t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.zIndex = "1100", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), t.addEventListener("select", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, !0), this._isMobileSheet() && (this._releaseScrollLock = nt());
704
+ t.style.position = "fixed", t.style.left = "0", t.style.top = "0", t.style.pointerEvents = "none", t.addEventListener("click", this._onOverlayClickBound), t.addEventListener("change", this._onOverlayChangeBound), t.addEventListener("change", this._onOverlayCalendarBound), t.addEventListener("select", this._onOverlayCalendarBound), document.body.appendChild(t), this._overlay = t, this._syncOverlayHostZIndex(), document.addEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.addEventListener("keydown", this._onDocumentKeyDownBound), window.addEventListener("resize", this._onWindowResizeBound), window.addEventListener("scroll", this._onWindowScrollBound, { passive: !0, capture: !0 }), this._isMobileSheet() && (this._releaseScrollLock = rt());
705
+ }
706
+ _syncOverlayHostZIndex() {
707
+ if (!this._overlay || typeof window > "u")
708
+ return;
709
+ const t = window.getComputedStyle(this).getPropertyValue("--ui-dtp-z").trim();
710
+ this._overlay.style.zIndex = t || "1600";
701
711
  }
702
712
  _destroyOverlay() {
703
- this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.removeEventListener("select", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
713
+ var t;
714
+ (t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, this._overlay && (this._schedulePosition.cancel(), document.removeEventListener("pointerdown", this._onDocumentPointerDownBound, !0), document.removeEventListener("keydown", this._onDocumentKeyDownBound), window.removeEventListener("resize", this._onWindowResizeBound), window.removeEventListener("scroll", this._onWindowScrollBound, !0), this._overlay.removeEventListener("click", this._onOverlayClickBound), this._overlay.removeEventListener("change", this._onOverlayChangeBound), this._overlay.removeEventListener("change", this._onOverlayCalendarBound), this._overlay.removeEventListener("select", this._onOverlayCalendarBound), this._overlay.parentElement && this._overlay.parentElement.removeChild(this._overlay), this._overlay = null, this._overlayKey = null, this._releaseScrollLock && (this._releaseScrollLock(), this._releaseScrollLock = null));
715
+ }
716
+ _syncDismissableLayer() {
717
+ var i;
718
+ if ((i = this._dismissableLayer) == null || i.destroy(), this._dismissableLayer = null, !this._open || !this._overlay)
719
+ return;
720
+ const t = this._overlay.querySelector(".panel, .sheet"), e = this.root.querySelector(".field");
721
+ t && (this._dismissableLayer = Y({
722
+ node: t,
723
+ trigger: e,
724
+ closeOnEscape: !0,
725
+ closeOnPointerOutside: !0,
726
+ closeOnFocusOutside: !1,
727
+ onBeforeDismiss: (s) => s === "escape-key" ? (this._setOpen(!1, "escape"), !1) : (s === "outside-pointer" && this._setOpen(!1, "outside"), !1)
728
+ }));
704
729
  }
705
730
  _positionOverlay() {
706
731
  if (!this._overlay || !this._open || this._isMobileSheet())
@@ -708,21 +733,27 @@ class ct extends Y {
708
733
  const t = this.root.querySelector(".field"), e = this._overlay.querySelector(".panel");
709
734
  if (!t || !e)
710
735
  return;
711
- const i = st(t.getBoundingClientRect(), e.getBoundingClientRect());
712
- e.style.position = "absolute", e.style.top = `${Math.round(i.top)}px`, e.style.left = `${Math.round(i.left)}px`;
736
+ const i = e.getAttribute("data-placement"), s = at(
737
+ t.getBoundingClientRect(),
738
+ e.getBoundingClientRect(),
739
+ 8,
740
+ 8,
741
+ i === "top" ? "top" : i === "bottom" ? "bottom" : null
742
+ );
743
+ e.style.position = "absolute", e.style.top = `${Math.round(s.top)}px`, e.style.left = `${Math.round(s.left)}px`, e.setAttribute("data-placement", s.placement);
713
744
  }
714
745
  _timeOptions() {
715
- const t = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (o, s) => {
716
- const r = s + 1, d = t.hours % 12 || 12;
746
+ const t = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 }, e = this._minuteStep(), i = this._is12h() ? Array.from({ length: 12 }, (o, n) => {
747
+ const r = n + 1, d = t.hours % 12 || 12;
717
748
  return `<option value="${r}" ${r === d ? "selected" : ""}>${p(r)}</option>`;
718
- }).join("") : Array.from({ length: 24 }, (o, s) => `<option value="${s}" ${s === t.hours ? "selected" : ""}>${p(s)}</option>`).join(""), n = Array.from({ length: Math.ceil(60 / e) }, (o, s) => {
719
- const r = Math.min(59, s * e);
749
+ }).join("") : Array.from({ length: 24 }, (o, n) => `<option value="${n}" ${n === t.hours ? "selected" : ""}>${p(n)}</option>`).join(""), s = Array.from({ length: Math.ceil(60 / e) }, (o, n) => {
750
+ const r = Math.min(59, n * e);
720
751
  return `<option value="${r}" ${r === t.minutes ? "selected" : ""}>${p(r)}</option>`;
721
752
  }).join(""), a = t.hours >= 12 ? "pm" : "am";
722
- return { hours: i, minutes: n, meridiem: a };
753
+ return { hours: i, minutes: s, meridiem: a };
723
754
  }
724
755
  _renderSurfaceInner(t, e = !1) {
725
- const i = this._translations(), n = this._timeOptions(), a = (this.getAttribute("label") || "").trim(), o = c(a), s = c(a || i.selectDate), r = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : "", d = `
756
+ const i = this._translations(), s = this._timeOptions(), a = (this.getAttribute("label") || "").trim(), o = c(a), n = c(a || i.selectDate), r = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : "", d = `
726
757
  <header class="head">
727
758
  <div>
728
759
  <p class="head-title" ${a ? "" : "hidden"}>${o}</p>
@@ -734,9 +765,9 @@ class ct extends Y {
734
765
  <section class="time-panel" part="time">
735
766
  <span class="icon" aria-hidden="true">${K}</span>
736
767
  <div class="time-grid" data-meridiem="${this._is12h() ? "true" : "false"}">
737
- <div><label>${c(i.hour)}</label><select data-segment="hours">${n.hours}</select></div>
738
- <div><label>${c(i.minute)}</label><select data-segment="minutes">${n.minutes}</select></div>
739
- ${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem"><option value="am" ${n.meridiem === "am" ? "selected" : ""}>${c(i.am)}</option><option value="pm" ${n.meridiem === "pm" ? "selected" : ""}>${c(i.pm)}</option></select></div>` : ""}
768
+ <div><label>${c(i.hour)}</label><select data-segment="hours">${s.hours}</select></div>
769
+ <div><label>${c(i.minute)}</label><select data-segment="minutes">${s.minutes}</select></div>
770
+ ${this._is12h() ? `<div><label>${c(i.meridiem)}</label><select data-segment="meridiem"><option value="am" ${s.meridiem === "am" ? "selected" : ""}>${c(i.am)}</option><option value="pm" ${s.meridiem === "pm" ? "selected" : ""}>${c(i.pm)}</option></select></div>` : ""}
740
771
  </div>
741
772
  </section>
742
773
  </div>
@@ -748,20 +779,20 @@ class ct extends Y {
748
779
  </footer>
749
780
  `;
750
781
  return e ? d : `
751
- <style>${ut}</style>
782
+ <style>${pt}</style>
752
783
  ${t ? '<div class="sheet-backdrop" data-action="backdrop"></div>' : ""}
753
- <section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${s}" part="${t ? "sheet" : "popover"}">${d}</section>
784
+ <section class="${t ? "sheet" : "panel"}" id="${this._panelId}" role="dialog" aria-modal="${t ? "true" : "false"}" aria-label="${n}" part="${t ? "sheet" : "popover"}">${d}</section>
754
785
  `;
755
786
  }
756
787
  _syncCalendar(t) {
757
- const e = (s, r) => {
788
+ const e = (n, r) => {
758
789
  if (r == null || r === "") {
759
- t.hasAttribute(s) && t.removeAttribute(s);
790
+ t.hasAttribute(n) && t.removeAttribute(n);
760
791
  return;
761
792
  }
762
- t.getAttribute(s) !== r && t.setAttribute(s, r);
763
- }, i = (s, r) => {
764
- r ? e(s, "") : e(s, null);
793
+ t.getAttribute(n) !== r && t.setAttribute(n, r);
794
+ }, i = (n, r) => {
795
+ r ? e(n, "") : e(n, null);
765
796
  };
766
797
  e("selection", "single"), e("value", this._pending.date), e("min", this.getAttribute("min")), e("max", this.getAttribute("max")), e("locale", this.getAttribute("locale")), e("translations", this.getAttribute("translations")), e("week-start", this.getAttribute("week-start"));
767
798
  const a = this.getAttribute("size") || "sm", o = t.classList.contains("dt-calendar-inline");
@@ -786,20 +817,21 @@ class ct extends Y {
786
817
  const i = Array.from(t.options).map((o) => Number(o.value)).filter((o) => Number.isFinite(o));
787
818
  if (!i.length)
788
819
  return;
789
- let n = i[0], a = Math.abs(n - e);
820
+ let s = i[0], a = Math.abs(s - e);
790
821
  for (let o = 1; o < i.length; o += 1) {
791
- const s = i[o], r = Math.abs(s - e);
792
- r < a && (n = s, a = r);
822
+ const n = i[o], r = Math.abs(n - e);
823
+ r < a && (s = n, a = r);
793
824
  }
794
- t.value = String(n);
825
+ t.value = String(s);
795
826
  }
796
827
  _syncOverlayState() {
797
828
  if (!this._overlay)
798
829
  return;
830
+ this._syncOverlayHostZIndex();
799
831
  const t = this._isMobileSheet();
800
- this._ensureOverlayContent(t);
801
- const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), n = this._overlay.querySelector(".footer");
802
- i && (i.dataset.bare = this._isBare() ? "true" : "false"), n && (n.hidden = !this._showFooter());
832
+ this._ensureOverlayContent(t), this._syncDismissableLayer();
833
+ const e = this._translations(), i = this._overlay.querySelector(".panel, .sheet"), s = this._overlay.querySelector(".footer");
834
+ i && (i.dataset.bare = this._isBare() ? "true" : "false"), s && (s.hidden = !this._showFooter());
803
835
  const a = this._overlay.querySelector(".head-title");
804
836
  if (a) {
805
837
  const l = (this.getAttribute("label") || "").trim();
@@ -807,8 +839,8 @@ class ct extends Y {
807
839
  }
808
840
  const o = this._overlay.querySelector(".head-meta");
809
841
  o && (o.textContent = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : e.selectDate);
810
- const s = this._overlay.querySelector(".dt-calendar");
811
- s && this._syncCalendar(s);
842
+ const n = this._overlay.querySelector(".dt-calendar");
843
+ n && this._syncCalendar(n);
812
844
  const r = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 }, d = this._overlay.querySelector('select[data-segment="hours"]'), b = this._overlay.querySelector('select[data-segment="minutes"]'), m = this._overlay.querySelector('select[data-segment="meridiem"]');
813
845
  if (d) {
814
846
  const l = this._is12h() ? r.hours % 12 || 12 : r.hours;
@@ -824,28 +856,28 @@ class ct extends Y {
824
856
  this._syncOverlayState();
825
857
  }
826
858
  _applyTimeFromSurface(t) {
827
- const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'), n = t.querySelector('select[data-segment="meridiem"]');
859
+ const e = t.querySelector('select[data-segment="hours"]'), i = t.querySelector('select[data-segment="minutes"]'), s = t.querySelector('select[data-segment="meridiem"]');
828
860
  if (!e || !i)
829
861
  return;
830
862
  const a = Number(e.value), o = Number(i.value);
831
863
  if (!Number.isFinite(a) || !Number.isFinite(o))
832
864
  return;
833
- let s = a;
865
+ let n = a;
834
866
  if (this._is12h()) {
835
- const r = (n == null ? void 0 : n.value) === "pm" ? "pm" : "am";
836
- r === "pm" && s < 12 && (s += 12), r === "am" && s === 12 && (s = 0);
867
+ const r = (s == null ? void 0 : s.value) === "pm" ? "pm" : "am";
868
+ r === "pm" && n < 12 && (n += 12), r === "am" && n === 12 && (n = 0);
837
869
  }
838
870
  this._pending = this._clampState({
839
871
  date: this._pending.date,
840
- time: `${p(s)}:${p(o)}`
872
+ time: `${p(n)}:${p(o)}`
841
873
  }), this._emitInput("time");
842
874
  }
843
875
  _onRootClick(t) {
844
- var n;
876
+ var s;
845
877
  const e = t.target;
846
878
  if (!e)
847
879
  return;
848
- const i = (n = e.closest("[data-action]")) == null ? void 0 : n.getAttribute("data-action");
880
+ const i = (s = e.closest("[data-action]")) == null ? void 0 : s.getAttribute("data-action");
849
881
  if (i && !(this._isInteractionBlocked() || this._isReadonly())) {
850
882
  if (i === "toggle") {
851
883
  this._restoreFocusEl = e, this._setOpen(!this._open, "toggle");
@@ -856,7 +888,7 @@ class ct extends Y {
856
888
  return;
857
889
  }
858
890
  if (this._isInlineMode() && i === "now") {
859
- const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), s = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${s}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
891
+ const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), n = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${n}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
860
892
  this._pending = this._clampState({ date: r, time: d }), this._emitInput("now"), this._updateHostState();
861
893
  return;
862
894
  }
@@ -903,12 +935,12 @@ class ct extends Y {
903
935
  this._commit({ date: null, time: null }, "blur");
904
936
  return;
905
937
  }
906
- const n = /^(.+)\s+(\d{1,2}:\d{2}(?::\d{2})?(?:\s?[ap]m)?)$/i.exec(i);
907
- if (!n) {
938
+ const s = /^(.+)\s+(\d{1,2}:\d{2}(?::\d{2})?(?:\s?[ap]m)?)$/i.exec(i);
939
+ if (!s) {
908
940
  this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
909
941
  return;
910
942
  }
911
- const a = this._parseDateInput(n[1]), o = y(n[2], !0) ? n[2] : null;
943
+ const a = this._parseDateInput(s[1]), o = y(s[2], !0) ? s[2] : null;
912
944
  if (!a || !o) {
913
945
  this._inlineError = this.getAttribute("error") || this._translations().invalidDateTime, this._emitInvalid(i, "parse"), this._updateHostState();
914
946
  return;
@@ -926,11 +958,11 @@ class ct extends Y {
926
958
  }
927
959
  }
928
960
  _onOverlayClick(t) {
929
- var n;
961
+ var s;
930
962
  const e = t.target;
931
963
  if (!e)
932
964
  return;
933
- const i = (n = e.closest("[data-action]")) == null ? void 0 : n.getAttribute("data-action");
965
+ const i = (s = e.closest("[data-action]")) == null ? void 0 : s.getAttribute("data-action");
934
966
  if (i && !this._isInteractionBlocked() && !(this._isReadonly() && i !== "toggle")) {
935
967
  if (i === "backdrop") {
936
968
  this._setOpen(!1, "outside");
@@ -945,7 +977,7 @@ class ct extends Y {
945
977
  return;
946
978
  }
947
979
  if (i === "now") {
948
- const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), s = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${s}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
980
+ const a = /* @__PURE__ */ new Date(), o = String(a.getMonth() + 1).padStart(2, "0"), n = String(a.getDate()).padStart(2, "0"), r = `${a.getFullYear()}-${o}-${n}`, d = `${p(a.getHours())}:${p(a.getMinutes())}`;
949
981
  this._pending = this._clampState({ date: r, time: d }), this._emitInput("now"), this._renderOverlay();
950
982
  return;
951
983
  }
@@ -962,7 +994,7 @@ class ct extends Y {
962
994
  const e = t.target;
963
995
  if (!e || e.tagName.toLowerCase() !== "ui-calendar")
964
996
  return;
965
- const i = t.type, n = t.detail, a = E(i === "select" ? (n == null ? void 0 : n.value) || null : n == null ? void 0 : n.value);
997
+ const i = t.type, s = t.detail, a = R(i === "select" ? (s == null ? void 0 : s.value) || null : s == null ? void 0 : s.value);
966
998
  if (a) {
967
999
  if (this._pending = this._clampState({ date: a, time: this._pending.time || "09:00" }), this._emitInput("calendar"), this._shouldAutoCommit() && this._pending.time) {
968
1000
  this._commit(this._pending, "calendar"), this._setOpen(!1, "calendar");
@@ -983,23 +1015,23 @@ class ct extends Y {
983
1015
  _updateHostState() {
984
1016
  if (!this._hasView)
985
1017
  return;
986
- const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", n = this._inlineError || i, a = !!x(this._value), o = this.getAttribute("name") || "", s = this._allowInput() ? this._draft : this._formatDisplay(this._value), r = this._isInlineMode(), d = this._translations(), b = n ? "error" : this._state();
1018
+ const t = this.getAttribute("label") || "", e = this.getAttribute("hint") || "", i = this.getAttribute("error") || "", s = this._inlineError || i, a = !!x(this._value), o = this.getAttribute("name") || "", n = this._allowInput() ? this._draft : this._formatDisplay(this._value), r = this._isInlineMode(), d = this._translations(), b = s ? "error" : this._state();
987
1019
  this._state() === "loading" ? this.setAttribute("aria-busy", "true") : this.removeAttribute("aria-busy");
988
- const m = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), $ = this.root.querySelector(".required"), l = this.root.querySelector(".input"), I = this.root.querySelector('.btn[data-action="clear"]'), f = this.root.querySelector('.btn[data-action="toggle"]'), g = this.root.querySelector(".hint"), w = this.root.querySelector(".error"), k = this.root.querySelector(".hidden-input");
989
- if (m && (m.hidden = !t), m && (m.id = this._labelId, m.setAttribute("for", this._inputId)), S && (S.textContent = t), $ && ($.hidden = !this.hasAttribute("required")), l && (l.value !== s && (l.value = s), l.id = this._inputId, l.placeholder = d.dateTimePlaceholder, l.readOnly = !this._allowInput() || this._isReadonly(), l.disabled = this._isInteractionBlocked(), l.required = this.hasAttribute("required"), l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-expanded", r ? "false" : String(this._open)), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-invalid", n ? "true" : "false"), t ? l.setAttribute("aria-labelledby", this._labelId) : l.removeAttribute("aria-labelledby")), I && (I.hidden = !(this._clearable() && a), I.setAttribute("aria-label", d.clear), I.disabled = this._isInteractionBlocked()), f && (f.hidden = r, f.setAttribute("aria-label", d.toggleCalendar), f.setAttribute("aria-expanded", r ? "false" : String(this._open)), f.setAttribute("aria-controls", this._panelId), f.disabled = this._isInteractionBlocked()), g && (g.id = this._hintId, g.hidden = !e, g.textContent = e), w && (w.id = this._errorId, w.hidden = !n, w.textContent = n), l) {
1020
+ const m = this.root.querySelector(".label"), S = this.root.querySelector(".label-text"), D = this.root.querySelector(".required"), l = this.root.querySelector(".input"), I = this.root.querySelector('.btn[data-action="clear"]'), f = this.root.querySelector('.btn[data-action="toggle"]'), g = this.root.querySelector(".hint"), w = this.root.querySelector(".error"), k = this.root.querySelector(".hidden-input");
1021
+ if (m && (m.hidden = !t), m && (m.id = this._labelId, m.setAttribute("for", this._inputId)), S && (S.textContent = t), D && (D.hidden = !this.hasAttribute("required")), l && (l.value !== n && (l.value = n), l.id = this._inputId, l.placeholder = d.dateTimePlaceholder, l.readOnly = !this._allowInput() || this._isReadonly(), l.disabled = this._isInteractionBlocked(), l.required = this.hasAttribute("required"), l.autocomplete = "off", l.setAttribute("role", "combobox"), l.setAttribute("aria-haspopup", "dialog"), l.setAttribute("aria-expanded", r ? "false" : String(this._open)), l.setAttribute("aria-controls", this._panelId), l.setAttribute("aria-invalid", s ? "true" : "false"), t ? l.setAttribute("aria-labelledby", this._labelId) : l.removeAttribute("aria-labelledby")), I && (I.hidden = !(this._clearable() && a), I.setAttribute("aria-label", d.clear), I.disabled = this._isInteractionBlocked()), f && (f.hidden = r, f.setAttribute("aria-label", d.toggleCalendar), f.setAttribute("aria-expanded", r ? "false" : String(this._open)), f.setAttribute("aria-controls", this._panelId), f.disabled = this._isInteractionBlocked()), g && (g.id = this._hintId, g.hidden = !e, g.textContent = e), w && (w.id = this._errorId, w.hidden = !s, w.textContent = s), l) {
990
1022
  const _ = [];
991
- e && g && !g.hidden && _.push(this._hintId), n && _.push(this._errorId), _.length ? l.setAttribute("aria-describedby", _.join(" ")) : l.removeAttribute("aria-describedby");
1023
+ e && g && !g.hidden && _.push(this._hintId), s && _.push(this._errorId), _.length ? l.setAttribute("aria-describedby", _.join(" ")) : l.removeAttribute("aria-describedby");
992
1024
  }
993
1025
  k && (k.disabled = !o, k.name = o, k.value = x(this._value) || "");
994
- const C = this.root.querySelector(".field");
995
- C && (C.dataset.open = this._open && !r ? "true" : "false", C.dataset.invalid = n ? "true" : "false", C.dataset.state = b);
1026
+ const A = this.root.querySelector(".field");
1027
+ A && (A.dataset.open = this._open && !r ? "true" : "false", A.dataset.invalid = s ? "true" : "false", A.dataset.state = b);
996
1028
  const u = this.root.querySelector(".inline-panel");
997
1029
  if (u) {
998
1030
  u.hidden = !r, u.id = this._panelId, u.dataset.bare = this._isBare() ? "true" : "false", u.setAttribute("role", "dialog"), u.setAttribute("aria-modal", "false"), u.setAttribute("aria-label", t || d.selectDate);
999
1031
  const _ = u.querySelector(".panel-title");
1000
1032
  _ && (_.textContent = t, _.hidden = !t);
1001
- const D = u.querySelector(".head-title");
1002
- D && (D.textContent = t, D.hidden = !t);
1033
+ const $ = u.querySelector(".head-title");
1034
+ $ && ($.textContent = t, $.hidden = !t);
1003
1035
  const q = u.querySelector(".head-meta");
1004
1036
  q && (q.textContent = this._pending.date && this._pending.time ? this._formatDisplay(this._pending) : d.selectDate);
1005
1037
  const T = u.querySelector('[data-action="now"]');
@@ -1012,13 +1044,13 @@ class ct extends Y {
1012
1044
  H && (H.hidden = !this._showFooter());
1013
1045
  const V = u.querySelector(".dt-calendar-inline");
1014
1046
  V && this._syncCalendar(V);
1015
- const B = u.querySelector('select[data-segment="hours"]'), O = u.querySelector('select[data-segment="minutes"]'), z = u.querySelector('select[data-segment="meridiem"]'), A = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 };
1016
- if (B) {
1017
- const R = this._is12h() ? A.hours % 12 || 12 : A.hours;
1018
- this._setClosestOptionValue(B, R), B.disabled = this._isInteractionBlocked() || this._isReadonly();
1047
+ const O = u.querySelector('select[data-segment="hours"]'), B = u.querySelector('select[data-segment="minutes"]'), z = u.querySelector('select[data-segment="meridiem"]'), C = y(this._pending.time || "00:00", !0) || { hours: 0, minutes: 0, seconds: 0 };
1048
+ if (O) {
1049
+ const L = this._is12h() ? C.hours % 12 || 12 : C.hours;
1050
+ this._setClosestOptionValue(O, L), O.disabled = this._isInteractionBlocked() || this._isReadonly();
1019
1051
  }
1020
- O && (this._setClosestOptionValue(O, A.minutes), O.disabled = this._isInteractionBlocked() || this._isReadonly()), z && (z.value = A.hours >= 12 ? "pm" : "am", z.disabled = this._isInteractionBlocked() || this._isReadonly()), u.querySelectorAll(".action").forEach((R) => {
1021
- R.disabled = this._isInteractionBlocked() || this._isReadonly();
1052
+ B && (this._setClosestOptionValue(B, C.minutes), B.disabled = this._isInteractionBlocked() || this._isReadonly()), z && (z.value = C.hours >= 12 ? "pm" : "am", z.disabled = this._isInteractionBlocked() || this._isReadonly()), u.querySelectorAll(".action").forEach((L) => {
1053
+ L.disabled = this._isInteractionBlocked() || this._isReadonly();
1022
1054
  });
1023
1055
  }
1024
1056
  !r && this._open && this._syncOverlayState(), r && this._destroyOverlay();
@@ -1027,18 +1059,18 @@ class ct extends Y {
1027
1059
  if (!this._hasView) {
1028
1060
  const t = this._translations();
1029
1061
  this.setContent(`
1030
- <style>${dt}</style>
1062
+ <style>${ct}</style>
1031
1063
  <div class="root">
1032
1064
  <label class="label" part="label" id="${this._labelId}">
1033
1065
  <span class="label-text"></span>
1034
1066
  <span class="required">*</span>
1035
1067
  </label>
1036
1068
  <div class="field" part="field input">
1037
- <span class="icon" part="icon">${at}</span>
1069
+ <span class="icon" part="icon">${lt}</span>
1038
1070
  <input class="input" id="${this._inputId}" part="input" />
1039
1071
  <span class="icon" part="icon">${K}</span>
1040
- <button type="button" class="btn" part="clear" data-action="clear">${lt}</button>
1041
- <button type="button" class="btn" part="toggle" data-action="toggle">${ot}</button>
1072
+ <button type="button" class="btn" part="clear" data-action="clear">${ut}</button>
1073
+ <button type="button" class="btn" part="toggle" data-action="toggle">${dt}</button>
1042
1074
  </div>
1043
1075
  <div class="hint" id="${this._hintId}" part="hint"></div>
1044
1076
  <div class="error" id="${this._errorId}" part="error" role="alert"></div>
@@ -1056,7 +1088,7 @@ class ct extends Y {
1056
1088
  return !1;
1057
1089
  }
1058
1090
  }
1059
- typeof customElements < "u" && !customElements.get("ui-date-time-picker") && customElements.define("ui-date-time-picker", ct);
1091
+ typeof customElements < "u" && !customElements.get("ui-date-time-picker") && customElements.define("ui-date-time-picker", ht);
1060
1092
  export {
1061
- ct as UIDateTimePicker
1093
+ ht as UIDateTimePicker
1062
1094
  };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./calendar-a8735e40.js"),C=require("./scroll-lock-d7b0df21.js"),I=require("./positioner-33529bb8.js"),w=new Map,v=24;function y(t,e,n){return Math.max(e,Math.min(n,t))}function s(t){return String(t).padStart(2,"0")}function b(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function N(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function O(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function L(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function U(t,e=!1){if(t==null)return e;const n=t.trim().toLowerCase();return n?n!=="false"&&n!=="0"&&n!=="off"&&n!=="no":!0}function F(t,e){const n=typeof t.composedPath=="function"?t.composedPath():[];for(const o of e)if(o&&n.includes(o))return!0;const r=t.target;if(!(r instanceof Node))return!1;for(const o of e)if(o instanceof Node&&o.contains(r))return!0;return!1}function P(t){const e=(t||"").trim();return e||(typeof navigator<"u"&&navigator.language?navigator.language:"en-US")}function m(t){if(!t)return null;const e=l.parseISO(t);return e?`${e.y}-${s(e.m)}-${s(e.d)}`:null}function g(t){if(!t)return null;const e=/^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());if(!e)return null;const n=m(e[1]);if(!n)return null;const r=d(e[2],!0);if(!r)return null;const o=e[2].split(":").length===3;return{date:n,time:M(r,o)}}function z(t,e){if(!t||!e)return null;const n=m(t),r=d(e,!0);return!n||!r?null:`${n}T${M(r,e.split(":").length>=3)}`}function A(t){if(!t)return null;const e=m(t);if(e)return e;const n=g(t);return(n==null?void 0:n.date)||null}function Y(t){if(!t)return null;const e=g(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function k(t,e,n){const r=l.parseISO(t);if(!r)return t;const o=`${e}::${JSON.stringify(n||{})}`;let i=w.get(o);return i||(i=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC",...n||{}}),w.set(o,i)),i.format(new Date(Date.UTC(r.y,r.m-1,r.d)))}function q(t,e,n,r){if(!t)return"";if(n==="iso")return t;if(n==="custom"&&r){const o=l.parseISO(t);if(!o)return t;const i=O(e),u=L(e);return r.replace(/YYYY/g,String(o.y)).replace(/MMM/g,i[o.m-1]||"").replace(/MMMM/g,u[o.m-1]||"").replace(/MM/g,s(o.m)).replace(/DD/g,s(o.d))}return k(t,e)}function B(t,e){const n=m(t.trim());if(n)return n;const r=N(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map($=>$.trim()).filter(Boolean);if(i.length!==3)return null;const u=b(i[0]),a=b(i[1]),h=b(i[2]);if(u==null||a==null||h==null)return null;let f=h;f<100&&(f+=f>=70?1900:2e3);const p=e.toLowerCase().startsWith("en-us"),c=p?u:a,D=p?a:u;if(f<1e3||c<1||c>12||D<1||D>31)return null;const T=`${f}-${s(c)}-${s(D)}`;return m(T)}function d(t,e){const n=t.trim().toLowerCase();if(!n)return null;const r=/^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);if(!r)return null;let o=Number(r[1]);const i=Number(r[2]??"0"),u=Number(r[3]??"0");if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(u)||i<0||i>59||u<0||u>59||!e&&u!==0)return null;const a=r[4];if(a){if(o<1||o>12)return null;a==="pm"&&o<12&&(o+=12),a==="am"&&o===12&&(o=0)}return o<0||o>23?null:{hours:o,minutes:i,seconds:u}}function M(t,e=!1){if(!t)return"";const n=s(y(t.hours,0,23)),r=s(y(t.minutes,0,59));if(!e)return`${n}:${r}`;const o=s(y(t.seconds,0,59));return`${n}:${r}:${o}`}function x(t,e){const n=d(t,!0);if(!n)return t;const r=new Date;return r.setHours(n.hours,n.minutes,n.seconds,0),new Intl.DateTimeFormat(e,{hour:"numeric",minute:"2-digit",second:t.split(":").length>2?"2-digit":void 0,hour12:!0}).format(r)}function S(t,e){const n=d(t,!0),r=d(e,!0);if(!n||!r)return t.localeCompare(e);const o=n.hours*3600+n.minutes*60+n.seconds,i=r.hours*3600+r.minutes*60+r.seconds;return o-i}function H(t,e,n){const r=d(t,!0);if(!r)return t;let o=M(r,t.split(":").length>=3);return e&&S(o,e)<0&&(o=e),n&&S(o,n)>0&&(o=n),o}function E(t,e,n){let r=t;return e&&l.compareISO(r,e)<0&&(r=e),n&&l.compareISO(r,n)>0&&(r=n),r}function W(t,e){const n=g(t),r=g(e);if(!n||!r)return t.localeCompare(e);const o=l.compareISO(n.date,r.date);return o!==0?o:S(n.time,r.time)}function Z(t){const e=l.parseISO(t);if(!e)return{start:t,end:t};const n=l.startOfMonth(e.y,e.m),r=l.endOfMonth(e.y,e.m);return{start:`${n.y}-${s(n.m)}-${s(n.d)}`,end:`${r.y}-${s(r.m)}-${s(r.d)}`}}function _(t,e){const n=y(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function R(t,e,n=8,r=8,o=null){const u=(typeof window<"u"?window.innerHeight:800)-t.bottom-r-n,a=t.top-r-n,h=u>=e.height,f=a>=e.height,p=o==="top"?"top":"bottom";let c;if(h&&!f)c="bottom";else if(f&&!h)c="top";else if(f&&h)c=p;else{const T=p==="bottom"?u:a,$=p==="bottom"?a:u;T>0&&$<=T+v?c=p:c=u>=a?"bottom":"top"}const D=I.computePositionState(t,e,{placement:`${c}-start`,strategy:"fixed",offset:r,shift:!1,flip:!1,boundaryPadding:n});return{top:Math.round(D.y),left:Math.round(D.x),placement:c}}function G(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function J(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function K(){return C.acquireBodyScrollLock()}exports.clampDateIso=E;exports.clampTime=H;exports.combineDateTime=z;exports.compareDateTimes=W;exports.compareTimes=S;exports.computeLastDaysRange=_;exports.computeMonthRange=Z;exports.computePopoverPosition=R;exports.eventOriginatesWithin=F;exports.formatDateForDisplay=q;exports.formatTime=M;exports.isTruthyAttr=U;exports.lockBodyScroll=K;exports.normalizeDateIso=m;exports.normalizeLocale=P;exports.parseConstraintDate=A;exports.parseConstraintDateTime=Y;exports.parseTimeInput=d;exports.parseUserDateInput=B;exports.rafThrottle=G;exports.shouldUseMobileSheet=J;exports.splitDateTime=g;exports.to12hDisplay=x;