@editora/ui-core 0.1.19 → 0.1.20

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 (299) hide show
  1. package/dist/{ElementBase-1b301e7f.js → ElementBase-EV6mVBUV.js} +1 -1
  2. package/dist/{ElementBase-909688f3.mjs → ElementBase-YlTLMsGk.mjs} +3 -3
  3. package/dist/accordion.cjs.js +3 -3
  4. package/dist/accordion.esm.js +39 -62
  5. package/dist/alert-dialog.cjs.js +19 -19
  6. package/dist/alert-dialog.esm.js +69 -87
  7. package/dist/alert.cjs.js +1 -1
  8. package/dist/alert.esm.js +4 -7
  9. package/dist/anchor.cjs.js +2 -2
  10. package/dist/anchor.esm.js +3 -3
  11. package/dist/animated-beam.cjs.js +83 -83
  12. package/dist/animated-beam.esm.js +250 -277
  13. package/dist/animated-list.cjs.js +4 -4
  14. package/dist/animated-list.esm.js +47 -61
  15. package/dist/animated-text.cjs.js +2 -2
  16. package/dist/animated-text.esm.js +13 -24
  17. package/dist/app-header.cjs.js +3 -3
  18. package/dist/app-header.esm.js +11 -13
  19. package/dist/aspect-ratio.cjs.js +1 -1
  20. package/dist/aspect-ratio.esm.js +4 -7
  21. package/dist/avatar.cjs.js +1 -1
  22. package/dist/avatar.esm.js +7 -13
  23. package/dist/badge.cjs.js +1 -1
  24. package/dist/badge.esm.js +4 -7
  25. package/dist/block-controls.cjs.js +2 -2
  26. package/dist/block-controls.esm.js +19 -35
  27. package/dist/box.cjs.js +1 -1
  28. package/dist/box.esm.js +8 -15
  29. package/dist/breadcrumb.cjs.js +2 -2
  30. package/dist/breadcrumb.esm.js +20 -37
  31. package/dist/button.cjs.js +1 -521
  32. package/dist/button.esm.js +2 -671
  33. package/dist/{calendar-2c11b824.mjs → calendar-DLY4acgn.mjs} +293 -342
  34. package/dist/{calendar-a8735e40.js → calendar-Dkof-FTK.js} +25 -25
  35. package/dist/calendar.cjs.js +1 -1
  36. package/dist/calendar.esm.js +8 -9
  37. package/dist/card.cjs.js +4 -4
  38. package/dist/card.esm.js +13 -19
  39. package/dist/chart.cjs.js +64 -64
  40. package/dist/chart.esm.js +223 -254
  41. package/dist/checkbox.cjs.js +1 -1
  42. package/dist/checkbox.esm.js +2 -3
  43. package/dist/collapsible.cjs.js +1 -1
  44. package/dist/collapsible.esm.js +5 -9
  45. package/dist/{collection-a1aac0c6.mjs → collection-C7URGjEI.mjs} +8 -14
  46. package/dist/collection.cjs.js +1 -1
  47. package/dist/collection.esm.js +4 -7
  48. package/dist/color-picker.cjs.js +9 -9
  49. package/dist/color-picker.esm.js +189 -252
  50. package/dist/combobox.cjs.js +13 -13
  51. package/dist/combobox.esm.js +93 -126
  52. package/dist/command-palette.cjs.js +3 -3
  53. package/dist/command-palette.esm.js +19 -30
  54. package/dist/command.cjs.js +4 -4
  55. package/dist/command.esm.js +41 -53
  56. package/dist/components/ui-orbiter.d.ts.map +1 -1
  57. package/dist/components/ui-skeleton.d.ts.map +1 -1
  58. package/dist/components/ui-split-button.d.ts +1 -0
  59. package/dist/components/ui-split-button.d.ts.map +1 -1
  60. package/dist/components/ui-time-picker.d.ts.map +1 -1
  61. package/dist/container.cjs.js +2 -2
  62. package/dist/container.esm.js +2 -3
  63. package/dist/context-menu.cjs.js +8 -8
  64. package/dist/context-menu.esm.js +157 -219
  65. package/dist/control-group.cjs.js +1 -1
  66. package/dist/control-group.esm.js +2 -3
  67. package/dist/data-table.cjs.js +4 -4
  68. package/dist/data-table.esm.js +299 -381
  69. package/dist/date-field.cjs.js +3 -3
  70. package/dist/date-field.esm.js +68 -80
  71. package/dist/date-picker.cjs.js +9 -9
  72. package/dist/date-picker.esm.js +69 -97
  73. package/dist/date-range-picker.cjs.js +3 -3
  74. package/dist/date-range-picker.esm.js +32 -56
  75. package/dist/date-range-time-picker.cjs.js +9 -9
  76. package/dist/date-range-time-picker.esm.js +111 -140
  77. package/dist/date-time-picker.cjs.js +4 -4
  78. package/dist/date-time-picker.esm.js +112 -144
  79. package/dist/date-time-utils-Dmost5Ee.js +1 -0
  80. package/dist/date-time-utils-y1N2gvG2.mjs +268 -0
  81. package/dist/description.cjs.js +1 -1
  82. package/dist/description.esm.js +3 -5
  83. package/dist/dialog.cjs.js +12 -12
  84. package/dist/dialog.esm.js +44 -63
  85. package/dist/direction-provider.cjs.js +1 -1
  86. package/dist/direction-provider.esm.js +2 -3
  87. package/dist/{dismissable-layer-9c7e6b58.mjs → dismissable-layer-BmPIoK80.mjs} +29 -33
  88. package/dist/dismissable-layer-DNfrKA20.js +1 -0
  89. package/dist/dismissable-layer.cjs.js +2 -2
  90. package/dist/dismissable-layer.esm.js +4 -6
  91. package/dist/dock.cjs.js +5 -5
  92. package/dist/dock.esm.js +134 -155
  93. package/dist/drawer.cjs.js +2 -2
  94. package/dist/drawer.esm.js +18 -35
  95. package/dist/dropdown.cjs.js +2 -2
  96. package/dist/dropdown.esm.js +119 -149
  97. package/dist/dropzone.cjs.js +1 -1
  98. package/dist/dropzone.esm.js +0 -1
  99. package/dist/empty-state.cjs.js +1 -1
  100. package/dist/empty-state.esm.js +1 -1
  101. package/dist/field-error.cjs.js +1 -1
  102. package/dist/field-error.esm.js +3 -5
  103. package/dist/field.cjs.js +5 -5
  104. package/dist/field.esm.js +27 -34
  105. package/dist/fieldset.cjs.js +4 -4
  106. package/dist/fieldset.esm.js +19 -24
  107. package/dist/file-upload.cjs.js +4 -4
  108. package/dist/file-upload.esm.js +69 -93
  109. package/dist/flex.cjs.js +1 -1
  110. package/dist/flex.esm.js +5 -9
  111. package/dist/floating-toolbar.cjs.js +4 -4
  112. package/dist/floating-toolbar.esm.js +60 -85
  113. package/dist/focus-scope-Bwug2gDv.js +1 -0
  114. package/dist/{focus-scope-103833ee.mjs → focus-scope-CmEsG5UZ.mjs} +39 -48
  115. package/dist/focus-scope.cjs.js +2 -2
  116. package/dist/focus-scope.esm.js +15 -20
  117. package/dist/form.cjs.js +2 -2
  118. package/dist/form.esm.js +26 -53
  119. package/dist/gantt.cjs.js +43 -43
  120. package/dist/gantt.esm.js +295 -322
  121. package/dist/grid.cjs.js +1 -1
  122. package/dist/grid.esm.js +5 -9
  123. package/dist/hover-card.cjs.js +4 -4
  124. package/dist/hover-card.esm.js +22 -28
  125. package/dist/icon-cloud.cjs.js +7 -7
  126. package/dist/icon-cloud.esm.js +48 -62
  127. package/dist/icon.cjs.js +1 -1
  128. package/dist/icon.esm.js +2 -4
  129. package/dist/index.cjs.js +1 -1
  130. package/dist/index.esm.js +378 -390
  131. package/dist/inline-edit.cjs.js +11 -11
  132. package/dist/inline-edit.esm.js +32 -36
  133. package/dist/input.cjs.js +17 -17
  134. package/dist/input.esm.js +50 -63
  135. package/dist/label.cjs.js +2 -2
  136. package/dist/label.esm.js +8 -17
  137. package/dist/layout.cjs.js +2 -2
  138. package/dist/layout.esm.js +20 -26
  139. package/dist/listbox-B6QgECax.js +46 -0
  140. package/dist/listbox-DJamVeFj.mjs +200 -0
  141. package/dist/listbox.cjs.js +1 -1
  142. package/dist/listbox.esm.js +2 -4
  143. package/dist/marquee.cjs.js +5 -5
  144. package/dist/marquee.esm.js +33 -50
  145. package/dist/masonry-grid.cjs.js +1 -1
  146. package/dist/masonry-grid.esm.js +5 -9
  147. package/dist/menu.cjs.js +3 -3
  148. package/dist/menu.esm.js +106 -126
  149. package/dist/menubar.cjs.js +5 -5
  150. package/dist/menubar.esm.js +118 -164
  151. package/dist/meter.cjs.js +2 -2
  152. package/dist/meter.esm.js +4 -4
  153. package/dist/multi-select.cjs.js +4 -4
  154. package/dist/multi-select.esm.js +120 -140
  155. package/dist/navigation-menu.cjs.js +4 -4
  156. package/dist/navigation-menu.esm.js +44 -55
  157. package/dist/number-field.cjs.js +2 -2
  158. package/dist/number-field.esm.js +73 -98
  159. package/dist/number-ticker.cjs.js +3 -3
  160. package/dist/number-ticker.esm.js +22 -43
  161. package/dist/odometer.cjs.js +1 -1
  162. package/dist/odometer.esm.js +5 -9
  163. package/dist/orbiter.cjs.js +13 -13
  164. package/dist/orbiter.esm.js +79 -90
  165. package/dist/{overlayManager-5bbd4dc3.mjs → overlayManager-BJjU1VA8.mjs} +4 -5
  166. package/dist/{overlayManager-0eda4e08.js → overlayManager-CSy3fJmJ.js} +1 -1
  167. package/dist/pagination.cjs.js +2 -2
  168. package/dist/pagination.esm.js +14 -18
  169. package/dist/{panel-group-a376cc5e.mjs → panel-group-8sVNnGxg.mjs} +24 -46
  170. package/dist/panel-group-CaD0_KQf.js +36 -0
  171. package/dist/panel-group.cjs.js +1 -1
  172. package/dist/panel-group.esm.js +2 -5
  173. package/dist/panel.cjs.js +4 -4
  174. package/dist/panel.esm.js +8 -10
  175. package/dist/password-field.cjs.js +9 -9
  176. package/dist/password-field.esm.js +62 -82
  177. package/dist/pin-input.cjs.js +3 -3
  178. package/dist/pin-input.esm.js +33 -39
  179. package/dist/placement-grid.cjs.js +4 -4
  180. package/dist/placement-grid.esm.js +108 -131
  181. package/dist/plugin-panel.cjs.js +7 -7
  182. package/dist/plugin-panel.esm.js +13 -15
  183. package/dist/popover.cjs.js +2 -2
  184. package/dist/popover.esm.js +21 -31
  185. package/dist/portal-DgpQ3Jo1.js +1 -0
  186. package/dist/{portal-fe73e5cc.mjs → portal-bR42gHvG.mjs} +43 -48
  187. package/dist/portal.cjs.js +2 -2
  188. package/dist/portal.esm.js +10 -19
  189. package/dist/{positioner-e9770c66.mjs → positioner-D0VGxtYU.mjs} +189 -209
  190. package/dist/positioner-D_fqyx_j.js +1 -0
  191. package/dist/positioner.cjs.js +2 -2
  192. package/dist/positioner.esm.js +11 -18
  193. package/dist/presence.cjs.js +1 -1
  194. package/dist/presence.esm.js +7 -13
  195. package/dist/progress.cjs.js +1 -1
  196. package/dist/progress.esm.js +5 -9
  197. package/dist/quick-actions.cjs.js +6 -6
  198. package/dist/quick-actions.esm.js +52 -62
  199. package/dist/radio-group.cjs.js +13 -13
  200. package/dist/radio-group.esm.js +39 -51
  201. package/dist/radio.cjs.js +1 -1
  202. package/dist/radio.esm.js +5 -9
  203. package/dist/rating.cjs.js +1 -1
  204. package/dist/rating.esm.js +12 -23
  205. package/dist/{roving-focus-group-4350c9a7.mjs → roving-focus-group-Dbm1Jko_.mjs} +3 -6
  206. package/dist/roving-focus-group.cjs.js +1 -1
  207. package/dist/roving-focus-group.esm.js +3 -5
  208. package/dist/runtime-CTaOSmBj.js +1 -0
  209. package/dist/{runtime-161f68a2.mjs → runtime-D1gFh1fS.mjs} +338 -366
  210. package/dist/runtime.cjs.js +1 -1
  211. package/dist/runtime.esm.js +6 -6
  212. package/dist/scroll-area.cjs.js +3 -3
  213. package/dist/scroll-area.esm.js +38 -46
  214. package/dist/{scroll-lock-31da444f.mjs → scroll-lock-LfqXXqsu.mjs} +5 -9
  215. package/dist/section.cjs.js +1 -1
  216. package/dist/section.esm.js +1 -1
  217. package/dist/select.cjs.js +7 -7
  218. package/dist/select.esm.js +67 -97
  219. package/dist/selection-popup.cjs.js +1 -1
  220. package/dist/selection-popup.esm.js +8 -15
  221. package/dist/separator.cjs.js +1 -1
  222. package/dist/separator.esm.js +1 -1
  223. package/dist/sidebar.cjs.js +18 -18
  224. package/dist/sidebar.esm.js +117 -139
  225. package/dist/skeleton.cjs.js +11 -11
  226. package/dist/skeleton.esm.js +27 -24
  227. package/dist/slider.cjs.js +1 -1
  228. package/dist/slider.esm.js +6 -11
  229. package/dist/slot.cjs.js +4 -4
  230. package/dist/slot.esm.js +16 -19
  231. package/dist/sortable.cjs.js +45 -45
  232. package/dist/sortable.esm.js +421 -524
  233. package/dist/spinning-text.cjs.js +12 -12
  234. package/dist/spinning-text.esm.js +80 -92
  235. package/dist/split-button.cjs.js +4 -4
  236. package/dist/split-button.esm.js +77 -62
  237. package/dist/splitter.cjs.js +1 -1
  238. package/dist/splitter.esm.js +1 -1
  239. package/dist/stepper.cjs.js +8 -8
  240. package/dist/stepper.esm.js +32 -52
  241. package/dist/switch.cjs.js +7 -7
  242. package/dist/switch.esm.js +23 -31
  243. package/dist/table.cjs.js +2 -2
  244. package/dist/table.esm.js +46 -56
  245. package/dist/tabs.cjs.js +3 -3
  246. package/dist/tabs.esm.js +35 -55
  247. package/dist/tags-input.cjs.js +4 -4
  248. package/dist/tags-input.esm.js +45 -62
  249. package/dist/textarea.cjs.js +6 -6
  250. package/dist/textarea.esm.js +32 -41
  251. package/dist/time-field.cjs.js +4 -4
  252. package/dist/time-field.esm.js +70 -84
  253. package/dist/time-picker.cjs.js +22 -22
  254. package/dist/time-picker.esm.js +88 -110
  255. package/dist/timeline.cjs.js +1 -1
  256. package/dist/timeline.esm.js +3 -5
  257. package/dist/toast.cjs.js +2 -2
  258. package/dist/toast.esm.js +33 -47
  259. package/dist/toggle-group.cjs.js +6 -6
  260. package/dist/toggle-group.esm.js +85 -105
  261. package/dist/toggle.cjs.js +1 -1
  262. package/dist/toggle.esm.js +3 -5
  263. package/dist/toolbar.cjs.js +1 -1
  264. package/dist/toolbar.esm.js +13 -24
  265. package/dist/tooltip.cjs.js +2 -2
  266. package/dist/tooltip.esm.js +31 -42
  267. package/dist/transfer-list.cjs.js +19 -19
  268. package/dist/transfer-list.esm.js +98 -111
  269. package/dist/{tree-dcd74a4a.mjs → tree-B3kE8ESs.mjs} +55 -62
  270. package/dist/tree-Dx_kv_ih.js +39 -0
  271. package/dist/tree-item.cjs.js +2 -2
  272. package/dist/tree-item.esm.js +2 -3
  273. package/dist/tree.cjs.js +1 -1
  274. package/dist/tree.esm.js +2 -5
  275. package/dist/ui-button-Q0GNNWKC.mjs +665 -0
  276. package/dist/ui-button-rXQOS9QJ.js +521 -0
  277. package/dist/{icon-9e9da03b.js → ui-icon-BzVNC_lr.js} +4 -4
  278. package/dist/{icon-e2a85cc1.mjs → ui-icon-YI6lyuqU.mjs} +58 -65
  279. package/dist/visually-hidden.cjs.js +1 -1
  280. package/dist/visually-hidden.esm.js +1 -1
  281. package/dist/wizard.cjs.js +14 -14
  282. package/dist/wizard.esm.js +85 -105
  283. package/package.json +2 -2
  284. package/dist/date-time-utils-66480de4.js +0 -1
  285. package/dist/date-time-utils-a2c7af25.mjs +0 -307
  286. package/dist/dismissable-layer-193e3bed.js +0 -1
  287. package/dist/focus-scope-2b12b4e7.js +0 -1
  288. package/dist/listbox-308789a0.mjs +0 -210
  289. package/dist/listbox-ef2f708e.js +0 -46
  290. package/dist/panel-group-40254cdd.js +0 -36
  291. package/dist/portal-c69756c0.js +0 -1
  292. package/dist/positioner-33529bb8.js +0 -1
  293. package/dist/runtime-3f13807b.js +0 -1
  294. package/dist/tree-0a7a8d05.js +0 -39
  295. /package/dist/{collection-a2969ad2.js → collection-qv8A8rq4.js} +0 -0
  296. /package/dist/{menu-item-styles-27fdbac4.mjs → menu-item-styles-CZiPwPwl.mjs} +0 -0
  297. /package/dist/{menu-item-styles-83ad1e22.js → menu-item-styles-CbNUEwP2.js} +0 -0
  298. /package/dist/{roving-focus-group-5c059bf9.js → roving-focus-group-BdJ_4Njm.js} +0 -0
  299. /package/dist/{scroll-lock-d7b0df21.js → scroll-lock-BX6e3Ced.js} +0 -0
package/dist/dock.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as M } from "./ElementBase-909688f3.mjs";
1
+ import { E as M } from "./ElementBase-YlTLMsGk.mjs";
2
2
  const T = 1.92, F = 148, C = 1, R = 20, _ = 0.18, g = "12px", y = "12px 14px", x = "56px", D = 56, k = {
3
3
  xs: {
4
4
  gap: "8px",
@@ -418,59 +418,54 @@ const T = 1.92, F = 148, C = 1, R = 20, _ = 0.18, g = "12px", y = "12px 14px", x
418
418
  }
419
419
  }
420
420
  `;
421
- function p(a, e, t) {
422
- return Math.min(t, Math.max(e, a));
421
+ function p(s, e, t) {
422
+ return Math.min(t, Math.max(e, s));
423
423
  }
424
- function I(a, e) {
425
- if (a == null || a.trim() === "")
426
- return e;
427
- const t = Number(a);
424
+ function S(s, e) {
425
+ if (s == null || s.trim() === "") return e;
426
+ const t = Number(s);
428
427
  return Number.isFinite(t) ? t : e;
429
428
  }
430
- function m(a, e) {
431
- return Math.max(0, I(a, e));
429
+ function m(s, e) {
430
+ return Math.max(0, S(s, e));
432
431
  }
433
- function q(a, e) {
434
- return p(I(a, e), 0.01, 1);
432
+ function q(s, e) {
433
+ return p(S(s, e), 0.01, 1);
435
434
  }
436
- function h(a) {
437
- if (a == null || a.trim() === "")
438
- return null;
439
- const e = a.trim().split(/\s+/).filter(Boolean);
435
+ function h(s) {
436
+ if (s == null || s.trim() === "") return null;
437
+ const e = s.trim().split(/\s+/).filter(Boolean);
440
438
  return e.length ? e.map((t) => /^-?\d+(\.\d+)?$/.test(t) ? `${t}px` : t).join(" ") : null;
441
439
  }
442
- function U(a) {
443
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame(a) : window.setTimeout(() => a(Date.now()), 16);
440
+ function U(s) {
441
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : window.setTimeout(() => s(Date.now()), 16);
444
442
  }
445
- function E(a) {
446
- if (a != null) {
443
+ function E(s) {
444
+ if (s != null) {
447
445
  if (typeof cancelAnimationFrame == "function") {
448
- cancelAnimationFrame(a);
446
+ cancelAnimationFrame(s);
449
447
  return;
450
448
  }
451
- window.clearTimeout(a);
449
+ window.clearTimeout(s);
452
450
  }
453
451
  }
454
- function $(a) {
455
- return a instanceof HTMLElement;
452
+ function $(s) {
453
+ return s instanceof HTMLElement;
456
454
  }
457
- function B(a) {
458
- return a.hasAttribute("disabled") || a.getAttribute("aria-disabled") === "true";
455
+ function B(s) {
456
+ return s.hasAttribute("disabled") || s.getAttribute("aria-disabled") === "true";
459
457
  }
460
- function H(a) {
461
- return a.hasAttribute("data-active") || a.getAttribute("aria-current") === "page" || a.getAttribute("aria-current") === "true";
458
+ function H(s) {
459
+ return s.hasAttribute("data-active") || s.getAttribute("aria-current") === "page" || s.getAttribute("aria-current") === "true";
462
460
  }
463
- function A(a, e) {
464
- return a === "top" || a === "bottom" || a === "start" || a === "end" ? a : e === "horizontal" ? "top" : "end";
461
+ function I(s, e) {
462
+ return s === "top" || s === "bottom" || s === "start" || s === "end" ? s : e === "horizontal" ? "top" : "end";
465
463
  }
466
- function S(a, e, t) {
467
- var l;
468
- if (!a.length)
469
- return -1;
470
- let n = e;
471
- for (let r = 0; r < a.length; r += 1)
472
- if (n = (n + t + a.length) % a.length, !((l = a[n]) != null && l.disabled))
473
- return n;
464
+ function A(s, e, t) {
465
+ if (!s.length) return -1;
466
+ let a = e;
467
+ for (let n = 0; n < s.length; n += 1)
468
+ if (a = (a + t + s.length) % s.length, !s[a]?.disabled) return a;
474
469
  return -1;
475
470
  }
476
471
  class G extends M {
@@ -502,8 +497,7 @@ class G extends M {
502
497
  super.connectedCallback(), this.hasAttribute("role") || this.setAttribute("role", "toolbar"), this._observeLightDom(), this._bindReducedMotion(), this._syncHostStyles(), queueMicrotask(() => this.refresh());
503
498
  }
504
499
  disconnectedCallback() {
505
- var e, t;
506
- if (this._slotEl && (this._slotEl.removeEventListener("slotchange", this._handleSlotChange), this._slotEl = null), this._frameEl && (this._frameEl.removeEventListener("pointermove", this._handlePointerMove), this._frameEl.removeEventListener("pointerleave", this._handlePointerLeave), this._frameEl = null), this.removeEventListener("focusin", this._handleFocusIn), this.removeEventListener("focusout", this._handleFocusOut), this.removeEventListener("keydown", this._handleKeyDown), (e = this._resizeObserver) == null || e.disconnect(), this._resizeObserver = null, (t = this._mutationObserver) == null || t.disconnect(), this._mutationObserver = null, this._mediaQuery) {
500
+ if (this._slotEl && (this._slotEl.removeEventListener("slotchange", this._handleSlotChange), this._slotEl = null), this._frameEl && (this._frameEl.removeEventListener("pointermove", this._handlePointerMove), this._frameEl.removeEventListener("pointerleave", this._handlePointerLeave), this._frameEl = null), this.removeEventListener("focusin", this._handleFocusIn), this.removeEventListener("focusout", this._handleFocusOut), this.removeEventListener("keydown", this._handleKeyDown), this._resizeObserver?.disconnect(), this._resizeObserver = null, this._mutationObserver?.disconnect(), this._mutationObserver = null, this._mediaQuery) {
507
501
  try {
508
502
  this._mediaQuery.removeEventListener("change", this._handleReducedMotionChange);
509
503
  } catch {
@@ -517,15 +511,14 @@ class G extends M {
517
511
  this._collectItems(), this._syncHostStyles(), this._measureItems(), this._syncTabIndices(), this._updateTargets(), this._queueAnimation();
518
512
  }
519
513
  focusItem(e) {
520
- var n, l;
521
- const t = typeof e == "number" ? e : this._items.findIndex((r) => r.el.getAttribute("data-value") === String(e));
522
- t < 0 || t >= this._items.length || (n = this._items[t]) != null && n.disabled || (this._focusedIndex = t, this._rovingIndex = t, this._syncTabIndices(), (l = this._items[t]) == null || l.el.focus(), this._pointerActive = !1, this._pointerCoord = Number.NaN, this._updateTargets(), this._queueAnimation());
514
+ const t = typeof e == "number" ? e : this._items.findIndex((a) => a.el.getAttribute("data-value") === String(e));
515
+ t < 0 || t >= this._items.length || this._items[t]?.disabled || (this._focusedIndex = t, this._rovingIndex = t, this._syncTabIndices(), this._items[t]?.el.focus(), this._pointerActive = !1, this._pointerCoord = Number.NaN, this._updateTargets(), this._queueAnimation());
523
516
  }
524
517
  clearActive() {
525
518
  this._pointerActive = !1, this._pointerCoord = Number.NaN, this._focusedIndex = -1, this._updateTargets(), this._queueAnimation();
526
519
  }
527
- attributeChangedCallback(e, t, n) {
528
- !e || t === n || !this.isConnected || (z.has(e) && this._syncHostStyles(), P.has(e) && this._syncItemChrome(), (O.has(e) || P.has(e) || z.has(e)) && this.refresh());
520
+ attributeChangedCallback(e, t, a) {
521
+ !e || t === a || !this.isConnected || (z.has(e) && this._syncHostStyles(), P.has(e) && this._syncItemChrome(), (O.has(e) || P.has(e) || z.has(e)) && this.refresh());
529
522
  }
530
523
  shouldRenderOnAttributeChange() {
531
524
  return !1;
@@ -559,8 +552,7 @@ class G extends M {
559
552
  this._resizeObserver || typeof ResizeObserver > "u" || (this._resizeObserver = new ResizeObserver(this._handleResize), this._resizeObserver.observe(this));
560
553
  }
561
554
  _bindReducedMotion() {
562
- if (typeof window > "u" || typeof window.matchMedia != "function")
563
- return;
555
+ if (typeof window > "u" || typeof window.matchMedia != "function") return;
564
556
  const e = window.matchMedia("(prefers-reduced-motion: reduce)");
565
557
  this._reducedMotion = e.matches, this._mediaQuery = e;
566
558
  try {
@@ -582,54 +574,49 @@ class G extends M {
582
574
  this._measureItems(), this._updateTargets(), this._queueAnimation();
583
575
  }
584
576
  _handlePointerMove(e) {
585
- if ("pointerType" in e && e.pointerType === "touch" || !this._frameEl)
586
- return;
587
- const t = this._frameEl.getBoundingClientRect(), l = this._orientation() === "horizontal" ? e.clientX - t.left : e.clientY - t.top;
588
- this._pointerActive = !0, this._pointerCoord = l, this._measureItems(), this._updateTargets(), this._queueAnimation();
577
+ if ("pointerType" in e && e.pointerType === "touch" || !this._frameEl) return;
578
+ const t = this._frameEl.getBoundingClientRect(), n = this._orientation() === "horizontal" ? e.clientX - t.left : e.clientY - t.top;
579
+ this._pointerActive = !0, this._pointerCoord = n, this._measureItems(), this._updateTargets(), this._queueAnimation();
589
580
  }
590
581
  _handlePointerLeave() {
591
582
  this._pointerActive = !1, this._pointerCoord = Number.NaN, this._updateTargets(), this._queueAnimation();
592
583
  }
593
584
  _handleFocusIn(e) {
594
- var l, r;
595
- const t = (r = (l = e.target) == null ? void 0 : l.closest) == null ? void 0 : r.call(l, "[data-ui-dock-item]");
596
- if (!t)
597
- return;
598
- const n = this._items.findIndex((s) => s.el === t);
599
- n < 0 || (this._focusedIndex = n, this._rovingIndex = n, this._syncTabIndices(), this._pointerActive = !1, this._pointerCoord = Number.NaN, this._updateTargets(), this._queueAnimation());
585
+ const t = e.target?.closest?.("[data-ui-dock-item]");
586
+ if (!t) return;
587
+ const a = this._items.findIndex((n) => n.el === t);
588
+ a < 0 || (this._focusedIndex = a, this._rovingIndex = a, this._syncTabIndices(), this._pointerActive = !1, this._pointerCoord = Number.NaN, this._updateTargets(), this._queueAnimation());
600
589
  }
601
590
  _handleFocusOut(e) {
602
591
  const t = e.relatedTarget;
603
592
  t && this.contains(t) || (this._focusedIndex = -1, this._pointerActive || (this._updateTargets(), this._queueAnimation()));
604
593
  }
605
594
  _handleKeyDown(e) {
606
- var r;
607
- if (e.defaultPrevented || !this._items.length)
608
- return;
609
- const t = this._orientation(), n = t === "horizontal" ? ["ArrowLeft"] : ["ArrowUp"], l = t === "horizontal" ? ["ArrowRight"] : ["ArrowDown"];
610
- if (n.includes(e.key)) {
595
+ if (e.defaultPrevented || !this._items.length) return;
596
+ const t = this._orientation(), a = t === "horizontal" ? ["ArrowLeft"] : ["ArrowUp"], n = t === "horizontal" ? ["ArrowRight"] : ["ArrowDown"];
597
+ if (a.includes(e.key)) {
611
598
  e.preventDefault();
612
- const s = S(this._items, this._rovingIndex, -1);
613
- s >= 0 && this.focusItem(s);
599
+ const i = A(this._items, this._rovingIndex, -1);
600
+ i >= 0 && this.focusItem(i);
614
601
  return;
615
602
  }
616
- if (l.includes(e.key)) {
603
+ if (n.includes(e.key)) {
617
604
  e.preventDefault();
618
- const s = S(this._items, this._rovingIndex, 1);
619
- s >= 0 && this.focusItem(s);
605
+ const i = A(this._items, this._rovingIndex, 1);
606
+ i >= 0 && this.focusItem(i);
620
607
  return;
621
608
  }
622
609
  if (e.key === "Home") {
623
610
  e.preventDefault();
624
- const s = this._items.findIndex((i) => !i.disabled);
625
- s >= 0 && this.focusItem(s);
611
+ const i = this._items.findIndex((c) => !c.disabled);
612
+ i >= 0 && this.focusItem(i);
626
613
  return;
627
614
  }
628
615
  if (e.key === "End") {
629
616
  e.preventDefault();
630
- for (let s = this._items.length - 1; s >= 0; s -= 1)
631
- if (!((r = this._items[s]) != null && r.disabled)) {
632
- this.focusItem(s);
617
+ for (let i = this._items.length - 1; i >= 0; i -= 1)
618
+ if (!this._items[i]?.disabled) {
619
+ this.focusItem(i);
633
620
  break;
634
621
  }
635
622
  return;
@@ -637,96 +624,92 @@ class G extends M {
637
624
  e.key === "Escape" && this.clearActive();
638
625
  }
639
626
  _collectItems() {
640
- var l, r;
641
- const e = new Map(this._items.map((s) => [s.el, s])), t = Array.from(this.children).filter($).map((s) => {
642
- const i = e.get(s), c = s.querySelector("[data-ui-dock-icon]"), u = s.querySelector("[data-ui-dock-label]"), o = s.querySelector("[data-ui-dock-badge]");
627
+ const e = new Map(this._items.map((n) => [n.el, n])), t = Array.from(this.children).filter($).map((n) => {
628
+ const i = e.get(n), c = n.querySelector("[data-ui-dock-icon]"), o = n.querySelector("[data-ui-dock-label]"), l = n.querySelector("[data-ui-dock-badge]");
643
629
  return {
644
- el: s,
630
+ el: n,
645
631
  iconEl: c,
646
- labelEl: u,
647
- badgeEl: o,
648
- center: (i == null ? void 0 : i.center) ?? 0,
649
- currentScale: (i == null ? void 0 : i.currentScale) ?? this._idleScale(),
650
- targetScale: (i == null ? void 0 : i.targetScale) ?? this._idleScale(),
651
- currentLift: (i == null ? void 0 : i.currentLift) ?? 0,
652
- targetLift: (i == null ? void 0 : i.targetLift) ?? 0,
653
- labelVisible: (i == null ? void 0 : i.labelVisible) ?? !1,
654
- disabled: B(s),
655
- sticky: H(s),
656
- scaleVelocity: (i == null ? void 0 : i.scaleVelocity) ?? 0,
657
- liftVelocity: (i == null ? void 0 : i.liftVelocity) ?? 0
632
+ labelEl: o,
633
+ badgeEl: l,
634
+ center: i?.center ?? 0,
635
+ currentScale: i?.currentScale ?? this._idleScale(),
636
+ targetScale: i?.targetScale ?? this._idleScale(),
637
+ currentLift: i?.currentLift ?? 0,
638
+ targetLift: i?.targetLift ?? 0,
639
+ labelVisible: i?.labelVisible ?? !1,
640
+ disabled: B(n),
641
+ sticky: H(n),
642
+ scaleVelocity: i?.scaleVelocity ?? 0,
643
+ liftVelocity: i?.liftVelocity ?? 0
658
644
  };
659
645
  });
660
646
  this._items = t;
661
- const n = this._items.findIndex((s) => s.sticky && !s.disabled);
662
- n >= 0 ? this._rovingIndex = n : (!this._items[this._rovingIndex] || (l = this._items[this._rovingIndex]) != null && l.disabled) && (this._rovingIndex = this._items.findIndex((s) => !s.disabled)), this._rovingIndex < 0 && (this._rovingIndex = 0), (this._focusedIndex >= this._items.length || (r = this._items[this._focusedIndex]) != null && r.disabled) && (this._focusedIndex = -1), this._syncItemChrome();
647
+ const a = this._items.findIndex((n) => n.sticky && !n.disabled);
648
+ a >= 0 ? this._rovingIndex = a : (!this._items[this._rovingIndex] || this._items[this._rovingIndex]?.disabled) && (this._rovingIndex = this._items.findIndex((n) => !n.disabled)), this._rovingIndex < 0 && (this._rovingIndex = 0), (this._focusedIndex >= this._items.length || this._items[this._focusedIndex]?.disabled) && (this._focusedIndex = -1), this._syncItemChrome();
663
649
  }
664
650
  _syncItemChrome() {
665
- const e = A(this.getAttribute("label-placement"), this._orientation()), t = this._labelMode(), n = this._orientation();
666
- this._items.forEach((l) => {
667
- var o;
668
- const { el: r, iconEl: s, labelEl: i, badgeEl: c, sticky: u } = l;
669
- if (r.setAttribute("data-ui-dock-item", ""), r.style.setProperty("position", "relative"), r.style.setProperty("display", "inline-flex"), r.style.setProperty("align-items", "center"), r.style.setProperty("justify-content", "center"), r.style.setProperty("inline-size", "var(--ui-dock-item-size)"), r.style.setProperty("block-size", "var(--ui-dock-item-size)"), r.style.setProperty("min-inline-size", "var(--ui-dock-item-size)"), r.style.setProperty("min-block-size", "var(--ui-dock-item-size)"), r.style.setProperty("flex", "0 0 var(--ui-dock-item-size)"), r.style.setProperty("box-sizing", "border-box"), r.style.setProperty("background", "transparent"), r.style.setProperty("border", "none"), r.style.setProperty("padding", "0"), r.style.setProperty("margin", "0"), r.style.setProperty("color", "inherit"), r.style.setProperty("text-decoration", "none"), r.style.setProperty("outline", "none"), r.style.setProperty("cursor", l.disabled ? "not-allowed" : "pointer"), r.style.setProperty("transform-origin", n === "horizontal" ? "center bottom" : "center center"), r.style.setProperty("touch-action", "manipulation"), r.hasAttribute("tabindex") || (r.tabIndex = -1), !r.hasAttribute("aria-label")) {
670
- const d = ((o = i == null ? void 0 : i.textContent) == null ? void 0 : o.trim()) || r.getAttribute("data-label") || r.getAttribute("title") || void 0;
671
- d && r.setAttribute("aria-label", d);
651
+ const e = I(this.getAttribute("label-placement"), this._orientation()), t = this._labelMode(), a = this._orientation();
652
+ this._items.forEach((n) => {
653
+ const { el: i, iconEl: c, labelEl: o, badgeEl: l, sticky: d } = n;
654
+ if (i.setAttribute("data-ui-dock-item", ""), i.style.setProperty("position", "relative"), i.style.setProperty("display", "inline-flex"), i.style.setProperty("align-items", "center"), i.style.setProperty("justify-content", "center"), i.style.setProperty("inline-size", "var(--ui-dock-item-size)"), i.style.setProperty("block-size", "var(--ui-dock-item-size)"), i.style.setProperty("min-inline-size", "var(--ui-dock-item-size)"), i.style.setProperty("min-block-size", "var(--ui-dock-item-size)"), i.style.setProperty("flex", "0 0 var(--ui-dock-item-size)"), i.style.setProperty("box-sizing", "border-box"), i.style.setProperty("background", "transparent"), i.style.setProperty("border", "none"), i.style.setProperty("padding", "0"), i.style.setProperty("margin", "0"), i.style.setProperty("color", "inherit"), i.style.setProperty("text-decoration", "none"), i.style.setProperty("outline", "none"), i.style.setProperty("cursor", n.disabled ? "not-allowed" : "pointer"), i.style.setProperty("transform-origin", a === "horizontal" ? "center bottom" : "center center"), i.style.setProperty("touch-action", "manipulation"), i.hasAttribute("tabindex") || (i.tabIndex = -1), !i.hasAttribute("aria-label")) {
655
+ const r = o?.textContent?.trim() || i.getAttribute("data-label") || i.getAttribute("title") || void 0;
656
+ r && i.setAttribute("aria-label", r);
672
657
  }
673
- u ? r.setAttribute("data-dock-current", "true") : r.removeAttribute("data-dock-current"), s && (s.style.setProperty("display", "inline-flex"), s.style.setProperty("align-items", "center"), s.style.setProperty("justify-content", "center"), s.style.setProperty("inline-size", "100%"), s.style.setProperty("block-size", "100%"), s.style.setProperty("border-radius", "var(--ui-dock-item-radius)"), s.style.setProperty("background", "var(--ui-dock-item-bg)"), s.style.setProperty("border", "1px solid var(--ui-dock-item-border)"), s.style.setProperty("box-shadow", "var(--ui-dock-item-shadow)"), s.style.setProperty("backdrop-filter", "var(--ui-dock-item-backdrop)"), s.style.setProperty("font-size", "var(--ui-dock-icon-size)"), s.style.setProperty("color", "inherit"), s.style.setProperty("overflow", "hidden"), s.style.setProperty("box-sizing", "border-box")), i && (i.setAttribute("aria-hidden", "true"), i.style.setProperty("position", "absolute"), i.style.setProperty("pointer-events", "none"), i.style.setProperty("white-space", "nowrap"), i.style.setProperty("padding", "var(--ui-dock-label-padding)"), i.style.setProperty("border-radius", "var(--ui-dock-label-radius)"), i.style.setProperty("background", "var(--ui-dock-label-bg)"), i.style.setProperty("color", "var(--ui-dock-label-color)"), i.style.setProperty("border", "1px solid var(--ui-dock-label-border)"), i.style.setProperty("box-shadow", "var(--ui-dock-label-shadow)"), i.style.setProperty("backdrop-filter", "var(--ui-dock-label-backdrop)"), i.style.setProperty("font-size", "var(--ui-dock-label-font-size)"), i.style.setProperty("font-weight", "var(--ui-dock-label-font-weight)"), i.style.setProperty("line-height", "1.2"), i.style.setProperty("letter-spacing", "0.01em"), i.style.setProperty("min-inline-size", "max-content"), i.style.setProperty("z-index", "3"), i.style.setProperty("display", t === "none" ? "none" : "inline-flex"), i.style.removeProperty("top"), i.style.removeProperty("bottom"), i.style.removeProperty("left"), i.style.removeProperty("right"), e === "top" ? (i.style.setProperty("left", "50%"), i.style.setProperty("bottom", "calc(100% + var(--ui-dock-label-offset))")) : e === "bottom" ? (i.style.setProperty("left", "50%"), i.style.setProperty("top", "calc(100% + var(--ui-dock-label-offset))")) : e === "start" ? (i.style.setProperty("right", "calc(100% + var(--ui-dock-label-offset))"), i.style.setProperty("top", "50%")) : (i.style.setProperty("left", "calc(100% + var(--ui-dock-label-offset))"), i.style.setProperty("top", "50%"))), c && (c.setAttribute("aria-hidden", "true"), c.style.setProperty("position", "absolute"), c.style.setProperty("inset-inline-end", "-2px"), c.style.setProperty("inset-block-start", "-2px"), c.style.setProperty("display", "inline-flex"), c.style.setProperty("align-items", "center"), c.style.setProperty("justify-content", "center"), c.style.setProperty("min-inline-size", "18px"), c.style.setProperty("min-block-size", "18px"), c.style.setProperty("padding", "0 6px"), c.style.setProperty("border-radius", "999px"), c.style.setProperty("background", "var(--ui-dock-accent)"), c.style.setProperty("color", "#ffffff"), c.style.setProperty("font-size", "11px"), c.style.setProperty("font-weight", "700"), c.style.setProperty("box-shadow", "0 8px 18px color-mix(in srgb, var(--ui-dock-accent) 32%, rgba(15, 23, 42, 0.18))"), c.style.setProperty("z-index", "4"));
658
+ d ? i.setAttribute("data-dock-current", "true") : i.removeAttribute("data-dock-current"), c && (c.style.setProperty("display", "inline-flex"), c.style.setProperty("align-items", "center"), c.style.setProperty("justify-content", "center"), c.style.setProperty("inline-size", "100%"), c.style.setProperty("block-size", "100%"), c.style.setProperty("border-radius", "var(--ui-dock-item-radius)"), c.style.setProperty("background", "var(--ui-dock-item-bg)"), c.style.setProperty("border", "1px solid var(--ui-dock-item-border)"), c.style.setProperty("box-shadow", "var(--ui-dock-item-shadow)"), c.style.setProperty("backdrop-filter", "var(--ui-dock-item-backdrop)"), c.style.setProperty("font-size", "var(--ui-dock-icon-size)"), c.style.setProperty("color", "inherit"), c.style.setProperty("overflow", "hidden"), c.style.setProperty("box-sizing", "border-box")), o && (o.setAttribute("aria-hidden", "true"), o.style.setProperty("position", "absolute"), o.style.setProperty("pointer-events", "none"), o.style.setProperty("white-space", "nowrap"), o.style.setProperty("padding", "var(--ui-dock-label-padding)"), o.style.setProperty("border-radius", "var(--ui-dock-label-radius)"), o.style.setProperty("background", "var(--ui-dock-label-bg)"), o.style.setProperty("color", "var(--ui-dock-label-color)"), o.style.setProperty("border", "1px solid var(--ui-dock-label-border)"), o.style.setProperty("box-shadow", "var(--ui-dock-label-shadow)"), o.style.setProperty("backdrop-filter", "var(--ui-dock-label-backdrop)"), o.style.setProperty("font-size", "var(--ui-dock-label-font-size)"), o.style.setProperty("font-weight", "var(--ui-dock-label-font-weight)"), o.style.setProperty("line-height", "1.2"), o.style.setProperty("letter-spacing", "0.01em"), o.style.setProperty("min-inline-size", "max-content"), o.style.setProperty("z-index", "3"), o.style.setProperty("display", t === "none" ? "none" : "inline-flex"), o.style.removeProperty("top"), o.style.removeProperty("bottom"), o.style.removeProperty("left"), o.style.removeProperty("right"), e === "top" ? (o.style.setProperty("left", "50%"), o.style.setProperty("bottom", "calc(100% + var(--ui-dock-label-offset))")) : e === "bottom" ? (o.style.setProperty("left", "50%"), o.style.setProperty("top", "calc(100% + var(--ui-dock-label-offset))")) : e === "start" ? (o.style.setProperty("right", "calc(100% + var(--ui-dock-label-offset))"), o.style.setProperty("top", "50%")) : (o.style.setProperty("left", "calc(100% + var(--ui-dock-label-offset))"), o.style.setProperty("top", "50%"))), l && (l.setAttribute("aria-hidden", "true"), l.style.setProperty("position", "absolute"), l.style.setProperty("inset-inline-end", "-2px"), l.style.setProperty("inset-block-start", "-2px"), l.style.setProperty("display", "inline-flex"), l.style.setProperty("align-items", "center"), l.style.setProperty("justify-content", "center"), l.style.setProperty("min-inline-size", "18px"), l.style.setProperty("min-block-size", "18px"), l.style.setProperty("padding", "0 6px"), l.style.setProperty("border-radius", "999px"), l.style.setProperty("background", "var(--ui-dock-accent)"), l.style.setProperty("color", "#ffffff"), l.style.setProperty("font-size", "11px"), l.style.setProperty("font-weight", "700"), l.style.setProperty("box-shadow", "0 8px 18px color-mix(in srgb, var(--ui-dock-accent) 32%, rgba(15, 23, 42, 0.18))"), l.style.setProperty("z-index", "4"));
674
659
  });
675
660
  }
676
661
  _syncTabIndices() {
677
- var t;
678
- const e = this._items.findIndex((n) => !n.disabled);
679
- e >= 0 && (this._rovingIndex < 0 || (t = this._items[this._rovingIndex]) != null && t.disabled) && (this._rovingIndex = e), this._items.forEach((n, l) => {
680
- if (n.disabled) {
681
- n.el.tabIndex = -1;
662
+ const e = this._items.findIndex((t) => !t.disabled);
663
+ e >= 0 && (this._rovingIndex < 0 || this._items[this._rovingIndex]?.disabled) && (this._rovingIndex = e), this._items.forEach((t, a) => {
664
+ if (t.disabled) {
665
+ t.el.tabIndex = -1;
682
666
  return;
683
667
  }
684
- n.el.tabIndex = l === this._rovingIndex ? 0 : -1;
668
+ t.el.tabIndex = a === this._rovingIndex ? 0 : -1;
685
669
  });
686
670
  }
687
671
  _measureItems() {
688
- if (!this._frameEl)
689
- return;
690
- const e = this._frameEl.getBoundingClientRect(), t = this._orientation(), n = t === "horizontal" ? e.left : e.top;
691
- this._items.forEach((l) => {
692
- const r = l.el.getBoundingClientRect();
693
- l.center = (t === "horizontal" ? r.left + r.width / 2 : r.top + r.height / 2) - n;
672
+ if (!this._frameEl) return;
673
+ const e = this._frameEl.getBoundingClientRect(), t = this._orientation(), a = t === "horizontal" ? e.left : e.top;
674
+ this._items.forEach((n) => {
675
+ const i = n.el.getBoundingClientRect();
676
+ n.center = (t === "horizontal" ? i.left + i.width / 2 : i.top + i.height / 2) - a;
694
677
  });
695
678
  }
696
679
  _updateTargets() {
697
- const e = this._idleScale(), t = Math.max(e, this._magnification()), n = Math.max(1, this._distance()), l = this._lift() * this._motion().lift, r = this._labelMode();
698
- this._items.forEach((s, i) => {
699
- let c = e;
700
- if (s.sticky && (c = Math.max(c, e + (t - e) * 0.08)), this._pointerActive && Number.isFinite(this._pointerCoord)) {
701
- const o = Math.abs(this._pointerCoord - s.center), d = p(1 - o / n, 0, 1);
702
- c = Math.max(c, e + (t - e) * d * d);
680
+ const e = this._idleScale(), t = Math.max(e, this._magnification()), a = Math.max(1, this._distance()), n = this._lift() * this._motion().lift, i = this._labelMode();
681
+ this._items.forEach((c, o) => {
682
+ let l = e;
683
+ if (c.sticky && (l = Math.max(l, e + (t - e) * 0.08)), this._pointerActive && Number.isFinite(this._pointerCoord)) {
684
+ const r = Math.abs(this._pointerCoord - c.center), u = p(1 - r / a, 0, 1);
685
+ l = Math.max(l, e + (t - e) * u * u);
703
686
  }
704
- i === this._focusedIndex && (c = Math.max(c, t)), s.disabled && (c = e);
705
- const u = t === e ? 0 : (c - e) / (t - e);
706
- s.targetScale = p(c, e, t), s.targetLift = u * l, s.labelVisible = r === "always" || r !== "none" && (i === this._focusedIndex || u > 0.18);
687
+ o === this._focusedIndex && (l = Math.max(l, t)), c.disabled && (l = e);
688
+ const d = t === e ? 0 : (l - e) / (t - e);
689
+ c.targetScale = p(l, e, t), c.targetLift = d * n, c.labelVisible = i === "always" || i !== "none" && (o === this._focusedIndex || d > 0.18);
707
690
  }), this._updateRuntimeState();
708
691
  }
709
692
  _applyFrame(e = !1) {
710
- const t = this._smoothing(), n = this._motion(), l = p(n.response + t * 0.12, 0.05, 0.42), r = p(n.damping + (t - _) * 0.14, 0.52, 0.9), s = this._orientation(), i = A(this.getAttribute("label-placement"), s), c = this._mainAxisOffsets(n.spread);
711
- let u = !1;
712
- this._items.forEach((o, d) => {
713
- e ? (o.currentScale = o.targetScale, o.currentLift = o.targetLift, o.scaleVelocity = 0, o.liftVelocity = 0) : (o.scaleVelocity = o.scaleVelocity * r + (o.targetScale - o.currentScale) * l, o.liftVelocity = o.liftVelocity * r + (o.targetLift - o.currentLift) * l, o.currentScale += o.scaleVelocity, o.currentLift += o.liftVelocity, Math.abs(o.targetScale - o.currentScale) < 2e-3 && Math.abs(o.scaleVelocity) < 2e-3 && (o.currentScale = o.targetScale, o.scaleVelocity = 0), Math.abs(o.targetLift - o.currentLift) < 2e-3 && Math.abs(o.liftVelocity) < 2e-3 && (o.currentLift = o.targetLift, o.liftVelocity = 0)), (Math.abs(o.targetScale - o.currentScale) >= 2e-3 || Math.abs(o.targetLift - o.currentLift) >= 2e-3 || Math.abs(o.scaleVelocity) >= 2e-3 || Math.abs(o.liftVelocity) >= 2e-3) && (u = !0);
714
- const b = c[d] ?? 0, L = s === "horizontal" ? b : i === "start" ? -o.currentLift * 0.28 : o.currentLift * 0.28, w = s === "horizontal" ? -o.currentLift : b;
715
- if (o.el.style.setProperty("transform", `translate3d(${L}px, ${w}px, 0) scale(${o.currentScale})`), o.el.style.setProperty("z-index", String(100 + Math.round(o.currentScale * 100) + d)), o.iconEl) {
716
- const f = d === this._focusedIndex ? "0 0 0 3px color-mix(in srgb, var(--ui-dock-focus-ring) 26%, transparent), " : o.sticky ? "0 0 0 2px color-mix(in srgb, var(--ui-dock-accent) 22%, transparent), " : "";
717
- o.iconEl.style.setProperty("box-shadow", `${f}var(--ui-dock-item-shadow)`), o.iconEl.style.setProperty(
693
+ const t = this._smoothing(), a = this._motion(), n = p(a.response + t * 0.12, 0.05, 0.42), i = p(a.damping + (t - _) * 0.14, 0.52, 0.9), c = this._orientation(), o = I(this.getAttribute("label-placement"), c), l = this._mainAxisOffsets(a.spread);
694
+ let d = !1;
695
+ this._items.forEach((r, u) => {
696
+ e ? (r.currentScale = r.targetScale, r.currentLift = r.targetLift, r.scaleVelocity = 0, r.liftVelocity = 0) : (r.scaleVelocity = r.scaleVelocity * i + (r.targetScale - r.currentScale) * n, r.liftVelocity = r.liftVelocity * i + (r.targetLift - r.currentLift) * n, r.currentScale += r.scaleVelocity, r.currentLift += r.liftVelocity, Math.abs(r.targetScale - r.currentScale) < 2e-3 && Math.abs(r.scaleVelocity) < 2e-3 && (r.currentScale = r.targetScale, r.scaleVelocity = 0), Math.abs(r.targetLift - r.currentLift) < 2e-3 && Math.abs(r.liftVelocity) < 2e-3 && (r.currentLift = r.targetLift, r.liftVelocity = 0)), (Math.abs(r.targetScale - r.currentScale) >= 2e-3 || Math.abs(r.targetLift - r.currentLift) >= 2e-3 || Math.abs(r.scaleVelocity) >= 2e-3 || Math.abs(r.liftVelocity) >= 2e-3) && (d = !0);
697
+ const b = l[u] ?? 0, L = c === "horizontal" ? b : o === "start" ? -r.currentLift * 0.28 : r.currentLift * 0.28, w = c === "horizontal" ? -r.currentLift : b;
698
+ if (r.el.style.setProperty("transform", `translate3d(${L}px, ${w}px, 0) scale(${r.currentScale})`), r.el.style.setProperty("z-index", String(100 + Math.round(r.currentScale * 100) + u)), r.iconEl) {
699
+ const f = u === this._focusedIndex ? "0 0 0 3px color-mix(in srgb, var(--ui-dock-focus-ring) 26%, transparent), " : r.sticky ? "0 0 0 2px color-mix(in srgb, var(--ui-dock-accent) 22%, transparent), " : "";
700
+ r.iconEl.style.setProperty("box-shadow", `${f}var(--ui-dock-item-shadow)`), r.iconEl.style.setProperty(
718
701
  "border-color",
719
- o.sticky || d === this._focusedIndex ? "color-mix(in srgb, var(--ui-dock-accent) 30%, var(--ui-dock-item-border))" : "var(--ui-dock-item-border)"
702
+ r.sticky || u === this._focusedIndex ? "color-mix(in srgb, var(--ui-dock-accent) 30%, var(--ui-dock-item-border))" : "var(--ui-dock-item-border)"
720
703
  );
721
704
  }
722
- if (o.labelEl) {
723
- const f = o.labelVisible;
724
- o.labelEl.style.setProperty("opacity", f ? "1" : "0"), o.labelEl.style.setProperty(
705
+ if (r.labelEl) {
706
+ const f = r.labelVisible;
707
+ r.labelEl.style.setProperty("opacity", f ? "1" : "0"), r.labelEl.style.setProperty(
725
708
  "transform",
726
- this._labelTransform(i, f)
727
- ), o.labelEl.style.setProperty("filter", f ? "blur(0px)" : "blur(6px)");
709
+ this._labelTransform(o, f)
710
+ ), r.labelEl.style.setProperty("filter", f ? "blur(0px)" : "blur(6px)");
728
711
  }
729
- }), u && this._queueAnimation();
712
+ }), d && this._queueAnimation();
730
713
  }
731
714
  _queueAnimation() {
732
715
  if (this._reducedMotion) {
@@ -738,15 +721,14 @@ class G extends M {
738
721
  }));
739
722
  }
740
723
  _mainAxisOffsets(e) {
741
- if (this._items.length < 2)
742
- return this._items.map(() => 0);
743
- const t = this._resolvedItemSizePx(), n = this._resolvedGapPx(), l = t + n, r = [0];
744
- for (let i = 1; i < this._items.length; i += 1) {
745
- const c = this._items[i - 1], u = this._items[i], o = t * c.currentScale / 2, d = t * u.currentScale / 2, b = Math.max(0, o + d - l);
746
- r[i] = r[i - 1] + b * e;
724
+ if (this._items.length < 2) return this._items.map(() => 0);
725
+ const t = this._resolvedItemSizePx(), a = this._resolvedGapPx(), n = t + a, i = [0];
726
+ for (let o = 1; o < this._items.length; o += 1) {
727
+ const l = this._items[o - 1], d = this._items[o], r = t * l.currentScale / 2, u = t * d.currentScale / 2, b = Math.max(0, r + u - n);
728
+ i[o] = i[o - 1] + b * e;
747
729
  }
748
- const s = r[r.length - 1] / 2;
749
- return r.map((i) => i - s);
730
+ const c = i[i.length - 1] / 2;
731
+ return i.map((o) => o - c);
750
732
  }
751
733
  _labelTransform(e, t) {
752
734
  return e === "top" ? t ? "translate3d(-50%, 0, 0)" : "translate3d(-50%, 6px, 0)" : e === "bottom" ? t ? "translate3d(-50%, 0, 0)" : "translate3d(-50%, -6px, 0)" : e === "start" ? t ? "translate3d(0, -50%, 0)" : "translate3d(6px, -50%, 0)" : t ? "translate3d(0, -50%, 0)" : "translate3d(-6px, -50%, 0)";
@@ -756,12 +738,12 @@ class G extends M {
756
738
  e ? this.style.setProperty("--ui-dock-gap", e) : this.style.removeProperty("--ui-dock-gap");
757
739
  const t = h(this.getAttribute("padding"));
758
740
  t ? this.style.setProperty("--ui-dock-padding", t) : this.style.removeProperty("--ui-dock-padding");
759
- const n = h(this.getAttribute("item-size"));
760
- n ? (this.style.setProperty("--ui-dock-item-size", n), this.style.setProperty("--ui-dock-icon-size", `calc(${n} * 0.44)`)) : (this.style.removeProperty("--ui-dock-item-size"), this.style.removeProperty("--ui-dock-icon-size"));
761
- const l = this.getAttribute("radius");
762
- if (l && !N.has(l)) {
763
- const r = h(l) || l;
764
- this.style.setProperty("--ui-dock-radius", r), this.style.setProperty("--ui-dock-item-radius", `calc(${r} * 0.82)`);
741
+ const a = h(this.getAttribute("item-size"));
742
+ a ? (this.style.setProperty("--ui-dock-item-size", a), this.style.setProperty("--ui-dock-icon-size", `calc(${a} * 0.44)`)) : (this.style.removeProperty("--ui-dock-item-size"), this.style.removeProperty("--ui-dock-icon-size"));
743
+ const n = this.getAttribute("radius");
744
+ if (n && !N.has(n)) {
745
+ const i = h(n) || n;
746
+ this.style.setProperty("--ui-dock-radius", i), this.style.setProperty("--ui-dock-item-radius", `calc(${i} * 0.82)`);
765
747
  } else
766
748
  this.style.removeProperty("--ui-dock-radius"), this.style.removeProperty("--ui-dock-item-radius");
767
749
  }
@@ -796,21 +778,18 @@ class G extends M {
796
778
  return e === "xs" || e === "0" ? "xs" : e === "sm" || e === "1" ? "sm" : e === "lg" || e === "3" ? "lg" : e === "xl" || e === "4" ? "xl" : "md";
797
779
  }
798
780
  _resolvedItemSizePx() {
799
- var t;
800
781
  const e = h(this.getAttribute("item-size"));
801
782
  if (e) {
802
- const n = Number.parseFloat(e);
803
- if (Number.isFinite(n))
804
- return n;
783
+ const t = Number.parseFloat(e);
784
+ if (Number.isFinite(t)) return t;
805
785
  }
806
- return ((t = k[this._sizeToken()]) == null ? void 0 : t.itemSize) ?? D;
786
+ return k[this._sizeToken()]?.itemSize ?? D;
807
787
  }
808
788
  _resolvedGapPx() {
809
789
  const e = h(this.getAttribute("gap"));
810
790
  if (e) {
811
- const n = Number.parseFloat(e);
812
- if (Number.isFinite(n))
813
- return n;
791
+ const a = Number.parseFloat(e);
792
+ if (Number.isFinite(a)) return a;
814
793
  }
815
794
  const t = k[this._sizeToken()];
816
795
  return t ? Number.parseFloat(t.gap) : Number.parseFloat(g);
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("./ElementBase-1b301e7f.js"),m=require("./overlayManager-0eda4e08.js");require("./scroll-lock-d7b0df21.js");function F(i){return typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>i()):window.setTimeout(i,16)}function _(i){if(i){if(typeof cancelAnimationFrame=="function"){cancelAnimationFrame(i);return}window.clearTimeout(i)}}const E='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',S=new Set(["side","dismissible","headless","variant","density","shape","elevation","tone","size","inset","close-on-overlay","close-on-esc","lock-while-loading","show-close","state","role","aria-label","aria-labelledby","aria-describedby","initial-focus"]),T=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const O=require("./ElementBase-EV6mVBUV.js"),m=require("./overlayManager-CSy3fJmJ.js");function F(i){return typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>i()):window.setTimeout(i,16)}function _(i){if(i){if(typeof cancelAnimationFrame=="function"){cancelAnimationFrame(i);return}window.clearTimeout(i)}}const E='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',S=new Set(["side","dismissible","headless","variant","density","shape","elevation","tone","size","inset","close-on-overlay","close-on-esc","lock-while-loading","show-close","state","role","aria-label","aria-labelledby","aria-describedby","initial-focus"]),T=`
2
2
  :host {
3
3
  position: fixed;
4
4
  inset: 0;
@@ -498,7 +498,7 @@
498
498
  display: none;
499
499
  }
500
500
  }
501
- `;function w(i,e){if(i==null)return e;const t=i.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function v(i){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function C(i,e){return i==="top"||i==="bottom"||i==="left"||i==="right"?i:i==="start"?e==="rtl"?"right":"left":i==="end"?e==="rtl"?"left":"right":"left"}function A(i,e){var r;const t=i.querySelector(`[slot="${e}"]`);return t?((r=t.textContent)==null?void 0:r.trim().length)!==0||t.children.length>0:!1}function L(){return typeof window<"u"&&typeof document<"u"}class I extends O.ElementBase{constructor(){super(),this._uid=Math.random().toString(36).slice(2,10),this._isOpen=!1,this._restoreFocusEl=null,this._globalListenersBound=!1,this._closeReason="programmatic",this._focusInitialFrame=0,this._focusTrapFrame=0,this._restoreFocusFrame=0,this._onRootClick=this._onRootClick.bind(this),this._onDocumentKeyDown=this._onDocumentKeyDown.bind(this),this._onDocumentFocusIn=this._onDocumentFocusIn.bind(this)}static get observedAttributes(){return["open","side","dismissible","headless","variant","density","shape","elevation","tone","size","inset","close-on-overlay","close-on-esc","lock-while-loading","show-close","state","title","description","aria-label","aria-labelledby","aria-describedby","initial-focus"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this._unbindGlobalListeners(),this._cancelScheduledFocusWork(),this._releaseOpenResources(),this._restoreFocusEl=null,this._isOpen=!1,super.disconnectedCallback()}attributeChangedCallback(e,t,r){if(t!==r){if(e==="open"){this._syncOpenState();return}if(S.has(e)){this._syncLiveUi(),this._isOpen&&(e==="initial-focus"||e==="dismissible"||e==="show-close")&&this._scheduleEnsureFocusTrap();return}this.isConnected&&this.requestRender()}}open(){this.setAttribute("open","")}close(e="programmatic"){this._closeReason=e,this.removeAttribute("open")}closeDrawer(e="programmatic"){if(this.hasAttribute("open")){if(e==="programmatic"){this.close("programmatic");return}this._requestClose(e)}}toggle(){this.hasAttribute("open")?this.close("programmatic"):this.open()}get dismissible(){const e=this.getAttribute("dismissible");return e==null?!1:w(e,!0)}set dismissible(e){e?this.setAttribute("dismissible",""):this.removeAttribute("dismissible")}get closeOnOverlay(){return w(this.getAttribute("close-on-overlay"),!0)}set closeOnOverlay(e){this.setAttribute("close-on-overlay",String(e))}get closeOnEsc(){return w(this.getAttribute("close-on-esc"),!0)}set closeOnEsc(e){this.setAttribute("close-on-esc",String(e))}get lockWhileLoading(){return w(this.getAttribute("lock-while-loading"),!0)}set lockWhileLoading(e){this.setAttribute("lock-while-loading",String(e))}get showClose(){return this.hasAttribute("show-close")?w(this.getAttribute("show-close"),!0):this.dismissible}set showClose(e){this.setAttribute("show-close",String(e))}get state(){const e=this.getAttribute("state");return e==="loading"||e==="error"||e==="success"?e:"idle"}set state(e){if(e==="idle"){this.removeAttribute("state");return}this.setAttribute("state",e)}get inset(){return this.hasAttribute("inset")}set inset(e){e?this.setAttribute("inset",""):this.removeAttribute("inset")}_getPanel(){return this.root.querySelector(".panel")}_getOverlay(){return this.root.querySelector(".overlay")}_getHeader(){return this.root.querySelector(".header")}_titleId(){return`ui-drawer-title-${this._uid}`}_descriptionId(){return`ui-drawer-description-${this._uid}`}_bodyId(){return`ui-drawer-body-${this._uid}`}_resolvedSide(){const e=this.getAttribute("dir")||document.documentElement.getAttribute("dir")||"ltr";return C(this.getAttribute("side"),e==="rtl"?"rtl":"ltr")}_isTopMost(){const e=m.OverlayManager.top();return e?e===this:!0}_isInteractionLocked(){return this.state==="loading"&&this.lockWhileLoading}_isNodeInsideDrawer(e){if(!e)return!1;const t=this._getPanel();return t&&t.contains(e)?!0:this.contains(e)}_isFocusable(e){if(!e||!e.isConnected||e.disabled||e.matches('[inert], [aria-hidden="true"]')||e.closest('[inert], [aria-hidden="true"]'))return!1;if(!L())return!0;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}_collectFocusable(){const e=this._getPanel(),t=[],r=s=>{this._isFocusable(s)&&(t.includes(s)||t.push(s))};return this.querySelectorAll(E).forEach(r),e&&e.querySelectorAll(E).forEach(r),t}_cancelScheduledFocusWork(){this._focusInitialFrame&&(_(this._focusInitialFrame),this._focusInitialFrame=0),this._focusTrapFrame&&(_(this._focusTrapFrame),this._focusTrapFrame=0),this._restoreFocusFrame&&(_(this._restoreFocusFrame),this._restoreFocusFrame=0)}_scheduleFocusInitial(){this._isOpen&&(this._focusInitialFrame||(this._focusInitialFrame=F(()=>{this._focusInitialFrame=0,this._focusInitial()})))}_scheduleEnsureFocusTrap(){this._isOpen&&(this._focusTrapFrame||(this._focusTrapFrame=F(()=>{this._focusTrapFrame=0,this._ensureFocusTrap()})))}_scheduleRestoreFocus(e){!e||!this._canRestoreFocus(e)||(this._restoreFocusFrame&&_(this._restoreFocusFrame),this._restoreFocusFrame=F(()=>{this._restoreFocusFrame=0;try{this._canRestoreFocus(e)&&e.focus({preventScroll:!0})}catch{try{this._canRestoreFocus(e)&&e.focus()}catch{}}}))}_syncLiveUi(){const e=this.hasAttribute("open"),t=this._getOverlay(),r=this._getPanel(),s=this._getHeader(),a=this.root.querySelector(".close-btn");if(t&&t.setAttribute("aria-hidden",e?"false":"true"),!r)return;const o=this._resolvedSide();r.classList.remove("side-left","side-right","side-top","side-bottom"),r.classList.add(`side-${o}`);const n=this.state==="loading";n?r.setAttribute("aria-busy","true"):r.removeAttribute("aria-busy");const y=this.getAttribute("role")||"dialog";r.setAttribute("role",y);const u=(this.getAttribute("title")||"").trim(),h=(this.getAttribute("description")||"").trim(),b=A(this,"header"),p=this.showClose,x=p||b||!!u||!!h;s&&s.classList.toggle("empty",!x),a&&(a.hidden=!p,a.disabled=n&&this.lockWhileLoading);const f=this.getAttribute("aria-label")||"",g=this.getAttribute("aria-labelledby")||"",l=this.getAttribute("aria-describedby")||"",c=g||(!f&&(b||u)?this._titleId():""),d=[];l?d.push(l):(h&&d.push(this._descriptionId()),d.push(this._bodyId()));const k=f||(c?"":"Drawer");k?r.setAttribute("aria-label",k):r.removeAttribute("aria-label"),c?r.setAttribute("aria-labelledby",c):r.removeAttribute("aria-labelledby"),d.length?r.setAttribute("aria-describedby",d.join(" ")):r.removeAttribute("aria-describedby")}_focusInitial(){if(!this._isOpen)return;const e=this._getPanel();if(!e)return;const t=this.getAttribute("initial-focus")||"";if(t){const o=this.querySelector(t)||e.querySelector(t);if(o&&this._isFocusable(o))try{o.focus({preventScroll:!0});return}catch{try{o.focus();return}catch{}}}const r=this._collectFocusable(),a=r.find(o=>o.hasAttribute("autofocus"))||r[0]||e;a===e&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","-1");try{a.focus({preventScroll:!0})}catch{try{a.focus()}catch{}}}_ensureFocusTrap(){if(!this._isOpen||!this._isTopMost())return;const e=document.activeElement;this._isNodeInsideDrawer(e)||this._focusInitial()}_releaseOpenResources(){try{m.OverlayManager.unregister(this),m.OverlayManager.releaseLock()}catch{}}_canRestoreFocus(e){if(!e||!e.isConnected||e.disabled)return!1;if(!L())return!0;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}_syncOpenState(){const e=this.hasAttribute("open");if(this._syncLiveUi(),e===this._isOpen){e?(this._bindGlobalListeners(),this._scheduleEnsureFocusTrap()):(this._unbindGlobalListeners(),this._cancelScheduledFocusWork());return}if(this._isOpen=e,e){this._cancelScheduledFocusWork(),this._bindGlobalListeners(),this._restoreFocusEl=document.activeElement||null,this._closeReason="programmatic";try{m.OverlayManager.register(this),m.OverlayManager.acquireLock()}catch{}this._scheduleFocusInitial(),this._scheduleEnsureFocusTrap(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("show",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{open:!0,reason:"programmatic"}}));return}this._unbindGlobalListeners(),this._cancelScheduledFocusWork(),this._releaseOpenResources();const t=this._closeReason;this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0,detail:{reason:t}})),this.dispatchEvent(new CustomEvent("hide",{bubbles:!0,composed:!0,detail:{reason:t}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{open:!1,reason:t}}));const r=this._restoreFocusEl;this._restoreFocusEl=null,this._closeReason="programmatic",this._scheduleRestoreFocus(r)}_requestClose(e){if(!this._isOpen||this._isInteractionLocked())return;const t=new CustomEvent("request-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(t);const r=new CustomEvent("ui-request-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r),!(t.defaultPrevented||r.defaultPrevented)&&this.close(e)}_onRootClick(e){const t=e.target;if(!t||!this._isOpen)return;if(t.closest(".close-btn")){this._requestClose("button");return}t.closest(".overlay")&&(!this.dismissible||!this.closeOnOverlay||this._isTopMost()&&this._requestClose("overlay"))}_handleTab(e){const t=this._getPanel();if(!t)return;const r=this._collectFocusable();if(!r.length){e.preventDefault(),t.focus();return}const s=r[0],a=r[r.length-1],o=document.activeElement,n=!!o&&this._isNodeInsideDrawer(o);if(e.shiftKey){if(!n||o===s){e.preventDefault();try{a.focus({preventScroll:!0})}catch{a.focus()}}return}if(!n||o===a){e.preventDefault();try{s.focus({preventScroll:!0})}catch{s.focus()}}}_onDocumentKeyDown(e){if(!(!this._isOpen||!this._isTopMost())){if(e.key==="Escape"){if(!this.dismissible||!this.closeOnEsc||this._isInteractionLocked())return;e.preventDefault(),e.stopPropagation(),this._requestClose("escape");return}e.key==="Tab"&&this._handleTab(e)}}_onDocumentFocusIn(e){if(!this._isOpen||!this._isTopMost())return;const t=e.target,r=this._getPanel(),s=typeof e.composedPath=="function"?e.composedPath():[];t&&this._isNodeInsideDrawer(t)||s.includes(this)||r&&s.includes(r)||this._scheduleFocusInitial()}render(){const e=this.getAttribute("dir")||document.documentElement.getAttribute("dir")||"ltr",t=C(this.getAttribute("side"),e==="rtl"?"rtl":"ltr"),r=this.showClose,s=A(this,"header"),a=A(this,"footer"),o=(this.getAttribute("title")||"").trim(),n=(this.getAttribute("description")||"").trim(),y=r||s||!!o||!!n,u=`ui-drawer-title-${this._uid}`,h=`ui-drawer-description-${this._uid}`,b=`ui-drawer-body-${this._uid}`,p=this.getAttribute("aria-label")||"",x=this.getAttribute("aria-labelledby")||"",f=this.getAttribute("aria-describedby")||"",g=x||(!p&&(s||o)?u:""),l=[];f?l.push(f):(n&&l.push(h),l.push(b));const c=p||(g?"":"Drawer"),d=this.state==="loading";this.setContent(`
501
+ `;function w(i,e){if(i==null)return e;const t=i.trim().toLowerCase();return t!=="false"&&t!=="0"&&t!=="off"}function v(i){return i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function C(i,e){return i==="top"||i==="bottom"||i==="left"||i==="right"?i:i==="start"?e==="rtl"?"right":"left":i==="end"?e==="rtl"?"left":"right":"left"}function A(i,e){const t=i.querySelector(`[slot="${e}"]`);return t?t.textContent?.trim().length!==0||t.children.length>0:!1}function L(){return typeof window<"u"&&typeof document<"u"}class I extends O.ElementBase{constructor(){super(),this._uid=Math.random().toString(36).slice(2,10),this._isOpen=!1,this._restoreFocusEl=null,this._globalListenersBound=!1,this._closeReason="programmatic",this._focusInitialFrame=0,this._focusTrapFrame=0,this._restoreFocusFrame=0,this._onRootClick=this._onRootClick.bind(this),this._onDocumentKeyDown=this._onDocumentKeyDown.bind(this),this._onDocumentFocusIn=this._onDocumentFocusIn.bind(this)}static get observedAttributes(){return["open","side","dismissible","headless","variant","density","shape","elevation","tone","size","inset","close-on-overlay","close-on-esc","lock-while-loading","show-close","state","title","description","aria-label","aria-labelledby","aria-describedby","initial-focus"]}connectedCallback(){super.connectedCallback(),this.root.addEventListener("click",this._onRootClick),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onRootClick),this._unbindGlobalListeners(),this._cancelScheduledFocusWork(),this._releaseOpenResources(),this._restoreFocusEl=null,this._isOpen=!1,super.disconnectedCallback()}attributeChangedCallback(e,t,r){if(t!==r){if(e==="open"){this._syncOpenState();return}if(S.has(e)){this._syncLiveUi(),this._isOpen&&(e==="initial-focus"||e==="dismissible"||e==="show-close")&&this._scheduleEnsureFocusTrap();return}this.isConnected&&this.requestRender()}}open(){this.setAttribute("open","")}close(e="programmatic"){this._closeReason=e,this.removeAttribute("open")}closeDrawer(e="programmatic"){if(this.hasAttribute("open")){if(e==="programmatic"){this.close("programmatic");return}this._requestClose(e)}}toggle(){this.hasAttribute("open")?this.close("programmatic"):this.open()}get dismissible(){const e=this.getAttribute("dismissible");return e==null?!1:w(e,!0)}set dismissible(e){e?this.setAttribute("dismissible",""):this.removeAttribute("dismissible")}get closeOnOverlay(){return w(this.getAttribute("close-on-overlay"),!0)}set closeOnOverlay(e){this.setAttribute("close-on-overlay",String(e))}get closeOnEsc(){return w(this.getAttribute("close-on-esc"),!0)}set closeOnEsc(e){this.setAttribute("close-on-esc",String(e))}get lockWhileLoading(){return w(this.getAttribute("lock-while-loading"),!0)}set lockWhileLoading(e){this.setAttribute("lock-while-loading",String(e))}get showClose(){return this.hasAttribute("show-close")?w(this.getAttribute("show-close"),!0):this.dismissible}set showClose(e){this.setAttribute("show-close",String(e))}get state(){const e=this.getAttribute("state");return e==="loading"||e==="error"||e==="success"?e:"idle"}set state(e){if(e==="idle"){this.removeAttribute("state");return}this.setAttribute("state",e)}get inset(){return this.hasAttribute("inset")}set inset(e){e?this.setAttribute("inset",""):this.removeAttribute("inset")}_getPanel(){return this.root.querySelector(".panel")}_getOverlay(){return this.root.querySelector(".overlay")}_getHeader(){return this.root.querySelector(".header")}_titleId(){return`ui-drawer-title-${this._uid}`}_descriptionId(){return`ui-drawer-description-${this._uid}`}_bodyId(){return`ui-drawer-body-${this._uid}`}_resolvedSide(){const e=this.getAttribute("dir")||document.documentElement.getAttribute("dir")||"ltr";return C(this.getAttribute("side"),e==="rtl"?"rtl":"ltr")}_isTopMost(){const e=m.OverlayManager.top();return e?e===this:!0}_isInteractionLocked(){return this.state==="loading"&&this.lockWhileLoading}_isNodeInsideDrawer(e){if(!e)return!1;const t=this._getPanel();return t&&t.contains(e)?!0:this.contains(e)}_isFocusable(e){if(!e||!e.isConnected||e.disabled||e.matches('[inert], [aria-hidden="true"]')||e.closest('[inert], [aria-hidden="true"]'))return!1;if(!L())return!0;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}_collectFocusable(){const e=this._getPanel(),t=[],r=s=>{this._isFocusable(s)&&(t.includes(s)||t.push(s))};return this.querySelectorAll(E).forEach(r),e&&e.querySelectorAll(E).forEach(r),t}_cancelScheduledFocusWork(){this._focusInitialFrame&&(_(this._focusInitialFrame),this._focusInitialFrame=0),this._focusTrapFrame&&(_(this._focusTrapFrame),this._focusTrapFrame=0),this._restoreFocusFrame&&(_(this._restoreFocusFrame),this._restoreFocusFrame=0)}_scheduleFocusInitial(){this._isOpen&&(this._focusInitialFrame||(this._focusInitialFrame=F(()=>{this._focusInitialFrame=0,this._focusInitial()})))}_scheduleEnsureFocusTrap(){this._isOpen&&(this._focusTrapFrame||(this._focusTrapFrame=F(()=>{this._focusTrapFrame=0,this._ensureFocusTrap()})))}_scheduleRestoreFocus(e){!e||!this._canRestoreFocus(e)||(this._restoreFocusFrame&&_(this._restoreFocusFrame),this._restoreFocusFrame=F(()=>{this._restoreFocusFrame=0;try{this._canRestoreFocus(e)&&e.focus({preventScroll:!0})}catch{try{this._canRestoreFocus(e)&&e.focus()}catch{}}}))}_syncLiveUi(){const e=this.hasAttribute("open"),t=this._getOverlay(),r=this._getPanel(),s=this._getHeader(),a=this.root.querySelector(".close-btn");if(t&&t.setAttribute("aria-hidden",e?"false":"true"),!r)return;const o=this._resolvedSide();r.classList.remove("side-left","side-right","side-top","side-bottom"),r.classList.add(`side-${o}`);const n=this.state==="loading";n?r.setAttribute("aria-busy","true"):r.removeAttribute("aria-busy");const y=this.getAttribute("role")||"dialog";r.setAttribute("role",y);const u=(this.getAttribute("title")||"").trim(),h=(this.getAttribute("description")||"").trim(),b=A(this,"header"),p=this.showClose,x=p||b||!!u||!!h;s&&s.classList.toggle("empty",!x),a&&(a.hidden=!p,a.disabled=n&&this.lockWhileLoading);const f=this.getAttribute("aria-label")||"",g=this.getAttribute("aria-labelledby")||"",l=this.getAttribute("aria-describedby")||"",c=g||(!f&&(b||u)?this._titleId():""),d=[];l?d.push(l):(h&&d.push(this._descriptionId()),d.push(this._bodyId()));const k=f||(c?"":"Drawer");k?r.setAttribute("aria-label",k):r.removeAttribute("aria-label"),c?r.setAttribute("aria-labelledby",c):r.removeAttribute("aria-labelledby"),d.length?r.setAttribute("aria-describedby",d.join(" ")):r.removeAttribute("aria-describedby")}_focusInitial(){if(!this._isOpen)return;const e=this._getPanel();if(!e)return;const t=this.getAttribute("initial-focus")||"";if(t){const o=this.querySelector(t)||e.querySelector(t);if(o&&this._isFocusable(o))try{o.focus({preventScroll:!0});return}catch{try{o.focus();return}catch{}}}const r=this._collectFocusable(),a=r.find(o=>o.hasAttribute("autofocus"))||r[0]||e;a===e&&!a.hasAttribute("tabindex")&&a.setAttribute("tabindex","-1");try{a.focus({preventScroll:!0})}catch{try{a.focus()}catch{}}}_ensureFocusTrap(){if(!this._isOpen||!this._isTopMost())return;const e=document.activeElement;this._isNodeInsideDrawer(e)||this._focusInitial()}_releaseOpenResources(){try{m.OverlayManager.unregister(this),m.OverlayManager.releaseLock()}catch{}}_canRestoreFocus(e){if(!e||!e.isConnected||e.disabled)return!1;if(!L())return!0;const t=window.getComputedStyle(e);return t.display!=="none"&&t.visibility!=="hidden"}_syncOpenState(){const e=this.hasAttribute("open");if(this._syncLiveUi(),e===this._isOpen){e?(this._bindGlobalListeners(),this._scheduleEnsureFocusTrap()):(this._unbindGlobalListeners(),this._cancelScheduledFocusWork());return}if(this._isOpen=e,e){this._cancelScheduledFocusWork(),this._bindGlobalListeners(),this._restoreFocusEl=document.activeElement||null,this._closeReason="programmatic";try{m.OverlayManager.register(this),m.OverlayManager.acquireLock()}catch{}this._scheduleFocusInitial(),this._scheduleEnsureFocusTrap(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("show",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{open:!0,reason:"programmatic"}}));return}this._unbindGlobalListeners(),this._cancelScheduledFocusWork(),this._releaseOpenResources();const t=this._closeReason;this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0,detail:{reason:t}})),this.dispatchEvent(new CustomEvent("hide",{bubbles:!0,composed:!0,detail:{reason:t}})),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{open:!1,reason:t}}));const r=this._restoreFocusEl;this._restoreFocusEl=null,this._closeReason="programmatic",this._scheduleRestoreFocus(r)}_requestClose(e){if(!this._isOpen||this._isInteractionLocked())return;const t=new CustomEvent("request-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(t);const r=new CustomEvent("ui-request-close",{detail:{reason:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(r),!(t.defaultPrevented||r.defaultPrevented)&&this.close(e)}_onRootClick(e){const t=e.target;if(!t||!this._isOpen)return;if(t.closest(".close-btn")){this._requestClose("button");return}t.closest(".overlay")&&(!this.dismissible||!this.closeOnOverlay||this._isTopMost()&&this._requestClose("overlay"))}_handleTab(e){const t=this._getPanel();if(!t)return;const r=this._collectFocusable();if(!r.length){e.preventDefault(),t.focus();return}const s=r[0],a=r[r.length-1],o=document.activeElement,n=!!o&&this._isNodeInsideDrawer(o);if(e.shiftKey){if(!n||o===s){e.preventDefault();try{a.focus({preventScroll:!0})}catch{a.focus()}}return}if(!n||o===a){e.preventDefault();try{s.focus({preventScroll:!0})}catch{s.focus()}}}_onDocumentKeyDown(e){if(!(!this._isOpen||!this._isTopMost())){if(e.key==="Escape"){if(!this.dismissible||!this.closeOnEsc||this._isInteractionLocked())return;e.preventDefault(),e.stopPropagation(),this._requestClose("escape");return}e.key==="Tab"&&this._handleTab(e)}}_onDocumentFocusIn(e){if(!this._isOpen||!this._isTopMost())return;const t=e.target,r=this._getPanel(),s=typeof e.composedPath=="function"?e.composedPath():[];t&&this._isNodeInsideDrawer(t)||s.includes(this)||r&&s.includes(r)||this._scheduleFocusInitial()}render(){const e=this.getAttribute("dir")||document.documentElement.getAttribute("dir")||"ltr",t=C(this.getAttribute("side"),e==="rtl"?"rtl":"ltr"),r=this.showClose,s=A(this,"header"),a=A(this,"footer"),o=(this.getAttribute("title")||"").trim(),n=(this.getAttribute("description")||"").trim(),y=r||s||!!o||!!n,u=`ui-drawer-title-${this._uid}`,h=`ui-drawer-description-${this._uid}`,b=`ui-drawer-body-${this._uid}`,p=this.getAttribute("aria-label")||"",x=this.getAttribute("aria-labelledby")||"",f=this.getAttribute("aria-describedby")||"",g=x||(!p&&(s||o)?u:""),l=[];f?l.push(f):(n&&l.push(h),l.push(b));const c=p||(g?"":"Drawer"),d=this.state==="loading";this.setContent(`
502
502
  <style>${T}</style>
503
503
  <div class="overlay" part="overlay" aria-hidden="true"></div>
504
504
  <aside