@editora/ui-core 0.1.10 → 0.1.13

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 (130) hide show
  1. package/README.md +5 -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 +39 -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-date-picker.d.ts +3 -0
  24. package/dist/components/ui-date-picker.d.ts.map +1 -1
  25. package/dist/components/ui-date-range-picker.d.ts +3 -0
  26. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  27. package/dist/components/ui-date-range-time-picker.d.ts +3 -0
  28. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  29. package/dist/components/ui-date-time-picker.d.ts +3 -0
  30. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  31. package/dist/components/ui-dialog.d.ts +3 -0
  32. package/dist/components/ui-dialog.d.ts.map +1 -1
  33. package/dist/components/ui-drawer.d.ts +14 -0
  34. package/dist/components/ui-drawer.d.ts.map +1 -1
  35. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  36. package/dist/components/ui-icon.d.ts.map +1 -1
  37. package/dist/components/ui-menu.d.ts +1 -0
  38. package/dist/components/ui-menu.d.ts.map +1 -1
  39. package/dist/components/ui-menubar.d.ts +1 -0
  40. package/dist/components/ui-menubar.d.ts.map +1 -1
  41. package/dist/components/ui-quick-actions.d.ts.map +1 -1
  42. package/dist/components/ui-radio.d.ts +47 -0
  43. package/dist/components/ui-radio.d.ts.map +1 -0
  44. package/dist/components/ui-select.d.ts +8 -0
  45. package/dist/components/ui-select.d.ts.map +1 -1
  46. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  47. package/dist/components/ui-split-button.d.ts +2 -0
  48. package/dist/components/ui-split-button.d.ts.map +1 -1
  49. package/dist/components/ui-stepper.d.ts.map +1 -1
  50. package/dist/components/ui-time-picker.d.ts +3 -0
  51. package/dist/components/ui-time-picker.d.ts.map +1 -1
  52. package/dist/context-menu.cjs.js +2 -2
  53. package/dist/context-menu.esm.js +2 -2
  54. package/dist/date-field.cjs.js +1 -1
  55. package/dist/date-field.esm.js +2 -2
  56. package/dist/date-picker.cjs.js +13 -13
  57. package/dist/date-picker.esm.js +100 -67
  58. package/dist/date-range-picker.cjs.js +14 -14
  59. package/dist/date-range-picker.esm.js +98 -65
  60. package/dist/date-range-time-picker.cjs.js +13 -13
  61. package/dist/date-range-time-picker.esm.js +76 -45
  62. package/dist/date-time-picker.cjs.js +13 -13
  63. package/dist/date-time-picker.esm.js +132 -101
  64. package/dist/date-time-utils-378ecc21.js +1 -0
  65. package/dist/{date-time-utils-bdceb7af.mjs → date-time-utils-a8b17ea7.mjs} +128 -102
  66. package/dist/dialog.cjs.js +29 -20
  67. package/dist/dialog.esm.js +90 -70
  68. package/dist/drawer.cjs.js +16 -16
  69. package/dist/drawer.esm.js +216 -98
  70. package/dist/floating-toolbar.cjs.js +3 -13
  71. package/dist/floating-toolbar.esm.js +17 -27
  72. package/dist/hover-card.cjs.js +1 -1
  73. package/dist/hover-card.esm.js +1 -1
  74. package/dist/{icon-eaa486b3.js → icon-9e9da03b.js} +4 -4
  75. package/dist/{icon-9ed13093.mjs → icon-e2a85cc1.mjs} +22 -18
  76. package/dist/icon.cjs.js +1 -1
  77. package/dist/icon.esm.js +1 -1
  78. package/dist/icons.d.ts +1 -1
  79. package/dist/icons.d.ts.map +1 -1
  80. package/dist/index.cjs.js +1 -1
  81. package/dist/index.d.ts +2 -0
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.esm.js +246 -244
  84. package/dist/menu.cjs.js +2 -2
  85. package/dist/menu.esm.js +118 -110
  86. package/dist/menubar.cjs.js +5 -5
  87. package/dist/menubar.esm.js +83 -78
  88. package/dist/{overlayManager-ece06517.js → overlayManager-0eda4e08.js} +1 -1
  89. package/dist/{overlayManager-86454af7.mjs → overlayManager-5bbd4dc3.mjs} +1 -1
  90. package/dist/popover.cjs.js +1 -1
  91. package/dist/popover.esm.js +2 -2
  92. package/dist/{portal-1cf392ca.mjs → portal-9060f7a6.mjs} +7 -7
  93. package/dist/portal-d9bae456.js +1 -0
  94. package/dist/{positioner-fbd61bf1.mjs → positioner-16f3cca1.mjs} +16 -16
  95. package/dist/positioner-43b1c75a.js +1 -0
  96. package/dist/positioner.cjs.js +1 -1
  97. package/dist/positioner.esm.js +1 -1
  98. package/dist/quick-actions.cjs.js +10 -4
  99. package/dist/quick-actions.esm.js +27 -21
  100. package/dist/radio.cjs.js +259 -0
  101. package/dist/radio.esm.js +455 -0
  102. package/dist/{runtime-5f282bc8.js → runtime-668914fe.js} +1 -1
  103. package/dist/{runtime-4ac0107b.mjs → runtime-864efe2f.mjs} +1 -1
  104. package/dist/runtime.cjs.js +1 -1
  105. package/dist/runtime.esm.js +2 -2
  106. package/dist/scroll-lock-31da444f.mjs +56 -0
  107. package/dist/scroll-lock-d7b0df21.js +1 -0
  108. package/dist/scroll-lock.d.ts.map +1 -1
  109. package/dist/select.cjs.js +14 -15
  110. package/dist/select.esm.js +117 -97
  111. package/dist/selection-popup.cjs.js +4 -7
  112. package/dist/selection-popup.esm.js +8 -11
  113. package/dist/split-button.cjs.js +137 -62
  114. package/dist/split-button.esm.js +235 -145
  115. package/dist/standalone/radio.d.ts +2 -0
  116. package/dist/standalone/radio.d.ts.map +1 -0
  117. package/dist/stepper.cjs.js +19 -50
  118. package/dist/stepper.esm.js +17 -48
  119. package/dist/time-field.cjs.js +1 -1
  120. package/dist/time-field.esm.js +14 -14
  121. package/dist/time-picker.cjs.js +15 -15
  122. package/dist/time-picker.esm.js +99 -68
  123. package/dist/tooltip.cjs.js +1 -1
  124. package/dist/tooltip.esm.js +1 -1
  125. package/package.json +2 -2
  126. package/dist/date-time-utils-5cf58cd0.js +0 -1
  127. package/dist/portal-d8d7fbca.js +0 -1
  128. package/dist/positioner-accc6e5f.js +0 -1
  129. package/dist/scroll-lock-48793569.js +0 -1
  130. package/dist/scroll-lock-9de6d328.mjs +0 -53
@@ -20,7 +20,7 @@
20
20
  border: 1px solid var(--ui-stepper-border);
21
21
  border-radius: var(--ui-stepper-radius);
22
22
  background: var(--ui-stepper-bg);
23
- box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
23
+ box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
24
24
  padding: 10px;
25
25
  }
26
26
 
@@ -63,8 +63,8 @@
63
63
  }
64
64
 
65
65
  .trigger:hover {
66
- border-color: color-mix(in srgb, var(--ui-stepper-accent) 34%, var(--ui-stepper-border));
67
- background: color-mix(in srgb, var(--ui-stepper-accent) 8%, transparent);
66
+ border-color: color-mix(in srgb, var(--ui-stepper-accent) 20%, var(--ui-stepper-border));
67
+ background: color-mix(in srgb, var(--ui-stepper-accent) 4%, transparent);
68
68
  }
69
69
 
70
70
  .trigger:focus-visible {
@@ -95,9 +95,8 @@
95
95
  position: absolute;
96
96
  inset: -5px;
97
97
  border-radius: inherit;
98
- border: 1px solid color-mix(in srgb, var(--ui-stepper-accent) 56%, transparent);
99
- opacity: 0.45;
100
- animation: ui-stepper-current-pulse var(--ui-stepper-indicator-duration) ease-out infinite;
98
+ border: 1px solid color-mix(in srgb, var(--ui-stepper-accent) 34%, transparent);
99
+ opacity: 0.18;
101
100
  pointer-events: none;
102
101
  }
103
102
 
@@ -141,19 +140,19 @@
141
140
  }
142
141
 
143
142
  .item[data-state="current"] .trigger {
144
- border-color: color-mix(in srgb, var(--ui-stepper-accent) 46%, transparent);
145
- background: color-mix(in srgb, var(--ui-stepper-accent) 13%, transparent);
143
+ border-color: color-mix(in srgb, var(--ui-stepper-accent) 28%, var(--ui-stepper-border));
144
+ background: color-mix(in srgb, var(--ui-stepper-accent) 7%, transparent);
146
145
  }
147
146
 
148
147
  .item[data-state="current"] .index,
149
148
  .item[data-state="complete"] .index {
150
- border-color: color-mix(in srgb, var(--ui-stepper-accent) 44%, transparent);
151
- background: color-mix(in srgb, var(--ui-stepper-accent) 18%, transparent);
152
- color: color-mix(in srgb, var(--ui-stepper-accent) 86%, #0f172a 14%);
149
+ border-color: color-mix(in srgb, var(--ui-stepper-accent) 28%, var(--ui-stepper-border));
150
+ background: color-mix(in srgb, var(--ui-stepper-accent) 10%, transparent);
151
+ color: color-mix(in srgb, var(--ui-stepper-accent) 68%, #0f172a 32%);
153
152
  }
154
153
 
155
154
  .item[data-state="complete"] .connector {
156
- background: color-mix(in srgb, var(--ui-stepper-accent) 52%, transparent);
155
+ background: color-mix(in srgb, var(--ui-stepper-accent) 32%, transparent);
157
156
  }
158
157
 
159
158
  .item[data-state="current"] .connector::after {
@@ -163,11 +162,10 @@
163
162
  background: linear-gradient(
164
163
  90deg,
165
164
  transparent 0%,
166
- color-mix(in srgb, var(--ui-stepper-accent) 48%, transparent) 50%,
165
+ color-mix(in srgb, var(--ui-stepper-accent) 24%, transparent) 50%,
167
166
  transparent 100%
168
167
  );
169
- transform: translateX(-100%);
170
- animation: ui-stepper-connector-flow var(--ui-stepper-indicator-duration) linear infinite;
168
+ opacity: 0.45;
171
169
  pointer-events: none;
172
170
  }
173
171
 
@@ -175,11 +173,9 @@
175
173
  background: linear-gradient(
176
174
  180deg,
177
175
  transparent 0%,
178
- color-mix(in srgb, var(--ui-stepper-accent) 48%, transparent) 50%,
176
+ color-mix(in srgb, var(--ui-stepper-accent) 24%, transparent) 50%,
179
177
  transparent 100%
180
178
  );
181
- transform: translateY(-100%);
182
- animation-name: ui-stepper-connector-flow-vertical;
183
179
  }
184
180
 
185
181
  .item[data-state="error"] .trigger {
@@ -224,33 +220,6 @@
224
220
  }
225
221
  }
226
222
 
227
- @keyframes ui-stepper-current-pulse {
228
- 0% {
229
- transform: scale(0.9);
230
- opacity: 0.45;
231
- }
232
- 70% {
233
- transform: scale(1.2);
234
- opacity: 0;
235
- }
236
- 100% {
237
- transform: scale(1.2);
238
- opacity: 0;
239
- }
240
- }
241
-
242
- @keyframes ui-stepper-connector-flow {
243
- to {
244
- transform: translateX(100%);
245
- }
246
- }
247
-
248
- @keyframes ui-stepper-connector-flow-vertical {
249
- to {
250
- transform: translateY(100%);
251
- }
252
- }
253
-
254
223
  @media (prefers-contrast: more) {
255
224
  :host {
256
225
  --ui-stepper-border: color-mix(in srgb, var(--ui-stepper-text) 70%, transparent);
@@ -310,24 +279,24 @@
310
279
  border-color: CanvasText;
311
280
  }
312
281
  }
313
- `;function u(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function m(o){if(!o)return[];try{const t=JSON.parse(o);return Array.isArray(t)?t.filter(e=>e&&typeof e=="object"):[]}catch{return[]}}function d(o){if(o==null)return!1;const t=String(o).toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}class b extends g.ElementBase{constructor(){super(),this._observer=null,this._isSyncingValueAttribute=!1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["steps","value","orientation","variant","size","clickable","linear","headless","aria-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(()=>{this.hasAttribute("steps")||this.requestRender()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["slot","data-value","data-label","data-description","data-optional","data-disabled","data-state","disabled"]})}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),super.disconnectedCallback()}attributeChangedCallback(t,e,r){if(e!==r){if(t==="value"){this._isSyncingValueAttribute||this._syncValueUi();return}if(t==="aria-label"){const s=this.root.querySelector(".frame");if(s){s.setAttribute("aria-label",r||"Stepper");return}}this.isConnected&&this.requestRender()}}_fromSlots(){return Array.from(this.querySelectorAll('[slot="step"], [data-step]')).map((e,r)=>{var p;const s=e.getAttribute("data-value")||String(r+1),i=e.getAttribute("data-label")||e.getAttribute("title")||((p=e.textContent)==null?void 0:p.trim())||`Step ${r+1}`,a=e.getAttribute("data-description")||"",l=d(e.getAttribute("data-optional")),n=e.hasAttribute("disabled")||d(e.getAttribute("data-disabled")),c=e.getAttribute("data-state");return{index:r,value:s,label:i,description:a,optional:l,disabled:n,state:c==="complete"||c==="error"||c==="warning"?c:"default"}})}_fromAttr(){return m(this.getAttribute("steps")).map((t,e)=>{const r=t.state==="complete"||t.state==="error"||t.state==="warning"?t.state:"default";return{index:e,value:t.value!=null?String(t.value):String(e+1),label:t.label!=null?String(t.label):`Step ${e+1}`,description:t.description!=null?String(t.description):"",optional:!!t.optional,disabled:!!t.disabled,state:r}})}_steps(){const t=this._fromAttr();return t.length?t:this._fromSlots()}_activeIndex(t){if(!t.length)return-1;const e=this.getAttribute("value")||"";if(e){const s=t.findIndex(i=>i.value===e);if(s>=0)return s}const r=t.find(s=>!s.disabled)||t[0];return r&&this.getAttribute("value")!==r.value&&this.setAttribute("value",r.value),t.findIndex(s=>s.value===r.value)}get value(){return this.getAttribute("value")||""}set value(t){const e=String(t||"");e?this.setAttribute("value",e):this.removeAttribute("value")}goTo(t){const e=this._steps();if(!e.length)return!1;const r=this._activeIndex(e),s=typeof t=="number"?t:e.findIndex(i=>i.value===String(t));return!Number.isInteger(s)||s<0||s>=e.length?!1:this._selectIndex(e,r,s,"api")}next(){const t=this._steps(),e=this._activeIndex(t);if(e<0)return!1;const r=Math.min(t.length-1,e+1);return this._selectIndex(t,e,r,"next")}prev(){const t=this._steps(),e=this._activeIndex(t);if(e<0)return!1;const r=Math.max(0,e-1);return this._selectIndex(t,e,r,"prev")}_selectIndex(t,e,r,s){if(r===e)return!0;const i=t[r];if(!i||i.disabled||this.hasAttribute("linear")&&r>e+1)return!1;const a=t[e],l=new CustomEvent("before-change",{detail:{currentIndex:e,nextIndex:r,currentValue:(a==null?void 0:a.value)||"",nextValue:i.value,trigger:s},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(l))return!1;this.value=i.value;const n={index:r,value:i.value,label:i.label,trigger:s};return this.dispatchEvent(new CustomEvent("input",{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("select",{detail:n,bubbles:!0,composed:!0})),!0}_onClick(t){const e=t.target,r=e==null?void 0:e.closest(".trigger");if(!r||!this.hasAttribute("clickable")&&!this.hasAttribute("linear"))return;const s=Number(r.getAttribute("data-index"));if(!Number.isInteger(s))return;const i=this._steps(),a=this._activeIndex(i);this._selectIndex(i,a,s,"click")}_moveFocus(t,e){const r=Array.from(this.root.querySelectorAll(".trigger:not([disabled])"));if(!r.length)return;const s=r.indexOf(t);if(s<0)return;const i=(s+e+r.length)%r.length;r[i].focus()}_onKeyDown(t){const e=t.target,r=e==null?void 0:e.closest(".trigger");if(!r)return;const s=this.getAttribute("orientation")==="vertical",i=!s&&getComputedStyle(this).direction==="rtl",a=s?"ArrowDown":i?"ArrowLeft":"ArrowRight",l=s?"ArrowUp":i?"ArrowRight":"ArrowLeft";if(t.key===a){t.preventDefault(),this._moveFocus(r,1);return}if(t.key===l){t.preventDefault(),this._moveFocus(r,-1);return}if(t.key==="Home"||t.key==="End"){const n=Array.from(this.root.querySelectorAll(".trigger:not([disabled])"));if(!n.length)return;t.preventDefault(),(t.key==="Home"?n[0]:n[n.length-1]).focus();return}(t.key===" "||t.key==="Enter")&&(t.preventDefault(),r.click())}_syncValueUi(){if(!this.isConnected)return;if(!this.root.querySelector(".list")){this.requestRender();return}const t=this._steps();if(!t.length)return;this._isSyncingValueAttribute=!0;let e=-1;try{e=this._activeIndex(t)}finally{this._isSyncingValueAttribute=!1}Array.from(this.root.querySelectorAll(".item")).forEach((s,i)=>{const a=t[i];if(!a)return;const l=a.state!=="default"?a.state:i<e?"complete":i===e?"current":"upcoming";s.setAttribute("data-state",l),s.setAttribute("data-active",i===e?"true":"false");const n=s.querySelector(".trigger");n&&n.setAttribute("aria-current",i===e?"step":"false");const c=s.querySelector(".index");c&&(c.textContent=i<e?"✓":String(i+1))})}render(){const t=this._steps(),e=this._activeIndex(t),r=this.getAttribute("aria-label")||"Stepper",s=t.map((i,a)=>`
314
- <li class="item" part="item" data-state="${i.state!=="default"?i.state:a<e?"complete":a===e?"current":"upcoming"}" data-active="${a===e?"true":"false"}">
282
+ `;function u(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function h(o){if(!o)return[];try{const e=JSON.parse(o);return Array.isArray(e)?e.filter(t=>t&&typeof t=="object"):[]}catch{return[]}}function d(o){if(o==null)return!1;const e=String(o).toLowerCase();return e!=="false"&&e!=="0"&&e!=="off"}class b extends g.ElementBase{constructor(){super(),this._observer=null,this._isSyncingValueAttribute=!1,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this)}static get observedAttributes(){return["steps","value","orientation","variant","size","clickable","linear","headless","aria-label"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this._observer=new MutationObserver(()=>{this.hasAttribute("steps")||this.requestRender()}),this._observer.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["slot","data-value","data-label","data-description","data-optional","data-disabled","data-state","disabled"]})}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this._observer&&(this._observer.disconnect(),this._observer=null),super.disconnectedCallback()}attributeChangedCallback(e,t,r){if(t!==r){if(e==="value"){this._isSyncingValueAttribute||this._syncValueUi();return}if(e==="aria-label"){const s=this.root.querySelector(".frame");if(s){s.setAttribute("aria-label",r||"Stepper");return}}this.isConnected&&this.requestRender()}}_fromSlots(){return Array.from(this.querySelectorAll('[slot="step"], [data-step]')).map((t,r)=>{var p;const s=t.getAttribute("data-value")||String(r+1),i=t.getAttribute("data-label")||t.getAttribute("title")||((p=t.textContent)==null?void 0:p.trim())||`Step ${r+1}`,a=t.getAttribute("data-description")||"",l=d(t.getAttribute("data-optional")),n=t.hasAttribute("disabled")||d(t.getAttribute("data-disabled")),c=t.getAttribute("data-state");return{index:r,value:s,label:i,description:a,optional:l,disabled:n,state:c==="complete"||c==="error"||c==="warning"?c:"default"}})}_fromAttr(){return h(this.getAttribute("steps")).map((e,t)=>{const r=e.state==="complete"||e.state==="error"||e.state==="warning"?e.state:"default";return{index:t,value:e.value!=null?String(e.value):String(t+1),label:e.label!=null?String(e.label):`Step ${t+1}`,description:e.description!=null?String(e.description):"",optional:!!e.optional,disabled:!!e.disabled,state:r}})}_steps(){const e=this._fromAttr();return e.length?e:this._fromSlots()}_activeIndex(e){if(!e.length)return-1;const t=this.getAttribute("value")||"";if(t){const s=e.findIndex(i=>i.value===t);if(s>=0)return s}const r=e.find(s=>!s.disabled)||e[0];return r&&this.getAttribute("value")!==r.value&&this.setAttribute("value",r.value),e.findIndex(s=>s.value===r.value)}get value(){return this.getAttribute("value")||""}set value(e){const t=String(e||"");t?this.setAttribute("value",t):this.removeAttribute("value")}goTo(e){const t=this._steps();if(!t.length)return!1;const r=this._activeIndex(t),s=typeof e=="number"?e:t.findIndex(i=>i.value===String(e));return!Number.isInteger(s)||s<0||s>=t.length?!1:this._selectIndex(t,r,s,"api")}next(){const e=this._steps(),t=this._activeIndex(e);if(t<0)return!1;const r=Math.min(e.length-1,t+1);return this._selectIndex(e,t,r,"next")}prev(){const e=this._steps(),t=this._activeIndex(e);if(t<0)return!1;const r=Math.max(0,t-1);return this._selectIndex(e,t,r,"prev")}_selectIndex(e,t,r,s){if(r===t)return!0;const i=e[r];if(!i||i.disabled||this.hasAttribute("linear")&&r>t+1)return!1;const a=e[t],l=new CustomEvent("before-change",{detail:{currentIndex:t,nextIndex:r,currentValue:(a==null?void 0:a.value)||"",nextValue:i.value,trigger:s},bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(l))return!1;this.value=i.value;const n={index:r,value:i.value,label:i.label,trigger:s};return this.dispatchEvent(new CustomEvent("input",{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:n,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("select",{detail:n,bubbles:!0,composed:!0})),!0}_onClick(e){const t=e.target,r=t==null?void 0:t.closest(".trigger");if(!r||!this.hasAttribute("clickable")&&!this.hasAttribute("linear"))return;const s=Number(r.getAttribute("data-index"));if(!Number.isInteger(s))return;const i=this._steps(),a=this._activeIndex(i);this._selectIndex(i,a,s,"click")}_moveFocus(e,t){const r=Array.from(this.root.querySelectorAll(".trigger:not([disabled])"));if(!r.length)return;const s=r.indexOf(e);if(s<0)return;const i=(s+t+r.length)%r.length;r[i].focus()}_onKeyDown(e){const t=e.target,r=t==null?void 0:t.closest(".trigger");if(!r)return;const s=this.getAttribute("orientation")==="vertical",i=!s&&getComputedStyle(this).direction==="rtl",a=s?"ArrowDown":i?"ArrowLeft":"ArrowRight",l=s?"ArrowUp":i?"ArrowRight":"ArrowLeft";if(e.key===a){e.preventDefault(),this._moveFocus(r,1);return}if(e.key===l){e.preventDefault(),this._moveFocus(r,-1);return}if(e.key==="Home"||e.key==="End"){const n=Array.from(this.root.querySelectorAll(".trigger:not([disabled])"));if(!n.length)return;e.preventDefault(),(e.key==="Home"?n[0]:n[n.length-1]).focus();return}(e.key===" "||e.key==="Enter")&&(e.preventDefault(),r.click())}_syncValueUi(){if(!this.isConnected)return;if(!this.root.querySelector(".list")){this.requestRender();return}const e=this._steps();if(!e.length)return;this._isSyncingValueAttribute=!0;let t=-1;try{t=this._activeIndex(e)}finally{this._isSyncingValueAttribute=!1}Array.from(this.root.querySelectorAll(".item")).forEach((s,i)=>{const a=e[i];if(!a)return;const l=a.state!=="default"?a.state:i<t?"complete":i===t?"current":"upcoming";s.setAttribute("data-state",l),s.setAttribute("data-active",i===t?"true":"false");const n=s.querySelector(".trigger");n&&n.setAttribute("aria-current",i===t?"step":"false");const c=s.querySelector(".index");c&&(c.textContent=i<t?"✓":String(i+1))})}render(){const e=this._steps(),t=this._activeIndex(e),r=this.getAttribute("aria-label")||"Stepper",s=e.map((i,a)=>`
283
+ <li class="item" part="item" data-state="${i.state!=="default"?i.state:a<t?"complete":a===t?"current":"upcoming"}" data-active="${a===t?"true":"false"}">
315
284
  <button
316
285
  type="button"
317
286
  class="trigger"
318
287
  part="trigger"
319
288
  data-index="${a}"
320
- aria-current="${a===e?"step":"false"}"
289
+ aria-current="${a===t?"step":"false"}"
321
290
  aria-disabled="${i.disabled?"true":"false"}"
322
291
  ${i.disabled?"disabled":""}
323
292
  >
324
- <span class="index" part="index">${a<e?"✓":a+1}</span>
293
+ <span class="index" part="index">${a<t?"✓":a+1}</span>
325
294
  <span class="meta" part="meta">
326
295
  <span class="label">${u(i.label)}${i.optional?" (optional)":""}</span>
327
296
  ${i.description?`<span class="description">${u(i.description)}</span>`:""}
328
297
  </span>
329
298
  </button>
330
- ${a<t.length-1?'<span class="connector" part="connector"></span>':""}
299
+ ${a<e.length-1?'<span class="connector" part="connector"></span>':""}
331
300
  </li>
332
301
  `).join("");this.setContent(`
333
302
  <style>${f}</style>
@@ -21,7 +21,7 @@ const g = `
21
21
  border: 1px solid var(--ui-stepper-border);
22
22
  border-radius: var(--ui-stepper-radius);
23
23
  background: var(--ui-stepper-bg);
24
- box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
24
+ box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
25
25
  padding: 10px;
26
26
  }
27
27
 
@@ -64,8 +64,8 @@ const g = `
64
64
  }
65
65
 
66
66
  .trigger:hover {
67
- border-color: color-mix(in srgb, var(--ui-stepper-accent) 34%, var(--ui-stepper-border));
68
- background: color-mix(in srgb, var(--ui-stepper-accent) 8%, transparent);
67
+ border-color: color-mix(in srgb, var(--ui-stepper-accent) 20%, var(--ui-stepper-border));
68
+ background: color-mix(in srgb, var(--ui-stepper-accent) 4%, transparent);
69
69
  }
70
70
 
71
71
  .trigger:focus-visible {
@@ -96,9 +96,8 @@ const g = `
96
96
  position: absolute;
97
97
  inset: -5px;
98
98
  border-radius: inherit;
99
- border: 1px solid color-mix(in srgb, var(--ui-stepper-accent) 56%, transparent);
100
- opacity: 0.45;
101
- animation: ui-stepper-current-pulse var(--ui-stepper-indicator-duration) ease-out infinite;
99
+ border: 1px solid color-mix(in srgb, var(--ui-stepper-accent) 34%, transparent);
100
+ opacity: 0.18;
102
101
  pointer-events: none;
103
102
  }
104
103
 
@@ -142,19 +141,19 @@ const g = `
142
141
  }
143
142
 
144
143
  .item[data-state="current"] .trigger {
145
- border-color: color-mix(in srgb, var(--ui-stepper-accent) 46%, transparent);
146
- background: color-mix(in srgb, var(--ui-stepper-accent) 13%, transparent);
144
+ border-color: color-mix(in srgb, var(--ui-stepper-accent) 28%, var(--ui-stepper-border));
145
+ background: color-mix(in srgb, var(--ui-stepper-accent) 7%, transparent);
147
146
  }
148
147
 
149
148
  .item[data-state="current"] .index,
150
149
  .item[data-state="complete"] .index {
151
- border-color: color-mix(in srgb, var(--ui-stepper-accent) 44%, transparent);
152
- background: color-mix(in srgb, var(--ui-stepper-accent) 18%, transparent);
153
- color: color-mix(in srgb, var(--ui-stepper-accent) 86%, #0f172a 14%);
150
+ border-color: color-mix(in srgb, var(--ui-stepper-accent) 28%, var(--ui-stepper-border));
151
+ background: color-mix(in srgb, var(--ui-stepper-accent) 10%, transparent);
152
+ color: color-mix(in srgb, var(--ui-stepper-accent) 68%, #0f172a 32%);
154
153
  }
155
154
 
156
155
  .item[data-state="complete"] .connector {
157
- background: color-mix(in srgb, var(--ui-stepper-accent) 52%, transparent);
156
+ background: color-mix(in srgb, var(--ui-stepper-accent) 32%, transparent);
158
157
  }
159
158
 
160
159
  .item[data-state="current"] .connector::after {
@@ -164,11 +163,10 @@ const g = `
164
163
  background: linear-gradient(
165
164
  90deg,
166
165
  transparent 0%,
167
- color-mix(in srgb, var(--ui-stepper-accent) 48%, transparent) 50%,
166
+ color-mix(in srgb, var(--ui-stepper-accent) 24%, transparent) 50%,
168
167
  transparent 100%
169
168
  );
170
- transform: translateX(-100%);
171
- animation: ui-stepper-connector-flow var(--ui-stepper-indicator-duration) linear infinite;
169
+ opacity: 0.45;
172
170
  pointer-events: none;
173
171
  }
174
172
 
@@ -176,11 +174,9 @@ const g = `
176
174
  background: linear-gradient(
177
175
  180deg,
178
176
  transparent 0%,
179
- color-mix(in srgb, var(--ui-stepper-accent) 48%, transparent) 50%,
177
+ color-mix(in srgb, var(--ui-stepper-accent) 24%, transparent) 50%,
180
178
  transparent 100%
181
179
  );
182
- transform: translateY(-100%);
183
- animation-name: ui-stepper-connector-flow-vertical;
184
180
  }
185
181
 
186
182
  .item[data-state="error"] .trigger {
@@ -225,33 +221,6 @@ const g = `
225
221
  }
226
222
  }
227
223
 
228
- @keyframes ui-stepper-current-pulse {
229
- 0% {
230
- transform: scale(0.9);
231
- opacity: 0.45;
232
- }
233
- 70% {
234
- transform: scale(1.2);
235
- opacity: 0;
236
- }
237
- 100% {
238
- transform: scale(1.2);
239
- opacity: 0;
240
- }
241
- }
242
-
243
- @keyframes ui-stepper-connector-flow {
244
- to {
245
- transform: translateX(100%);
246
- }
247
- }
248
-
249
- @keyframes ui-stepper-connector-flow-vertical {
250
- to {
251
- transform: translateY(100%);
252
- }
253
- }
254
-
255
224
  @media (prefers-contrast: more) {
256
225
  :host {
257
226
  --ui-stepper-border: color-mix(in srgb, var(--ui-stepper-text) 70%, transparent);
@@ -331,7 +300,7 @@ function d(o) {
331
300
  const t = String(o).toLowerCase();
332
301
  return t !== "false" && t !== "0" && t !== "off";
333
302
  }
334
- class m extends b {
303
+ class h extends b {
335
304
  constructor() {
336
305
  super(), this._observer = null, this._isSyncingValueAttribute = !1, this._onClick = this._onClick.bind(this), this._onKeyDown = this._onKeyDown.bind(this);
337
306
  }
@@ -572,7 +541,7 @@ class m extends b {
572
541
  `);
573
542
  }
574
543
  }
575
- typeof customElements < "u" && !customElements.get("ui-stepper") && customElements.define("ui-stepper", m);
544
+ typeof customElements < "u" && !customElements.get("ui-stepper") && customElements.define("ui-stepper", h);
576
545
  export {
577
- m as UIStepper
546
+ h as UIStepper
578
547
  };
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("./ElementBase-1b301e7f.js"),c=require("./date-time-utils-5cf58cd0.js");require("./calendar-a8735e40.js");require("./scroll-lock-48793569.js");let M=0;const C=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const T=require("./ElementBase-1b301e7f.js"),c=require("./date-time-utils-378ecc21.js");require("./calendar-a8735e40.js");require("./scroll-lock-d7b0df21.js");let M=0;const C=`
2
2
  :host {
3
3
  --ui-time-field-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 78%, transparent);
4
4
  --ui-time-field-border: 1px solid var(--ui-time-field-border-color);
@@ -1,7 +1,7 @@
1
1
  import { E as M } from "./ElementBase-909688f3.mjs";
2
- import { o as A, q as x, u as T } from "./date-time-utils-bdceb7af.mjs";
2
+ import { q as A, u as x, v as T } from "./date-time-utils-a8b17ea7.mjs";
3
3
  import "./calendar-2c11b824.mjs";
4
- import "./scroll-lock-9de6d328.mjs";
4
+ import "./scroll-lock-31da444f.mjs";
5
5
  let V = 0;
6
6
  const B = `
7
7
  :host {
@@ -356,26 +356,26 @@ class E extends M {
356
356
  const d = f(this._value, this._showSeconds()), F = this._order(), m = [];
357
357
  this._segmentButtons.clear();
358
358
  const v = d ? _(d) : null;
359
- if (F.forEach((o, C) => {
359
+ if (F.forEach((n, C) => {
360
360
  if (C > 0) {
361
361
  const h = document.createElement("span");
362
- h.className = "literal", h.textContent = o === "meridiem" ? " " : ":", m.push(h);
362
+ h.className = "literal", h.textContent = n === "meridiem" ? " " : ":", m.push(h);
363
363
  }
364
- const n = document.createElement("button");
365
- if (n.type = "button", n.className = "segment", n.setAttribute("data-segment", o), n.setAttribute("data-active", this._activeSegment === o ? "true" : "false"), n.setAttribute("data-empty", d ? "false" : "true"), n.setAttribute("aria-label", o === "hour" ? "Hour" : o === "minute" ? "Minute" : o === "second" ? "Second" : "AM or PM"), n.tabIndex = this._activeSegment === o ? 0 : -1, n.disabled = this.hasAttribute("disabled"), n.addEventListener("click", this._onSegmentClick), n.addEventListener("keydown", this._onSegmentKeyDown), !d)
366
- n.textContent = I(o);
367
- else if (o === "hour") {
364
+ const o = document.createElement("button");
365
+ if (o.type = "button", o.className = "segment", o.setAttribute("data-segment", n), o.setAttribute("data-active", this._activeSegment === n ? "true" : "false"), o.setAttribute("data-empty", d ? "false" : "true"), o.setAttribute("aria-label", n === "hour" ? "Hour" : n === "minute" ? "Minute" : n === "second" ? "Second" : "AM or PM"), o.tabIndex = this._activeSegment === n ? 0 : -1, o.disabled = this.hasAttribute("disabled"), o.addEventListener("click", this._onSegmentClick), o.addEventListener("keydown", this._onSegmentKeyDown), !d)
366
+ o.textContent = I(n);
367
+ else if (n === "hour") {
368
368
  const h = this._is12h() ? v.hour : d.hours;
369
- n.textContent = String(h).padStart(2, "0");
369
+ o.textContent = String(h).padStart(2, "0");
370
370
  } else
371
- o === "minute" ? n.textContent = String(d.minutes).padStart(2, "0") : o === "second" ? n.textContent = String(d.seconds).padStart(2, "0") : n.textContent = v.meridiem;
372
- this._segmentButtons.set(o, n), m.push(n);
371
+ n === "minute" ? o.textContent = String(d.minutes).padStart(2, "0") : n === "second" ? o.textContent = String(d.seconds).padStart(2, "0") : o.textContent = v.meridiem;
372
+ this._segmentButtons.set(n, o), m.push(o);
373
373
  }), this._segmentsEl.replaceChildren(...m), i) {
374
- const o = this._segmentButtons.get(this._activeSegment);
374
+ const n = this._segmentButtons.get(this._activeSegment);
375
375
  try {
376
- o == null || o.focus({ preventScroll: !0 });
376
+ n == null || n.focus({ preventScroll: !0 });
377
377
  } catch {
378
- o == null || o.focus();
378
+ n == null || n.focus();
379
379
  }
380
380
  }
381
381
  }
@@ -1,16 +1,16 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-1b301e7f.js"),x=require("./calendar-a8735e40.js"),a=require("./date-time-utils-5cf58cd0.js");require("./scroll-lock-48793569.js");const E=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("./ElementBase-1b301e7f.js"),x=require("./dismissable-layer-193e3bed.js"),E=require("./calendar-a8735e40.js"),a=require("./date-time-utils-378ecc21.js");require("./scroll-lock-d7b0df21.js");const k=`
2
2
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
3
3
  <path d="M10 2.4a7.6 7.6 0 1 1 0 15.2A7.6 7.6 0 0 1 10 2.4Zm0 1.4a6.2 6.2 0 1 0 0 12.4 6.2 6.2 0 0 0 0-12.4Zm.7 2.4a.7.7 0 0 0-1.4 0v4.1c0 .2.1.4.2.5l2.6 2.5a.7.7 0 1 0 1-1l-2.4-2.3v-3.8Z" fill="currentColor"/>
4
4
  </svg>
5
- `,k=`
5
+ `,w=`
6
6
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
7
7
  <path d="m6 6 8 8M14 6l-8 8" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/>
8
8
  </svg>
9
- `,w=`
9
+ `,S=`
10
10
  <svg viewBox="0 0 20 20" class="icon-svg" aria-hidden="true" focusable="false">
11
11
  <path d="m5.6 7.6 4.4 4.6 4.4-4.6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
12
12
  </svg>
13
- `,S=`
13
+ `,C=`
14
14
  :host {
15
15
  --ui-dp-bg: color-mix(in srgb, var(--ui-color-surface, #ffffff) 96%, transparent);
16
16
  --ui-dp-border: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 72%, transparent);
@@ -139,7 +139,7 @@
139
139
  outline-color: Highlight;
140
140
  }
141
141
  }
142
- `,C=`
142
+ `,B=`
143
143
  .overlay { position: fixed; z-index: var(--ui-dp-z, 1600); pointer-events: none; }
144
144
  .panel {
145
145
  pointer-events: auto;
@@ -245,15 +245,15 @@
245
245
  outline-color: Highlight;
246
246
  }
247
247
  }
248
- `;function p(_){return String(_).padStart(2,"0")}function m(_,t,e,i){const n=p(_),s=p(t);return i?`${n}:${s}:${p(e)}`:`${n}:${s}`}class v extends g.ElementBase{constructor(){super(...arguments),this._value=null,this._pending=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._fieldEl=null,this._labelEl=null,this._labelTextEl=null,this._requiredEl=null,this._inputEl=null,this._clearBtn=null,this._toggleBtn=null,this._hintEl=null,this._errorEl=null,this._hiddenInputEl=null,this._schedulePosition=a.rafThrottle(()=>this._positionOverlay()),this._onRootClickBound=t=>this._onRootClick(t),this._onRootInputBound=t=>this._onRootInput(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._onDocumentPointerDownBound=t=>this._onDocumentPointerDown(t),this._onDocumentKeyDownBound=t=>this._onDocumentKeyDown(t),this._onWindowResizeBound=()=>this._schedulePosition.run(),this._onWindowScrollBound=()=>this._schedulePosition.run()}static get observedAttributes(){return["open","default-open","value","default-value","format","step","seconds","step-seconds","min","max","disabled","readonly","required","name","clearable","allow-input","mode","label","hint","error","translations","locale","variant"]}connectedCallback(){if(super.connectedCallback(),this.root.addEventListener("click",this._onRootClickBound),this.root.addEventListener("input",this._onRootInputBound),this.root.addEventListener("focusout",this._onRootBlurBound),this.root.addEventListener("keydown",this._onRootKeyDownBound),this._hasView&&!this._inputEl&&this._cacheDomRefs(),!this._isInitialized){const t=this._normalizeCanonical(this.getAttribute("value")||this.getAttribute("default-value"));this._value=t,this._pending=t,this._draft=this._formatDisplay(t),this._open=this.hasAttribute("open")||a.isTruthyAttr(this.getAttribute("default-open")),this._isInitialized=!0}this._open&&!this._isInlineMode()&&this._ensureOverlay()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClickBound),this.root.removeEventListener("input",this._onRootInputBound),this.root.removeEventListener("focusout",this._onRootBlurBound),this.root.removeEventListener("keydown",this._onRootKeyDownBound),this._destroyOverlay(),this._fieldEl=null,this._labelEl=null,this._labelTextEl=null,this._requiredEl=null,this._inputEl=null,this._clearBtn=null,this._toggleBtn=null,this._hintEl=null,this._errorEl=null,this._hiddenInputEl=null,super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(e!==i&&(t==="value"&&!this._syncing&&(this._value=this._normalizeCanonical(i),this._pending=this._value,this._draft=this._formatDisplay(this._value),this._inlineError=""),t==="open"&&!this._syncing&&(this._open=this.hasAttribute("open"),this._syncOverlay("attribute")),t==="mode"&&this._syncOverlay("attribute"),t==="disabled"&&this.hasAttribute("disabled")&&this._setOpen(!1,"outside"),!!this.isConnected)){if(!this._hasView){this.requestRender();return}this._updateHostState()}}_isInlineMode(){return(this.getAttribute("mode")||"popover")==="inline"}_isMobileSheet(){return a.shouldUseMobileSheet(this.getAttribute("mode"))}_isDisabled(){return this.hasAttribute("disabled")}_isReadonly(){return this.hasAttribute("readonly")}_allowInput(){return a.isTruthyAttr(this.getAttribute("allow-input"),!0)}_clearable(){return a.isTruthyAttr(this.getAttribute("clearable"),!0)}_withSeconds(){return this.hasAttribute("seconds")}_is12h(){return(this.getAttribute("format")||"24h")==="12h"}_minuteStep(){const t=Number(this.getAttribute("step")||5),e=5;return!Number.isFinite(t)||t<1?e:Math.min(60,Math.trunc(t))}_secondStep(){const t=Number(this.getAttribute("step-seconds")||1);return!Number.isFinite(t)||t<1?1:Math.min(60,Math.trunc(t))}_translations(){return x.resolveDateTimeTranslations(this.getAttribute("locale"),this.getAttribute("translations"))}_normalizeCanonical(t){if(!t)return null;const e=a.parseTimeInput(t,!0);return e?m(e.hours,e.minutes,e.seconds,this._withSeconds()):null}_minTime(){return this._normalizeCanonical(this.getAttribute("min"))}_maxTime(){return this._normalizeCanonical(this.getAttribute("max"))}_formatDisplay(t){return t?this._is12h()?a.to12hDisplay(t,this.getAttribute("locale")||"en-US"):t:""}_syncOpenAttribute(t){this._syncing=!0;try{t?this.hasAttribute("open")||this.setAttribute("open",""):this.hasAttribute("open")&&this.removeAttribute("open")}finally{this._syncing=!1}}_syncValueAttribute(t){this._syncing=!0;try{t?this.getAttribute("value")!==t&&this.setAttribute("value",t):this.hasAttribute("value")&&this.removeAttribute("value")}finally{this._syncing=!1}}_emitInput(t){const e={mode:"time",value:this._pending,source:t};this.dispatchEvent(new CustomEvent("input",{detail:e,bubbles:!0,composed:!0}))}_emitChange(t){const e={mode:"time",value:this._value,source:t};this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}_emitInvalid(t,e){this.dispatchEvent(new CustomEvent("invalid",{detail:{raw:t,reason:e},bubbles:!0,composed:!0}))}_clampToBounds(t){if(!t)return null;const e=this._minTime(),i=this._maxTime();let n=t;return e&&a.compareTimes(n,e)<0&&(n=e),i&&a.compareTimes(n,i)>0&&(n=i),n}_commit(t,e){if(this._isDisabled()||this._isReadonly())return;const i=this._clampToBounds(this._normalizeCanonical(t));this._value=i,this._pending=i,this._draft=this._formatDisplay(i),this._inlineError="",this._syncValueAttribute(i),this._emitInput(e),this._emitChange(e),this._updateHostState()}_setOpen(t,e){this._isDisabled()||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})))}_syncOverlay(t){if(this._isInlineMode()){this._destroyOverlay();return}if(this._open){this._ensureOverlay(),this._syncOverlayState();return}this._destroyOverlay();const e=this._restoreFocusEl;if(this._restoreFocusEl=null,e&&e.isConnected)try{e.focus()}catch{}}_ensureOverlay(){if(this._overlay||typeof document>"u")return;const t=document.createElement("div");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),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=a.lockBodyScroll())}_destroyOverlay(){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.parentElement&&this._overlay.parentElement.removeChild(this._overlay),this._overlay=null,this._overlayKey=null,this._releaseScrollLock&&(this._releaseScrollLock(),this._releaseScrollLock=null))}_positionOverlay(){if(!this._overlay||!this._open||this._isMobileSheet())return;const t=this._fieldEl,e=this._overlay.querySelector(".panel");if(!t||!e)return;const i=a.computePopoverPosition(t.getBoundingClientRect(),e.getBoundingClientRect());e.style.position="absolute",e.style.top=`${Math.round(i.top)}px`,e.style.left=`${Math.round(i.left)}px`}_timeParts(t){const e=a.parseTimeInput(t||"00:00",!0)||{hours:0,minutes:0,seconds:0},i=e.hours>=12?"pm":"am";return{hours:e.hours,minutes:e.minutes,seconds:e.seconds,meridiem:i}}_buildOverlayContent(t){const e=this._translations(),i=this._timeParts(this._pending),n=this._is12h(),s=this._withSeconds(),r=n?i.hours%12||12:i.hours,o=this._minuteStep(),u=this._secondStep(),l=Array.from({length:n?12:24},(b,h)=>{const d=n?h+1:h;return`<option value="${d}" ${d===r?"selected":""}>${p(d)}</option>`}).join(""),c=Array.from({length:Math.ceil(60/o)},(b,h)=>{const d=Math.min(59,h*o);return`<option value="${d}" ${d===i.minutes?"selected":""}>${p(d)}</option>`}).join(""),f=Array.from({length:Math.ceil(60/u)},(b,h)=>{const d=Math.min(59,h*u);return`<option value="${d}" ${d===i.seconds?"selected":""}>${p(d)}</option>`}).join(""),y=`
249
- <div class="pickers" data-seconds="${s?"true":"false"}" data-ampm="${n?"true":"false"}">
248
+ `;function p(_){return String(_).padStart(2,"0")}function m(_,t,e,i){const s=p(_),n=p(t);return i?`${s}:${n}:${p(e)}`:`${s}:${n}`}class v extends g.ElementBase{constructor(){super(...arguments),this._value=null,this._pending=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._fieldEl=null,this._labelEl=null,this._labelTextEl=null,this._requiredEl=null,this._inputEl=null,this._clearBtn=null,this._toggleBtn=null,this._hintEl=null,this._errorEl=null,this._hiddenInputEl=null,this._schedulePosition=a.rafThrottle(()=>this._positionOverlay()),this._onRootClickBound=t=>this._onRootClick(t),this._onRootInputBound=t=>this._onRootInput(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._onDocumentPointerDownBound=t=>this._onDocumentPointerDown(t),this._onDocumentKeyDownBound=t=>this._onDocumentKeyDown(t),this._onWindowResizeBound=()=>this._schedulePosition.run(),this._onWindowScrollBound=t=>{a.eventOriginatesWithin(t,[this._overlay])||this._schedulePosition.run()}}static get observedAttributes(){return["open","default-open","value","default-value","format","step","seconds","step-seconds","min","max","disabled","readonly","required","name","clearable","allow-input","mode","label","hint","error","translations","locale","variant"]}connectedCallback(){if(super.connectedCallback(),this.root.addEventListener("click",this._onRootClickBound),this.root.addEventListener("input",this._onRootInputBound),this.root.addEventListener("focusout",this._onRootBlurBound),this.root.addEventListener("keydown",this._onRootKeyDownBound),this._hasView&&!this._inputEl&&this._cacheDomRefs(),!this._isInitialized){const t=this._normalizeCanonical(this.getAttribute("value")||this.getAttribute("default-value"));this._value=t,this._pending=t,this._draft=this._formatDisplay(t),this._open=this.hasAttribute("open")||a.isTruthyAttr(this.getAttribute("default-open")),this._isInitialized=!0}this._open&&!this._isInlineMode()&&this._ensureOverlay()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClickBound),this.root.removeEventListener("input",this._onRootInputBound),this.root.removeEventListener("focusout",this._onRootBlurBound),this.root.removeEventListener("keydown",this._onRootKeyDownBound),this._destroyOverlay(),this._fieldEl=null,this._labelEl=null,this._labelTextEl=null,this._requiredEl=null,this._inputEl=null,this._clearBtn=null,this._toggleBtn=null,this._hintEl=null,this._errorEl=null,this._hiddenInputEl=null,super.disconnectedCallback()}attributeChangedCallback(t,e,i){if(e!==i&&(t==="value"&&!this._syncing&&(this._value=this._normalizeCanonical(i),this._pending=this._value,this._draft=this._formatDisplay(this._value),this._inlineError=""),t==="open"&&!this._syncing&&(this._open=this.hasAttribute("open"),this._syncOverlay("attribute")),t==="mode"&&this._syncOverlay("attribute"),t==="disabled"&&this.hasAttribute("disabled")&&this._setOpen(!1,"outside"),!!this.isConnected)){if(!this._hasView){this.requestRender();return}this._updateHostState()}}_isInlineMode(){return(this.getAttribute("mode")||"popover")==="inline"}_isMobileSheet(){return a.shouldUseMobileSheet(this.getAttribute("mode"))}_isDisabled(){return this.hasAttribute("disabled")}_isReadonly(){return this.hasAttribute("readonly")}_allowInput(){return a.isTruthyAttr(this.getAttribute("allow-input"),!0)}_clearable(){return a.isTruthyAttr(this.getAttribute("clearable"),!0)}_withSeconds(){return this.hasAttribute("seconds")}_is12h(){return(this.getAttribute("format")||"24h")==="12h"}_minuteStep(){const t=Number(this.getAttribute("step")||5),e=5;return!Number.isFinite(t)||t<1?e:Math.min(60,Math.trunc(t))}_secondStep(){const t=Number(this.getAttribute("step-seconds")||1);return!Number.isFinite(t)||t<1?1:Math.min(60,Math.trunc(t))}_translations(){return E.resolveDateTimeTranslations(this.getAttribute("locale"),this.getAttribute("translations"))}_normalizeCanonical(t){if(!t)return null;const e=a.parseTimeInput(t,!0);return e?m(e.hours,e.minutes,e.seconds,this._withSeconds()):null}_minTime(){return this._normalizeCanonical(this.getAttribute("min"))}_maxTime(){return this._normalizeCanonical(this.getAttribute("max"))}_formatDisplay(t){return t?this._is12h()?a.to12hDisplay(t,this.getAttribute("locale")||"en-US"):t:""}_syncOpenAttribute(t){this._syncing=!0;try{t?this.hasAttribute("open")||this.setAttribute("open",""):this.hasAttribute("open")&&this.removeAttribute("open")}finally{this._syncing=!1}}_syncValueAttribute(t){this._syncing=!0;try{t?this.getAttribute("value")!==t&&this.setAttribute("value",t):this.hasAttribute("value")&&this.removeAttribute("value")}finally{this._syncing=!1}}_emitInput(t){const e={mode:"time",value:this._pending,source:t};this.dispatchEvent(new CustomEvent("input",{detail:e,bubbles:!0,composed:!0}))}_emitChange(t){const e={mode:"time",value:this._value,source:t};this.dispatchEvent(new CustomEvent("change",{detail:e,bubbles:!0,composed:!0}))}_emitInvalid(t,e){this.dispatchEvent(new CustomEvent("invalid",{detail:{raw:t,reason:e},bubbles:!0,composed:!0}))}_clampToBounds(t){if(!t)return null;const e=this._minTime(),i=this._maxTime();let s=t;return e&&a.compareTimes(s,e)<0&&(s=e),i&&a.compareTimes(s,i)>0&&(s=i),s}_commit(t,e){if(this._isDisabled()||this._isReadonly())return;const i=this._clampToBounds(this._normalizeCanonical(t));this._value=i,this._pending=i,this._draft=this._formatDisplay(i),this._inlineError="",this._syncValueAttribute(i),this._emitInput(e),this._emitChange(e),this._updateHostState()}_setOpen(t,e){this._isDisabled()||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})))}_syncOverlay(t){if(this._isInlineMode()){this._destroyOverlay();return}if(this._open){this._ensureOverlay(),this._syncOverlayState();return}this._destroyOverlay();const e=this._restoreFocusEl;if(this._restoreFocusEl=null,e&&e.isConnected)try{e.focus()}catch{}}_ensureOverlay(){if(this._overlay||typeof document>"u")return;const t=document.createElement("div");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),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=a.lockBodyScroll())}_syncOverlayHostZIndex(){if(!this._overlay||typeof window>"u")return;const t=window.getComputedStyle(this).getPropertyValue("--ui-dp-z").trim();this._overlay.style.zIndex=t||"1600"}_destroyOverlay(){var t;(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.parentElement&&this._overlay.parentElement.removeChild(this._overlay),this._overlay=null,this._overlayKey=null,this._releaseScrollLock&&(this._releaseScrollLock(),this._releaseScrollLock=null))}_syncDismissableLayer(){var e;if((e=this._dismissableLayer)==null||e.destroy(),this._dismissableLayer=null,!this._open||!this._overlay)return;const t=this._overlay.querySelector(".panel, .sheet");t&&(this._dismissableLayer=x.createDismissableLayer({node:t,trigger:this._fieldEl,closeOnEscape:!0,closeOnPointerOutside:!0,closeOnFocusOutside:!1,onBeforeDismiss:i=>i==="escape-key"?(this._setOpen(!1,"escape"),!1):(i==="outside-pointer"&&this._setOpen(!1,"outside"),!1)}))}_positionOverlay(){if(!this._overlay||!this._open||this._isMobileSheet())return;const t=this._fieldEl,e=this._overlay.querySelector(".panel");if(!t||!e)return;const i=e.getAttribute("data-placement"),s=a.computePopoverPosition(t.getBoundingClientRect(),e.getBoundingClientRect(),8,8,i==="top"?"top":i==="bottom"?"bottom":null);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)}_timeParts(t){const e=a.parseTimeInput(t||"00:00",!0)||{hours:0,minutes:0,seconds:0},i=e.hours>=12?"pm":"am";return{hours:e.hours,minutes:e.minutes,seconds:e.seconds,meridiem:i}}_buildOverlayContent(t){const e=this._translations(),i=this._timeParts(this._pending),s=this._is12h(),n=this._withSeconds(),r=s?i.hours%12||12:i.hours,o=this._minuteStep(),u=this._secondStep(),l=Array.from({length:s?12:24},(b,h)=>{const d=s?h+1:h;return`<option value="${d}" ${d===r?"selected":""}>${p(d)}</option>`}).join(""),c=Array.from({length:Math.ceil(60/o)},(b,h)=>{const d=Math.min(59,h*o);return`<option value="${d}" ${d===i.minutes?"selected":""}>${p(d)}</option>`}).join(""),f=Array.from({length:Math.ceil(60/u)},(b,h)=>{const d=Math.min(59,h*u);return`<option value="${d}" ${d===i.seconds?"selected":""}>${p(d)}</option>`}).join(""),y=`
249
+ <div class="pickers" data-seconds="${n?"true":"false"}" data-ampm="${s?"true":"false"}">
250
250
  <div class="picker"><label>${e.hour}</label><select data-segment="hours">${l}</select></div>
251
251
  <div class="picker"><label>${e.minute}</label><select data-segment="minutes">${c}</select></div>
252
- ${s?`<div class="picker"><label>${e.second}</label><select data-segment="seconds">${f}</select></div>`:""}
253
- ${n?`<div class="picker"><label>${e.meridiem}</label><select data-segment="meridiem"><option value="am" ${i.meridiem==="am"?"selected":""}>${e.am}</option><option value="pm" ${i.meridiem==="pm"?"selected":""}>${e.pm}</option></select></div>`:""}
252
+ ${n?`<div class="picker"><label>${e.second}</label><select data-segment="seconds">${f}</select></div>`:""}
253
+ ${s?`<div class="picker"><label>${e.meridiem}</label><select data-segment="meridiem"><option value="am" ${i.meridiem==="am"?"selected":""}>${e.am}</option><option value="pm" ${i.meridiem==="pm"?"selected":""}>${e.pm}</option></select></div>`:""}
254
254
  </div>
255
255
  `;return`
256
- <style>${C}</style>
256
+ <style>${B}</style>
257
257
  ${t?'<div class="sheet-backdrop" data-action="backdrop"></div>':""}
258
258
  <section class="${t?"sheet":"panel"}" part="${t?"sheet":"popover"}">
259
259
  ${y}
@@ -264,18 +264,18 @@
264
264
  <button type="button" class="action" data-action="apply" data-tone="primary" part="apply">${e.apply}</button>
265
265
  </footer>
266
266
  </section>
267
- `}_overlaySignature(t){return[t?"sheet":"popover",this._is12h()?"12h":"24h",this._withSeconds()?"sec":"nosec",this._minuteStep(),this._secondStep(),this.getAttribute("translations")||""].join(":")}_ensureOverlayContent(t){if(!this._overlay)return;const e=this._overlaySignature(t);this._overlayKey!==e&&(this._overlayKey=e,this._overlay.innerHTML=t?`<div class="sheet-wrap">${this._buildOverlayContent(!0)}</div>`:`<div class="overlay">${this._buildOverlayContent(!1)}</div>`)}_setClosestOptionValue(t,e){const i=Array.from(t.options).map(r=>Number(r.value)).filter(r=>Number.isFinite(r));if(!i.length)return;let n=i[0],s=Math.abs(n-e);for(let r=1;r<i.length;r+=1){const o=i[r],u=Math.abs(o-e);u<s&&(n=o,s=u)}t.value=String(n)}_syncOverlayState(){if(!this._overlay)return;const t=this._isMobileSheet();this._ensureOverlayContent(t);const e=this._timeParts(this._pending),i=this._overlay.querySelector('select[data-segment="hours"]'),n=this._overlay.querySelector('select[data-segment="minutes"]'),s=this._overlay.querySelector('select[data-segment="seconds"]'),r=this._overlay.querySelector('select[data-segment="meridiem"]'),o=this._isDisabled()||this._isReadonly();if(this._overlay.querySelectorAll(".action").forEach(l=>{l.disabled=o}),i){const l=this._is12h()?e.hours%12||12:e.hours;this._setClosestOptionValue(i,l),i.disabled=o}n&&(this._setClosestOptionValue(n,e.minutes),n.disabled=o),s&&(this._setClosestOptionValue(s,e.seconds),s.disabled=o),r&&(r.value=e.meridiem,r.disabled=o),t||this._schedulePosition.run()}_renderOverlay(){this._syncOverlayState()}_applySegmentsFromOverlay(){if(!this._overlay)return;const t=this._overlay.querySelector('select[data-segment="hours"]'),e=this._overlay.querySelector('select[data-segment="minutes"]'),i=this._overlay.querySelector('select[data-segment="seconds"]'),n=this._overlay.querySelector('select[data-segment="meridiem"]');if(!t||!e)return;let s=Number(t.value);const r=Number(e.value),o=i?Number(i.value):0;if(this._is12h()&&n){const l=n.value==="pm"?"pm":"am";l==="pm"&&s<12&&(s+=12),l==="am"&&s===12&&(s=0)}const u=m(s,r,o,this._withSeconds());this._pending=this._clampToBounds(u),this._emitInput("picker")}_onRootClick(t){var n;const e=t.target;if(!e)return;const i=(n=e.closest("[data-action]"))==null?void 0:n.getAttribute("data-action");if(i){if(i==="toggle"){this._restoreFocusEl=e,this._setOpen(!this._open,"toggle");return}i==="clear"&&this._commit(null,"clear")}}_onRootInput(t){const e=t.target;if(!(e instanceof HTMLInputElement)||!e.classList.contains("input")||!this._allowInput())return;this._draft=e.value,this._inlineError="";const i=this._normalizeCanonical(e.value);this._pending=i,this._emitInput("typing")}_onRootBlur(t){const e=t.target;if(!(e instanceof HTMLInputElement)||!e.classList.contains("input")||!this._allowInput())return;if(!this._draft.trim()){this._commit(null,"blur");return}const i=this._normalizeCanonical(this._draft);if(!i){this._inlineError=this.getAttribute("error")||this._translations().invalidTime,this._emitInvalid(this._draft,"parse"),this._updateHostState();return}this._commit(i,"blur")}_stepBy(t){const e=a.parseTimeInput(this._pending||this._value||"00:00",!0)||{hours:0,minutes:0,seconds:0},i=this._minuteStep()*t,n=((e.hours*60+e.minutes+i)%(24*60)+24*60)%(24*60),s=Math.floor(n/60),r=n%60,o=m(s,r,e.seconds,this._withSeconds());this._pending=this._clampToBounds(o),this._emitInput("keyboard-step"),this._updateHostState()}_onRootKeyDown(t){const e=t,i=e.target;if(!(!(i instanceof HTMLInputElement)||!i.classList.contains("input"))){if(e.key==="ArrowUp"){e.preventDefault(),this._stepBy(e.shiftKey?5:1);return}if(e.key==="ArrowDown"){e.preventDefault(),this._stepBy(e.shiftKey?-5:-1);return}if(e.key==="Enter"){e.preventDefault();const n=this._normalizeCanonical(this._draft);if(!n&&this._draft.trim()){this._inlineError=this.getAttribute("error")||this._translations().invalidTime,this._emitInvalid(this._draft,"parse"),this._updateHostState();return}this._commit(n,"enter"),this._isInlineMode()||this._setOpen(!1,"enter");return}if(e.key==="Escape"&&this._open&&!this._isInlineMode()){e.preventDefault(),this._setOpen(!1,"escape");return}e.key==="ArrowDown"&&!this._open&&!this._isInlineMode()&&(e.preventDefault(),this._setOpen(!0,"keyboard"))}}_onOverlayClick(t){var n;const e=t.target;if(!e)return;const i=(n=e.closest("[data-action]"))==null?void 0:n.getAttribute("data-action");if(i){if(i==="backdrop"){this._setOpen(!1,"outside");return}if(i==="cancel"){this._pending=this._value,this._setOpen(!1,"cancel");return}if(i==="clear"){this._pending=null,this._emitInput("clear"),this._renderOverlay();return}if(i==="now"){const s=new Date,r=m(s.getHours(),s.getMinutes(),s.getSeconds(),this._withSeconds());this._pending=this._clampToBounds(r),this._emitInput("now"),this._renderOverlay();return}i==="apply"&&(this._commit(this._pending,"apply"),this._setOpen(!1,"apply"))}}_onOverlayChange(t){const e=t.target;e instanceof HTMLSelectElement&&e.matches("select[data-segment]")&&this._applySegmentsFromOverlay()}_onDocumentPointerDown(t){if(!this._open||!this._overlay)return;const e=t.composedPath();e.includes(this)||e.includes(this._overlay)||this._setOpen(!1,"outside")}_onDocumentKeyDown(t){this._open&&t.key==="Escape"&&(t.preventDefault(),this._setOpen(!1,"escape"))}_cacheDomRefs(){this._labelEl=this.root.querySelector(".label"),this._labelTextEl=this.root.querySelector(".label-text"),this._requiredEl=this.root.querySelector(".required"),this._fieldEl=this.root.querySelector(".field"),this._inputEl=this.root.querySelector(".input"),this._clearBtn=this.root.querySelector('.btn[data-action="clear"]'),this._toggleBtn=this.root.querySelector('.btn[data-action="toggle"]'),this._hintEl=this.root.querySelector(".hint"),this._errorEl=this.root.querySelector(".error"),this._hiddenInputEl=this.root.querySelector(".hidden-input")}_updateHostState(){if(!this._hasView)return;const t=this.getAttribute("label")||"",e=this.getAttribute("hint")||"",i=this.getAttribute("error")||"",n=this._inlineError||i,s=!!this._value,r=this.getAttribute("name")||"",o=this._allowInput()?this._draft:this._formatDisplay(this._value),u=this._isInlineMode(),l=this._isDisabled(),c=this._translations();this._labelEl&&(this._labelEl.hidden=!t),this._labelTextEl&&(this._labelTextEl.textContent=t),this._requiredEl&&(this._requiredEl.hidden=!this.hasAttribute("required")),this._inputEl&&(this._inputEl.value!==o&&(this._inputEl.value=o),this._inputEl.placeholder=this._withSeconds()?c.timePlaceholderSeconds:c.timePlaceholder,this._inputEl.readOnly=!this._allowInput()||this._isReadonly(),this._inputEl.disabled=l,this._inputEl.required=this.hasAttribute("required")),this._clearBtn&&(this._clearBtn.hidden=!(this._clearable()&&s),this._clearBtn.disabled=l||this._isReadonly(),this._clearBtn.setAttribute("aria-label",c.clear)),this._toggleBtn&&(this._toggleBtn.hidden=u,this._toggleBtn.disabled=l||this._isReadonly(),this._toggleBtn.setAttribute("aria-label",c.toggleCalendar)),this._hintEl&&(this._hintEl.hidden=!e,this._hintEl.textContent=e),this._errorEl&&(this._errorEl.hidden=!n,this._errorEl.textContent=n),this._hiddenInputEl&&(this._hiddenInputEl.disabled=!r,this._hiddenInputEl.name=r,this._hiddenInputEl.value=this._value||""),!u&&this._open&&this._syncOverlayState()}render(){this._hasView||(this.setContent(`
268
- <style>${S}</style>
267
+ `}_overlaySignature(t){return[t?"sheet":"popover",this._is12h()?"12h":"24h",this._withSeconds()?"sec":"nosec",this._minuteStep(),this._secondStep(),this.getAttribute("translations")||""].join(":")}_ensureOverlayContent(t){if(!this._overlay)return;const e=this._overlaySignature(t);this._overlayKey!==e&&(this._overlayKey=e,this._overlay.innerHTML=t?`<div class="sheet-wrap">${this._buildOverlayContent(!0)}</div>`:`<div class="overlay">${this._buildOverlayContent(!1)}</div>`)}_setClosestOptionValue(t,e){const i=Array.from(t.options).map(r=>Number(r.value)).filter(r=>Number.isFinite(r));if(!i.length)return;let s=i[0],n=Math.abs(s-e);for(let r=1;r<i.length;r+=1){const o=i[r],u=Math.abs(o-e);u<n&&(s=o,n=u)}t.value=String(s)}_syncOverlayState(){if(!this._overlay)return;this._syncOverlayHostZIndex();const t=this._isMobileSheet();this._ensureOverlayContent(t),this._syncDismissableLayer();const e=this._timeParts(this._pending),i=this._overlay.querySelector('select[data-segment="hours"]'),s=this._overlay.querySelector('select[data-segment="minutes"]'),n=this._overlay.querySelector('select[data-segment="seconds"]'),r=this._overlay.querySelector('select[data-segment="meridiem"]'),o=this._isDisabled()||this._isReadonly();if(this._overlay.querySelectorAll(".action").forEach(l=>{l.disabled=o}),i){const l=this._is12h()?e.hours%12||12:e.hours;this._setClosestOptionValue(i,l),i.disabled=o}s&&(this._setClosestOptionValue(s,e.minutes),s.disabled=o),n&&(this._setClosestOptionValue(n,e.seconds),n.disabled=o),r&&(r.value=e.meridiem,r.disabled=o),t||this._schedulePosition.run()}_renderOverlay(){this._syncOverlayState()}_applySegmentsFromOverlay(){if(!this._overlay)return;const t=this._overlay.querySelector('select[data-segment="hours"]'),e=this._overlay.querySelector('select[data-segment="minutes"]'),i=this._overlay.querySelector('select[data-segment="seconds"]'),s=this._overlay.querySelector('select[data-segment="meridiem"]');if(!t||!e)return;let n=Number(t.value);const r=Number(e.value),o=i?Number(i.value):0;if(this._is12h()&&s){const l=s.value==="pm"?"pm":"am";l==="pm"&&n<12&&(n+=12),l==="am"&&n===12&&(n=0)}const u=m(n,r,o,this._withSeconds());this._pending=this._clampToBounds(u),this._emitInput("picker")}_onRootClick(t){var s;const e=t.target;if(!e)return;const i=(s=e.closest("[data-action]"))==null?void 0:s.getAttribute("data-action");if(i){if(i==="toggle"){this._restoreFocusEl=e,this._setOpen(!this._open,"toggle");return}i==="clear"&&this._commit(null,"clear")}}_onRootInput(t){const e=t.target;if(!(e instanceof HTMLInputElement)||!e.classList.contains("input")||!this._allowInput())return;this._draft=e.value,this._inlineError="";const i=this._normalizeCanonical(e.value);this._pending=i,this._emitInput("typing")}_onRootBlur(t){const e=t.target;if(!(e instanceof HTMLInputElement)||!e.classList.contains("input")||!this._allowInput())return;if(!this._draft.trim()){this._commit(null,"blur");return}const i=this._normalizeCanonical(this._draft);if(!i){this._inlineError=this.getAttribute("error")||this._translations().invalidTime,this._emitInvalid(this._draft,"parse"),this._updateHostState();return}this._commit(i,"blur")}_stepBy(t){const e=a.parseTimeInput(this._pending||this._value||"00:00",!0)||{hours:0,minutes:0,seconds:0},i=this._minuteStep()*t,s=((e.hours*60+e.minutes+i)%(24*60)+24*60)%(24*60),n=Math.floor(s/60),r=s%60,o=m(n,r,e.seconds,this._withSeconds());this._pending=this._clampToBounds(o),this._emitInput("keyboard-step"),this._updateHostState()}_onRootKeyDown(t){const e=t,i=e.target;if(!(!(i instanceof HTMLInputElement)||!i.classList.contains("input"))){if(e.key==="ArrowUp"){e.preventDefault(),this._stepBy(e.shiftKey?5:1);return}if(e.key==="ArrowDown"){e.preventDefault(),this._stepBy(e.shiftKey?-5:-1);return}if(e.key==="Enter"){e.preventDefault();const s=this._normalizeCanonical(this._draft);if(!s&&this._draft.trim()){this._inlineError=this.getAttribute("error")||this._translations().invalidTime,this._emitInvalid(this._draft,"parse"),this._updateHostState();return}this._commit(s,"enter"),this._isInlineMode()||this._setOpen(!1,"enter");return}if(e.key==="Escape"&&this._open&&!this._isInlineMode()){e.preventDefault(),this._setOpen(!1,"escape");return}e.key==="ArrowDown"&&!this._open&&!this._isInlineMode()&&(e.preventDefault(),this._setOpen(!0,"keyboard"))}}_onOverlayClick(t){var s;const e=t.target;if(!e)return;const i=(s=e.closest("[data-action]"))==null?void 0:s.getAttribute("data-action");if(i){if(i==="backdrop"){this._setOpen(!1,"outside");return}if(i==="cancel"){this._pending=this._value,this._setOpen(!1,"cancel");return}if(i==="clear"){this._pending=null,this._emitInput("clear"),this._renderOverlay();return}if(i==="now"){const n=new Date,r=m(n.getHours(),n.getMinutes(),n.getSeconds(),this._withSeconds());this._pending=this._clampToBounds(r),this._emitInput("now"),this._renderOverlay();return}i==="apply"&&(this._commit(this._pending,"apply"),this._setOpen(!1,"apply"))}}_onOverlayChange(t){const e=t.target;e instanceof HTMLSelectElement&&e.matches("select[data-segment]")&&this._applySegmentsFromOverlay()}_onDocumentPointerDown(t){if(!this._open||!this._overlay)return;const e=t.composedPath();e.includes(this)||e.includes(this._overlay)||this._setOpen(!1,"outside")}_onDocumentKeyDown(t){this._open&&t.key==="Escape"&&(t.preventDefault(),this._setOpen(!1,"escape"))}_cacheDomRefs(){this._labelEl=this.root.querySelector(".label"),this._labelTextEl=this.root.querySelector(".label-text"),this._requiredEl=this.root.querySelector(".required"),this._fieldEl=this.root.querySelector(".field"),this._inputEl=this.root.querySelector(".input"),this._clearBtn=this.root.querySelector('.btn[data-action="clear"]'),this._toggleBtn=this.root.querySelector('.btn[data-action="toggle"]'),this._hintEl=this.root.querySelector(".hint"),this._errorEl=this.root.querySelector(".error"),this._hiddenInputEl=this.root.querySelector(".hidden-input")}_updateHostState(){if(!this._hasView)return;const t=this.getAttribute("label")||"",e=this.getAttribute("hint")||"",i=this.getAttribute("error")||"",s=this._inlineError||i,n=!!this._value,r=this.getAttribute("name")||"",o=this._allowInput()?this._draft:this._formatDisplay(this._value),u=this._isInlineMode(),l=this._isDisabled(),c=this._translations();this._labelEl&&(this._labelEl.hidden=!t),this._labelTextEl&&(this._labelTextEl.textContent=t),this._requiredEl&&(this._requiredEl.hidden=!this.hasAttribute("required")),this._inputEl&&(this._inputEl.value!==o&&(this._inputEl.value=o),this._inputEl.placeholder=this._withSeconds()?c.timePlaceholderSeconds:c.timePlaceholder,this._inputEl.readOnly=!this._allowInput()||this._isReadonly(),this._inputEl.disabled=l,this._inputEl.required=this.hasAttribute("required")),this._clearBtn&&(this._clearBtn.hidden=!(this._clearable()&&n),this._clearBtn.disabled=l||this._isReadonly(),this._clearBtn.setAttribute("aria-label",c.clear)),this._toggleBtn&&(this._toggleBtn.hidden=u,this._toggleBtn.disabled=l||this._isReadonly(),this._toggleBtn.setAttribute("aria-label",c.toggleCalendar)),this._hintEl&&(this._hintEl.hidden=!e,this._hintEl.textContent=e),this._errorEl&&(this._errorEl.hidden=!s,this._errorEl.textContent=s),this._hiddenInputEl&&(this._hiddenInputEl.disabled=!r,this._hiddenInputEl.name=r,this._hiddenInputEl.value=this._value||""),!u&&this._open&&this._syncOverlayState()}render(){this._hasView||(this.setContent(`
268
+ <style>${C}</style>
269
269
  <div class="root">
270
270
  <label class="label" part="label">
271
271
  <span class="label-text"></span>
272
272
  <span class="required">*</span>
273
273
  </label>
274
274
  <div class="field" part="field input">
275
- <span class="icon" part="icon">${E}</span>
275
+ <span class="icon" part="icon">${k}</span>
276
276
  <input class="input" part="input" />
277
- <button type="button" class="btn" part="clear" data-action="clear">${k}</button>
278
- <button type="button" class="btn" part="toggle" data-action="toggle">${w}</button>
277
+ <button type="button" class="btn" part="clear" data-action="clear">${w}</button>
278
+ <button type="button" class="btn" part="toggle" data-action="toggle">${S}</button>
279
279
  </div>
280
280
  <div class="hint" part="hint"></div>
281
281
  <div class="error" part="error" role="alert"></div>