@arcadeai/design-system 3.39.1 → 3.39.2

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 (414) hide show
  1. package/dist/CompositeItem-CniPsjzP.js +30 -0
  2. package/dist/CompositeList-yq5K_yj6.js +81 -0
  3. package/dist/CompositeRoot-Dy-5A-Je.js +206 -0
  4. package/dist/DialogRoot-DDokfJcO.js +57 -0
  5. package/dist/DialogTrigger-CFUE8YsM.js +402 -0
  6. package/dist/DirectionContext-BSOheMwC.js +10 -0
  7. package/dist/FieldItemContext-CF2fRwBC.js +12 -0
  8. package/dist/FloatingPortalLite-BHsRx4XN.js +29 -0
  9. package/dist/InternalBackdrop-BVEfe6O1.js +610 -0
  10. package/dist/LabelableContext-Dzw1DWuj.js +171 -0
  11. package/dist/Separator-CswSYAXX.js +25 -0
  12. package/dist/ToolbarRootContext-D7EsmJ5f.js +10 -0
  13. package/dist/andromeeda-B-gfN00q.js +4 -0
  14. package/dist/angular-html-dA1qUKRV.js +32 -0
  15. package/dist/angular-ts-CXyBC0vY.js +21 -0
  16. package/dist/apl-CjNiDgad.js +3 -3
  17. package/dist/assets/images/arcade-grid.d.ts.map +1 -1
  18. package/dist/assets/images/arcade-grid.js +1 -0
  19. package/dist/assets/index.css +1 -1
  20. package/dist/assets/tokens.css +1 -1
  21. package/dist/assets/variables.css +1 -1
  22. package/dist/astro--3ZkKqYU.js +18 -0
  23. package/dist/astro-CFFExE8Q.js +5 -5
  24. package/dist/aurora-x-B56eICma.js +4 -0
  25. package/dist/ayu-dark-DJSOaKig.js +4 -0
  26. package/dist/ayu-light-BPfFt4v-.js +4 -0
  27. package/dist/ayu-mirage-DmPLRBj7.js +4 -0
  28. package/dist/blade-BoRuQEEj.js +20 -0
  29. package/dist/blade-D0HyNvCw.js +4 -4
  30. package/dist/c-C4SM8H98.js +6 -0
  31. package/dist/cairo-DM6WF2e3.js +1 -1
  32. package/dist/{calendar-DreAgQKY.js → calendar-CLEnvrbp.js} +483 -482
  33. package/dist/catppuccin-frappe-CA5k7W3u.js +4 -0
  34. package/dist/catppuccin-latte-CYfkUW5v.js +4 -0
  35. package/dist/catppuccin-macchiato-BOj_4I3g.js +4 -0
  36. package/dist/catppuccin-mocha-BXpUXme4.js +4 -0
  37. package/dist/clamp-BxE4ZAuA.js +17 -0
  38. package/dist/cobol-HihOMwht.js +1 -1
  39. package/dist/coffee-D8Swy5yR.js +8 -0
  40. package/dist/components/index.js +665 -646
  41. package/dist/components/ui/atoms/accordion.d.ts +9 -7
  42. package/dist/components/ui/atoms/accordion.d.ts.map +1 -1
  43. package/dist/components/ui/atoms/accordion.js +454 -243
  44. package/dist/components/ui/atoms/alert-dialog.d.ts +13 -9
  45. package/dist/components/ui/atoms/alert-dialog.d.ts.map +1 -1
  46. package/dist/components/ui/atoms/alert-dialog.js +149 -183
  47. package/dist/components/ui/atoms/alert.d.ts +2 -1
  48. package/dist/components/ui/atoms/alert.d.ts.map +1 -1
  49. package/dist/components/ui/atoms/alert.js +36 -25
  50. package/dist/components/ui/atoms/avatar.d.ts +10 -5
  51. package/dist/components/ui/atoms/avatar.d.ts.map +1 -1
  52. package/dist/components/ui/atoms/avatar.js +198 -205
  53. package/dist/components/ui/atoms/badge.d.ts +4 -5
  54. package/dist/components/ui/atoms/badge.d.ts.map +1 -1
  55. package/dist/components/ui/atoms/badge.js +31 -22
  56. package/dist/components/ui/atoms/breadcrumb.d.ts +4 -5
  57. package/dist/components/ui/atoms/breadcrumb.d.ts.map +1 -1
  58. package/dist/components/ui/atoms/breadcrumb.js +46 -29
  59. package/dist/components/ui/atoms/button.d.ts +4 -6
  60. package/dist/components/ui/atoms/button.d.ts.map +1 -1
  61. package/dist/components/ui/atoms/button.js +59 -28
  62. package/dist/components/ui/atoms/byoc-badge.d.ts +2 -2
  63. package/dist/components/ui/atoms/byoc-badge.d.ts.map +1 -1
  64. package/dist/components/ui/atoms/byoc-badge.js +14 -8
  65. package/dist/components/ui/atoms/calendar.d.ts +6 -16
  66. package/dist/components/ui/atoms/calendar.d.ts.map +1 -1
  67. package/dist/components/ui/atoms/calendar.js +1 -1
  68. package/dist/components/ui/atoms/card.d.ts +4 -2
  69. package/dist/components/ui/atoms/card.d.ts.map +1 -1
  70. package/dist/components/ui/atoms/card.js +46 -35
  71. package/dist/components/ui/atoms/chart.d.ts +24 -48
  72. package/dist/components/ui/atoms/chart.d.ts.map +1 -1
  73. package/dist/components/ui/atoms/chart.js +179 -148
  74. package/dist/components/ui/atoms/checkbox.d.ts +2 -3
  75. package/dist/components/ui/atoms/checkbox.d.ts.map +1 -1
  76. package/dist/components/ui/atoms/checkbox.js +269 -249
  77. package/dist/components/ui/atoms/code-block.js +1 -1
  78. package/dist/components/ui/atoms/collapsible.d.ts +5 -5
  79. package/dist/components/ui/atoms/collapsible.d.ts.map +1 -1
  80. package/dist/components/ui/atoms/collapsible.js +208 -23
  81. package/dist/components/ui/atoms/command.d.ts +4 -3
  82. package/dist/components/ui/atoms/command.d.ts.map +1 -1
  83. package/dist/components/ui/atoms/command.js +1655 -348
  84. package/dist/components/ui/atoms/dialog.d.ts +12 -10
  85. package/dist/components/ui/atoms/dialog.d.ts.map +1 -1
  86. package/dist/components/ui/atoms/dialog.js +91 -80
  87. package/dist/components/ui/atoms/dropdown-menu.d.ts +21 -17
  88. package/dist/components/ui/atoms/dropdown-menu.d.ts.map +1 -1
  89. package/dist/components/ui/atoms/dropdown-menu.js +1507 -899
  90. package/dist/components/ui/atoms/form.d.ts +5 -3
  91. package/dist/components/ui/atoms/form.d.ts.map +1 -1
  92. package/dist/components/ui/atoms/form.js +36 -42
  93. package/dist/components/ui/atoms/hover-card.d.ts +5 -6
  94. package/dist/components/ui/atoms/hover-card.d.ts.map +1 -1
  95. package/dist/components/ui/atoms/hover-card.js +355 -193
  96. package/dist/components/ui/atoms/index.d.ts +1 -0
  97. package/dist/components/ui/atoms/index.d.ts.map +1 -1
  98. package/dist/components/ui/atoms/index.js +566 -547
  99. package/dist/components/ui/atoms/input-group.d.ts +20 -0
  100. package/dist/components/ui/atoms/input-group.d.ts.map +1 -0
  101. package/dist/components/ui/atoms/input-group.js +136 -0
  102. package/dist/components/ui/atoms/input.d.ts.map +1 -1
  103. package/dist/components/ui/atoms/input.js +113 -13
  104. package/dist/components/ui/atoms/label.d.ts +1 -2
  105. package/dist/components/ui/atoms/label.d.ts.map +1 -1
  106. package/dist/components/ui/atoms/label.js +18 -31
  107. package/dist/components/ui/atoms/markdown.js +1 -1
  108. package/dist/components/ui/atoms/mobile-tooltip.js +4 -3
  109. package/dist/components/ui/atoms/popover.d.ts +8 -6
  110. package/dist/components/ui/atoms/popover.d.ts.map +1 -1
  111. package/dist/components/ui/atoms/popover.js +617 -245
  112. package/dist/components/ui/atoms/pro-badge.js +1 -1
  113. package/dist/components/ui/atoms/progress.d.ts +7 -4
  114. package/dist/components/ui/atoms/progress.d.ts.map +1 -1
  115. package/dist/components/ui/atoms/progress.js +236 -92
  116. package/dist/components/ui/atoms/radio-group.d.ts +4 -4
  117. package/dist/components/ui/atoms/radio-group.d.ts.map +1 -1
  118. package/dist/components/ui/atoms/radio-group.js +355 -251
  119. package/dist/components/ui/atoms/resizable.d.ts +3 -4
  120. package/dist/components/ui/atoms/resizable.d.ts.map +1 -1
  121. package/dist/components/ui/atoms/resizable.js +25 -27
  122. package/dist/components/ui/atoms/scroll-area.d.ts +5 -5
  123. package/dist/components/ui/atoms/scroll-area.d.ts.map +1 -1
  124. package/dist/components/ui/atoms/scroll-area.js +611 -526
  125. package/dist/components/ui/atoms/scroll-button.d.ts.map +1 -1
  126. package/dist/components/ui/atoms/scroll-button.js +27 -22
  127. package/dist/components/ui/atoms/select.d.ts +11 -11
  128. package/dist/components/ui/atoms/select.d.ts.map +1 -1
  129. package/dist/components/ui/atoms/select.js +1525 -889
  130. package/dist/components/ui/atoms/separator.d.ts +2 -3
  131. package/dist/components/ui/atoms/separator.d.ts.map +1 -1
  132. package/dist/components/ui/atoms/separator.js +16 -35
  133. package/dist/components/ui/atoms/sheet.d.ts +9 -9
  134. package/dist/components/ui/atoms/sheet.d.ts.map +1 -1
  135. package/dist/components/ui/atoms/sheet.js +65 -64
  136. package/dist/components/ui/atoms/sidebar.d.ts +9 -15
  137. package/dist/components/ui/atoms/sidebar.d.ts.map +1 -1
  138. package/dist/components/ui/atoms/sidebar.js +288 -283
  139. package/dist/components/ui/atoms/skeleton.js +4 -4
  140. package/dist/components/ui/atoms/slider.d.ts +2 -3
  141. package/dist/components/ui/atoms/slider.d.ts.map +1 -1
  142. package/dist/components/ui/atoms/slider.js +886 -440
  143. package/dist/components/ui/atoms/switch.d.ts +4 -5
  144. package/dist/components/ui/atoms/switch.d.ts.map +1 -1
  145. package/dist/components/ui/atoms/switch.js +218 -151
  146. package/dist/components/ui/atoms/table.d.ts +2 -4
  147. package/dist/components/ui/atoms/table.d.ts.map +1 -1
  148. package/dist/components/ui/atoms/table.js +35 -36
  149. package/dist/components/ui/atoms/tabs.d.ts +11 -7
  150. package/dist/components/ui/atoms/tabs.d.ts.map +1 -1
  151. package/dist/components/ui/atoms/tabs.js +492 -186
  152. package/dist/components/ui/atoms/textarea.d.ts.map +1 -1
  153. package/dist/components/ui/atoms/textarea.js +7 -7
  154. package/dist/components/ui/atoms/toggle.d.ts +2 -3
  155. package/dist/components/ui/atoms/toggle.d.ts.map +1 -1
  156. package/dist/components/ui/atoms/toggle.js +92 -45
  157. package/dist/components/ui/atoms/tooltip.d.ts +6 -9
  158. package/dist/components/ui/atoms/tooltip.d.ts.map +1 -1
  159. package/dist/components/ui/atoms/tooltip.js +625 -343
  160. package/dist/components/ui/atoms/view-tools-control.js +16 -15
  161. package/dist/components/ui/atoms/virtualized-grid.d.ts +11 -4
  162. package/dist/components/ui/atoms/virtualized-grid.d.ts.map +1 -1
  163. package/dist/components/ui/atoms/virtualized-grid.js +365 -333
  164. package/dist/components/ui/index.js +665 -646
  165. package/dist/components/ui/molecules/chat-history-item.d.ts.map +1 -1
  166. package/dist/components/ui/molecules/chat-history-item.js +47 -40
  167. package/dist/components/ui/molecules/command-bar.js +1 -1
  168. package/dist/components/ui/molecules/confirm-popover.d.ts +2 -2
  169. package/dist/components/ui/molecules/confirm-popover.d.ts.map +1 -1
  170. package/dist/components/ui/molecules/confirm-popover.js +26 -24
  171. package/dist/components/ui/molecules/date-time-picker.d.ts.map +1 -1
  172. package/dist/components/ui/molecules/date-time-picker.js +17 -11
  173. package/dist/components/ui/molecules/index.js +1 -1
  174. package/dist/components/ui/molecules/message.d.ts +2 -3
  175. package/dist/components/ui/molecules/message.d.ts.map +1 -1
  176. package/dist/components/ui/molecules/message.js +10 -16
  177. package/dist/components/ui/molecules/prompt-input.d.ts +1 -1
  178. package/dist/components/ui/molecules/prompt-input.d.ts.map +1 -1
  179. package/dist/components/ui/molecules/prompt-input.js +21 -22
  180. package/dist/components/ui/molecules/requirement-badges.d.ts.map +1 -1
  181. package/dist/components/ui/molecules/requirement-badges.js +3 -3
  182. package/dist/components/ui/molecules/steps-progress.js +1 -0
  183. package/dist/components/ui/molecules/tool-call-accordion.js +1 -0
  184. package/dist/components/ui/molecules/tool-card.d.ts.map +1 -1
  185. package/dist/components/ui/molecules/tool-card.js +60 -47
  186. package/dist/components/ui/molecules/toolkit-card.d.ts.map +1 -1
  187. package/dist/components/ui/molecules/toolkit-card.js +1 -1
  188. package/dist/components/ui/molecules/user-nav.d.ts.map +1 -1
  189. package/dist/components/ui/molecules/user-nav.js +62 -57
  190. package/dist/components/ui/templates/auth-template.js +5 -5
  191. package/dist/composite-BASdnlNo.js +220 -0
  192. package/dist/composite-BSpUD7nI.js +66 -0
  193. package/dist/cpp-CA4iM_wM.js +18 -0
  194. package/dist/createBaseUIEventDetails-CqidROtw.js +55 -0
  195. package/dist/crystal-CRJyc4G-.js +4 -4
  196. package/dist/css-M7EaDHN_.js +6 -0
  197. package/dist/csv-B7yqA61e.js +6 -0
  198. package/dist/dark-plus-B4vfALTw.js +4 -0
  199. package/dist/detectBrowser-Dn2N72k1.js +42 -0
  200. package/dist/dracula-Cb59ZzY3.js +4 -0
  201. package/dist/dracula-soft-aaEmszbU.js +4 -0
  202. package/dist/edge-BYQkOzbF.js +1 -1
  203. package/dist/element-DSo91iOi.js +88 -0
  204. package/dist/elm-BtNbw_Cd.js +1 -1
  205. package/dist/erlang-DNcDT8Hi.js +1 -1
  206. package/dist/event-BCa0Un_3.js +30 -0
  207. package/dist/everforest-dark-CLp_21RJ.js +4 -0
  208. package/dist/everforest-light-CZ0NCAAv.js +4 -0
  209. package/dist/floating-ui.utils-48URp89E.js +126 -0
  210. package/dist/floating-ui.utils.dom-jr2suqy2.js +135 -0
  211. package/dist/fsharp-CYOiIVNx.js +1 -1
  212. package/dist/getDisabledMountTransitionStyles-fmnaQYVj.js +1539 -0
  213. package/dist/getPseudoElementBounds-B4_miSEJ.js +364 -0
  214. package/dist/git-rebase-ZWUFO_T4.js +1 -1
  215. package/dist/github-dark-BD3lImVS.js +4 -0
  216. package/dist/github-dark-default-ID_nBUwl.js +4 -0
  217. package/dist/github-dark-dimmed-Cw4rFgde.js +4 -0
  218. package/dist/github-dark-high-contrast-DSby9de8.js +4 -0
  219. package/dist/github-light-W396yAFe.js +4 -0
  220. package/dist/github-light-default-DCAQ2px1.js +4 -0
  221. package/dist/github-light-high-contrast-ChWJGEvx.js +4 -0
  222. package/dist/glimmer-js-DkxNrfPT.js +2 -2
  223. package/dist/glimmer-ts-D6YZEmK_.js +2 -2
  224. package/dist/glsl-CgdqkyFp.js +8 -0
  225. package/dist/graphql-Bv26LTzG.js +14 -0
  226. package/dist/gruvbox-dark-hard-BC1GRqFa.js +4 -0
  227. package/dist/gruvbox-dark-medium-COLy2cDY.js +4 -0
  228. package/dist/gruvbox-dark-soft-B8MALL4f.js +4 -0
  229. package/dist/gruvbox-light-hard-Bzxr_AnB.js +4 -0
  230. package/dist/gruvbox-light-medium-D2fqu3Kj.js +4 -0
  231. package/dist/gruvbox-light-soft-atzRH3-n.js +4 -0
  232. package/dist/hack-ItRNKiEb.js +1 -1
  233. package/dist/haml-B1t5q1Sv.js +10 -0
  234. package/dist/haml-NZLVzu_R.js +1 -1
  235. package/dist/handlebars-B2fb61mr.js +14 -0
  236. package/dist/handlebars-mxStpSE7.js +2 -2
  237. package/dist/highlighted-body-OFNGDK62-Df6AJMbs.js +20 -0
  238. package/dist/hooks/use-mobile.d.ts.map +1 -1
  239. package/dist/hooks/use-mobile.js +11 -12
  240. package/dist/horizon-PFtq58ZB.js +4 -0
  241. package/dist/horizon-bright-2WzHy-Vo.js +4 -0
  242. package/dist/houston-BEqUWhHr.js +4 -0
  243. package/dist/html-B50bmoVb.js +1 -1
  244. package/dist/html-CPZ3oZQ7.js +10 -0
  245. package/dist/html-derivative-B2qv7eyt.js +8 -0
  246. package/dist/http-BQ2t9cn1.js +14 -0
  247. package/dist/hurl-RyCMCa80.js +12 -0
  248. package/dist/imba-DpB-wtPB.js +6 -0
  249. package/dist/index-3rscXtm3.js +4708 -0
  250. package/dist/inertValue-kpZZDBEy.js +7 -0
  251. package/dist/integrations/rhf/index.js +6 -5
  252. package/dist/isElementDisabled-Cbd8W9kH.js +6 -0
  253. package/dist/java-CbphP4lz.js +6 -0
  254. package/dist/javascript-CgYd5l7W.js +6 -0
  255. package/dist/jinja-DFCUirAg.js +11 -0
  256. package/dist/jison-CTEI_s6O.js +8 -0
  257. package/dist/json-B5-prx4F.js +6 -0
  258. package/dist/json5-CZ8R1oUY.js +6 -0
  259. package/dist/jsonc-DMboCKBJ.js +6 -0
  260. package/dist/jsonl-YgIUi4Dg.js +6 -0
  261. package/dist/jsx-D4q4E1UD.js +6 -0
  262. package/dist/julia-2ubi2n9a.js +16 -0
  263. package/dist/just-CEK2SJ_k.js +4 -4
  264. package/dist/kanagawa-dragon-DuYaOBBk.js +4 -0
  265. package/dist/kanagawa-lotus-CyjAihYC.js +4 -0
  266. package/dist/kanagawa-wave-BVdXUMj5.js +4 -0
  267. package/dist/laserwave-B_2VVKNJ.js +4 -0
  268. package/dist/less-MoGo8xoS.js +6 -0
  269. package/dist/light-plus-IB4fPeJj.js +4 -0
  270. package/dist/liquid-CHzkx3jT.js +2 -2
  271. package/dist/lua-Bp3IRv7I.js +1 -1
  272. package/dist/main.js +691 -672
  273. package/dist/markdown-B-zRtm0x.js +6 -0
  274. package/dist/{markdown-D0xxRbwP.js → markdown-B71Eurda.js} +10329 -8108
  275. package/dist/marko-BlmC3dqW.js +14 -0
  276. package/dist/marko-CJBA24Ri.js +2 -2
  277. package/dist/material-theme-CjsSdYF2.js +4 -0
  278. package/dist/material-theme-darker-DEk0vgdS.js +4 -0
  279. package/dist/material-theme-lighter-DEVB_7K5.js +4 -0
  280. package/dist/material-theme-ocean-DK6jm24j.js +4 -0
  281. package/dist/material-theme-palenight-CNkXNpHv.js +4 -0
  282. package/dist/mdc-C9YSUwVC.js +2 -2
  283. package/dist/mdc-CLNk3q28.js +12 -0
  284. package/dist/mdx-CiUWpBB_.js +6 -0
  285. package/dist/mermaid-GHXKKRXX-BkplG-MI.js +5 -0
  286. package/dist/min-dark-CJcHUHwu.js +4 -0
  287. package/dist/min-light-BAN2UR75.js +4 -0
  288. package/dist/monokai-BbXwpjKl.js +4 -0
  289. package/dist/night-owl-csViJ7u4.js +4 -0
  290. package/dist/night-owl-light-BC-NuMC3.js +4 -0
  291. package/dist/nim-QAjRdh9w.js +5 -5
  292. package/dist/nord-B8Sq-VQ0.js +4 -0
  293. package/dist/one-dark-pro-DTdrcl-J.js +4 -0
  294. package/dist/one-light-kPHTChCU.js +4 -0
  295. package/dist/owner-rKN292Q9.js +6 -0
  296. package/dist/perl-DkVrgJBg.js +3 -3
  297. package/dist/php-BIzsF_5x.js +4 -4
  298. package/dist/php-Kn-vgdBD.js +18 -0
  299. package/dist/plastic-DDweBgVs.js +4 -0
  300. package/dist/poimandres-Dqvs16BQ.js +4 -0
  301. package/dist/popupStateMapping-BT9Y_jIq.js +1849 -0
  302. package/dist/postcss-CwL8bLZI.js +6 -0
  303. package/dist/pug-CTOOvSEH.js +12 -0
  304. package/dist/pug-XOw9Q1Ho.js +1 -1
  305. package/dist/python-jjYlTiSH.js +6 -0
  306. package/dist/qml-rTNXsquU.js +1 -1
  307. package/dist/r-C8zl4zMO.js +6 -0
  308. package/dist/react-resizable-panels-BqIpIFl2.js +2017 -0
  309. package/dist/red-DBDwQkX-.js +4 -0
  310. package/dist/regexp-Dpy_RgoJ.js +6 -0
  311. package/dist/resolveAriaLabelledBy-B5vw-szP.js +11 -0
  312. package/dist/rose-pine-DGHrTu7e.js +4 -0
  313. package/dist/rose-pine-dawn-DfRVdapG.js +4 -0
  314. package/dist/rose-pine-moon-DFpJm5Rd.js +4 -0
  315. package/dist/rst-DM32Wy3O.js +5 -5
  316. package/dist/ruby-BeqCs27h.js +8 -8
  317. package/dist/safePolygon-CJcmMc0u.js +389 -0
  318. package/dist/safeReact-DKq-628G.js +7 -0
  319. package/dist/sas-fpEvgATw.js +1 -1
  320. package/dist/sass-BmupNt-w.js +6 -0
  321. package/dist/scss-BZYVIVaN.js +8 -0
  322. package/dist/serializeValue-BebmSzW3.js +14 -0
  323. package/dist/shellscript-fMxXshxv.js +6 -0
  324. package/dist/shellsession-DiDJNQdy.js +1 -1
  325. package/dist/slack-dark-noeC6QPl.js +4 -0
  326. package/dist/slack-ochin-3_2idqLR.js +4 -0
  327. package/dist/snazzy-light-B9cV359v.js +4 -0
  328. package/dist/solarized-dark-B6X0ILWr.js +4 -0
  329. package/dist/solarized-light-LxOemn3c.js +4 -0
  330. package/dist/sql-D30Zid36.js +6 -0
  331. package/dist/stata-B8c5fTjX.js +1 -1
  332. package/dist/styles-DU5BO7fS.js +16 -0
  333. package/dist/stylus-BoBcEBjx.js +6 -0
  334. package/dist/surrealql-CQi7GQN7.js +1 -1
  335. package/dist/svelte-b9PAcyUe.js +14 -0
  336. package/dist/svelte-rYri41WT.js +3 -3
  337. package/dist/synthwave-84-DzQeMpV0.js +4 -0
  338. package/dist/templ-Crs9Ui8q.js +1 -1
  339. package/dist/tex-AHxmLTL0.js +1 -1
  340. package/dist/tokyo-night-CLM-V_Re.js +4 -0
  341. package/dist/{toolkit-card-CB1oiaei.js → toolkit-card-DhpOY80l.js} +56 -36
  342. package/dist/ts-tags-CP1b-4Z2.js +41 -0
  343. package/dist/ts-tags-ioVe2PKw.js +5 -5
  344. package/dist/tsx-QNpb2qLW.js +6 -0
  345. package/dist/twig-DwV2Fi4L.js +2 -2
  346. package/dist/typescript-AhniRyfZ.js +6 -0
  347. package/dist/useAnimationFrame-DIc6eFHa.js +69 -0
  348. package/dist/useAriaLabelledBy-VklrCmKp.js +34 -0
  349. package/dist/useBaseUiId-C8Dq0BQq.js +25 -0
  350. package/dist/useButton-JYPKQKj4.js +150 -0
  351. package/dist/useCollapsiblePanel-9pDlDh3R.js +257 -0
  352. package/dist/useCompositeItem-D00ALGkT.js +35 -0
  353. package/dist/useCompositeListItem-CYQrZg5-.js +74 -0
  354. package/dist/useControlled-Sx-_x7Sz.js +32 -0
  355. package/dist/useFocus-Aj9ShMQu.js +97 -0
  356. package/dist/useIsoLayoutEffect-DpJo20by.js +7 -0
  357. package/dist/useLabelableId-DF_d91GP.js +44 -0
  358. package/dist/useOnFirstRender-B4aruaIA.js +9 -0
  359. package/dist/useOnMount-JHtE6teb.js +9 -0
  360. package/dist/useOpenChangeComplete-DkeH9FGJ.js +130 -0
  361. package/dist/useRender-BNXBkp2o.js +7 -0
  362. package/dist/useRenderElement-DNB2vtF1.js +274 -0
  363. package/dist/useRole-N-RCRzo1.js +76 -0
  364. package/dist/useStableCallback-CudqoENs.js +33 -0
  365. package/dist/useSyncedFloatingRootContext-Bc90zSTy.js +185 -0
  366. package/dist/useTimeout-DAqPwigF.js +33 -0
  367. package/dist/useValueAsRef-LhoZc6As.js +20 -0
  368. package/dist/useValueChanged-Bissqjjn.js +15 -0
  369. package/dist/valueToPercent-BBgE4D3L.js +27 -0
  370. package/dist/vesper-BmV7KiQ0.js +4 -0
  371. package/dist/visuallyHidden-PuyyGHVF.js +22 -0
  372. package/dist/vitesse-black-CxZz3C4s.js +4 -0
  373. package/dist/vitesse-dark-DVUJ0sy2.js +4 -0
  374. package/dist/vitesse-light-BDJohtUr.js +4 -0
  375. package/dist/vue-CY6W2ID0.js +31 -0
  376. package/dist/vue-DXEmyXn9.js +3 -3
  377. package/dist/vue-html-DYXHAJ2G.js +8 -0
  378. package/dist/vue-vine-D41-N99t.js +4 -4
  379. package/dist/vue-vine-DiWTpMwZ.js +18 -0
  380. package/dist/wasm-3y0A1Y71.js +6 -0
  381. package/dist/wasm-Dm9SFfrx.js +7 -0
  382. package/dist/web-BbvN_Lei.js +2846 -0
  383. package/dist/wgsl-SXl3EZUN.js +6 -0
  384. package/dist/wit-Cw0CTVY0.js +6 -0
  385. package/dist/xml-CNXGTZ6Z.js +8 -0
  386. package/dist/xsl-BmSZphgC.js +1 -1
  387. package/dist/yaml-DZqZ2PBD.js +6 -0
  388. package/package.json +37 -34
  389. package/dist/highlighted-body-TPN3WLV5-D6UnKGod.js +0 -19
  390. package/dist/index-0ioNhtNM.js +0 -10
  391. package/dist/index-437EL2iq.js +0 -52
  392. package/dist/index-B695uy69.js +0 -9
  393. package/dist/index-BEZCAdXQ.js +0 -1568
  394. package/dist/index-BGQepRFJ.js +0 -27
  395. package/dist/index-BZPx6jYI.js +0 -8
  396. package/dist/index-BaLuVb4t.js +0 -70
  397. package/dist/index-Bw62B28F.js +0 -31
  398. package/dist/index-By-GFSsC.js +0 -245
  399. package/dist/index-ByaXH_ih.js +0 -10
  400. package/dist/index-CCKe-Mpx.js +0 -6
  401. package/dist/index-Cv867SGx.js +0 -13
  402. package/dist/index-CvA4FcaC.js +0 -677
  403. package/dist/index-D2LZVjSn.js +0 -82
  404. package/dist/index-DFZozV_h.js +0 -68
  405. package/dist/index-DJQkmo5O.js +0 -49
  406. package/dist/index-DLohNuco.js +0 -36
  407. package/dist/index-DrFfdHac.js +0 -144
  408. package/dist/index-DrlYGDRT.js +0 -119
  409. package/dist/index-Dz8CQngS.js +0 -181
  410. package/dist/index-cd1ceFJg.js +0 -6973
  411. package/dist/index-rKs9bXHr.js +0 -6
  412. package/dist/mermaid-O7DHMXV3-gUrB-Xs1.js +0 -4
  413. package/dist/react-resizable-panels.browser-DYl0LXfw.js +0 -1510
  414. package/dist/web-BwFNdl01.js +0 -697
@@ -1,977 +1,1613 @@
1
- import { jsx as s, jsxs as Q, Fragment as be } from "react/jsx-runtime";
2
- import { CheckIcon as lt, ChevronDownIcon as _e, ChevronUpIcon as ct } from "lucide-react";
3
- import { cn as G } from "../../../lib/utils.js";
1
+ "use client";
2
+ import { jsx as R, jsxs as ze } from "react/jsx-runtime";
3
+ import { CheckIcon as ln, ChevronDownIcon as Ct, ChevronUpIcon as an } from "lucide-react";
4
+ import { cn as Pe } from "../../../lib/utils.js";
4
5
  import * as n from "react";
5
- import * as Ee from "react-dom";
6
- import { c as Ne } from "../../../index-rKs9bXHr.js";
7
- import { c as P } from "../../../index-B695uy69.js";
8
- import { c as it } from "../../../index-DJQkmo5O.js";
9
- import { u as k, c as dt } from "../../../index-D2LZVjSn.js";
10
- import { c as ut } from "../../../index-DFZozV_h.js";
11
- import { u as pt } from "../../../index-ByaXH_ih.js";
12
- import { P as ft, D as mt } from "../../../index-DrFfdHac.js";
13
- import { h as ht, u as vt, R as gt, F as St } from "../../../index-CvA4FcaC.js";
14
- import { u as Te } from "../../../index-Cv867SGx.js";
15
- import { R as wt, A as xt, c as Me, C as Ct, a as yt } from "../../../index-BEZCAdXQ.js";
16
- import { P as M } from "../../../index-DLohNuco.js";
17
- import { u as It } from "../../../index-0ioNhtNM.js";
18
- import { u as Re } from "../../../index-437EL2iq.js";
19
- import { u as j } from "../../../index-CCKe-Mpx.js";
20
- import { u as bt } from "../../../index-BZPx6jYI.js";
21
- import { V as Tt } from "../../../index-Bw62B28F.js";
22
- var Pt = [" ", "Enter", "ArrowUp", "ArrowDown"], Nt = [" ", "Enter"], ee = "Select", [de, ue, Rt] = it(ee), [ne] = ut(ee, [
23
- Rt,
24
- Me
25
- ]), pe = Me(), [_t, Y] = ne(ee), [Et, Mt] = ne(ee), Ae = (t) => {
26
- const {
27
- __scopeSelect: o,
28
- children: e,
29
- open: c,
30
- defaultOpen: l,
31
- onOpenChange: u,
32
- value: r,
33
- defaultValue: a,
34
- onValueChange: i,
35
- dir: f,
36
- name: g,
37
- autoComplete: x,
38
- disabled: N,
39
- required: b,
40
- form: y
41
- } = t, d = pe(o), [h, S] = n.useState(null), [m, v] = n.useState(null), [W, A] = n.useState(!1), re = pt(f), [R, D] = Re({
42
- prop: c,
43
- defaultProp: l ?? !1,
44
- onChange: u,
45
- caller: ee
46
- }), [z, X] = Re({
47
- prop: r,
48
- defaultProp: a,
49
- onChange: i,
50
- caller: ee
51
- }), B = n.useRef(null), V = h ? y || !!h.closest("form") : !0, [K, H] = n.useState(/* @__PURE__ */ new Set()), U = Array.from(K).map((_) => _.props.value).join(";");
52
- return /* @__PURE__ */ s(wt, { ...d, children: /* @__PURE__ */ Q(
53
- _t,
54
- {
55
- required: b,
56
- scope: o,
57
- trigger: h,
58
- onTriggerChange: S,
59
- valueNode: m,
60
- onValueNodeChange: v,
61
- valueNodeHasChildren: W,
62
- onValueNodeHasChildrenChange: A,
63
- contentId: Te(),
64
- value: z,
65
- onValueChange: X,
66
- open: R,
67
- onOpenChange: D,
68
- dir: re,
69
- triggerPointerDownPosRef: B,
70
- disabled: N,
71
- children: [
72
- /* @__PURE__ */ s(de.Provider, { scope: o, children: /* @__PURE__ */ s(
73
- Et,
74
- {
75
- scope: t.__scopeSelect,
76
- onNativeOptionAdd: n.useCallback((_) => {
77
- H((L) => new Set(L).add(_));
78
- }, []),
79
- onNativeOptionRemove: n.useCallback((_) => {
80
- H((L) => {
81
- const F = new Set(L);
82
- return F.delete(_), F;
83
- });
84
- }, []),
85
- children: e
86
- }
87
- ) }),
88
- V ? /* @__PURE__ */ Q(
89
- nt,
90
- {
91
- "aria-hidden": !0,
92
- required: b,
93
- tabIndex: -1,
94
- name: g,
95
- autoComplete: x,
96
- value: z,
97
- onChange: (_) => X(_.target.value),
98
- disabled: N,
99
- form: y,
100
- children: [
101
- z === void 0 ? /* @__PURE__ */ s("option", { value: "" }) : null,
102
- Array.from(K)
103
- ]
104
- },
105
- U
106
- ) : null
107
- ]
108
- }
109
- ) });
110
- };
111
- Ae.displayName = ee;
112
- var Oe = "SelectTrigger", De = n.forwardRef(
113
- (t, o) => {
114
- const { __scopeSelect: e, disabled: c = !1, ...l } = t, u = pe(e), r = Y(Oe, e), a = r.disabled || c, i = k(o, r.onTriggerChange), f = ue(e), g = n.useRef("touch"), [x, N, b] = st((d) => {
115
- const h = f().filter((v) => !v.disabled), S = h.find((v) => v.value === r.value), m = at(h, d, S);
116
- m !== void 0 && r.onValueChange(m.value);
117
- }), y = (d) => {
118
- a || (r.onOpenChange(!0), b()), d && (r.triggerPointerDownPosRef.current = {
119
- x: Math.round(d.pageX),
120
- y: Math.round(d.pageY)
121
- });
122
- };
123
- return /* @__PURE__ */ s(xt, { asChild: !0, ...u, children: /* @__PURE__ */ s(
124
- M.button,
125
- {
126
- type: "button",
127
- role: "combobox",
128
- "aria-controls": r.contentId,
129
- "aria-expanded": r.open,
130
- "aria-required": r.required,
131
- "aria-autocomplete": "none",
132
- dir: r.dir,
133
- "data-state": r.open ? "open" : "closed",
134
- disabled: a,
135
- "data-disabled": a ? "" : void 0,
136
- "data-placeholder": rt(r.value) ? "" : void 0,
137
- ...l,
138
- ref: i,
139
- onClick: P(l.onClick, (d) => {
140
- d.currentTarget.focus(), g.current !== "mouse" && y(d);
141
- }),
142
- onPointerDown: P(l.onPointerDown, (d) => {
143
- g.current = d.pointerType;
144
- const h = d.target;
145
- h.hasPointerCapture(d.pointerId) && h.releasePointerCapture(d.pointerId), d.button === 0 && d.ctrlKey === !1 && d.pointerType === "mouse" && (y(d), d.preventDefault());
146
- }),
147
- onKeyDown: P(l.onKeyDown, (d) => {
148
- const h = x.current !== "";
149
- !(d.ctrlKey || d.altKey || d.metaKey) && d.key.length === 1 && N(d.key), !(h && d.key === " ") && Pt.includes(d.key) && (y(), d.preventDefault());
150
- })
151
- }
152
- ) });
6
+ import { v as cn, a as un } from "../../../visuallyHidden-PuyyGHVF.js";
7
+ import { f as Xe, b as Rt, a as dn, m as Vt, E as fn, c as Pt, u as be } from "../../../useRenderElement-DNB2vtF1.js";
8
+ import { u as pn } from "../../../useOnFirstRender-B4aruaIA.js";
9
+ import { u as Et } from "../../../useControlled-Sx-_x7Sz.js";
10
+ import { u as Se } from "../../../useIsoLayoutEffect-DpJo20by.js";
11
+ import { u as Ce } from "../../../useStableCallback-CudqoENs.js";
12
+ import { u as pt } from "../../../useValueAsRef-LhoZc6As.js";
13
+ import { c as mn, a as Dt, b as gn, u as hn, f as Sn } from "../../../LabelableContext-Dzw1DWuj.js";
14
+ import { u as Ot } from "../../../useLabelableId-DF_d91GP.js";
15
+ import { u as mt, a as ot, t as Lt } from "../../../useOpenChangeComplete-DkeH9FGJ.js";
16
+ import { s as ut } from "../../../serializeValue-BebmSzW3.js";
17
+ import { d as A, S as bn, K as f, p as xn, q as vn, B as yn, r as In, z as wn, L as Rn, x as Ht } from "../../../popupStateMapping-BT9Y_jIq.js";
18
+ import { f as En, o as Tn, c as Ve, n as gt, q as Mn, w as Nn, r as it } from "../../../createBaseUIEventDetails-CqidROtw.js";
19
+ import { u as An } from "../../../useValueChanged-Bissqjjn.js";
20
+ import { u as Cn, b as Vn, a as Pn, I as Dn, F as On } from "../../../InternalBackdrop-BVEfe6O1.js";
21
+ import { b as Ln, u as Hn, g as Ut, p as Un } from "../../../getDisabledMountTransitionStyles-fmnaQYVj.js";
22
+ import { u as Bn, a as Fn, g as _n } from "../../../getPseudoElementBounds-B4_miSEJ.js";
23
+ import { i as kn } from "../../../inertValue-kpZZDBEy.js";
24
+ import { C as zn } from "../../../CompositeList-yq5K_yj6.js";
25
+ import * as Wn from "react-dom";
26
+ import { r as qn } from "../../../floating-ui.utils-48URp89E.js";
27
+ import { u as Le } from "../../../useTimeout-DAqPwigF.js";
28
+ import { e as Yn } from "../../../detectBrowser-Dn2N72k1.js";
29
+ import { o as dt } from "../../../owner-rKN292Q9.js";
30
+ import { u as Gn } from "../../../useAnimationFrame-DIc6eFHa.js";
31
+ import { s as ft } from "../../../styles-DU5BO7fS.js";
32
+ import { u as $n } from "../../../ToolbarRootContext-D7EsmJ5f.js";
33
+ import { C as jn } from "../../../composite-BSpUD7nI.js";
34
+ import { u as Xn, c as at } from "../../../clamp-BxE4ZAuA.js";
35
+ import { g as Tt } from "../../../floating-ui.utils.dom-jr2suqy2.js";
36
+ import { u as Kn, I as Jn } from "../../../useCompositeListItem-CYQrZg5-.js";
37
+ import { a as Bt } from "../../../useButton-JYPKQKj4.js";
38
+ import { u as Zn } from "../../../useBaseUiId-C8Dq0BQq.js";
39
+ import { S as Qn } from "../../../Separator-CswSYAXX.js";
40
+ import { r as eo } from "../../../resolveAriaLabelledBy-B5vw-szP.js";
41
+ import { g as to, c as ct } from "../../../element-DSo91iOi.js";
42
+ const ht = /* @__PURE__ */ n.createContext(null);
43
+ process.env.NODE_ENV !== "production" && (ht.displayName = "SelectRootContext");
44
+ const St = /* @__PURE__ */ n.createContext(null);
45
+ process.env.NODE_ENV !== "production" && (St.displayName = "SelectFloatingContext");
46
+ function Ee() {
47
+ const e = n.useContext(ht);
48
+ if (e === null)
49
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>." : Xe(60));
50
+ return e;
51
+ }
52
+ function Ft() {
53
+ const e = n.useContext(St);
54
+ if (e === null)
55
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>." : Xe(61));
56
+ return e;
57
+ }
58
+ const no = (e, t) => Object.is(e, t);
59
+ function ke(e, t, o) {
60
+ return e == null || t == null ? Object.is(e, t) : o(e, t);
61
+ }
62
+ function oo(e, t, o) {
63
+ return !e || e.length === 0 ? !1 : e.some((s) => s === void 0 ? !1 : ke(t, s, o));
64
+ }
65
+ function je(e, t, o) {
66
+ return !e || e.length === 0 ? -1 : e.findIndex((s) => s === void 0 ? !1 : ke(s, t, o));
67
+ }
68
+ function ro(e, t, o) {
69
+ return e.filter((s) => !ke(t, s, o));
70
+ }
71
+ function _t(e) {
72
+ return e != null && e.length > 0 && typeof e[0] == "object" && e[0] != null && "items" in e[0];
73
+ }
74
+ function so(e) {
75
+ if (!Array.isArray(e))
76
+ return e != null && "null" in e;
77
+ const t = e;
78
+ if (_t(t)) {
79
+ for (const o of t)
80
+ for (const s of o.items)
81
+ if (s && s.value == null && s.label != null)
82
+ return !0;
83
+ return !1;
153
84
  }
154
- );
155
- De.displayName = Oe;
156
- var Le = "SelectValue", ke = n.forwardRef(
157
- (t, o) => {
158
- const { __scopeSelect: e, className: c, style: l, children: u, placeholder: r = "", ...a } = t, i = Y(Le, e), { onValueNodeHasChildrenChange: f } = i, g = u !== void 0, x = k(o, i.onValueNodeChange);
159
- return j(() => {
160
- f(g);
161
- }, [f, g]), /* @__PURE__ */ s(
162
- M.span,
163
- {
164
- ...a,
165
- ref: x,
166
- style: { pointerEvents: "none" },
167
- children: rt(i.value) ? /* @__PURE__ */ s(be, { children: r }) : u
168
- }
169
- );
85
+ for (const o of t)
86
+ if (o && o.value == null && o.label != null)
87
+ return !0;
88
+ return !1;
89
+ }
90
+ function lo(e, t) {
91
+ if (t && e != null)
92
+ return t(e) ?? "";
93
+ if (e && typeof e == "object") {
94
+ if ("label" in e && e.label != null)
95
+ return String(e.label);
96
+ if ("value" in e)
97
+ return String(e.value);
170
98
  }
171
- );
172
- ke.displayName = Le;
173
- var At = "SelectIcon", Be = n.forwardRef(
174
- (t, o) => {
175
- const { __scopeSelect: e, children: c, ...l } = t;
176
- return /* @__PURE__ */ s(M.span, { "aria-hidden": !0, ...l, ref: o, children: c || "▼" });
99
+ return ut(e);
100
+ }
101
+ function _e(e, t) {
102
+ return t && e != null ? t(e) ?? "" : e && typeof e == "object" && "value" in e && "label" in e ? ut(e.value) : ut(e);
103
+ }
104
+ function kt(e, t, o) {
105
+ function s() {
106
+ return lo(e, o);
177
107
  }
178
- );
179
- Be.displayName = At;
180
- var Ot = "SelectPortal", Ve = (t) => /* @__PURE__ */ s(ft, { asChild: !0, ...t });
181
- Ve.displayName = Ot;
182
- var te = "SelectContent", He = n.forwardRef(
183
- (t, o) => {
184
- const e = Y(te, t.__scopeSelect), [c, l] = n.useState();
185
- if (j(() => {
186
- l(new DocumentFragment());
187
- }, []), !e.open) {
188
- const u = c;
189
- return u ? Ee.createPortal(
190
- /* @__PURE__ */ s(Ue, { scope: t.__scopeSelect, children: /* @__PURE__ */ s(de.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ s("div", { children: t.children }) }) }),
191
- u
192
- ) : null;
108
+ if (o && e != null)
109
+ return o(e);
110
+ if (e && typeof e == "object" && "label" in e && e.label != null)
111
+ return e.label;
112
+ if (t && !Array.isArray(t))
113
+ return t[e] ?? s();
114
+ if (Array.isArray(t)) {
115
+ const x = t, l = _t(x) ? x.flatMap((c) => c.items) : x;
116
+ if (e == null || typeof e != "object") {
117
+ const c = l.find((u) => u.value === e);
118
+ return c && c.label != null ? c.label : s();
119
+ }
120
+ if ("value" in e) {
121
+ const c = l.find((u) => u && u.value === e.value);
122
+ if (c && c.label != null)
123
+ return c.label;
193
124
  }
194
- return /* @__PURE__ */ s(Fe, { ...t, ref: o });
195
125
  }
196
- );
197
- He.displayName = te;
198
- var O = 10, [Ue, q] = ne(te), Dt = "SelectContentImpl", Lt = dt("SelectContent.RemoveScroll"), Fe = n.forwardRef(
199
- (t, o) => {
126
+ return s();
127
+ }
128
+ function io(e, t, o) {
129
+ return e.reduce((s, x, l) => (l > 0 && s.push(", "), s.push(/* @__PURE__ */ R(n.Fragment, {
130
+ children: kt(x, t, o)
131
+ }, l)), s), []);
132
+ }
133
+ const a = {
134
+ id: A((e) => e.id),
135
+ labelId: A((e) => e.labelId),
136
+ modal: A((e) => e.modal),
137
+ multiple: A((e) => e.multiple),
138
+ items: A((e) => e.items),
139
+ itemToStringLabel: A((e) => e.itemToStringLabel),
140
+ itemToStringValue: A((e) => e.itemToStringValue),
141
+ isItemEqualToValue: A((e) => e.isItemEqualToValue),
142
+ value: A((e) => e.value),
143
+ hasSelectedValue: A((e) => {
200
144
  const {
201
- __scopeSelect: e,
202
- position: c = "item-aligned",
203
- onCloseAutoFocus: l,
204
- onEscapeKeyDown: u,
205
- onPointerDownOutside: r,
206
- //
207
- // PopperContent props
208
- side: a,
209
- sideOffset: i,
210
- align: f,
211
- alignOffset: g,
212
- arrowPadding: x,
213
- collisionBoundary: N,
214
- collisionPadding: b,
215
- sticky: y,
216
- hideWhenDetached: d,
217
- avoidCollisions: h,
218
- //
219
- ...S
220
- } = t, m = Y(te, e), [v, W] = n.useState(null), [A, re] = n.useState(null), R = k(o, (p) => W(p)), [D, z] = n.useState(null), [X, B] = n.useState(
221
- null
222
- ), V = ue(e), [K, H] = n.useState(!1), U = n.useRef(!1);
223
- n.useEffect(() => {
224
- if (v) return ht(v);
225
- }, [v]), vt();
226
- const _ = n.useCallback(
227
- (p) => {
228
- const [I, ...E] = V().map((T) => T.ref.current), [w] = E.slice(-1), C = document.activeElement;
229
- for (const T of p)
230
- if (T === C || (T?.scrollIntoView({ block: "nearest" }), T === I && A && (A.scrollTop = 0), T === w && A && (A.scrollTop = A.scrollHeight), T?.focus(), document.activeElement !== C)) return;
231
- },
232
- [V, A]
233
- ), L = n.useCallback(
234
- () => _([D, v]),
235
- [_, D, v]
236
- );
237
- n.useEffect(() => {
238
- K && L();
239
- }, [K, L]);
240
- const { onOpenChange: F, triggerPointerDownPosRef: $ } = m;
241
- n.useEffect(() => {
242
- if (v) {
243
- let p = { x: 0, y: 0 };
244
- const I = (w) => {
245
- p = {
246
- x: Math.abs(Math.round(w.pageX) - ($.current?.x ?? 0)),
247
- y: Math.abs(Math.round(w.pageY) - ($.current?.y ?? 0))
248
- };
249
- }, E = (w) => {
250
- p.x <= 10 && p.y <= 10 ? w.preventDefault() : v.contains(w.target) || F(!1), document.removeEventListener("pointermove", I), $.current = null;
251
- };
252
- return $.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", E, { capture: !0, once: !0 })), () => {
253
- document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", E, { capture: !0 });
254
- };
255
- }
256
- }, [v, F, $]), n.useEffect(() => {
257
- const p = () => F(!1);
258
- return window.addEventListener("blur", p), window.addEventListener("resize", p), () => {
259
- window.removeEventListener("blur", p), window.removeEventListener("resize", p);
260
- };
261
- }, [F]);
262
- const [fe, le] = st((p) => {
263
- const I = V().filter((C) => !C.disabled), E = I.find((C) => C.ref.current === document.activeElement), w = at(I, p, E);
264
- w && setTimeout(() => w.ref.current.focus());
265
- }), me = n.useCallback(
266
- (p, I, E) => {
267
- const w = !U.current && !E;
268
- (m.value !== void 0 && m.value === I || w) && (z(p), w && (U.current = !0));
269
- },
270
- [m.value]
271
- ), he = n.useCallback(() => v?.focus(), [v]), oe = n.useCallback(
272
- (p, I, E) => {
273
- const w = !U.current && !E;
274
- (m.value !== void 0 && m.value === I || w) && B(p);
275
- },
276
- [m.value]
277
- ), ce = c === "popper" ? we : We, se = ce === we ? {
278
- side: a,
279
- sideOffset: i,
280
- align: f,
281
- alignOffset: g,
282
- arrowPadding: x,
283
- collisionBoundary: N,
284
- collisionPadding: b,
285
- sticky: y,
286
- hideWhenDetached: d,
287
- avoidCollisions: h
288
- } : {};
289
- return /* @__PURE__ */ s(
290
- Ue,
291
- {
292
- scope: e,
293
- content: v,
294
- viewport: A,
295
- onViewportChange: re,
296
- itemRefCallback: me,
297
- selectedItem: D,
298
- onItemLeave: he,
299
- itemTextRefCallback: oe,
300
- focusSelectedItem: L,
301
- selectedItemText: X,
302
- position: c,
303
- isPositioned: K,
304
- searchRef: fe,
305
- children: /* @__PURE__ */ s(gt, { as: Lt, allowPinchZoom: !0, children: /* @__PURE__ */ s(
306
- St,
307
- {
308
- asChild: !0,
309
- trapped: m.open,
310
- onMountAutoFocus: (p) => {
311
- p.preventDefault();
312
- },
313
- onUnmountAutoFocus: P(l, (p) => {
314
- m.trigger?.focus({ preventScroll: !0 }), p.preventDefault();
315
- }),
316
- children: /* @__PURE__ */ s(
317
- mt,
318
- {
319
- asChild: !0,
320
- disableOutsidePointerEvents: !0,
321
- onEscapeKeyDown: u,
322
- onPointerDownOutside: r,
323
- onFocusOutside: (p) => p.preventDefault(),
324
- onDismiss: () => m.onOpenChange(!1),
325
- children: /* @__PURE__ */ s(
326
- ce,
327
- {
328
- role: "listbox",
329
- id: m.contentId,
330
- "data-state": m.open ? "open" : "closed",
331
- dir: m.dir,
332
- onContextMenu: (p) => p.preventDefault(),
333
- ...S,
334
- ...se,
335
- onPlaced: () => H(!0),
336
- ref: R,
337
- style: {
338
- // flex layout so we can place the scroll buttons properly
339
- display: "flex",
340
- flexDirection: "column",
341
- // reset the outline by default as the content MAY get focused
342
- outline: "none",
343
- ...S.style
344
- },
345
- onKeyDown: P(S.onKeyDown, (p) => {
346
- const I = p.ctrlKey || p.altKey || p.metaKey;
347
- if (p.key === "Tab" && p.preventDefault(), !I && p.key.length === 1 && le(p.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(p.key)) {
348
- let w = V().filter((C) => !C.disabled).map((C) => C.ref.current);
349
- if (["ArrowUp", "End"].includes(p.key) && (w = w.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(p.key)) {
350
- const C = p.target, T = w.indexOf(C);
351
- w = w.slice(T + 1);
352
- }
353
- setTimeout(() => _(w)), p.preventDefault();
354
- }
355
- })
356
- }
357
- )
358
- }
359
- )
360
- }
361
- ) })
362
- }
363
- );
364
- }
365
- );
366
- Fe.displayName = Dt;
367
- var kt = "SelectItemAlignedPosition", We = n.forwardRef((t, o) => {
368
- const { __scopeSelect: e, onPlaced: c, ...l } = t, u = Y(te, e), r = q(te, e), [a, i] = n.useState(null), [f, g] = n.useState(null), x = k(o, (R) => g(R)), N = ue(e), b = n.useRef(!1), y = n.useRef(!0), { viewport: d, selectedItem: h, selectedItemText: S, focusSelectedItem: m } = r, v = n.useCallback(() => {
369
- if (u.trigger && u.valueNode && a && f && d && h && S) {
370
- const R = u.trigger.getBoundingClientRect(), D = f.getBoundingClientRect(), z = u.valueNode.getBoundingClientRect(), X = S.getBoundingClientRect();
371
- if (u.dir !== "rtl") {
372
- const C = X.left - D.left, T = z.left - C, Z = R.left - T, J = R.width + Z, ve = Math.max(J, D.width), ge = window.innerWidth - O, Se = Ne(T, [
373
- O,
374
- // Prevents the content from going off the starting edge of the
375
- // viewport. It may still go off the ending edge, but this can be
376
- // controlled by the user since they may want to manage overflow in a
377
- // specific way.
378
- // https://github.com/radix-ui/primitives/issues/2049
379
- Math.max(O, ge - ve)
380
- ]);
381
- a.style.minWidth = J + "px", a.style.left = Se + "px";
382
- } else {
383
- const C = D.right - X.right, T = window.innerWidth - z.right - C, Z = window.innerWidth - R.right - T, J = R.width + Z, ve = Math.max(J, D.width), ge = window.innerWidth - O, Se = Ne(T, [
384
- O,
385
- Math.max(O, ge - ve)
386
- ]);
387
- a.style.minWidth = J + "px", a.style.right = Se + "px";
388
- }
389
- const B = N(), V = window.innerHeight - O * 2, K = d.scrollHeight, H = window.getComputedStyle(f), U = parseInt(H.borderTopWidth, 10), _ = parseInt(H.paddingTop, 10), L = parseInt(H.borderBottomWidth, 10), F = parseInt(H.paddingBottom, 10), $ = U + _ + K + F + L, fe = Math.min(h.offsetHeight * 5, $), le = window.getComputedStyle(d), me = parseInt(le.paddingTop, 10), he = parseInt(le.paddingBottom, 10), oe = R.top + R.height / 2 - O, ce = V - oe, se = h.offsetHeight / 2, p = h.offsetTop + se, I = U + _ + p, E = $ - I;
390
- if (I <= oe) {
391
- const C = B.length > 0 && h === B[B.length - 1].ref.current;
392
- a.style.bottom = "0px";
393
- const T = f.clientHeight - d.offsetTop - d.offsetHeight, Z = Math.max(
394
- ce,
395
- se + // viewport might have padding bottom, include it to avoid a scrollable viewport
396
- (C ? he : 0) + T + L
397
- ), J = I + Z;
398
- a.style.height = J + "px";
399
- } else {
400
- const C = B.length > 0 && h === B[0].ref.current;
401
- a.style.top = "0px";
402
- const Z = Math.max(
403
- oe,
404
- U + d.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
405
- (C ? me : 0) + se
406
- ) + E;
407
- a.style.height = Z + "px", d.scrollTop = I - oe + d.offsetTop;
145
+ value: t,
146
+ multiple: o,
147
+ itemToStringValue: s
148
+ } = e;
149
+ return t == null ? !1 : o && Array.isArray(t) ? t.length > 0 : _e(t, s) !== "";
150
+ }),
151
+ hasNullItemLabel: A((e, t) => t ? so(e.items) : !1),
152
+ open: A((e) => e.open),
153
+ mounted: A((e) => e.mounted),
154
+ forceMount: A((e) => e.forceMount),
155
+ transitionStatus: A((e) => e.transitionStatus),
156
+ openMethod: A((e) => e.openMethod),
157
+ activeIndex: A((e) => e.activeIndex),
158
+ selectedIndex: A((e) => e.selectedIndex),
159
+ isActive: A((e, t) => e.activeIndex === t),
160
+ isSelected: A((e, t, o) => {
161
+ const s = e.isItemEqualToValue, x = e.value;
162
+ return e.multiple ? Array.isArray(x) && x.some((l) => ke(o, l, s)) : e.selectedIndex === t && e.selectedIndex !== null ? !0 : ke(o, x, s);
163
+ }),
164
+ isSelectedByFocus: A((e, t) => e.selectedIndex === t),
165
+ popupProps: A((e) => e.popupProps),
166
+ triggerProps: A((e) => e.triggerProps),
167
+ triggerElement: A((e) => e.triggerElement),
168
+ positionerElement: A((e) => e.positionerElement),
169
+ listElement: A((e) => e.listElement),
170
+ scrollUpArrowVisible: A((e) => e.scrollUpArrowVisible),
171
+ scrollDownArrowVisible: A((e) => e.scrollDownArrowVisible),
172
+ hasScrollArrows: A((e) => e.hasScrollArrows)
173
+ };
174
+ function ao(e) {
175
+ const {
176
+ id: t,
177
+ value: o,
178
+ defaultValue: s = null,
179
+ onValueChange: x,
180
+ open: l,
181
+ defaultOpen: c = !1,
182
+ onOpenChange: u,
183
+ name: d,
184
+ autoComplete: U,
185
+ disabled: N = !1,
186
+ readOnly: T = !1,
187
+ required: S = !1,
188
+ modal: B = !0,
189
+ actionsRef: te,
190
+ inputRef: v,
191
+ onOpenChangeComplete: $,
192
+ items: C,
193
+ multiple: y = !1,
194
+ itemToStringLabel: h,
195
+ itemToStringValue: b,
196
+ isItemEqualToValue: q = no,
197
+ highlightItemOnHover: ge = !0,
198
+ children: oe
199
+ } = e, {
200
+ clearErrors: k
201
+ } = mn(), {
202
+ setDirty: K,
203
+ setTouched: ie,
204
+ setFocused: z,
205
+ shouldValidateOnChange: Y,
206
+ validityData: j,
207
+ setFilled: m,
208
+ name: ce,
209
+ disabled: W,
210
+ validation: F,
211
+ validationMode: V
212
+ } = Dt(), r = Ot({
213
+ id: t
214
+ }), M = W || N, O = ce ?? d, [i, P] = Et({
215
+ controlled: o,
216
+ default: y ? s ?? Rt : s,
217
+ name: "Select",
218
+ state: "value"
219
+ }), [I, re] = Et({
220
+ controlled: l,
221
+ default: c,
222
+ name: "Select",
223
+ state: "open"
224
+ }), p = n.useRef([]), L = n.useRef([]), se = n.useRef(null), ue = n.useRef(null), Te = n.useRef(0), w = n.useRef(null), J = n.useRef([]), ae = n.useRef(!1), _ = n.useRef(!1), xe = n.useRef(null), ye = n.useRef({
225
+ allowSelectedMouseUp: !1,
226
+ allowUnselectedMouseUp: !1
227
+ }), H = n.useRef(!1), {
228
+ mounted: X,
229
+ setMounted: Z,
230
+ transitionStatus: G
231
+ } = mt(I), {
232
+ openMethod: ne,
233
+ triggerProps: Q
234
+ } = Cn(I), g = dn(() => new bn({
235
+ id: r,
236
+ labelId: void 0,
237
+ modal: B,
238
+ multiple: y,
239
+ itemToStringLabel: h,
240
+ itemToStringValue: b,
241
+ isItemEqualToValue: q,
242
+ value: i,
243
+ open: I,
244
+ mounted: X,
245
+ transitionStatus: G,
246
+ items: C,
247
+ forceMount: !1,
248
+ openMethod: null,
249
+ activeIndex: null,
250
+ selectedIndex: null,
251
+ popupProps: {},
252
+ triggerProps: {},
253
+ triggerElement: null,
254
+ positionerElement: null,
255
+ listElement: null,
256
+ scrollUpArrowVisible: !1,
257
+ scrollDownArrowVisible: !1,
258
+ hasScrollArrows: !1
259
+ })).current, Me = f(g, a.activeIndex), Ie = f(g, a.selectedIndex), we = f(g, a.triggerElement), De = f(g, a.positionerElement), He = n.useMemo(() => y && Array.isArray(i) && i.length === 0 ? "" : _e(i, b), [y, i, b]), ee = n.useMemo(() => y && Array.isArray(i) ? i.map((E) => _e(E, b)) : _e(i, b), [y, i, b]), de = pt(g.state.triggerElement);
260
+ gn({
261
+ id: r,
262
+ commit: F.commit,
263
+ value: i,
264
+ controlRef: de,
265
+ name: O,
266
+ getValue: () => ee
267
+ });
268
+ const le = n.useRef(i);
269
+ Se(() => {
270
+ i !== le.current && g.set("forceMount", !0);
271
+ }, [g, i]), Se(() => {
272
+ m(y ? Array.isArray(i) && i.length > 0 : i != null);
273
+ }, [y, i, m]), Se(function() {
274
+ if (I)
275
+ return;
276
+ const D = J.current;
277
+ if (y) {
278
+ const he = Array.isArray(i) ? i : [];
279
+ if (he.length === 0) {
280
+ g.set("selectedIndex", null);
281
+ return;
408
282
  }
409
- a.style.margin = `${O}px 0`, a.style.minHeight = fe + "px", a.style.maxHeight = V + "px", c?.(), requestAnimationFrame(() => b.current = !0);
283
+ const me = he[he.length - 1], Oe = je(D, me, q);
284
+ g.set("selectedIndex", Oe === -1 ? null : Oe);
285
+ return;
410
286
  }
411
- }, [
412
- N,
413
- u.trigger,
414
- u.valueNode,
415
- a,
416
- f,
417
- d,
418
- h,
419
- S,
420
- u.dir,
421
- c
422
- ]);
423
- j(() => v(), [v]);
424
- const [W, A] = n.useState();
425
- j(() => {
426
- f && A(window.getComputedStyle(f).zIndex);
427
- }, [f]);
428
- const re = n.useCallback(
429
- (R) => {
430
- R && y.current === !0 && (v(), m?.(), y.current = !1);
287
+ const pe = je(D, i, q);
288
+ g.set("selectedIndex", pe === -1 ? null : pe);
289
+ }, [y, I, i, J, q, g]), An(i, () => {
290
+ k(O), K(i !== j.initialValue), Y() ? F.commit(i) : F.commit(i, !0);
291
+ });
292
+ const fe = Ce((E, D) => {
293
+ if (u?.(E, D), !D.isCanceled && (re(E), !E && (D.reason === En || D.reason === Tn) && (ie(!0), z(!1), V === "onBlur" && F.commit(i)), !E && g.state.activeIndex !== null)) {
294
+ const pe = p.current[g.state.activeIndex];
295
+ queueMicrotask(() => {
296
+ pe?.setAttribute("tabindex", "-1");
297
+ });
298
+ }
299
+ }), We = Ce(() => {
300
+ Z(!1), g.set("activeIndex", null), $?.(!1);
301
+ });
302
+ ot({
303
+ enabled: !te,
304
+ open: I,
305
+ ref: se,
306
+ onComplete() {
307
+ I || We();
308
+ }
309
+ }), n.useImperativeHandle(te, () => ({
310
+ unmount: We
311
+ }), [We]);
312
+ const Ue = Ce((E, D) => {
313
+ x?.(E, D), !D.isCanceled && P(E);
314
+ }), qe = Ce(() => {
315
+ const E = g.state.listElement || se.current;
316
+ if (!E)
317
+ return;
318
+ const D = E.scrollTop, pe = E.scrollTop + E.clientHeight, he = D > 1, me = pe < E.scrollHeight - 1;
319
+ g.state.scrollUpArrowVisible !== he && g.set("scrollUpArrowVisible", he), g.state.scrollDownArrowVisible !== me && g.set("scrollDownArrowVisible", me);
320
+ }), Re = Ln({
321
+ open: I,
322
+ onOpenChange: fe,
323
+ elements: {
324
+ reference: we,
325
+ floating: De
326
+ }
327
+ }), Ne = Vn(Re, {
328
+ enabled: !T && !M,
329
+ event: "mousedown"
330
+ }), Ke = xn(Re, {
331
+ bubbles: !1
332
+ }), Je = Bn(Re, {
333
+ enabled: !T && !M,
334
+ listRef: p,
335
+ activeIndex: Me,
336
+ selectedIndex: Ie,
337
+ disabledIndices: Rt,
338
+ onNavigate(E) {
339
+ E === null && !I || g.set("activeIndex", E);
431
340
  },
432
- [v, m]
433
- );
434
- return /* @__PURE__ */ s(
435
- Vt,
436
- {
437
- scope: e,
438
- contentWrapper: a,
439
- shouldExpandOnScrollRef: b,
440
- onScrollButtonChange: re,
441
- children: /* @__PURE__ */ s(
442
- "div",
443
- {
444
- ref: i,
445
- style: {
446
- display: "flex",
447
- flexDirection: "column",
448
- position: "fixed",
449
- zIndex: W
341
+ // Implement our own listeners since `onPointerLeave` on each option fires while scrolling with
342
+ // the `alignItemWithTrigger=true`, causing a performance issue on Chrome.
343
+ focusItemOnHover: !1
344
+ }), Ye = Fn(Re, {
345
+ enabled: !T && !M && (I || !y),
346
+ listRef: L,
347
+ activeIndex: Me,
348
+ selectedIndex: Ie,
349
+ onMatch(E) {
350
+ I ? g.set("activeIndex", E) : Ue(J.current[E], Ve("none"));
351
+ },
352
+ onTypingChange(E) {
353
+ ae.current = E;
354
+ }
355
+ }), {
356
+ getReferenceProps: ve,
357
+ getFloatingProps: Ge,
358
+ getItemProps: Be
359
+ } = vn([Ne, Ke, Je, Ye]), Fe = n.useMemo(() => Vt(ve(), Q, r ? {
360
+ id: r
361
+ } : fn), [ve, Q, r]);
362
+ pn(() => {
363
+ g.update({
364
+ popupProps: Ge(),
365
+ triggerProps: Fe
366
+ });
367
+ }), Se(() => {
368
+ g.update({
369
+ id: r,
370
+ modal: B,
371
+ multiple: y,
372
+ value: i,
373
+ open: I,
374
+ mounted: X,
375
+ transitionStatus: G,
376
+ popupProps: Ge(),
377
+ triggerProps: Fe,
378
+ items: C,
379
+ itemToStringLabel: h,
380
+ itemToStringValue: b,
381
+ isItemEqualToValue: q,
382
+ openMethod: ne
383
+ });
384
+ }, [g, r, B, y, i, I, X, G, Ge, Fe, C, h, b, q, ne]);
385
+ const rt = n.useMemo(() => ({
386
+ store: g,
387
+ name: O,
388
+ required: S,
389
+ disabled: M,
390
+ readOnly: T,
391
+ multiple: y,
392
+ itemToStringLabel: h,
393
+ itemToStringValue: b,
394
+ highlightItemOnHover: ge,
395
+ setValue: Ue,
396
+ setOpen: fe,
397
+ listRef: p,
398
+ popupRef: se,
399
+ scrollHandlerRef: ue,
400
+ handleScrollArrowVisibility: qe,
401
+ scrollArrowsMountedCountRef: Te,
402
+ getItemProps: Be,
403
+ events: Re.context.events,
404
+ valueRef: w,
405
+ valuesRef: J,
406
+ labelsRef: L,
407
+ typingRef: ae,
408
+ selectionRef: ye,
409
+ selectedItemTextRef: xe,
410
+ validation: F,
411
+ onOpenChangeComplete: $,
412
+ keyboardActiveRef: _,
413
+ alignItemWithTriggerActiveRef: H,
414
+ initialValueRef: le
415
+ }), [g, O, S, M, T, y, h, b, ge, Ue, fe, Be, Re.context.events, F, $, qe]), st = Pt(v, F.inputRef), Ze = y && Array.isArray(i) && i.length > 0, $e = y ? void 0 : O, lt = n.useMemo(() => !y || !Array.isArray(i) || !O ? null : i.map((E) => {
416
+ const D = _e(E, b);
417
+ return /* @__PURE__ */ R("input", {
418
+ type: "hidden",
419
+ name: O,
420
+ value: D
421
+ }, D);
422
+ }), [y, i, O, b]);
423
+ return /* @__PURE__ */ R(ht.Provider, {
424
+ value: rt,
425
+ children: /* @__PURE__ */ ze(St.Provider, {
426
+ value: Re,
427
+ children: [oe, /* @__PURE__ */ R("input", {
428
+ ...F.getInputValidationProps({
429
+ onFocus() {
430
+ g.state.triggerElement?.focus({
431
+ // Supported in Chrome from 144 (January 2026)
432
+ // @ts-expect-error - focusVisible is not yet in the lib.dom.d.ts
433
+ focusVisible: !0
434
+ });
450
435
  },
451
- children: /* @__PURE__ */ s(
452
- M.div,
453
- {
454
- ...l,
455
- ref: x,
456
- style: {
457
- // When we get the height of the content, it includes borders. If we were to set
458
- // the height without having `boxSizing: 'border-box'` it would be too big.
459
- boxSizing: "border-box",
460
- // We need to ensure the content doesn't get taller than the wrapper
461
- maxHeight: "100%",
462
- ...l.style
463
- }
436
+ // Handle browser autofill.
437
+ onChange(E) {
438
+ if (E.nativeEvent.defaultPrevented)
439
+ return;
440
+ const D = E.target.value, pe = Ve(gt, E.nativeEvent);
441
+ function he() {
442
+ if (y)
443
+ return;
444
+ const me = J.current.find((Oe) => _e(Oe, b).toLowerCase() === D.toLowerCase());
445
+ me != null && (K(me !== j.initialValue), Ue(me, pe), Y() && F.commit(me));
464
446
  }
465
- )
466
- }
467
- )
447
+ g.set("forceMount", !0), queueMicrotask(he);
448
+ }
449
+ }),
450
+ id: r && $e == null ? `${r}-hidden-input` : void 0,
451
+ name: $e,
452
+ autoComplete: U,
453
+ value: He,
454
+ disabled: M,
455
+ required: S && !Ze,
456
+ readOnly: T,
457
+ ref: st,
458
+ style: O ? cn : un,
459
+ tabIndex: -1,
460
+ "aria-hidden": !0
461
+ }), lt]
462
+ })
463
+ });
464
+ }
465
+ const Qe = 2, co = 400, Mt = 200, uo = {
466
+ ...yn,
467
+ ...Sn,
468
+ value: () => null
469
+ }, zt = /* @__PURE__ */ n.forwardRef(function(t, o) {
470
+ const {
471
+ render: s,
472
+ className: x,
473
+ id: l,
474
+ disabled: c = !1,
475
+ nativeButton: u = !0,
476
+ ...d
477
+ } = t, {
478
+ setTouched: U,
479
+ setFocused: N,
480
+ validationMode: T,
481
+ state: S,
482
+ disabled: B
483
+ } = Dt(), {
484
+ labelId: te
485
+ } = hn(), {
486
+ store: v,
487
+ setOpen: $,
488
+ selectionRef: C,
489
+ validation: y,
490
+ readOnly: h,
491
+ required: b,
492
+ alignItemWithTriggerActiveRef: q,
493
+ disabled: ge,
494
+ keyboardActiveRef: oe
495
+ } = Ee(), k = B || ge || c, K = f(v, a.open), ie = f(v, a.value), z = f(v, a.triggerProps), Y = f(v, a.positionerElement), j = f(v, a.listElement), m = f(v, a.id), ce = f(v, a.labelId), W = f(v, a.hasSelectedValue), F = !W && K, V = f(v, a.hasNullItemLabel, F), r = l ?? m, M = eo(te, ce);
496
+ Ot({
497
+ id: r
498
+ });
499
+ const O = pt(Y), i = n.useRef(null), {
500
+ getButtonProps: P,
501
+ buttonRef: I
502
+ } = Bt({
503
+ disabled: k,
504
+ native: u
505
+ }), re = Ce((_) => {
506
+ v.set("triggerElement", _);
507
+ }), p = Pt(o, i, I, re), L = Le(), se = Le(), ue = Le(), Te = Le();
508
+ n.useEffect(() => {
509
+ if (K)
510
+ return !(W || V) ? ue.start(co, () => {
511
+ C.current.allowUnselectedMouseUp = !0, C.current.allowSelectedMouseUp = !0;
512
+ }) : Te.start(Mt, () => {
513
+ C.current.allowUnselectedMouseUp = !0, ue.start(Mt, () => {
514
+ C.current.allowSelectedMouseUp = !0;
515
+ });
516
+ }), () => {
517
+ ue.clear(), Te.clear();
518
+ };
519
+ C.current = {
520
+ allowSelectedMouseUp: !1,
521
+ allowUnselectedMouseUp: !1
522
+ }, se.clear();
523
+ }, [K, W, V, C, se, ue, Te]);
524
+ const w = n.useMemo(() => j?.id ?? to(Y)?.id, [j, Y]), J = Vt(z, {
525
+ id: r,
526
+ role: "combobox",
527
+ "aria-expanded": K ? "true" : "false",
528
+ "aria-haspopup": "listbox",
529
+ "aria-controls": K ? w : void 0,
530
+ "aria-labelledby": M,
531
+ "aria-readonly": h || void 0,
532
+ "aria-required": b || void 0,
533
+ tabIndex: k ? -1 : 0,
534
+ ref: p,
535
+ onFocus(_) {
536
+ N(!0), K && q.current && $(!1, Ve(gt, _.nativeEvent)), L.start(0, () => {
537
+ v.set("forceMount", !0);
538
+ });
539
+ },
540
+ onBlur(_) {
541
+ ct(Y, _.relatedTarget) || (U(!0), N(!1), T === "onBlur" && y.commit(ie));
542
+ },
543
+ onPointerMove() {
544
+ oe.current = !1;
545
+ },
546
+ onKeyDown() {
547
+ oe.current = !0;
548
+ },
549
+ onMouseDown(_) {
550
+ if (K)
551
+ return;
552
+ const xe = dt(_.currentTarget);
553
+ function ye(H) {
554
+ if (!i.current)
555
+ return;
556
+ const X = H.target;
557
+ if (ct(i.current, X) || ct(O.current, X) || X === i.current)
558
+ return;
559
+ const Z = _n(i.current);
560
+ H.clientX >= Z.left - Qe && H.clientX <= Z.right + Qe && H.clientY >= Z.top - Qe && H.clientY <= Z.bottom + Qe || $(!1, Ve(Mn, H));
561
+ }
562
+ se.start(0, () => {
563
+ xe.addEventListener("mouseup", ye, {
564
+ once: !0
565
+ });
566
+ });
468
567
  }
469
- );
568
+ }, y.getValidationProps, d, P);
569
+ J.role = "combobox";
570
+ const ae = {
571
+ ...S,
572
+ open: K,
573
+ disabled: k,
574
+ value: ie,
575
+ readOnly: h,
576
+ placeholder: !W
577
+ };
578
+ return be("button", t, {
579
+ ref: [o, i],
580
+ state: ae,
581
+ stateAttributesMapping: uo,
582
+ props: J
583
+ });
470
584
  });
471
- We.displayName = kt;
472
- var Bt = "SelectPopperPosition", we = n.forwardRef((t, o) => {
585
+ process.env.NODE_ENV !== "production" && (zt.displayName = "SelectTrigger");
586
+ const fo = {
587
+ value: () => null
588
+ }, Wt = /* @__PURE__ */ n.forwardRef(function(t, o) {
473
589
  const {
474
- __scopeSelect: e,
475
- align: c = "start",
476
- collisionPadding: l = O,
590
+ className: s,
591
+ render: x,
592
+ children: l,
593
+ placeholder: c,
477
594
  ...u
478
- } = t, r = pe(e);
479
- return /* @__PURE__ */ s(
480
- Ct,
481
- {
482
- ...r,
483
- ...u,
595
+ } = t, {
596
+ store: d,
597
+ valueRef: U
598
+ } = Ee(), N = f(d, a.value), T = f(d, a.items), S = f(d, a.itemToStringLabel), B = f(d, a.hasSelectedValue), te = !B && c != null && l == null, v = f(d, a.hasNullItemLabel, te), $ = {
599
+ value: N,
600
+ placeholder: !B
601
+ };
602
+ let C = null;
603
+ return typeof l == "function" ? C = l(N) : l != null ? C = l : !B && c != null && !v ? C = c : Array.isArray(N) ? C = io(N, T, S) : C = kt(N, T, S), be("span", t, {
604
+ state: $,
605
+ ref: [o, U],
606
+ props: [{
607
+ children: C
608
+ }, u],
609
+ stateAttributesMapping: fo
610
+ });
611
+ });
612
+ process.env.NODE_ENV !== "production" && (Wt.displayName = "SelectValue");
613
+ const qt = /* @__PURE__ */ n.forwardRef(function(t, o) {
614
+ const {
615
+ className: s,
616
+ render: x,
617
+ ...l
618
+ } = t, {
619
+ store: c
620
+ } = Ee(), d = {
621
+ open: f(c, a.open)
622
+ };
623
+ return be("span", t, {
624
+ state: d,
625
+ ref: o,
626
+ props: [{
627
+ "aria-hidden": !0,
628
+ children: "▼"
629
+ }, l],
630
+ stateAttributesMapping: In
631
+ });
632
+ });
633
+ process.env.NODE_ENV !== "production" && (qt.displayName = "SelectIcon");
634
+ const Yt = /* @__PURE__ */ n.createContext(void 0);
635
+ process.env.NODE_ENV !== "production" && (Yt.displayName = "SelectPortalContext");
636
+ const Gt = /* @__PURE__ */ n.forwardRef(function(t, o) {
637
+ const {
638
+ store: s
639
+ } = Ee(), x = f(s, a.mounted), l = f(s, a.forceMount);
640
+ return x || l ? /* @__PURE__ */ R(Yt.Provider, {
641
+ value: !0,
642
+ children: /* @__PURE__ */ R(wn, {
484
643
  ref: o,
485
- align: c,
486
- collisionPadding: l,
644
+ ...t
645
+ })
646
+ }) : null;
647
+ });
648
+ process.env.NODE_ENV !== "production" && (Gt.displayName = "SelectPortal");
649
+ const bt = /* @__PURE__ */ n.createContext(void 0);
650
+ process.env.NODE_ENV !== "production" && (bt.displayName = "SelectPositionerContext");
651
+ function xt() {
652
+ const e = n.useContext(bt);
653
+ if (!e)
654
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>." : Xe(59));
655
+ return e;
656
+ }
657
+ function nt(e, t) {
658
+ e && Object.assign(e.style, t);
659
+ }
660
+ const $t = {
661
+ position: "relative",
662
+ maxHeight: "100%",
663
+ overflowX: "hidden",
664
+ overflowY: "auto"
665
+ }, po = {
666
+ position: "fixed"
667
+ }, jt = /* @__PURE__ */ n.forwardRef(function(t, o) {
668
+ const {
669
+ anchor: s,
670
+ positionMethod: x = "absolute",
671
+ className: l,
672
+ render: c,
673
+ side: u = "bottom",
674
+ align: d = "center",
675
+ sideOffset: U = 0,
676
+ alignOffset: N = 0,
677
+ collisionBoundary: T = "clipping-ancestors",
678
+ collisionPadding: S,
679
+ arrowPadding: B = 5,
680
+ sticky: te = !1,
681
+ disableAnchorTracking: v,
682
+ alignItemWithTrigger: $ = !0,
683
+ collisionAvoidance: C = Rn,
684
+ ...y
685
+ } = t, {
686
+ store: h,
687
+ listRef: b,
688
+ labelsRef: q,
689
+ alignItemWithTriggerActiveRef: ge,
690
+ selectedItemTextRef: oe,
691
+ valuesRef: k,
692
+ initialValueRef: K,
693
+ popupRef: ie,
694
+ setValue: z
695
+ } = Ee(), Y = Ft(), j = f(h, a.open), m = f(h, a.mounted), ce = f(h, a.modal), W = f(h, a.value), F = f(h, a.openMethod), V = f(h, a.positionerElement), r = f(h, a.triggerElement), M = f(h, a.isItemEqualToValue), O = f(h, a.transitionStatus), i = n.useRef(null), P = n.useRef(null), [I, re] = n.useState($), p = m && I && F !== "touch";
696
+ !m && I !== $ && re($), Se(() => {
697
+ m || (a.scrollUpArrowVisible(h.state) && h.set("scrollUpArrowVisible", !1), a.scrollDownArrowVisible(h.state) && h.set("scrollDownArrowVisible", !1));
698
+ }, [h, m]), n.useImperativeHandle(ge, () => p), Pn((p || ce) && j && F !== "touch", r);
699
+ const L = Hn({
700
+ anchor: s,
701
+ floatingRootContext: Y,
702
+ positionMethod: x,
703
+ mounted: m,
704
+ side: u,
705
+ sideOffset: U,
706
+ align: d,
707
+ alignOffset: N,
708
+ arrowPadding: B,
709
+ collisionBoundary: T,
710
+ collisionPadding: S,
711
+ sticky: te,
712
+ disableAnchorTracking: v ?? p,
713
+ collisionAvoidance: C,
714
+ keepMounted: !0
715
+ }), se = p ? "none" : L.side, ue = p ? po : L.positionerStyles, Te = n.useMemo(() => {
716
+ const H = {};
717
+ return j || (H.pointerEvents = "none"), {
718
+ role: "presentation",
719
+ hidden: !m,
487
720
  style: {
488
- // Ensure border-box for floating-ui calculations
489
- boxSizing: "border-box",
490
- ...u.style,
491
- "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
492
- "--radix-select-content-available-width": "var(--radix-popper-available-width)",
493
- "--radix-select-content-available-height": "var(--radix-popper-available-height)",
494
- "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
495
- "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
721
+ ...ue,
722
+ ...H
496
723
  }
724
+ };
725
+ }, [j, m, ue]), w = {
726
+ open: j,
727
+ side: se,
728
+ align: L.align,
729
+ anchorHidden: L.anchorHidden
730
+ }, J = Ce((H) => {
731
+ h.set("positionerElement", H);
732
+ }), ae = be("div", t, {
733
+ ref: [o, J],
734
+ state: w,
735
+ stateAttributesMapping: Ht,
736
+ props: [Te, Ut(O), y]
737
+ }), _ = n.useRef(0), xe = Ce((H) => {
738
+ if (H.size === 0 && _.current === 0 || k.current.length === 0)
739
+ return;
740
+ const X = _.current;
741
+ if (_.current = H.size, H.size === X)
742
+ return;
743
+ const Z = Ve(gt);
744
+ if (X !== 0 && !h.state.multiple && W !== null && je(k.current, W, M) === -1) {
745
+ const ne = K.current, g = ne != null && je(k.current, ne, M) !== -1 ? ne : null;
746
+ z(g, Z), g === null && (h.set("selectedIndex", null), oe.current = null);
497
747
  }
498
- );
748
+ if (X !== 0 && h.state.multiple && Array.isArray(W)) {
749
+ const G = (Q) => je(k.current, Q, M) !== -1, ne = W.filter((Q) => G(Q));
750
+ (ne.length !== W.length || ne.some((Q) => !oo(W, Q, M))) && (z(ne, Z), ne.length === 0 && (h.set("selectedIndex", null), oe.current = null));
751
+ }
752
+ if (j && p) {
753
+ h.update({
754
+ scrollUpArrowVisible: !1,
755
+ scrollDownArrowVisible: !1
756
+ });
757
+ const G = {
758
+ height: ""
759
+ };
760
+ nt(V, G), nt(ie.current, G);
761
+ }
762
+ }), ye = n.useMemo(() => ({
763
+ ...L,
764
+ side: se,
765
+ alignItemWithTriggerActive: p,
766
+ setControlledAlignItemWithTrigger: re,
767
+ scrollUpArrowRef: i,
768
+ scrollDownArrowRef: P
769
+ }), [L, se, p, re]);
770
+ return /* @__PURE__ */ R(zn, {
771
+ elementsRef: b,
772
+ labelsRef: q,
773
+ onMapChange: xe,
774
+ children: /* @__PURE__ */ ze(bt.Provider, {
775
+ value: ye,
776
+ children: [m && ce && /* @__PURE__ */ R(Dn, {
777
+ inert: kn(!j),
778
+ cutout: r
779
+ }), ae]
780
+ })
781
+ });
499
782
  });
500
- we.displayName = Bt;
501
- var [Vt, Pe] = ne(te, {}), xe = "SelectViewport", ze = n.forwardRef(
502
- (t, o) => {
503
- const { __scopeSelect: e, nonce: c, ...l } = t, u = q(xe, e), r = Pe(xe, e), a = k(o, u.onViewportChange), i = n.useRef(0);
504
- return /* @__PURE__ */ Q(be, { children: [
505
- /* @__PURE__ */ s(
506
- "style",
507
- {
508
- dangerouslySetInnerHTML: {
509
- __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
510
- },
511
- nonce: c
512
- }
513
- ),
514
- /* @__PURE__ */ s(de.Slot, { scope: e, children: /* @__PURE__ */ s(
515
- M.div,
516
- {
517
- "data-radix-select-viewport": "",
518
- role: "presentation",
519
- ...l,
520
- ref: a,
521
- style: {
522
- // we use position: 'relative' here on the `viewport` so that when we call
523
- // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
524
- // (independent of the scrollUpButton).
525
- position: "relative",
526
- flex: 1,
527
- // Viewport should only be scrollable in the vertical direction.
528
- // This won't work in vertical writing modes, so we'll need to
529
- // revisit this if/when that is supported
530
- // https://developer.chrome.com/blog/vertical-form-controls
531
- overflow: "hidden auto",
532
- ...l.style
533
- },
534
- onScroll: P(l.onScroll, (f) => {
535
- const g = f.currentTarget, { contentWrapper: x, shouldExpandOnScrollRef: N } = r;
536
- if (N?.current && x) {
537
- const b = Math.abs(i.current - g.scrollTop);
538
- if (b > 0) {
539
- const y = window.innerHeight - O * 2, d = parseFloat(x.style.minHeight), h = parseFloat(x.style.height), S = Math.max(d, h);
540
- if (S < y) {
541
- const m = S + b, v = Math.min(y, m), W = m - v;
542
- x.style.height = v + "px", x.style.bottom === "0px" && (g.scrollTop = W > 0 ? W : 0, x.style.justifyContent = "flex-end");
543
- }
544
- }
545
- }
546
- i.current = g.scrollTop;
547
- })
548
- }
549
- ) })
550
- ] });
551
- }
552
- );
553
- ze.displayName = xe;
554
- var Ke = "SelectGroup", [Ht, Ut] = ne(Ke), $e = n.forwardRef(
555
- (t, o) => {
556
- const { __scopeSelect: e, ...c } = t, l = Te();
557
- return /* @__PURE__ */ s(Ht, { scope: e, id: l, children: /* @__PURE__ */ s(M.div, { role: "group", "aria-labelledby": l, ...c, ref: o }) });
558
- }
559
- );
560
- $e.displayName = Ke;
561
- var Ge = "SelectLabel", je = n.forwardRef(
562
- (t, o) => {
563
- const { __scopeSelect: e, ...c } = t, l = Ut(Ge, e);
564
- return /* @__PURE__ */ s(M.div, { id: l.id, ...c, ref: o });
565
- }
566
- );
567
- je.displayName = Ge;
568
- var ie = "SelectItem", [Ft, Ye] = ne(ie), qe = n.forwardRef(
569
- (t, o) => {
570
- const {
571
- __scopeSelect: e,
572
- value: c,
573
- disabled: l = !1,
574
- textValue: u,
575
- ...r
576
- } = t, a = Y(ie, e), i = q(ie, e), f = a.value === c, [g, x] = n.useState(u ?? ""), [N, b] = n.useState(!1), y = k(
577
- o,
578
- (m) => i.itemRefCallback?.(m, c, l)
579
- ), d = Te(), h = n.useRef("touch"), S = () => {
580
- l || (a.onValueChange(c), a.onOpenChange(!1));
783
+ process.env.NODE_ENV !== "production" && (jt.displayName = "SelectPositioner");
784
+ function Xt(e) {
785
+ const t = e.currentTarget.getBoundingClientRect();
786
+ return t.top + 1 <= e.clientY && e.clientY <= t.bottom - 1 && t.left + 1 <= e.clientX && e.clientX <= t.right - 1;
787
+ }
788
+ const Ae = 1, mo = {
789
+ ...Ht,
790
+ ...Lt
791
+ }, Kt = /* @__PURE__ */ n.forwardRef(function(t, o) {
792
+ const {
793
+ render: s,
794
+ className: x,
795
+ finalFocus: l,
796
+ ...c
797
+ } = t, {
798
+ store: u,
799
+ popupRef: d,
800
+ onOpenChangeComplete: U,
801
+ setOpen: N,
802
+ valueRef: T,
803
+ selectedItemTextRef: S,
804
+ keyboardActiveRef: B,
805
+ multiple: te,
806
+ handleScrollArrowVisibility: v,
807
+ scrollHandlerRef: $,
808
+ highlightItemOnHover: C
809
+ } = Ee(), {
810
+ side: y,
811
+ align: h,
812
+ alignItemWithTriggerActive: b,
813
+ setControlledAlignItemWithTrigger: q,
814
+ scrollDownArrowRef: ge,
815
+ scrollUpArrowRef: oe
816
+ } = xt(), k = $n() != null, K = Ft(), {
817
+ nonce: ie,
818
+ disableStyleElements: z
819
+ } = Xn(), Y = Le(), j = f(u, a.id), m = f(u, a.open), ce = f(u, a.mounted), W = f(u, a.popupProps), F = f(u, a.transitionStatus), V = f(u, a.triggerElement), r = f(u, a.positionerElement), M = f(u, a.listElement), O = n.useRef(0), i = n.useRef(!1), P = n.useRef(0), I = n.useRef(!1), re = n.useRef({}), p = Gn(), L = Ce((w) => {
820
+ if (!r || !d.current || !I.current)
821
+ return;
822
+ if (i.current || !b) {
823
+ v();
824
+ return;
825
+ }
826
+ const J = r.style.top === "0px", ae = r.style.bottom === "0px", _ = r.getBoundingClientRect().height, xe = dt(r), ye = getComputedStyle(r), H = parseFloat(ye.marginTop), X = parseFloat(ye.marginBottom), Z = Nt(getComputedStyle(d.current)), G = Math.min(xe.documentElement.clientHeight - H - X, Z), ne = w.scrollTop, Q = et(w);
827
+ let g = 0, Me = null, Ie = !1, we = !1;
828
+ const De = (ee) => {
829
+ r.style.height = `${ee}px`;
830
+ }, He = (ee, de) => {
831
+ const le = at(ee, 0, G - _);
832
+ le > 0 && De(_ + le), w.scrollTop = de, G - (_ + le) <= Ae && (i.current = !0), v();
581
833
  };
582
- if (c === "")
583
- throw new Error(
584
- "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
585
- );
586
- return /* @__PURE__ */ s(
587
- Ft,
588
- {
589
- scope: e,
590
- value: c,
591
- disabled: l,
592
- textId: d,
593
- isSelected: f,
594
- onItemTextChange: n.useCallback((m) => {
595
- x((v) => v || (m?.textContent ?? "").trim());
596
- }, []),
597
- children: /* @__PURE__ */ s(
598
- de.ItemSlot,
599
- {
600
- scope: e,
601
- value: c,
602
- disabled: l,
603
- textValue: g,
604
- children: /* @__PURE__ */ s(
605
- M.div,
606
- {
607
- role: "option",
608
- "aria-labelledby": d,
609
- "data-highlighted": N ? "" : void 0,
610
- "aria-selected": f && N,
611
- "data-state": f ? "checked" : "unchecked",
612
- "aria-disabled": l || void 0,
613
- "data-disabled": l ? "" : void 0,
614
- tabIndex: l ? void 0 : -1,
615
- ...r,
616
- ref: y,
617
- onFocus: P(r.onFocus, () => b(!0)),
618
- onBlur: P(r.onBlur, () => b(!1)),
619
- onClick: P(r.onClick, () => {
620
- h.current !== "mouse" && S();
621
- }),
622
- onPointerUp: P(r.onPointerUp, () => {
623
- h.current === "mouse" && S();
624
- }),
625
- onPointerDown: P(r.onPointerDown, (m) => {
626
- h.current = m.pointerType;
627
- }),
628
- onPointerMove: P(r.onPointerMove, (m) => {
629
- h.current = m.pointerType, l ? i.onItemLeave?.() : h.current === "mouse" && m.currentTarget.focus({ preventScroll: !0 });
630
- }),
631
- onPointerLeave: P(r.onPointerLeave, (m) => {
632
- m.currentTarget === document.activeElement && i.onItemLeave?.();
633
- }),
634
- onKeyDown: P(r.onKeyDown, (m) => {
635
- i.searchRef?.current !== "" && m.key === " " || (Nt.includes(m.key) && S(), m.key === " " && m.preventDefault());
636
- })
637
- }
638
- )
639
- }
640
- )
834
+ if (J) {
835
+ const ee = Q - ne, de = _ + ee, le = Math.min(de, G);
836
+ if (g = le, ee <= Ae) {
837
+ He(ee, Q);
838
+ return;
641
839
  }
642
- );
643
- }
644
- );
645
- qe.displayName = ie;
646
- var ae = "SelectItemText", Xe = n.forwardRef(
647
- (t, o) => {
648
- const { __scopeSelect: e, className: c, style: l, ...u } = t, r = Y(ae, e), a = q(ae, e), i = Ye(ae, e), f = Mt(ae, e), [g, x] = n.useState(null), N = k(
649
- o,
650
- (S) => x(S),
651
- i.onItemTextChange,
652
- (S) => a.itemTextRefCallback?.(S, i.value, i.disabled)
653
- ), b = g?.textContent, y = n.useMemo(
654
- () => /* @__PURE__ */ s("option", { value: i.value, disabled: i.disabled, children: b }, i.value),
655
- [i.disabled, i.value, b]
656
- ), { onNativeOptionAdd: d, onNativeOptionRemove: h } = f;
657
- return j(() => (d(y), () => h(y)), [d, h, y]), /* @__PURE__ */ Q(be, { children: [
658
- /* @__PURE__ */ s(M.span, { id: i.textId, ...u, ref: N }),
659
- i.isSelected && r.valueNode && !r.valueNodeHasChildren ? Ee.createPortal(u.children, r.valueNode) : null
660
- ] });
661
- }
662
- );
663
- Xe.displayName = ae;
664
- var Ze = "SelectItemIndicator", Je = n.forwardRef(
665
- (t, o) => {
666
- const { __scopeSelect: e, ...c } = t;
667
- return Ye(Ze, e).isSelected ? /* @__PURE__ */ s(M.span, { "aria-hidden": !0, ...c, ref: o }) : null;
668
- }
669
- );
670
- Je.displayName = Ze;
671
- var Ce = "SelectScrollUpButton", Qe = n.forwardRef((t, o) => {
672
- const e = q(Ce, t.__scopeSelect), c = Pe(Ce, t.__scopeSelect), [l, u] = n.useState(!1), r = k(o, c.onScrollButtonChange);
673
- return j(() => {
674
- if (e.viewport && e.isPositioned) {
675
- let a = function() {
676
- const f = i.scrollTop > 0;
677
- u(f);
678
- };
679
- const i = e.viewport;
680
- return a(), i.addEventListener("scroll", a), () => i.removeEventListener("scroll", a);
840
+ G - le > Ae ? we = !0 : Ie = !0;
841
+ } else if (ae) {
842
+ const ee = ne, de = _ + ee, le = Math.min(de, G), fe = de - G;
843
+ if (g = le, ee <= Ae) {
844
+ He(ee, 0);
845
+ return;
846
+ }
847
+ G - le > Ae ? Me = 0 : (Ie = !0, ne < Q && (Me = ne - (ee - fe)));
681
848
  }
682
- }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ s(
683
- tt,
684
- {
685
- ...t,
686
- ref: r,
687
- onAutoScroll: () => {
688
- const { viewport: a, selectedItem: i } = e;
689
- a && i && (a.scrollTop = a.scrollTop - i.offsetHeight);
849
+ if (g = Math.ceil(g), g !== 0 && De(g), we || Me != null) {
850
+ const ee = et(w), de = we ? ee : at(Me, 0, ee);
851
+ Math.abs(w.scrollTop - de) > Ae && (w.scrollTop = de);
852
+ }
853
+ (Ie || g >= G - Ae) && (i.current = !0), v();
854
+ });
855
+ n.useImperativeHandle($, () => L, [L]), ot({
856
+ open: m,
857
+ ref: d,
858
+ onComplete() {
859
+ m && U?.(!0);
860
+ }
861
+ });
862
+ const se = {
863
+ open: m,
864
+ transitionStatus: F,
865
+ side: y,
866
+ align: h
867
+ };
868
+ Se(() => {
869
+ !r || !d.current || Object.keys(re.current).length || (re.current = {
870
+ top: r.style.top || "0",
871
+ left: r.style.left || "0",
872
+ right: r.style.right,
873
+ height: r.style.height,
874
+ bottom: r.style.bottom,
875
+ minHeight: r.style.minHeight,
876
+ maxHeight: r.style.maxHeight,
877
+ marginTop: r.style.marginTop,
878
+ marginBottom: r.style.marginBottom
879
+ });
880
+ }, [d, r]), Se(() => {
881
+ m || b || (I.current = !1, i.current = !1, O.current = 0, P.current = 0, nt(r, re.current));
882
+ }, [m, b, r, d]), Se(() => {
883
+ const w = d.current;
884
+ if (!(!m || !V || !r || !w || u.state.transitionStatus === "ending")) {
885
+ if (!b) {
886
+ I.current = !0, p.request(v), w.style.removeProperty("--transform-origin");
887
+ return;
690
888
  }
889
+ queueMicrotask(() => {
890
+ const J = ho(w);
891
+ w.style.removeProperty("--transform-origin");
892
+ try {
893
+ const ae = getComputedStyle(r), _ = getComputedStyle(w), xe = dt(V), ye = Tt(r), H = go(V), X = tt(V.getBoundingClientRect(), H), Z = tt(r.getBoundingClientRect(), H), G = X.left, ne = X.height, Q = M || w, g = Q.scrollHeight, Me = parseFloat(_.borderBottomWidth), Ie = parseFloat(ae.marginTop) || 10, we = parseFloat(ae.marginBottom) || 10, De = parseFloat(ae.minHeight) || 100, He = Nt(_), ee = 5, de = 5, le = 20, fe = xe.documentElement.clientHeight - Ie - we, We = xe.documentElement.clientWidth, Ue = fe - X.bottom + ne, qe = S.current, Re = T.current;
894
+ let Ne, Ke = 0, Je = 0;
895
+ if (qe && Re) {
896
+ const D = tt(Re.getBoundingClientRect(), H);
897
+ Ne = tt(qe.getBoundingClientRect(), H);
898
+ const pe = D.left - G, he = Ne.left - Z.left, me = D.top - X.top + D.height / 2, Oe = Ne.top - Z.top + Ne.height / 2;
899
+ Ke = pe - he, Je = Oe - me;
900
+ }
901
+ const Ye = Ue + Je + we + Me;
902
+ let ve = Math.min(fe, Ye);
903
+ const Ge = fe - Ie - we, Be = Ye - ve, Fe = Math.max(ee, G + Ke), rt = We - de, st = Math.max(0, Fe + Z.width - rt);
904
+ r.style.left = `${Fe - st}px`, r.style.height = `${ve}px`, r.style.maxHeight = "auto", r.style.marginTop = `${Ie}px`, r.style.marginBottom = `${we}px`, w.style.height = "100%";
905
+ const Ze = et(Q), $e = Be >= Ze - Ae;
906
+ $e && (ve = Math.min(fe, Z.height) - (Be - Ze));
907
+ const lt = X.top < le || X.bottom > fe - le || Math.ceil(ve) + Ae < Math.min(g, De), E = (ye.visualViewport?.scale ?? 1) !== 1 && Yn;
908
+ if (lt || E) {
909
+ I.current = !0, nt(r, re.current), Wn.flushSync(() => q(!1));
910
+ return;
911
+ }
912
+ if ($e) {
913
+ const D = Math.max(0, fe - Ye);
914
+ r.style.top = Z.height >= Ge ? "0" : `${D}px`, r.style.height = `${ve}px`, Q.scrollTop = et(Q), O.current = Math.max(De, ve);
915
+ } else
916
+ r.style.bottom = "0", O.current = Math.max(De, ve), Q.scrollTop = Be;
917
+ if (Ne) {
918
+ const D = Z.top, pe = Z.height, he = Ne.top + Ne.height / 2, me = pe > 0 ? (he - D) / pe * 100 : 50, Oe = at(me, 0, 100);
919
+ w.style.setProperty("--transform-origin", `50% ${Oe}%`);
920
+ }
921
+ (O.current === fe || ve >= He) && (i.current = !0), v(), setTimeout(() => {
922
+ I.current = !0;
923
+ });
924
+ } finally {
925
+ J();
926
+ }
927
+ });
928
+ }
929
+ }, [u, m, r, V, T, S, d, v, b, q, p, ge, oe, M]), n.useEffect(() => {
930
+ if (!b || !r || !m)
931
+ return;
932
+ const w = Tt(r);
933
+ function J(ae) {
934
+ N(!1, Ve(Nn, ae));
935
+ }
936
+ return w.addEventListener("resize", J), () => {
937
+ w.removeEventListener("resize", J);
938
+ };
939
+ }, [N, b, r, m]);
940
+ const ue = {
941
+ ...M ? {
942
+ role: "presentation",
943
+ "aria-orientation": void 0
944
+ } : {
945
+ role: "listbox",
946
+ "aria-multiselectable": te || void 0,
947
+ id: `${j}-list`
948
+ },
949
+ onKeyDown(w) {
950
+ B.current = !0, k && jn.has(w.key) && w.stopPropagation();
951
+ },
952
+ onMouseMove() {
953
+ B.current = !1;
954
+ },
955
+ onPointerLeave(w) {
956
+ if (!C || Xt(w) || w.pointerType === "touch")
957
+ return;
958
+ const J = w.currentTarget;
959
+ Y.start(0, () => {
960
+ u.set("activeIndex", null), J.focus({
961
+ preventScroll: !0
962
+ });
963
+ });
964
+ },
965
+ onScroll(w) {
966
+ M || L(w.currentTarget);
967
+ },
968
+ ...b && {
969
+ style: M ? {
970
+ height: "100%"
971
+ } : $t
691
972
  }
692
- ) : null;
973
+ }, Te = be("div", t, {
974
+ ref: [o, d],
975
+ state: se,
976
+ stateAttributesMapping: mo,
977
+ props: [W, ue, Ut(F), {
978
+ className: !M && b ? ft.className : void 0
979
+ }, c]
980
+ });
981
+ return /* @__PURE__ */ ze(n.Fragment, {
982
+ children: [!z && ft.getElement(ie), /* @__PURE__ */ R(On, {
983
+ context: K,
984
+ modal: !1,
985
+ disabled: !ce,
986
+ returnFocus: l,
987
+ restoreFocus: !0,
988
+ children: Te
989
+ })]
990
+ });
693
991
  });
694
- Qe.displayName = Ce;
695
- var ye = "SelectScrollDownButton", et = n.forwardRef((t, o) => {
696
- const e = q(ye, t.__scopeSelect), c = Pe(ye, t.__scopeSelect), [l, u] = n.useState(!1), r = k(o, c.onScrollButtonChange);
697
- return j(() => {
698
- if (e.viewport && e.isPositioned) {
699
- let a = function() {
700
- const f = i.scrollHeight - i.clientHeight, g = Math.ceil(i.scrollTop) < f;
701
- u(g);
702
- };
703
- const i = e.viewport;
704
- return a(), i.addEventListener("scroll", a), () => i.removeEventListener("scroll", a);
992
+ process.env.NODE_ENV !== "production" && (Kt.displayName = "SelectPopup");
993
+ function Nt(e) {
994
+ const t = e.maxHeight || "";
995
+ return t.endsWith("px") && parseFloat(t) || 1 / 0;
996
+ }
997
+ function et(e) {
998
+ return Math.max(0, e.scrollHeight - e.clientHeight);
999
+ }
1000
+ function go(e) {
1001
+ return Un.getScale(e);
1002
+ }
1003
+ function tt(e, t) {
1004
+ return qn({
1005
+ x: e.x / t.x,
1006
+ y: e.y / t.y,
1007
+ width: e.width / t.x,
1008
+ height: e.height / t.y
1009
+ });
1010
+ }
1011
+ const At = [["transform", "none"], ["scale", "1"], ["translate", "0 0"]];
1012
+ function ho(e) {
1013
+ const {
1014
+ style: t
1015
+ } = e, o = {};
1016
+ for (const [s, x] of At)
1017
+ o[s] = t.getPropertyValue(s), t.setProperty(s, x, "important");
1018
+ return () => {
1019
+ for (const [s] of At) {
1020
+ const x = o[s];
1021
+ x ? t.setProperty(s, x) : t.removeProperty(s);
705
1022
  }
706
- }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ s(
707
- tt,
708
- {
709
- ...t,
710
- ref: r,
711
- onAutoScroll: () => {
712
- const { viewport: a, selectedItem: i } = e;
713
- a && i && (a.scrollTop = a.scrollTop + i.offsetHeight);
1023
+ };
1024
+ }
1025
+ const Jt = /* @__PURE__ */ n.forwardRef(function(t, o) {
1026
+ const {
1027
+ className: s,
1028
+ render: x,
1029
+ ...l
1030
+ } = t, {
1031
+ store: c,
1032
+ scrollHandlerRef: u
1033
+ } = Ee(), {
1034
+ alignItemWithTriggerActive: d
1035
+ } = xt(), U = f(c, a.hasScrollArrows), N = f(c, a.openMethod), T = f(c, a.multiple), B = {
1036
+ id: `${f(c, a.id)}-list`,
1037
+ role: "listbox",
1038
+ "aria-multiselectable": T || void 0,
1039
+ onScroll(v) {
1040
+ u.current?.(v.currentTarget);
1041
+ },
1042
+ ...d && {
1043
+ style: $t
1044
+ },
1045
+ className: U && N !== "touch" ? ft.className : void 0
1046
+ }, te = Ce((v) => {
1047
+ c.set("listElement", v);
1048
+ });
1049
+ return be("div", t, {
1050
+ ref: [o, te],
1051
+ props: [B, l]
1052
+ });
1053
+ });
1054
+ process.env.NODE_ENV !== "production" && (Jt.displayName = "SelectList");
1055
+ const vt = /* @__PURE__ */ n.createContext(void 0);
1056
+ process.env.NODE_ENV !== "production" && (vt.displayName = "SelectItemContext");
1057
+ function yt() {
1058
+ const e = n.useContext(vt);
1059
+ if (!e)
1060
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>." : Xe(57));
1061
+ return e;
1062
+ }
1063
+ const Zt = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
1064
+ const {
1065
+ render: s,
1066
+ className: x,
1067
+ value: l = null,
1068
+ label: c,
1069
+ disabled: u = !1,
1070
+ nativeButton: d = !1,
1071
+ ...U
1072
+ } = t, N = n.useRef(null), T = Kn({
1073
+ label: c,
1074
+ textRef: N,
1075
+ indexGuessBehavior: Jn.GuessFromOrder
1076
+ }), {
1077
+ store: S,
1078
+ getItemProps: B,
1079
+ setOpen: te,
1080
+ setValue: v,
1081
+ selectionRef: $,
1082
+ typingRef: C,
1083
+ valuesRef: y,
1084
+ keyboardActiveRef: h,
1085
+ multiple: b,
1086
+ highlightItemOnHover: q
1087
+ } = Ee(), ge = Le(), oe = f(S, a.isActive, T.index), k = f(S, a.isSelected, T.index, l), K = f(S, a.isSelectedByFocus, T.index), ie = f(S, a.isItemEqualToValue), z = T.index, Y = z !== -1, j = n.useRef(null), m = pt(z);
1088
+ Se(() => {
1089
+ if (!Y)
1090
+ return;
1091
+ const p = y.current;
1092
+ return p[z] = l, () => {
1093
+ delete p[z];
1094
+ };
1095
+ }, [Y, z, l, y]), Se(() => {
1096
+ if (!Y)
1097
+ return;
1098
+ const p = S.state.value;
1099
+ let L = p;
1100
+ b && Array.isArray(p) && p.length > 0 && (L = p[p.length - 1]), L !== void 0 && ke(l, L, ie) && S.set("selectedIndex", z);
1101
+ }, [Y, z, b, ie, S, l]);
1102
+ const ce = {
1103
+ disabled: u,
1104
+ selected: k,
1105
+ highlighted: oe
1106
+ }, W = B({
1107
+ active: oe,
1108
+ selected: k
1109
+ });
1110
+ W.onFocus = void 0, W.id = void 0;
1111
+ const F = n.useRef(null), V = n.useRef("mouse"), r = n.useRef(!1), {
1112
+ getButtonProps: M,
1113
+ buttonRef: O
1114
+ } = Bt({
1115
+ disabled: u,
1116
+ focusableWhenDisabled: !0,
1117
+ native: d,
1118
+ composite: !0
1119
+ });
1120
+ function i(p) {
1121
+ const L = S.state.value;
1122
+ if (b) {
1123
+ const se = Array.isArray(L) ? L : [], ue = k ? ro(se, l, ie) : [...se, l];
1124
+ v(ue, Ve(it, p));
1125
+ } else
1126
+ v(l, Ve(it, p)), te(!1, Ve(it, p));
1127
+ }
1128
+ const P = {
1129
+ role: "option",
1130
+ "aria-selected": k,
1131
+ tabIndex: oe ? 0 : -1,
1132
+ onFocus() {
1133
+ S.set("activeIndex", z);
1134
+ },
1135
+ onMouseEnter() {
1136
+ !h.current && S.state.selectedIndex === null && q && S.set("activeIndex", z);
1137
+ },
1138
+ onMouseMove() {
1139
+ q && S.set("activeIndex", z);
1140
+ },
1141
+ onMouseLeave(p) {
1142
+ !q || h.current || Xt(p) || ge.start(0, () => {
1143
+ S.state.activeIndex === z && S.set("activeIndex", null);
1144
+ });
1145
+ },
1146
+ onTouchStart() {
1147
+ $.current = {
1148
+ allowSelectedMouseUp: !1,
1149
+ allowUnselectedMouseUp: !1
1150
+ };
1151
+ },
1152
+ onKeyDown(p) {
1153
+ F.current = p.key, S.set("activeIndex", z), p.key === " " && C.current && p.preventDefault();
1154
+ },
1155
+ onClick(p) {
1156
+ r.current = !1, !(p.type === "keydown" && F.current === null) && (u || p.type === "keydown" && F.current === " " && C.current || V.current !== "touch" && !oe || (F.current = null, i(p.nativeEvent)));
1157
+ },
1158
+ onPointerEnter(p) {
1159
+ V.current = p.pointerType;
1160
+ },
1161
+ onPointerDown(p) {
1162
+ V.current = p.pointerType, r.current = !0;
1163
+ },
1164
+ onMouseUp() {
1165
+ if (u)
1166
+ return;
1167
+ if (r.current) {
1168
+ r.current = !1;
1169
+ return;
714
1170
  }
1171
+ const p = !$.current.allowSelectedMouseUp && k, L = !$.current.allowUnselectedMouseUp && !k;
1172
+ p || L || V.current !== "touch" && !oe || j.current?.click();
715
1173
  }
716
- ) : null;
1174
+ }, I = be("div", t, {
1175
+ ref: [O, o, T.ref, j],
1176
+ state: ce,
1177
+ props: [W, P, U, M]
1178
+ }), re = n.useMemo(() => ({
1179
+ selected: k,
1180
+ indexRef: m,
1181
+ textRef: N,
1182
+ selectedByFocus: K,
1183
+ hasRegistered: Y
1184
+ }), [k, m, N, K, Y]);
1185
+ return /* @__PURE__ */ R(vt.Provider, {
1186
+ value: re,
1187
+ children: I
1188
+ });
1189
+ }));
1190
+ process.env.NODE_ENV !== "production" && (Zt.displayName = "SelectItem");
1191
+ const Qt = /* @__PURE__ */ n.forwardRef(function(t, o) {
1192
+ const s = t.keepMounted ?? !1, {
1193
+ selected: x
1194
+ } = yt();
1195
+ return s || x ? /* @__PURE__ */ R(en, {
1196
+ ...t,
1197
+ ref: o
1198
+ }) : null;
717
1199
  });
718
- et.displayName = ye;
719
- var tt = n.forwardRef((t, o) => {
720
- const { __scopeSelect: e, onAutoScroll: c, ...l } = t, u = q("SelectScrollButton", e), r = n.useRef(null), a = ue(e), i = n.useCallback(() => {
721
- r.current !== null && (window.clearInterval(r.current), r.current = null);
722
- }, []);
723
- return n.useEffect(() => () => i(), [i]), j(() => {
724
- a().find((g) => g.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
725
- }, [a]), /* @__PURE__ */ s(
726
- M.div,
727
- {
1200
+ process.env.NODE_ENV !== "production" && (Qt.displayName = "SelectItemIndicator");
1201
+ const en = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef((e, t) => {
1202
+ const {
1203
+ render: o,
1204
+ className: s,
1205
+ keepMounted: x,
1206
+ ...l
1207
+ } = e, {
1208
+ selected: c
1209
+ } = yt(), u = n.useRef(null), {
1210
+ transitionStatus: d,
1211
+ setMounted: U
1212
+ } = mt(c), T = be("span", e, {
1213
+ ref: [t, u],
1214
+ state: {
1215
+ selected: c,
1216
+ transitionStatus: d
1217
+ },
1218
+ props: [{
728
1219
  "aria-hidden": !0,
729
- ...l,
730
- ref: o,
731
- style: { flexShrink: 0, ...l.style },
732
- onPointerDown: P(l.onPointerDown, () => {
733
- r.current === null && (r.current = window.setInterval(c, 50));
734
- }),
735
- onPointerMove: P(l.onPointerMove, () => {
736
- u.onItemLeave?.(), r.current === null && (r.current = window.setInterval(c, 50));
737
- }),
738
- onPointerLeave: P(l.onPointerLeave, () => {
739
- i();
740
- })
1220
+ children: "✔️"
1221
+ }, l],
1222
+ stateAttributesMapping: Lt
1223
+ });
1224
+ return ot({
1225
+ open: c,
1226
+ ref: u,
1227
+ onComplete() {
1228
+ c || U(!1);
741
1229
  }
742
- );
743
- }), Wt = "SelectSeparator", ot = n.forwardRef(
744
- (t, o) => {
745
- const { __scopeSelect: e, ...c } = t;
746
- return /* @__PURE__ */ s(M.div, { "aria-hidden": !0, ...c, ref: o });
747
- }
748
- );
749
- ot.displayName = Wt;
750
- var Ie = "SelectArrow", zt = n.forwardRef(
751
- (t, o) => {
752
- const { __scopeSelect: e, ...c } = t, l = pe(e), u = Y(Ie, e), r = q(Ie, e);
753
- return u.open && r.position === "popper" ? /* @__PURE__ */ s(yt, { ...l, ...c, ref: o }) : null;
754
- }
755
- );
756
- zt.displayName = Ie;
757
- var Kt = "SelectBubbleInput", nt = n.forwardRef(
758
- ({ __scopeSelect: t, value: o, ...e }, c) => {
759
- const l = n.useRef(null), u = k(c, l), r = bt(o);
760
- return n.useEffect(() => {
761
- const a = l.current;
762
- if (!a) return;
763
- const i = window.HTMLSelectElement.prototype, g = Object.getOwnPropertyDescriptor(
764
- i,
765
- "value"
766
- ).set;
767
- if (r !== o && g) {
768
- const x = new Event("change", { bubbles: !0 });
769
- g.call(a, o), a.dispatchEvent(x);
770
- }
771
- }, [r, o]), /* @__PURE__ */ s(
772
- M.select,
773
- {
774
- ...e,
775
- style: { ...Tt, ...e.style },
776
- ref: u,
777
- defaultValue: o
778
- }
779
- );
780
- }
781
- );
782
- nt.displayName = Kt;
783
- function rt(t) {
784
- return t === "" || t === void 0;
785
- }
786
- function st(t) {
787
- const o = It(t), e = n.useRef(""), c = n.useRef(0), l = n.useCallback(
788
- (r) => {
789
- const a = e.current + r;
790
- o(a), (function i(f) {
791
- e.current = f, window.clearTimeout(c.current), f !== "" && (c.current = window.setTimeout(() => i(""), 1e3));
792
- })(a);
1230
+ }), T;
1231
+ }));
1232
+ process.env.NODE_ENV !== "production" && (en.displayName = "Inner");
1233
+ const tn = /* @__PURE__ */ n.memo(/* @__PURE__ */ n.forwardRef(function(t, o) {
1234
+ const {
1235
+ indexRef: s,
1236
+ textRef: x,
1237
+ selectedByFocus: l,
1238
+ hasRegistered: c
1239
+ } = yt(), {
1240
+ selectedItemTextRef: u
1241
+ } = Ee(), {
1242
+ className: d,
1243
+ render: U,
1244
+ ...N
1245
+ } = t, T = n.useCallback((B) => {
1246
+ if (!B || !c)
1247
+ return;
1248
+ const te = u.current === null || !u.current.isConnected;
1249
+ (l || te && s.current === 0) && (u.current = B);
1250
+ }, [u, s, l, c]);
1251
+ return be("div", t, {
1252
+ ref: [T, o, x],
1253
+ props: N
1254
+ });
1255
+ }));
1256
+ process.env.NODE_ENV !== "production" && (tn.displayName = "SelectItemText");
1257
+ const It = /* @__PURE__ */ n.forwardRef(function(t, o) {
1258
+ const {
1259
+ render: s,
1260
+ className: x,
1261
+ direction: l,
1262
+ keepMounted: c = !1,
1263
+ ...u
1264
+ } = t, {
1265
+ store: d,
1266
+ popupRef: U,
1267
+ listRef: N,
1268
+ handleScrollArrowVisibility: T,
1269
+ scrollArrowsMountedCountRef: S
1270
+ } = Ee(), {
1271
+ side: B,
1272
+ scrollDownArrowRef: te,
1273
+ scrollUpArrowRef: v
1274
+ } = xt(), $ = l === "up" ? a.scrollUpArrowVisible : a.scrollDownArrowVisible, C = f(d, $), y = f(d, a.openMethod), h = C && y !== "touch", b = Le(), q = l === "up" ? v : te, {
1275
+ transitionStatus: ge,
1276
+ setMounted: oe
1277
+ } = mt(h);
1278
+ Se(() => (S.current += 1, d.state.hasScrollArrows || d.set("hasScrollArrows", !0), () => {
1279
+ S.current = Math.max(0, S.current - 1), S.current === 0 && d.state.hasScrollArrows && d.set("hasScrollArrows", !1);
1280
+ }), [d, S]), ot({
1281
+ open: h,
1282
+ ref: q,
1283
+ onComplete() {
1284
+ h || oe(!1);
1285
+ }
1286
+ });
1287
+ const ie = be("div", t, {
1288
+ ref: [o, q],
1289
+ state: {
1290
+ direction: l,
1291
+ visible: h,
1292
+ side: B,
1293
+ transitionStatus: ge
793
1294
  },
794
- [o]
795
- ), u = n.useCallback(() => {
796
- e.current = "", window.clearTimeout(c.current);
797
- }, []);
798
- return n.useEffect(() => () => window.clearTimeout(c.current), []), [e, l, u];
799
- }
800
- function at(t, o, e) {
801
- const l = o.length > 1 && Array.from(o).every((f) => f === o[0]) ? o[0] : o, u = e ? t.indexOf(e) : -1;
802
- let r = $t(t, Math.max(u, 0));
803
- l.length === 1 && (r = r.filter((f) => f !== e));
804
- const i = r.find(
805
- (f) => f.textValue.toLowerCase().startsWith(l.toLowerCase())
806
- );
807
- return i !== e ? i : void 0;
808
- }
809
- function $t(t, o) {
810
- return t.map((e, c) => t[(o + c) % t.length]);
811
- }
812
- var Gt = Ae, jt = De, Yt = ke, qt = Be, Xt = Ve, Zt = He, Jt = ze, Qt = $e, eo = je, to = qe, oo = Xe, no = Je, ro = Qe, so = et, ao = ot;
813
- function _o({
814
- ...t
815
- }) {
816
- return /* @__PURE__ */ s(Gt, { "data-slot": "select", ...t });
817
- }
818
- function Eo({
819
- ...t
820
- }) {
821
- return /* @__PURE__ */ s(Qt, { "data-slot": "select-group", ...t });
1295
+ props: [{
1296
+ "aria-hidden": !0,
1297
+ children: l === "up" ? "▲" : "▼",
1298
+ style: {
1299
+ position: "absolute"
1300
+ },
1301
+ onMouseMove(Y) {
1302
+ if (Y.movementX === 0 && Y.movementY === 0 || b.isStarted())
1303
+ return;
1304
+ d.set("activeIndex", null);
1305
+ function j() {
1306
+ const m = d.state.listElement ?? U.current;
1307
+ if (!m)
1308
+ return;
1309
+ d.set("activeIndex", null), T();
1310
+ const ce = m.scrollTop === 0, W = Math.round(m.scrollTop + m.clientHeight) >= m.scrollHeight;
1311
+ if (N.current.length === 0 && (l === "up" ? d.set("scrollUpArrowVisible", !ce) : d.set("scrollDownArrowVisible", !W)), l === "up" && ce || l === "down" && W) {
1312
+ b.clear();
1313
+ return;
1314
+ }
1315
+ if ((d.state.listElement || U.current) && N.current && N.current.length > 0) {
1316
+ const V = N.current, r = q.current?.offsetHeight || 0;
1317
+ if (l === "up") {
1318
+ let M = 0;
1319
+ const O = m.scrollTop + r;
1320
+ for (let P = 0; P < V.length; P += 1) {
1321
+ const I = V[P];
1322
+ if (I && I.offsetTop >= O) {
1323
+ M = P;
1324
+ break;
1325
+ }
1326
+ }
1327
+ const i = Math.max(0, M - 1);
1328
+ if (i < M) {
1329
+ const P = V[i];
1330
+ P && (m.scrollTop = Math.max(0, P.offsetTop - r));
1331
+ } else
1332
+ m.scrollTop = 0;
1333
+ } else {
1334
+ let M = V.length - 1;
1335
+ const O = m.scrollTop + m.clientHeight - r;
1336
+ for (let P = 0; P < V.length; P += 1) {
1337
+ const I = V[P];
1338
+ if (I && I.offsetTop + I.offsetHeight > O) {
1339
+ M = Math.max(0, P - 1);
1340
+ break;
1341
+ }
1342
+ }
1343
+ const i = Math.min(V.length - 1, M + 1);
1344
+ if (i > M) {
1345
+ const P = V[i];
1346
+ P && (m.scrollTop = P.offsetTop + P.offsetHeight - m.clientHeight + r);
1347
+ } else
1348
+ m.scrollTop = m.scrollHeight - m.clientHeight;
1349
+ }
1350
+ }
1351
+ b.start(40, j);
1352
+ }
1353
+ b.start(40, j);
1354
+ },
1355
+ onMouseLeave() {
1356
+ b.clear();
1357
+ }
1358
+ }, u]
1359
+ });
1360
+ return h || c ? ie : null;
1361
+ });
1362
+ process.env.NODE_ENV !== "production" && (It.displayName = "SelectScrollArrow");
1363
+ const nn = /* @__PURE__ */ n.forwardRef(function(t, o) {
1364
+ return /* @__PURE__ */ R(It, {
1365
+ ...t,
1366
+ ref: o,
1367
+ direction: "down"
1368
+ });
1369
+ });
1370
+ process.env.NODE_ENV !== "production" && (nn.displayName = "SelectScrollDownArrow");
1371
+ const on = /* @__PURE__ */ n.forwardRef(function(t, o) {
1372
+ return /* @__PURE__ */ R(It, {
1373
+ ...t,
1374
+ ref: o,
1375
+ direction: "up"
1376
+ });
1377
+ });
1378
+ process.env.NODE_ENV !== "production" && (on.displayName = "SelectScrollUpArrow");
1379
+ const wt = /* @__PURE__ */ n.createContext(void 0);
1380
+ process.env.NODE_ENV !== "production" && (wt.displayName = "SelectGroupContext");
1381
+ function So() {
1382
+ const e = n.useContext(wt);
1383
+ if (e === void 0)
1384
+ throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>." : Xe(56));
1385
+ return e;
822
1386
  }
823
- function Mo({
824
- ...t
825
- }) {
826
- return /* @__PURE__ */ s(Yt, { "data-slot": "select-value", ...t });
1387
+ const rn = /* @__PURE__ */ n.forwardRef(function(t, o) {
1388
+ const {
1389
+ className: s,
1390
+ render: x,
1391
+ ...l
1392
+ } = t, [c, u] = n.useState(), d = n.useMemo(() => ({
1393
+ labelId: c,
1394
+ setLabelId: u
1395
+ }), [c, u]), U = be("div", t, {
1396
+ ref: o,
1397
+ props: [{
1398
+ role: "group",
1399
+ "aria-labelledby": c
1400
+ }, l]
1401
+ });
1402
+ return /* @__PURE__ */ R(wt.Provider, {
1403
+ value: d,
1404
+ children: U
1405
+ });
1406
+ });
1407
+ process.env.NODE_ENV !== "production" && (rn.displayName = "SelectGroup");
1408
+ const sn = /* @__PURE__ */ n.forwardRef(function(t, o) {
1409
+ const {
1410
+ className: s,
1411
+ render: x,
1412
+ id: l,
1413
+ ...c
1414
+ } = t, {
1415
+ setLabelId: u
1416
+ } = So(), d = Zn(l);
1417
+ return Se(() => {
1418
+ u(d);
1419
+ }, [d, u]), be("div", t, {
1420
+ ref: o,
1421
+ props: [{
1422
+ id: d
1423
+ }, c]
1424
+ });
1425
+ });
1426
+ process.env.NODE_ENV !== "production" && (sn.displayName = "SelectGroupLabel");
1427
+ const sr = ao;
1428
+ function lr({ className: e, ...t }) {
1429
+ return /* @__PURE__ */ R(
1430
+ rn,
1431
+ {
1432
+ className: Pe("scroll-my-1 p-1", e),
1433
+ "data-slot": "select-group",
1434
+ ...t
1435
+ }
1436
+ );
827
1437
  }
828
- function Ao({
829
- className: t,
830
- size: o = "default",
831
- children: e,
832
- ...c
833
- }) {
834
- return /* @__PURE__ */ Q(
835
- jt,
1438
+ function ir({ className: e, ...t }) {
1439
+ return /* @__PURE__ */ R(
1440
+ Wt,
836
1441
  {
837
- className: G(
838
- "flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",
839
- t
840
- ),
841
- "data-size": o,
842
- "data-slot": "select-trigger",
843
- ...c,
844
- children: [
845
- e,
846
- /* @__PURE__ */ s(qt, { asChild: !0, children: /* @__PURE__ */ s(_e, { className: "size-4 opacity-50" }) })
847
- ]
1442
+ className: Pe("flex flex-1 text-left", e),
1443
+ "data-slot": "select-value",
1444
+ ...t
848
1445
  }
849
1446
  );
850
1447
  }
851
- function Oo({
852
- className: t,
1448
+ function ar({
1449
+ className: e,
1450
+ size: t = "default",
853
1451
  children: o,
854
- position: e = "popper",
855
- ...c
1452
+ ...s
856
1453
  }) {
857
- return /* @__PURE__ */ s(Xt, { children: /* @__PURE__ */ Q(
858
- Zt,
1454
+ return /* @__PURE__ */ ze(
1455
+ zt,
859
1456
  {
860
- className: G(
861
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",
862
- e === "popper" && "data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",
863
- t
1457
+ className: Pe(
1458
+ "flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-md border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-placeholder:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
1459
+ e
864
1460
  ),
865
- "data-slot": "select-content",
866
- position: e,
867
- ...c,
1461
+ "data-size": t,
1462
+ "data-slot": "select-trigger",
1463
+ ...s,
868
1464
  children: [
869
- /* @__PURE__ */ s(lo, {}),
870
- /* @__PURE__ */ s(
871
- Jt,
1465
+ o,
1466
+ /* @__PURE__ */ R(
1467
+ qt,
872
1468
  {
873
- className: G(
874
- "p-1",
875
- e === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
876
- ),
877
- children: o
1469
+ render: /* @__PURE__ */ R(Ct, { className: "pointer-events-none size-4 text-muted-foreground" })
878
1470
  }
879
- ),
880
- /* @__PURE__ */ s(co, {})
1471
+ )
881
1472
  ]
882
1473
  }
1474
+ );
1475
+ }
1476
+ function cr({
1477
+ className: e,
1478
+ children: t,
1479
+ side: o = "bottom",
1480
+ sideOffset: s = 4,
1481
+ align: x = "center",
1482
+ alignOffset: l = 0,
1483
+ alignItemWithTrigger: c = !1,
1484
+ ...u
1485
+ }) {
1486
+ return /* @__PURE__ */ R(Gt, { children: /* @__PURE__ */ R(
1487
+ jt,
1488
+ {
1489
+ align: x,
1490
+ alignItemWithTrigger: c,
1491
+ alignOffset: l,
1492
+ className: "isolate z-50",
1493
+ side: o,
1494
+ sideOffset: s,
1495
+ children: /* @__PURE__ */ ze(
1496
+ Kt,
1497
+ {
1498
+ className: Pe(
1499
+ "data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:fade-in-0 data-open:zoom-in-95 data-closed:fade-out-0 data-closed:zoom-out-95 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-closed:animate-out data-open:animate-in",
1500
+ e
1501
+ ),
1502
+ "data-align-trigger": c,
1503
+ "data-slot": "select-content",
1504
+ ...u,
1505
+ children: [
1506
+ /* @__PURE__ */ R(bo, {}),
1507
+ /* @__PURE__ */ R(Jt, { children: t }),
1508
+ /* @__PURE__ */ R(xo, {})
1509
+ ]
1510
+ }
1511
+ )
1512
+ }
883
1513
  ) });
884
1514
  }
885
- function Do({
886
- className: t,
887
- ...o
1515
+ function ur({
1516
+ className: e,
1517
+ ...t
888
1518
  }) {
889
- return /* @__PURE__ */ s(
890
- eo,
1519
+ return /* @__PURE__ */ R(
1520
+ sn,
891
1521
  {
892
- className: G("px-2 py-1.5 text-muted-foreground text-xs", t),
1522
+ className: Pe("px-2 py-1.5 text-muted-foreground text-xs", e),
893
1523
  "data-slot": "select-label",
894
- ...o
1524
+ ...t
895
1525
  }
896
1526
  );
897
1527
  }
898
- function Lo({
899
- className: t,
900
- children: o,
901
- ...e
1528
+ function dr({
1529
+ className: e,
1530
+ children: t,
1531
+ ...o
902
1532
  }) {
903
- return /* @__PURE__ */ Q(
904
- to,
1533
+ return /* @__PURE__ */ ze(
1534
+ Zt,
905
1535
  {
906
- className: G(
907
- "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
908
- t
1536
+ className: Pe(
1537
+ "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
1538
+ e
909
1539
  ),
910
1540
  "data-slot": "select-item",
911
- ...e,
1541
+ ...o,
912
1542
  children: [
913
- /* @__PURE__ */ s("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ s(no, { children: /* @__PURE__ */ s(lt, { className: "size-4" }) }) }),
914
- /* @__PURE__ */ s(oo, { children: o })
1543
+ /* @__PURE__ */ R(tn, { className: "flex flex-1 shrink-0 gap-2 whitespace-nowrap", children: t }),
1544
+ /* @__PURE__ */ R(
1545
+ Qt,
1546
+ {
1547
+ render: /* @__PURE__ */ R("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }),
1548
+ children: /* @__PURE__ */ R(ln, { className: "pointer-events-none" })
1549
+ }
1550
+ )
915
1551
  ]
916
1552
  }
917
1553
  );
918
1554
  }
919
- function ko({
920
- className: t,
921
- ...o
1555
+ function fr({
1556
+ className: e,
1557
+ ...t
922
1558
  }) {
923
- return /* @__PURE__ */ s(
924
- ao,
1559
+ return /* @__PURE__ */ R(
1560
+ Qn,
925
1561
  {
926
- className: G("pointer-events-none -mx-1 my-1 h-px bg-border", t),
1562
+ className: Pe("pointer-events-none -mx-1 my-1 h-px bg-border", e),
927
1563
  "data-slot": "select-separator",
928
- ...o
1564
+ ...t
929
1565
  }
930
1566
  );
931
1567
  }
932
- function lo({
933
- className: t,
934
- ...o
1568
+ function bo({
1569
+ className: e,
1570
+ ...t
935
1571
  }) {
936
- return /* @__PURE__ */ s(
937
- ro,
1572
+ return /* @__PURE__ */ R(
1573
+ on,
938
1574
  {
939
- className: G(
940
- "flex cursor-default items-center justify-center py-1",
941
- t
1575
+ className: Pe(
1576
+ "top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
1577
+ e
942
1578
  ),
943
1579
  "data-slot": "select-scroll-up-button",
944
- ...o,
945
- children: /* @__PURE__ */ s(ct, { className: "size-4" })
1580
+ ...t,
1581
+ children: /* @__PURE__ */ R(an, {})
946
1582
  }
947
1583
  );
948
1584
  }
949
- function co({
950
- className: t,
951
- ...o
1585
+ function xo({
1586
+ className: e,
1587
+ ...t
952
1588
  }) {
953
- return /* @__PURE__ */ s(
954
- so,
1589
+ return /* @__PURE__ */ R(
1590
+ nn,
955
1591
  {
956
- className: G(
957
- "flex cursor-default items-center justify-center py-1",
958
- t
1592
+ className: Pe(
1593
+ "bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",
1594
+ e
959
1595
  ),
960
1596
  "data-slot": "select-scroll-down-button",
961
- ...o,
962
- children: /* @__PURE__ */ s(_e, { className: "size-4" })
1597
+ ...t,
1598
+ children: /* @__PURE__ */ R(Ct, {})
963
1599
  }
964
1600
  );
965
1601
  }
966
1602
  export {
967
- _o as Select,
968
- Oo as SelectContent,
969
- Eo as SelectGroup,
970
- Lo as SelectItem,
971
- Do as SelectLabel,
972
- co as SelectScrollDownButton,
973
- lo as SelectScrollUpButton,
974
- ko as SelectSeparator,
975
- Ao as SelectTrigger,
976
- Mo as SelectValue
1603
+ sr as Select,
1604
+ cr as SelectContent,
1605
+ lr as SelectGroup,
1606
+ dr as SelectItem,
1607
+ ur as SelectLabel,
1608
+ xo as SelectScrollDownButton,
1609
+ bo as SelectScrollUpButton,
1610
+ fr as SelectSeparator,
1611
+ ar as SelectTrigger,
1612
+ ir as SelectValue
977
1613
  };