@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
@@ -1,18 +1,16 @@
1
- import { E } from "./ElementBase-909688f3.mjs";
2
- import { c as A } from "./portal-fe73e5cc.mjs";
3
- import { c as S } from "./dismissable-layer-9c7e6b58.mjs";
4
- import { l as P } from "./positioner-e9770c66.mjs";
5
- import { c as w } from "./menu-item-styles-27fdbac4.mjs";
6
- import "./listbox-308789a0.mjs";
7
- import "./collection-a1aac0c6.mjs";
8
- import "./collection.esm.js";
9
- const c = '.menuitem, [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [data-menu-item]', b = [
1
+ import { E } from "./ElementBase-YlTLMsGk.mjs";
2
+ import { b as A } from "./portal-bR42gHvG.mjs";
3
+ import { c as S } from "./dismissable-layer-BmPIoK80.mjs";
4
+ import { e as P } from "./positioner-D0VGxtYU.mjs";
5
+ import { c as w } from "./menu-item-styles-CZiPwPwl.mjs";
6
+ import "./listbox-DJamVeFj.mjs";
7
+ const l = '.menuitem, [role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [data-menu-item]', b = [
10
8
  ":scope > .menuitem",
11
9
  ':scope > [role="menuitem"]',
12
10
  ':scope > [role="menuitemcheckbox"]',
13
11
  ':scope > [role="menuitemradio"]',
14
12
  ":scope > [data-menu-item]"
15
- ].join(", "), O = ":scope > .submenu", l = 8, L = 6, R = 420, C = 110, I = [
13
+ ].join(", "), O = ":scope > .submenu", a = 8, L = 6, R = 420, C = 110, I = [
16
14
  "--ui-color-primary",
17
15
  "--ui-color-primary-hover",
18
16
  "--ui-color-foreground-on-primary",
@@ -416,79 +414,71 @@ const c = '.menuitem, [role="menuitem"], [role="menuitemcheckbox"], [role="menui
416
414
  }
417
415
  `;
418
416
  function z() {
419
- if (typeof document > "u")
420
- return;
421
- const o = "ui-context-menu-light-dom-style";
422
- if (document.getElementById(o))
423
- return;
417
+ if (typeof document > "u") return;
418
+ const s = "ui-context-menu-light-dom-style";
419
+ if (document.getElementById(s)) return;
424
420
  const t = document.createElement("style");
425
- t.id = o, t.textContent = v, document.head.appendChild(t);
421
+ t.id = s, t.textContent = v, document.head.appendChild(t);
426
422
  }
427
- function B(o, t) {
428
- return o.replace(/(^|})\s*([^@}{][^{}]*)\{/g, (e, i, n) => {
429
- const s = n.split(",").map((r) => r.trim()).filter(Boolean).map((r) => r.startsWith(t) ? r : `${t} ${r}`).join(", ");
423
+ function B(s, t) {
424
+ return s.replace(/(^|})\s*([^@}{][^{}]*)\{/g, (e, i, o) => {
425
+ const n = o.split(",").map((r) => r.trim()).filter(Boolean).map((r) => r.startsWith(t) ? r : `${t} ${r}`).join(", ");
430
426
  return `${i}
431
- ${s} {`;
427
+ ${n} {`;
432
428
  });
433
429
  }
434
- function F(o) {
435
- const t = o.replace(/:host\(\[([a-z-]+)(?:="([^"]+)")?\]\)/g, (e, i, n) => n != null ? `.ui-context-menu-portal[data-${i}="${n}"]` : `.ui-context-menu-portal[data-${i}="true"]`).replace(/:host/g, ".ui-context-menu-portal");
430
+ function F(s) {
431
+ const t = s.replace(/:host\(\[([a-z-]+)(?:="([^"]+)")?\]\)/g, (e, i, o) => o != null ? `.ui-context-menu-portal[data-${i}="${o}"]` : `.ui-context-menu-portal[data-${i}="true"]`).replace(/:host/g, ".ui-context-menu-portal");
436
432
  return B(t, ".ui-context-menu-portal");
437
433
  }
438
- function H(o) {
439
- return o.replace(/(^|,)\s*ui-context-menu\b/gm, (t, e) => `${e} .ui-context-menu-portal`);
434
+ function H(s) {
435
+ return s.replace(/(^|,)\s*ui-context-menu\b/gm, (t, e) => `${e} .ui-context-menu-portal`);
440
436
  }
441
437
  const D = `${F(g)}
442
438
  ${H(v)}`;
443
- function M(o) {
444
- return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
439
+ function M(s) {
440
+ return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
445
441
  }
446
- function q(o, t) {
447
- return typeof o == "number" ? { x: o, y: typeof t == "number" ? t : 0 } : o;
442
+ function q(s, t) {
443
+ return typeof s == "number" ? { x: s, y: typeof t == "number" ? t : 0 } : s;
448
444
  }
449
- function $(o) {
450
- return o === "top" || o === "left" || o === "right" ? o : "bottom";
445
+ function $(s) {
446
+ return s === "top" || s === "left" || s === "right" ? s : "bottom";
451
447
  }
452
- function V(o) {
453
- return `${o}-start`;
448
+ function V(s) {
449
+ return `${s}-start`;
454
450
  }
455
- function _(o) {
456
- if (!o)
457
- return "";
458
- const t = o.trim().toLowerCase();
451
+ function _(s) {
452
+ if (!s) return "";
453
+ const t = s.trim().toLowerCase();
459
454
  return t === "1" ? "sm" : t === "2" ? "md" : t === "3" ? "lg" : t === "sm" || t === "md" || t === "lg" ? t : t === "compact" ? "sm" : t === "comfortable" ? "lg" : "";
460
455
  }
461
- function y(o) {
462
- if (!o)
463
- return "";
464
- const t = o.trim().toLowerCase();
465
- return t ? t === "none" ? "0px" : t === "sm" ? "8px" : t === "md" ? "12px" : t === "lg" ? "16px" : t === "full" ? "999px" : t === "square" ? "6px" : t === "soft" ? "16px" : /^\d+(\.\d+)?$/.test(t) ? `${t}px` : o : "";
456
+ function y(s) {
457
+ if (!s) return "";
458
+ const t = s.trim().toLowerCase();
459
+ return t ? t === "none" ? "0px" : t === "sm" ? "8px" : t === "md" ? "12px" : t === "lg" ? "16px" : t === "full" ? "999px" : t === "square" ? "6px" : t === "soft" ? "16px" : /^\d+(\.\d+)?$/.test(t) ? `${t}px` : s : "";
466
460
  }
467
- function N(o) {
468
- if (!o.isConnected || o.hidden)
469
- return !1;
470
- const t = window.getComputedStyle(o);
461
+ function N(s) {
462
+ if (!s.isConnected || s.hidden) return !1;
463
+ const t = window.getComputedStyle(s);
471
464
  return !(t.display === "none" || t.visibility === "hidden");
472
465
  }
473
- function W(o) {
474
- if (!o.isConnected)
475
- return !1;
476
- const t = window.getComputedStyle(o);
477
- if (t.display === "none" || t.visibility === "hidden")
478
- return !1;
479
- const e = o.getBoundingClientRect();
480
- if (e.width > 0 || e.height > 0)
481
- return !0;
482
- const i = Number.parseFloat(t.width || "0"), n = Number.parseFloat(t.height || "0");
483
- return i > 0 || n > 0;
466
+ function W(s) {
467
+ if (!s.isConnected) return !1;
468
+ const t = window.getComputedStyle(s);
469
+ if (t.display === "none" || t.visibility === "hidden") return !1;
470
+ const e = s.getBoundingClientRect();
471
+ if (e.width > 0 || e.height > 0) return !0;
472
+ const i = Number.parseFloat(t.width || "0"), o = Number.parseFloat(t.height || "0");
473
+ return i > 0 || o > 0;
484
474
  }
485
- function x(o) {
486
- const t = o.getAttribute("aria-disabled");
487
- return o.hasAttribute("disabled") || t === "true" || o.disabled === !0;
475
+ function x(s) {
476
+ const t = s.getAttribute("aria-disabled");
477
+ return s.hasAttribute("disabled") || t === "true" || s.disabled === !0;
488
478
  }
489
- function G(o) {
490
- for (const t of o)
491
- if (t instanceof HTMLElement && t.matches(c))
479
+ function G(s) {
480
+ for (const t of s)
481
+ if (t instanceof HTMLElement && t.matches(l))
492
482
  return t;
493
483
  return null;
494
484
  }
@@ -600,8 +590,7 @@ class U extends E {
600
590
  }
601
591
  }
602
592
  openForAnchor(t) {
603
- if (this.headless || this.isDisabled)
604
- return;
593
+ if (this.headless || this.isDisabled) return;
605
594
  this._anchorEl = t;
606
595
  const e = t.getBoundingClientRect();
607
596
  if (this._point = { x: e.left, y: e.bottom }, this._isOpen) {
@@ -647,14 +636,13 @@ class U extends E {
647
636
  return t || (this.state === "loading" ? "Loading actions" : this.state === "error" ? "Action unavailable" : this.state === "success" ? "Action ready" : "");
648
637
  }
649
638
  _emitOpenState(t, e, i) {
650
- const n = { open: t, previousOpen: e, source: i };
651
- this.dispatchEvent(new CustomEvent(t ? "open" : "close", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent(t ? "ui-open" : "ui-close", { detail: n, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: { ...n }, bubbles: !0, composed: !0 }));
639
+ const o = { open: t, previousOpen: e, source: i };
640
+ this.dispatchEvent(new CustomEvent(t ? "open" : "close", { detail: o, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent(t ? "ui-open" : "ui-close", { detail: o, bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("change", { detail: { ...o }, bubbles: !0, composed: !0 }));
652
641
  }
653
642
  _setOpen(t, e) {
654
643
  t !== this.open && (t && (this.headless || this.isDisabled) || (this._nextOpenSource = e, t ? this.setAttribute("open", "") : this.removeAttribute("open")));
655
644
  }
656
645
  _syncOpenState() {
657
- var i;
658
646
  const t = this.hasAttribute("open"), e = this._nextOpenSource;
659
647
  if (this._nextOpenSource = "attribute", t === this._isOpen) {
660
648
  this._syncGlobalListeners(t), t ? ((!this._portalEl || !this._portalEl.isConnected) && this._mountPortal(), this._syncPortalVisualState(), this._syncSurfaceState(), this._syncDismissableLayer(), this._schedulePosition(), this._scheduleSubmenuLayout()) : this._syncSurfaceState();
@@ -666,7 +654,7 @@ class U extends E {
666
654
  });
667
655
  return;
668
656
  }
669
- if (this._clearSubmenuState(), this._cancelScheduledWork(), this._teardownPortal(), this._syncSurfaceState(), this._anchorEl = null, this._emitOpenState(!1, !0, e), (i = this._restoreFocusEl) != null && i.isConnected)
657
+ if (this._clearSubmenuState(), this._cancelScheduledWork(), this._teardownPortal(), this._syncSurfaceState(), this._anchorEl = null, this._emitOpenState(!1, !0, e), this._restoreFocusEl?.isConnected)
670
658
  try {
671
659
  this._restoreFocusEl.focus();
672
660
  } catch {
@@ -675,8 +663,7 @@ class U extends E {
675
663
  }
676
664
  _syncSurfaceState() {
677
665
  const t = this._surface();
678
- if (!t)
679
- return;
666
+ if (!t) return;
680
667
  const e = this._isOpen && !this.headless, i = e && !this.isDisabled && this.state !== "loading";
681
668
  t.setAttribute("aria-hidden", this._isOpen ? "false" : "true"), t.setAttribute("aria-busy", this.state === "loading" ? "true" : "false"), this._isOpen ? t.removeAttribute("hidden") : t.setAttribute("hidden", ""), t.style.display = this.headless ? "none" : "block", t.style.visibility = e ? "visible" : "hidden", t.style.opacity = e ? "1" : "0", t.style.transform = e ? "translateY(0) scale(1)" : "translateY(4px) scale(0.985)", t.style.pointerEvents = i ? "auto" : "none";
682
669
  }
@@ -703,59 +690,50 @@ class U extends E {
703
690
  this._portalEl && (e ? this._portalEl.setAttribute(`data-${t}`, "true") : this._portalEl.removeAttribute(`data-${t}`));
704
691
  }
705
692
  _syncPortalThemeVariables() {
706
- if (!this._portalEl)
707
- return;
693
+ if (!this._portalEl) return;
708
694
  const t = getComputedStyle(this), e = (i) => {
709
- const n = t.getPropertyValue(i).trim();
710
- n ? this._portalEl.style.setProperty(i, n) : this._portalEl.style.removeProperty(i);
695
+ const o = t.getPropertyValue(i).trim();
696
+ o ? this._portalEl.style.setProperty(i, o) : this._portalEl.style.removeProperty(i);
711
697
  };
712
- I.forEach(e), T.forEach(e), k.forEach(({ prefix: i, from: n, to: s }) => {
713
- for (let r = n; r <= s; r += 1)
714
- e(`${i}${r}`);
698
+ I.forEach(e), T.forEach(e), k.forEach(({ prefix: i, from: o, to: n }) => {
699
+ for (let r = o; r <= n; r += 1) e(`${i}${r}`);
715
700
  });
716
701
  }
717
702
  _syncPortalVisualState() {
718
- if (!this._portalEl)
719
- return;
703
+ if (!this._portalEl) return;
720
704
  const t = _(this.getAttribute("size") || this.getAttribute("density")), e = y(this.getAttribute("radius") || this.getAttribute("shape"));
721
705
  this._syncPortalThemeVariables(), this._setPortalFlag("open", this._isOpen), this._setPortalFlag("headless", this.headless), this._setPortalFlag("disabled", this.isDisabled);
722
- const i = this.getAttribute("variant"), n = _(this.getAttribute("size") || this.getAttribute("density")), s = this.getAttribute("density"), r = this.getAttribute("radius"), u = this.getAttribute("shape"), a = this.getAttribute("elevation"), h = this.getAttribute("tone"), m = this.getAttribute("placement");
723
- i ? this._portalEl.setAttribute("data-variant", i) : this._portalEl.removeAttribute("data-variant"), n && n !== "md" ? this._portalEl.setAttribute("data-size", n) : this._portalEl.removeAttribute("data-size"), s ? this._portalEl.setAttribute("data-density", s) : this._portalEl.removeAttribute("data-density"), r ? this._portalEl.setAttribute("data-radius", r) : this._portalEl.removeAttribute("data-radius"), u ? this._portalEl.setAttribute("data-shape", u) : this._portalEl.removeAttribute("data-shape"), a ? this._portalEl.setAttribute("data-elevation", a) : this._portalEl.removeAttribute("data-elevation"), h ? this._portalEl.setAttribute("data-tone", h) : this._portalEl.removeAttribute("data-tone"), m ? this._portalEl.setAttribute("data-placement-request", m) : this._portalEl.removeAttribute("data-placement-request"), t === "sm" ? (this._portalEl.style.setProperty("--ui-context-menu-padding", "4px"), this._portalEl.style.setProperty("--ui-context-menu-item-gap", "8px"), this._portalEl.style.setProperty("--ui-context-menu-item-min-height", "32px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-y", "6px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-x", "8px"), this._portalEl.style.setProperty("--ui-context-menu-item-font-size", "13px"), this._portalEl.style.setProperty("--ui-context-menu-item-line-height", "18px"), this._portalEl.style.setProperty("--ui-context-menu-separator-margin", "4px 8px")) : t === "lg" ? (this._portalEl.style.setProperty("--ui-context-menu-padding", "8px"), this._portalEl.style.setProperty("--ui-context-menu-item-gap", "12px"), this._portalEl.style.setProperty("--ui-context-menu-item-min-height", "40px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-y", "9px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-x", "12px"), this._portalEl.style.setProperty("--ui-context-menu-item-font-size", "15px"), this._portalEl.style.setProperty("--ui-context-menu-item-line-height", "22px"), this._portalEl.style.setProperty("--ui-context-menu-separator-margin", "8px 12px")) : (this._portalEl.style.removeProperty("--ui-context-menu-padding"), this._portalEl.style.removeProperty("--ui-context-menu-item-gap"), this._portalEl.style.removeProperty("--ui-context-menu-item-min-height"), this._portalEl.style.removeProperty("--ui-context-menu-item-pad-y"), this._portalEl.style.removeProperty("--ui-context-menu-item-pad-x"), this._portalEl.style.removeProperty("--ui-context-menu-item-font-size"), this._portalEl.style.removeProperty("--ui-context-menu-item-line-height"), this._portalEl.style.removeProperty("--ui-context-menu-separator-margin")), e ? (this._portalEl.style.setProperty("--ui-context-menu-radius", e), this._portalEl.style.setProperty("--ui-context-menu-item-radius", e), this._portalEl.style.setProperty("--ui-context-menu-submenu-radius", e)) : (this._portalEl.style.removeProperty("--ui-context-menu-radius"), this._portalEl.style.removeProperty("--ui-context-menu-item-radius"), this._portalEl.style.removeProperty("--ui-context-menu-submenu-radius")), this.state !== "idle" ? this._portalEl.setAttribute("data-state", this.state) : this._portalEl.removeAttribute("data-state");
706
+ const i = this.getAttribute("variant"), o = _(this.getAttribute("size") || this.getAttribute("density")), n = this.getAttribute("density"), r = this.getAttribute("radius"), u = this.getAttribute("shape"), c = this.getAttribute("elevation"), h = this.getAttribute("tone"), m = this.getAttribute("placement");
707
+ i ? this._portalEl.setAttribute("data-variant", i) : this._portalEl.removeAttribute("data-variant"), o && o !== "md" ? this._portalEl.setAttribute("data-size", o) : this._portalEl.removeAttribute("data-size"), n ? this._portalEl.setAttribute("data-density", n) : this._portalEl.removeAttribute("data-density"), r ? this._portalEl.setAttribute("data-radius", r) : this._portalEl.removeAttribute("data-radius"), u ? this._portalEl.setAttribute("data-shape", u) : this._portalEl.removeAttribute("data-shape"), c ? this._portalEl.setAttribute("data-elevation", c) : this._portalEl.removeAttribute("data-elevation"), h ? this._portalEl.setAttribute("data-tone", h) : this._portalEl.removeAttribute("data-tone"), m ? this._portalEl.setAttribute("data-placement-request", m) : this._portalEl.removeAttribute("data-placement-request"), t === "sm" ? (this._portalEl.style.setProperty("--ui-context-menu-padding", "4px"), this._portalEl.style.setProperty("--ui-context-menu-item-gap", "8px"), this._portalEl.style.setProperty("--ui-context-menu-item-min-height", "32px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-y", "6px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-x", "8px"), this._portalEl.style.setProperty("--ui-context-menu-item-font-size", "13px"), this._portalEl.style.setProperty("--ui-context-menu-item-line-height", "18px"), this._portalEl.style.setProperty("--ui-context-menu-separator-margin", "4px 8px")) : t === "lg" ? (this._portalEl.style.setProperty("--ui-context-menu-padding", "8px"), this._portalEl.style.setProperty("--ui-context-menu-item-gap", "12px"), this._portalEl.style.setProperty("--ui-context-menu-item-min-height", "40px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-y", "9px"), this._portalEl.style.setProperty("--ui-context-menu-item-pad-x", "12px"), this._portalEl.style.setProperty("--ui-context-menu-item-font-size", "15px"), this._portalEl.style.setProperty("--ui-context-menu-item-line-height", "22px"), this._portalEl.style.setProperty("--ui-context-menu-separator-margin", "8px 12px")) : (this._portalEl.style.removeProperty("--ui-context-menu-padding"), this._portalEl.style.removeProperty("--ui-context-menu-item-gap"), this._portalEl.style.removeProperty("--ui-context-menu-item-min-height"), this._portalEl.style.removeProperty("--ui-context-menu-item-pad-y"), this._portalEl.style.removeProperty("--ui-context-menu-item-pad-x"), this._portalEl.style.removeProperty("--ui-context-menu-item-font-size"), this._portalEl.style.removeProperty("--ui-context-menu-item-line-height"), this._portalEl.style.removeProperty("--ui-context-menu-separator-margin")), e ? (this._portalEl.style.setProperty("--ui-context-menu-radius", e), this._portalEl.style.setProperty("--ui-context-menu-item-radius", e), this._portalEl.style.setProperty("--ui-context-menu-submenu-radius", e)) : (this._portalEl.style.removeProperty("--ui-context-menu-radius"), this._portalEl.style.removeProperty("--ui-context-menu-item-radius"), this._portalEl.style.removeProperty("--ui-context-menu-submenu-radius")), this.state !== "idle" ? this._portalEl.setAttribute("data-state", this.state) : this._portalEl.removeAttribute("data-state");
724
708
  const p = this._portalEl.querySelector(".state-row");
725
709
  p && (p.textContent = this._stateText());
726
710
  }
727
711
  _moveContentIntoPortal() {
728
- if (this._contentSourceEl)
729
- return;
712
+ if (this._contentSourceEl) return;
730
713
  const t = this.querySelector('[slot="menu"]') || this.querySelector('[slot="content"]'), e = this._portalContentHostEl;
731
714
  !t || !e || (this._contentOriginalParent = t.parentNode, this._contentAnchor = document.createComment("ui-context-menu-anchor"), this._contentOriginalParent && this._contentOriginalParent.insertBefore(this._contentAnchor, t), this._contentSourceEl = t, e.appendChild(t));
732
715
  }
733
716
  _restoreContentFromPortal() {
734
717
  const t = this._contentSourceEl;
735
- if (!t)
736
- return;
718
+ if (!t) return;
737
719
  const e = this._contentAnchor, i = this._contentOriginalParent;
738
- e != null && e.parentNode ? (e.parentNode.insertBefore(t, e), e.parentNode.removeChild(e)) : i && i.appendChild(t), this._contentSourceEl = null, this._contentAnchor = null, this._contentOriginalParent = null;
720
+ e?.parentNode ? (e.parentNode.insertBefore(t, e), e.parentNode.removeChild(e)) : i && i.appendChild(t), this._contentSourceEl = null, this._contentAnchor = null, this._contentOriginalParent = null;
739
721
  }
740
722
  _mountPortal() {
741
- var i, n;
742
- if ((i = this._portalEl) != null && i.isConnected)
743
- return;
723
+ if (this._portalEl?.isConnected) return;
744
724
  const t = A();
745
- if (!t)
746
- return;
725
+ if (!t) return;
747
726
  const e = document.createElement("div");
748
727
  e.className = "ui-context-menu-portal", e.style.position = "absolute", e.style.pointerEvents = "auto", e.innerHTML = `
749
728
  <style>${D}</style>
750
729
  <div class="surface" part="menu" role="menu" aria-hidden="true" aria-busy="false" tabindex="-1">
751
730
  <div class="state-row" part="state"></div>
752
- <ui-listbox class="content-host" slot="menu" role="menu" item-selector="${c.replace(/"/g, "&quot;")}" direct-item-selector="${b.replace(/"/g, "&quot;")}" item-role="menuitem" active-attribute="data-active"></ui-listbox>
731
+ <ui-listbox class="content-host" slot="menu" role="menu" item-selector="${l.replace(/"/g, "&quot;")}" direct-item-selector="${b.replace(/"/g, "&quot;")}" item-role="menuitem" active-attribute="data-active"></ui-listbox>
753
732
  </div>
754
- `, t.appendChild(e), this._portalEl = e, this._portalSurfaceEl = e.querySelector(".surface"), this._portalContentHostEl = e.querySelector("ui-listbox.content-host"), this._moveContentIntoPortal(), (n = this._portalContentHostEl) == null || n.refresh(), this._syncPortalVisualState(), this._syncSurfaceState(), this._bindPortalInteractionListeners(), this._syncDismissableLayer();
733
+ `, t.appendChild(e), this._portalEl = e, this._portalSurfaceEl = e.querySelector(".surface"), this._portalContentHostEl = e.querySelector("ui-listbox.content-host"), this._moveContentIntoPortal(), this._portalContentHostEl?.refresh(), this._syncPortalVisualState(), this._syncSurfaceState(), this._bindPortalInteractionListeners(), this._syncDismissableLayer();
755
734
  }
756
735
  _teardownPortal() {
757
- var t, e, i;
758
- if ((t = this._dismissableLayer) == null || t.destroy(), this._dismissableLayer = null, (e = this._positioner) == null || e.destroy(), this._positioner = null, this._positionerPlacement = null, this._positionerOffset = 0, this._positionerAnchorEl = null, this._unbindPortalInteractionListeners(), this._restoreContentFromPortal(), this._portalContentHostEl = null, this._portalSurfaceEl = null, (i = this._portalEl) != null && i.parentElement)
736
+ if (this._dismissableLayer?.destroy(), this._dismissableLayer = null, this._positioner?.destroy(), this._positioner = null, this._positionerPlacement = null, this._positionerOffset = 0, this._positionerAnchorEl = null, this._unbindPortalInteractionListeners(), this._restoreContentFromPortal(), this._portalContentHostEl = null, this._portalSurfaceEl = null, this._portalEl?.parentElement)
759
737
  try {
760
738
  this._portalEl.parentElement.removeChild(this._portalEl);
761
739
  } catch {
@@ -763,21 +741,20 @@ class U extends E {
763
741
  this._portalEl = null;
764
742
  }
765
743
  _syncDismissableLayer() {
766
- var e, i;
767
744
  const t = this._portalSurfaceEl;
768
745
  if (!t || !this._isOpen) {
769
- (e = this._dismissableLayer) == null || e.destroy(), this._dismissableLayer = null;
746
+ this._dismissableLayer?.destroy(), this._dismissableLayer = null;
770
747
  return;
771
748
  }
772
- (i = this._dismissableLayer) == null || i.destroy(), this._dismissableLayer = S({
749
+ this._dismissableLayer?.destroy(), this._dismissableLayer = S({
773
750
  node: t,
774
751
  trigger: this._anchorEl || this,
775
752
  closeOnEscape: this.closeOnEscape,
776
753
  closeOnPointerOutside: !0,
777
754
  closeOnFocusOutside: !0,
778
- onDismiss: (n) => {
779
- const s = n === "escape-key" ? "escape" : "outside";
780
- this._setOpen(!1, s);
755
+ onDismiss: (e) => {
756
+ const i = e === "escape-key" ? "escape" : "outside";
757
+ this._setOpen(!1, i);
781
758
  }
782
759
  });
783
760
  }
@@ -785,8 +762,7 @@ class U extends E {
785
762
  this._positionRaf != null && (cancelAnimationFrame(this._positionRaf), this._positionRaf = null), this._submenuRaf != null && (cancelAnimationFrame(this._submenuRaf), this._submenuRaf = null), this._stopAnchorTracking(), this._cancelSubmenuIntent(), this._resetTypeahead();
786
763
  }
787
764
  _captureAnchorRect() {
788
- if (!this._anchorEl)
789
- return null;
765
+ if (!this._anchorEl) return null;
790
766
  const t = this._anchorEl.getBoundingClientRect();
791
767
  return {
792
768
  top: t.top,
@@ -816,8 +792,7 @@ class U extends E {
816
792
  };
817
793
  }
818
794
  _rebuildPositioner(t, e, i) {
819
- var n;
820
- (n = this._positioner) == null || n.destroy(), this._positioner = P({
795
+ this._positioner?.destroy(), this._positioner = P({
821
796
  anchor: this._anchorEl || this._pointVirtualAnchor(),
822
797
  floating: t,
823
798
  placement: e,
@@ -825,7 +800,7 @@ class U extends E {
825
800
  offset: i,
826
801
  flip: !0,
827
802
  shift: !0,
828
- boundaryPadding: l,
803
+ boundaryPadding: a,
829
804
  observeWindowResize: !1,
830
805
  observeScroll: !1,
831
806
  observeAncestorScroll: !1,
@@ -833,9 +808,9 @@ class U extends E {
833
808
  observeLayoutShift: !1,
834
809
  observeAnchorResize: !1,
835
810
  observeFloatingResize: !1,
836
- onUpdate: (s) => {
837
- const r = window.innerWidth || document.documentElement.clientWidth || 0, u = window.innerHeight || document.documentElement.clientHeight || 0;
838
- t.style.maxWidth = `${Math.max(160, r - l * 2)}px`, t.style.maxHeight = `${Math.max(120, u - l * 2)}px`, t.setAttribute("data-placement", s.placement.split("-")[0]);
811
+ onUpdate: (o) => {
812
+ const n = window.innerWidth || document.documentElement.clientWidth || 0, r = window.innerHeight || document.documentElement.clientHeight || 0;
813
+ t.style.maxWidth = `${Math.max(160, n - a * 2)}px`, t.style.maxHeight = `${Math.max(120, r - a * 2)}px`, t.setAttribute("data-placement", o.placement.split("-")[0]);
839
814
  }
840
815
  }), this._positionerPlacement = e, this._positionerOffset = i, this._positionerAnchorEl = this._anchorEl;
841
816
  }
@@ -846,27 +821,24 @@ class U extends E {
846
821
  this._anchorTrackRaf != null && (cancelAnimationFrame(this._anchorTrackRaf), this._anchorTrackRaf = null), this._lastAnchorRect = null;
847
822
  }
848
823
  _trackAnchorLayout() {
849
- if (this._anchorTrackRaf = null, !this._isOpen || !this._anchorEl)
850
- return;
824
+ if (this._anchorTrackRaf = null, !this._isOpen || !this._anchorEl) return;
851
825
  const t = this._captureAnchorRect(), e = this._lastAnchorRect;
852
826
  if (this._lastAnchorRect = t, !t) {
853
827
  this.close();
854
828
  return;
855
829
  }
856
- !!e && (t.top !== e.top || t.left !== e.left || t.right !== e.right || t.bottom !== e.bottom || t.width !== e.width || t.height !== e.height) && (this._positionMenu(), this._layoutSubmenus()), this._anchorTrackRaf = requestAnimationFrame(this._trackAnchorLayout);
830
+ e && (t.top !== e.top || t.left !== e.left || t.right !== e.right || t.bottom !== e.bottom || t.width !== e.width || t.height !== e.height) && (this._positionMenu(), this._layoutSubmenus()), this._anchorTrackRaf = requestAnimationFrame(this._trackAnchorLayout);
857
831
  }
858
832
  _resetTypeahead() {
859
833
  this._typeaheadBuffer = "", this._typeaheadTimer != null && (window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = null);
860
834
  }
861
835
  _normalizeMenuSemantics() {
862
- var e;
863
836
  const t = this._menuHost();
864
- t && ((e = this._listbox()) == null || e.syncItemSemantics({ container: t }));
837
+ t && this._listbox()?.syncItemSemantics({ container: t });
865
838
  }
866
839
  _queryMenuItems(t) {
867
- var i;
868
840
  const e = t || this._menuHost();
869
- return e ? (((i = this._listbox()) == null ? void 0 : i.queryItems({ container: e })) || []).filter((n) => N(n)) : [];
841
+ return e ? (this._listbox()?.queryItems({ container: e }) || []).filter((i) => N(i)) : [];
870
842
  }
871
843
  _submenuFor(t) {
872
844
  return t.querySelector(O);
@@ -875,12 +847,10 @@ class U extends E {
875
847
  this._hoveredItem = null;
876
848
  }
877
849
  _focusItem(t) {
878
- var i;
879
- if (!t)
880
- return;
850
+ if (!t) return;
881
851
  this._clearHighlights();
882
852
  const e = t.closest(".submenu") || this._menuHost();
883
- (i = this._listbox()) == null || i.setActiveItem(t, {
853
+ this._listbox()?.setActiveItem(t, {
884
854
  container: e,
885
855
  focus: !0,
886
856
  owner: this._surface(),
@@ -888,8 +858,7 @@ class U extends E {
888
858
  }), this._setOpenBranch(t, !1);
889
859
  }
890
860
  _focusFirstItem() {
891
- var i;
892
- const t = (i = this._listbox()) == null ? void 0 : i.focusBoundary("first", {
861
+ const t = this._listbox()?.focusBoundary("first", {
893
862
  container: this._menuHost(),
894
863
  focus: !0,
895
864
  owner: this._surface(),
@@ -908,8 +877,7 @@ class U extends E {
908
877
  }
909
878
  }
910
879
  _focusLastItem() {
911
- var e;
912
- const t = (e = this._listbox()) == null ? void 0 : e.focusBoundary("last", {
880
+ const t = this._listbox()?.focusBoundary("last", {
913
881
  container: this._menuHost(),
914
882
  focus: !0,
915
883
  owner: this._surface(),
@@ -918,145 +886,126 @@ class U extends E {
918
886
  t && this._setOpenBranch(t, !1);
919
887
  }
920
888
  _findCurrentItem(t) {
921
- var i;
922
889
  if (t && typeof t.composedPath == "function") {
923
- const n = G(t.composedPath());
924
- if (n)
925
- return n;
890
+ const i = G(t.composedPath());
891
+ if (i) return i;
926
892
  }
927
893
  const e = document.activeElement;
928
894
  if (e instanceof HTMLElement) {
929
- const n = e.closest(c);
930
- if (n instanceof HTMLElement)
931
- return n;
895
+ const i = e.closest(l);
896
+ if (i instanceof HTMLElement) return i;
932
897
  }
933
- return (i = this._hoveredItem) != null && i.isConnected ? this._hoveredItem : null;
898
+ return this._hoveredItem?.isConnected ? this._hoveredItem : null;
934
899
  }
935
900
  _moveFocus(t, e) {
936
- var s, r, u;
937
901
  const i = t.closest(".submenu") || this._menuHost();
938
- if (!i)
939
- return;
902
+ if (!i) return;
940
903
  if (e === "first") {
941
- const a = (s = this._listbox()) == null ? void 0 : s.focusBoundary("first", {
904
+ const n = this._listbox()?.focusBoundary("first", {
942
905
  container: i,
943
906
  focus: !0,
944
907
  owner: this._surface(),
945
908
  scroll: !0
946
909
  });
947
- a && this._setOpenBranch(a, !1);
910
+ n && this._setOpenBranch(n, !1);
948
911
  return;
949
912
  }
950
913
  if (e === "last") {
951
- const a = (r = this._listbox()) == null ? void 0 : r.focusBoundary("last", {
914
+ const n = this._listbox()?.focusBoundary("last", {
952
915
  container: i,
953
916
  focus: !0,
954
917
  owner: this._surface(),
955
918
  scroll: !0
956
919
  });
957
- a && this._setOpenBranch(a, !1);
920
+ n && this._setOpenBranch(n, !1);
958
921
  return;
959
922
  }
960
- const n = (u = this._listbox()) == null ? void 0 : u.move(e === "next" ? 1 : -1, {
923
+ const o = this._listbox()?.move(e === "next" ? 1 : -1, {
961
924
  container: i,
962
925
  current: t,
963
926
  focus: !0,
964
927
  owner: this._surface(),
965
928
  scroll: !0
966
929
  });
967
- n && this._setOpenBranch(n, !1);
930
+ o && this._setOpenBranch(o, !1);
968
931
  }
969
932
  _setOpenBranch(t, e) {
970
933
  const i = this._menuHost();
971
- if (!i || (i.querySelectorAll('[data-submenu-open="true"]').forEach((r) => r.removeAttribute("data-submenu-open")), !t))
972
- return;
973
- const n = [];
974
- let s = t;
975
- for (; s; ) {
976
- const r = s.closest(".submenu");
977
- if (!r)
978
- break;
934
+ if (!i || (i.querySelectorAll('[data-submenu-open="true"]').forEach((r) => r.removeAttribute("data-submenu-open")), !t)) return;
935
+ const o = [];
936
+ let n = t;
937
+ for (; n; ) {
938
+ const r = n.closest(".submenu");
939
+ if (!r) break;
979
940
  const u = r.parentElement;
980
- if (!(u instanceof HTMLElement) || !u.matches(c))
981
- break;
982
- n.unshift(u), s = u;
941
+ if (!(u instanceof HTMLElement) || !u.matches(l)) break;
942
+ o.unshift(u), n = u;
983
943
  }
984
- n.forEach((r) => r.setAttribute("data-submenu-open", "true")), e && this._submenuFor(t) && t.setAttribute("data-submenu-open", "true");
944
+ o.forEach((r) => r.setAttribute("data-submenu-open", "true")), e && this._submenuFor(t) && t.setAttribute("data-submenu-open", "true");
985
945
  }
986
946
  _openSubmenu(t, e) {
987
- var s;
988
947
  this._cancelSubmenuIntent();
989
948
  const i = this._submenuFor(t);
990
- if (!i || x(t))
991
- return !1;
992
- if (this._setOpenBranch(t, !0), this._scheduleSubmenuLayout(), !e)
993
- return !0;
994
- const n = (s = this._listbox()) == null ? void 0 : s.focusBoundary("first", {
949
+ if (!i || x(t)) return !1;
950
+ if (this._setOpenBranch(t, !0), this._scheduleSubmenuLayout(), !e) return !0;
951
+ const o = this._listbox()?.focusBoundary("first", {
995
952
  container: i,
996
953
  focus: !0,
997
954
  owner: this._surface(),
998
955
  scroll: !0
999
956
  });
1000
- return n && this._setOpenBranch(n, !1), !0;
957
+ return o && this._setOpenBranch(o, !1), !0;
1001
958
  }
1002
959
  _closeParentSubmenu(t) {
1003
960
  const e = t.closest(".submenu");
1004
- if (!e)
1005
- return !1;
961
+ if (!e) return !1;
1006
962
  const i = e.parentElement;
1007
- return !(i instanceof HTMLElement) || !i.matches(c) ? !1 : (this._focusItem(i), this._setOpenBranch(i, !1), i.removeAttribute("data-submenu-open"), !0);
963
+ return !(i instanceof HTMLElement) || !i.matches(l) ? !1 : (this._focusItem(i), this._setOpenBranch(i, !1), i.removeAttribute("data-submenu-open"), !0);
1008
964
  }
1009
965
  _clearSubmenuState() {
1010
- var e;
1011
966
  this._cancelSubmenuIntent(), this._hoveredItem = null;
1012
967
  const t = this._menuHost();
1013
- t && (t.querySelectorAll('[data-submenu-open="true"]').forEach((i) => i.removeAttribute("data-submenu-open")), (e = this._listbox()) == null || e.clearActive({ container: t }));
968
+ t && (t.querySelectorAll('[data-submenu-open="true"]').forEach((e) => e.removeAttribute("data-submenu-open")), this._listbox()?.clearActive({ container: t }));
1014
969
  }
1015
970
  _handleTypeahead(t, e) {
1016
- var s;
1017
- if (!this.typeahead || t.ctrlKey || t.altKey || t.metaKey || t.key.length !== 1 || !/\S/.test(t.key))
1018
- return !1;
1019
- const i = (e == null ? void 0 : e.closest(".submenu")) || this._menuHost();
1020
- if (!i)
1021
- return !1;
971
+ if (!this.typeahead || t.ctrlKey || t.altKey || t.metaKey || t.key.length !== 1 || !/\S/.test(t.key)) return !1;
972
+ const i = e?.closest(".submenu") || this._menuHost();
973
+ if (!i) return !1;
1022
974
  this._typeaheadBuffer = `${this._typeaheadBuffer}${t.key}`.slice(-24), this._typeaheadTimer != null && window.clearTimeout(this._typeaheadTimer), this._typeaheadTimer = window.setTimeout(() => this._resetTypeahead(), R);
1023
- const n = (s = this._listbox()) == null ? void 0 : s.typeahead(this._typeaheadBuffer, {
975
+ const o = this._listbox()?.typeahead(this._typeaheadBuffer, {
1024
976
  container: i,
1025
977
  current: e,
1026
978
  focus: !0,
1027
979
  owner: this._surface(),
1028
980
  scroll: !0
1029
981
  });
1030
- return n ? (t.preventDefault(), this._setOpenBranch(n, !1), !0) : !1;
982
+ return o ? (t.preventDefault(), this._setOpenBranch(o, !1), !0) : !1;
1031
983
  }
1032
984
  _applySelectionBehavior(t) {
1033
985
  const e = t.getAttribute("role");
1034
986
  if (e === "menuitemcheckbox") {
1035
- const s = t.getAttribute("aria-checked") !== "true";
1036
- t.setAttribute("aria-checked", s ? "true" : "false"), t.setAttribute("data-state", s ? "checked" : "unchecked");
987
+ const n = t.getAttribute("aria-checked") !== "true";
988
+ t.setAttribute("aria-checked", n ? "true" : "false"), t.setAttribute("data-state", n ? "checked" : "unchecked");
1037
989
  return;
1038
990
  }
1039
- if (e !== "menuitemradio")
1040
- return;
991
+ if (e !== "menuitemradio") return;
1041
992
  const i = t.closest(".submenu") || this._menuHost();
1042
- if (!i)
1043
- return;
1044
- const n = t.getAttribute("data-group") || t.getAttribute("name") || "";
1045
- i.querySelectorAll('[role="menuitemradio"]').forEach((s) => {
1046
- const r = s.getAttribute("data-group") || s.getAttribute("name") || "";
1047
- n && r !== n || (s.setAttribute("aria-checked", "false"), s.setAttribute("data-state", "unchecked"));
993
+ if (!i) return;
994
+ const o = t.getAttribute("data-group") || t.getAttribute("name") || "";
995
+ i.querySelectorAll('[role="menuitemradio"]').forEach((n) => {
996
+ const r = n.getAttribute("data-group") || n.getAttribute("name") || "";
997
+ o && r !== o || (n.setAttribute("aria-checked", "false"), n.setAttribute("data-state", "unchecked"));
1048
998
  }), t.setAttribute("aria-checked", "true"), t.setAttribute("data-state", "checked");
1049
999
  }
1050
1000
  _emitSelect(t) {
1051
- var s;
1052
- const e = this._menuHost(), n = (e ? Array.from(e.querySelectorAll(c)) : []).indexOf(t);
1001
+ const e = this._menuHost(), o = (e ? Array.from(e.querySelectorAll(l)) : []).indexOf(t);
1053
1002
  this.dispatchEvent(new CustomEvent("select", {
1054
1003
  bubbles: !0,
1055
1004
  composed: !0,
1056
1005
  detail: {
1057
- index: n,
1006
+ index: o,
1058
1007
  value: t.getAttribute("data-value") || t.getAttribute("value") || void 0,
1059
- label: t.getAttribute("aria-label") || ((s = t.textContent) == null ? void 0 : s.trim()) || void 0,
1008
+ label: t.getAttribute("aria-label") || t.textContent?.trim() || void 0,
1060
1009
  checked: t.getAttribute("aria-checked") === "true",
1061
1010
  item: t
1062
1011
  }
@@ -1068,20 +1017,18 @@ class U extends E {
1068
1017
  }));
1069
1018
  }
1070
1019
  _positionMenu() {
1071
- var r;
1072
1020
  const t = this._surface();
1073
- if (!t)
1074
- return;
1021
+ if (!t) return;
1075
1022
  if (this._anchorEl && !W(this._anchorEl)) {
1076
1023
  this.close();
1077
1024
  return;
1078
1025
  }
1079
- const e = $(this.getAttribute("placement")), i = V(e), n = this._anchorEl ? L : 0;
1080
- if (!this._positioner || this._positionerPlacement !== i || this._positionerOffset !== n || this._positionerAnchorEl !== this._anchorEl) {
1081
- this._rebuildPositioner(t, i, n);
1026
+ const e = $(this.getAttribute("placement")), i = V(e), o = this._anchorEl ? L : 0;
1027
+ if (!this._positioner || this._positionerPlacement !== i || this._positionerOffset !== o || this._positionerAnchorEl !== this._anchorEl) {
1028
+ this._rebuildPositioner(t, i, o);
1082
1029
  return;
1083
1030
  }
1084
- (r = this._positioner) == null || r.update();
1031
+ this._positioner?.update();
1085
1032
  }
1086
1033
  _scheduleSubmenuLayout() {
1087
1034
  this._isOpen && (this._submenuRaf != null && cancelAnimationFrame(this._submenuRaf), this._submenuRaf = requestAnimationFrame(() => {
@@ -1090,23 +1037,20 @@ class U extends E {
1090
1037
  }
1091
1038
  _layoutSubmenus() {
1092
1039
  const t = this._menuHost();
1093
- if (!t)
1094
- return;
1040
+ if (!t) return;
1095
1041
  const e = window.innerWidth || document.documentElement.clientWidth || 0, i = window.innerHeight || document.documentElement.clientHeight || 0;
1096
- Array.from(t.querySelectorAll('.menuitem > .submenu, [role="menuitem"] > .submenu')).forEach((s) => {
1097
- const r = s.parentElement;
1098
- if (!(r instanceof HTMLElement))
1099
- return;
1042
+ Array.from(t.querySelectorAll('.menuitem > .submenu, [role="menuitem"] > .submenu')).forEach((n) => {
1043
+ const r = n.parentElement;
1044
+ if (!(r instanceof HTMLElement)) return;
1100
1045
  r.removeAttribute("data-submenu-side"), r.removeAttribute("data-submenu-align");
1101
- const u = s.style.display, a = s.style.visibility, h = s.style.pointerEvents, m = s.style.opacity, p = s.style.transform;
1102
- s.style.display = "grid", s.style.visibility = "hidden", s.style.pointerEvents = "none", s.style.opacity = "0", s.style.transform = "none";
1103
- const d = r.getBoundingClientRect(), f = s.getBoundingClientRect();
1104
- d.right + l + f.width > e && d.left - l - f.width >= l && r.setAttribute("data-submenu-side", "left"), d.top + f.height > i - l && d.bottom - f.height >= l && r.setAttribute("data-submenu-align", "up"), s.style.display = u, s.style.visibility = a, s.style.pointerEvents = h, s.style.opacity = m, s.style.transform = p;
1046
+ const u = n.style.display, c = n.style.visibility, h = n.style.pointerEvents, m = n.style.opacity, p = n.style.transform;
1047
+ n.style.display = "grid", n.style.visibility = "hidden", n.style.pointerEvents = "none", n.style.opacity = "0", n.style.transform = "none";
1048
+ const d = r.getBoundingClientRect(), f = n.getBoundingClientRect();
1049
+ d.right + a + f.width > e && d.left - a - f.width >= a && r.setAttribute("data-submenu-side", "left"), d.top + f.height > i - a && d.bottom - f.height >= a && r.setAttribute("data-submenu-align", "up"), n.style.display = u, n.style.visibility = c, n.style.pointerEvents = h, n.style.opacity = m, n.style.transform = p;
1105
1050
  });
1106
1051
  }
1107
1052
  _onRootClick(t) {
1108
- if (!this._isOpen || this.isDisabled || this.state === "loading")
1109
- return;
1053
+ if (!this._isOpen || this.isDisabled || this.state === "loading") return;
1110
1054
  const e = this._findCurrentItem(t);
1111
1055
  if (!(!e || x(e))) {
1112
1056
  if (this._submenuFor(e)) {
@@ -1117,8 +1061,7 @@ class U extends E {
1117
1061
  }
1118
1062
  }
1119
1063
  _onRootPointerOver(t) {
1120
- if (!this._isOpen)
1121
- return;
1064
+ if (!this._isOpen) return;
1122
1065
  const e = this._findCurrentItem(t);
1123
1066
  if (!(!e || x(e))) {
1124
1067
  if (this._hoveredItem = e, this._submenuFor(e)) {
@@ -1132,15 +1075,12 @@ class U extends E {
1132
1075
  this._cancelSubmenuIntent(), this._clearHighlights();
1133
1076
  }
1134
1077
  _onRootFocusIn(t) {
1135
- var n;
1136
- if (!this._isOpen)
1137
- return;
1078
+ if (!this._isOpen) return;
1138
1079
  this._cancelSubmenuIntent();
1139
1080
  const e = this._findCurrentItem(t);
1140
- if (!e || x(e))
1141
- return;
1081
+ if (!e || x(e)) return;
1142
1082
  const i = e.closest(".submenu") || this._menuHost();
1143
- (n = this._listbox()) == null || n.setActiveItem(e, {
1083
+ this._listbox()?.setActiveItem(e, {
1144
1084
  container: i,
1145
1085
  focus: !1,
1146
1086
  owner: this._surface(),
@@ -1158,13 +1098,11 @@ class U extends E {
1158
1098
  }, C));
1159
1099
  }
1160
1100
  _onRootKeyDown(t) {
1161
- if (!this._isOpen)
1162
- return;
1101
+ if (!this._isOpen) return;
1163
1102
  const e = this._findCurrentItem(t);
1164
1103
  if (!this._handleTypeahead(t, e)) {
1165
1104
  if (t.key === "Escape") {
1166
- if (!this.closeOnEscape)
1167
- return;
1105
+ if (!this.closeOnEscape) return;
1168
1106
  t.preventDefault(), this._setOpen(!1, "escape");
1169
1107
  return;
1170
1108
  }
@@ -1213,7 +1151,7 @@ class U extends E {
1213
1151
  <style>${g}</style>
1214
1152
  <div class="surface" part="menu" role="menu" aria-hidden="true" aria-busy="false" tabindex="-1">
1215
1153
  <div class="state-row" part="state" data-state="${this.state}">${t}</div>
1216
- <ui-listbox class="content-host" part="content" slot="menu" role="menu" item-selector="${c.replace(/"/g, "&quot;")}" direct-item-selector="${b.replace(/"/g, "&quot;")}" item-role="menuitem" active-attribute="data-active">
1154
+ <ui-listbox class="content-host" part="content" slot="menu" role="menu" item-selector="${l.replace(/"/g, "&quot;")}" direct-item-selector="${b.replace(/"/g, "&quot;")}" item-role="menuitem" active-attribute="data-active">
1217
1155
  <slot name="menu"></slot>
1218
1156
  <slot name="content"></slot>
1219
1157
  </ui-listbox>