@nonoun/native-ui 0.1.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 (537) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +105 -0
  3. package/dist/a2ui/a2ui-adapter.d.ts +50 -0
  4. package/dist/a2ui/a2ui-adapter.d.ts.map +1 -0
  5. package/dist/a2ui/a2ui-component-map.d.ts +41 -0
  6. package/dist/a2ui/a2ui-component-map.d.ts.map +1 -0
  7. package/dist/a2ui/a2ui-converter.d.ts +34 -0
  8. package/dist/a2ui/a2ui-converter.d.ts.map +1 -0
  9. package/dist/a2ui/a2ui-surface.d.ts +33 -0
  10. package/dist/a2ui/a2ui-surface.d.ts.map +1 -0
  11. package/dist/a2ui/a2ui-transport.d.ts +80 -0
  12. package/dist/a2ui/a2ui-transport.d.ts.map +1 -0
  13. package/dist/a2ui/a2ui-types.d.ts +104 -0
  14. package/dist/a2ui/a2ui-types.d.ts.map +1 -0
  15. package/dist/a2ui/index.d.ts +13 -0
  16. package/dist/a2ui/index.d.ts.map +1 -0
  17. package/dist/components/ui-accordion/index.d.ts +4 -0
  18. package/dist/components/ui-accordion/index.d.ts.map +1 -0
  19. package/dist/components/ui-accordion/ui-accordion-element.d.ts +18 -0
  20. package/dist/components/ui-accordion/ui-accordion-element.d.ts.map +1 -0
  21. package/dist/components/ui-accordion/ui-accordion-item-element.d.ts +18 -0
  22. package/dist/components/ui-accordion/ui-accordion-item-element.d.ts.map +1 -0
  23. package/dist/components/ui-accordion/ui-accordion.d.ts +4 -0
  24. package/dist/components/ui-accordion/ui-accordion.d.ts.map +1 -0
  25. package/dist/components/ui-avatar/index.d.ts +3 -0
  26. package/dist/components/ui-avatar/index.d.ts.map +1 -0
  27. package/dist/components/ui-avatar/ui-avatar-element.d.ts +20 -0
  28. package/dist/components/ui-avatar/ui-avatar-element.d.ts.map +1 -0
  29. package/dist/components/ui-avatar/ui-avatar.d.ts +3 -0
  30. package/dist/components/ui-avatar/ui-avatar.d.ts.map +1 -0
  31. package/dist/components/ui-badge/index.d.ts +3 -0
  32. package/dist/components/ui-badge/index.d.ts.map +1 -0
  33. package/dist/components/ui-badge/ui-badge-element.d.ts +13 -0
  34. package/dist/components/ui-badge/ui-badge-element.d.ts.map +1 -0
  35. package/dist/components/ui-badge/ui-badge.d.ts +3 -0
  36. package/dist/components/ui-badge/ui-badge.d.ts.map +1 -0
  37. package/dist/components/ui-breadcrumb/index.d.ts +4 -0
  38. package/dist/components/ui-breadcrumb/index.d.ts.map +1 -0
  39. package/dist/components/ui-breadcrumb/ui-breadcrumb-element.d.ts +8 -0
  40. package/dist/components/ui-breadcrumb/ui-breadcrumb-element.d.ts.map +1 -0
  41. package/dist/components/ui-breadcrumb/ui-breadcrumb-item-element.d.ts +15 -0
  42. package/dist/components/ui-breadcrumb/ui-breadcrumb-item-element.d.ts.map +1 -0
  43. package/dist/components/ui-breadcrumb/ui-breadcrumb.d.ts +4 -0
  44. package/dist/components/ui-breadcrumb/ui-breadcrumb.d.ts.map +1 -0
  45. package/dist/components/ui-button/index.d.ts +3 -0
  46. package/dist/components/ui-button/index.d.ts.map +1 -0
  47. package/dist/components/ui-button/ui-button-element.d.ts +391 -0
  48. package/dist/components/ui-button/ui-button-element.d.ts.map +1 -0
  49. package/dist/components/ui-button/ui-button.d.ts +3 -0
  50. package/dist/components/ui-button/ui-button.d.ts.map +1 -0
  51. package/dist/components/ui-calendar/calendar-store.d.ts +61 -0
  52. package/dist/components/ui-calendar/calendar-store.d.ts.map +1 -0
  53. package/dist/components/ui-calendar/index.d.ts +5 -0
  54. package/dist/components/ui-calendar/index.d.ts.map +1 -0
  55. package/dist/components/ui-calendar/ui-calendar-element.d.ts +400 -0
  56. package/dist/components/ui-calendar/ui-calendar-element.d.ts.map +1 -0
  57. package/dist/components/ui-calendar/ui-calendar.d.ts +3 -0
  58. package/dist/components/ui-calendar/ui-calendar.d.ts.map +1 -0
  59. package/dist/components/ui-chat/index.d.ts +3 -0
  60. package/dist/components/ui-chat/index.d.ts.map +1 -0
  61. package/dist/components/ui-chat/ui-chat-input-element.d.ts +21 -0
  62. package/dist/components/ui-chat/ui-chat-input-element.d.ts.map +1 -0
  63. package/dist/components/ui-chat/ui-chat-input.d.ts +3 -0
  64. package/dist/components/ui-chat/ui-chat-input.d.ts.map +1 -0
  65. package/dist/components/ui-checkbox/index.d.ts +3 -0
  66. package/dist/components/ui-checkbox/index.d.ts.map +1 -0
  67. package/dist/components/ui-checkbox/ui-checkbox-element.d.ts +402 -0
  68. package/dist/components/ui-checkbox/ui-checkbox-element.d.ts.map +1 -0
  69. package/dist/components/ui-checkbox/ui-checkbox.d.ts +3 -0
  70. package/dist/components/ui-checkbox/ui-checkbox.d.ts.map +1 -0
  71. package/dist/components/ui-combobox/index.d.ts +4 -0
  72. package/dist/components/ui-combobox/index.d.ts.map +1 -0
  73. package/dist/components/ui-combobox/ui-combobox-element.d.ts +408 -0
  74. package/dist/components/ui-combobox/ui-combobox-element.d.ts.map +1 -0
  75. package/dist/components/ui-combobox/ui-combobox.d.ts +3 -0
  76. package/dist/components/ui-combobox/ui-combobox.d.ts.map +1 -0
  77. package/dist/components/ui-command/index.d.ts +13 -0
  78. package/dist/components/ui-command/index.d.ts.map +1 -0
  79. package/dist/components/ui-command/ui-command-element.d.ts +21 -0
  80. package/dist/components/ui-command/ui-command-element.d.ts.map +1 -0
  81. package/dist/components/ui-command/ui-command-empty-element.d.ts +5 -0
  82. package/dist/components/ui-command/ui-command-empty-element.d.ts.map +1 -0
  83. package/dist/components/ui-command/ui-command-empty.d.ts +3 -0
  84. package/dist/components/ui-command/ui-command-empty.d.ts.map +1 -0
  85. package/dist/components/ui-command/ui-command-group-element.d.ts +6 -0
  86. package/dist/components/ui-command/ui-command-group-element.d.ts.map +1 -0
  87. package/dist/components/ui-command/ui-command-group.d.ts +3 -0
  88. package/dist/components/ui-command/ui-command-group.d.ts.map +1 -0
  89. package/dist/components/ui-command/ui-command-input-element.d.ts +14 -0
  90. package/dist/components/ui-command/ui-command-input-element.d.ts.map +1 -0
  91. package/dist/components/ui-command/ui-command-input.d.ts +3 -0
  92. package/dist/components/ui-command/ui-command-input.d.ts.map +1 -0
  93. package/dist/components/ui-command/ui-command-item-element.d.ts +25 -0
  94. package/dist/components/ui-command/ui-command-item-element.d.ts.map +1 -0
  95. package/dist/components/ui-command/ui-command-item.d.ts +3 -0
  96. package/dist/components/ui-command/ui-command-item.d.ts.map +1 -0
  97. package/dist/components/ui-command/ui-command-list-element.d.ts +6 -0
  98. package/dist/components/ui-command/ui-command-list-element.d.ts.map +1 -0
  99. package/dist/components/ui-command/ui-command-list.d.ts +3 -0
  100. package/dist/components/ui-command/ui-command-list.d.ts.map +1 -0
  101. package/dist/components/ui-command/ui-command.d.ts +8 -0
  102. package/dist/components/ui-command/ui-command.d.ts.map +1 -0
  103. package/dist/components/ui-controller/index.d.ts +3 -0
  104. package/dist/components/ui-controller/index.d.ts.map +1 -0
  105. package/dist/components/ui-controller/ui-controller-element.d.ts +18 -0
  106. package/dist/components/ui-controller/ui-controller-element.d.ts.map +1 -0
  107. package/dist/components/ui-controller/ui-controller.d.ts +2 -0
  108. package/dist/components/ui-controller/ui-controller.d.ts.map +1 -0
  109. package/dist/components/ui-dialog/index.d.ts +3 -0
  110. package/dist/components/ui-dialog/index.d.ts.map +1 -0
  111. package/dist/components/ui-dialog/ui-dialog-element.d.ts +17 -0
  112. package/dist/components/ui-dialog/ui-dialog-element.d.ts.map +1 -0
  113. package/dist/components/ui-dialog/ui-dialog.d.ts +3 -0
  114. package/dist/components/ui-dialog/ui-dialog.d.ts.map +1 -0
  115. package/dist/components/ui-drawer/index.d.ts +3 -0
  116. package/dist/components/ui-drawer/index.d.ts.map +1 -0
  117. package/dist/components/ui-drawer/ui-drawer-element.d.ts +18 -0
  118. package/dist/components/ui-drawer/ui-drawer-element.d.ts.map +1 -0
  119. package/dist/components/ui-drawer/ui-drawer.d.ts +3 -0
  120. package/dist/components/ui-drawer/ui-drawer.d.ts.map +1 -0
  121. package/dist/components/ui-field/index.d.ts +3 -0
  122. package/dist/components/ui-field/index.d.ts.map +1 -0
  123. package/dist/components/ui-field/ui-field-element.d.ts +14 -0
  124. package/dist/components/ui-field/ui-field-element.d.ts.map +1 -0
  125. package/dist/components/ui-field/ui-field.d.ts +3 -0
  126. package/dist/components/ui-field/ui-field.d.ts.map +1 -0
  127. package/dist/components/ui-input/index.d.ts +3 -0
  128. package/dist/components/ui-input/index.d.ts.map +1 -0
  129. package/dist/components/ui-input/ui-input-element.d.ts +404 -0
  130. package/dist/components/ui-input/ui-input-element.d.ts.map +1 -0
  131. package/dist/components/ui-input/ui-input.d.ts +3 -0
  132. package/dist/components/ui-input/ui-input.d.ts.map +1 -0
  133. package/dist/components/ui-input-otp/index.d.ts +3 -0
  134. package/dist/components/ui-input-otp/index.d.ts.map +1 -0
  135. package/dist/components/ui-input-otp/ui-input-otp-element.d.ts +399 -0
  136. package/dist/components/ui-input-otp/ui-input-otp-element.d.ts.map +1 -0
  137. package/dist/components/ui-input-otp/ui-input-otp.d.ts +3 -0
  138. package/dist/components/ui-input-otp/ui-input-otp.d.ts.map +1 -0
  139. package/dist/components/ui-listbox/index.d.ts +9 -0
  140. package/dist/components/ui-listbox/index.d.ts.map +1 -0
  141. package/dist/components/ui-listbox/ui-listbox-element.d.ts +29 -0
  142. package/dist/components/ui-listbox/ui-listbox-element.d.ts.map +1 -0
  143. package/dist/components/ui-listbox/ui-listbox.d.ts +5 -0
  144. package/dist/components/ui-listbox/ui-listbox.d.ts.map +1 -0
  145. package/dist/components/ui-listbox/ui-option-element.d.ts +23 -0
  146. package/dist/components/ui-listbox/ui-option-element.d.ts.map +1 -0
  147. package/dist/components/ui-listbox/ui-option-group-element.d.ts +6 -0
  148. package/dist/components/ui-listbox/ui-option-group-element.d.ts.map +1 -0
  149. package/dist/components/ui-listbox/ui-option-group-header-element.d.ts +7 -0
  150. package/dist/components/ui-listbox/ui-option-group-header-element.d.ts.map +1 -0
  151. package/dist/components/ui-listbox/ui-option-group-header.d.ts +3 -0
  152. package/dist/components/ui-listbox/ui-option-group-header.d.ts.map +1 -0
  153. package/dist/components/ui-listbox/ui-option-group.d.ts +3 -0
  154. package/dist/components/ui-listbox/ui-option-group.d.ts.map +1 -0
  155. package/dist/components/ui-listbox/ui-option.d.ts +3 -0
  156. package/dist/components/ui-listbox/ui-option.d.ts.map +1 -0
  157. package/dist/components/ui-nav/index.d.ts +6 -0
  158. package/dist/components/ui-nav/index.d.ts.map +1 -0
  159. package/dist/components/ui-nav/ui-nav-element.d.ts +20 -0
  160. package/dist/components/ui-nav/ui-nav-element.d.ts.map +1 -0
  161. package/dist/components/ui-nav/ui-nav-group-element.d.ts +16 -0
  162. package/dist/components/ui-nav/ui-nav-group-element.d.ts.map +1 -0
  163. package/dist/components/ui-nav/ui-nav-group-header-element.d.ts +7 -0
  164. package/dist/components/ui-nav/ui-nav-group-header-element.d.ts.map +1 -0
  165. package/dist/components/ui-nav/ui-nav-item-element.d.ts +23 -0
  166. package/dist/components/ui-nav/ui-nav-item-element.d.ts.map +1 -0
  167. package/dist/components/ui-nav/ui-nav.d.ts +2 -0
  168. package/dist/components/ui-nav/ui-nav.d.ts.map +1 -0
  169. package/dist/components/ui-pagination/index.d.ts +3 -0
  170. package/dist/components/ui-pagination/index.d.ts.map +1 -0
  171. package/dist/components/ui-pagination/ui-pagination-element.d.ts +29 -0
  172. package/dist/components/ui-pagination/ui-pagination-element.d.ts.map +1 -0
  173. package/dist/components/ui-pagination/ui-pagination.d.ts +5 -0
  174. package/dist/components/ui-pagination/ui-pagination.d.ts.map +1 -0
  175. package/dist/components/ui-radio/index.d.ts +4 -0
  176. package/dist/components/ui-radio/index.d.ts.map +1 -0
  177. package/dist/components/ui-radio/ui-radio-element.d.ts +21 -0
  178. package/dist/components/ui-radio/ui-radio-element.d.ts.map +1 -0
  179. package/dist/components/ui-radio/ui-radio-group-element.d.ts +397 -0
  180. package/dist/components/ui-radio/ui-radio-group-element.d.ts.map +1 -0
  181. package/dist/components/ui-radio/ui-radio.d.ts +4 -0
  182. package/dist/components/ui-radio/ui-radio.d.ts.map +1 -0
  183. package/dist/components/ui-range/index.d.ts +3 -0
  184. package/dist/components/ui-range/index.d.ts.map +1 -0
  185. package/dist/components/ui-range/ui-range-element.d.ts +403 -0
  186. package/dist/components/ui-range/ui-range-element.d.ts.map +1 -0
  187. package/dist/components/ui-range/ui-range.d.ts +3 -0
  188. package/dist/components/ui-range/ui-range.d.ts.map +1 -0
  189. package/dist/components/ui-segmented-control/index.d.ts +4 -0
  190. package/dist/components/ui-segmented-control/index.d.ts.map +1 -0
  191. package/dist/components/ui-segmented-control/ui-segment-element.d.ts +21 -0
  192. package/dist/components/ui-segmented-control/ui-segment-element.d.ts.map +1 -0
  193. package/dist/components/ui-segmented-control/ui-segmented-control-element.d.ts +395 -0
  194. package/dist/components/ui-segmented-control/ui-segmented-control-element.d.ts.map +1 -0
  195. package/dist/components/ui-segmented-control/ui-segmented-control.d.ts +4 -0
  196. package/dist/components/ui-segmented-control/ui-segmented-control.d.ts.map +1 -0
  197. package/dist/components/ui-select/index.d.ts +4 -0
  198. package/dist/components/ui-select/index.d.ts.map +1 -0
  199. package/dist/components/ui-select/select-controller.d.ts +12 -0
  200. package/dist/components/ui-select/select-controller.d.ts.map +1 -0
  201. package/dist/components/ui-select/ui-select-element.d.ts +408 -0
  202. package/dist/components/ui-select/ui-select-element.d.ts.map +1 -0
  203. package/dist/components/ui-select/ui-select.d.ts +4 -0
  204. package/dist/components/ui-select/ui-select.d.ts.map +1 -0
  205. package/dist/components/ui-slideshow/index.d.ts +4 -0
  206. package/dist/components/ui-slideshow/index.d.ts.map +1 -0
  207. package/dist/components/ui-slideshow/ui-slide-element.d.ts +6 -0
  208. package/dist/components/ui-slideshow/ui-slide-element.d.ts.map +1 -0
  209. package/dist/components/ui-slideshow/ui-slideshow-element.d.ts +28 -0
  210. package/dist/components/ui-slideshow/ui-slideshow-element.d.ts.map +1 -0
  211. package/dist/components/ui-slideshow/ui-slideshow.d.ts +4 -0
  212. package/dist/components/ui-slideshow/ui-slideshow.d.ts.map +1 -0
  213. package/dist/components/ui-switch/index.d.ts +3 -0
  214. package/dist/components/ui-switch/index.d.ts.map +1 -0
  215. package/dist/components/ui-switch/ui-switch-element.d.ts +396 -0
  216. package/dist/components/ui-switch/ui-switch-element.d.ts.map +1 -0
  217. package/dist/components/ui-switch/ui-switch.d.ts +3 -0
  218. package/dist/components/ui-switch/ui-switch.d.ts.map +1 -0
  219. package/dist/components/ui-table/column-resize-controller.d.ts +13 -0
  220. package/dist/components/ui-table/column-resize-controller.d.ts.map +1 -0
  221. package/dist/components/ui-table/index.d.ts +12 -0
  222. package/dist/components/ui-table/index.d.ts.map +1 -0
  223. package/dist/components/ui-table/table-drag-controller.d.ts +12 -0
  224. package/dist/components/ui-table/table-drag-controller.d.ts.map +1 -0
  225. package/dist/components/ui-table/table-store.d.ts +24 -0
  226. package/dist/components/ui-table/table-store.d.ts.map +1 -0
  227. package/dist/components/ui-table/ui-table-body-element.d.ts +7 -0
  228. package/dist/components/ui-table/ui-table-body-element.d.ts.map +1 -0
  229. package/dist/components/ui-table/ui-table-cell-element.d.ts +7 -0
  230. package/dist/components/ui-table/ui-table-cell-element.d.ts.map +1 -0
  231. package/dist/components/ui-table/ui-table-element.d.ts +22 -0
  232. package/dist/components/ui-table/ui-table-element.d.ts.map +1 -0
  233. package/dist/components/ui-table/ui-table-head-element.d.ts +7 -0
  234. package/dist/components/ui-table/ui-table-head-element.d.ts.map +1 -0
  235. package/dist/components/ui-table/ui-table-header-element.d.ts +19 -0
  236. package/dist/components/ui-table/ui-table-header-element.d.ts.map +1 -0
  237. package/dist/components/ui-table/ui-table-row-element.d.ts +18 -0
  238. package/dist/components/ui-table/ui-table-row-element.d.ts.map +1 -0
  239. package/dist/components/ui-table/ui-table.d.ts +8 -0
  240. package/dist/components/ui-table/ui-table.d.ts.map +1 -0
  241. package/dist/components/ui-tabs/index.d.ts +6 -0
  242. package/dist/components/ui-tabs/index.d.ts.map +1 -0
  243. package/dist/components/ui-tabs/ui-tab-element.d.ts +21 -0
  244. package/dist/components/ui-tabs/ui-tab-element.d.ts.map +1 -0
  245. package/dist/components/ui-tabs/ui-tab-panel-element.d.ts +14 -0
  246. package/dist/components/ui-tabs/ui-tab-panel-element.d.ts.map +1 -0
  247. package/dist/components/ui-tabs/ui-tab-panels-element.d.ts +7 -0
  248. package/dist/components/ui-tabs/ui-tab-panels-element.d.ts.map +1 -0
  249. package/dist/components/ui-tabs/ui-tabs-element.d.ts +21 -0
  250. package/dist/components/ui-tabs/ui-tabs-element.d.ts.map +1 -0
  251. package/dist/components/ui-tabs/ui-tabs.d.ts +6 -0
  252. package/dist/components/ui-tabs/ui-tabs.d.ts.map +1 -0
  253. package/dist/components/ui-textarea/index.d.ts +3 -0
  254. package/dist/components/ui-textarea/index.d.ts.map +1 -0
  255. package/dist/components/ui-textarea/ui-textarea-element.d.ts +406 -0
  256. package/dist/components/ui-textarea/ui-textarea-element.d.ts.map +1 -0
  257. package/dist/components/ui-textarea/ui-textarea.d.ts +3 -0
  258. package/dist/components/ui-textarea/ui-textarea.d.ts.map +1 -0
  259. package/dist/components/ui-tooltip/index.d.ts +3 -0
  260. package/dist/components/ui-tooltip/index.d.ts.map +1 -0
  261. package/dist/components/ui-tooltip/ui-tooltip-element.d.ts +22 -0
  262. package/dist/components/ui-tooltip/ui-tooltip-element.d.ts.map +1 -0
  263. package/dist/components/ui-tooltip/ui-tooltip.d.ts +3 -0
  264. package/dist/components/ui-tooltip/ui-tooltip.d.ts.map +1 -0
  265. package/dist/components/ui-tree/index.d.ts +4 -0
  266. package/dist/components/ui-tree/index.d.ts.map +1 -0
  267. package/dist/components/ui-tree/ui-tree-element.d.ts +16 -0
  268. package/dist/components/ui-tree/ui-tree-element.d.ts.map +1 -0
  269. package/dist/components/ui-tree/ui-tree-item-element.d.ts +18 -0
  270. package/dist/components/ui-tree/ui-tree-item-element.d.ts.map +1 -0
  271. package/dist/components/ui-tree/ui-tree.d.ts +5 -0
  272. package/dist/components/ui-tree/ui-tree.d.ts.map +1 -0
  273. package/dist/components-lean.css +5107 -0
  274. package/dist/components.css +5183 -0
  275. package/dist/containers/ui-card/index.d.ts +3 -0
  276. package/dist/containers/ui-card/index.d.ts.map +1 -0
  277. package/dist/containers/ui-card/ui-card-element.d.ts +13 -0
  278. package/dist/containers/ui-card/ui-card-element.d.ts.map +1 -0
  279. package/dist/containers/ui-card/ui-card.d.ts +3 -0
  280. package/dist/containers/ui-card/ui-card.d.ts.map +1 -0
  281. package/dist/containers/ui-layout-chat/index.d.ts +3 -0
  282. package/dist/containers/ui-layout-chat/index.d.ts.map +1 -0
  283. package/dist/containers/ui-layout-chat/ui-layout-chat-element.d.ts +14 -0
  284. package/dist/containers/ui-layout-chat/ui-layout-chat-element.d.ts.map +1 -0
  285. package/dist/containers/ui-layout-chat/ui-layout-chat.d.ts +3 -0
  286. package/dist/containers/ui-layout-chat/ui-layout-chat.d.ts.map +1 -0
  287. package/dist/containers/ui-layout-inspector/index.d.ts +3 -0
  288. package/dist/containers/ui-layout-inspector/index.d.ts.map +1 -0
  289. package/dist/containers/ui-layout-inspector/ui-layout-inspector-element.d.ts +14 -0
  290. package/dist/containers/ui-layout-inspector/ui-layout-inspector-element.d.ts.map +1 -0
  291. package/dist/containers/ui-layout-inspector/ui-layout-inspector.d.ts +3 -0
  292. package/dist/containers/ui-layout-inspector/ui-layout-inspector.d.ts.map +1 -0
  293. package/dist/containers/ui-layout-sidebar/index.d.ts +4 -0
  294. package/dist/containers/ui-layout-sidebar/index.d.ts.map +1 -0
  295. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-element.d.ts +8 -0
  296. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-element.d.ts.map +1 -0
  297. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-trigger-element.d.ts +8 -0
  298. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-trigger-element.d.ts.map +1 -0
  299. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-trigger.d.ts +3 -0
  300. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar-trigger.d.ts.map +1 -0
  301. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar.d.ts +4 -0
  302. package/dist/containers/ui-layout-sidebar/ui-layout-sidebar.d.ts.map +1 -0
  303. package/dist/containers/ui-section/index.d.ts +3 -0
  304. package/dist/containers/ui-section/index.d.ts.map +1 -0
  305. package/dist/containers/ui-section/ui-section-element.d.ts +14 -0
  306. package/dist/containers/ui-section/ui-section-element.d.ts.map +1 -0
  307. package/dist/containers/ui-section/ui-section.d.ts +3 -0
  308. package/dist/containers/ui-section/ui-section.d.ts.map +1 -0
  309. package/dist/containers/ui-toolbar/index.d.ts +3 -0
  310. package/dist/containers/ui-toolbar/index.d.ts.map +1 -0
  311. package/dist/containers/ui-toolbar/ui-toolbar-element.d.ts +9 -0
  312. package/dist/containers/ui-toolbar/ui-toolbar-element.d.ts.map +1 -0
  313. package/dist/containers/ui-toolbar/ui-toolbar.d.ts +3 -0
  314. package/dist/containers/ui-toolbar/ui-toolbar.d.ts.map +1 -0
  315. package/dist/core/context.d.ts +731 -0
  316. package/dist/core/context.d.ts.map +1 -0
  317. package/dist/core/data-list.d.ts +42 -0
  318. package/dist/core/data-list.d.ts.map +1 -0
  319. package/dist/core/data-options.d.ts +18 -0
  320. package/dist/core/data-options.d.ts.map +1 -0
  321. package/dist/core/define.d.ts +2 -0
  322. package/dist/core/define.d.ts.map +1 -0
  323. package/dist/core/effects.d.ts +5 -0
  324. package/dist/core/effects.d.ts.map +1 -0
  325. package/dist/core/form-associable.d.ts +391 -0
  326. package/dist/core/form-associable.d.ts.map +1 -0
  327. package/dist/core/gesture-router.d.ts +36 -0
  328. package/dist/core/gesture-router.d.ts.map +1 -0
  329. package/dist/core/index.d.ts +21 -0
  330. package/dist/core/index.d.ts.map +1 -0
  331. package/dist/core/reactive-prop.d.ts +62 -0
  332. package/dist/core/reactive-prop.d.ts.map +1 -0
  333. package/dist/core/trait-options.d.ts +18 -0
  334. package/dist/core/trait-options.d.ts.map +1 -0
  335. package/dist/core/trait-registry.d.ts +11 -0
  336. package/dist/core/trait-registry.d.ts.map +1 -0
  337. package/dist/core/trait-runtime.d.ts +37 -0
  338. package/dist/core/trait-runtime.d.ts.map +1 -0
  339. package/dist/core/types.d.ts +9 -0
  340. package/dist/core/types.d.ts.map +1 -0
  341. package/dist/core/ui-element.d.ts +17 -0
  342. package/dist/core/ui-element.d.ts.map +1 -0
  343. package/dist/core/uid.d.ts +2 -0
  344. package/dist/core/uid.d.ts.map +1 -0
  345. package/dist/custom-elements.json +21202 -0
  346. package/dist/dialog-controller.js +754 -0
  347. package/dist/events.d.ts +168 -0
  348. package/dist/events.d.ts.map +1 -0
  349. package/dist/foundation.css +2003 -0
  350. package/dist/icons/icons.d.ts +30 -0
  351. package/dist/icons/icons.d.ts.map +1 -0
  352. package/dist/icons/index.d.ts +4 -0
  353. package/dist/icons/index.d.ts.map +1 -0
  354. package/dist/icons/registry.d.ts +4 -0
  355. package/dist/icons/registry.d.ts.map +1 -0
  356. package/dist/icons/ui-icon-element.d.ts +15 -0
  357. package/dist/icons/ui-icon-element.d.ts.map +1 -0
  358. package/dist/icons/ui-icon.d.ts +3 -0
  359. package/dist/icons/ui-icon.d.ts.map +1 -0
  360. package/dist/index.d.ts +102 -0
  361. package/dist/index.d.ts.map +1 -0
  362. package/dist/kernel/accessibility.d.ts +15 -0
  363. package/dist/kernel/accessibility.d.ts.map +1 -0
  364. package/dist/kernel/command-bus.d.ts +13 -0
  365. package/dist/kernel/command-bus.d.ts.map +1 -0
  366. package/dist/kernel/command-history.d.ts +18 -0
  367. package/dist/kernel/command-history.d.ts.map +1 -0
  368. package/dist/kernel/components.d.ts +26 -0
  369. package/dist/kernel/components.d.ts.map +1 -0
  370. package/dist/kernel/data-binding.d.ts +33 -0
  371. package/dist/kernel/data-binding.d.ts.map +1 -0
  372. package/dist/kernel/data-runtime.d.ts +43 -0
  373. package/dist/kernel/data-runtime.d.ts.map +1 -0
  374. package/dist/kernel/executor.d.ts +16 -0
  375. package/dist/kernel/executor.d.ts.map +1 -0
  376. package/dist/kernel/focus-router.d.ts +13 -0
  377. package/dist/kernel/focus-router.d.ts.map +1 -0
  378. package/dist/kernel/index.d.ts +32 -0
  379. package/dist/kernel/index.d.ts.map +1 -0
  380. package/dist/kernel/kernel.d.ts +44 -0
  381. package/dist/kernel/kernel.d.ts.map +1 -0
  382. package/dist/kernel/observability.d.ts +58 -0
  383. package/dist/kernel/observability.d.ts.map +1 -0
  384. package/dist/kernel/overlay-manager.d.ts +21 -0
  385. package/dist/kernel/overlay-manager.d.ts.map +1 -0
  386. package/dist/kernel/patch.d.ts +59 -0
  387. package/dist/kernel/patch.d.ts.map +1 -0
  388. package/dist/kernel/planner.d.ts +151 -0
  389. package/dist/kernel/planner.d.ts.map +1 -0
  390. package/dist/kernel/policy.d.ts +58 -0
  391. package/dist/kernel/policy.d.ts.map +1 -0
  392. package/dist/kernel/schema-catalog.d.ts +54 -0
  393. package/dist/kernel/schema-catalog.d.ts.map +1 -0
  394. package/dist/kernel/schema.d.ts +6 -0
  395. package/dist/kernel/schema.d.ts.map +1 -0
  396. package/dist/kernel/types.d.ts +81 -0
  397. package/dist/kernel/types.d.ts.map +1 -0
  398. package/dist/kernel/workflow-templates.d.ts +22 -0
  399. package/dist/kernel/workflow-templates.d.ts.map +1 -0
  400. package/dist/kernel/workflow.d.ts +70 -0
  401. package/dist/kernel/workflow.d.ts.map +1 -0
  402. package/dist/kernel.d.ts +27 -0
  403. package/dist/kernel.d.ts.map +1 -0
  404. package/dist/kernel.js +4137 -0
  405. package/dist/native-ui-lean.css +7111 -0
  406. package/dist/native-ui.css +7187 -0
  407. package/dist/native-ui.js +75 -0
  408. package/dist/reactivity/batch.d.ts +2 -0
  409. package/dist/reactivity/batch.d.ts.map +1 -0
  410. package/dist/reactivity/computed.d.ts +3 -0
  411. package/dist/reactivity/computed.d.ts.map +1 -0
  412. package/dist/reactivity/debug.d.ts +5 -0
  413. package/dist/reactivity/debug.d.ts.map +1 -0
  414. package/dist/reactivity/effect.d.ts +3 -0
  415. package/dist/reactivity/effect.d.ts.map +1 -0
  416. package/dist/reactivity/graph.d.ts +35 -0
  417. package/dist/reactivity/graph.d.ts.map +1 -0
  418. package/dist/reactivity/index.d.ts +8 -0
  419. package/dist/reactivity/index.d.ts.map +1 -0
  420. package/dist/reactivity/signal.d.ts +3 -0
  421. package/dist/reactivity/signal.d.ts.map +1 -0
  422. package/dist/reactivity/types.d.ts +18 -0
  423. package/dist/reactivity/types.d.ts.map +1 -0
  424. package/dist/reactivity/untrack.d.ts +2 -0
  425. package/dist/reactivity/untrack.d.ts.map +1 -0
  426. package/dist/register-all.d.ts +11 -0
  427. package/dist/register-all.d.ts.map +1 -0
  428. package/dist/register-all.js +3 -0
  429. package/dist/register-all2.js +1244 -0
  430. package/dist/traits/adapters/clippable-adapter.d.ts +4 -0
  431. package/dist/traits/adapters/clippable-adapter.d.ts.map +1 -0
  432. package/dist/traits/adapters/collapsible-adapter.d.ts +4 -0
  433. package/dist/traits/adapters/collapsible-adapter.d.ts.map +1 -0
  434. package/dist/traits/adapters/copyable-adapter.d.ts +4 -0
  435. package/dist/traits/adapters/copyable-adapter.d.ts.map +1 -0
  436. package/dist/traits/adapters/dialogable-adapter.d.ts +4 -0
  437. package/dist/traits/adapters/dialogable-adapter.d.ts.map +1 -0
  438. package/dist/traits/adapters/dismissable-adapter.d.ts +4 -0
  439. package/dist/traits/adapters/dismissable-adapter.d.ts.map +1 -0
  440. package/dist/traits/adapters/draggable-adapter.d.ts +4 -0
  441. package/dist/traits/adapters/draggable-adapter.d.ts.map +1 -0
  442. package/dist/traits/adapters/droppable-adapter.d.ts +4 -0
  443. package/dist/traits/adapters/droppable-adapter.d.ts.map +1 -0
  444. package/dist/traits/adapters/editable-adapter.d.ts +4 -0
  445. package/dist/traits/adapters/editable-adapter.d.ts.map +1 -0
  446. package/dist/traits/adapters/focus-trappable-adapter.d.ts +4 -0
  447. package/dist/traits/adapters/focus-trappable-adapter.d.ts.map +1 -0
  448. package/dist/traits/adapters/hoverable-adapter.d.ts +4 -0
  449. package/dist/traits/adapters/hoverable-adapter.d.ts.map +1 -0
  450. package/dist/traits/adapters/index.d.ts +25 -0
  451. package/dist/traits/adapters/index.d.ts.map +1 -0
  452. package/dist/traits/adapters/intersectable-adapter.d.ts +4 -0
  453. package/dist/traits/adapters/intersectable-adapter.d.ts.map +1 -0
  454. package/dist/traits/adapters/list-navigable-adapter.d.ts +4 -0
  455. package/dist/traits/adapters/list-navigable-adapter.d.ts.map +1 -0
  456. package/dist/traits/adapters/popoverable-adapter.d.ts +4 -0
  457. package/dist/traits/adapters/popoverable-adapter.d.ts.map +1 -0
  458. package/dist/traits/adapters/pressable-adapter.d.ts +4 -0
  459. package/dist/traits/adapters/pressable-adapter.d.ts.map +1 -0
  460. package/dist/traits/adapters/range-selectable-adapter.d.ts +4 -0
  461. package/dist/traits/adapters/range-selectable-adapter.d.ts.map +1 -0
  462. package/dist/traits/adapters/resizable-adapter.d.ts +4 -0
  463. package/dist/traits/adapters/resizable-adapter.d.ts.map +1 -0
  464. package/dist/traits/adapters/roving-focusable-adapter.d.ts +4 -0
  465. package/dist/traits/adapters/roving-focusable-adapter.d.ts.map +1 -0
  466. package/dist/traits/adapters/searchable-adapter.d.ts +4 -0
  467. package/dist/traits/adapters/searchable-adapter.d.ts.map +1 -0
  468. package/dist/traits/adapters/selectable-adapter.d.ts +4 -0
  469. package/dist/traits/adapters/selectable-adapter.d.ts.map +1 -0
  470. package/dist/traits/adapters/sortable-adapter.d.ts +4 -0
  471. package/dist/traits/adapters/sortable-adapter.d.ts.map +1 -0
  472. package/dist/traits/adapters/swipeable-adapter.d.ts +4 -0
  473. package/dist/traits/adapters/swipeable-adapter.d.ts.map +1 -0
  474. package/dist/traits/adapters/toastable-adapter.d.ts +4 -0
  475. package/dist/traits/adapters/toastable-adapter.d.ts.map +1 -0
  476. package/dist/traits/adapters/validatable-adapter.d.ts +4 -0
  477. package/dist/traits/adapters/validatable-adapter.d.ts.map +1 -0
  478. package/dist/traits/adapters/virtualizable-adapter.d.ts +4 -0
  479. package/dist/traits/adapters/virtualizable-adapter.d.ts.map +1 -0
  480. package/dist/traits/clipboard-controller.d.ts +24 -0
  481. package/dist/traits/clipboard-controller.d.ts.map +1 -0
  482. package/dist/traits/collapsible-controller.d.ts +17 -0
  483. package/dist/traits/collapsible-controller.d.ts.map +1 -0
  484. package/dist/traits/copy-controller.d.ts +15 -0
  485. package/dist/traits/copy-controller.d.ts.map +1 -0
  486. package/dist/traits/dialog-controller.d.ts +14 -0
  487. package/dist/traits/dialog-controller.d.ts.map +1 -0
  488. package/dist/traits/dismiss-controller.d.ts +10 -0
  489. package/dist/traits/dismiss-controller.d.ts.map +1 -0
  490. package/dist/traits/drag-controller.d.ts +22 -0
  491. package/dist/traits/drag-controller.d.ts.map +1 -0
  492. package/dist/traits/drop-zone-controller.d.ts +18 -0
  493. package/dist/traits/drop-zone-controller.d.ts.map +1 -0
  494. package/dist/traits/edit-controller.d.ts +22 -0
  495. package/dist/traits/edit-controller.d.ts.map +1 -0
  496. package/dist/traits/focus-trap-controller.d.ts +10 -0
  497. package/dist/traits/focus-trap-controller.d.ts.map +1 -0
  498. package/dist/traits/hover-controller.d.ts +18 -0
  499. package/dist/traits/hover-controller.d.ts.map +1 -0
  500. package/dist/traits/index.d.ts +71 -0
  501. package/dist/traits/index.d.ts.map +1 -0
  502. package/dist/traits/intersect-controller.d.ts +22 -0
  503. package/dist/traits/intersect-controller.d.ts.map +1 -0
  504. package/dist/traits/list-navigate-controller.d.ts +36 -0
  505. package/dist/traits/list-navigate-controller.d.ts.map +1 -0
  506. package/dist/traits/popover-controller.d.ts +10 -0
  507. package/dist/traits/popover-controller.d.ts.map +1 -0
  508. package/dist/traits/press-controller.d.ts +14 -0
  509. package/dist/traits/press-controller.d.ts.map +1 -0
  510. package/dist/traits/range-select-controller.d.ts +19 -0
  511. package/dist/traits/range-select-controller.d.ts.map +1 -0
  512. package/dist/traits/register-all.d.ts +6 -0
  513. package/dist/traits/register-all.d.ts.map +1 -0
  514. package/dist/traits/resize-controller.d.ts +25 -0
  515. package/dist/traits/resize-controller.d.ts.map +1 -0
  516. package/dist/traits/roving-focus-controller.d.ts +20 -0
  517. package/dist/traits/roving-focus-controller.d.ts.map +1 -0
  518. package/dist/traits/search-controller.d.ts +26 -0
  519. package/dist/traits/search-controller.d.ts.map +1 -0
  520. package/dist/traits/selection-controller.d.ts +28 -0
  521. package/dist/traits/selection-controller.d.ts.map +1 -0
  522. package/dist/traits/sort-controller.d.ts +19 -0
  523. package/dist/traits/sort-controller.d.ts.map +1 -0
  524. package/dist/traits/swipe-controller.d.ts +24 -0
  525. package/dist/traits/swipe-controller.d.ts.map +1 -0
  526. package/dist/traits/toast-controller.d.ts +12 -0
  527. package/dist/traits/toast-controller.d.ts.map +1 -0
  528. package/dist/traits/validate-controller.d.ts +24 -0
  529. package/dist/traits/validate-controller.d.ts.map +1 -0
  530. package/dist/traits/virtual-scroll-controller.d.ts +19 -0
  531. package/dist/traits/virtual-scroll-controller.d.ts.map +1 -0
  532. package/dist/traits-entry.d.ts +15 -0
  533. package/dist/traits-entry.d.ts.map +1 -0
  534. package/dist/traits.js +4 -0
  535. package/dist/ui-icon-element.js +4405 -0
  536. package/dist/uid.js +147 -0
  537. package/package.json +86 -0
@@ -0,0 +1,4405 @@
1
+ import { a as e, o as t, r as n, t as r } from "./uid.js";
2
+ import { _ as i, a, c as o, h as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m } from "./dialog-controller.js";
3
+ function h(e, t, n, r) {
4
+ let i;
5
+ return () => {
6
+ let n = t.value;
7
+ e.toggleAttribute("disabled", n), n ? e.setAttribute("aria-disabled", "true") : e.removeAttribute("aria-disabled"), r?.manageTabindex && e.setAttribute("tabindex", n ? "-1" : "0"), i !== void 0 && i !== n && e.dispatchEvent(new CustomEvent("ui-disabled", {
8
+ bubbles: !0,
9
+ composed: !0,
10
+ detail: { disabled: n }
11
+ })), i = n;
12
+ };
13
+ }
14
+ function g(e, n, r) {
15
+ let i = r.attribute ?? n;
16
+ if (r.type === "boolean") {
17
+ let n = t(!1);
18
+ return {
19
+ get signal() {
20
+ return n;
21
+ },
22
+ get value() {
23
+ return n.value;
24
+ },
25
+ set(t) {
26
+ n.value = t, e.toggleAttribute(i, t);
27
+ },
28
+ fromAttribute(e) {
29
+ n.value = e !== null;
30
+ }
31
+ };
32
+ }
33
+ if (r.type === "number") {
34
+ let n = r.initial ?? 0, a = t(n);
35
+ return {
36
+ get signal() {
37
+ return a;
38
+ },
39
+ get value() {
40
+ return a.value;
41
+ },
42
+ set(t) {
43
+ a.value = t, e.setAttribute(i, String(t));
44
+ },
45
+ fromAttribute(e) {
46
+ a.value = parseFloat(e ?? String(n)) || n;
47
+ }
48
+ };
49
+ }
50
+ let a = r.initial ?? "", o = t(a);
51
+ return {
52
+ get signal() {
53
+ return o;
54
+ },
55
+ get value() {
56
+ return o.value;
57
+ },
58
+ set(t) {
59
+ o.value = t, t ? e.getAttribute(i) !== t && e.setAttribute(i, t) : e.removeAttribute(i);
60
+ },
61
+ fromAttribute(e) {
62
+ o.value = e ?? a;
63
+ }
64
+ };
65
+ }
66
+ /**
67
+ * Dispatches an attribute change to the matching reactive prop.
68
+ * Returns true if handled, false if no matching prop was found.
69
+ *
70
+ * ```ts
71
+ * attributeChangedCallback(name, old, val) {
72
+ * if (old === val) return;
73
+ * if (syncProp(this.#props, name, val)) return;
74
+ * // handle non-prop attributes...
75
+ * super.attributeChangedCallback?.(name, old, val);
76
+ * }
77
+ * ```
78
+ */
79
+ function _(e, t, n) {
80
+ let r = e[t];
81
+ return r ? (r.fromAttribute(n), !0) : !1;
82
+ }
83
+ /**
84
+ * Mixin that provides the common form-association boilerplate:
85
+ *
86
+ * - `static formAssociated = true`
87
+ * - `formDisabledCallback` → calls `onFormDisabled(disabled)`
88
+ * - `formResetCallback` → calls `onFormReset()`
89
+ *
90
+ * Subclasses override `onFormDisabled` and `onFormReset` with their own logic.
91
+ *
92
+ * Must remain a mixin (not a controller) because the Web Components spec
93
+ * requires `static formAssociated = true` on the class constructor.
94
+ *
95
+ * ```ts
96
+ * class UIInput extends FormAssociable(UIElement) {
97
+ * onFormDisabled(disabled: boolean) { this.#disabled.value = disabled; }
98
+ * onFormReset() { this.textContent = ''; }
99
+ * }
100
+ * ```
101
+ */
102
+ function v(e) {
103
+ return class extends e {
104
+ static formAssociated = !0;
105
+ /** Override to handle form-initiated disabled state changes. */
106
+ onFormDisabled(e) {}
107
+ /** Override to handle form reset. */
108
+ onFormReset() {}
109
+ /** Override to handle form state restore (e.g. back/forward navigation). */
110
+ onFormStateRestore(e) {}
111
+ formDisabledCallback(e) {
112
+ this.onFormDisabled(e);
113
+ }
114
+ formResetCallback() {
115
+ this.onFormReset();
116
+ }
117
+ formStateRestoreCallback(e, t) {
118
+ this.onFormStateRestore(e);
119
+ }
120
+ formAssociatedCallback(e) {}
121
+ };
122
+ }
123
+ function y(e, t) {
124
+ return e.label.toLowerCase().includes(t.toLowerCase());
125
+ }
126
+ var b = class {
127
+ data;
128
+ query;
129
+ #e;
130
+ #t;
131
+ filtered;
132
+ sorted;
133
+ activeIndex;
134
+ activeItem;
135
+ value;
136
+ selected;
137
+ #n;
138
+ selectedItem;
139
+ empty;
140
+ constructor(n = {}) {
141
+ this.data = t([]), this.query = t(""), this.#e = t(n.filterFn ?? y), this.#t = t(n.sortFn ?? null), this.#n = t(n.multiple ?? !1), this.activeIndex = t(n.initialActiveIndex ?? -1), this.value = t(null), this.selected = t(/* @__PURE__ */ new Set()), this.filtered = e(() => {
142
+ let e = this.data.value, t = this.query.value, n = this.#e.value;
143
+ return t ? e.filter((e) => n(e, t)) : e;
144
+ }), this.sorted = e(() => {
145
+ let e = this.filtered.value, t = this.#t.value;
146
+ return t ? [...e].sort(t) : e;
147
+ }), this.activeItem = e(() => {
148
+ let e = this.view.value, t = this.activeIndex.value;
149
+ return t >= 0 && t < e.length ? e[t] : null;
150
+ }), this.selectedItem = e(() => {
151
+ let e = this.value.value;
152
+ return e === null ? null : this.data.value.find((t) => t.value === e) ?? null;
153
+ }), this.empty = e(() => this.view.value.length === 0);
154
+ }
155
+ get view() {
156
+ return this.sorted;
157
+ }
158
+ get multiple() {
159
+ return this.#n.value;
160
+ }
161
+ set multiple(e) {
162
+ this.#n.value = e;
163
+ }
164
+ setQuery(e, t) {
165
+ n(() => {
166
+ this.query.value = e, this.activeIndex.value = t ?? -1;
167
+ });
168
+ }
169
+ moveActive(e, t) {
170
+ let n = t ?? this.view.value.length;
171
+ if (n === 0) return;
172
+ let r = this.activeIndex.value;
173
+ if (t == null) {
174
+ let t = this.view.value, i = (r + e + n) % n, a = 0;
175
+ for (; t[i]?.disabled && a < n;) i = (i + e + n) % n, a++;
176
+ this.activeIndex.value = i;
177
+ return;
178
+ }
179
+ this.activeIndex.value = (r + e + n) % n;
180
+ }
181
+ selectActive() {
182
+ let e = this.activeItem.value;
183
+ e && this.select(e.value);
184
+ }
185
+ select(e) {
186
+ if (this.#n.value) {
187
+ let t = new Set(this.selected.value);
188
+ t.add(e), n(() => {
189
+ this.selected.value = t, this.value.value = e;
190
+ });
191
+ } else this.value.value = e;
192
+ }
193
+ deselect(e) {
194
+ if (!this.#n.value) return;
195
+ let t = new Set(this.selected.value);
196
+ t.delete(e), n(() => {
197
+ this.selected.value = t, this.value.value === e && (this.value.value = null);
198
+ });
199
+ }
200
+ toggle(e) {
201
+ this.#n.value && this.selected.value.has(e) ? this.deselect(e) : this.select(e);
202
+ }
203
+ selectAll() {
204
+ if (!this.#n.value) return;
205
+ let e = this.view.value;
206
+ this.selected.value = new Set(e.map((e) => e.value));
207
+ }
208
+ clearSelection() {
209
+ n(() => {
210
+ this.value.value = null, this.selected.value = /* @__PURE__ */ new Set();
211
+ });
212
+ }
213
+ reset() {
214
+ n(() => {
215
+ this.data.value = [], this.query.value = "", this.activeIndex.value = -1, this.value.value = null, this.selected.value = /* @__PURE__ */ new Set();
216
+ });
217
+ }
218
+ setFilter(e) {
219
+ this.#e.value = e;
220
+ }
221
+ setSort(e) {
222
+ this.#t.value = e;
223
+ }
224
+ };
225
+ function x(e) {
226
+ return new b(e);
227
+ }
228
+ /**
229
+ * Validates a JSON string → typed option array.
230
+ * Filters out entries missing `value` or `label` strings.
231
+ */
232
+ function S(e, t) {
233
+ try {
234
+ let t = JSON.parse(e);
235
+ return Array.isArray(t) ? t.filter((e) => typeof e == "object" && !!e && typeof e.value == "string" && typeof e.label == "string") : [];
236
+ } catch {
237
+ return console.warn(`<${t}>: invalid options JSON`, e), [];
238
+ }
239
+ }
240
+ /**
241
+ * Fetches remote options with abort-guard and stale-response protection.
242
+ * Aborts any in-flight request before starting a new one.
243
+ * Returns the new AbortController for the caller to store.
244
+ */
245
+ async function C(e, t, n, r) {
246
+ t?.abort();
247
+ let i = new AbortController();
248
+ try {
249
+ let t = await fetch(e, { signal: i.signal });
250
+ if (!t.ok) return console.warn(`<${r}>: fetch failed (${t.status}) for ${e}`), i;
251
+ let a = await t.json();
252
+ if (i.signal.aborted) return i;
253
+ n.value = (Array.isArray(a) ? a : []).filter((e) => typeof e == "object" && !!e && typeof e.value == "string" && typeof e.label == "string");
254
+ } catch (e) {
255
+ if (e instanceof DOMException && e.name === "AbortError") return i;
256
+ console.warn(`<${r}>: fetch error`, e);
257
+ }
258
+ return i;
259
+ }
260
+ /**
261
+ * Button component with press feedback and form association.
262
+ * @attr {boolean} disabled - Disables interaction
263
+ * @attr {string} type - Form button type: "button" | "submit" | "reset"
264
+ * @fires ui-press - Fired on activation (click, Enter, Space)
265
+ */
266
+ var ee = class extends v(d) {
267
+ static observedAttributes = ["disabled", "type"];
268
+ #e;
269
+ #t;
270
+ #n;
271
+ #r;
272
+ constructor() {
273
+ super(), this.#e = this.attachInternals(), this.#e.role = "button", this.#t = g(this, "disabled", { type: "boolean" }), this.#n = g(this, "type", {
274
+ type: "string",
275
+ initial: "button"
276
+ });
277
+ }
278
+ get disabled() {
279
+ return this.#t.value;
280
+ }
281
+ set disabled(e) {
282
+ this.#t.set(e);
283
+ }
284
+ get type() {
285
+ return this.#n.value;
286
+ }
287
+ set type(e) {
288
+ this.#n.set(e);
289
+ }
290
+ attributeChangedCallback(e, t, n) {
291
+ t !== n && (_({
292
+ disabled: this.#t,
293
+ type: this.#n
294
+ }, e, n), super.attributeChangedCallback?.(e, t, n));
295
+ }
296
+ setup() {
297
+ super.setup(), this.#r = new u(this, { disabled: () => this.disabled }), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEffect(h(this, this.#t.signal, this.#e, { manageTabindex: !0 })), this.addEventListener("ui-press", this.#i);
298
+ }
299
+ teardown() {
300
+ this.removeEventListener("ui-press", this.#i), this.#r.destroy(), super.teardown();
301
+ }
302
+ #i = () => {
303
+ if (this.#t.value) return;
304
+ let e = this.#e.form;
305
+ if (!e) return;
306
+ let t = this.#n.value;
307
+ t === "submit" ? e.requestSubmit() : t === "reset" && e.reset();
308
+ };
309
+ onFormDisabled(e) {
310
+ this.#t.signal.value = e;
311
+ }
312
+ onFormReset() {
313
+ this.#t.signal.value = this.hasAttribute("disabled");
314
+ }
315
+ }, te = class extends v(d) {
316
+ static observedAttributes = [
317
+ "value",
318
+ "placeholder",
319
+ "disabled",
320
+ "readonly",
321
+ "required",
322
+ "name"
323
+ ];
324
+ #e;
325
+ #t = t(!1);
326
+ #n = t(!1);
327
+ #r = t("");
328
+ #i = [];
329
+ constructor() {
330
+ super(), this.#e = this.attachInternals(), this.#e.role = "textbox";
331
+ }
332
+ get value() {
333
+ return this.#a();
334
+ }
335
+ set value(e) {
336
+ this.#o(e), this.#r.value = e, this.#e.setFormValue(e), this.#s();
337
+ }
338
+ #a() {
339
+ let e = "";
340
+ for (let t of this.childNodes) t.nodeType === Node.TEXT_NODE && (e += t.textContent);
341
+ return e;
342
+ }
343
+ #o(e) {
344
+ for (let e of [...this.childNodes]) e.nodeType === Node.TEXT_NODE && e.remove();
345
+ e && this.append(e);
346
+ }
347
+ get placeholder() {
348
+ return this.getAttribute("placeholder") ?? "";
349
+ }
350
+ set placeholder(e) {
351
+ this.setAttribute("placeholder", e);
352
+ }
353
+ get name() {
354
+ return this.getAttribute("name") ?? "";
355
+ }
356
+ set name(e) {
357
+ this.setAttribute("name", e);
358
+ }
359
+ get disabled() {
360
+ return this.#t.value;
361
+ }
362
+ set disabled(e) {
363
+ this.#t.value = e, this.toggleAttribute("disabled", e);
364
+ }
365
+ get readOnly() {
366
+ return this.hasAttribute("readonly");
367
+ }
368
+ set readOnly(e) {
369
+ this.toggleAttribute("readonly", e), this.setAttribute("contenteditable", e ? "false" : "plaintext-only");
370
+ }
371
+ get required() {
372
+ return this.#n.value;
373
+ }
374
+ set required(e) {
375
+ this.#n.value = e, this.toggleAttribute("required", e);
376
+ }
377
+ attributeChangedCallback(e, t, n) {
378
+ if (t !== n) {
379
+ switch (e) {
380
+ case "value":
381
+ this.#o(n ?? ""), this.#r.value = n ?? "", this.#e.setFormValue(n ?? ""), this.#s();
382
+ break;
383
+ case "disabled":
384
+ this.#t.value = n !== null, this.setAttribute("contenteditable", n !== null || this.hasAttribute("readonly") ? "false" : "plaintext-only");
385
+ break;
386
+ case "readonly":
387
+ this.setAttribute("contenteditable", n !== null || this.#t.value ? "false" : "plaintext-only");
388
+ break;
389
+ case "required":
390
+ this.#n.value = n !== null;
391
+ break;
392
+ }
393
+ super.attributeChangedCallback?.(e, t, n);
394
+ }
395
+ }
396
+ setup() {
397
+ super.setup(), this.hasAttribute("contenteditable") || this.setAttribute("contenteditable", "plaintext-only"), this.#i = [...this.querySelectorAll(":scope > [slot]")];
398
+ for (let e of this.#i) e.setAttribute("contenteditable", "false");
399
+ this.#n.value = this.hasAttribute("required"), this.#r.value = this.#a(), this.#s(), this.addEffect(h(this, this.#t, this.#e, { manageTabindex: !0 })), this.addEffect(() => {
400
+ this.#n.value && this.#r.value === "" ? this.#e.setValidity({ valueMissing: !0 }, "Please fill out this field.", this) : this.#e.setValidity({});
401
+ }), this.addEventListener("input", this.#c), this.addEventListener("blur", this.#l);
402
+ }
403
+ teardown() {
404
+ this.removeEventListener("input", this.#c), this.removeEventListener("blur", this.#l), super.teardown();
405
+ }
406
+ select() {
407
+ let e = document.createRange();
408
+ e.selectNodeContents(this);
409
+ let t = window.getSelection();
410
+ t?.removeAllRanges(), t?.addRange(e);
411
+ }
412
+ onFormDisabled(e) {
413
+ this.#t.value = e, this.setAttribute("contenteditable", e || this.hasAttribute("readonly") ? "false" : "plaintext-only");
414
+ }
415
+ onFormReset() {
416
+ this.#o(""), this.#r.value = "", this.#e.setFormValue(""), this.#s(), this.#t.value = this.hasAttribute("disabled");
417
+ }
418
+ #s() {
419
+ this.#a().trim() === "" ? this.#e.states.add("empty") : this.#e.states.delete("empty");
420
+ }
421
+ #c = () => {
422
+ for (let e of this.#i) e.parentNode || this.appendChild(e);
423
+ let e = this.#a();
424
+ this.#r.value = e, this.#e.setFormValue(e), this.#s(), this.dispatchEvent(new CustomEvent("ui-input", {
425
+ bubbles: !0,
426
+ composed: !0,
427
+ detail: { value: e }
428
+ }));
429
+ };
430
+ #l = () => {
431
+ this.dispatchEvent(new CustomEvent("ui-change", {
432
+ bubbles: !0,
433
+ composed: !0,
434
+ detail: { value: this.#a() }
435
+ }));
436
+ };
437
+ }, ne = class extends d {
438
+ static observedAttributes = [
439
+ "disabled",
440
+ "multiple",
441
+ "virtual-focus"
442
+ ];
443
+ #e;
444
+ #t;
445
+ #n = t(!1);
446
+ #r = new b();
447
+ #i;
448
+ constructor() {
449
+ super(), this.#e = this.attachInternals(), this.#e.role = "listbox", this.#t = g(this, "disabled", { type: "boolean" });
450
+ }
451
+ get virtualFocus() {
452
+ return this.hasAttribute("virtual-focus");
453
+ }
454
+ set virtualFocus(e) {
455
+ this.toggleAttribute("virtual-focus", e);
456
+ }
457
+ get disabled() {
458
+ return this.#t.value;
459
+ }
460
+ set disabled(e) {
461
+ this.#t.set(e);
462
+ }
463
+ get multiple() {
464
+ return this.#n.value;
465
+ }
466
+ set multiple(e) {
467
+ this.#n.value = e, this.#r.multiple = e, this.toggleAttribute("multiple", e);
468
+ }
469
+ get value() {
470
+ return this.#r.value.value;
471
+ }
472
+ get controller() {
473
+ return this.#r;
474
+ }
475
+ get listValue() {
476
+ return this.#i.listValue;
477
+ }
478
+ attributeChangedCallback(e, t, n) {
479
+ if (t !== n) {
480
+ if (_({ disabled: this.#t }, e, n)) {
481
+ super.attributeChangedCallback?.(e, t, n);
482
+ return;
483
+ }
484
+ switch (e) {
485
+ case "multiple":
486
+ this.#n.value = n !== null, this.#r.multiple = n !== null;
487
+ break;
488
+ case "virtual-focus":
489
+ this.#i && (this.#i.rovingFocus.disabled = n !== null);
490
+ break;
491
+ }
492
+ super.attributeChangedCallback?.(e, t, n);
493
+ }
494
+ }
495
+ setup() {
496
+ super.setup(), this.#i = new l(this, {
497
+ itemSelector: ":scope ui-option:not([disabled])",
498
+ autoSync: !1,
499
+ orientation: "vertical",
500
+ disabled: this.virtualFocus,
501
+ onChildSelect: (e) => {
502
+ this.#n.value ? this.#r.toggle(e.value) : this.#r.select(e.value), this.dispatchEvent(new CustomEvent("ui-change", {
503
+ bubbles: !0,
504
+ composed: !0,
505
+ cancelable: !0,
506
+ detail: e
507
+ }));
508
+ },
509
+ addEffect: (e) => this.addEffect(e),
510
+ deferChildren: (e) => this.deferChildren(e)
511
+ }), this.addEffect(h(this, this.#t.signal, this.#e)), this.deferChildren(() => {
512
+ this.addEffect(() => {
513
+ let e = this.#r.value.value, t = this.#r.selected.value, n = this.#n.value, r = this.querySelectorAll(":scope ui-option");
514
+ for (let i of r) {
515
+ let r = n ? t.has(i.value) : i.value === e;
516
+ i.setAttribute("aria-selected", r ? "true" : "false");
517
+ }
518
+ }), this.addEffect(() => {
519
+ let e = this.#r.activeIndex.value, t = this.querySelectorAll(":scope ui-option:not([disabled])");
520
+ for (let n = 0; n < t.length; n++) t[n].toggleAttribute("active", n === e);
521
+ });
522
+ });
523
+ }
524
+ teardown() {
525
+ this.#i.destroy(), super.teardown();
526
+ }
527
+ getActiveOption() {
528
+ let e = this.#r.activeIndex.value;
529
+ return this.querySelectorAll(":scope ui-option:not([disabled])")[e] ?? null;
530
+ }
531
+ }, re = class extends d {
532
+ static observedAttributes = [
533
+ "value",
534
+ "disabled",
535
+ "label"
536
+ ];
537
+ #e;
538
+ #t = t("");
539
+ #n;
540
+ #r = t("");
541
+ constructor() {
542
+ super(), this.#e = this.attachInternals(), this.#e.role = "option", this.#n = g(this, "disabled", { type: "boolean" });
543
+ }
544
+ get value() {
545
+ return this.#t.value;
546
+ }
547
+ set value(e) {
548
+ this.#t.value = e, this.getAttribute("value") !== e && this.setAttribute("value", e);
549
+ }
550
+ get disabled() {
551
+ return this.#n.value;
552
+ }
553
+ set disabled(e) {
554
+ this.#n.set(e);
555
+ }
556
+ get label() {
557
+ return this.#r.value || this.textContent?.trim() || "";
558
+ }
559
+ set label(e) {
560
+ this.#r.value = e, e ? this.getAttribute("label") !== e && this.setAttribute("label", e) : this.removeAttribute("label");
561
+ }
562
+ attributeChangedCallback(e, t, n) {
563
+ if (t !== n) {
564
+ if (_({ disabled: this.#n }, e, n)) {
565
+ super.attributeChangedCallback?.(e, t, n);
566
+ return;
567
+ }
568
+ switch (e) {
569
+ case "value":
570
+ this.#t.value = n ?? "";
571
+ break;
572
+ case "label":
573
+ this.#r.value = n ?? "";
574
+ break;
575
+ }
576
+ super.attributeChangedCallback?.(e, t, n);
577
+ }
578
+ }
579
+ setup() {
580
+ super.setup(), this.addEffect(h(this, this.#n.signal, this.#e)), this.addEventListener("click", this.#i);
581
+ }
582
+ teardown() {
583
+ this.removeEventListener("click", this.#i), super.teardown();
584
+ }
585
+ #i = () => {
586
+ this.disabled || this.dispatchEvent(new CustomEvent("ui-select", {
587
+ bubbles: !0,
588
+ composed: !0,
589
+ detail: {
590
+ value: this.#t.value,
591
+ label: this.label
592
+ }
593
+ }));
594
+ };
595
+ }, ie = class extends d {
596
+ constructor() {
597
+ super();
598
+ let e = this.attachInternals();
599
+ e.role = "presentation";
600
+ }
601
+ setup() {
602
+ super.setup(), this.id ||= r("ogh");
603
+ let e = this.closest("ui-option-group");
604
+ e && e.setAttribute("aria-labelledby", this.id);
605
+ }
606
+ }, ae = class extends d {
607
+ constructor() {
608
+ super();
609
+ let e = this.attachInternals();
610
+ e.role = "group";
611
+ }
612
+ }, oe = class extends d {
613
+ static observedAttributes = ["disabled"];
614
+ #e;
615
+ #t = new b({ initialActiveIndex: 0 });
616
+ #n = t(!1);
617
+ constructor() {
618
+ super(), this.#e = this.attachInternals();
619
+ }
620
+ get store() {
621
+ return this.#t;
622
+ }
623
+ get disabled() {
624
+ return this.#n.value;
625
+ }
626
+ set disabled(e) {
627
+ this.#n.value = e, this.toggleAttribute("disabled", e);
628
+ }
629
+ attributeChangedCallback(e, t, n) {
630
+ t !== n && (e === "disabled" && (this.#n.value = n !== null), super.attributeChangedCallback?.(e, t, n));
631
+ }
632
+ setup() {
633
+ super.setup(), this.addEffect(h(this, this.#n, this.#e)), this.addEventListener("ui-input", this.#i), this.addEventListener("ui-select", this.#a), this.addEventListener("keydown", this.#o), this.deferChildren(() => {
634
+ this.addEffect(() => {
635
+ let e = this.#t.query.value.toLowerCase().trim(), t = this.querySelectorAll("ui-command-item");
636
+ for (let n of t) {
637
+ let t = !e || n.searchText.includes(e);
638
+ n.toggleAttribute("hidden", !t);
639
+ }
640
+ }), this.addEffect(() => {
641
+ this.#t.query.value;
642
+ let e = this.#t.activeIndex.value, t = this.#r();
643
+ for (let n = 0; n < t.length; n++) t[n].toggleAttribute("active", n === e);
644
+ let n = t[e];
645
+ n && n.scrollIntoView({ block: "nearest" });
646
+ }), this.addEffect(() => {
647
+ this.#t.query.value;
648
+ let e = this.#r(), t = this.querySelector("ui-command-empty");
649
+ t && t.toggleAttribute("hidden", e.length > 0);
650
+ });
651
+ });
652
+ }
653
+ teardown() {
654
+ this.removeEventListener("ui-input", this.#i), this.removeEventListener("ui-select", this.#a), this.removeEventListener("keydown", this.#o), super.teardown();
655
+ }
656
+ #r() {
657
+ return [...this.querySelectorAll("ui-command-item:not([hidden]):not([disabled])")];
658
+ }
659
+ #i = (e) => {
660
+ if (this.#n.value) return;
661
+ let t = e.detail;
662
+ this.#t.setQuery(t.value, 0);
663
+ };
664
+ #a = (e) => {
665
+ if (this.#n.value) return;
666
+ let t = e.detail;
667
+ this.dispatchEvent(new CustomEvent("ui-change", {
668
+ bubbles: !0,
669
+ composed: !0,
670
+ detail: t
671
+ }));
672
+ };
673
+ #o = (e) => {
674
+ if (this.#n.value) return;
675
+ let t = this.#r();
676
+ if (!(t.length === 0 && e.key !== "Escape")) switch (e.key) {
677
+ case "ArrowDown":
678
+ e.preventDefault(), this.#t.moveActive(1, t.length);
679
+ break;
680
+ case "ArrowUp":
681
+ e.preventDefault(), this.#t.moveActive(-1, t.length);
682
+ break;
683
+ case "Home":
684
+ e.preventDefault(), this.#t.activeIndex.value = 0;
685
+ break;
686
+ case "End":
687
+ e.preventDefault(), this.#t.activeIndex.value = Math.max(0, t.length - 1);
688
+ break;
689
+ case "Enter": {
690
+ e.preventDefault();
691
+ let n = t[this.#t.activeIndex.value];
692
+ n && n.click();
693
+ break;
694
+ }
695
+ case "Escape":
696
+ this.dispatchEvent(new CustomEvent("ui-dismiss", {
697
+ bubbles: !0,
698
+ composed: !0
699
+ }));
700
+ break;
701
+ }
702
+ };
703
+ }, se = class extends d {
704
+ #e = null;
705
+ setup() {
706
+ super.setup(), this.deferChildren(() => {
707
+ this.#e = this.querySelector("input"), this.#e && this.#e.addEventListener("input", this.#t);
708
+ });
709
+ }
710
+ teardown() {
711
+ this.#e && this.#e.removeEventListener("input", this.#t), this.#e = null, super.teardown();
712
+ }
713
+ get inputElement() {
714
+ return this.#e;
715
+ }
716
+ focus(e) {
717
+ this.#e?.focus(e);
718
+ }
719
+ clear() {
720
+ this.#e && (this.#e.value = "", this.#t());
721
+ }
722
+ #t = () => {
723
+ let e = this.#e?.value ?? "";
724
+ this.dispatchEvent(new CustomEvent("ui-input", {
725
+ bubbles: !0,
726
+ composed: !0,
727
+ detail: { value: e }
728
+ }));
729
+ };
730
+ }, ce = class extends d {
731
+ constructor() {
732
+ super();
733
+ let e = this.attachInternals();
734
+ e.role = "listbox";
735
+ }
736
+ }, le = class extends d {
737
+ static observedAttributes = [
738
+ "value",
739
+ "disabled",
740
+ "keywords"
741
+ ];
742
+ #e;
743
+ #t = t("");
744
+ #n = t(!1);
745
+ #r = t("");
746
+ constructor() {
747
+ super(), this.#e = this.attachInternals(), this.#e.role = "option";
748
+ }
749
+ get value() {
750
+ return this.#t.value;
751
+ }
752
+ set value(e) {
753
+ this.#t.value = e, this.getAttribute("value") !== e && this.setAttribute("value", e);
754
+ }
755
+ get disabled() {
756
+ return this.#n.value;
757
+ }
758
+ set disabled(e) {
759
+ this.#n.value = e, this.toggleAttribute("disabled", e);
760
+ }
761
+ get keywords() {
762
+ return this.#r.value;
763
+ }
764
+ set keywords(e) {
765
+ this.#r.value = e, e ? this.getAttribute("keywords") !== e && this.setAttribute("keywords", e) : this.removeAttribute("keywords");
766
+ }
767
+ get label() {
768
+ return this.textContent?.trim() || "";
769
+ }
770
+ get searchText() {
771
+ return `${this.label} ${this.#t.value} ${this.#r.value}`.toLowerCase();
772
+ }
773
+ attributeChangedCallback(e, t, n) {
774
+ if (t !== n) {
775
+ switch (e) {
776
+ case "value":
777
+ this.#t.value = n ?? "";
778
+ break;
779
+ case "disabled":
780
+ this.#n.value = n !== null;
781
+ break;
782
+ case "keywords":
783
+ this.#r.value = n ?? "";
784
+ break;
785
+ }
786
+ super.attributeChangedCallback?.(e, t, n);
787
+ }
788
+ }
789
+ setup() {
790
+ super.setup(), this.addEffect(h(this, this.#n, this.#e)), this.addEventListener("click", this.#i);
791
+ }
792
+ teardown() {
793
+ this.removeEventListener("click", this.#i), super.teardown();
794
+ }
795
+ #i = () => {
796
+ this.#n.value || this.dispatchEvent(new CustomEvent("ui-select", {
797
+ bubbles: !0,
798
+ composed: !0,
799
+ detail: {
800
+ value: this.#t.value,
801
+ label: this.label
802
+ }
803
+ }));
804
+ };
805
+ }, w = class extends d {
806
+ constructor() {
807
+ super();
808
+ let e = this.attachInternals();
809
+ e.role = "group";
810
+ }
811
+ }, T = class extends d {}, E = class extends v(d) {
812
+ static observedAttributes = [
813
+ "checked",
814
+ "indeterminate",
815
+ "disabled",
816
+ "name",
817
+ "value",
818
+ "required"
819
+ ];
820
+ #e;
821
+ #t;
822
+ #n;
823
+ #r;
824
+ #i = t(!1);
825
+ #a = !1;
826
+ #o;
827
+ constructor() {
828
+ super(), this.#e = this.attachInternals(), this.#e.role = "checkbox", this.#t = g(this, "checked", { type: "boolean" }), this.#n = g(this, "indeterminate", { type: "boolean" }), this.#r = g(this, "disabled", { type: "boolean" });
829
+ }
830
+ get checked() {
831
+ return this.#t.value;
832
+ }
833
+ set checked(e) {
834
+ this.#t.set(e);
835
+ }
836
+ get indeterminate() {
837
+ return this.#n.value;
838
+ }
839
+ set indeterminate(e) {
840
+ this.#n.set(e);
841
+ }
842
+ get disabled() {
843
+ return this.#r.value;
844
+ }
845
+ set disabled(e) {
846
+ this.#r.set(e);
847
+ }
848
+ get name() {
849
+ return this.getAttribute("name") ?? "";
850
+ }
851
+ set name(e) {
852
+ this.setAttribute("name", e);
853
+ }
854
+ get value() {
855
+ return this.getAttribute("value") ?? "on";
856
+ }
857
+ set value(e) {
858
+ this.setAttribute("value", e);
859
+ }
860
+ get required() {
861
+ return this.#i.value;
862
+ }
863
+ set required(e) {
864
+ this.#i.value = e, this.toggleAttribute("required", e);
865
+ }
866
+ attributeChangedCallback(e, t, n) {
867
+ if (t !== n) {
868
+ if (_({
869
+ checked: this.#t,
870
+ indeterminate: this.#n,
871
+ disabled: this.#r
872
+ }, e, n)) {
873
+ super.attributeChangedCallback?.(e, t, n);
874
+ return;
875
+ }
876
+ e === "required" && (this.#i.value = n !== null), super.attributeChangedCallback?.(e, t, n);
877
+ }
878
+ }
879
+ setup() {
880
+ super.setup(), this.#o = new u(this, { disabled: () => this.disabled }), this.#a = this.hasAttribute("checked"), this.#i.value = this.hasAttribute("required"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEffect(h(this, this.#r.signal, this.#e, { manageTabindex: !0 })), this.addEffect(() => {
881
+ let e = this.#t.value, t = this.#n.value ? "mixed" : e ? "true" : "false";
882
+ this.setAttribute("aria-checked", t), this.#e.setFormValue(e ? this.value : null);
883
+ }), this.addEffect(() => {
884
+ let e = this.#i.value;
885
+ this.#e.ariaRequired = e ? "true" : null;
886
+ }), this.addEffect(() => {
887
+ this.#i.value && !this.#t.value ? this.#e.setValidity({ valueMissing: !0 }, "Please check this box if you want to proceed.", this) : this.#e.setValidity({});
888
+ }), this.addEventListener("ui-press", this.#s);
889
+ }
890
+ teardown() {
891
+ this.removeEventListener("ui-press", this.#s), this.#o.destroy(), super.teardown();
892
+ }
893
+ onFormDisabled(e) {
894
+ this.#r.signal.value = e;
895
+ }
896
+ onFormReset() {
897
+ this.#t.set(this.#a), this.#n.set(!1);
898
+ }
899
+ #s = () => {
900
+ this.#r.value || (this.#n.value ? (this.indeterminate = !1, this.checked = !0) : this.checked = !this.#t.value, this.dispatchEvent(new CustomEvent("ui-change", {
901
+ bubbles: !0,
902
+ composed: !0,
903
+ detail: {
904
+ checked: this.#t.value,
905
+ value: this.value
906
+ }
907
+ })));
908
+ };
909
+ }, D = class extends v(d) {
910
+ static observedAttributes = [
911
+ "checked",
912
+ "disabled",
913
+ "name",
914
+ "value"
915
+ ];
916
+ #e;
917
+ #t;
918
+ #n;
919
+ #r = !1;
920
+ #i;
921
+ constructor() {
922
+ super(), this.#e = this.attachInternals(), this.#e.role = "switch", this.#t = g(this, "checked", { type: "boolean" }), this.#n = g(this, "disabled", { type: "boolean" });
923
+ }
924
+ get checked() {
925
+ return this.#t.value;
926
+ }
927
+ set checked(e) {
928
+ this.#t.set(e);
929
+ }
930
+ get disabled() {
931
+ return this.#n.value;
932
+ }
933
+ set disabled(e) {
934
+ this.#n.set(e);
935
+ }
936
+ get name() {
937
+ return this.getAttribute("name") ?? "";
938
+ }
939
+ set name(e) {
940
+ this.setAttribute("name", e);
941
+ }
942
+ get value() {
943
+ return this.getAttribute("value") ?? "on";
944
+ }
945
+ set value(e) {
946
+ this.setAttribute("value", e);
947
+ }
948
+ attributeChangedCallback(e, t, n) {
949
+ t !== n && (_({
950
+ checked: this.#t,
951
+ disabled: this.#n
952
+ }, e, n), super.attributeChangedCallback?.(e, t, n));
953
+ }
954
+ setup() {
955
+ super.setup(), this.#i = new u(this, { disabled: () => this.disabled }), this.#r = this.hasAttribute("checked"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEffect(h(this, this.#n.signal, this.#e, { manageTabindex: !0 })), this.addEffect(() => {
956
+ let e = this.#t.value;
957
+ this.setAttribute("aria-checked", e ? "true" : "false"), this.#e.setFormValue(e ? this.value : null);
958
+ }), this.addEventListener("ui-press", this.#a);
959
+ }
960
+ teardown() {
961
+ this.removeEventListener("ui-press", this.#a), this.#i.destroy(), super.teardown();
962
+ }
963
+ onFormDisabled(e) {
964
+ this.#n.signal.value = e;
965
+ }
966
+ onFormReset() {
967
+ this.#t.set(this.#r);
968
+ }
969
+ #a = () => {
970
+ this.#n.value || (this.checked = !this.#t.value, this.dispatchEvent(new CustomEvent("ui-change", {
971
+ bubbles: !0,
972
+ composed: !0,
973
+ detail: {
974
+ checked: this.#t.value,
975
+ value: this.value
976
+ }
977
+ })));
978
+ };
979
+ }, O = class extends d {
980
+ static observedAttributes = ["value", "disabled"];
981
+ #e;
982
+ #t;
983
+ #n;
984
+ constructor() {
985
+ super(), this.#e = this.attachInternals(), this.#e.role = "radio", this.#t = g(this, "disabled", { type: "boolean" });
986
+ }
987
+ get value() {
988
+ return this.getAttribute("value") ?? "";
989
+ }
990
+ set value(e) {
991
+ this.setAttribute("value", e);
992
+ }
993
+ get disabled() {
994
+ return this.#t.value;
995
+ }
996
+ set disabled(e) {
997
+ this.#t.set(e);
998
+ }
999
+ get label() {
1000
+ return this.getAttribute("label") ?? this.textContent?.trim() ?? "";
1001
+ }
1002
+ attributeChangedCallback(e, t, n) {
1003
+ t !== n && (_({ disabled: this.#t }, e, n), super.attributeChangedCallback?.(e, t, n));
1004
+ }
1005
+ setup() {
1006
+ super.setup(), this.setAttribute("aria-checked", "false"), this.#n = new u(this, { disabled: () => this.disabled }), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "-1"), this.addEffect(h(this, this.#t.signal, this.#e)), this.addEventListener("click", this.#r), this.addEventListener("keydown", this.#i);
1007
+ }
1008
+ teardown() {
1009
+ this.removeEventListener("click", this.#r), this.removeEventListener("keydown", this.#i), this.#n.destroy(), super.teardown();
1010
+ }
1011
+ #r = () => {
1012
+ this.disabled || this.dispatchEvent(new CustomEvent("ui-select", {
1013
+ bubbles: !0,
1014
+ composed: !0,
1015
+ detail: {
1016
+ value: this.value,
1017
+ label: this.label
1018
+ }
1019
+ }));
1020
+ };
1021
+ #i = (e) => {
1022
+ e.key !== "Enter" && e.key !== " " || this.disabled || (e.preventDefault(), this.dispatchEvent(new CustomEvent("ui-select", {
1023
+ bubbles: !0,
1024
+ composed: !0,
1025
+ detail: {
1026
+ value: this.value,
1027
+ label: this.label
1028
+ }
1029
+ })));
1030
+ };
1031
+ }, k = class extends v(d) {
1032
+ static observedAttributes = [
1033
+ "value",
1034
+ "disabled",
1035
+ "name",
1036
+ "required",
1037
+ "orientation"
1038
+ ];
1039
+ #e;
1040
+ #t = t(!1);
1041
+ #n = t(!1);
1042
+ #r = null;
1043
+ #i;
1044
+ constructor() {
1045
+ super(), this.#e = this.attachInternals(), this.#e.role = "radiogroup";
1046
+ }
1047
+ get value() {
1048
+ return this.#i?.listValue.value ?? null;
1049
+ }
1050
+ set value(e) {
1051
+ this.#i && (this.#i.listValue.value = e), e === null ? this.removeAttribute("value") : this.setAttribute("value", e);
1052
+ }
1053
+ get disabled() {
1054
+ return this.#t.value;
1055
+ }
1056
+ set disabled(e) {
1057
+ this.#t.value = e, this.toggleAttribute("disabled", e);
1058
+ }
1059
+ get name() {
1060
+ return this.getAttribute("name") ?? "";
1061
+ }
1062
+ set name(e) {
1063
+ this.setAttribute("name", e);
1064
+ }
1065
+ get required() {
1066
+ return this.#n.value;
1067
+ }
1068
+ set required(e) {
1069
+ this.#n.value = e, this.toggleAttribute("required", e);
1070
+ }
1071
+ attributeChangedCallback(e, t, n) {
1072
+ if (t !== n) {
1073
+ switch (e) {
1074
+ case "value":
1075
+ this.#i && (this.#i.listValue.value = n);
1076
+ break;
1077
+ case "disabled":
1078
+ this.#t.value = n !== null;
1079
+ break;
1080
+ case "required":
1081
+ this.#n.value = n !== null;
1082
+ break;
1083
+ case "orientation":
1084
+ this.#i && (this.#i.rovingFocus.orientation = n ?? "vertical");
1085
+ break;
1086
+ }
1087
+ super.attributeChangedCallback?.(e, t, n);
1088
+ }
1089
+ }
1090
+ setup() {
1091
+ super.setup(), this.#r = this.getAttribute("value"), this.#n.value = this.hasAttribute("required"), this.#i = new l(this, {
1092
+ itemSelector: ":scope ui-radio:not([disabled])",
1093
+ ariaAttr: "aria-checked",
1094
+ orientation: "vertical",
1095
+ onChildSelect: (e) => {
1096
+ this.#i.listValue.value = e.value, this.setAttribute("value", e.value), this.dispatchEvent(new CustomEvent("ui-change", {
1097
+ bubbles: !0,
1098
+ composed: !0,
1099
+ detail: e
1100
+ }));
1101
+ },
1102
+ addEffect: (e) => this.addEffect(e),
1103
+ deferChildren: (e) => this.deferChildren(e)
1104
+ });
1105
+ let e = this.getAttribute("value");
1106
+ e !== null && (this.#i.listValue.value = e), this.addEffect(h(this, this.#t, this.#e)), this.addEffect(() => {
1107
+ let e = this.#n.value;
1108
+ this.#e.ariaRequired = e ? "true" : null;
1109
+ }), this.addEffect(() => {
1110
+ let e = this.#i.listValue.value;
1111
+ this.#e.setFormValue(e);
1112
+ }), this.addEffect(() => {
1113
+ let e = this.#i.listValue.value;
1114
+ this.#n.value && (e === null || e === "") ? this.#e.setValidity({ valueMissing: !0 }, "Please select one of these options.", this) : this.#e.setValidity({});
1115
+ });
1116
+ }
1117
+ teardown() {
1118
+ this.#i.destroy(), super.teardown();
1119
+ }
1120
+ onFormDisabled(e) {
1121
+ this.#t.value = e;
1122
+ }
1123
+ onFormReset() {
1124
+ this.#i && (this.#i.listValue.value = this.#r), this.#r === null ? this.removeAttribute("value") : this.setAttribute("value", this.#r);
1125
+ }
1126
+ }, A = class extends v(d) {
1127
+ static observedAttributes = [
1128
+ "value",
1129
+ "disabled",
1130
+ "name",
1131
+ "required"
1132
+ ];
1133
+ #e;
1134
+ #t = t(!1);
1135
+ #n = t(!1);
1136
+ #r = null;
1137
+ #i;
1138
+ constructor() {
1139
+ super(), this.#e = this.attachInternals(), this.#e.role = "radiogroup";
1140
+ }
1141
+ get value() {
1142
+ return this.#i?.listValue.value ?? null;
1143
+ }
1144
+ set value(e) {
1145
+ this.#i && (this.#i.listValue.value = e), e === null ? this.removeAttribute("value") : this.setAttribute("value", e);
1146
+ }
1147
+ get disabled() {
1148
+ return this.#t.value;
1149
+ }
1150
+ set disabled(e) {
1151
+ this.#t.value = e, this.toggleAttribute("disabled", e);
1152
+ }
1153
+ get name() {
1154
+ return this.getAttribute("name") ?? "";
1155
+ }
1156
+ set name(e) {
1157
+ this.setAttribute("name", e);
1158
+ }
1159
+ get required() {
1160
+ return this.#n.value;
1161
+ }
1162
+ set required(e) {
1163
+ this.#n.value = e, this.toggleAttribute("required", e);
1164
+ }
1165
+ attributeChangedCallback(e, t, n) {
1166
+ if (t !== n) {
1167
+ switch (e) {
1168
+ case "value":
1169
+ this.#i && (this.#i.listValue.value = n);
1170
+ break;
1171
+ case "disabled":
1172
+ this.#t.value = n !== null;
1173
+ break;
1174
+ case "required":
1175
+ this.#n.value = n !== null;
1176
+ break;
1177
+ }
1178
+ super.attributeChangedCallback?.(e, t, n);
1179
+ }
1180
+ }
1181
+ setup() {
1182
+ super.setup(), this.#r = this.getAttribute("value"), this.#i = new l(this, {
1183
+ itemSelector: ":scope > ui-segment:not([disabled])",
1184
+ ariaAttr: "aria-checked",
1185
+ orientation: "horizontal",
1186
+ onChildSelect: (e) => {
1187
+ this.#i.listValue.value = e.value, this.setAttribute("value", e.value), this.dispatchEvent(new CustomEvent("ui-change", {
1188
+ bubbles: !0,
1189
+ composed: !0,
1190
+ detail: e
1191
+ }));
1192
+ },
1193
+ addEffect: (e) => this.addEffect(e),
1194
+ deferChildren: (e) => this.deferChildren(e)
1195
+ });
1196
+ let e = this.getAttribute("value");
1197
+ e !== null && (this.#i.listValue.value = e), this.addEffect(h(this, this.#t, this.#e)), this.#n.value = this.hasAttribute("required"), this.addEffect(() => {
1198
+ let e = this.#i.listValue.value;
1199
+ this.#n.value && (e === null || e === "") ? this.#e.setValidity({ valueMissing: !0 }, "Please select one of these options.", this) : this.#e.setValidity({});
1200
+ }), this.addEffect(() => {
1201
+ let e = this.#i.listValue.value;
1202
+ this.#e.setFormValue(e);
1203
+ }), this.deferChildren(() => {
1204
+ this.addEffect(() => {
1205
+ let e = this.#i.listValue.value, t = this.querySelectorAll(":scope > ui-segment"), n = -1, r = 0;
1206
+ for (let i of t) i.value === e && (n = r), r++;
1207
+ this.#a(n, r);
1208
+ });
1209
+ });
1210
+ }
1211
+ teardown() {
1212
+ this.#i.destroy(), super.teardown();
1213
+ }
1214
+ onFormDisabled(e) {
1215
+ this.#t.value = e;
1216
+ }
1217
+ onFormReset() {
1218
+ this.#i && (this.#i.listValue.value = this.#r), this.#r === null ? this.removeAttribute("value") : this.setAttribute("value", this.#r);
1219
+ }
1220
+ #a(e, t) {
1221
+ if (e < 0) {
1222
+ this.#e.states.delete("ready");
1223
+ return;
1224
+ }
1225
+ this.style.setProperty("--_indicator-index", `${e}`), this.style.setProperty("--_segment-count", `${t}`), this.#e.states.add("ready");
1226
+ }
1227
+ }, j = class extends d {
1228
+ static observedAttributes = ["value", "disabled"];
1229
+ #e;
1230
+ #t;
1231
+ #n;
1232
+ constructor() {
1233
+ super(), this.#e = this.attachInternals(), this.#e.role = "radio", this.#t = g(this, "disabled", { type: "boolean" });
1234
+ }
1235
+ get value() {
1236
+ return this.getAttribute("value") ?? "";
1237
+ }
1238
+ set value(e) {
1239
+ this.setAttribute("value", e);
1240
+ }
1241
+ get disabled() {
1242
+ return this.#t.value;
1243
+ }
1244
+ set disabled(e) {
1245
+ this.#t.set(e);
1246
+ }
1247
+ get label() {
1248
+ return this.getAttribute("label") ?? this.textContent?.trim() ?? "";
1249
+ }
1250
+ attributeChangedCallback(e, t, n) {
1251
+ t !== n && (_({ disabled: this.#t }, e, n), super.attributeChangedCallback?.(e, t, n));
1252
+ }
1253
+ setup() {
1254
+ super.setup(), this.#n = new u(this, { disabled: () => this.disabled }), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "-1"), this.addEffect(h(this, this.#t.signal, this.#e)), this.addEventListener("ui-press", this.#r);
1255
+ }
1256
+ teardown() {
1257
+ this.removeEventListener("ui-press", this.#r), this.#n.destroy(), super.teardown();
1258
+ }
1259
+ #r = () => {
1260
+ this.#t.value || this.dispatchEvent(new CustomEvent("ui-select", {
1261
+ bubbles: !0,
1262
+ composed: !0,
1263
+ detail: {
1264
+ value: this.value,
1265
+ label: this.label
1266
+ }
1267
+ }));
1268
+ };
1269
+ }, M = class extends d {
1270
+ static observedAttributes = [
1271
+ "placement",
1272
+ "delay",
1273
+ "disabled"
1274
+ ];
1275
+ #e;
1276
+ #t = t(!1);
1277
+ #n = t(!1);
1278
+ #r = null;
1279
+ #i = null;
1280
+ #a = "";
1281
+ constructor() {
1282
+ super(), this.#e = this.attachInternals();
1283
+ }
1284
+ get disabled() {
1285
+ return this.#n.value;
1286
+ }
1287
+ set disabled(e) {
1288
+ this.#n.value = e, this.toggleAttribute("disabled", e);
1289
+ }
1290
+ get placement() {
1291
+ return this.getAttribute("placement") ?? "top";
1292
+ }
1293
+ set placement(e) {
1294
+ this.setAttribute("placement", e);
1295
+ }
1296
+ get delay() {
1297
+ return Number(this.getAttribute("delay") ?? 500);
1298
+ }
1299
+ set delay(e) {
1300
+ this.setAttribute("delay", String(e));
1301
+ }
1302
+ attributeChangedCallback(e, t, n) {
1303
+ t !== n && (e === "disabled" && (this.#n.value = n !== null), super.attributeChangedCallback?.(e, t, n));
1304
+ }
1305
+ setup() {
1306
+ super.setup(), this.addEffect(h(this, this.#n, this.#e)), this.#i = this.parentElement, this.#i && (this.#a = r("tip"), this.#i.style.setProperty("anchor-name", `--${this.#a}`), this.style.setProperty("position-anchor", `--${this.#a}`), this.hasAttribute("popover") || this.setAttribute("popover", "manual"), this.id ||= r("tooltip"), this.#i.setAttribute("aria-describedby", this.id), this.#i.addEventListener("mouseenter", this.#o), this.#i.addEventListener("mouseleave", this.#s), this.#i.addEventListener("focusin", this.#o), this.#i.addEventListener("focusout", this.#s), this.#i.addEventListener("keydown", this.#c), this.addEffect(() => {
1307
+ this.#n.value && this.#t.value && (this.#l(), this.#t.value = !1);
1308
+ }), this.addEffect(() => {
1309
+ if (this.#t.value) try {
1310
+ this.showPopover();
1311
+ } catch {}
1312
+ else try {
1313
+ this.hidePopover();
1314
+ } catch {}
1315
+ }));
1316
+ }
1317
+ teardown() {
1318
+ this.#l(), this.#i &&= (this.#i.removeEventListener("mouseenter", this.#o), this.#i.removeEventListener("mouseleave", this.#s), this.#i.removeEventListener("focusin", this.#o), this.#i.removeEventListener("focusout", this.#s), this.#i.removeEventListener("keydown", this.#c), this.#i.removeAttribute("aria-describedby"), this.#i.style.removeProperty("anchor-name"), null), super.teardown();
1319
+ }
1320
+ #o = () => {
1321
+ this.#n.value || (this.#l(), this.#r = setTimeout(() => {
1322
+ this.#t.value = !0;
1323
+ }, this.delay));
1324
+ };
1325
+ #s = () => {
1326
+ this.#l(), this.#t.value = !1;
1327
+ };
1328
+ #c = (e) => {
1329
+ e.key === "Escape" && this.#t.value && (this.#t.value = !1);
1330
+ };
1331
+ #l() {
1332
+ this.#r !== null && (clearTimeout(this.#r), this.#r = null);
1333
+ }
1334
+ }, N = class extends d {
1335
+ static observedAttributes = ["multiple", "disabled"];
1336
+ #e = t(!1);
1337
+ get multiple() {
1338
+ return this.hasAttribute("multiple");
1339
+ }
1340
+ set multiple(e) {
1341
+ this.toggleAttribute("multiple", e);
1342
+ }
1343
+ get disabled() {
1344
+ return this.#e.value;
1345
+ }
1346
+ set disabled(e) {
1347
+ this.#e.value = e, this.toggleAttribute("disabled", e);
1348
+ }
1349
+ attributeChangedCallback(e, t, n) {
1350
+ t !== n && (e === "disabled" && (this.#e.value = n !== null), super.attributeChangedCallback?.(e, t, n));
1351
+ }
1352
+ setup() {
1353
+ super.setup(), this.addEffect(h(this, this.#e)), this.addEventListener("toggle", this.#t, !0);
1354
+ }
1355
+ teardown() {
1356
+ this.removeEventListener("toggle", this.#t, !0), super.teardown();
1357
+ }
1358
+ #t = (e) => {
1359
+ if (this.multiple) return;
1360
+ let t = e.target;
1361
+ if (!t.open) return;
1362
+ let n = t.closest("ui-accordion-item");
1363
+ if (!n) return;
1364
+ let r = this.querySelectorAll(":scope > ui-accordion-item[open]");
1365
+ for (let e of r) e !== n && (e.open = !1);
1366
+ };
1367
+ }, P = class extends d {
1368
+ static observedAttributes = ["open", "disabled"];
1369
+ #e = t(!1);
1370
+ #t = t(!1);
1371
+ #n = null;
1372
+ get open() {
1373
+ return this.#e.value;
1374
+ }
1375
+ set open(e) {
1376
+ this.#e.value = e, this.toggleAttribute("open", e);
1377
+ }
1378
+ get disabled() {
1379
+ return this.#t.value;
1380
+ }
1381
+ set disabled(e) {
1382
+ this.#t.value = e, this.toggleAttribute("disabled", e);
1383
+ }
1384
+ attributeChangedCallback(e, t, n) {
1385
+ if (t !== n) {
1386
+ switch (e) {
1387
+ case "open":
1388
+ this.#e.value = n !== null;
1389
+ break;
1390
+ case "disabled":
1391
+ this.#t.value = n !== null;
1392
+ break;
1393
+ }
1394
+ super.attributeChangedCallback?.(e, t, n);
1395
+ }
1396
+ }
1397
+ setup() {
1398
+ super.setup();
1399
+ let e = document.createElement("details"), t = document.createElement("summary"), n = this.querySelector(":scope > [slot=\"heading\"]");
1400
+ n && (n.removeAttribute("slot"), t.appendChild(n));
1401
+ let r = document.createElement("div");
1402
+ for (r.setAttribute("part", "content"); this.firstChild;) r.appendChild(this.firstChild);
1403
+ e.appendChild(t), e.appendChild(r), this.appendChild(e), this.#n = e, this.addEffect(() => {
1404
+ let e = this.#e.value;
1405
+ this.#n && (this.#n.open = e);
1406
+ }), this.addEffect(h(this, this.#t)), e.addEventListener("toggle", this.#r);
1407
+ }
1408
+ teardown() {
1409
+ this.#n?.removeEventListener("toggle", this.#r), this.#n = null, super.teardown();
1410
+ }
1411
+ #r = () => {
1412
+ if (!this.#n) return;
1413
+ let e = this.#n.open;
1414
+ this.#e.value = e, this.toggleAttribute("open", e);
1415
+ };
1416
+ }, F = class extends d {
1417
+ static observedAttributes = ["no-close-on-escape", "no-close-on-backdrop"];
1418
+ #e;
1419
+ get open() {
1420
+ return this.#e.open;
1421
+ }
1422
+ showModal() {
1423
+ this.#e.showModal();
1424
+ }
1425
+ close() {
1426
+ this.#e.close();
1427
+ }
1428
+ setup() {
1429
+ super.setup(), this.#e = new m(this);
1430
+ }
1431
+ teardown() {
1432
+ this.#e.destroy(), super.teardown();
1433
+ }
1434
+ }, I = class extends d {
1435
+ static observedAttributes = [
1436
+ "value",
1437
+ "disabled",
1438
+ "orientation"
1439
+ ];
1440
+ #e;
1441
+ #t = t(!1);
1442
+ #n;
1443
+ constructor() {
1444
+ super(), this.#e = this.attachInternals(), this.#e.role = "tablist";
1445
+ }
1446
+ get value() {
1447
+ return this.#n?.listValue.value ?? null;
1448
+ }
1449
+ set value(e) {
1450
+ this.#n && (this.#n.listValue.value = e), e === null ? this.removeAttribute("value") : this.setAttribute("value", e);
1451
+ }
1452
+ get disabled() {
1453
+ return this.#t.value;
1454
+ }
1455
+ set disabled(e) {
1456
+ this.#t.value = e, this.toggleAttribute("disabled", e);
1457
+ }
1458
+ attributeChangedCallback(e, t, n) {
1459
+ if (t !== n) {
1460
+ switch (e) {
1461
+ case "value":
1462
+ this.#n && (this.#n.listValue.value = n);
1463
+ break;
1464
+ case "disabled":
1465
+ this.#t.value = n !== null;
1466
+ break;
1467
+ case "orientation":
1468
+ this.#n && (this.#n.rovingFocus.orientation = n === "vertical" ? "vertical" : "horizontal");
1469
+ break;
1470
+ }
1471
+ super.attributeChangedCallback?.(e, t, n);
1472
+ }
1473
+ }
1474
+ setup() {
1475
+ super.setup(), this.#n = new l(this, {
1476
+ itemSelector: ":scope > ui-tab:not([disabled])",
1477
+ orientation: "horizontal",
1478
+ autoSync: !0,
1479
+ onChildSelect: (e) => {
1480
+ this.#n.listValue.value = e.value, this.setAttribute("value", e.value), this.dispatchEvent(new CustomEvent("ui-change", {
1481
+ bubbles: !0,
1482
+ composed: !0,
1483
+ detail: e
1484
+ }));
1485
+ },
1486
+ addEffect: (e) => this.addEffect(e),
1487
+ deferChildren: (e) => this.deferChildren(e)
1488
+ });
1489
+ let e = this.getAttribute("value");
1490
+ e !== null && (this.#n.listValue.value = e), this.addEffect(h(this, this.#t, this.#e)), this.deferChildren(() => {
1491
+ this.#r(), this.addEffect(() => {
1492
+ let e = this.#n.listValue.value, t = this.querySelectorAll(":scope > ui-tab"), n = this.querySelectorAll(":scope > ui-tab-panels > ui-tab-panel"), r = -1, i = 0;
1493
+ for (let n of t) n.value === e && (r = i), i++;
1494
+ for (let t of n) {
1495
+ let n = t.value === e;
1496
+ t.toggleAttribute("hidden", !n), t.setAttribute("tabindex", n ? "0" : "-1");
1497
+ }
1498
+ this.#i(r, i);
1499
+ });
1500
+ });
1501
+ }
1502
+ teardown() {
1503
+ this.#n.destroy(), super.teardown();
1504
+ }
1505
+ #r() {
1506
+ let e = this.querySelectorAll(":scope > ui-tab"), t = this.querySelectorAll(":scope > ui-tab-panels > ui-tab-panel"), n = /* @__PURE__ */ new Map();
1507
+ for (let e of t) e.id ||= r("tp"), n.set(e.value, e);
1508
+ for (let t of e) {
1509
+ t.id ||= r("tab");
1510
+ let e = n.get(t.value);
1511
+ e && (t.setAttribute("aria-controls", e.id), e.setAttribute("aria-labelledby", t.id));
1512
+ }
1513
+ }
1514
+ #i(e, t) {
1515
+ if (e < 0) {
1516
+ this.#e.states.delete("ready");
1517
+ return;
1518
+ }
1519
+ this.style.setProperty("--_indicator-index", `${e}`), this.style.setProperty("--_tab-count", `${t}`), this.#e.states.add("ready");
1520
+ }
1521
+ }, L = class extends d {
1522
+ static observedAttributes = ["value", "disabled"];
1523
+ #e;
1524
+ #t;
1525
+ #n;
1526
+ constructor() {
1527
+ super(), this.#e = this.attachInternals(), this.#e.role = "tab", this.#t = g(this, "disabled", { type: "boolean" });
1528
+ }
1529
+ get value() {
1530
+ return this.getAttribute("value") ?? "";
1531
+ }
1532
+ set value(e) {
1533
+ this.setAttribute("value", e);
1534
+ }
1535
+ get disabled() {
1536
+ return this.#t.value;
1537
+ }
1538
+ set disabled(e) {
1539
+ this.#t.set(e);
1540
+ }
1541
+ get label() {
1542
+ return this.getAttribute("label") ?? this.textContent?.trim() ?? "";
1543
+ }
1544
+ attributeChangedCallback(e, t, n) {
1545
+ t !== n && (_({ disabled: this.#t }, e, n), super.attributeChangedCallback?.(e, t, n));
1546
+ }
1547
+ setup() {
1548
+ super.setup(), this.#n = new u(this, { disabled: () => this.disabled }), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "-1"), this.addEffect(h(this, this.#t.signal, this.#e)), this.addEventListener("ui-press", this.#r);
1549
+ }
1550
+ teardown() {
1551
+ this.removeEventListener("ui-press", this.#r), this.#n.destroy(), super.teardown();
1552
+ }
1553
+ #r = () => {
1554
+ this.disabled || this.dispatchEvent(new CustomEvent("ui-select", {
1555
+ bubbles: !0,
1556
+ composed: !0,
1557
+ detail: {
1558
+ value: this.value,
1559
+ label: this.label
1560
+ }
1561
+ }));
1562
+ };
1563
+ }, R = class extends d {
1564
+ static observedAttributes = ["value"];
1565
+ #e;
1566
+ constructor() {
1567
+ super(), this.#e = this.attachInternals(), this.#e.role = "tabpanel";
1568
+ }
1569
+ get value() {
1570
+ return this.getAttribute("value") ?? "";
1571
+ }
1572
+ set value(e) {
1573
+ this.setAttribute("value", e);
1574
+ }
1575
+ attributeChangedCallback(e, t, n) {
1576
+ t !== n && super.attributeChangedCallback?.(e, t, n);
1577
+ }
1578
+ }, z = class extends d {
1579
+ #e;
1580
+ constructor() {
1581
+ super(), this.#e = this.attachInternals(), this.#e.role = "presentation";
1582
+ }
1583
+ }, B = class {
1584
+ sortColumn;
1585
+ sortDirection;
1586
+ selected;
1587
+ columnWidths;
1588
+ constructor(e = {}) {
1589
+ this.sortColumn = t(e.sortColumn ?? null), this.sortDirection = t(e.sortDirection ?? "none"), this.selected = t(/* @__PURE__ */ new Set()), this.columnWidths = t([]);
1590
+ }
1591
+ toggleSort(e) {
1592
+ if (this.sortColumn.value === e) {
1593
+ let e = this.sortDirection.value;
1594
+ this.sortDirection.value = e === "asc" ? "desc" : e === "desc" ? "none" : "asc", this.sortDirection.value === "none" && (this.sortColumn.value = null);
1595
+ } else this.sortColumn.value = e, this.sortDirection.value = "asc";
1596
+ }
1597
+ select(e) {
1598
+ let t = new Set(this.selected.value);
1599
+ t.add(e), this.selected.value = t;
1600
+ }
1601
+ deselect(e) {
1602
+ let t = new Set(this.selected.value);
1603
+ t.delete(e), this.selected.value = t;
1604
+ }
1605
+ toggle(e) {
1606
+ this.selected.value.has(e) ? this.deselect(e) : this.select(e);
1607
+ }
1608
+ selectAll(e) {
1609
+ this.selected.value = new Set(e);
1610
+ }
1611
+ clearSelection() {
1612
+ this.selected.value = /* @__PURE__ */ new Set();
1613
+ }
1614
+ isSelected(e) {
1615
+ return this.selected.value.has(e);
1616
+ }
1617
+ };
1618
+ function V(e = {}) {
1619
+ return new B(e);
1620
+ }
1621
+ var H = class {
1622
+ table;
1623
+ #e = [];
1624
+ #t = -1;
1625
+ #n = 0;
1626
+ #r = 0;
1627
+ #i = !1;
1628
+ #a;
1629
+ #o;
1630
+ constructor(e, t = {}) {
1631
+ this.table = e, this.#a = t.minWidth ?? 48, this.#o = t.maxWidth ?? Infinity;
1632
+ }
1633
+ /** Call after table is in DOM and has computed layout. */
1634
+ init() {
1635
+ this.table.addEventListener("pointerdown", this.#l);
1636
+ }
1637
+ destroy() {
1638
+ this.table.removeEventListener("pointerdown", this.#l), this.#m();
1639
+ }
1640
+ #s() {
1641
+ this.#e = getComputedStyle(this.table).gridTemplateColumns.split(/\s+/).map((e) => parseFloat(e));
1642
+ }
1643
+ #c() {
1644
+ this.table.style.gridTemplateColumns = this.#e.map((e) => `${e}px`).join(" ");
1645
+ }
1646
+ #l = (e) => {
1647
+ if (e.button !== 0) return;
1648
+ let t = e.target.closest?.(".table-resize-handle");
1649
+ if (!t || !this.table.contains(t)) return;
1650
+ let n = t.closest("ui-table-header");
1651
+ if (!n) return;
1652
+ let r = n.closest("ui-table-row");
1653
+ if (!r) return;
1654
+ let i = [...r.querySelectorAll("ui-table-header")];
1655
+ this.#s();
1656
+ let a = i.indexOf(n);
1657
+ a === -1 || a >= this.#e.length || (e.preventDefault(), e.stopPropagation(), this.table.style.width || (this.table.style.width = `${this.table.offsetWidth}px`), this.#i = !0, this.#t = a, this.#n = e.clientX, this.#r = this.#e[a], t.setPointerCapture(e.pointerId), this.table.setAttribute("resizing", ""), document.addEventListener("pointermove", this.#u), document.addEventListener("pointerup", this.#d), document.addEventListener("pointercancel", this.#f), document.addEventListener("keydown", this.#p), this.table.dispatchEvent(new CustomEvent("ui-table-resize-start", {
1658
+ bubbles: !0,
1659
+ composed: !0,
1660
+ detail: {
1661
+ column: a,
1662
+ width: this.#r
1663
+ }
1664
+ })));
1665
+ };
1666
+ #u = (e) => {
1667
+ if (!this.#i) return;
1668
+ let t = e.clientX - this.#n, n = Math.min(this.#o, Math.max(this.#a, this.#r + t));
1669
+ this.#e[this.#t] = n, this.#c(), this.table.dispatchEvent(new CustomEvent("ui-table-resize", {
1670
+ bubbles: !0,
1671
+ composed: !0,
1672
+ detail: {
1673
+ column: this.#t,
1674
+ width: n
1675
+ }
1676
+ }));
1677
+ };
1678
+ #d = (e) => {
1679
+ this.#i && (this.table.dispatchEvent(new CustomEvent("ui-table-resize-end", {
1680
+ bubbles: !0,
1681
+ composed: !0,
1682
+ detail: {
1683
+ column: this.#t,
1684
+ width: this.#e[this.#t],
1685
+ allWidths: [...this.#e]
1686
+ }
1687
+ })), this.#m());
1688
+ };
1689
+ #f = () => {
1690
+ this.#i && (this.#e[this.#t] = this.#r, this.#c(), this.#m());
1691
+ };
1692
+ #p = (e) => {
1693
+ e.key === "Escape" && this.#i && (e.preventDefault(), this.#e[this.#t] = this.#r, this.#c(), this.#m());
1694
+ };
1695
+ #m() {
1696
+ this.#i = !1, this.#t = -1, this.table.removeAttribute("resizing"), document.removeEventListener("pointermove", this.#u), document.removeEventListener("pointerup", this.#d), document.removeEventListener("pointercancel", this.#f), document.removeEventListener("keydown", this.#p);
1697
+ }
1698
+ }, U = class {
1699
+ #e;
1700
+ #t;
1701
+ #n;
1702
+ #r = !1;
1703
+ constructor(e, t) {
1704
+ this.#t = t, this.#n = e, this.#e = new o(e, {
1705
+ selector: "ui-table-row:not([colspan])",
1706
+ axis: "vertical",
1707
+ mode: "slot"
1708
+ }), e.addEventListener("ui-drag-start", this.#i), e.addEventListener("ui-drop", this.#a), e.addEventListener("click", this.#o, { capture: !0 });
1709
+ }
1710
+ #i = (e) => {
1711
+ this.#r = !0;
1712
+ let t = this.#n.querySelector(":scope > [popover][aria-hidden=\"true\"]");
1713
+ t && (t.style.gridTemplateColumns = getComputedStyle(this.#t).gridTemplateColumns, t.style.display = "grid", t.style.alignItems = "center");
1714
+ };
1715
+ #a = (e) => {
1716
+ let t = e.detail, n = new CustomEvent("ui-table-reorder", {
1717
+ bubbles: !0,
1718
+ composed: !0,
1719
+ cancelable: !0,
1720
+ detail: {
1721
+ row: t.item,
1722
+ fromIndex: t.fromIndex,
1723
+ toIndex: t.toIndex
1724
+ }
1725
+ });
1726
+ this.#t.dispatchEvent(n) && (t.insertBefore ? this.#n.insertBefore(t.item, t.insertBefore) : this.#n.appendChild(t.item));
1727
+ };
1728
+ #o = (e) => {
1729
+ this.#r &&= (e.stopPropagation(), !1);
1730
+ };
1731
+ destroy() {
1732
+ this.#n.removeEventListener("ui-drag-start", this.#i), this.#n.removeEventListener("ui-drop", this.#a), this.#n.removeEventListener("click", this.#o, { capture: !0 }), this.#e.destroy();
1733
+ }
1734
+ }, W = class extends d {
1735
+ static observedAttributes = [
1736
+ "selectable",
1737
+ "resizable",
1738
+ "reorderable"
1739
+ ];
1740
+ #e;
1741
+ #t = new B();
1742
+ #n = null;
1743
+ #r = null;
1744
+ #i = null;
1745
+ constructor() {
1746
+ super(), this.#e = this.attachInternals(), this.#e.role = "table";
1747
+ }
1748
+ get store() {
1749
+ return this.#t;
1750
+ }
1751
+ set store(e) {
1752
+ this.#t = e;
1753
+ }
1754
+ get selectable() {
1755
+ return this.hasAttribute("selectable");
1756
+ }
1757
+ set selectable(e) {
1758
+ this.toggleAttribute("selectable", e);
1759
+ }
1760
+ setup() {
1761
+ super.setup(), this.addEventListener("ui-sort", this.#c), this.addEventListener("ui-row-select", this.#l), this.deferChildren(() => {
1762
+ this.addEffect(() => {
1763
+ let e = this.#t.sortColumn.value, t = this.#t.sortDirection.value, n = this.querySelectorAll("ui-table-header[sortable]");
1764
+ for (let r of n) r.column === e ? (r.setAttribute("sort", t), r.setAttribute("aria-sort", t === "asc" ? "ascending" : t === "desc" ? "descending" : "none")) : (r.setAttribute("sort", "none"), r.removeAttribute("aria-sort"));
1765
+ }), this.addEffect(() => {
1766
+ let e = this.#t.selected.value, t = this.querySelectorAll("ui-table-body ui-table-row");
1767
+ for (let n of t) {
1768
+ let t = e.has(n.value);
1769
+ n.toggleAttribute("selected", t), n.setAttribute("aria-selected", t ? "true" : "false");
1770
+ }
1771
+ }), this.addEffect(() => {
1772
+ let e = this.#t.sortColumn.value, t = this.querySelectorAll("ui-table-body ui-table-row[colspan]");
1773
+ for (let n of t) n.toggleAttribute("hidden", e !== null);
1774
+ }), this.hasAttribute("resizable") && this.#a(), this.hasAttribute("sticky-header") && this.#o(), this.hasAttribute("reorderable") && this.#s();
1775
+ });
1776
+ }
1777
+ teardown() {
1778
+ this.#n?.destroy(), this.#n = null, this.#r?.disconnect(), this.#r = null, this.#i?.destroy(), this.#i = null, this.removeEventListener("ui-sort", this.#c), this.removeEventListener("ui-row-select", this.#l), super.teardown();
1779
+ }
1780
+ #a() {
1781
+ let e = this.querySelectorAll("ui-table-header");
1782
+ for (let t of e) {
1783
+ let e = document.createElement("div");
1784
+ e.className = "table-resize-handle", e.setAttribute("aria-hidden", "true"), e.addEventListener("click", (e) => e.stopPropagation()), t.appendChild(e);
1785
+ }
1786
+ this.#n = new H(this), this.#n.init();
1787
+ }
1788
+ #o() {
1789
+ let e = this.querySelector(":scope > ui-table-head > ui-table-row");
1790
+ e && (this.#r = new ResizeObserver((e) => {
1791
+ for (let t of e) {
1792
+ let e = t.borderBoxSize?.[0]?.blockSize ?? t.target.getBoundingClientRect().height;
1793
+ this.style.setProperty("--_header-height", `${e}px`);
1794
+ }
1795
+ }), this.#r.observe(e));
1796
+ }
1797
+ #s() {
1798
+ let e = this.querySelector(":scope > ui-table-body");
1799
+ e && (this.#i = new U(e, this));
1800
+ }
1801
+ #c = (e) => {
1802
+ let t = e.detail;
1803
+ this.#t.toggleSort(t.column), this.dispatchEvent(new CustomEvent("ui-table-sort", {
1804
+ bubbles: !0,
1805
+ composed: !0,
1806
+ detail: {
1807
+ column: this.#t.sortColumn.value,
1808
+ direction: this.#t.sortDirection.value
1809
+ }
1810
+ }));
1811
+ };
1812
+ #l = (e) => {
1813
+ if (!this.selectable) return;
1814
+ let t = e.detail;
1815
+ this.#t.toggle(t.value), this.dispatchEvent(new CustomEvent("ui-table-select", {
1816
+ bubbles: !0,
1817
+ composed: !0,
1818
+ detail: {
1819
+ value: t.value,
1820
+ selected: this.#t.isSelected(t.value),
1821
+ allSelected: [...this.#t.selected.value]
1822
+ }
1823
+ }));
1824
+ };
1825
+ }, ue = class extends d {
1826
+ #e;
1827
+ constructor() {
1828
+ super(), this.#e = this.attachInternals(), this.#e.role = "rowgroup";
1829
+ }
1830
+ }, de = class extends d {
1831
+ #e;
1832
+ constructor() {
1833
+ super(), this.#e = this.attachInternals(), this.#e.role = "rowgroup";
1834
+ }
1835
+ }, fe = class extends d {
1836
+ static observedAttributes = ["value", "selected"];
1837
+ #e;
1838
+ constructor() {
1839
+ super(), this.#e = this.attachInternals(), this.#e.role = "row";
1840
+ }
1841
+ get value() {
1842
+ return this.getAttribute("value") ?? "";
1843
+ }
1844
+ set value(e) {
1845
+ this.setAttribute("value", e);
1846
+ }
1847
+ get selected() {
1848
+ return this.hasAttribute("selected");
1849
+ }
1850
+ set selected(e) {
1851
+ this.toggleAttribute("selected", e);
1852
+ }
1853
+ setup() {
1854
+ super.setup(), this.addEventListener("click", this.#t);
1855
+ }
1856
+ teardown() {
1857
+ this.removeEventListener("click", this.#t), super.teardown();
1858
+ }
1859
+ #t = () => {
1860
+ this.hasAttribute("colspan") || this.closest("ui-table")?.hasAttribute("selectable") && this.dispatchEvent(new CustomEvent("ui-row-select", {
1861
+ bubbles: !0,
1862
+ composed: !0,
1863
+ detail: { value: this.value }
1864
+ }));
1865
+ };
1866
+ }, pe = class extends d {
1867
+ #e;
1868
+ constructor() {
1869
+ super(), this.#e = this.attachInternals(), this.#e.role = "cell";
1870
+ }
1871
+ }, me = class extends d {
1872
+ static observedAttributes = ["sort", "sortable"];
1873
+ #e;
1874
+ constructor() {
1875
+ super(), this.#e = this.attachInternals(), this.#e.role = "columnheader";
1876
+ }
1877
+ get column() {
1878
+ return this.getAttribute("column") ?? "";
1879
+ }
1880
+ get sortable() {
1881
+ return this.hasAttribute("sortable");
1882
+ }
1883
+ get sort() {
1884
+ return this.getAttribute("sort") ?? "none";
1885
+ }
1886
+ set sort(e) {
1887
+ this.setAttribute("sort", e);
1888
+ }
1889
+ setup() {
1890
+ super.setup(), this.sortable && (this.setAttribute("tabindex", "0"), this.addEventListener("click", this.#t), this.addEventListener("keydown", this.#n));
1891
+ }
1892
+ teardown() {
1893
+ this.removeEventListener("click", this.#t), this.removeEventListener("keydown", this.#n), super.teardown();
1894
+ }
1895
+ #t = () => {
1896
+ this.sortable && this.dispatchEvent(new CustomEvent("ui-sort", {
1897
+ bubbles: !0,
1898
+ composed: !0,
1899
+ detail: { column: this.column }
1900
+ }));
1901
+ };
1902
+ #n = (e) => {
1903
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.#t());
1904
+ };
1905
+ };
1906
+ function G(e) {
1907
+ if (!e) return null;
1908
+ let t = /* @__PURE__ */ new Date(e + "T00:00:00");
1909
+ return isNaN(t.getTime()) ? null : t;
1910
+ }
1911
+ function he(e) {
1912
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
1913
+ }
1914
+ function K(e, t) {
1915
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
1916
+ }
1917
+ var q = class {
1918
+ view;
1919
+ focusedYear;
1920
+ focusedMonth;
1921
+ value;
1922
+ rangeStart;
1923
+ rangeEnd;
1924
+ min;
1925
+ max;
1926
+ days;
1927
+ months;
1928
+ years;
1929
+ title;
1930
+ constructor(n = {}) {
1931
+ let r = /* @__PURE__ */ new Date(), i = G(n.value ?? null) ?? r;
1932
+ this.view = t("day"), this.focusedYear = t(i.getFullYear()), this.focusedMonth = t(i.getMonth()), this.value = t(n.value ?? null), this.rangeStart = t(n.rangeStart ?? null), this.rangeEnd = t(n.rangeEnd ?? null), this.min = t(n.min ?? null), this.max = t(n.max ?? null), this.days = e(() => this.#e()), this.months = e(() => this.#t()), this.years = e(() => this.#n()), this.title = e(() => this.#r());
1933
+ }
1934
+ prevMonth() {
1935
+ n(() => {
1936
+ this.focusedMonth.value === 0 ? (this.focusedMonth.value = 11, this.focusedYear.value--) : this.focusedMonth.value--;
1937
+ });
1938
+ }
1939
+ nextMonth() {
1940
+ n(() => {
1941
+ this.focusedMonth.value === 11 ? (this.focusedMonth.value = 0, this.focusedYear.value++) : this.focusedMonth.value++;
1942
+ });
1943
+ }
1944
+ prevYear() {
1945
+ this.focusedYear.value--;
1946
+ }
1947
+ nextYear() {
1948
+ this.focusedYear.value++;
1949
+ }
1950
+ prevDecade() {
1951
+ this.focusedYear.value -= 10;
1952
+ }
1953
+ nextDecade() {
1954
+ this.focusedYear.value += 10;
1955
+ }
1956
+ selectDate(e) {
1957
+ this.value.value = e;
1958
+ }
1959
+ selectMonth(e) {
1960
+ this.focusedMonth.value = e, this.view.value = "day";
1961
+ }
1962
+ selectYear(e) {
1963
+ this.focusedYear.value = e, this.view.value = "month";
1964
+ }
1965
+ setRange(e, t) {
1966
+ this.rangeStart.value = e, this.rangeEnd.value = t;
1967
+ }
1968
+ isDateDisabled(e) {
1969
+ let t = G(this.min.value), n = G(this.max.value), r = G(e);
1970
+ return !!(!r || t && r < t || n && r > n);
1971
+ }
1972
+ #e() {
1973
+ let e = this.focusedYear.value, t = this.focusedMonth.value, n = G(this.value.value), r = /* @__PURE__ */ new Date(), i = G(this.rangeStart.value), a = G(this.rangeEnd.value), o = new Date(e, t, 1).getDay(), s = new Date(e, t, 1 - o), c = [];
1974
+ for (let e = 0; e < 42; e++) {
1975
+ let o = new Date(s.getFullYear(), s.getMonth(), s.getDate() + e), l = he(o), u = o.getMonth() === t, d = K(o, r), f = n ? K(o, n) : !1, p = this.isDateDisabled(l), m = !1, h = !1, g = !1;
1976
+ if (i && a) {
1977
+ let e = i <= a ? i : a, t = i <= a ? a : i;
1978
+ m = o >= e && o <= t, h = K(o, e), g = K(o, t);
1979
+ }
1980
+ c.push({
1981
+ date: l,
1982
+ day: o.getDate(),
1983
+ inMonth: u,
1984
+ isToday: d,
1985
+ isSelected: f,
1986
+ isDisabled: p,
1987
+ inRange: m,
1988
+ isRangeStart: h,
1989
+ isRangeEnd: g
1990
+ });
1991
+ }
1992
+ return c;
1993
+ }
1994
+ #t() {
1995
+ let e = this.focusedYear.value, t = this.focusedMonth.value;
1996
+ return [
1997
+ "Jan",
1998
+ "Feb",
1999
+ "Mar",
2000
+ "Apr",
2001
+ "May",
2002
+ "Jun",
2003
+ "Jul",
2004
+ "Aug",
2005
+ "Sep",
2006
+ "Oct",
2007
+ "Nov",
2008
+ "Dec"
2009
+ ].map((n, r) => ({
2010
+ month: r,
2011
+ name: n,
2012
+ isCurrent: r === t && e === (/* @__PURE__ */ new Date()).getFullYear(),
2013
+ isSelected: r === t
2014
+ }));
2015
+ }
2016
+ #n() {
2017
+ let e = this.focusedYear.value, t = Math.floor(e / 10) * 10, n = (/* @__PURE__ */ new Date()).getFullYear(), r = [];
2018
+ for (let i = t - 1; i <= t + 10; i++) r.push({
2019
+ year: i,
2020
+ inDecade: i >= t && i < t + 10,
2021
+ isCurrent: i === n,
2022
+ isSelected: i === e
2023
+ });
2024
+ return r;
2025
+ }
2026
+ #r() {
2027
+ let e = [
2028
+ "January",
2029
+ "February",
2030
+ "March",
2031
+ "April",
2032
+ "May",
2033
+ "June",
2034
+ "July",
2035
+ "August",
2036
+ "September",
2037
+ "October",
2038
+ "November",
2039
+ "December"
2040
+ ];
2041
+ switch (this.view.value) {
2042
+ case "day": return `${e[this.focusedMonth.value]} ${this.focusedYear.value}`;
2043
+ case "month": return `${this.focusedYear.value}`;
2044
+ case "year": {
2045
+ let e = Math.floor(this.focusedYear.value / 10) * 10;
2046
+ return `${e}–${e + 9}`;
2047
+ }
2048
+ }
2049
+ }
2050
+ };
2051
+ function ge(e = {}) {
2052
+ return new q(e);
2053
+ }
2054
+ /**
2055
+ * Calendar date picker with day/month/year views and optional range selection.
2056
+ * @attr {string} value - Selected date in ISO format (YYYY-MM-DD)
2057
+ * @attr {string} min - Minimum selectable date in ISO format
2058
+ * @attr {string} max - Maximum selectable date in ISO format
2059
+ * @attr {boolean} disabled - Disables interaction
2060
+ * @attr {string} name - Form field name
2061
+ * @attr {boolean} range - Enables range selection mode
2062
+ * @fires ui-change - Fired on single date selection with `{ value }` detail
2063
+ * @fires ui-range-select - Fired on range commit with `{ start, end }` detail
2064
+ */
2065
+ var _e = class extends v(d) {
2066
+ static observedAttributes = [
2067
+ "value",
2068
+ "min",
2069
+ "max",
2070
+ "disabled",
2071
+ "name",
2072
+ "range",
2073
+ "required"
2074
+ ];
2075
+ #e;
2076
+ #t = new q();
2077
+ #n = t(!1);
2078
+ #r = t(!1);
2079
+ #i = null;
2080
+ #a = t(0);
2081
+ #o = "idle";
2082
+ constructor() {
2083
+ super(), this.#e = this.attachInternals(), this.#e.role = "group", this.setAttribute("tabindex", "0");
2084
+ }
2085
+ get store() {
2086
+ return this.#t;
2087
+ }
2088
+ get value() {
2089
+ return this.#t.value.value;
2090
+ }
2091
+ set value(e) {
2092
+ this.#t.value.value = e, e ? this.setAttribute("value", e) : this.removeAttribute("value");
2093
+ }
2094
+ get disabled() {
2095
+ return this.#n.value;
2096
+ }
2097
+ set disabled(e) {
2098
+ this.#n.value = e, this.toggleAttribute("disabled", e);
2099
+ }
2100
+ get required() {
2101
+ return this.#r.value;
2102
+ }
2103
+ set required(e) {
2104
+ this.#r.value = e, this.toggleAttribute("required", e);
2105
+ }
2106
+ get range() {
2107
+ return this.hasAttribute("range");
2108
+ }
2109
+ attributeChangedCallback(e, t, n) {
2110
+ if (t !== n) {
2111
+ switch (e) {
2112
+ case "value":
2113
+ this.#t.value.value = n;
2114
+ break;
2115
+ case "min":
2116
+ this.#t.min.value = n;
2117
+ break;
2118
+ case "max":
2119
+ this.#t.max.value = n;
2120
+ break;
2121
+ case "disabled":
2122
+ this.#n.value = n !== null;
2123
+ break;
2124
+ case "required":
2125
+ this.#r.value = n !== null;
2126
+ break;
2127
+ }
2128
+ super.attributeChangedCallback?.(e, t, n);
2129
+ }
2130
+ }
2131
+ setup() {
2132
+ super.setup(), this.#i = this.getAttribute("value");
2133
+ let e = this.getAttribute("value"), t = this.getAttribute("min"), r = this.getAttribute("max");
2134
+ n(() => {
2135
+ e && (this.#t.value.value = e), t && (this.#t.min.value = t), r && (this.#t.max.value = r);
2136
+ }), this.#s(), this.addEventListener("keydown", this.#b), this.addEffect(() => this.#c()), this.addEffect(() => {
2137
+ this.#e.setFormValue(this.#t.value.value);
2138
+ }), this.addEffect(h(this, this.#n, this.#e, { manageTabindex: !0 })), this.#r.value = this.hasAttribute("required"), this.addEffect(() => {
2139
+ let e = this.#t.value.value;
2140
+ this.#r.value && (e === null || e === "") ? this.#e.setValidity({ valueMissing: !0 }, "Please select a date.", this) : this.#e.setValidity({});
2141
+ });
2142
+ }
2143
+ teardown() {
2144
+ this.querySelector(".cal-prev")?.removeEventListener("click", this.#l), this.querySelector(".cal-next")?.removeEventListener("click", this.#u), this.querySelector(".cal-title")?.removeEventListener("click", this.#d);
2145
+ let e = this.querySelector(".cal-grid");
2146
+ e?.removeEventListener("click", this.#f), e?.removeEventListener("pointermove", this.#p), this.removeEventListener("keydown", this.#b), super.teardown();
2147
+ }
2148
+ onFormDisabled(e) {
2149
+ this.#n.value = e;
2150
+ }
2151
+ onFormReset() {
2152
+ this.#t.value.value = this.#i, this.#i ? this.setAttribute("value", this.#i) : this.removeAttribute("value");
2153
+ }
2154
+ #s() {
2155
+ this.innerHTML = "\n <div class=\"cal-header\">\n <button type=\"button\" class=\"cal-prev\" aria-label=\"Previous\" tabindex=\"-1\"></button>\n <button type=\"button\" class=\"cal-title\" tabindex=\"-1\"></button>\n <button type=\"button\" class=\"cal-next\" aria-label=\"Next\" tabindex=\"-1\"></button>\n </div>\n <div class=\"cal-weekdays\"></div>\n <div class=\"cal-grid\" role=\"grid\"></div>\n ";
2156
+ let e = this.querySelector(".cal-prev"), t = this.querySelector(".cal-next"), n = this.querySelector(".cal-title");
2157
+ e?.addEventListener("click", this.#l), t?.addEventListener("click", this.#u), n?.addEventListener("click", this.#d);
2158
+ let r = this.querySelector(".cal-grid");
2159
+ r?.addEventListener("click", this.#f), r?.addEventListener("pointermove", this.#p);
2160
+ }
2161
+ #c() {
2162
+ let e = this.#t.view.value, t = this.querySelector(".cal-title"), n = this.querySelector(".cal-weekdays"), r = this.querySelector(".cal-grid");
2163
+ !t || !n || !r || (t.textContent = this.#t.title.value, e === "day" ? (this.setAttribute("view", "day"), n.innerHTML = [
2164
+ "Su",
2165
+ "Mo",
2166
+ "Tu",
2167
+ "We",
2168
+ "Th",
2169
+ "Fr",
2170
+ "Sa"
2171
+ ].map((e) => `<span class="cal-weekday">${e}</span>`).join(""), r.innerHTML = this.#t.days.value.map((e, t) => {
2172
+ let n = `class="cal-cell" data-date="${e.date}" data-index="${t}" tabindex="-1"`;
2173
+ return e.inMonth || (n += " data-outside"), e.isToday && (n += " data-today"), e.isSelected && (n += " data-selected"), e.isDisabled && (n += " disabled"), e.inRange && (n += " data-in-range"), e.isRangeStart && (n += " data-range-start"), e.isRangeEnd && (n += " data-range-end"), `<button type="button" ${n}>${e.day}</button>`;
2174
+ }).join("")) : e === "month" ? (this.setAttribute("view", "month"), n.innerHTML = "", r.innerHTML = this.#t.months.value.map((e) => {
2175
+ let t = `class="cal-cell" data-month="${e.month}" tabindex="-1"`;
2176
+ return e.isCurrent && (t += " data-today"), e.isSelected && (t += " data-selected"), `<button type="button" ${t}>${e.name}</button>`;
2177
+ }).join("")) : (this.setAttribute("view", "year"), n.innerHTML = "", r.innerHTML = this.#t.years.value.map((e) => {
2178
+ let t = `class="cal-cell" data-year="${e.year}" tabindex="-1"`;
2179
+ return e.inDecade || (t += " data-outside"), e.isCurrent && (t += " data-today"), e.isSelected && (t += " data-selected"), `<button type="button" ${t}>${e.year}</button>`;
2180
+ }).join("")));
2181
+ }
2182
+ #l = () => {
2183
+ this.#m();
2184
+ };
2185
+ #u = () => {
2186
+ this.#h();
2187
+ };
2188
+ #d = () => {
2189
+ this.#g();
2190
+ };
2191
+ #f = (e) => {
2192
+ this.#_(e);
2193
+ };
2194
+ #p = (e) => {
2195
+ this.#y(e);
2196
+ };
2197
+ #m() {
2198
+ let e = this.#t.view.value;
2199
+ e === "day" ? this.#t.prevMonth() : e === "month" ? this.#t.prevYear() : this.#t.prevDecade();
2200
+ }
2201
+ #h() {
2202
+ let e = this.#t.view.value;
2203
+ e === "day" ? this.#t.nextMonth() : e === "month" ? this.#t.nextYear() : this.#t.nextDecade();
2204
+ }
2205
+ #g() {
2206
+ let e = this.#t.view.value;
2207
+ e === "day" ? this.#t.view.value = "month" : e === "month" && (this.#t.view.value = "year");
2208
+ }
2209
+ #_(e) {
2210
+ if (this.#n.value) return;
2211
+ let t = e.target.closest(".cal-cell");
2212
+ if (!t || t.hasAttribute("disabled")) return;
2213
+ let n = t.dataset.date, r = t.dataset.month, i = t.dataset.year;
2214
+ n ? this.#v(n) : r === void 0 ? i !== void 0 && this.#t.selectYear(Number(i)) : this.#t.selectMonth(Number(r));
2215
+ }
2216
+ #v(e) {
2217
+ if (this.range) if (this.#o === "idle") this.#t.selectDate(e), this.#t.setRange(e, null), this.setAttribute("value", e), this.#o = "selecting";
2218
+ else if (this.#o === "selecting") {
2219
+ let t = this.#t.rangeStart.value;
2220
+ if (!t) return;
2221
+ this.#t.setRange(t, e), this.#o = "committed", this.dispatchEvent(new CustomEvent("ui-range-select", {
2222
+ bubbles: !0,
2223
+ composed: !0,
2224
+ detail: {
2225
+ start: this.#t.rangeStart.value,
2226
+ end: this.#t.rangeEnd.value
2227
+ }
2228
+ }));
2229
+ } else this.#t.value.value = null, this.#t.setRange(null, null), this.removeAttribute("value"), this.#o = "idle";
2230
+ else this.#t.selectDate(e), this.setAttribute("value", e), this.dispatchEvent(new CustomEvent("ui-change", {
2231
+ bubbles: !0,
2232
+ composed: !0,
2233
+ detail: { value: e }
2234
+ }));
2235
+ }
2236
+ #y(e) {
2237
+ if (this.#n.value || !this.range || this.#o !== "selecting") return;
2238
+ let t = e.target.closest(".cal-cell");
2239
+ if (!t || t.hasAttribute("disabled")) return;
2240
+ let n = t.dataset.date;
2241
+ if (!n) return;
2242
+ let r = this.#t.rangeStart.value;
2243
+ r && this.#t.setRange(r, n);
2244
+ }
2245
+ #b = (e) => {
2246
+ if (this.#n.value || this.#t.view.value !== "day") return;
2247
+ let t = this.#t.days.value, n = this.#a.value, r = !0;
2248
+ switch (e.key) {
2249
+ case "ArrowRight":
2250
+ n += 1;
2251
+ break;
2252
+ case "ArrowLeft":
2253
+ --n;
2254
+ break;
2255
+ case "ArrowDown":
2256
+ n += 7;
2257
+ break;
2258
+ case "ArrowUp":
2259
+ n -= 7;
2260
+ break;
2261
+ case "Home":
2262
+ n -= n % 7;
2263
+ break;
2264
+ case "End":
2265
+ n = n - n % 7 + 6;
2266
+ break;
2267
+ case "PageDown":
2268
+ e.shiftKey ? this.#t.nextYear() : this.#t.nextMonth();
2269
+ break;
2270
+ case "PageUp":
2271
+ e.shiftKey ? this.#t.prevYear() : this.#t.prevMonth();
2272
+ break;
2273
+ case "Enter":
2274
+ case " ": {
2275
+ let e = t[n];
2276
+ e && !e.isDisabled && this.#v(e.date);
2277
+ break;
2278
+ }
2279
+ default: r = !1;
2280
+ }
2281
+ r && (e.preventDefault(), n = Math.max(0, Math.min(41, n)), this.#a.value = n, n < 0 && this.#t.prevMonth(), n > 41 && this.#t.nextMonth());
2282
+ };
2283
+ }, J = class {
2284
+ open = t(!1);
2285
+ value = t(null);
2286
+ label = t("");
2287
+ toggle() {
2288
+ this.open.value = !this.open.value;
2289
+ }
2290
+ show() {
2291
+ this.open.value = !0;
2292
+ }
2293
+ hide() {
2294
+ this.open.value = !1;
2295
+ }
2296
+ select(e, t) {
2297
+ n(() => {
2298
+ this.value.value = e, this.label.value = t, this.open.value = !1;
2299
+ });
2300
+ }
2301
+ reset() {
2302
+ n(() => {
2303
+ this.open.value = !1, this.value.value = null, this.label.value = "";
2304
+ });
2305
+ }
2306
+ }, ve = class extends v(d) {
2307
+ static observedAttributes = [
2308
+ "value",
2309
+ "disabled",
2310
+ "name",
2311
+ "options",
2312
+ "src",
2313
+ "placeholder",
2314
+ "required"
2315
+ ];
2316
+ #e;
2317
+ #t = new J();
2318
+ #n = t(!1);
2319
+ #r = t(!1);
2320
+ #i;
2321
+ #a = t([]);
2322
+ #o = t(null);
2323
+ #s = t("");
2324
+ #c = !1;
2325
+ #l = null;
2326
+ #u = null;
2327
+ #d = null;
2328
+ constructor() {
2329
+ super(), this.#e = this.attachInternals();
2330
+ }
2331
+ get controller() {
2332
+ return this.#t;
2333
+ }
2334
+ get value() {
2335
+ return this.#t.value.value;
2336
+ }
2337
+ set value(e) {
2338
+ if (e === null) {
2339
+ this.#t.reset();
2340
+ return;
2341
+ }
2342
+ let t = this.querySelector(`ui-option[value="${CSS.escape(e)}"]`), n = t?.getAttribute("label") ?? t?.textContent?.trim() ?? e;
2343
+ this.#t.select(e, n);
2344
+ }
2345
+ get name() {
2346
+ return this.getAttribute("name") ?? "";
2347
+ }
2348
+ set name(e) {
2349
+ this.setAttribute("name", e);
2350
+ }
2351
+ get disabled() {
2352
+ return this.#n.value;
2353
+ }
2354
+ set disabled(e) {
2355
+ this.#n.value = e, this.toggleAttribute("disabled", e);
2356
+ }
2357
+ get required() {
2358
+ return this.#r.value;
2359
+ }
2360
+ set required(e) {
2361
+ this.#r.value = e, this.toggleAttribute("required", e);
2362
+ }
2363
+ get options() {
2364
+ return this.#a.value;
2365
+ }
2366
+ set options(e) {
2367
+ this.#a.value = e, this.setAttribute("options", JSON.stringify(e));
2368
+ }
2369
+ get src() {
2370
+ return this.#o.value;
2371
+ }
2372
+ set src(e) {
2373
+ this.#o.value = e, e == null ? this.removeAttribute("src") : this.setAttribute("src", e);
2374
+ }
2375
+ get placeholder() {
2376
+ return this.#s.value;
2377
+ }
2378
+ set placeholder(e) {
2379
+ this.#s.value = e, e ? this.setAttribute("placeholder", e) : this.removeAttribute("placeholder");
2380
+ }
2381
+ #f(e) {
2382
+ return S(e, "ui-select");
2383
+ }
2384
+ async #p(e) {
2385
+ this.#l = await C(e, this.#l, this.#a, "ui-select");
2386
+ }
2387
+ #m() {
2388
+ let e = document.createElement("ui-button");
2389
+ e.setAttribute("justify", "spread");
2390
+ let t = document.createElement("span");
2391
+ t.setAttribute("slot", "label"), t.textContent = this.#s.value || "\xA0", e.appendChild(t);
2392
+ let n = document.createElement("ui-icon");
2393
+ n.setAttribute("name", "caret-up-down"), n.setAttribute("slot", "trailing"), e.appendChild(n);
2394
+ let r = document.createElement("ui-listbox");
2395
+ r.setAttribute("popover", "manual"), this.appendChild(e), this.appendChild(r);
2396
+ }
2397
+ #h(e) {
2398
+ let t = this.#u;
2399
+ if (t) {
2400
+ for (; t.firstChild;) t.removeChild(t.firstChild);
2401
+ for (let n of e) {
2402
+ let e = document.createElement("ui-option");
2403
+ e.setAttribute("value", n.value), e.setAttribute("label", n.label), e.textContent = n.label, n.disabled && e.setAttribute("disabled", ""), t.appendChild(e);
2404
+ }
2405
+ }
2406
+ }
2407
+ attributeChangedCallback(e, t, n) {
2408
+ if (t !== n) {
2409
+ switch (e) {
2410
+ case "disabled":
2411
+ this.#n.value = n !== null;
2412
+ break;
2413
+ case "required":
2414
+ this.#r.value = n !== null;
2415
+ break;
2416
+ case "options":
2417
+ n ? this.#a.value = this.#f(n) : this.#a.value = [];
2418
+ break;
2419
+ case "src":
2420
+ this.#o.value = n;
2421
+ break;
2422
+ case "placeholder":
2423
+ this.#s.value = n ?? "";
2424
+ break;
2425
+ }
2426
+ super.attributeChangedCallback?.(e, t, n);
2427
+ }
2428
+ }
2429
+ setup() {
2430
+ if (super.setup(), this.#i = new f(this), this.#c = this.hasAttribute("options") || this.hasAttribute("src"), this.#c) {
2431
+ let e = this.getAttribute("options");
2432
+ e && (this.#a.value = this.#f(e)), this.#o.value = this.getAttribute("src"), this.#s.value = this.getAttribute("placeholder") ?? "", this.#m();
2433
+ }
2434
+ let e = this.querySelector(":scope > ui-button");
2435
+ this.#d = e;
2436
+ let t = this.querySelector(":scope > ui-listbox[popover]");
2437
+ this.#u = t, t?.setAttribute("popover", "manual"), e && t && this.#i.wirePopover(e, t), e?.setAttribute("aria-haspopup", "listbox"), this.deferChildren(() => {
2438
+ let n = this.getAttribute("value");
2439
+ if (n) {
2440
+ let e = this.querySelector(`ui-option[value="${CSS.escape(n)}"]`), t = e?.getAttribute("label") ?? e?.textContent?.trim() ?? n;
2441
+ this.#t.value.value = n, this.#t.label.value = t;
2442
+ }
2443
+ this.addEffect(() => {
2444
+ let t = this.#t.label.value, n = e?.querySelector("[slot=\"label\"]");
2445
+ n && (n.textContent = t || (this.#c ? this.#s.value || "\xA0" : n.textContent ?? ""));
2446
+ }), this.addEffect(() => {
2447
+ let e = this.#t.value.value, n = t?.querySelectorAll("ui-option") ?? [];
2448
+ for (let t of n) {
2449
+ let n = t.getAttribute("value") === e;
2450
+ t.setAttribute("aria-selected", String(n));
2451
+ }
2452
+ }), this.#c && (this.addEffect(() => {
2453
+ let e = this.#a.value;
2454
+ this.#h(e);
2455
+ }), this.addEffect(() => {
2456
+ let e = this.#o.value;
2457
+ e && this.#p(e);
2458
+ }), this.addEffect(() => {
2459
+ let t = this.#s.value, n = this.#t.label.value, r = e?.querySelector("[slot=\"label\"]");
2460
+ r && !n && (r.textContent = t || "\xA0");
2461
+ }));
2462
+ }), this.addEffect(h(this, this.#n, this.#e)), this.addEffect(() => {
2463
+ let t = this.#n.value;
2464
+ e && e.toggleAttribute("disabled", t), t && this.#t.open.value && this.#t.hide();
2465
+ }), this.#r.value = this.hasAttribute("required"), this.addEffect(() => {
2466
+ let e = this.#t.value.value;
2467
+ this.#r.value && (e === null || e === "") ? this.#e.setValidity({ valueMissing: !0 }, "Please select an option.", this) : this.#e.setValidity({});
2468
+ }), this.addEffect(() => {
2469
+ let t = this.#t.open.value;
2470
+ this.#i.syncPopover(t), e?.setAttribute("aria-expanded", String(t));
2471
+ }), this.addEffect(() => {
2472
+ let e = this.#t.value.value;
2473
+ this.#e.setFormValue(e ?? ""), e == null ? this.removeAttribute("value") : this.setAttribute("value", e);
2474
+ }), e?.addEventListener("ui-press", this.#g), this.addEventListener("ui-change", this.#_), this.addEventListener("ui-select", this.#v), this.addEventListener("ui-dismiss", this.#y), e?.addEventListener("keydown", this.#b);
2475
+ }
2476
+ #g = () => {
2477
+ this.#n.value || this.#t.toggle();
2478
+ };
2479
+ #_ = (e) => {
2480
+ e.target !== this && e.stopImmediatePropagation();
2481
+ };
2482
+ #v = (e) => {
2483
+ let t = e.detail;
2484
+ this.#t.select(t.value, t.label), this.dispatchEvent(new CustomEvent("ui-change", {
2485
+ bubbles: !0,
2486
+ composed: !0,
2487
+ detail: t
2488
+ }));
2489
+ };
2490
+ #y = () => {
2491
+ this.#t.hide();
2492
+ };
2493
+ #b = (e) => {
2494
+ if (this.#n.value) return;
2495
+ let t = this.#u;
2496
+ switch (e.key) {
2497
+ case "ArrowDown":
2498
+ case "ArrowUp": {
2499
+ e.preventDefault();
2500
+ let n = t?.controller;
2501
+ if (this.#t.open.value || this.#t.show(), n) {
2502
+ let r = t?.querySelectorAll(":scope > ui-option:not([disabled])")?.length ?? 0;
2503
+ n.moveActive(e.key === "ArrowDown" ? 1 : -1, r);
2504
+ }
2505
+ break;
2506
+ }
2507
+ case "Enter":
2508
+ case " ":
2509
+ if (e.preventDefault(), this.#t.open.value) {
2510
+ let e = t?.getActiveOption();
2511
+ e && e.click();
2512
+ } else this.#t.toggle();
2513
+ break;
2514
+ case "Escape":
2515
+ this.#t.open.value && (e.preventDefault(), this.#t.hide());
2516
+ break;
2517
+ case "Home": {
2518
+ e.preventDefault();
2519
+ let n = t?.controller;
2520
+ n && (n.activeIndex.value = 0);
2521
+ break;
2522
+ }
2523
+ case "End": {
2524
+ e.preventDefault();
2525
+ let n = t?.controller;
2526
+ if (n) {
2527
+ let e = t?.querySelectorAll(":scope > ui-option:not([disabled])");
2528
+ n.activeIndex.value = Math.max(0, (e?.length ?? 1) - 1);
2529
+ }
2530
+ break;
2531
+ }
2532
+ }
2533
+ };
2534
+ teardown() {
2535
+ this.#d?.removeEventListener("ui-press", this.#g), this.#d?.removeEventListener("keydown", this.#b), this.removeEventListener("ui-change", this.#_), this.removeEventListener("ui-select", this.#v), this.removeEventListener("ui-dismiss", this.#y), this.#d = null, this.#l?.abort(), this.#l = null, this.#u = null, this.#i.destroy(), super.teardown();
2536
+ }
2537
+ onFormReset() {
2538
+ this.#t.reset();
2539
+ }
2540
+ onFormDisabled(e) {
2541
+ this.#n.value = e;
2542
+ }
2543
+ }, ye = class extends v(d) {
2544
+ static observedAttributes = [
2545
+ "value",
2546
+ "disabled",
2547
+ "name",
2548
+ "options",
2549
+ "src",
2550
+ "placeholder",
2551
+ "required"
2552
+ ];
2553
+ #e;
2554
+ #t = new b();
2555
+ #n = t(!1);
2556
+ #r = t(!1);
2557
+ #i = t(!1);
2558
+ #a;
2559
+ #o = r("listbox");
2560
+ #s = null;
2561
+ #c = t([]);
2562
+ #l = t(null);
2563
+ #u = t("");
2564
+ #d = !1;
2565
+ #f = null;
2566
+ #p = null;
2567
+ constructor() {
2568
+ super(), this.#e = this.attachInternals();
2569
+ }
2570
+ get store() {
2571
+ return this.#t;
2572
+ }
2573
+ get value() {
2574
+ return this.#t.value.value;
2575
+ }
2576
+ set value(e) {
2577
+ if (e === null) {
2578
+ n(() => {
2579
+ this.#t.clearSelection(), this.#t.query.value = "", this.#t.activeIndex.value = -1, this.#n.value = !1;
2580
+ });
2581
+ return;
2582
+ }
2583
+ this.#t.select(e);
2584
+ }
2585
+ get name() {
2586
+ return this.getAttribute("name") ?? "";
2587
+ }
2588
+ set name(e) {
2589
+ this.setAttribute("name", e);
2590
+ }
2591
+ get disabled() {
2592
+ return this.#r.value;
2593
+ }
2594
+ set disabled(e) {
2595
+ this.#r.value = e, this.toggleAttribute("disabled", e);
2596
+ }
2597
+ get required() {
2598
+ return this.#i.value;
2599
+ }
2600
+ set required(e) {
2601
+ this.#i.value = e, this.toggleAttribute("required", e);
2602
+ }
2603
+ get options() {
2604
+ return this.#c.value;
2605
+ }
2606
+ set options(e) {
2607
+ this.#c.value = e, this.setAttribute("options", JSON.stringify(e));
2608
+ }
2609
+ get src() {
2610
+ return this.#l.value;
2611
+ }
2612
+ set src(e) {
2613
+ this.#l.value = e, e == null ? this.removeAttribute("src") : this.setAttribute("src", e);
2614
+ }
2615
+ get placeholder() {
2616
+ return this.#u.value;
2617
+ }
2618
+ set placeholder(e) {
2619
+ this.#u.value = e, e ? this.setAttribute("placeholder", e) : this.removeAttribute("placeholder");
2620
+ }
2621
+ #m(e) {
2622
+ return S(e, "ui-combobox");
2623
+ }
2624
+ async #h(e) {
2625
+ this.#f = await C(e, this.#f, this.#c, "ui-combobox");
2626
+ }
2627
+ #g() {
2628
+ let e = document.createElement("ui-input"), t = this.#u.value;
2629
+ t && e.setAttribute("placeholder", t);
2630
+ let n = this.getAttribute("size");
2631
+ n && e.setAttribute("size", n);
2632
+ let r = document.createElement("ui-listbox");
2633
+ r.setAttribute("popover", "manual"), this.appendChild(e), this.appendChild(r);
2634
+ }
2635
+ #_(e) {
2636
+ let t = this.#p;
2637
+ if (t) {
2638
+ for (; t.firstChild;) t.removeChild(t.firstChild);
2639
+ for (let n of e) {
2640
+ let e = document.createElement("ui-option");
2641
+ e.setAttribute("value", n.value), e.setAttribute("label", n.label), e.textContent = n.label, n.disabled && e.setAttribute("disabled", ""), t.appendChild(e);
2642
+ }
2643
+ this.#t.data.value = e;
2644
+ }
2645
+ }
2646
+ attributeChangedCallback(e, t, n) {
2647
+ if (t !== n) {
2648
+ switch (e) {
2649
+ case "disabled":
2650
+ this.#r.value = n !== null;
2651
+ break;
2652
+ case "required":
2653
+ this.#i.value = n !== null;
2654
+ break;
2655
+ case "options":
2656
+ n ? this.#c.value = this.#m(n) : this.#c.value = [];
2657
+ break;
2658
+ case "src":
2659
+ this.#l.value = n;
2660
+ break;
2661
+ case "placeholder":
2662
+ this.#u.value = n ?? "";
2663
+ break;
2664
+ }
2665
+ super.attributeChangedCallback?.(e, t, n);
2666
+ }
2667
+ }
2668
+ setup() {
2669
+ if (super.setup(), this.#a = new f(this), this.#d = this.hasAttribute("options") || this.hasAttribute("src"), this.#d) {
2670
+ let e = this.getAttribute("options");
2671
+ e && (this.#c.value = this.#m(e)), this.#l.value = this.getAttribute("src"), this.#u.value = this.getAttribute("placeholder") ?? "", this.#g();
2672
+ }
2673
+ let e = this.querySelector(":scope > ui-input");
2674
+ this.#s = e;
2675
+ let t = this.querySelector(":scope > ui-listbox[popover]");
2676
+ this.#p = t, t?.setAttribute("popover", "manual"), t?.setAttribute("virtual-focus", ""), e && t && (this.#a.wirePopover(e, t), t.id ||= this.#o), e?.setAttribute("role", "combobox"), e?.setAttribute("aria-autocomplete", "list"), e?.setAttribute("aria-controls", t?.id ?? ""), e?.setAttribute("aria-expanded", "false"), this.deferChildren(() => {
2677
+ if (!this.#d) {
2678
+ let e = t?.querySelectorAll("ui-option") ?? [];
2679
+ this.#t.data.value = [...e].map((e) => ({
2680
+ value: e.getAttribute("value") ?? "",
2681
+ label: e.getAttribute("label") ?? e.textContent?.trim() ?? ""
2682
+ }));
2683
+ }
2684
+ let n = this.getAttribute("value");
2685
+ if (n) {
2686
+ let e = this.querySelector(`ui-option[value="${CSS.escape(n)}"]`), t = e?.getAttribute("label") ?? e?.textContent?.trim() ?? n;
2687
+ this.#t.value.value = n, this.#t.query.value = t;
2688
+ }
2689
+ this.addEffect(() => {
2690
+ let e = this.#t.view.value, n = new Set(e.map((e) => e.value)), r = t?.querySelectorAll("ui-option") ?? [];
2691
+ for (let e of r) e.toggleAttribute("hidden", !n.has(e.getAttribute("value") ?? ""));
2692
+ }), this.addEffect(() => {
2693
+ this.#t.view.value;
2694
+ let n = this.#t.activeIndex.value, i = [...t?.querySelectorAll("ui-option:not([hidden]):not([disabled])") ?? []];
2695
+ for (let e = 0; e < i.length; e++) i[e].toggleAttribute("active", e === n);
2696
+ let a = i[n];
2697
+ a ? (a.scrollIntoView({ block: "nearest" }), a.id ||= r("opt"), e?.setAttribute("aria-activedescendant", a.id)) : e?.removeAttribute("aria-activedescendant");
2698
+ }), this.addEffect(() => {
2699
+ let e = this.#t.value.value, n = t?.querySelectorAll("ui-option") ?? [];
2700
+ for (let t of n) {
2701
+ let n = t.getAttribute("value") === e;
2702
+ t.setAttribute("aria-selected", String(n));
2703
+ }
2704
+ }), this.#d && (this.addEffect(() => {
2705
+ let e = this.#c.value;
2706
+ this.#_(e);
2707
+ }), this.addEffect(() => {
2708
+ let e = this.#l.value;
2709
+ e && this.#h(e);
2710
+ }), this.addEffect(() => {
2711
+ let t = this.#u.value;
2712
+ e && (t ? e.setAttribute("placeholder", t) : e.removeAttribute("placeholder"));
2713
+ }));
2714
+ }), this.addEffect(h(this, this.#r, this.#e)), this.addEffect(() => {
2715
+ let t = this.#r.value;
2716
+ e && e.toggleAttribute("disabled", t), t && this.#n.value && (this.#n.value = !1);
2717
+ }), this.#i.value = this.hasAttribute("required"), this.addEffect(() => {
2718
+ let e = this.#t.value.value;
2719
+ this.#i.value && (e === null || e === "") ? this.#e.setValidity({ valueMissing: !0 }, "Please select an option.", this) : this.#e.setValidity({});
2720
+ }), this.addEffect(() => {
2721
+ let t = this.#n.value;
2722
+ this.#a.syncPopover(t), e?.setAttribute("aria-expanded", String(t));
2723
+ }), this.addEffect(() => {
2724
+ let e = this.#t.value.value;
2725
+ this.#e.setFormValue(e ?? ""), e == null ? this.removeAttribute("value") : this.setAttribute("value", e);
2726
+ }), e?.addEventListener("focus", this.#v), this.addEventListener("ui-input", this.#y), this.addEventListener("ui-change", this.#b), this.addEventListener("ui-select", this.#x), this.addEventListener("ui-dismiss", this.#S), e?.addEventListener("keydown", this.#C);
2727
+ }
2728
+ #v = () => {
2729
+ !this.#r.value && !this.#n.value && (this.#n.value = !0);
2730
+ };
2731
+ #y = (e) => {
2732
+ this.#t.setQuery(e.detail.value), this.#n.value = !0;
2733
+ };
2734
+ #b = (e) => {
2735
+ e.target !== this && e.stopImmediatePropagation();
2736
+ };
2737
+ #x = (e) => {
2738
+ let t = e.detail;
2739
+ n(() => {
2740
+ this.#t.select(t.value), this.#t.query.value = t.label, this.#t.activeIndex.value = -1, this.#n.value = !1;
2741
+ });
2742
+ let r = this.#s;
2743
+ r && "value" in r && (r.value = t.label), this.dispatchEvent(new CustomEvent("ui-change", {
2744
+ bubbles: !0,
2745
+ composed: !0,
2746
+ detail: t
2747
+ }));
2748
+ };
2749
+ #S = () => {
2750
+ this.#n.value = !1;
2751
+ };
2752
+ #C = (e) => {
2753
+ if (this.#r.value) return;
2754
+ let t = this.#s;
2755
+ switch (e.key) {
2756
+ case "ArrowDown":
2757
+ e.preventDefault(), this.#n.value || (this.#n.value = !0), this.#t.moveActive(1);
2758
+ break;
2759
+ case "ArrowUp":
2760
+ e.preventDefault(), this.#n.value || (this.#n.value = !0), this.#t.moveActive(-1);
2761
+ break;
2762
+ case "Enter":
2763
+ if (this.#n.value) {
2764
+ e.preventDefault();
2765
+ let n = this.#t.activeItem.value;
2766
+ this.#t.selectActive(), n && t && "value" in t && (this.#t.query.value = n.label, t.value = n.label), this.#t.activeIndex.value = -1, this.#n.value = !1;
2767
+ }
2768
+ break;
2769
+ case "Escape":
2770
+ this.#n.value && (e.preventDefault(), this.#n.value = !1);
2771
+ break;
2772
+ case "Home":
2773
+ this.#n.value && (e.preventDefault(), this.#t.activeIndex.value = 0);
2774
+ break;
2775
+ case "End":
2776
+ if (this.#n.value) {
2777
+ e.preventDefault();
2778
+ let t = this.#t.view.value.length;
2779
+ this.#t.activeIndex.value = Math.max(0, t - 1);
2780
+ }
2781
+ break;
2782
+ }
2783
+ };
2784
+ teardown() {
2785
+ this.#s?.removeEventListener("focus", this.#v), this.#s?.removeEventListener("keydown", this.#C), this.removeEventListener("ui-input", this.#y), this.removeEventListener("ui-change", this.#b), this.removeEventListener("ui-select", this.#x), this.removeEventListener("ui-dismiss", this.#S), this.#s = null, this.#p = null, this.#f?.abort(), this.#f = null, this.#a.destroy(), super.teardown();
2786
+ }
2787
+ onFormReset() {
2788
+ n(() => {
2789
+ this.#t.clearSelection(), this.#t.query.value = "", this.#t.activeIndex.value = -1, this.#n.value = !1;
2790
+ });
2791
+ let e = this.querySelector(":scope > ui-input");
2792
+ e && (e.value = "");
2793
+ }
2794
+ onFormDisabled(e) {
2795
+ this.#r.value = e;
2796
+ }
2797
+ }, be = class extends d {
2798
+ static observedAttributes = ["disabled", "required"];
2799
+ #e = r("field-label");
2800
+ #t = r("field-desc");
2801
+ #n = r("field-err");
2802
+ #r = null;
2803
+ setup() {
2804
+ super.setup(), this.deferChildren(() => {
2805
+ this.#i(), this.#a(), this.#o(), this.#s(), this.#c();
2806
+ }), this.addEventListener("ui-invalid", this.#l), this.addEventListener("ui-valid", this.#u);
2807
+ }
2808
+ teardown() {
2809
+ this.removeEventListener("ui-invalid", this.#l), this.removeEventListener("ui-valid", this.#u), super.teardown();
2810
+ }
2811
+ attributeChangedCallback(e, t, n) {
2812
+ if (t !== n) {
2813
+ switch (e) {
2814
+ case "disabled":
2815
+ this.#s();
2816
+ break;
2817
+ case "required":
2818
+ this.#c();
2819
+ break;
2820
+ }
2821
+ super.attributeChangedCallback(e, t, n);
2822
+ }
2823
+ }
2824
+ #i() {
2825
+ let e = this.querySelectorAll("ui-input, ui-select, ui-combobox, ui-checkbox, ui-switch, ui-radio, ui-range, ui-textarea, ui-input-otp, input, select, textarea");
2826
+ for (let t of e) if (!t.hasAttribute("slot")) {
2827
+ this.#r = t;
2828
+ break;
2829
+ }
2830
+ }
2831
+ #a() {
2832
+ let e = this.querySelector("[slot=\"label\"]"), t = this.querySelector("[slot=\"description\"]"), n = this.querySelector("[slot=\"error\"]");
2833
+ e && !e.id && (e.id = this.#e), t && !t.id && (t.id = this.#t), n && !n.id && (n.id = this.#n);
2834
+ }
2835
+ #o() {
2836
+ if (!this.#r) return;
2837
+ let e = this.querySelector("[slot=\"label\"]"), t = this.querySelector("[slot=\"description\"]"), n = this.querySelector("[slot=\"error\"]");
2838
+ e && this.#r.setAttribute("aria-labelledby", e.id);
2839
+ let r = [];
2840
+ t && r.push(t.id), n && r.push(n.id), r.length && this.#r.setAttribute("aria-describedby", r.join(" "));
2841
+ }
2842
+ #s() {
2843
+ this.#r && (this.hasAttribute("disabled") ? this.#r.setAttribute("disabled", "") : this.#r.removeAttribute("disabled"));
2844
+ }
2845
+ #c() {
2846
+ this.#r && (this.hasAttribute("required") ? this.#r.setAttribute("required", "") : this.#r.removeAttribute("required"));
2847
+ }
2848
+ #l = (e) => {
2849
+ let t = e;
2850
+ this.setAttribute("invalid", "");
2851
+ let n = this.querySelector("[slot=\"error\"]");
2852
+ n && t.detail?.message && (n.textContent = t.detail.message);
2853
+ };
2854
+ #u = () => {
2855
+ this.removeAttribute("invalid");
2856
+ };
2857
+ }, xe = class extends v(d) {
2858
+ static observedAttributes = [
2859
+ "value",
2860
+ "placeholder",
2861
+ "disabled",
2862
+ "readonly",
2863
+ "required",
2864
+ "name",
2865
+ "rows",
2866
+ "maxlength",
2867
+ "autogrow"
2868
+ ];
2869
+ #e;
2870
+ #t = t(!1);
2871
+ #n = t(!1);
2872
+ #r = t("");
2873
+ #i = 0;
2874
+ constructor() {
2875
+ super(), this.#e = this.attachInternals(), this.#e.role = "textbox", this.#e.ariaMultiLine = "true", this.setAttribute("aria-multiline", "true");
2876
+ }
2877
+ get value() {
2878
+ return this.textContent ?? "";
2879
+ }
2880
+ set value(e) {
2881
+ this.textContent = e, this.#r.value = e, this.#e.setFormValue(e), this.#a(), this.#o();
2882
+ }
2883
+ get placeholder() {
2884
+ return this.getAttribute("placeholder") ?? "";
2885
+ }
2886
+ set placeholder(e) {
2887
+ this.setAttribute("placeholder", e);
2888
+ }
2889
+ get name() {
2890
+ return this.getAttribute("name") ?? "";
2891
+ }
2892
+ set name(e) {
2893
+ this.setAttribute("name", e);
2894
+ }
2895
+ get disabled() {
2896
+ return this.#t.value;
2897
+ }
2898
+ set disabled(e) {
2899
+ this.#t.value = e, this.toggleAttribute("disabled", e);
2900
+ }
2901
+ get readOnly() {
2902
+ return this.hasAttribute("readonly");
2903
+ }
2904
+ set readOnly(e) {
2905
+ this.toggleAttribute("readonly", e), this.setAttribute("contenteditable", e ? "false" : "plaintext-only");
2906
+ }
2907
+ get required() {
2908
+ return this.#n.value;
2909
+ }
2910
+ set required(e) {
2911
+ this.#n.value = e, this.toggleAttribute("required", e);
2912
+ }
2913
+ attributeChangedCallback(e, t, n) {
2914
+ if (t !== n) {
2915
+ switch (e) {
2916
+ case "value":
2917
+ this.textContent = n ?? "", this.#r.value = n ?? "", this.#e.setFormValue(n ?? ""), this.#a(), this.#o();
2918
+ break;
2919
+ case "disabled":
2920
+ this.#t.value = n !== null, this.setAttribute("contenteditable", n !== null || this.hasAttribute("readonly") ? "false" : "plaintext-only");
2921
+ break;
2922
+ case "readonly":
2923
+ this.setAttribute("contenteditable", n !== null || this.#t.value ? "false" : "plaintext-only");
2924
+ break;
2925
+ case "required":
2926
+ this.#n.value = n !== null;
2927
+ break;
2928
+ case "autogrow":
2929
+ this.#o();
2930
+ break;
2931
+ }
2932
+ super.attributeChangedCallback?.(e, t, n);
2933
+ }
2934
+ }
2935
+ setup() {
2936
+ super.setup(), this.hasAttribute("contenteditable") || this.setAttribute("contenteditable", "plaintext-only"), this.#n.value = this.hasAttribute("required"), this.#r.value = this.textContent ?? "", this.#a(), this.#o(), this.addEffect(h(this, this.#t, this.#e, { manageTabindex: !0 })), this.addEffect(() => {
2937
+ this.#n.value && this.#r.value === "" ? this.#e.setValidity({ valueMissing: !0 }, "Please fill out this field.", this) : this.#e.setValidity({});
2938
+ }), this.addEventListener("input", this.#s), this.addEventListener("blur", this.#c);
2939
+ }
2940
+ teardown() {
2941
+ cancelAnimationFrame(this.#i), this.removeEventListener("input", this.#s), this.removeEventListener("blur", this.#c), super.teardown();
2942
+ }
2943
+ onFormDisabled(e) {
2944
+ this.#t.value = e, this.setAttribute("contenteditable", e || this.hasAttribute("readonly") ? "false" : "plaintext-only");
2945
+ }
2946
+ onFormReset() {
2947
+ this.textContent = "", this.#r.value = "", this.#e.setFormValue(""), this.#a(), this.#t.value = this.hasAttribute("disabled");
2948
+ }
2949
+ #a() {
2950
+ (this.textContent ?? "").trim() === "" ? this.#e.states.add("empty") : this.#e.states.delete("empty");
2951
+ }
2952
+ #o() {
2953
+ !this.hasAttribute("autogrow") || !this.isConnected || (this.style.setProperty("--_autogrow-height", "auto"), cancelAnimationFrame(this.#i), this.#i = requestAnimationFrame(() => {
2954
+ this.style.setProperty("--_autogrow-height", `${this.scrollHeight}px`);
2955
+ }));
2956
+ }
2957
+ #s = () => {
2958
+ let e = this.textContent ?? "", t = this.getAttribute("maxlength");
2959
+ if (t !== null) {
2960
+ let n = parseInt(t, 10);
2961
+ if (!isNaN(n) && e.length > n) {
2962
+ this.textContent = e.slice(0, n);
2963
+ let t = window.getSelection();
2964
+ t && (t.selectAllChildren(this), t.collapseToEnd());
2965
+ }
2966
+ }
2967
+ let n = this.textContent ?? "";
2968
+ this.#r.value = n, this.#e.setFormValue(n), this.#a(), this.#o(), this.dispatchEvent(new CustomEvent("ui-input", {
2969
+ bubbles: !0,
2970
+ composed: !0,
2971
+ detail: { value: n }
2972
+ }));
2973
+ };
2974
+ #c = () => {
2975
+ this.dispatchEvent(new CustomEvent("ui-change", {
2976
+ bubbles: !0,
2977
+ composed: !0,
2978
+ detail: { value: this.textContent ?? "" }
2979
+ }));
2980
+ };
2981
+ }, Se = class extends v(d) {
2982
+ static observedAttributes = [
2983
+ "value",
2984
+ "min",
2985
+ "max",
2986
+ "step",
2987
+ "disabled",
2988
+ "name"
2989
+ ];
2990
+ #e;
2991
+ #t = t(!1);
2992
+ #n = t(50);
2993
+ #r = 50;
2994
+ #i = t(0);
2995
+ #a = t(100);
2996
+ #o = t(1);
2997
+ #s = null;
2998
+ #c = !1;
2999
+ constructor() {
3000
+ super(), this.#e = this.attachInternals(), this.#e.role = "slider";
3001
+ }
3002
+ get value() {
3003
+ return this.#n.value;
3004
+ }
3005
+ set value(e) {
3006
+ this.#n.value = this.#l(e), this.#d();
3007
+ }
3008
+ get min() {
3009
+ return this.#i.value;
3010
+ }
3011
+ set min(e) {
3012
+ this.#i.value = e;
3013
+ }
3014
+ get max() {
3015
+ return this.#a.value;
3016
+ }
3017
+ set max(e) {
3018
+ this.#a.value = e;
3019
+ }
3020
+ get step() {
3021
+ return this.#o.value;
3022
+ }
3023
+ set step(e) {
3024
+ this.#o.value = e;
3025
+ }
3026
+ get disabled() {
3027
+ return this.#t.value;
3028
+ }
3029
+ set disabled(e) {
3030
+ this.#t.value = e, this.toggleAttribute("disabled", e);
3031
+ }
3032
+ get name() {
3033
+ return this.getAttribute("name") ?? "";
3034
+ }
3035
+ set name(e) {
3036
+ this.setAttribute("name", e);
3037
+ }
3038
+ attributeChangedCallback(e, t, n) {
3039
+ if (t !== n) {
3040
+ switch (e) {
3041
+ case "value":
3042
+ this.#n.value = this.#l(parseFloat(n ?? "50") || 50);
3043
+ break;
3044
+ case "min":
3045
+ this.#i.value = parseFloat(n ?? "0") || 0;
3046
+ break;
3047
+ case "max":
3048
+ this.#a.value = parseFloat(n ?? "100") || 100;
3049
+ break;
3050
+ case "step":
3051
+ this.#o.value = parseFloat(n ?? "1") || 1;
3052
+ break;
3053
+ case "disabled":
3054
+ this.#t.value = n !== null;
3055
+ break;
3056
+ }
3057
+ super.attributeChangedCallback(e, t, n);
3058
+ }
3059
+ }
3060
+ setup() {
3061
+ super.setup(), this.#r = this.#n.value, this.#s = document.createElement("div"), this.#s.classList.add("ui-range-thumb"), this.appendChild(this.#s), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEffect(h(this, this.#t, this.#e, { manageTabindex: !0 })), this.addEffect(() => {
3062
+ let e = this.#u();
3063
+ this.style.setProperty("--_progress", String(e)), this.#e.ariaValueNow = String(this.#n.value), this.#e.ariaValueMin = String(this.#i.value), this.#e.ariaValueMax = String(this.#a.value);
3064
+ }), this.#d(), this.addEventListener("pointerdown", this.#p), this.addEventListener("keydown", this.#_);
3065
+ }
3066
+ teardown() {
3067
+ this.removeEventListener("pointerdown", this.#p), this.removeEventListener("keydown", this.#_), this.#s &&= (this.#s.remove(), null), super.teardown();
3068
+ }
3069
+ onFormDisabled(e) {
3070
+ this.#t.value = e;
3071
+ }
3072
+ onFormReset() {
3073
+ this.#n.value = this.#r, this.#d();
3074
+ }
3075
+ #l(e) {
3076
+ let t = this.#i.value, n = this.#a.value, r = this.#o.value, i = Math.round((e - t) / r) * r + t;
3077
+ return Math.min(n, Math.max(t, i));
3078
+ }
3079
+ #u() {
3080
+ let e = this.#a.value - this.#i.value;
3081
+ return e === 0 ? 0 : (this.#n.value - this.#i.value) / e;
3082
+ }
3083
+ #d() {
3084
+ this.#e.setFormValue(String(this.#n.value));
3085
+ }
3086
+ #f(e) {
3087
+ let t = this.getBoundingClientRect(), n = this.#s?.offsetWidth ?? 0, r = n / 2, i = t.width - n;
3088
+ if (i <= 0) return this.#i.value;
3089
+ let a = e.clientX - t.left - r, o = Math.min(1, Math.max(0, a / i));
3090
+ return this.#i.value + o * (this.#a.value - this.#i.value);
3091
+ }
3092
+ #p = (e) => {
3093
+ if (e.button !== 0 || this.#t.value) return;
3094
+ this.setPointerCapture(e.pointerId), this.#c = !0, this.toggleAttribute("pressed", !0);
3095
+ let t = this.#l(this.#f(e));
3096
+ this.#n.value = t, this.#d(), this.#v(), this.addEventListener("pointermove", this.#m), this.addEventListener("pointerup", this.#h), this.addEventListener("pointercancel", this.#g);
3097
+ };
3098
+ #m = (e) => {
3099
+ if (!this.#c || this.#t.value) return;
3100
+ let t = this.#l(this.#f(e));
3101
+ t !== this.#n.value && (this.#n.value = t, this.#d(), this.#v());
3102
+ };
3103
+ #h = () => {
3104
+ this.#c = !1, this.removeAttribute("pressed"), this.removeEventListener("pointermove", this.#m), this.removeEventListener("pointerup", this.#h), this.removeEventListener("pointercancel", this.#g), this.#y();
3105
+ };
3106
+ #g = () => {
3107
+ this.#c = !1, this.removeAttribute("pressed"), this.removeEventListener("pointermove", this.#m), this.removeEventListener("pointerup", this.#h), this.removeEventListener("pointercancel", this.#g);
3108
+ };
3109
+ #_ = (e) => {
3110
+ if (this.#t.value) return;
3111
+ let t = this.#o.value, n = t * 10, r = this.#n.value;
3112
+ switch (e.key) {
3113
+ case "ArrowRight":
3114
+ case "ArrowUp":
3115
+ r += t;
3116
+ break;
3117
+ case "ArrowLeft":
3118
+ case "ArrowDown":
3119
+ r -= t;
3120
+ break;
3121
+ case "PageUp":
3122
+ r += n;
3123
+ break;
3124
+ case "PageDown":
3125
+ r -= n;
3126
+ break;
3127
+ case "Home":
3128
+ r = this.#i.value;
3129
+ break;
3130
+ case "End":
3131
+ r = this.#a.value;
3132
+ break;
3133
+ default: return;
3134
+ }
3135
+ e.preventDefault(), r = this.#l(r), r !== this.#n.value && (this.#n.value = r, this.#d(), this.#v(), this.#y());
3136
+ };
3137
+ #v() {
3138
+ this.dispatchEvent(new CustomEvent("ui-input", {
3139
+ bubbles: !0,
3140
+ composed: !0,
3141
+ detail: { value: this.#n.value }
3142
+ }));
3143
+ }
3144
+ #y() {
3145
+ this.dispatchEvent(new CustomEvent("ui-change", {
3146
+ bubbles: !0,
3147
+ composed: !0,
3148
+ detail: { value: this.#n.value }
3149
+ }));
3150
+ }
3151
+ }, Ce = class extends v(d) {
3152
+ static observedAttributes = [
3153
+ "value",
3154
+ "length",
3155
+ "disabled",
3156
+ "name",
3157
+ "pattern",
3158
+ "mask",
3159
+ "required"
3160
+ ];
3161
+ #e;
3162
+ #t = t(!1);
3163
+ #n;
3164
+ #r = [];
3165
+ #i = [];
3166
+ #a = 6;
3167
+ #o = /[0-9]/;
3168
+ constructor() {
3169
+ super(), this.#e = this.attachInternals(), this.#e.role = "group", this.#n = g(this, "disabled", { type: "boolean" });
3170
+ }
3171
+ get value() {
3172
+ return this.#i.join("");
3173
+ }
3174
+ set value(e) {
3175
+ this.#i = e.split("").slice(0, this.#a), this.#c(), this.#l();
3176
+ }
3177
+ get name() {
3178
+ return this.getAttribute("name") ?? "";
3179
+ }
3180
+ set name(e) {
3181
+ this.setAttribute("name", e);
3182
+ }
3183
+ get disabled() {
3184
+ return this.#n.value;
3185
+ }
3186
+ set disabled(e) {
3187
+ this.#n.set(e);
3188
+ }
3189
+ get required() {
3190
+ return this.#t.value;
3191
+ }
3192
+ set required(e) {
3193
+ this.#t.value = e, this.toggleAttribute("required", e);
3194
+ }
3195
+ attributeChangedCallback(e, t, n) {
3196
+ if (t !== n) {
3197
+ if (_({ disabled: this.#n }, e, n)) {
3198
+ super.attributeChangedCallback(e, t, n);
3199
+ return;
3200
+ }
3201
+ switch (e) {
3202
+ case "value":
3203
+ this.value = n ?? "";
3204
+ break;
3205
+ case "length": {
3206
+ let e = parseInt(n ?? "6", 10);
3207
+ !isNaN(e) && e >= 1 && e <= 12 && (this.#a = e, this.isConnected && this.#s());
3208
+ break;
3209
+ }
3210
+ case "pattern":
3211
+ try {
3212
+ this.#o = new RegExp(n ?? "[0-9]");
3213
+ } catch {}
3214
+ break;
3215
+ case "required":
3216
+ this.#t.value = n !== null, this.isConnected && this.#l();
3217
+ break;
3218
+ }
3219
+ super.attributeChangedCallback(e, t, n);
3220
+ }
3221
+ }
3222
+ setup() {
3223
+ super.setup();
3224
+ let e = this.getAttribute("length");
3225
+ if (e) {
3226
+ let t = parseInt(e, 10);
3227
+ !isNaN(t) && t >= 1 && t <= 12 && (this.#a = t);
3228
+ }
3229
+ let t = this.getAttribute("pattern");
3230
+ if (t) try {
3231
+ this.#o = new RegExp(t);
3232
+ } catch {}
3233
+ this.#s(), this.addEffect(h(this, this.#n.signal, this.#e, { manageTabindex: !1 })), this.#t.value = this.hasAttribute("required");
3234
+ let n = this.getAttribute("value");
3235
+ n && (this.value = n), this.addEventListener("paste", this.#m);
3236
+ }
3237
+ teardown() {
3238
+ for (let e of this.#r) e.removeEventListener("input", this.#d), e.removeEventListener("keydown", this.#f), e.removeEventListener("focus", this.#p);
3239
+ this.removeEventListener("paste", this.#m), super.teardown();
3240
+ }
3241
+ #s() {
3242
+ for (let e of this.#r) e.removeEventListener("input", this.#d), e.removeEventListener("keydown", this.#f), e.removeEventListener("focus", this.#p), e.remove();
3243
+ this.#r = [], this.#i = [];
3244
+ for (let e = 0; e < this.#a; e++) {
3245
+ let e = document.createElement("div");
3246
+ e.classList.add("ui-otp-cell"), e.setAttribute("data-empty", ""), e.setAttribute("contenteditable", "plaintext-only"), e.setAttribute("inputmode", "numeric"), e.addEventListener("input", this.#d), e.addEventListener("keydown", this.#f), e.addEventListener("focus", this.#p), this.appendChild(e), this.#r.push(e), this.#i.push("");
3247
+ }
3248
+ }
3249
+ #c() {
3250
+ for (let e = 0; e < this.#a; e++) {
3251
+ let t = this.#r[e];
3252
+ if (!t) continue;
3253
+ let n = this.#i[e] ?? "";
3254
+ t.textContent = n, n ? t.removeAttribute("data-empty") : t.setAttribute("data-empty", "");
3255
+ }
3256
+ }
3257
+ #l() {
3258
+ let e = this.value;
3259
+ this.#e.setFormValue(e), this.#t.value && e.length < this.#a ? this.#e.setValidity({ valueMissing: !0 }, "Please fill out this field.", this) : this.#e.setValidity({});
3260
+ }
3261
+ #u(e) {
3262
+ let t = this.#r[e];
3263
+ if (t) {
3264
+ t.focus();
3265
+ let e = window.getSelection();
3266
+ e && (e.selectAllChildren(t), e.collapseToEnd());
3267
+ }
3268
+ }
3269
+ #d = (e) => {
3270
+ if (this.disabled) return;
3271
+ let t = e.target, n = this.#r.indexOf(t);
3272
+ if (n === -1) return;
3273
+ let r = t.textContent ?? "";
3274
+ if (r.length > 0) {
3275
+ let e = r[r.length - 1];
3276
+ this.#o.test(e) ? (this.#i[n] = e, t.textContent = e, t.removeAttribute("data-empty"), this.#l(), this.#h(), n < this.#a - 1 && this.#u(n + 1), this.value.length === this.#a && this.#g()) : t.textContent = this.#i[n] || "";
3277
+ } else this.#i[n] = "", t.setAttribute("data-empty", ""), this.#l(), this.#h();
3278
+ };
3279
+ #f = (e) => {
3280
+ if (this.disabled) return;
3281
+ let t = e.target, n = this.#r.indexOf(t);
3282
+ n !== -1 && (e.key === "Backspace" ? (this.#i[n] ? (this.#i[n] = "", t.textContent = "", t.setAttribute("data-empty", ""), this.#l(), this.#h()) : n > 0 && this.#u(n - 1), e.preventDefault()) : e.key === "ArrowLeft" && n > 0 ? (this.#u(n - 1), e.preventDefault()) : e.key === "ArrowRight" && n < this.#a - 1 ? (this.#u(n + 1), e.preventDefault()) : e.key === "Delete" && (this.#i[n] = "", t.textContent = "", t.setAttribute("data-empty", ""), this.#l(), this.#h(), e.preventDefault()));
3283
+ };
3284
+ #p = (e) => {
3285
+ let t = e.target, n = window.getSelection();
3286
+ n && (n.selectAllChildren(t), n.collapseToEnd());
3287
+ };
3288
+ #m = (e) => {
3289
+ if (this.disabled) {
3290
+ e.preventDefault();
3291
+ return;
3292
+ }
3293
+ e.preventDefault();
3294
+ let t = (e.clipboardData?.getData("text") ?? "").split("").filter((e) => this.#o.test(e)).slice(0, this.#a);
3295
+ for (let e = 0; e < this.#a; e++) this.#i[e] = t[e] ?? "";
3296
+ this.#c(), this.#l(), this.#h();
3297
+ let n = this.#i.findIndex((e) => !e);
3298
+ this.#u(n >= 0 ? n : this.#a - 1), t.length === this.#a && this.#g();
3299
+ };
3300
+ onFormDisabled(e) {
3301
+ this.#n.signal.value = e;
3302
+ for (let t of this.#r) t.setAttribute("contenteditable", e ? "false" : "plaintext-only");
3303
+ }
3304
+ onFormReset() {
3305
+ this.value = "", this.#n.signal.value = this.hasAttribute("disabled");
3306
+ }
3307
+ #h() {
3308
+ this.dispatchEvent(new CustomEvent("ui-input", {
3309
+ bubbles: !0,
3310
+ composed: !0,
3311
+ detail: { value: this.value }
3312
+ }));
3313
+ }
3314
+ #g() {
3315
+ this.dispatchEvent(new CustomEvent("ui-change", {
3316
+ bubbles: !0,
3317
+ composed: !0,
3318
+ detail: { value: this.value }
3319
+ }));
3320
+ }
3321
+ }, we = class extends d {
3322
+ static observedAttributes = [
3323
+ "src",
3324
+ "name",
3325
+ "alt"
3326
+ ];
3327
+ #e;
3328
+ #t = null;
3329
+ constructor() {
3330
+ super(), this.#e = this.attachInternals(), this.#e.role = "img";
3331
+ }
3332
+ get src() {
3333
+ return this.getAttribute("src") ?? "";
3334
+ }
3335
+ set src(e) {
3336
+ this.setAttribute("src", e);
3337
+ }
3338
+ get name() {
3339
+ return this.getAttribute("name") ?? "";
3340
+ }
3341
+ set name(e) {
3342
+ this.setAttribute("name", e);
3343
+ }
3344
+ attributeChangedCallback(e, t, n) {
3345
+ t !== n && (this.isConnected && this.#n(), super.attributeChangedCallback(e, t, n));
3346
+ }
3347
+ setup() {
3348
+ super.setup(), this.#n();
3349
+ }
3350
+ teardown() {
3351
+ this.#t &&= (this.#t.removeEventListener("error", this.#i), null), super.teardown();
3352
+ }
3353
+ #n() {
3354
+ this.textContent = "", this.#t = null;
3355
+ let e = this.getAttribute("src"), t = this.getAttribute("name"), n = this.getAttribute("alt") ?? t ?? "";
3356
+ this.#e.ariaLabel = n, this.setAttribute("aria-label", n), e ? (this.#t = document.createElement("img"), this.#t.src = e, this.#t.alt = n, this.#t.addEventListener("error", this.#i), this.appendChild(this.#t)) : t ? this.textContent = this.#r(t) : this.textContent = "?";
3357
+ }
3358
+ #r(e) {
3359
+ let t = e.trim().split(/\s+/);
3360
+ return t.length === 0 ? "?" : t.length === 1 ? t[0][0].toUpperCase() : (t[0][0] + t[t.length - 1][0]).toUpperCase();
3361
+ }
3362
+ #i = () => {
3363
+ this.#t &&= (this.#t.removeEventListener("error", this.#i), this.#t.remove(), null);
3364
+ let e = this.getAttribute("name");
3365
+ e ? this.textContent = this.#r(e) : this.textContent = "?";
3366
+ };
3367
+ }, Te = class extends d {
3368
+ static observedAttributes = ["max"];
3369
+ #e;
3370
+ #t = "";
3371
+ constructor() {
3372
+ super(), this.#e = this.attachInternals(), this.#e.role = "status";
3373
+ }
3374
+ attributeChangedCallback(e, t, n) {
3375
+ t !== n && (e === "max" && this.isConnected && this.#n(), super.attributeChangedCallback(e, t, n));
3376
+ }
3377
+ setup() {
3378
+ super.setup(), this.#t = this.textContent?.trim() ?? "", this.#n();
3379
+ }
3380
+ #n() {
3381
+ let e = this.getAttribute("max");
3382
+ if (!e) return;
3383
+ let t = parseInt(e, 10);
3384
+ if (isNaN(t)) return;
3385
+ let n = parseInt(this.#t, 10);
3386
+ isNaN(n) || (n > t ? this.textContent = `${t}+` : this.textContent = this.#t);
3387
+ }
3388
+ }, Ee = class extends d {
3389
+ #e;
3390
+ constructor() {
3391
+ super(), this.#e = this.attachInternals(), this.#e.role = "navigation";
3392
+ }
3393
+ setup() {
3394
+ super.setup();
3395
+ let e = this.getAttribute("aria-label") ?? "Breadcrumb";
3396
+ this.#e.ariaLabel = e, this.hasAttribute("aria-label") || this.setAttribute("aria-label", e);
3397
+ }
3398
+ }, De = class extends d {
3399
+ static observedAttributes = ["href", "current"];
3400
+ #e;
3401
+ constructor() {
3402
+ super(), this.#e = this.attachInternals(), this.#e.role = "link";
3403
+ }
3404
+ setup() {
3405
+ super.setup(), this.#t(), !this.hasAttribute("current") && !this.hasAttribute("tabindex") && this.setAttribute("tabindex", "0"), this.addEventListener("click", this.#n), this.addEventListener("keydown", this.#r);
3406
+ }
3407
+ teardown() {
3408
+ this.removeEventListener("click", this.#n), this.removeEventListener("keydown", this.#r), super.teardown();
3409
+ }
3410
+ attributeChangedCallback(e, t, n) {
3411
+ t !== n && (this.isConnected && this.#t(), super.attributeChangedCallback(e, t, n));
3412
+ }
3413
+ #t() {
3414
+ this.hasAttribute("current") ? (this.setAttribute("aria-disabled", "true"), this.setAttribute("aria-current", "page"), this.removeAttribute("tabindex")) : (this.removeAttribute("aria-disabled"), this.removeAttribute("aria-current"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"));
3415
+ }
3416
+ #n = () => {
3417
+ if (this.hasAttribute("current")) return;
3418
+ let e = this.getAttribute("href");
3419
+ e && (window.location.href = e);
3420
+ };
3421
+ #r = (e) => {
3422
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.#n());
3423
+ };
3424
+ }, Oe = class extends d {
3425
+ static observedAttributes = [
3426
+ "total",
3427
+ "value",
3428
+ "siblings",
3429
+ "boundaries",
3430
+ "disabled"
3431
+ ];
3432
+ #e;
3433
+ #t = t(1);
3434
+ #n = t(1);
3435
+ #r = t(1);
3436
+ #i = t(1);
3437
+ #a = t(!1);
3438
+ constructor() {
3439
+ super(), this.#e = this.attachInternals(), this.#e.role = "navigation";
3440
+ }
3441
+ get total() {
3442
+ return this.#t.value;
3443
+ }
3444
+ set total(e) {
3445
+ this.#t.value = Math.max(1, e);
3446
+ }
3447
+ get value() {
3448
+ return this.#n.value;
3449
+ }
3450
+ set value(e) {
3451
+ this.#n.value = Math.min(Math.max(1, e), this.#t.value);
3452
+ }
3453
+ get siblings() {
3454
+ return this.#r.value;
3455
+ }
3456
+ set siblings(e) {
3457
+ this.#r.value = Math.max(0, e);
3458
+ }
3459
+ get boundaries() {
3460
+ return this.#i.value;
3461
+ }
3462
+ set boundaries(e) {
3463
+ this.#i.value = Math.max(0, e);
3464
+ }
3465
+ get disabled() {
3466
+ return this.#a.value;
3467
+ }
3468
+ set disabled(e) {
3469
+ this.#a.value = e, this.toggleAttribute("disabled", e);
3470
+ }
3471
+ attributeChangedCallback(e, t, n) {
3472
+ if (t === n) return;
3473
+ let r = parseInt(n ?? "", 10);
3474
+ switch (e) {
3475
+ case "total":
3476
+ this.#t.value = Math.max(1, isNaN(r) ? 1 : r);
3477
+ break;
3478
+ case "value":
3479
+ this.#n.value = Math.min(Math.max(1, isNaN(r) ? 1 : r), this.#t.value);
3480
+ break;
3481
+ case "siblings":
3482
+ this.#r.value = Math.max(0, isNaN(r) ? 1 : r);
3483
+ break;
3484
+ case "boundaries":
3485
+ this.#i.value = Math.max(0, isNaN(r) ? 1 : r);
3486
+ break;
3487
+ case "disabled":
3488
+ this.#a.value = n !== null;
3489
+ return;
3490
+ }
3491
+ super.attributeChangedCallback(e, t, n);
3492
+ }
3493
+ setup() {
3494
+ super.setup();
3495
+ let e = this.getAttribute("aria-label") ?? "Pagination";
3496
+ this.#e.ariaLabel = e, this.hasAttribute("aria-label") || this.setAttribute("aria-label", e), this.addEffect(h(this, this.#a, this.#e)), this.addEffect(() => {
3497
+ this.#l();
3498
+ });
3499
+ }
3500
+ teardown() {
3501
+ this.textContent = "", super.teardown();
3502
+ }
3503
+ #o() {
3504
+ let e = this.#t.value, t = this.#n.value, n = this.#r.value, r = this.#i.value;
3505
+ if (e <= r * 2 + n * 2 + 3) return Array.from({ length: e }, (e, t) => t + 1);
3506
+ let i = [];
3507
+ for (let e = 1; e <= r; e++) i.push(e);
3508
+ let a = Math.max(r + 1, t - n);
3509
+ a > r + 1 && i.push("ellipsis");
3510
+ let o = Math.min(e - r, t + n);
3511
+ for (let e = a; e <= o; e++) i.includes(e) || i.push(e);
3512
+ o < e - r && i.push("ellipsis");
3513
+ for (let t = e - r + 1; t <= e; t++) i.includes(t) || i.push(t);
3514
+ return i;
3515
+ }
3516
+ #s(e, t, n, r) {
3517
+ let i = document.createElement("ui-button");
3518
+ return i.setAttribute("variant", "ghost"), i.setAttribute("aria-label", t), n && i.setAttribute("disabled", ""), i.textContent = e, i.addEventListener("ui-press", r), i;
3519
+ }
3520
+ #c(e, t, n, r) {
3521
+ let i = document.createElement("ui-button");
3522
+ i.setAttribute("variant", "ghost"), i.setAttribute("aria-label", t), n && i.setAttribute("disabled", "");
3523
+ let a = document.createElement("ui-icon");
3524
+ return a.setAttribute("name", e), i.appendChild(a), i.addEventListener("ui-press", r), i;
3525
+ }
3526
+ #l() {
3527
+ let e = this.#t.value, t = this.#n.value, n = this.#o();
3528
+ this.textContent = "", this.appendChild(this.#c("caret-left", "Previous page", t <= 1, () => this.#u(t - 1)));
3529
+ for (let e of n) if (e === "ellipsis") {
3530
+ let e = document.createElement("span");
3531
+ e.classList.add("ui-pagination-ellipsis"), e.textContent = "…", this.appendChild(e);
3532
+ } else {
3533
+ let n = this.#s(String(e), `Page ${e}`, !1, () => this.#u(e));
3534
+ e === t && n.setAttribute("aria-current", "page"), this.appendChild(n);
3535
+ }
3536
+ this.appendChild(this.#c("caret-right", "Next page", t >= e, () => this.#u(t + 1)));
3537
+ }
3538
+ #u(e) {
3539
+ if (this.#a.value) return;
3540
+ let t = Math.min(Math.max(1, e), this.#t.value);
3541
+ t !== this.#n.value && (this.#n.value = t, this.setAttribute("value", String(t)), this.dispatchEvent(new CustomEvent("ui-change", {
3542
+ bubbles: !0,
3543
+ composed: !0,
3544
+ detail: { value: t }
3545
+ })));
3546
+ }
3547
+ }, ke = class extends d {
3548
+ static observedAttributes = [
3549
+ "side",
3550
+ "no-close-on-escape",
3551
+ "no-close-on-backdrop"
3552
+ ];
3553
+ #e;
3554
+ get open() {
3555
+ return this.#e.open;
3556
+ }
3557
+ showModal() {
3558
+ this.#e.showModal();
3559
+ }
3560
+ close() {
3561
+ this.#e.close();
3562
+ }
3563
+ setup() {
3564
+ super.setup(), this.#e = new m(this, { contentTarget: () => document.createElement("ui-drawer-panel") });
3565
+ }
3566
+ teardown() {
3567
+ this.#e.destroy(), super.teardown();
3568
+ }
3569
+ }, Ae = class extends d {
3570
+ static observedAttributes = ["disabled"];
3571
+ #e;
3572
+ #t = t(!1);
3573
+ #n;
3574
+ constructor() {
3575
+ super(), this.#e = this.attachInternals(), this.#e.role = "tree";
3576
+ }
3577
+ get disabled() {
3578
+ return this.#t.value;
3579
+ }
3580
+ set disabled(e) {
3581
+ this.#t.value = e, this.toggleAttribute("disabled", e);
3582
+ }
3583
+ attributeChangedCallback(e, t, n) {
3584
+ t !== n && (e === "disabled" && (this.#t.value = n !== null), super.attributeChangedCallback?.(e, t, n));
3585
+ }
3586
+ setup() {
3587
+ super.setup(), this.#n = new a(this, {
3588
+ selector: ":scope ui-tree-item > [slot=\"label\"]",
3589
+ orientation: "vertical"
3590
+ });
3591
+ let e = this.getAttribute("aria-label") ?? "Tree";
3592
+ this.#e.ariaLabel = e, this.hasAttribute("aria-label") || this.setAttribute("aria-label", e), this.addEffect(h(this, this.#t, this.#e));
3593
+ }
3594
+ teardown() {
3595
+ this.#n.destroy(), super.teardown();
3596
+ }
3597
+ }, je = class extends d {
3598
+ static observedAttributes = [
3599
+ "expanded",
3600
+ "selected",
3601
+ "disabled"
3602
+ ];
3603
+ #e;
3604
+ #t = null;
3605
+ #n = null;
3606
+ #r = t(!1);
3607
+ constructor() {
3608
+ super(), this.#e = this.attachInternals(), this.#e.role = "treeitem";
3609
+ }
3610
+ get disabled() {
3611
+ return this.#r.value;
3612
+ }
3613
+ set disabled(e) {
3614
+ this.#r.value = e, this.toggleAttribute("disabled", e);
3615
+ }
3616
+ setup() {
3617
+ super.setup(), this.addEffect(h(this, this.#r, this.#e)), this.deferChildren(() => {
3618
+ this.#i(), this.#a();
3619
+ }), this.addEventListener("click", this.#o), this.addEventListener("keydown", this.#s);
3620
+ }
3621
+ teardown() {
3622
+ this.removeEventListener("click", this.#o), this.removeEventListener("keydown", this.#s), super.teardown();
3623
+ }
3624
+ attributeChangedCallback(e, t, n) {
3625
+ t !== n && (e === "disabled" && (this.#r.value = n !== null), this.isConnected && this.#a(), super.attributeChangedCallback(e, t, n));
3626
+ }
3627
+ #i() {
3628
+ let e = this.querySelectorAll(":scope > ui-tree-item");
3629
+ if (e.length > 0) {
3630
+ this.setAttribute("expandable", "");
3631
+ let t = this.querySelector(":scope > [slot=\"label\"]");
3632
+ t && (this.#n = document.createElement("ui-icon"), this.#n.setAttribute("name", this.hasAttribute("expanded") ? "caret-down" : "caret-right"), this.#n.classList.add("ui-tree-caret"), t.prepend(this.#n)), this.#t = document.createElement("div"), this.#t.classList.add("ui-tree-children");
3633
+ for (let t of e) this.#t.appendChild(t);
3634
+ this.appendChild(this.#t);
3635
+ }
3636
+ let t = 0, n = this.parentElement;
3637
+ for (; n;) {
3638
+ if (n.tagName === "UI-TREE-ITEM") t++;
3639
+ else if (!n.classList?.contains("ui-tree-children")) break;
3640
+ n = n.parentElement;
3641
+ }
3642
+ if (t > 0) {
3643
+ let e = this.querySelector(":scope > [slot=\"label\"]");
3644
+ e instanceof HTMLElement && e.style.setProperty("--_tree-depth", String(t));
3645
+ }
3646
+ let r = this.querySelector(":scope > [slot=\"label\"]");
3647
+ r instanceof HTMLElement && !r.hasAttribute("tabindex") && r.setAttribute("tabindex", "-1");
3648
+ }
3649
+ #a() {
3650
+ let e = this.hasAttribute("expanded"), t = this.hasAttribute("selected");
3651
+ this.hasAttribute("expandable") ? this.setAttribute("aria-expanded", String(e)) : this.removeAttribute("aria-expanded"), this.setAttribute("aria-selected", String(t)), this.#n && this.#n.setAttribute("name", e ? "caret-down" : "caret-right");
3652
+ }
3653
+ #o = (e) => {
3654
+ let t = e.target, n = this.querySelector(":scope > [slot=\"label\"]");
3655
+ t !== n && !n?.contains(t) || (e.stopPropagation(), !this.#r.value && (this.hasAttribute("expandable") && this.toggleAttribute("expanded"), this.toggleAttribute("selected", !0)));
3656
+ };
3657
+ #s = (e) => {
3658
+ if (e.target === this.querySelector(":scope > [slot=\"label\"]") && !this.#r.value) switch (e.key) {
3659
+ case "ArrowRight":
3660
+ if (this.hasAttribute("expandable") && !this.hasAttribute("expanded")) this.setAttribute("expanded", ""), e.preventDefault(), e.stopPropagation();
3661
+ else if (this.hasAttribute("expanded")) {
3662
+ let t = this.querySelector(":scope > .ui-tree-children > ui-tree-item > [slot=\"label\"]");
3663
+ t && (t.focus(), e.preventDefault(), e.stopPropagation());
3664
+ }
3665
+ break;
3666
+ case "ArrowLeft":
3667
+ if (this.hasAttribute("expanded")) this.removeAttribute("expanded"), e.preventDefault(), e.stopPropagation();
3668
+ else {
3669
+ let t = (this.parentElement?.closest("ui-tree-item"))?.querySelector(":scope > [slot=\"label\"]");
3670
+ t && (t.focus(), e.preventDefault(), e.stopPropagation());
3671
+ }
3672
+ break;
3673
+ case "Enter":
3674
+ case " ":
3675
+ e.preventDefault(), e.stopPropagation(), this.toggleAttribute("selected", !0), this.hasAttribute("expandable") && this.toggleAttribute("expanded");
3676
+ break;
3677
+ }
3678
+ };
3679
+ }, Me = class extends d {
3680
+ static observedAttributes = [
3681
+ "direction",
3682
+ "controls",
3683
+ "indicators",
3684
+ "autoplay",
3685
+ "interval",
3686
+ "loop",
3687
+ "peek",
3688
+ "per-view",
3689
+ "gap",
3690
+ "disabled"
3691
+ ];
3692
+ #e = null;
3693
+ #t = null;
3694
+ #n = null;
3695
+ #r = null;
3696
+ #i = null;
3697
+ #a = t(0);
3698
+ #o = t(0);
3699
+ #s = t(!1);
3700
+ #c = null;
3701
+ #l = window.matchMedia("(prefers-reduced-motion: reduce)");
3702
+ #u = null;
3703
+ #d = [];
3704
+ #f = !1;
3705
+ #p = 0;
3706
+ #m = 0;
3707
+ #h = 0;
3708
+ #g = 0;
3709
+ #_;
3710
+ constructor() {
3711
+ super(), this.#_ = this.attachInternals(), this.#_.role = "region";
3712
+ }
3713
+ get index() {
3714
+ return this.#a.value;
3715
+ }
3716
+ goTo(e) {
3717
+ let t = this.#d.length;
3718
+ if (t === 0) return;
3719
+ let n = e;
3720
+ n = this.hasAttribute("loop") ? (e % t + t) % t : Math.max(0, Math.min(e, t - 1));
3721
+ let r = this.#d[n];
3722
+ if (!r) return;
3723
+ let i = this.getAttribute("direction") === "vertical";
3724
+ r.scrollIntoView({
3725
+ block: i ? "start" : "nearest",
3726
+ inline: i ? "nearest" : "start"
3727
+ });
3728
+ }
3729
+ next() {
3730
+ this.goTo(this.#a.value + 1);
3731
+ }
3732
+ prev() {
3733
+ this.goTo(this.#a.value - 1);
3734
+ }
3735
+ attributeChangedCallback(e, t, n) {
3736
+ if (t !== n) {
3737
+ switch (e) {
3738
+ case "disabled":
3739
+ this.#s.value = n !== null;
3740
+ break;
3741
+ case "per-view":
3742
+ this.#v(n);
3743
+ break;
3744
+ case "autoplay":
3745
+ n === null ? this.#E() : this.#T();
3746
+ break;
3747
+ }
3748
+ super.attributeChangedCallback?.(e, t, n);
3749
+ }
3750
+ }
3751
+ setup() {
3752
+ super.setup();
3753
+ let e = document.createElement("div");
3754
+ e.setAttribute("part", "track"), e.id = r("ss-track"), e.setAttribute("tabindex", "0");
3755
+ let t = [];
3756
+ for (; this.firstChild;) {
3757
+ let n = this.firstChild;
3758
+ e.appendChild(n), n instanceof HTMLElement && n.tagName.toLowerCase() === "ui-slide" && t.push(n);
3759
+ }
3760
+ this.appendChild(e), this.#e = e, this.#d = t;
3761
+ let n = document.createElement("div");
3762
+ n.setAttribute("part", "controls");
3763
+ let i = document.createElement("button");
3764
+ i.setAttribute("part", "prev"), i.setAttribute("aria-label", "Previous slide"), i.setAttribute("type", "button"), i.innerHTML = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 256 256\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z\" fill=\"currentColor\"/></svg>";
3765
+ let a = document.createElement("button");
3766
+ a.setAttribute("part", "next"), a.setAttribute("aria-label", "Next slide"), a.setAttribute("type", "button"), a.innerHTML = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 256 256\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z\" fill=\"currentColor\"/></svg>", n.appendChild(i), n.appendChild(a), this.appendChild(n), this.#n = i, this.#r = a;
3767
+ let o = document.createElement("div");
3768
+ o.setAttribute("part", "indicators"), o.setAttribute("aria-hidden", "true"), this.appendChild(o), this.#t = o;
3769
+ let s = document.createElement("div");
3770
+ s.id = r("ss-live"), s.setAttribute("aria-live", "polite"), s.setAttribute("aria-atomic", "true"), s.setAttribute("data-visually-hidden", ""), this.appendChild(s), this.#i = s, this.setAttribute("aria-roledescription", "carousel"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", "Slideshow"), this.#v(this.getAttribute("per-view")), this.#o.value = t.length, this.#y(t), this.#b(t.length), this.#S(t), t.length > 0 && t[0].toggleAttribute("active", !0), this.addEffect(() => {
3771
+ let e = this.#a.value, t = this.#o.value;
3772
+ this.#C(e), this.#w(e, t), this.#i && (this.#i.textContent = `Slide ${e + 1} of ${t}`);
3773
+ }), this.addEffect(h(this, this.#s, this.#_)), i.addEventListener("click", this.#D), a.addEventListener("click", this.#O), e.addEventListener("keydown", this.#P), e.addEventListener("pointerdown", this.#j), this.addEventListener("mouseenter", this.#k), this.addEventListener("mouseleave", this.#A), this.addEventListener("focusin", this.#k), this.addEventListener("focusout", this.#A), this.hasAttribute("autoplay") && this.#T();
3774
+ }
3775
+ teardown() {
3776
+ this.#E(), this.#u?.disconnect(), this.#u = null, this.#n?.removeEventListener("click", this.#D), this.#r?.removeEventListener("click", this.#O), this.#e?.removeEventListener("keydown", this.#P), this.#e?.removeEventListener("pointerdown", this.#j), this.removeEventListener("mouseenter", this.#k), this.removeEventListener("mouseleave", this.#A), this.removeEventListener("focusin", this.#k), this.removeEventListener("focusout", this.#A), this.#e = null, this.#t?.removeEventListener("click", this.#x), this.#t && (this.#t.innerHTML = ""), this.#t = null, this.#n = null, this.#r = null, this.#i = null, this.#d = [], super.teardown();
3777
+ }
3778
+ #v(e) {
3779
+ let t = Math.max(1, parseInt(e ?? "1", 10) || 1);
3780
+ this.style.setProperty("--_per-view", String(t));
3781
+ }
3782
+ #y(e) {
3783
+ let t = e.length;
3784
+ for (let n = 0; n < t; n++) {
3785
+ let i = e[n];
3786
+ i.setAttribute("role", "group"), i.setAttribute("aria-roledescription", "slide"), i.setAttribute("aria-label", `${n + 1} of ${t}`), i.id ||= r("slide");
3787
+ }
3788
+ }
3789
+ #b(e) {
3790
+ let t = this.#t;
3791
+ if (t) {
3792
+ t.addEventListener("click", this.#x);
3793
+ for (let n = 0; n < e; n++) {
3794
+ let e = document.createElement("button");
3795
+ e.setAttribute("part", "dot"), e.setAttribute("type", "button"), e.setAttribute("aria-label", `Go to slide ${n + 1}`), e.setAttribute("data-index", String(n)), n === 0 && e.toggleAttribute("active", !0), t.appendChild(e);
3796
+ }
3797
+ }
3798
+ }
3799
+ #x = (e) => {
3800
+ let t = e.target.closest("[data-index]");
3801
+ if (!t) return;
3802
+ let n = parseInt(t.dataset.index ?? "", 10);
3803
+ isNaN(n) || (this.#E(), this.goTo(n));
3804
+ };
3805
+ #S(e) {
3806
+ let t = this.#e;
3807
+ if (!(!t || e.length === 0)) {
3808
+ this.#u = new IntersectionObserver((e) => {
3809
+ for (let t of e) if (t.isIntersecting && t.intersectionRatio >= .5) {
3810
+ let e = t.target, n = this.#d.indexOf(e);
3811
+ n !== -1 && n !== this.#a.value && (this.#a.value = n, this.#d.forEach((e, t) => e.toggleAttribute("active", t === n)), this.dispatchEvent(new CustomEvent("ui-slide-change", {
3812
+ bubbles: !0,
3813
+ composed: !0,
3814
+ detail: {
3815
+ index: n,
3816
+ slide: e
3817
+ }
3818
+ })));
3819
+ }
3820
+ }, {
3821
+ root: t,
3822
+ threshold: .5
3823
+ });
3824
+ for (let t of e) this.#u.observe(t);
3825
+ }
3826
+ }
3827
+ #C(e) {
3828
+ let t = this.#t?.querySelectorAll("[part=\"dot\"]");
3829
+ t && t.forEach((t, n) => t.toggleAttribute("active", n === e));
3830
+ }
3831
+ #w(e, t) {
3832
+ if (!this.#n || !this.#r) return;
3833
+ let n = this.hasAttribute("loop");
3834
+ this.#n.disabled = !n && e === 0, this.#r.disabled = !n && e === t - 1;
3835
+ }
3836
+ #T() {
3837
+ if (this.#l.matches) return;
3838
+ this.#E();
3839
+ let e = parseInt(this.getAttribute("interval") ?? "5000", 10) || 5e3;
3840
+ this.#c = setInterval(() => this.next(), e);
3841
+ }
3842
+ #E() {
3843
+ this.#c !== null && (clearInterval(this.#c), this.#c = null);
3844
+ }
3845
+ #D = () => {
3846
+ this.#E(), this.prev();
3847
+ };
3848
+ #O = () => {
3849
+ this.#E(), this.next();
3850
+ };
3851
+ #k = () => {
3852
+ this.#c !== null && (clearInterval(this.#c), this.#c = null);
3853
+ };
3854
+ #A = () => {
3855
+ this.hasAttribute("autoplay") && !this.#l.matches && this.#c === null && this.#T();
3856
+ };
3857
+ #j = (e) => {
3858
+ if (e.button !== 0 || e.pointerType === "touch") return;
3859
+ let t = this.#e;
3860
+ t && (this.#f = !0, this.#p = e.clientX, this.#m = e.clientY, this.#h = t.scrollLeft, this.#g = t.scrollTop, t.style.scrollBehavior = "auto", t.style.scrollSnapType = "none", t.setPointerCapture(e.pointerId), t.setAttribute("data-dragging", ""), t.addEventListener("pointermove", this.#M), t.addEventListener("pointerup", this.#N), t.addEventListener("pointercancel", this.#N));
3861
+ };
3862
+ #M = (e) => {
3863
+ if (!(!this.#f || !this.#e)) if (e.preventDefault(), this.getAttribute("direction") === "vertical") {
3864
+ let t = e.clientY - this.#m;
3865
+ this.#e.scrollTop = this.#g - t;
3866
+ } else {
3867
+ let t = e.clientX - this.#p;
3868
+ this.#e.scrollLeft = this.#h - t;
3869
+ }
3870
+ };
3871
+ #N = (e) => {
3872
+ !this.#f || !this.#e || (this.#f = !1, this.#e.releasePointerCapture(e.pointerId), this.#e.removeAttribute("data-dragging"), this.#e.removeEventListener("pointermove", this.#M), this.#e.removeEventListener("pointerup", this.#N), this.#e.removeEventListener("pointercancel", this.#N), this.#e.style.scrollBehavior = "", this.#e.style.scrollSnapType = "");
3873
+ };
3874
+ #P = (e) => {
3875
+ if (this.#s.value) return;
3876
+ let t = this.getAttribute("direction") === "vertical";
3877
+ switch (e.key) {
3878
+ case t ? "ArrowDown" : "ArrowRight":
3879
+ e.preventDefault(), this.next();
3880
+ break;
3881
+ case t ? "ArrowUp" : "ArrowLeft":
3882
+ e.preventDefault(), this.prev();
3883
+ break;
3884
+ case "Home":
3885
+ e.preventDefault(), this.goTo(0);
3886
+ break;
3887
+ case "End":
3888
+ e.preventDefault(), this.goTo(this.#o.value - 1);
3889
+ break;
3890
+ }
3891
+ };
3892
+ }, Ne = class extends d {
3893
+ setup() {
3894
+ super.setup(), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "-1");
3895
+ }
3896
+ }, Pe = class extends d {
3897
+ static observedAttributes = ["value", "disabled"];
3898
+ #e;
3899
+ #t;
3900
+ #n;
3901
+ constructor() {
3902
+ super(), this.#e = this.attachInternals(), this.#e.role = "navigation", this.#t = g(this, "disabled", { type: "boolean" });
3903
+ }
3904
+ get value() {
3905
+ return this.#n?.listValue.value ?? null;
3906
+ }
3907
+ set value(e) {
3908
+ this.#n && (this.#n.listValue.value = e), e === null ? this.removeAttribute("value") : this.setAttribute("value", e);
3909
+ }
3910
+ get disabled() {
3911
+ return this.#t.value;
3912
+ }
3913
+ set disabled(e) {
3914
+ this.#t.set(e);
3915
+ }
3916
+ attributeChangedCallback(e, t, n) {
3917
+ if (t !== n) {
3918
+ if (_({ disabled: this.#t }, e, n)) {
3919
+ super.attributeChangedCallback?.(e, t, n);
3920
+ return;
3921
+ }
3922
+ e === "value" && this.#n && (this.#n.listValue.value = n), super.attributeChangedCallback?.(e, t, n);
3923
+ }
3924
+ }
3925
+ setup() {
3926
+ super.setup(), this.#n = new l(this, {
3927
+ itemSelector: ":scope ui-nav-item:not([disabled])",
3928
+ orientation: "vertical",
3929
+ ariaAttr: "aria-current",
3930
+ onChildSelect: (e) => {
3931
+ this.#n.listValue.value = e.value, this.setAttribute("value", e.value), this.dispatchEvent(new CustomEvent("ui-change", {
3932
+ bubbles: !0,
3933
+ composed: !0,
3934
+ cancelable: !0,
3935
+ detail: e
3936
+ }));
3937
+ },
3938
+ addEffect: (e) => this.addEffect(e),
3939
+ deferChildren: (e) => this.deferChildren(e)
3940
+ });
3941
+ let e = this.getAttribute("value");
3942
+ e !== null && (this.#n.listValue.value = e), this.addEffect(h(this, this.#t.signal, this.#e));
3943
+ }
3944
+ teardown() {
3945
+ this.#n.destroy(), super.teardown();
3946
+ }
3947
+ }, Fe = class extends d {
3948
+ static observedAttributes = [
3949
+ "value",
3950
+ "disabled",
3951
+ "label"
3952
+ ];
3953
+ #e;
3954
+ #t = t("");
3955
+ #n;
3956
+ #r = t("");
3957
+ constructor() {
3958
+ super(), this.#e = this.attachInternals(), this.#e.role = "option", this.#n = g(this, "disabled", { type: "boolean" });
3959
+ }
3960
+ get value() {
3961
+ return this.#t.value;
3962
+ }
3963
+ set value(e) {
3964
+ this.#t.value = e, this.getAttribute("value") !== e && this.setAttribute("value", e);
3965
+ }
3966
+ get disabled() {
3967
+ return this.#n.value;
3968
+ }
3969
+ set disabled(e) {
3970
+ this.#n.set(e);
3971
+ }
3972
+ get label() {
3973
+ return this.#r.value || this.textContent?.trim() || "";
3974
+ }
3975
+ set label(e) {
3976
+ this.#r.value = e, e ? this.getAttribute("label") !== e && this.setAttribute("label", e) : this.removeAttribute("label");
3977
+ }
3978
+ attributeChangedCallback(e, t, n) {
3979
+ if (t !== n) {
3980
+ if (_({ disabled: this.#n }, e, n)) {
3981
+ super.attributeChangedCallback?.(e, t, n);
3982
+ return;
3983
+ }
3984
+ switch (e) {
3985
+ case "value":
3986
+ this.#t.value = n ?? "";
3987
+ break;
3988
+ case "label":
3989
+ this.#r.value = n ?? "";
3990
+ break;
3991
+ }
3992
+ super.attributeChangedCallback?.(e, t, n);
3993
+ }
3994
+ }
3995
+ setup() {
3996
+ super.setup(), this.addEffect(h(this, this.#n.signal, this.#e)), this.addEventListener("click", this.#i);
3997
+ }
3998
+ teardown() {
3999
+ this.removeEventListener("click", this.#i), super.teardown();
4000
+ }
4001
+ #i = () => {
4002
+ this.disabled || this.dispatchEvent(new CustomEvent("ui-select", {
4003
+ bubbles: !0,
4004
+ composed: !0,
4005
+ detail: {
4006
+ value: this.#t.value,
4007
+ label: this.label
4008
+ }
4009
+ }));
4010
+ };
4011
+ }, Ie = class extends d {
4012
+ static observedAttributes = ["open"];
4013
+ #e = t(!0);
4014
+ #t = null;
4015
+ #n;
4016
+ #r = null;
4017
+ constructor() {
4018
+ super(), this.#n = this.attachInternals(), this.#n.role = "group";
4019
+ }
4020
+ get open() {
4021
+ return this.#e.value;
4022
+ }
4023
+ set open(e) {
4024
+ this.#e.value = e, this.toggleAttribute("open", e);
4025
+ }
4026
+ attributeChangedCallback(e, t, n) {
4027
+ t !== n && (e === "open" && (this.#e.value = n !== null), super.attributeChangedCallback?.(e, t, n));
4028
+ }
4029
+ setup() {
4030
+ super.setup();
4031
+ let e = document.createElement("details"), t = document.createElement("summary"), n = this.querySelector(":scope > ui-nav-group-header");
4032
+ for (n && t.appendChild(n); this.firstChild;) e.appendChild(this.firstChild);
4033
+ e.insertBefore(t, e.firstChild), this.appendChild(e), this.#t = e, this.addEffect(() => {
4034
+ let e = this.#e.value;
4035
+ this.#t && (this.#t.open = e);
4036
+ }), e.addEventListener("toggle", this.#a), this.#r = new MutationObserver(() => this.#i()), this.#r.observe(e, {
4037
+ subtree: !0,
4038
+ attributes: !0,
4039
+ attributeFilter: ["aria-current"]
4040
+ }), this.#i();
4041
+ }
4042
+ teardown() {
4043
+ this.#r?.disconnect(), this.#r = null, this.#t?.removeEventListener("toggle", this.#a), this.#t = null, super.teardown();
4044
+ }
4045
+ #i() {
4046
+ if (!this.#t) return;
4047
+ let e = this.#t.querySelectorAll(":scope > ui-nav-item"), t = -1;
4048
+ for (let n = 0; n < e.length; n++) if (e[n].hasAttribute("aria-current")) {
4049
+ t = n;
4050
+ break;
4051
+ }
4052
+ if (t < 0) {
4053
+ this.#n.states.delete("has-selection");
4054
+ return;
4055
+ }
4056
+ this.style.setProperty("--_indicator-index", `${t}`), this.#n.states.add("has-selection");
4057
+ }
4058
+ #a = () => {
4059
+ if (!this.#t) return;
4060
+ let e = this.#t.open;
4061
+ this.#e.value = e, this.toggleAttribute("open", e);
4062
+ };
4063
+ }, Le = class extends d {
4064
+ constructor() {
4065
+ super();
4066
+ let e = this.attachInternals();
4067
+ e.role = "presentation";
4068
+ }
4069
+ setup() {
4070
+ super.setup(), this.id ||= r("ngh");
4071
+ let e = this.closest("ui-nav-group");
4072
+ e && e.setAttribute("aria-labelledby", this.id);
4073
+ }
4074
+ }, Re = class extends d {
4075
+ static observedAttributes = [
4076
+ "traits",
4077
+ "for",
4078
+ "provides"
4079
+ ];
4080
+ /** Per-target controller instances: target → Map<traitName, instance> */
4081
+ #e = /* @__PURE__ */ new Map();
4082
+ /** Watches for child additions/removals in selector mode */
4083
+ #t = null;
4084
+ /** Watches for trait option attribute changes on this element */
4085
+ #n = null;
4086
+ connectedCallback() {
4087
+ this.setup();
4088
+ }
4089
+ setup() {
4090
+ super.setup(), this.#r(), this.#d();
4091
+ }
4092
+ teardown() {
4093
+ this.#u(), this.#t?.disconnect(), this.#t = null, this.#n?.disconnect(), this.#n = null, super.teardown();
4094
+ }
4095
+ attributeChangedCallback(e, t, n) {
4096
+ super.attributeChangedCallback(e, t, n), this.isConnected && (e === "traits" || e === "for" || e === "provides") && (this.#u(), this.#t?.disconnect(), this.#t = null, this.#r());
4097
+ }
4098
+ #r() {
4099
+ if (this.getAttribute("provides") !== null) return;
4100
+ let e = this.getAttribute("traits");
4101
+ if (!e) return;
4102
+ let t = this.getAttribute("for");
4103
+ t === null ? this.#i(e) : this.#a(e, t);
4104
+ }
4105
+ #i(e) {
4106
+ let t = this.#c();
4107
+ t && this.#s(t, e);
4108
+ }
4109
+ #a(e, t) {
4110
+ let n = this.querySelectorAll(t);
4111
+ for (let t of n) this.#s(t, e);
4112
+ this.#t = new MutationObserver(() => {
4113
+ this.#o(e, t);
4114
+ }), this.#t.observe(this, {
4115
+ childList: !0,
4116
+ subtree: !0
4117
+ });
4118
+ }
4119
+ #o(e, t) {
4120
+ let n = new Set(this.querySelectorAll(t));
4121
+ for (let [e, t] of this.#e) n.has(e) || (this.#l(e, t), this.#e.delete(e));
4122
+ for (let t of n) this.#e.has(t) || this.#s(t, e);
4123
+ }
4124
+ #s(e, t) {
4125
+ let n = t.split(/\s+/).filter(Boolean), r = this.#e.get(e) ?? /* @__PURE__ */ new Map();
4126
+ for (let t of n) {
4127
+ if (r.has(t)) continue;
4128
+ let n = i(t);
4129
+ if (!n) {
4130
+ console.warn(`[native-ui] Unknown trait "${t}". Is it registered?`);
4131
+ continue;
4132
+ }
4133
+ for (let [e] of r) if (i(e)?.conflicts?.includes(t) || n.conflicts?.includes(e)) {
4134
+ let n = `[native-ui] Trait conflict: "${t}" and "${e}" are incompatible.`;
4135
+ console.warn(n);
4136
+ }
4137
+ let a = c(this, t), o = n.create(e, a);
4138
+ r.set(t, o);
4139
+ }
4140
+ this.#e.set(e, r);
4141
+ }
4142
+ #c() {
4143
+ for (let e of this.children) if (e instanceof HTMLElement) return e;
4144
+ return null;
4145
+ }
4146
+ #l(e, t) {
4147
+ for (let [e, n] of t) {
4148
+ let t = i(e);
4149
+ t && t.destroy(n);
4150
+ }
4151
+ t.clear();
4152
+ }
4153
+ #u() {
4154
+ for (let [e, t] of this.#e) this.#l(e, t);
4155
+ this.#e.clear();
4156
+ }
4157
+ /** Watch trait option attributes (e.g. draggable-axis) on this element */
4158
+ #d() {
4159
+ this.#n = new MutationObserver((e) => {
4160
+ for (let t of e) {
4161
+ if (!t.attributeName || t.attributeName === "traits" || t.attributeName === "for" || t.attributeName === "provides") continue;
4162
+ let e = s(t.attributeName);
4163
+ if (!e) continue;
4164
+ let n = i(e.trait);
4165
+ if (!n?.update) continue;
4166
+ let r = c(this, e.trait);
4167
+ for (let [, t] of this.#e) {
4168
+ let i = t.get(e.trait);
4169
+ i && n.update(i, r);
4170
+ }
4171
+ }
4172
+ }), this.#n.observe(this, { attributes: !0 });
4173
+ }
4174
+ }, Y = class extends d {
4175
+ static observedAttributes = [
4176
+ "disabled",
4177
+ "no-enter-submit",
4178
+ "no-auto-clear"
4179
+ ];
4180
+ #e;
4181
+ #t = t(!1);
4182
+ #n = null;
4183
+ #r = null;
4184
+ constructor() {
4185
+ super(), this.#e = this.attachInternals();
4186
+ }
4187
+ get value() {
4188
+ return this.#n?.value ?? "";
4189
+ }
4190
+ set value(e) {
4191
+ this.#n && (this.#n.value = e);
4192
+ }
4193
+ get disabled() {
4194
+ return this.#t.value;
4195
+ }
4196
+ set disabled(e) {
4197
+ this.#t.value = e, this.toggleAttribute("disabled", e);
4198
+ }
4199
+ attributeChangedCallback(e, t, n) {
4200
+ if (t !== n) {
4201
+ switch (e) {
4202
+ case "disabled":
4203
+ this.#t.value = n !== null;
4204
+ break;
4205
+ }
4206
+ super.attributeChangedCallback(e, t, n);
4207
+ }
4208
+ }
4209
+ setup() {
4210
+ super.setup(), this.addEffect(h(this, this.#t, this.#e)), this.deferChildren(() => {
4211
+ this.#i(), this.addEffect(() => {
4212
+ let e = this.#t.value;
4213
+ this.#n && this.#n.toggleAttribute("disabled", e), this.#r && (e ? this.#r.setAttribute("disabled", "") : this.#o());
4214
+ });
4215
+ }), this.addEventListener("ui-input", this.#s), this.addEventListener("ui-press", this.#c), this.addEventListener("keydown", this.#l);
4216
+ }
4217
+ teardown() {
4218
+ this.removeEventListener("ui-input", this.#s), this.removeEventListener("ui-press", this.#c), this.removeEventListener("keydown", this.#l), this.#n = null, this.#r = null, super.teardown();
4219
+ }
4220
+ #i() {
4221
+ this.#n = this.querySelector(":scope > ui-textarea"), this.#r = this.querySelector("[data-submit]") ?? this.#a();
4222
+ }
4223
+ #a() {
4224
+ let e = this.querySelector(":scope > ui-chat-input-actions");
4225
+ if (!e) return null;
4226
+ let t = e.querySelectorAll("ui-button[variant=\"primary\"]");
4227
+ return t.length ? t[t.length - 1] : null;
4228
+ }
4229
+ #o() {
4230
+ !this.#r || this.#t.value || (this.value.trim() ? this.#r.removeAttribute("disabled") : this.#r.setAttribute("disabled", ""));
4231
+ }
4232
+ #s = (e) => {
4233
+ this.#t.value || this.#o();
4234
+ };
4235
+ #c = (e) => {
4236
+ this.#t.value || e.target === this.#r && this.#u();
4237
+ };
4238
+ #l = (e) => {
4239
+ if (this.#t.value || this.hasAttribute("no-enter-submit")) return;
4240
+ let t = e;
4241
+ if (t.isComposing) return;
4242
+ let n = t.target;
4243
+ !this.#n?.contains(n) && n !== this.#n || t.key === "Enter" && !t.shiftKey && !t.ctrlKey && !t.metaKey && (t.preventDefault(), this.value.trim() && this.#u());
4244
+ };
4245
+ #u() {
4246
+ let e = this.value.trim();
4247
+ e && this.dispatchEvent(new CustomEvent("ui-send", {
4248
+ bubbles: !0,
4249
+ composed: !0,
4250
+ cancelable: !0,
4251
+ detail: { value: e }
4252
+ })) && !this.hasAttribute("no-auto-clear") && (this.value = "", this.#r?.setAttribute("disabled", ""));
4253
+ }
4254
+ }, ze = class extends d {
4255
+ static observedAttributes = ["interactive", "href"];
4256
+ setup() {
4257
+ super.setup(), this.hasAttribute("interactive") && (this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0"), this.addEventListener("click", this.#e), this.addEventListener("keydown", this.#t));
4258
+ }
4259
+ teardown() {
4260
+ this.removeEventListener("click", this.#e), this.removeEventListener("keydown", this.#t), super.teardown();
4261
+ }
4262
+ #e = () => {
4263
+ let e = this.getAttribute("href");
4264
+ e && (window.location.href = e);
4265
+ };
4266
+ #t = (e) => {
4267
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.#e());
4268
+ };
4269
+ }, Be = class extends d {
4270
+ static observedAttributes = [
4271
+ "collapsible",
4272
+ "collapsed",
4273
+ "divider"
4274
+ ];
4275
+ setup() {
4276
+ if (super.setup(), this.hasAttribute("collapsible")) {
4277
+ let e = this.querySelector("[slot=\"heading\"]");
4278
+ e && e.addEventListener("click", this.#e);
4279
+ }
4280
+ }
4281
+ teardown() {
4282
+ let e = this.querySelector("[slot=\"heading\"]");
4283
+ e && e.removeEventListener("click", this.#e), super.teardown();
4284
+ }
4285
+ #e = () => {
4286
+ this.hasAttribute("collapsible") && this.toggleAttribute("collapsed");
4287
+ };
4288
+ }, Ve = class extends d {
4289
+ #e;
4290
+ #t;
4291
+ constructor() {
4292
+ super(), this.#e = this.attachInternals(), this.#e.role = "toolbar";
4293
+ }
4294
+ setup() {
4295
+ super.setup(), this.#t = new a(this, {
4296
+ selector: ":scope > ui-button:not([disabled]), :scope > button:not([disabled])",
4297
+ orientation: "horizontal"
4298
+ }), this.hasAttribute("aria-label") || this.setAttribute("aria-label", "Toolbar");
4299
+ }
4300
+ teardown() {
4301
+ this.#t.destroy(), super.teardown();
4302
+ }
4303
+ }, He = class extends d {
4304
+ #e = null;
4305
+ setup() {
4306
+ super.setup();
4307
+ let e = this.querySelector(":scope > [slot=\"sidebar\"]");
4308
+ e?.querySelector(".layout-resize-handle") && (this.#e = new p(e, {
4309
+ handleSelector: ".layout-resize-handle",
4310
+ axis: "horizontal",
4311
+ min: 160,
4312
+ max: 400
4313
+ })), this.dataset.ready = "";
4314
+ }
4315
+ teardown() {
4316
+ this.#e?.destroy(), this.#e = null, super.teardown();
4317
+ }
4318
+ }, Ue = class extends d {
4319
+ #e = null;
4320
+ #t = !1;
4321
+ setup() {
4322
+ super.setup();
4323
+ let e = this.querySelector(":scope > ui-listbox[popover]");
4324
+ e && (this.#e = new f(this), this.#e.wirePopover(this, e), this.addEventListener("click", this.#n), this.addEventListener("ui-dismiss", this.#r));
4325
+ }
4326
+ teardown() {
4327
+ this.removeEventListener("click", this.#n), this.removeEventListener("ui-dismiss", this.#r), this.#e?.destroy(), this.#e = null, this.#t = !1, super.teardown();
4328
+ }
4329
+ #n = (e) => {
4330
+ e.target.closest("ui-listbox") || (this.#t = !this.#t, this.#e?.syncPopover(this.#t));
4331
+ };
4332
+ #r = () => {
4333
+ this.#t = !1, this.#e?.syncPopover(!1);
4334
+ };
4335
+ }, We = class extends d {
4336
+ #e = null;
4337
+ get open() {
4338
+ return this.hasAttribute("open");
4339
+ }
4340
+ set open(e) {
4341
+ this.toggleAttribute("open", e);
4342
+ }
4343
+ toggle() {
4344
+ this.open = !this.open;
4345
+ }
4346
+ setup() {
4347
+ super.setup(), this.querySelector(".layout-resize-handle") && (this.#e = new p(this, {
4348
+ handleSelector: ".layout-resize-handle",
4349
+ axis: "horizontal",
4350
+ min: 280,
4351
+ max: 480,
4352
+ reverse: !0
4353
+ }));
4354
+ }
4355
+ teardown() {
4356
+ this.#e?.destroy(), this.#e = null, super.teardown();
4357
+ }
4358
+ }, X = /* @__PURE__ */ new Map(), Z = /* @__PURE__ */ new Set();
4359
+ function Ge(e, t) {
4360
+ X.set(e, t), Z.forEach((t) => t(e));
4361
+ }
4362
+ function Q(e) {
4363
+ return X.get(e);
4364
+ }
4365
+ function $(e) {
4366
+ return Z.add(e), () => Z.delete(e);
4367
+ }
4368
+ /**
4369
+ * Icon component rendering SVG from the global icon registry.
4370
+ * @attr {string} name - Icon name from the Phosphor icon set
4371
+ * @attr {string} size - Icon size override
4372
+ * @attr {string} aria-label - Accessible label (sets role="img" when present)
4373
+ */
4374
+ var Ke = class extends d {
4375
+ static observedAttributes = [
4376
+ "name",
4377
+ "size",
4378
+ "aria-label"
4379
+ ];
4380
+ #e = null;
4381
+ setup() {
4382
+ super.setup(), this.#t(), this.#n();
4383
+ }
4384
+ attributeChangedCallback(e, t, n) {
4385
+ super.attributeChangedCallback(e, t, n), e === "name" && this.#n(), e === "aria-label" && this.#t();
4386
+ }
4387
+ disconnectedCallback() {
4388
+ super.disconnectedCallback(), this.#e?.(), this.#e = null;
4389
+ }
4390
+ #t() {
4391
+ this.hasAttribute("aria-label") ? (this.setAttribute("role", "img"), this.removeAttribute("aria-hidden")) : (this.setAttribute("aria-hidden", "true"), this.removeAttribute("role"));
4392
+ }
4393
+ #n() {
4394
+ let e = this.getAttribute("name");
4395
+ if (!e) {
4396
+ this.innerHTML = "", this.#e?.(), this.#e = null;
4397
+ return;
4398
+ }
4399
+ let t = Q(e);
4400
+ t ? (this.innerHTML = t, this.#e?.(), this.#e = null) : (this.innerHTML = "", this.#e ||= $((e) => {
4401
+ e === this.getAttribute("name") && this.#n();
4402
+ }));
4403
+ }
4404
+ };
4405
+ export { M as $, be as A, de as B, De as C, g as Ct, Ce as D, we as E, q as F, V as G, W as H, ge as I, L as J, z as K, me as L, ve as M, J as N, Se as O, _e as P, N as Q, pe as R, Oe as S, v as St, Te as T, h as Tt, H as U, ue as V, B as W, F as X, I as Y, P as Z, Ne as _, ee as _t, We as a, E as at, Ae as b, b as bt, Ve as c, le as ct, Y as d, oe as dt, j as et, Re as f, ae as ft, Pe as g, te as gt, Fe as h, ne as ht, Ge as i, D as it, ye as j, xe as k, Be as l, ce as lt, Ie as m, re as mt, Q as n, k as nt, Ue as o, T as ot, Le as p, ie as pt, R as q, $ as r, O as rt, He as s, w as st, Ke as t, A as tt, ze as u, se as ut, Me as v, C as vt, Ee as w, _ as wt, ke as x, x as xt, je as y, S as yt, fe as z };