@editora/ui-core 0.1.25 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/README.md +124 -0
  2. package/dist/accordion.cjs.js +13 -12
  3. package/dist/accordion.esm.js +13 -12
  4. package/dist/alert-dialog.cjs.js +76 -45
  5. package/dist/alert-dialog.esm.js +179 -135
  6. package/dist/alert.cjs.js +41 -32
  7. package/dist/alert.esm.js +79 -70
  8. package/dist/animated-beam.cjs.js +42 -50
  9. package/dist/animated-beam.esm.js +47 -55
  10. package/dist/animated-list.cjs.js +11 -27
  11. package/dist/animated-list.esm.js +12 -28
  12. package/dist/animated-text.cjs.js +4 -4
  13. package/dist/animated-text.esm.js +4 -4
  14. package/dist/app-header.cjs.js +5 -5
  15. package/dist/app-header.esm.js +6 -6
  16. package/dist/aspect-ratio.cjs.js +10 -12
  17. package/dist/aspect-ratio.esm.js +11 -13
  18. package/dist/avatar.cjs.js +13 -17
  19. package/dist/avatar.esm.js +13 -17
  20. package/dist/badge.cjs.js +27 -22
  21. package/dist/badge.esm.js +32 -27
  22. package/dist/block-controls.cjs.js +11 -12
  23. package/dist/block-controls.esm.js +8 -9
  24. package/dist/box.cjs.js +2 -3
  25. package/dist/box.esm.js +2 -3
  26. package/dist/breadcrumb.cjs.js +12 -18
  27. package/dist/breadcrumb.esm.js +11 -17
  28. package/dist/button.cjs.js +1 -1
  29. package/dist/button.esm.js +1 -1
  30. package/dist/{calendar-B3PUKHQm.mjs → calendar-DmxiZrR7.mjs} +126 -117
  31. package/dist/{calendar-D-mXMgqc.js → calendar-o273O28D.js} +53 -44
  32. package/dist/calendar.cjs.js +1 -1
  33. package/dist/calendar.esm.js +1 -1
  34. package/dist/card.cjs.js +6 -7
  35. package/dist/card.esm.js +5 -6
  36. package/dist/chart.cjs.js +52 -52
  37. package/dist/chart.esm.js +95 -95
  38. package/dist/checkbox.cjs.js +19 -15
  39. package/dist/checkbox.esm.js +19 -15
  40. package/dist/collapsible.cjs.js +7 -11
  41. package/dist/collapsible.esm.js +7 -11
  42. package/dist/color-picker.cjs.js +36 -17
  43. package/dist/color-picker.esm.js +132 -113
  44. package/dist/combobox.cjs.js +57 -54
  45. package/dist/combobox.esm.js +62 -58
  46. package/dist/command-palette.cjs.js +1 -0
  47. package/dist/command-palette.esm.js +1 -0
  48. package/dist/command.cjs.js +32 -14
  49. package/dist/command.esm.js +46 -28
  50. package/dist/components/date-time-utils.d.ts.map +1 -1
  51. package/dist/components/ui-accordion.d.ts.map +1 -1
  52. package/dist/components/ui-alert-dialog.d.ts +2 -0
  53. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  54. package/dist/components/ui-alert.d.ts.map +1 -1
  55. package/dist/components/ui-animated-beam.d.ts.map +1 -1
  56. package/dist/components/ui-animated-list.d.ts.map +1 -1
  57. package/dist/components/ui-aspect-ratio.d.ts.map +1 -1
  58. package/dist/components/ui-avatar.d.ts.map +1 -1
  59. package/dist/components/ui-badge.d.ts.map +1 -1
  60. package/dist/components/ui-block-controls.d.ts.map +1 -1
  61. package/dist/components/ui-box.d.ts.map +1 -1
  62. package/dist/components/ui-breadcrumb.d.ts.map +1 -1
  63. package/dist/components/ui-button.d.ts.map +1 -1
  64. package/dist/components/ui-calendar.d.ts.map +1 -1
  65. package/dist/components/ui-card.d.ts.map +1 -1
  66. package/dist/components/ui-checkbox.d.ts.map +1 -1
  67. package/dist/components/ui-collapsible.d.ts.map +1 -1
  68. package/dist/components/ui-color-picker.d.ts.map +1 -1
  69. package/dist/components/ui-combobox.d.ts.map +1 -1
  70. package/dist/components/ui-command-palette.d.ts.map +1 -1
  71. package/dist/components/ui-command.d.ts.map +1 -1
  72. package/dist/components/ui-container.d.ts.map +1 -1
  73. package/dist/components/ui-context-menu.d.ts.map +1 -1
  74. package/dist/components/ui-data-table.d.ts +7 -0
  75. package/dist/components/ui-data-table.d.ts.map +1 -1
  76. package/dist/components/ui-date-picker.d.ts.map +1 -1
  77. package/dist/components/ui-date-range-picker.d.ts.map +1 -1
  78. package/dist/components/ui-date-range-time-picker.d.ts.map +1 -1
  79. package/dist/components/ui-date-time-picker.d.ts.map +1 -1
  80. package/dist/components/ui-dialog.d.ts +2 -0
  81. package/dist/components/ui-dialog.d.ts.map +1 -1
  82. package/dist/components/ui-dock.d.ts.map +1 -1
  83. package/dist/components/ui-drawer.d.ts.map +1 -1
  84. package/dist/components/ui-dropdown.d.ts.map +1 -1
  85. package/dist/components/ui-empty-state.d.ts.map +1 -1
  86. package/dist/components/ui-field.d.ts.map +1 -1
  87. package/dist/components/ui-fieldset.d.ts.map +1 -1
  88. package/dist/components/ui-file-upload.d.ts.map +1 -1
  89. package/dist/components/ui-floating-toolbar.d.ts.map +1 -1
  90. package/dist/components/ui-form.d.ts.map +1 -1
  91. package/dist/components/ui-icon-cloud.d.ts.map +1 -1
  92. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  93. package/dist/components/ui-input.d.ts.map +1 -1
  94. package/dist/components/ui-marquee.d.ts.map +1 -1
  95. package/dist/components/ui-menu.d.ts.map +1 -1
  96. package/dist/components/ui-menubar.d.ts.map +1 -1
  97. package/dist/components/ui-meter.d.ts.map +1 -1
  98. package/dist/components/ui-multi-select.d.ts.map +1 -1
  99. package/dist/components/ui-number-field.d.ts.map +1 -1
  100. package/dist/components/ui-orbiter.d.ts.map +1 -1
  101. package/dist/components/ui-pagination.d.ts.map +1 -1
  102. package/dist/components/ui-password-field.d.ts.map +1 -1
  103. package/dist/components/ui-pin-input.d.ts.map +1 -1
  104. package/dist/components/ui-popover.d.ts.map +1 -1
  105. package/dist/components/ui-progress.d.ts.map +1 -1
  106. package/dist/components/ui-radio-group.d.ts.map +1 -1
  107. package/dist/components/ui-radio.d.ts.map +1 -1
  108. package/dist/components/ui-rating.d.ts +1 -0
  109. package/dist/components/ui-rating.d.ts.map +1 -1
  110. package/dist/components/ui-scroll-area.d.ts.map +1 -1
  111. package/dist/components/ui-section.d.ts.map +1 -1
  112. package/dist/components/ui-select.d.ts.map +1 -1
  113. package/dist/components/ui-selection-popup.d.ts.map +1 -1
  114. package/dist/components/ui-slider.d.ts.map +1 -1
  115. package/dist/components/ui-sortable.d.ts.map +1 -1
  116. package/dist/components/ui-spinning-text.d.ts.map +1 -1
  117. package/dist/components/ui-split-button.d.ts.map +1 -1
  118. package/dist/components/ui-splitter.d.ts.map +1 -1
  119. package/dist/components/ui-stepper.d.ts.map +1 -1
  120. package/dist/components/ui-switch.d.ts.map +1 -1
  121. package/dist/components/ui-tabs.d.ts.map +1 -1
  122. package/dist/components/ui-tags-input.d.ts.map +1 -1
  123. package/dist/components/ui-textarea.d.ts.map +1 -1
  124. package/dist/components/ui-time-picker.d.ts.map +1 -1
  125. package/dist/components/ui-toggle-group.d.ts +2 -0
  126. package/dist/components/ui-toggle-group.d.ts.map +1 -1
  127. package/dist/components/ui-toggle.d.ts.map +1 -1
  128. package/dist/components/ui-toolbar.d.ts +2 -0
  129. package/dist/components/ui-toolbar.d.ts.map +1 -1
  130. package/dist/components/ui-tooltip.d.ts.map +1 -1
  131. package/dist/components/ui-transfer-list.d.ts.map +1 -1
  132. package/dist/components/ui-tree-item.d.ts.map +1 -1
  133. package/dist/components/ui-tree.d.ts.map +1 -1
  134. package/dist/components/ui-wizard.d.ts.map +1 -1
  135. package/dist/container.cjs.js +6 -12
  136. package/dist/container.esm.js +8 -14
  137. package/dist/context-menu.cjs.js +8 -8
  138. package/dist/context-menu.esm.js +42 -41
  139. package/dist/data-table.cjs.js +18 -15
  140. package/dist/data-table.esm.js +207 -187
  141. package/dist/date-field.cjs.js +8 -8
  142. package/dist/date-field.esm.js +7 -7
  143. package/dist/date-picker.cjs.js +27 -18
  144. package/dist/date-picker.esm.js +57 -48
  145. package/dist/date-range-picker.cjs.js +22 -17
  146. package/dist/date-range-picker.esm.js +31 -26
  147. package/dist/date-range-time-picker.cjs.js +26 -19
  148. package/dist/date-range-time-picker.esm.js +23 -16
  149. package/dist/date-time-picker.cjs.js +23 -16
  150. package/dist/date-time-picker.esm.js +88 -81
  151. package/dist/{date-time-utils-BTlxnz5j.mjs → date-time-utils-B4hAkt36.mjs} +75 -68
  152. package/dist/date-time-utils-DdigV4hs.js +1 -0
  153. package/dist/dialog.cjs.js +57 -41
  154. package/dist/dialog.esm.js +84 -51
  155. package/dist/dock.cjs.js +16 -30
  156. package/dist/dock.esm.js +26 -40
  157. package/dist/drawer.cjs.js +8 -12
  158. package/dist/drawer.esm.js +6 -10
  159. package/dist/dropdown.cjs.js +8 -6
  160. package/dist/dropdown.esm.js +33 -30
  161. package/dist/empty-state.cjs.js +17 -15
  162. package/dist/empty-state.esm.js +13 -11
  163. package/dist/field.cjs.js +22 -13
  164. package/dist/field.esm.js +54 -45
  165. package/dist/fieldset.cjs.js +18 -11
  166. package/dist/fieldset.esm.js +20 -13
  167. package/dist/file-upload.cjs.js +77 -35
  168. package/dist/file-upload.esm.js +152 -110
  169. package/dist/floating-toolbar.cjs.js +6 -7
  170. package/dist/floating-toolbar.esm.js +8 -9
  171. package/dist/form.cjs.js +20 -23
  172. package/dist/form.esm.js +20 -23
  173. package/dist/gantt.cjs.js +6 -6
  174. package/dist/gantt.esm.js +6 -6
  175. package/dist/hover-card.cjs.js +7 -7
  176. package/dist/hover-card.esm.js +7 -7
  177. package/dist/icon-cloud.cjs.js +19 -36
  178. package/dist/icon-cloud.esm.js +41 -58
  179. package/dist/index.cjs.js +1 -1
  180. package/dist/index.d.ts +2 -0
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.esm.js +108 -104
  183. package/dist/inline-edit.cjs.js +47 -19
  184. package/dist/inline-edit.esm.js +66 -38
  185. package/dist/input.cjs.js +44 -37
  186. package/dist/input.esm.js +59 -52
  187. package/dist/layout.cjs.js +3 -3
  188. package/dist/layout.esm.js +3 -3
  189. package/dist/marquee.cjs.js +7 -10
  190. package/dist/marquee.esm.js +7 -10
  191. package/dist/menu.cjs.js +8 -24
  192. package/dist/menu.esm.js +52 -72
  193. package/dist/menubar.cjs.js +9 -31
  194. package/dist/menubar.esm.js +127 -153
  195. package/dist/meter.cjs.js +4 -9
  196. package/dist/meter.esm.js +6 -11
  197. package/dist/multi-select.cjs.js +48 -35
  198. package/dist/multi-select.esm.js +67 -53
  199. package/dist/navigation-menu.cjs.js +10 -10
  200. package/dist/navigation-menu.esm.js +33 -33
  201. package/dist/number-field.cjs.js +27 -16
  202. package/dist/number-field.esm.js +36 -25
  203. package/dist/odometer.cjs.js +5 -5
  204. package/dist/odometer.esm.js +3 -3
  205. package/dist/orbiter.cjs.js +11 -28
  206. package/dist/orbiter.esm.js +28 -45
  207. package/dist/overlay-motion-B56x1GoY.js +49 -0
  208. package/dist/overlay-motion-BX3dPLay.mjs +120 -0
  209. package/dist/pagination.cjs.js +28 -25
  210. package/dist/pagination.esm.js +54 -51
  211. package/dist/password-field.cjs.js +38 -33
  212. package/dist/password-field.esm.js +62 -57
  213. package/dist/pin-input.cjs.js +17 -13
  214. package/dist/pin-input.esm.js +23 -19
  215. package/dist/plugin-panel.cjs.js +1 -1
  216. package/dist/plugin-panel.esm.js +1 -1
  217. package/dist/popover.cjs.js +16 -28
  218. package/dist/popover.esm.js +29 -45
  219. package/dist/portal-DeaM1tYY.mjs +121 -0
  220. package/dist/portal-XbYR3m_q.js +1 -0
  221. package/dist/portal.d.ts +3 -1
  222. package/dist/portal.d.ts.map +1 -1
  223. package/dist/{positioner-D0VGxtYU.mjs → positioner-BE8Nbho2.mjs} +5 -3
  224. package/dist/{positioner-D_fqyx_j.js → positioner-DZ1FW6A9.js} +1 -1
  225. package/dist/positioner.cjs.js +1 -1
  226. package/dist/positioner.esm.js +1 -1
  227. package/dist/primitives/overlay-motion.d.ts +47 -0
  228. package/dist/primitives/overlay-motion.d.ts.map +1 -0
  229. package/dist/primitives/positioner.d.ts.map +1 -1
  230. package/dist/progress.cjs.js +11 -16
  231. package/dist/progress.esm.js +37 -42
  232. package/dist/quick-actions.cjs.js +13 -13
  233. package/dist/quick-actions.esm.js +11 -11
  234. package/dist/radio-group.cjs.js +50 -26
  235. package/dist/radio-group.esm.js +53 -29
  236. package/dist/radio.cjs.js +15 -12
  237. package/dist/radio.esm.js +15 -12
  238. package/dist/rating.cjs.js +11 -15
  239. package/dist/rating.esm.js +48 -50
  240. package/dist/{runtime-CFnK53iC.mjs → runtime-CQM6wZOc.mjs} +498 -514
  241. package/dist/runtime-DxCl0A5q.js +5 -0
  242. package/dist/runtime.cjs.js +1 -1
  243. package/dist/runtime.d.ts +3 -2
  244. package/dist/runtime.d.ts.map +1 -1
  245. package/dist/runtime.esm.js +36 -32
  246. package/dist/scroll-area.cjs.js +3 -4
  247. package/dist/scroll-area.esm.js +3 -4
  248. package/dist/section.cjs.js +2 -4
  249. package/dist/section.esm.js +2 -4
  250. package/dist/select.cjs.js +40 -73
  251. package/dist/select.esm.js +55 -87
  252. package/dist/selection-popup.cjs.js +3 -4
  253. package/dist/selection-popup.esm.js +3 -4
  254. package/dist/semantic-tokens.d.ts +17 -0
  255. package/dist/semantic-tokens.d.ts.map +1 -0
  256. package/dist/sidebar.cjs.js +22 -22
  257. package/dist/sidebar.esm.js +25 -25
  258. package/dist/skeleton.cjs.js +2 -2
  259. package/dist/skeleton.esm.js +2 -2
  260. package/dist/slider.cjs.js +22 -26
  261. package/dist/slider.esm.js +25 -29
  262. package/dist/sortable.cjs.js +4 -5
  263. package/dist/sortable.esm.js +4 -5
  264. package/dist/spinning-text.cjs.js +4 -13
  265. package/dist/spinning-text.esm.js +4 -13
  266. package/dist/split-button.cjs.js +5 -5
  267. package/dist/split-button.esm.js +15 -14
  268. package/dist/splitter.cjs.js +52 -10
  269. package/dist/splitter.esm.js +55 -13
  270. package/dist/stepper.cjs.js +31 -65
  271. package/dist/stepper.esm.js +32 -66
  272. package/dist/switch.cjs.js +20 -22
  273. package/dist/switch.esm.js +20 -22
  274. package/dist/table.cjs.js +5 -5
  275. package/dist/table.esm.js +20 -20
  276. package/dist/tabs.cjs.js +91 -21
  277. package/dist/tabs.esm.js +182 -112
  278. package/dist/tags-input.cjs.js +41 -15
  279. package/dist/tags-input.esm.js +73 -47
  280. package/dist/textarea.cjs.js +32 -33
  281. package/dist/textarea.esm.js +38 -39
  282. package/dist/theme.d.ts +25 -1
  283. package/dist/theme.d.ts.map +1 -1
  284. package/dist/time-field.cjs.js +7 -7
  285. package/dist/time-field.esm.js +6 -6
  286. package/dist/time-picker.cjs.js +16 -13
  287. package/dist/time-picker.esm.js +27 -24
  288. package/dist/timeline.cjs.js +10 -10
  289. package/dist/timeline.esm.js +7 -7
  290. package/dist/toggle-group.cjs.js +13 -13
  291. package/dist/toggle-group.esm.js +66 -61
  292. package/dist/toggle.cjs.js +52 -34
  293. package/dist/toggle.esm.js +80 -62
  294. package/dist/toolbar.cjs.js +14 -14
  295. package/dist/toolbar.esm.js +41 -33
  296. package/dist/tooltip.cjs.js +3 -3
  297. package/dist/tooltip.esm.js +39 -33
  298. package/dist/transfer-list.cjs.js +28 -29
  299. package/dist/transfer-list.esm.js +28 -29
  300. package/dist/{tree-B_oQput6.mjs → tree-33fVNnaf.mjs} +6 -5
  301. package/dist/{tree-SivHxcAy.js → tree-Dc02MChE.js} +6 -5
  302. package/dist/tree-item.cjs.js +9 -8
  303. package/dist/tree-item.esm.js +13 -12
  304. package/dist/tree.cjs.js +1 -1
  305. package/dist/tree.esm.js +1 -1
  306. package/dist/{ui-button-Co8Sid6t.mjs → ui-button-C3OmI7Sn.mjs} +152 -154
  307. package/dist/{ui-button-BPrzJScZ.js → ui-button-CnLwXBnx.js} +107 -109
  308. package/dist/wizard.cjs.js +39 -36
  309. package/dist/wizard.esm.js +39 -36
  310. package/package.json +1 -1
  311. package/dist/date-time-utils-y3AvNvGe.js +0 -1
  312. package/dist/portal-DgpQ3Jo1.js +0 -1
  313. package/dist/portal-bR42gHvG.mjs +0 -118
  314. package/dist/runtime-DwE-tizc.js +0 -1
@@ -1,11 +1,11 @@
1
- import { p as T, c as b, a as N, s as v, e as F } from "./calendar-B3PUKHQm.mjs";
2
- import { a as L } from "./scroll-lock-LfqXXqsu.mjs";
3
- import { c as U } from "./positioner-D0VGxtYU.mjs";
4
- const C = /* @__PURE__ */ new Map(), I = 24;
1
+ import { p as T, c as b, a as N, s as F, e as L } from "./calendar-DmxiZrR7.mjs";
2
+ import { a as U } from "./scroll-lock-LfqXXqsu.mjs";
3
+ import { c as I } from "./positioner-BE8Nbho2.mjs";
4
+ const C = /* @__PURE__ */ new Map(), O = 24;
5
5
  function D(t, n, e) {
6
6
  return Math.max(n, Math.min(e, t));
7
7
  }
8
- function u(t) {
8
+ function a(t) {
9
9
  return String(t).padStart(2, "0");
10
10
  }
11
11
  function $(t) {
@@ -13,10 +13,10 @@ function $(t) {
13
13
  const n = Number(t);
14
14
  return Number.isFinite(n) ? Math.trunc(n) : null;
15
15
  }
16
- function O(t) {
16
+ function P(t) {
17
17
  return t.replace(/[.\-]/g, "/").replace(/\s+/g, " ").trim();
18
18
  }
19
- function P(t) {
19
+ function A(t) {
20
20
  const n = [];
21
21
  for (let e = 0; e < 12; e += 1)
22
22
  n.push(
@@ -27,7 +27,7 @@ function P(t) {
27
27
  );
28
28
  return n;
29
29
  }
30
- function A(t) {
30
+ function z(t) {
31
31
  const n = [];
32
32
  for (let e = 0; e < 12; e += 1)
33
33
  n.push(
@@ -38,12 +38,12 @@ function A(t) {
38
38
  );
39
39
  return n;
40
40
  }
41
- function B(t, n = !1) {
41
+ function H(t, n = !1) {
42
42
  if (t == null) return n;
43
43
  const e = t.trim().toLowerCase();
44
44
  return e ? e !== "false" && e !== "0" && e !== "off" && e !== "no" : !0;
45
45
  }
46
- function H(t, n) {
46
+ function q(t, n) {
47
47
  const e = typeof t.composedPath == "function" ? t.composedPath() : [];
48
48
  for (const o of n)
49
49
  if (o && e.includes(o)) return !0;
@@ -53,14 +53,21 @@ function H(t, n) {
53
53
  if (o instanceof Node && o.contains(r)) return !0;
54
54
  return !1;
55
55
  }
56
- function q(t) {
56
+ function v(t) {
57
+ try {
58
+ return new Intl.DateTimeFormat(t), !0;
59
+ } catch {
60
+ return !1;
61
+ }
62
+ }
63
+ function E(t) {
57
64
  const n = (t || "").trim();
58
- return n || (typeof navigator < "u" && navigator.language ? navigator.language : "en-US");
65
+ return n && v(n) ? n : typeof navigator < "u" && navigator.language && v(navigator.language) ? navigator.language : "en-US";
59
66
  }
60
67
  function m(t) {
61
68
  if (!t) return null;
62
69
  const n = T(t);
63
- return n ? `${n.y}-${u(n.m)}-${u(n.d)}` : null;
70
+ return n ? `${n.y}-${a(n.m)}-${a(n.d)}` : null;
64
71
  }
65
72
  function y(t) {
66
73
  if (!t) return null;
@@ -73,24 +80,24 @@ function y(t) {
73
80
  const o = n[2].split(":").length === 3;
74
81
  return { date: e, time: w(r, o) };
75
82
  }
76
- function E(t, n) {
83
+ function Z(t, n) {
77
84
  if (!t || !n) return null;
78
85
  const e = m(t), r = h(n);
79
86
  return !e || !r ? null : `${e}T${w(r, n.split(":").length >= 3)}`;
80
87
  }
81
- function Z(t) {
88
+ function _(t) {
82
89
  if (!t) return null;
83
90
  const n = m(t);
84
91
  return n || y(t)?.date || null;
85
92
  }
86
- function _(t) {
93
+ function W(t) {
87
94
  if (!t) return null;
88
95
  const n = y(t);
89
96
  if (n) return n;
90
97
  const e = m(t);
91
98
  return e ? { date: e, time: "00:00" } : null;
92
99
  }
93
- function z(t, n, e) {
100
+ function Y(t, n, e) {
94
101
  const r = T(t);
95
102
  if (!r) return t;
96
103
  const o = `${n}::${JSON.stringify({})}`;
@@ -102,33 +109,33 @@ function z(t, n, e) {
102
109
  timeZone: "UTC"
103
110
  }), C.set(o, s)), s.format(new Date(Date.UTC(r.y, r.m - 1, r.d)));
104
111
  }
105
- function W(t, n, e, r) {
112
+ function j(t, n, e, r) {
106
113
  if (!t) return "";
107
114
  if (e === "iso") return t;
108
115
  if (e === "custom" && r) {
109
116
  const o = T(t);
110
117
  if (!o) return t;
111
- const s = P(n), i = A(n);
112
- return r.replace(/YYYY/g, String(o.y)).replace(/MMM/g, s[o.m - 1] || "").replace(/MMMM/g, i[o.m - 1] || "").replace(/MM/g, u(o.m)).replace(/DD/g, u(o.d));
118
+ const s = A(n), i = z(n);
119
+ return r.replace(/YYYY/g, String(o.y)).replace(/MMM/g, s[o.m - 1] || "").replace(/MMMM/g, i[o.m - 1] || "").replace(/MM/g, a(o.m)).replace(/DD/g, a(o.d));
113
120
  }
114
- return z(t, n);
121
+ return Y(t, n);
115
122
  }
116
- function j(t, n) {
123
+ function G(t, n) {
117
124
  const e = m(t.trim());
118
125
  if (e) return e;
119
- const r = O(t);
126
+ const r = P(t);
120
127
  if (!r) return null;
121
128
  const o = m(r);
122
129
  if (o) return o;
123
130
  const s = r.split("/").map((M) => M.trim()).filter(Boolean);
124
131
  if (s.length !== 3) return null;
125
- const i = $(s[0]), a = $(s[1]), p = $(s[2]);
126
- if (i == null || a == null || p == null) return null;
132
+ const i = $(s[0]), u = $(s[1]), p = $(s[2]);
133
+ if (i == null || u == null || p == null) return null;
127
134
  let f = p;
128
135
  f < 100 && (f += f >= 70 ? 1900 : 2e3);
129
- const l = n.toLowerCase().startsWith("en-us"), c = l ? i : a, d = l ? a : i;
136
+ const l = n.toLowerCase().startsWith("en-us"), c = l ? i : u, d = l ? u : i;
130
137
  if (f < 1e3 || c < 1 || c > 12 || d < 1 || d > 31) return null;
131
- const g = `${f}-${u(c)}-${u(d)}`;
138
+ const g = `${f}-${a(c)}-${a(d)}`;
132
139
  return m(g);
133
140
  }
134
141
  function h(t, n) {
@@ -139,21 +146,21 @@ function h(t, n) {
139
146
  let o = Number(r[1]);
140
147
  const s = Number(r[2] ?? "0"), i = Number(r[3] ?? "0");
141
148
  if (!Number.isFinite(o) || !Number.isFinite(s) || !Number.isFinite(i) || s < 0 || s > 59 || i < 0 || i > 59) return null;
142
- const a = r[4];
143
- if (a) {
149
+ const u = r[4];
150
+ if (u) {
144
151
  if (o < 1 || o > 12) return null;
145
- a === "pm" && o < 12 && (o += 12), a === "am" && o === 12 && (o = 0);
152
+ u === "pm" && o < 12 && (o += 12), u === "am" && o === 12 && (o = 0);
146
153
  }
147
154
  return o < 0 || o > 23 ? null : { hours: o, minutes: s, seconds: i };
148
155
  }
149
156
  function w(t, n = !1) {
150
157
  if (!t) return "";
151
- const e = u(D(t.hours, 0, 23)), r = u(D(t.minutes, 0, 59));
158
+ const e = a(D(t.hours, 0, 23)), r = a(D(t.minutes, 0, 59));
152
159
  if (!n) return `${e}:${r}`;
153
- const o = u(D(t.seconds, 0, 59));
160
+ const o = a(D(t.seconds, 0, 59));
154
161
  return `${e}:${r}:${o}`;
155
162
  }
156
- function G(t, n) {
163
+ function J(t, n) {
157
164
  const e = h(t);
158
165
  if (!e) return t;
159
166
  const r = /* @__PURE__ */ new Date();
@@ -170,40 +177,40 @@ function S(t, n) {
170
177
  const o = e.hours * 3600 + e.minutes * 60 + e.seconds, s = r.hours * 3600 + r.minutes * 60 + r.seconds;
171
178
  return o - s;
172
179
  }
173
- function J(t, n, e) {
180
+ function K(t, n, e) {
174
181
  const r = h(t);
175
182
  if (!r) return t;
176
183
  let o = w(r, t.split(":").length >= 3);
177
184
  return n && S(o, n) < 0 && (o = n), e && S(o, e) > 0 && (o = e), o;
178
185
  }
179
- function K(t, n, e) {
186
+ function V(t, n, e) {
180
187
  let r = t;
181
188
  return n && b(r, n) < 0 && (r = n), e && b(r, e) > 0 && (r = e), r;
182
189
  }
183
- function V(t, n) {
190
+ function Q(t, n) {
184
191
  const e = y(t), r = y(n);
185
192
  if (!e || !r) return t.localeCompare(n);
186
193
  const o = b(e.date, r.date);
187
194
  return o !== 0 ? o : S(e.time, r.time);
188
195
  }
189
- function Q(t) {
196
+ function R(t) {
190
197
  const n = T(t);
191
198
  if (!n) return { start: t, end: t };
192
- const e = v(n.y, n.m), r = F(n.y, n.m);
199
+ const e = F(n.y, n.m), r = L(n.y, n.m);
193
200
  return {
194
- start: `${e.y}-${u(e.m)}-${u(e.d)}`,
195
- end: `${r.y}-${u(r.m)}-${u(r.d)}`
201
+ start: `${e.y}-${a(e.m)}-${a(e.d)}`,
202
+ end: `${r.y}-${a(r.m)}-${a(r.d)}`
196
203
  };
197
204
  }
198
- function R(t, n) {
205
+ function X(t, n) {
199
206
  const e = D(n, 1, 366);
200
207
  return {
201
208
  start: N(t, -(e - 1)),
202
209
  end: t
203
210
  };
204
211
  }
205
- function X(t, n, e = 8, r = 8, o = null) {
206
- const i = (typeof window < "u" ? window.innerHeight : 800) - t.bottom - r - e, a = t.top - r - e, p = i >= n.height, f = a >= n.height, l = o === "top" ? "top" : "bottom";
212
+ function tt(t, n, e = 8, r = 8, o = null) {
213
+ const i = (typeof window < "u" ? window.innerHeight : 800) - t.bottom - r - e, u = t.top - r - e, p = i >= n.height, f = u >= n.height, l = o === "top" ? "top" : "bottom";
207
214
  let c;
208
215
  if (p && !f)
209
216
  c = "bottom";
@@ -212,10 +219,10 @@ function X(t, n, e = 8, r = 8, o = null) {
212
219
  else if (f && p)
213
220
  c = l;
214
221
  else {
215
- const g = l === "bottom" ? i : a, M = l === "bottom" ? a : i;
216
- g > 0 && M <= g + I ? c = l : c = i >= a ? "bottom" : "top";
222
+ const g = l === "bottom" ? i : u, M = l === "bottom" ? u : i;
223
+ g > 0 && M <= g + O ? c = l : c = i >= u ? "bottom" : "top";
217
224
  }
218
- const d = U(t, n, {
225
+ const d = I(t, n, {
219
226
  placement: `${c}-start`,
220
227
  strategy: "fixed",
221
228
  offset: r,
@@ -225,7 +232,7 @@ function X(t, n, e = 8, r = 8, o = null) {
225
232
  });
226
233
  return { top: Math.round(d.y), left: Math.round(d.x), placement: c };
227
234
  }
228
- function tt(t) {
235
+ function nt(t) {
229
236
  let n = 0;
230
237
  return { run: () => {
231
238
  n || (n = requestAnimationFrame(() => {
@@ -235,34 +242,34 @@ function tt(t) {
235
242
  n && (cancelAnimationFrame(n), n = 0);
236
243
  } };
237
244
  }
238
- function nt(t) {
245
+ function et(t) {
239
246
  return (t || "popover") === "inline" || typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia("(max-width: 639px)").matches;
240
247
  }
241
- function et() {
242
- return L();
248
+ function rt() {
249
+ return U();
243
250
  }
244
251
  export {
245
- K as a,
246
- q as b,
247
- X as c,
248
- j as d,
249
- H as e,
250
- W as f,
251
- R as g,
252
- Q as h,
253
- B as i,
254
- E as j,
252
+ V as a,
253
+ E as b,
254
+ tt as c,
255
+ G as d,
256
+ q as e,
257
+ j as f,
258
+ X as g,
259
+ R as h,
260
+ H as i,
261
+ Z as j,
255
262
  y as k,
256
- et as l,
257
- V as m,
263
+ rt as l,
264
+ Q as m,
258
265
  m as n,
259
- _ as o,
260
- Z as p,
266
+ W as o,
267
+ _ as p,
261
268
  h as q,
262
- tt as r,
263
- nt as s,
264
- G as t,
269
+ nt as r,
270
+ et as s,
271
+ J as t,
265
272
  w as u,
266
- J as v,
273
+ K as v,
267
274
  S as w
268
275
  };
@@ -0,0 +1 @@
1
+ "use strict";const l=require("./calendar-o273O28D.js"),I=require("./scroll-lock-BX6e3Ced.js"),v=require("./positioner-DZ1FW6A9.js"),w=new Map,N=24;function y(t,e,n){return Math.max(e,Math.min(n,t))}function u(t){return String(t).padStart(2,"0")}function $(t){if(!/^-?\d+$/.test(t))return null;const e=Number(t);return Number.isFinite(e)?Math.trunc(e):null}function O(t){return t.replace(/[.\-]/g,"/").replace(/\s+/g," ").trim()}function L(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"short",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function U(t){const e=[];for(let n=0;n<12;n+=1)e.push(new Intl.DateTimeFormat(t,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2024,n,1))));return e}function F(t,e=!1){if(t==null)return e;const n=t.trim().toLowerCase();return n?n!=="false"&&n!=="0"&&n!=="off"&&n!=="no":!0}function P(t,e){const n=typeof t.composedPath=="function"?t.composedPath():[];for(const o of e)if(o&&n.includes(o))return!0;const r=t.target;if(!(r instanceof Node))return!1;for(const o of e)if(o instanceof Node&&o.contains(r))return!0;return!1}function C(t){try{return new Intl.DateTimeFormat(t),!0}catch{return!1}}function z(t){const e=(t||"").trim();return e&&C(e)?e:typeof navigator<"u"&&navigator.language&&C(navigator.language)?navigator.language:"en-US"}function m(t){if(!t)return null;const e=l.parseISO(t);return e?`${e.y}-${u(e.m)}-${u(e.d)}`:null}function D(t){if(!t)return null;const e=/^(\d{4}-\d{2}-\d{2})[T ](\d{1,2}:\d{2}(?::\d{2})?)$/.exec(t.trim());if(!e)return null;const n=m(e[1]);if(!n)return null;const r=d(e[2]);if(!r)return null;const o=e[2].split(":").length===3;return{date:n,time:M(r,o)}}function A(t,e){if(!t||!e)return null;const n=m(t),r=d(e);return!n||!r?null:`${n}T${M(r,e.split(":").length>=3)}`}function Y(t){if(!t)return null;const e=m(t);return e||D(t)?.date||null}function k(t){if(!t)return null;const e=D(t);if(e)return e;const n=m(t);return n?{date:n,time:"00:00"}:null}function q(t,e,n){const r=l.parseISO(t);if(!r)return t;const o=`${e}::${JSON.stringify({})}`;let i=w.get(o);return i||(i=new Intl.DateTimeFormat(e,{year:"numeric",month:"short",day:"2-digit",timeZone:"UTC"}),w.set(o,i)),i.format(new Date(Date.UTC(r.y,r.m-1,r.d)))}function B(t,e,n,r){if(!t)return"";if(n==="iso")return t;if(n==="custom"&&r){const o=l.parseISO(t);if(!o)return t;const i=L(e),s=U(e);return r.replace(/YYYY/g,String(o.y)).replace(/MMM/g,i[o.m-1]||"").replace(/MMMM/g,s[o.m-1]||"").replace(/MM/g,u(o.m)).replace(/DD/g,u(o.d))}return q(t,e)}function x(t,e){const n=m(t.trim());if(n)return n;const r=O(t);if(!r)return null;const o=m(r);if(o)return o;const i=r.split("/").map(b=>b.trim()).filter(Boolean);if(i.length!==3)return null;const s=$(i[0]),a=$(i[1]),h=$(i[2]);if(s==null||a==null||h==null)return null;let f=h;f<100&&(f+=f>=70?1900:2e3);const p=e.toLowerCase().startsWith("en-us"),c=p?s:a,g=p?a:s;if(f<1e3||c<1||c>12||g<1||g>31)return null;const T=`${f}-${u(c)}-${u(g)}`;return m(T)}function d(t,e){const n=t.trim().toLowerCase();if(!n)return null;const r=/^(\d{1,2})(?::|\.|h)?(\d{1,2})?(?::|\.|m)?(\d{1,2})?\s*(am|pm)?$/.exec(n);if(!r)return null;let o=Number(r[1]);const i=Number(r[2]??"0"),s=Number(r[3]??"0");if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(s)||i<0||i>59||s<0||s>59)return null;const a=r[4];if(a){if(o<1||o>12)return null;a==="pm"&&o<12&&(o+=12),a==="am"&&o===12&&(o=0)}return o<0||o>23?null:{hours:o,minutes:i,seconds:s}}function M(t,e=!1){if(!t)return"";const n=u(y(t.hours,0,23)),r=u(y(t.minutes,0,59));if(!e)return`${n}:${r}`;const o=u(y(t.seconds,0,59));return`${n}:${r}:${o}`}function H(t,e){const n=d(t);if(!n)return t;const r=new Date;return r.setHours(n.hours,n.minutes,n.seconds,0),new Intl.DateTimeFormat(e,{hour:"numeric",minute:"2-digit",second:t.split(":").length>2?"2-digit":void 0,hour12:!0}).format(r)}function S(t,e){const n=d(t),r=d(e);if(!n||!r)return t.localeCompare(e);const o=n.hours*3600+n.minutes*60+n.seconds,i=r.hours*3600+r.minutes*60+r.seconds;return o-i}function E(t,e,n){const r=d(t);if(!r)return t;let o=M(r,t.split(":").length>=3);return e&&S(o,e)<0&&(o=e),n&&S(o,n)>0&&(o=n),o}function W(t,e,n){let r=t;return e&&l.compareISO(r,e)<0&&(r=e),n&&l.compareISO(r,n)>0&&(r=n),r}function Z(t,e){const n=D(t),r=D(e);if(!n||!r)return t.localeCompare(e);const o=l.compareISO(n.date,r.date);return o!==0?o:S(n.time,r.time)}function _(t){const e=l.parseISO(t);if(!e)return{start:t,end:t};const n=l.startOfMonth(e.y,e.m),r=l.endOfMonth(e.y,e.m);return{start:`${n.y}-${u(n.m)}-${u(n.d)}`,end:`${r.y}-${u(r.m)}-${u(r.d)}`}}function R(t,e){const n=y(e,1,366);return{start:l.addDaysISO(t,-(n-1)),end:t}}function G(t,e,n=8,r=8,o=null){const s=(typeof window<"u"?window.innerHeight:800)-t.bottom-r-n,a=t.top-r-n,h=s>=e.height,f=a>=e.height,p=o==="top"?"top":"bottom";let c;if(h&&!f)c="bottom";else if(f&&!h)c="top";else if(f&&h)c=p;else{const T=p==="bottom"?s:a,b=p==="bottom"?a:s;T>0&&b<=T+N?c=p:c=s>=a?"bottom":"top"}const g=v.computePositionState(t,e,{placement:`${c}-start`,strategy:"fixed",offset:r,shift:!1,flip:!1,boundaryPadding:n});return{top:Math.round(g.y),left:Math.round(g.x),placement:c}}function J(t){let e=0;return{run:()=>{e||(e=requestAnimationFrame(()=>{e=0,t()}))},cancel:()=>{e&&(cancelAnimationFrame(e),e=0)}}}function K(t){return(t||"popover")==="inline"||typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(max-width: 639px)").matches}function V(){return I.acquireBodyScrollLock()}exports.clampDateIso=W;exports.clampTime=E;exports.combineDateTime=A;exports.compareDateTimes=Z;exports.compareTimes=S;exports.computeLastDaysRange=R;exports.computeMonthRange=_;exports.computePopoverPosition=G;exports.eventOriginatesWithin=P;exports.formatDateForDisplay=B;exports.formatTime=M;exports.isTruthyAttr=F;exports.lockBodyScroll=V;exports.normalizeDateIso=m;exports.normalizeLocale=z;exports.parseConstraintDate=Y;exports.parseConstraintDateTime=k;exports.parseTimeInput=d;exports.parseUserDateInput=x;exports.rafThrottle=J;exports.shouldUseMobileSheet=K;exports.splitDateTime=D;exports.to12hDisplay=H;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const z=require("./ElementBase-DxbvhLJs.js"),S=require("./scroll-lock-BX6e3Ced.js"),M=require("./dismissable-layer-DNfrKA20.js"),I=require("./focus-scope-Bwug2gDv.js"),R=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("./ElementBase-DxbvhLJs.js"),C=require("./scroll-lock-BX6e3Ced.js"),I=require("./dismissable-layer-DNfrKA20.js"),R=require("./focus-scope-Bwug2gDv.js"),S=require("./overlay-motion-B56x1GoY.js"),P=`
2
2
  :host {
3
3
  position: fixed;
4
4
  inset: 0;
@@ -9,17 +9,13 @@
9
9
  color-scheme: light dark;
10
10
  --ui-dialog-backdrop: color-mix(in srgb, #020617 58%, transparent);
11
11
  --ui-dialog-backdrop-filter: none;
12
- --ui-dialog-bg: linear-gradient(
13
- 180deg,
14
- color-mix(in srgb, var(--ui-color-surface, #ffffff) 98%, transparent) 0%,
15
- color-mix(in srgb, var(--ui-color-surface-elevated, #f8fafc) 24%, var(--ui-color-surface, #ffffff)) 100%
16
- );
12
+ --ui-dialog-bg: var(--color-panel-solid, var(--ui-color-surface-elevated, var(--ui-color-surface, #ffffff)));
17
13
  --ui-dialog-color: var(--ui-color-text, #0f172a);
18
14
  --ui-dialog-muted: var(--ui-color-muted, #526175);
19
- --ui-dialog-border-color: color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent);
15
+ --ui-dialog-border-color: var(--ui-color-line-subtle, color-mix(in srgb, var(--ui-color-border, #cbd5e1) 70%, transparent));
20
16
  --ui-dialog-border: 1px solid var(--ui-dialog-border-color);
21
- --ui-dialog-shadow: none;
22
- --ui-dialog-radius: 16px;
17
+ --ui-dialog-shadow: var(--shadow-6, 0 24px 60px rgba(2, 6, 23, 0.28));
18
+ --ui-dialog-radius: calc(var(--ui-radius, 6px) * 2);
23
19
  --ui-dialog-padding-x: 24px;
24
20
  --ui-dialog-padding-y: 20px;
25
21
  --ui-dialog-width: min(560px, calc(100vw - 24px));
@@ -68,18 +64,21 @@
68
64
  background: var(--ui-dialog-backdrop);
69
65
  -webkit-backdrop-filter: var(--ui-dialog-backdrop-filter);
70
66
  backdrop-filter: var(--ui-dialog-backdrop-filter);
71
- opacity: 0;
72
- transition: opacity var(--ui-dialog-duration) var(--ui-dialog-easing);
67
+ /* The overlay goes to the top layer (popover); undo the popover user-agent box. */
68
+ inline-size: 100%;
69
+ block-size: 100%;
70
+ max-inline-size: none;
71
+ max-block-size: none;
72
+ margin: 0;
73
+ border: 0;
74
+ overflow: visible;
75
+ color: inherit;
73
76
  }
74
77
 
75
78
  .overlay[hidden] {
76
79
  display: none;
77
80
  }
78
81
 
79
- .overlay[data-open='true'] {
80
- opacity: 1;
81
- }
82
-
83
82
  .panel {
84
83
  position: relative;
85
84
  z-index: var(--ui-dialog-z);
@@ -93,20 +92,39 @@
93
92
  color: var(--ui-dialog-color);
94
93
  box-shadow: var(--ui-dialog-shadow);
95
94
  padding: var(--ui-dialog-padding-y) var(--ui-dialog-padding-x);
96
- transform: translate3d(0, 12px, 0) scale(0.985);
97
- opacity: 0;
98
95
  transition:
99
- transform var(--ui-dialog-duration) var(--ui-dialog-easing),
100
- opacity var(--ui-dialog-duration) var(--ui-dialog-easing),
101
96
  border-color var(--ui-dialog-duration) var(--ui-dialog-easing),
102
97
  box-shadow var(--ui-dialog-duration) var(--ui-dialog-easing);
103
- will-change: transform, opacity;
104
98
  backface-visibility: hidden;
105
99
  }
106
100
 
107
- .overlay[data-open='true'] .panel {
108
- transform: translate3d(0, 0, 0) scale(1);
109
- opacity: 1;
101
+ /* Open and close are animations on data-state: a transition cannot run out of display: none. */
102
+ .overlay[data-state='open']:not([data-instant]) {
103
+ animation: ui-dialog-backdrop-in var(--ui-dialog-in-duration, 150ms) ease-out backwards;
104
+ }
105
+
106
+ .overlay[data-state='open']:not([data-instant]) .panel {
107
+ animation: ui-dialog-panel-in var(--ui-dialog-in-duration, 150ms) var(--ui-motion-enter-easing, cubic-bezier(0.16, 1, 0.3, 1)) backwards;
108
+ }
109
+
110
+ .overlay[data-state='closed'] {
111
+ animation: ui-dialog-backdrop-out var(--ui-dialog-out-duration, 100ms) ease-in both;
112
+ pointer-events: none;
113
+ }
114
+
115
+ .overlay[data-state='closed'] .panel {
116
+ animation: ui-dialog-panel-out var(--ui-dialog-out-duration, 100ms) var(--ui-motion-exit-easing, cubic-bezier(0.4, 0, 1, 1)) both;
117
+ }
118
+
119
+ @keyframes ui-dialog-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
120
+ @keyframes ui-dialog-backdrop-out { from { opacity: 1; } to { opacity: 0; } }
121
+ @keyframes ui-dialog-panel-in {
122
+ from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
123
+ to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
124
+ }
125
+ @keyframes ui-dialog-panel-out {
126
+ from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
127
+ to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.96); }
110
128
  }
111
129
 
112
130
  :host([state='error']) .panel {
@@ -195,8 +213,6 @@
195
213
 
196
214
  .footer {
197
215
  margin-top: 20px;
198
- padding-top: 16px;
199
- border-top: 1px solid color-mix(in srgb, var(--ui-dialog-border-color) 82%, transparent);
200
216
  display: flex;
201
217
  align-items: center;
202
218
  justify-content: flex-end;
@@ -276,7 +292,7 @@
276
292
  }
277
293
 
278
294
  .error[data-empty='true'] {
279
- visibility: hidden;
295
+ display: none;
280
296
  }
281
297
 
282
298
  :host([state='loading']) .btn,
@@ -372,26 +388,26 @@
372
388
  box-shadow: none;
373
389
  }
374
390
  }
375
- `,P='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function g(a,t){if(a==null)return t;const i=a.trim().toLowerCase();return i!=="false"&&i!=="0"&&i!=="off"}function n(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function C(){return typeof window<"u"&&typeof document<"u"}function E(a){return window.setTimeout(a,16)}function p(a){a&&window.clearTimeout(a)}const l=class l extends z.ElementBase{constructor(){super(),this._isActive=!1,this._uid=Math.random().toString(36).slice(2,10),this._dialogId=this._uid,this._lastFocused=null,this._terminalEmitted=!1,this._closeMeta=null,this._runtimeError="",this._config={},this._dismissableLayer=null,this._focusScope=null,this._disconnectCleanupFrame=0,this._restoreFocusFrame=0,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onSubmit=this._onSubmit.bind(this)}static get observedAttributes(){return["open","headless","title","description","closable","dismissible","close-on-overlay","close-on-backdrop","close-on-esc","lock-while-loading","size","state","role","initial-focus","submit-text","cancel-text","loading-text","error-message","aria-label","aria-labelledby","aria-describedby"]}connectedCallback(){this._disconnectCleanupFrame&&(p(this._disconnectCleanupFrame),this._disconnectCleanupFrame=0),super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.addEventListener("submit",this._onSubmit),this._syncFromAttributes(),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.removeEventListener("submit",this._onSubmit),this._disconnectCleanupFrame&&p(this._disconnectCleanupFrame),this._restoreFocusFrame&&(p(this._restoreFocusFrame),this._restoreFocusFrame=0),this._disconnectCleanupFrame=E(()=>{this._disconnectCleanupFrame=0,!this.isConnected&&(this._isActive&&!this._terminalEmitted?this.close("dismiss","unmount"):(this._destroyRuntimeControllers(),this._deactivate()),super.disconnectedCallback())})}attributeChangedCallback(t,i,e){if(i!==e){if(t==="open"){this._syncOpenState();return}t==="state"&&e!=="error"&&(this._runtimeError=""),this._syncFromAttributes(),this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.close("dismiss","programmatic")}get dismissible(){return g(this.getAttribute("dismissible")??this.getAttribute("closable"),!0)}set dismissible(t){this.setAttribute("dismissible",String(t)),this.setAttribute("closable",String(t))}get closeOnOverlay(){return g(this.getAttribute("close-on-overlay")??this.getAttribute("close-on-backdrop"),!0)}set closeOnOverlay(t){this.setAttribute("close-on-overlay",String(t)),this.setAttribute("close-on-backdrop",String(t))}get closeOnEsc(){return g(this.getAttribute("close-on-esc"),!0)}set closeOnEsc(t){this.setAttribute("close-on-esc",String(t))}get lockWhileLoading(){return g(this.getAttribute("lock-while-loading"),!0)}set lockWhileLoading(t){this.setAttribute("lock-while-loading",String(t))}get state(){const t=this.getAttribute("state");return t==="loading"||t==="error"||t==="success"?t:"idle"}set state(t){if(t==="idle"){this.removeAttribute("state");return}this.setAttribute("state",t)}get dialogId(){return this._dialogId}set dialogId(t){this._dialogId=t||this._uid,this.requestRender()}get config(){return this._config}set config(t){this._config=t||{},this._config.id&&(this._dialogId=this._config.id),this._config.dismissible!=null&&(this.dismissible=!!this._config.dismissible),this._config.closeOnOverlay!=null&&(this.closeOnOverlay=!!this._config.closeOnOverlay),this._config.closeOnEsc!=null&&(this.closeOnEsc=!!this._config.closeOnEsc),this._config.lockWhileLoading!=null&&(this.lockWhileLoading=!!this._config.lockWhileLoading),this._config.size&&this.setAttribute("size",this._config.size),this._config.role&&this.setAttribute("role",this._config.role),this._config.initialFocus&&this.setAttribute("initial-focus",this._config.initialFocus),this._config.ariaLabel&&this.setAttribute("aria-label",this._config.ariaLabel),this._config.ariaLabelledby&&this.setAttribute("aria-labelledby",this._config.ariaLabelledby),this._config.ariaDescribedby&&this.setAttribute("aria-describedby",this._config.ariaDescribedby),this._config.errorMessage&&(this._runtimeError=this._config.errorMessage),this.requestRender()}openDialog(){this.setAttribute("open","")}closeDialog(t="programmatic"){if(!this.hasAttribute("open"))return;const i=new CustomEvent("request-close",{detail:{reason:t},bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(i);const e=new CustomEvent("ui-request-close",{detail:{id:this.dialogId||this._uid,reason:t},bubbles:!0,cancelable:!0,composed:!0});if(this.dispatchEvent(e),!(i.defaultPrevented||e.defaultPrevented)){if(t==="submit"){this.close("submit");return}if(t==="cancel"){this.close("cancel");return}if(t==="overlay"){this.close("dismiss","overlay");return}if(t==="escape"){this.close("dismiss","esc");return}if(t==="button"){this.close("dismiss","close-icon");return}this.close("dismiss","programmatic")}}close(t="dismiss",i,e){this._terminalEmitted||(this._closeMeta={action:t,source:i,reason:e},this.hasAttribute("open")&&this.removeAttribute("open"),this._syncOpenState())}setError(t){this._runtimeError=t,this.state=t?"error":"idle",this.requestRender()}clearError(){this._runtimeError="",this.state==="error"&&(this.state="idle"),this.requestRender()}_syncFromAttributes(){!this.hasAttribute("dismissible")&&this.hasAttribute("closable")&&this.setAttribute("dismissible",this.getAttribute("closable")||"true"),!this.hasAttribute("closable")&&this.hasAttribute("dismissible")&&this.setAttribute("closable",this.getAttribute("dismissible")||"true"),!this.hasAttribute("close-on-overlay")&&this.hasAttribute("close-on-backdrop")&&this.setAttribute("close-on-overlay",this.getAttribute("close-on-backdrop")||"true"),!this.hasAttribute("close-on-backdrop")&&this.hasAttribute("close-on-overlay")&&this.setAttribute("close-on-backdrop",this.getAttribute("close-on-overlay")||"true"),this.hasAttribute("role")||this.setAttribute("role","dialog")}_syncOpenState(){const t=this.hasAttribute("open");t&&!this._isActive?this._activate():!t&&this._isActive&&this._deactivate(),this._syncOpenUi()}_activate(){this._isActive=!0,this._terminalEmitted=!1,this._closeMeta=null,l._openStack.includes(this)||l._openStack.push(this),this._lastFocused=document.activeElement||null,S.acquireBodyScrollLock();const t=this.dialogId||this._uid;this._dispatchWithLegacy("ui-open","open",{id:t}),this.dispatchEvent(new CustomEvent("show",{bubbles:!0,composed:!0})),this._syncOpenUi(),this._syncRuntimeControllers()}_deactivate(){if(!this._isActive)return;this._isActive=!1,this._destroyRuntimeControllers();const t=l._openStack.lastIndexOf(this);if(t>=0&&l._openStack.splice(t,1),S.releaseBodyScrollLock(),!this._terminalEmitted){const e=this._closeMeta||{action:"dismiss",source:"abort"},s=this.dialogId||this._uid;e.action==="cancel"?this._dispatchWithLegacy("ui-cancel","cancel",{id:s}):this._dispatchWithLegacy("ui-dismiss","dismiss",{id:s,source:e.source||"abort",reason:e.reason}),this._dispatchWithLegacy("ui-close","close",{id:s,action:e.action,source:e.source,reason:e.reason}),this.dispatchEvent(new CustomEvent("hide",{bubbles:!0,composed:!0})),this._terminalEmitted=!0,this._closeMeta=null}const i=this._lastFocused;this._lastFocused=null,i&&this._canRestoreFocus(i)&&(this._restoreFocusFrame&&p(this._restoreFocusFrame),this._restoreFocusFrame=E(()=>{this._restoreFocusFrame=0;try{this._canRestoreFocus(i)&&i.focus()}catch{}})),this._syncOpenUi()}_dispatchWithLegacy(t,i,e,s=!1){const o=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:s});this.dispatchEvent(o);const r=new CustomEvent(i,{detail:e,bubbles:!0,composed:!0,cancelable:s});return this.dispatchEvent(r),o}_isTopMost(){if(!this._isActive)return!1;const t=l._openStack;return t.length>0&&t[t.length-1]===this}_queryPanel(){return this.root.querySelector(".panel")}_canRestoreFocus(t){if(!t||!t.isConnected||t.disabled||t.getAttribute("aria-hidden")==="true")return!1;if(!C())return!0;const i=window.getComputedStyle(t);return i.display!=="none"&&i.visibility!=="hidden"}_collectFocusable(t){return Array.from(t.querySelectorAll(P)).filter(i=>{if(i.disabled||i.getAttribute("aria-hidden")==="true")return!1;const s=C()?window.getComputedStyle(i):null;return!(s&&(s.display==="none"||s.visibility==="hidden"))})}_focusInitial(){if(!this.open)return;const t=this._queryPanel();if(!t)return;const i=this.getAttribute("initial-focus")||this._config.initialFocus||"";if(i){const r=t.querySelector(i);if(r&&typeof r.focus=="function"){r.focus();return}}const e=this._collectFocusable(t),o=e.find(r=>r.hasAttribute("autofocus"))||e[0]||t;!o.hasAttribute("tabindex")&&o===t&&o.setAttribute("tabindex","-1");try{o.focus()}catch{}}_onFocusIn(t){!this.open||this._isTopMost()}_handleTab(t){t.key}_destroyRuntimeControllers(){this._dismissableLayer?.destroy(),this._dismissableLayer=null,this._focusScope?.destroy(),this._focusScope=null}_syncOpenUi(){const t=this.root.querySelector(".overlay"),i=this._queryPanel(),e=this.open;!t||!i||(t.hidden=!e,t.setAttribute("data-open",String(e)),t.setAttribute("aria-hidden",e?"false":"true"),i.setAttribute("aria-hidden",e?"false":"true"))}_syncRuntimeControllers(){if(this._destroyRuntimeControllers(),!this.open||!this._isTopMost())return;const t=this._queryPanel();t&&(this._dismissableLayer=M.createDismissableLayer({node:t,closeOnEscape:this.closeOnEsc,closeOnPointerOutside:this.closeOnOverlay,closeOnFocusOutside:!1,onBeforeDismiss:(i,e)=>this._isInteractionLocked()?!1:i==="escape-key"?(this.closeDialog("escape"),!1):(i==="outside-pointer"&&this.closeDialog("overlay"),!1)}),this._focusScope=I.createFocusScope({node:t,trapped:!0,loop:!0,restoreFocus:!1,autoFocus:"first",initialFocus:()=>{const i=this.getAttribute("initial-focus")||this._config.initialFocus||"";return i?t.querySelector(i):null}}))}_collectFormData(t){const i=this._queryPanel(),e=t||this.querySelector("form")||i?.querySelector("form")||null;if(!(e instanceof HTMLFormElement)||typeof FormData>"u")return;const s=new FormData(e),o={};for(const[r,h]of s.entries()){const c=String(h);if(o[r]==null){o[r]=c;continue}const d=o[r];Array.isArray(d)?d.push(c):o[r]=[d,c]}return Object.keys(o).length?o:void 0}_resolveSubmitForm(t){if(t){const s=t.closest("form");if(s instanceof HTMLFormElement&&this.contains(s))return s}const i=this.querySelector("form");if(i instanceof HTMLFormElement)return i;const e=this._queryPanel()?.querySelector("form");return e instanceof HTMLFormElement?e:null}_isInteractionLocked(){return this.state==="loading"&&this.lockWhileLoading}_requestDismiss(t,i){if(!this._isInteractionLocked()){if(t==="overlay"){this.closeDialog("overlay");return}if(t==="esc"){this.closeDialog("escape");return}if(t==="close-icon"){this.closeDialog("button");return}this.close("dismiss",t,i)}}_handleSubmit(t){if(this._isInteractionLocked())return;const i=t??this._resolveSubmitForm();if(i&&typeof i.reportValidity=="function"&&!i.reportValidity())return;const e={id:this.dialogId||this._uid,formData:this._collectFormData(i)};this._dispatchWithLegacy("ui-submit","submit",e,!0).defaultPrevented||this.closeDialog("submit")}_handleCancel(){this._isInteractionLocked()||this.closeDialog("cancel")}_onClick(t){if(!this.open||!this._isTopMost())return;const i=t.target;if(i){if(!i.closest(".panel")&&i.closest(".overlay")&&this.closeOnOverlay){this._requestDismiss("overlay");return}if(i.closest(".close")){this._requestDismiss("close-icon");return}if(i.closest(".btn-submit")){this._handleSubmit();return}i.closest(".btn-cancel")&&this._handleCancel()}}_onSubmit(t){if(!this.open||!this._isTopMost())return;const i=t.target;i&&i!==this&&this.contains(i)&&(t.preventDefault(),t.stopPropagation(),this._handleSubmit(i))}_onKeyDown(t){if(!(!this.open||!this._isTopMost())&&t.key==="Escape"){if(!this.closeOnEsc)return;t.preventDefault(),t.stopPropagation(),this._requestDismiss("esc");return}}render(){const t=this._config.title??this.getAttribute("title")??"",i=this._config.description??this.getAttribute("description")??"",e=this._config.submitText??this.getAttribute("submit-text")??"Submit",s=this._config.cancelText??this.getAttribute("cancel-text")??"Cancel",o=this._config.loadingText??this.getAttribute("loading-text")??"Working...",r=t.trim(),h=i.trim(),c=!!this.querySelector('[slot="title"]'),d=!!this.querySelector('[slot="description"]'),m=!!(r||c),v=!!(h||d),L=!!this.querySelector('[slot="content"]'),O=!!this.querySelector('[slot="footer"]'),q=this._config.showCancel??!0,$=this._config.showClose??this.dismissible,_=this._runtimeError||this._config.errorMessage||this.getAttribute("error-message")||"",b=this.state==="loading",x=`ui-dialog-title-${this._uid}`,A=`ui-dialog-description-${this._uid}`,k=`ui-dialog-error-${this._uid}`,D=this.getAttribute("aria-label")||"",T=this.getAttribute("aria-labelledby")||"",w=this.getAttribute("aria-describedby")||"",y=T||(m?x:""),F=D||(y?"":"Dialog"),u=[];w?u.push(w):(v&&u.push(A),_&&u.push(k));const B=m||v?`
391
+ `,W='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function p(n,t){if(n==null)return t;const i=n.trim().toLowerCase();return i!=="false"&&i!=="0"&&i!=="off"}function a(n){return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function E(){return typeof window<"u"&&typeof document<"u"}function L(n){return window.setTimeout(n,16)}function g(n){n&&window.clearTimeout(n)}const l=class l extends M.ElementBase{constructor(){super(),this._isActive=!1,this._uid=Math.random().toString(36).slice(2,10),this._dialogId=this._uid,this._lastFocused=null,this._terminalEmitted=!1,this._closeMeta=null,this._runtimeError="",this._config={},this._dismissableLayer=null,this._focusScope=null,this._disconnectCleanupFrame=0,this._restoreFocusFrame=0,this._presented=!1,this._finishClose=null,this._onClick=this._onClick.bind(this),this._onKeyDown=this._onKeyDown.bind(this),this._onFocusIn=this._onFocusIn.bind(this),this._onSubmit=this._onSubmit.bind(this)}static get observedAttributes(){return["open","headless","title","description","closable","dismissible","close-on-overlay","close-on-backdrop","close-on-esc","lock-while-loading","size","state","role","initial-focus","submit-text","cancel-text","loading-text","error-message","aria-label","aria-labelledby","aria-describedby"]}connectedCallback(){this._disconnectCleanupFrame&&(g(this._disconnectCleanupFrame),this._disconnectCleanupFrame=0),super.connectedCallback(),this.root.addEventListener("click",this._onClick),this.root.addEventListener("keydown",this._onKeyDown),this.addEventListener("submit",this._onSubmit),this._syncFromAttributes(),this._syncOpenState()}disconnectedCallback(){this.root.removeEventListener("click",this._onClick),this.root.removeEventListener("keydown",this._onKeyDown),this.removeEventListener("submit",this._onSubmit),this._disconnectCleanupFrame&&g(this._disconnectCleanupFrame),this._restoreFocusFrame&&(g(this._restoreFocusFrame),this._restoreFocusFrame=0),this._disconnectCleanupFrame=L(()=>{this._disconnectCleanupFrame=0,!this.isConnected&&(this._isActive&&!this._terminalEmitted?this.close("dismiss","unmount"):(this._destroyRuntimeControllers(),this._deactivate()),super.disconnectedCallback())})}attributeChangedCallback(t,i,e){if(i!==e){if(t==="open"){this._syncOpenState();return}t==="state"&&e!=="error"&&(this._runtimeError=""),this._syncFromAttributes(),this.isConnected&&this.requestRender()}}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.close("dismiss","programmatic")}get dismissible(){return p(this.getAttribute("dismissible")??this.getAttribute("closable"),!0)}set dismissible(t){this.setAttribute("dismissible",String(t)),this.setAttribute("closable",String(t))}get closeOnOverlay(){return p(this.getAttribute("close-on-overlay")??this.getAttribute("close-on-backdrop"),!0)}set closeOnOverlay(t){this.setAttribute("close-on-overlay",String(t)),this.setAttribute("close-on-backdrop",String(t))}get closeOnEsc(){return p(this.getAttribute("close-on-esc"),!0)}set closeOnEsc(t){this.setAttribute("close-on-esc",String(t))}get lockWhileLoading(){return p(this.getAttribute("lock-while-loading"),!0)}set lockWhileLoading(t){this.setAttribute("lock-while-loading",String(t))}get state(){const t=this.getAttribute("state");return t==="loading"||t==="error"||t==="success"?t:"idle"}set state(t){if(t==="idle"){this.removeAttribute("state");return}this.setAttribute("state",t)}get dialogId(){return this._dialogId}set dialogId(t){this._dialogId=t||this._uid,this.requestRender()}get config(){return this._config}set config(t){this._config=t||{},this._config.id&&(this._dialogId=this._config.id),this._config.dismissible!=null&&(this.dismissible=!!this._config.dismissible),this._config.closeOnOverlay!=null&&(this.closeOnOverlay=!!this._config.closeOnOverlay),this._config.closeOnEsc!=null&&(this.closeOnEsc=!!this._config.closeOnEsc),this._config.lockWhileLoading!=null&&(this.lockWhileLoading=!!this._config.lockWhileLoading),this._config.size&&this.setAttribute("size",this._config.size),this._config.role&&this.setAttribute("role",this._config.role),this._config.initialFocus&&this.setAttribute("initial-focus",this._config.initialFocus),this._config.ariaLabel&&this.setAttribute("aria-label",this._config.ariaLabel),this._config.ariaLabelledby&&this.setAttribute("aria-labelledby",this._config.ariaLabelledby),this._config.ariaDescribedby&&this.setAttribute("aria-describedby",this._config.ariaDescribedby),this._config.errorMessage&&(this._runtimeError=this._config.errorMessage),this.requestRender()}openDialog(){this.setAttribute("open","")}closeDialog(t="programmatic"){if(!this.hasAttribute("open"))return;const i=new CustomEvent("request-close",{detail:{reason:t},bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(i);const e=new CustomEvent("ui-request-close",{detail:{id:this.dialogId||this._uid,reason:t},bubbles:!0,cancelable:!0,composed:!0});if(this.dispatchEvent(e),!(i.defaultPrevented||e.defaultPrevented)){if(t==="submit"){this.close("submit");return}if(t==="cancel"){this.close("cancel");return}if(t==="overlay"){this.close("dismiss","overlay");return}if(t==="escape"){this.close("dismiss","esc");return}if(t==="button"){this.close("dismiss","close-icon");return}this.close("dismiss","programmatic")}}close(t="dismiss",i,e){this._terminalEmitted||(this._closeMeta={action:t,source:i,reason:e},this.hasAttribute("open")&&this.removeAttribute("open"),this._syncOpenState())}setError(t){this._runtimeError=t,this.state=t?"error":"idle",this.requestRender()}clearError(){this._runtimeError="",this.state==="error"&&(this.state="idle"),this.requestRender()}_syncFromAttributes(){!this.hasAttribute("dismissible")&&this.hasAttribute("closable")&&this.setAttribute("dismissible",this.getAttribute("closable")||"true"),!this.hasAttribute("closable")&&this.hasAttribute("dismissible")&&this.setAttribute("closable",this.getAttribute("dismissible")||"true"),!this.hasAttribute("close-on-overlay")&&this.hasAttribute("close-on-backdrop")&&this.setAttribute("close-on-overlay",this.getAttribute("close-on-backdrop")||"true"),!this.hasAttribute("close-on-backdrop")&&this.hasAttribute("close-on-overlay")&&this.setAttribute("close-on-backdrop",this.getAttribute("close-on-overlay")||"true"),this.hasAttribute("role")||this.setAttribute("role","dialog")}_syncOpenState(){const t=this.hasAttribute("open");t&&!this._isActive?this._activate():!t&&this._isActive&&this._deactivate(),this._syncOpenUi()}_activate(){this._isActive=!0,this._terminalEmitted=!1,this._closeMeta=null,l._openStack.includes(this)||l._openStack.push(this),this._lastFocused=document.activeElement||null,C.acquireBodyScrollLock();const t=this.dialogId||this._uid;this._dispatchWithLegacy("ui-open","open",{id:t}),this.dispatchEvent(new CustomEvent("show",{bubbles:!0,composed:!0})),this._syncOpenUi(),this._syncRuntimeControllers()}_deactivate(){if(!this._isActive)return;this._isActive=!1,this._destroyRuntimeControllers();const t=l._openStack.lastIndexOf(this);if(t>=0&&l._openStack.splice(t,1),C.releaseBodyScrollLock(),!this._terminalEmitted){const e=this._closeMeta||{action:"dismiss",source:"abort"},s=this.dialogId||this._uid;e.action==="cancel"?this._dispatchWithLegacy("ui-cancel","cancel",{id:s}):this._dispatchWithLegacy("ui-dismiss","dismiss",{id:s,source:e.source||"abort",reason:e.reason}),this._dispatchWithLegacy("ui-close","close",{id:s,action:e.action,source:e.source,reason:e.reason}),this.dispatchEvent(new CustomEvent("hide",{bubbles:!0,composed:!0})),this._terminalEmitted=!0,this._closeMeta=null}const i=this._lastFocused;this._lastFocused=null,i&&this._canRestoreFocus(i)&&(this._restoreFocusFrame&&g(this._restoreFocusFrame),this._restoreFocusFrame=L(()=>{this._restoreFocusFrame=0;try{this._canRestoreFocus(i)&&i.focus()}catch{}})),this._syncOpenUi()}_dispatchWithLegacy(t,i,e,s=!1){const o=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0,cancelable:s});this.dispatchEvent(o);const r=new CustomEvent(i,{detail:e,bubbles:!0,composed:!0,cancelable:s});return this.dispatchEvent(r),o}_isTopMost(){if(!this._isActive)return!1;const t=l._openStack;return t.length>0&&t[t.length-1]===this}_queryPanel(){return this.root.querySelector(".panel")}_canRestoreFocus(t){if(!t||!t.isConnected||t.disabled||t.getAttribute("aria-hidden")==="true")return!1;if(!E())return!0;const i=window.getComputedStyle(t);return i.display!=="none"&&i.visibility!=="hidden"}_collectFocusable(t){return Array.from(t.querySelectorAll(W)).filter(i=>{if(i.disabled||i.getAttribute("aria-hidden")==="true")return!1;const s=E()?window.getComputedStyle(i):null;return!(s&&(s.display==="none"||s.visibility==="hidden"))})}_focusInitial(){if(!this.open)return;const t=this._queryPanel();if(!t)return;const i=this.getAttribute("initial-focus")||this._config.initialFocus||"";if(i){const r=t.querySelector(i);if(r&&typeof r.focus=="function"){r.focus();return}}const e=this._collectFocusable(t),o=e.find(r=>r.hasAttribute("autofocus"))||e[0]||t;!o.hasAttribute("tabindex")&&o===t&&o.setAttribute("tabindex","-1");try{o.focus()}catch{}}_onFocusIn(t){!this.open||this._isTopMost()}_handleTab(t){t.key}_destroyRuntimeControllers(){this._dismissableLayer?.destroy(),this._dismissableLayer=null,this._focusScope?.destroy(),this._focusScope=null}_syncOpenUi(){const t=this.root.querySelector(".overlay"),i=this._queryPanel(),e=this.open;if(!(!t||!i)){if(t.setAttribute("aria-hidden",e?"false":"true"),i.setAttribute("aria-hidden",e?"false":"true"),t.setAttribute("data-open",String(e)),e){this._finishClose?.(),this._finishClose=null,t.hidden=!1,t.setAttribute("data-state","open"),this._presented||t.removeAttribute("data-instant"),this._presented=!0,this.hasAttribute("headless")||S.liftToTopLayer(t,{resetBox:!1});return}if(this._presented&&!t.hidden){this._presented=!1,t.removeAttribute("data-instant"),this._finishClose=S.closeOverlay(t,()=>{this._finishClose=null,t.hidden=!0;try{t.matches(":popover-open")&&t.hidePopover()}catch{}});return}this._finishClose||(this._presented=!1,t.setAttribute("data-state","closed"),t.hidden=!0)}}_syncRuntimeControllers(){if(this._destroyRuntimeControllers(),!this.open||!this._isTopMost())return;const t=this._queryPanel();t&&(this._dismissableLayer=I.createDismissableLayer({node:t,closeOnEscape:this.closeOnEsc,closeOnPointerOutside:this.closeOnOverlay,closeOnFocusOutside:!1,onBeforeDismiss:(i,e)=>this._isInteractionLocked()?!1:i==="escape-key"?(this.closeDialog("escape"),!1):(i==="outside-pointer"&&this.closeDialog("overlay"),!1)}),this._focusScope=R.createFocusScope({node:t,trapped:!0,loop:!0,restoreFocus:!1,autoFocus:"first",initialFocus:()=>{const i=this.getAttribute("initial-focus")||this._config.initialFocus||"";return i?t.querySelector(i):null}}))}_collectFormData(t){const i=this._queryPanel(),e=t||this.querySelector("form")||i?.querySelector("form")||null;if(!(e instanceof HTMLFormElement)||typeof FormData>"u")return;const s=new FormData(e),o={};for(const[r,h]of s.entries()){const c=String(h);if(o[r]==null){o[r]=c;continue}const d=o[r];Array.isArray(d)?d.push(c):o[r]=[d,c]}return Object.keys(o).length?o:void 0}_resolveSubmitForm(t){if(t){const s=t.closest("form");if(s instanceof HTMLFormElement&&this.contains(s))return s}const i=this.querySelector("form");if(i instanceof HTMLFormElement)return i;const e=this._queryPanel()?.querySelector("form");return e instanceof HTMLFormElement?e:null}_isInteractionLocked(){return this.state==="loading"&&this.lockWhileLoading}_requestDismiss(t,i){if(!this._isInteractionLocked()){if(t==="overlay"){this.closeDialog("overlay");return}if(t==="esc"){this.closeDialog("escape");return}if(t==="close-icon"){this.closeDialog("button");return}this.close("dismiss",t,i)}}_handleSubmit(t){if(this._isInteractionLocked())return;const i=t??this._resolveSubmitForm();if(i&&typeof i.reportValidity=="function"&&!i.reportValidity())return;const e={id:this.dialogId||this._uid,formData:this._collectFormData(i)};this._dispatchWithLegacy("ui-submit","submit",e,!0).defaultPrevented||this.closeDialog("submit")}_handleCancel(){this._isInteractionLocked()||this.closeDialog("cancel")}_onClick(t){if(!this.open||!this._isTopMost())return;const i=t.target;if(i){if(!i.closest(".panel")&&i.closest(".overlay")&&this.closeOnOverlay){this._requestDismiss("overlay");return}if(i.closest(".close")){this._requestDismiss("close-icon");return}if(i.closest(".btn-submit")){this._handleSubmit();return}i.closest(".btn-cancel")&&this._handleCancel()}}_onSubmit(t){if(!this.open||!this._isTopMost())return;const i=t.target;i&&i!==this&&this.contains(i)&&(t.preventDefault(),t.stopPropagation(),this._handleSubmit(i))}_onKeyDown(t){if(!(!this.open||!this._isTopMost())&&t.key==="Escape"){if(!this.closeOnEsc)return;t.preventDefault(),t.stopPropagation(),this._requestDismiss("esc");return}}render(){const t=this._config.title??this.getAttribute("title")??"",i=this._config.description??this.getAttribute("description")??"",e=this._config.submitText??this.getAttribute("submit-text")??"Submit",s=this._config.cancelText??this.getAttribute("cancel-text")??"Cancel",o=this._config.loadingText??this.getAttribute("loading-text")??"Working...",r=t.trim(),h=i.trim(),c=!!this.querySelector('[slot="title"]'),d=!!this.querySelector('[slot="description"]'),m=!!(r||c),v=!!(h||d),O=!!this.querySelector('[slot="content"]'),q=!!this.querySelector('[slot="footer"]'),$=this._config.showCancel??!0,T=this._config.showClose??this.dismissible,_=this._runtimeError||this._config.errorMessage||this.getAttribute("error-message")||"",b=this.state==="loading",x=`ui-dialog-title-${this._uid}`,k=`ui-dialog-description-${this._uid}`,A=`ui-dialog-error-${this._uid}`,D=this.getAttribute("aria-label")||"",z=this.getAttribute("aria-labelledby")||"",w=this.getAttribute("aria-describedby")||"",y=z||(m?x:""),F=D||(y?"":"Dialog"),u=[];w?u.push(w):(v&&u.push(k),_&&u.push(A));const B=m||v?`
376
392
  <header class="header" part="header">
377
- ${m?`<h2 id="${x}" class="title" part="title"><slot name="title">${n(r)}</slot></h2>`:""}
378
- ${v?`<p id="${A}" class="description" part="description"><slot name="description">${n(h)}</slot></p>`:""}
393
+ ${m?`<h2 id="${x}" class="title" part="title"><slot name="title">${a(r)}</slot></h2>`:""}
394
+ ${v?`<p id="${k}" class="description" part="description"><slot name="description">${a(h)}</slot></p>`:""}
379
395
  </header>
380
396
  `:"";this._destroyRuntimeControllers(),this.setContent(`
381
- ${this.hasAttribute("headless")?"":`<style>${R}</style>`}
382
- <div class="overlay" part="overlay" data-open="${String(this.open)}" ${this.open?"":"hidden"} aria-hidden="${this.open?"false":"true"}">
397
+ ${this.hasAttribute("headless")?"":`<style>${P}</style>`}
398
+ <div class="overlay" part="overlay" data-open="${String(this.open)}" data-state="${this.open?"open":"closed"}" ${this.open?"data-instant":"hidden"} aria-hidden="${this.open?"false":"true"}">
383
399
  <section
384
400
  class="panel"
385
401
  part="panel"
386
- role="${n(this.getAttribute("role")||"dialog")}"
402
+ role="${a(this.getAttribute("role")||"dialog")}"
387
403
  aria-modal="true"
388
- ${F?`aria-label="${n(F)}"`:""}
389
- ${y?`aria-labelledby="${n(y)}"`:""}
390
- ${u.length?`aria-describedby="${n(u.join(" "))}"`:""}
404
+ ${F?`aria-label="${a(F)}"`:""}
405
+ ${y?`aria-labelledby="${a(y)}"`:""}
406
+ ${u.length?`aria-describedby="${a(u.join(" "))}"`:""}
391
407
  aria-hidden="${this.open?"false":"true"}"
392
408
  tabindex="-1"
393
409
  >
394
- ${$?`<button class="close" part="close" aria-label="Close dialog" type="button" ${b?"disabled":""}>
410
+ ${T?`<button class="close" part="close" aria-label="Close dialog" type="button" ${b?"disabled":""}>
395
411
  <svg class="close-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" aria-hidden="true">
396
412
  <path d="M3.5 3.5L12.5 12.5"></path>
397
413
  <path d="M12.5 3.5L3.5 12.5"></path>
@@ -399,16 +415,16 @@
399
415
  </button>`:""}
400
416
  ${B}
401
417
  <div class="body" part="body">
402
- ${L?'<slot name="content"></slot>':"<slot></slot>"}
418
+ ${O?'<slot name="content"></slot>':"<slot></slot>"}
403
419
  </div>
404
420
 
405
- <div class="error" id="${k}" part="error" aria-live="polite" data-empty="${String(!_)}">${n(_)}</div>
421
+ <div class="error" id="${A}" part="error" aria-live="polite" data-empty="${String(!_)}">${a(_)}</div>
406
422
 
407
423
  <footer class="footer" part="footer">
408
- ${b?`<span class="loading" part="loading"><span class="spinner" aria-hidden="true"></span><span>${n(o)}</span></span>`:'<span aria-hidden="true"></span>'}
424
+ ${b?`<span class="loading" part="loading"><span class="spinner" aria-hidden="true"></span><span>${a(o)}</span></span>`:'<span aria-hidden="true"></span>'}
409
425
 
410
- ${O?'<slot name="footer"></slot>':`${q?`<button class="btn btn-cancel" part="cancel" type="button" ${b?"disabled":""}>${n(s)}</button>`:""}
411
- <button class="btn btn-submit" part="submit" type="button" ${b?"disabled":""}>${n(e)}</button>`}
426
+ ${q?'<slot name="footer"></slot>':`${$?`<button class="btn btn-cancel" part="cancel" type="button" ${b?"disabled":""}>${a(s)}</button>`:""}
427
+ <button class="btn btn-submit" part="submit" type="button" ${b?"disabled":""}>${a(e)}</button>`}
412
428
  </footer>
413
429
  </section>
414
430
  </div>