@womp/kookie-ui 0.3.25 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (582) hide show
  1. package/AUTHORS +27 -0
  2. package/LICENSE +29 -0
  3. package/README.md +21 -1
  4. package/components.css +163 -118
  5. package/dist/cjs/components/_internal/base-button.d.ts.map +1 -1
  6. package/dist/cjs/components/_internal/base-button.js +1 -1
  7. package/dist/cjs/components/_internal/base-button.js.map +4 -4
  8. package/dist/cjs/components/_internal/dropdown-menu-drill-down.js +1 -1
  9. package/dist/cjs/components/_internal/dropdown-menu-drill-down.js.map +3 -3
  10. package/dist/cjs/components/_internal/shell-bottom.js +1 -1
  11. package/dist/cjs/components/_internal/shell-bottom.js.map +4 -4
  12. package/dist/cjs/components/_internal/shell-handles.d.ts.map +1 -1
  13. package/dist/cjs/components/_internal/shell-handles.js +1 -1
  14. package/dist/cjs/components/_internal/shell-handles.js.map +3 -3
  15. package/dist/cjs/components/_internal/shell-inspector.js +1 -1
  16. package/dist/cjs/components/_internal/shell-inspector.js.map +4 -4
  17. package/dist/cjs/components/_internal/shell-sidebar.js +1 -1
  18. package/dist/cjs/components/_internal/shell-sidebar.js.map +4 -4
  19. package/dist/cjs/components/accordion.d.ts.map +1 -1
  20. package/dist/cjs/components/accordion.js +1 -1
  21. package/dist/cjs/components/accordion.js.map +4 -4
  22. package/dist/cjs/components/alert-dialog.d.ts.map +1 -1
  23. package/dist/cjs/components/alert-dialog.js +1 -1
  24. package/dist/cjs/components/alert-dialog.js.map +4 -4
  25. package/dist/cjs/components/avatar.js +1 -1
  26. package/dist/cjs/components/avatar.js.map +4 -4
  27. package/dist/cjs/components/badge.d.ts.map +1 -1
  28. package/dist/cjs/components/badge.js +1 -1
  29. package/dist/cjs/components/badge.js.map +4 -4
  30. package/dist/cjs/components/blockquote.js +1 -1
  31. package/dist/cjs/components/blockquote.js.map +4 -4
  32. package/dist/cjs/components/box.js +1 -1
  33. package/dist/cjs/components/box.js.map +4 -4
  34. package/dist/cjs/components/button.js +1 -1
  35. package/dist/cjs/components/button.js.map +4 -4
  36. package/dist/cjs/components/callout.js +1 -1
  37. package/dist/cjs/components/callout.js.map +4 -4
  38. package/dist/cjs/components/card.js +1 -1
  39. package/dist/cjs/components/card.js.map +4 -4
  40. package/dist/cjs/components/chatbar.js +2 -2
  41. package/dist/cjs/components/chatbar.js.map +4 -4
  42. package/dist/cjs/components/checkbox-cards.js +1 -1
  43. package/dist/cjs/components/checkbox-cards.js.map +4 -4
  44. package/dist/cjs/components/checkbox-group.js +1 -1
  45. package/dist/cjs/components/checkbox-group.js.map +4 -4
  46. package/dist/cjs/components/checkbox.js +1 -1
  47. package/dist/cjs/components/checkbox.js.map +4 -4
  48. package/dist/cjs/components/code.js +1 -1
  49. package/dist/cjs/components/code.js.map +4 -4
  50. package/dist/cjs/components/combobox.js +1 -1
  51. package/dist/cjs/components/combobox.js.map +4 -4
  52. package/dist/cjs/components/container.js +1 -1
  53. package/dist/cjs/components/container.js.map +4 -4
  54. package/dist/cjs/components/context-menu.d.ts.map +1 -1
  55. package/dist/cjs/components/context-menu.js +1 -1
  56. package/dist/cjs/components/context-menu.js.map +4 -4
  57. package/dist/cjs/components/data-list.js +1 -1
  58. package/dist/cjs/components/data-list.js.map +4 -4
  59. package/dist/cjs/components/dialog.d.ts.map +1 -1
  60. package/dist/cjs/components/dialog.js +1 -1
  61. package/dist/cjs/components/dialog.js.map +4 -4
  62. package/dist/cjs/components/dropdown-menu.d.ts.map +1 -1
  63. package/dist/cjs/components/dropdown-menu.js +1 -1
  64. package/dist/cjs/components/dropdown-menu.js.map +4 -4
  65. package/dist/cjs/components/em.js +1 -1
  66. package/dist/cjs/components/em.js.map +4 -4
  67. package/dist/cjs/components/flex.js +1 -1
  68. package/dist/cjs/components/flex.js.map +4 -4
  69. package/dist/cjs/components/grid.js +1 -1
  70. package/dist/cjs/components/grid.js.map +4 -4
  71. package/dist/cjs/components/heading.js +1 -1
  72. package/dist/cjs/components/heading.js.map +4 -4
  73. package/dist/cjs/components/hover-card.js +1 -1
  74. package/dist/cjs/components/hover-card.js.map +4 -4
  75. package/dist/cjs/components/icon-button.js +2 -2
  76. package/dist/cjs/components/icon-button.js.map +4 -4
  77. package/dist/cjs/components/image.js +1 -1
  78. package/dist/cjs/components/image.js.map +4 -4
  79. package/dist/cjs/components/index.js +5 -5
  80. package/dist/cjs/components/index.js.map +4 -4
  81. package/dist/cjs/components/inset.js +1 -1
  82. package/dist/cjs/components/inset.js.map +4 -4
  83. package/dist/cjs/components/kbd.js +1 -1
  84. package/dist/cjs/components/kbd.js.map +4 -4
  85. package/dist/cjs/components/link.js +1 -1
  86. package/dist/cjs/components/link.js.map +4 -4
  87. package/dist/cjs/components/navbar.js +1 -1
  88. package/dist/cjs/components/navbar.js.map +4 -4
  89. package/dist/cjs/components/popover.js +1 -1
  90. package/dist/cjs/components/popover.js.map +4 -4
  91. package/dist/cjs/components/progress.js +1 -1
  92. package/dist/cjs/components/progress.js.map +4 -4
  93. package/dist/cjs/components/quote.js +1 -1
  94. package/dist/cjs/components/quote.js.map +4 -4
  95. package/dist/cjs/components/radio-cards.js +1 -1
  96. package/dist/cjs/components/radio-cards.js.map +4 -4
  97. package/dist/cjs/components/radio-group.js +1 -1
  98. package/dist/cjs/components/radio-group.js.map +4 -4
  99. package/dist/cjs/components/radio.js +1 -1
  100. package/dist/cjs/components/radio.js.map +4 -4
  101. package/dist/cjs/components/schemas/base-button.schema.d.ts +2 -2
  102. package/dist/cjs/components/schemas/button.schema.d.ts +2 -2
  103. package/dist/cjs/components/schemas/icon-button.schema.d.ts +4 -4
  104. package/dist/cjs/components/schemas/shell.schema.d.ts +2 -2
  105. package/dist/cjs/components/schemas/toggle-button.schema.d.ts +6 -6
  106. package/dist/cjs/components/schemas/toggle-icon-button.schema.d.ts +8 -8
  107. package/dist/cjs/components/scroll-area.js +1 -1
  108. package/dist/cjs/components/scroll-area.js.map +4 -4
  109. package/dist/cjs/components/section.js +1 -1
  110. package/dist/cjs/components/section.js.map +4 -4
  111. package/dist/cjs/components/segmented-control.js +1 -1
  112. package/dist/cjs/components/segmented-control.js.map +4 -4
  113. package/dist/cjs/components/select.js +1 -1
  114. package/dist/cjs/components/select.js.map +4 -4
  115. package/dist/cjs/components/separator.js +1 -1
  116. package/dist/cjs/components/separator.js.map +4 -4
  117. package/dist/cjs/components/sheet.d.ts.map +1 -1
  118. package/dist/cjs/components/sheet.js +1 -1
  119. package/dist/cjs/components/sheet.js.map +4 -4
  120. package/dist/cjs/components/shell.js +1 -1
  121. package/dist/cjs/components/shell.js.map +4 -4
  122. package/dist/cjs/components/sidebar.js +1 -1
  123. package/dist/cjs/components/sidebar.js.map +4 -4
  124. package/dist/cjs/components/skeleton.js +1 -1
  125. package/dist/cjs/components/skeleton.js.map +4 -4
  126. package/dist/cjs/components/slider.js +1 -1
  127. package/dist/cjs/components/slider.js.map +4 -4
  128. package/dist/cjs/components/spinner.js +1 -1
  129. package/dist/cjs/components/spinner.js.map +4 -4
  130. package/dist/cjs/components/strong.js +1 -1
  131. package/dist/cjs/components/strong.js.map +4 -4
  132. package/dist/cjs/components/switch.js +1 -1
  133. package/dist/cjs/components/switch.js.map +4 -4
  134. package/dist/cjs/components/tab-nav.js +1 -1
  135. package/dist/cjs/components/tab-nav.js.map +4 -4
  136. package/dist/cjs/components/table.js +1 -1
  137. package/dist/cjs/components/table.js.map +4 -4
  138. package/dist/cjs/components/tabs.js +1 -1
  139. package/dist/cjs/components/tabs.js.map +4 -4
  140. package/dist/cjs/components/text-area.js +1 -1
  141. package/dist/cjs/components/text-area.js.map +4 -4
  142. package/dist/cjs/components/text-field.js +2 -2
  143. package/dist/cjs/components/text-field.js.map +4 -4
  144. package/dist/cjs/components/text.js +1 -1
  145. package/dist/cjs/components/text.js.map +4 -4
  146. package/dist/cjs/components/theme-panel.js +3 -3
  147. package/dist/cjs/components/theme-panel.js.map +4 -4
  148. package/dist/cjs/components/theme.d.ts +3 -0
  149. package/dist/cjs/components/theme.d.ts.map +1 -1
  150. package/dist/cjs/components/theme.js +1 -1
  151. package/dist/cjs/components/theme.js.map +4 -4
  152. package/dist/cjs/components/theme.props.d.ts +15 -1
  153. package/dist/cjs/components/theme.props.d.ts.map +1 -1
  154. package/dist/cjs/components/theme.props.js +1 -1
  155. package/dist/cjs/components/theme.props.js.map +2 -2
  156. package/dist/cjs/components/toggle-button.js +2 -2
  157. package/dist/cjs/components/toggle-button.js.map +4 -4
  158. package/dist/cjs/components/toggle-icon-button.js +3 -3
  159. package/dist/cjs/components/toggle-icon-button.js.map +4 -4
  160. package/dist/cjs/components/toolbar.js +1 -1
  161. package/dist/cjs/components/toolbar.js.map +4 -4
  162. package/dist/cjs/components/tooltip.js +1 -1
  163. package/dist/cjs/components/tooltip.js.map +4 -4
  164. package/dist/cjs/components/user-card.js +1 -1
  165. package/dist/cjs/components/user-card.js.map +4 -4
  166. package/dist/cjs/helpers/compile-prop-defs.d.ts +49 -0
  167. package/dist/cjs/helpers/compile-prop-defs.d.ts.map +1 -0
  168. package/dist/cjs/helpers/compile-prop-defs.js +2 -0
  169. package/dist/cjs/helpers/compile-prop-defs.js.map +7 -0
  170. package/dist/cjs/helpers/extract-props.d.ts.map +1 -1
  171. package/dist/cjs/helpers/extract-props.js +1 -1
  172. package/dist/cjs/helpers/extract-props.js.map +4 -4
  173. package/dist/cjs/helpers/font-config.d.ts +84 -77
  174. package/dist/cjs/helpers/font-config.d.ts.map +1 -1
  175. package/dist/cjs/helpers/font-config.js +5 -2
  176. package/dist/cjs/helpers/font-config.js.map +3 -3
  177. package/dist/cjs/helpers/get-margin-styles.d.ts.map +1 -1
  178. package/dist/cjs/helpers/get-margin-styles.js +1 -1
  179. package/dist/cjs/helpers/get-margin-styles.js.map +3 -3
  180. package/dist/cjs/helpers/get-responsive-styles.d.ts +5 -2
  181. package/dist/cjs/helpers/get-responsive-styles.d.ts.map +1 -1
  182. package/dist/cjs/helpers/get-responsive-styles.js +1 -1
  183. package/dist/cjs/helpers/get-responsive-styles.js.map +3 -3
  184. package/dist/cjs/helpers/index.js +5 -2
  185. package/dist/cjs/helpers/index.js.map +4 -4
  186. package/dist/cjs/helpers/use-deprecation-warning.d.ts +10 -0
  187. package/dist/cjs/helpers/use-deprecation-warning.d.ts.map +1 -0
  188. package/dist/cjs/helpers/use-deprecation-warning.js +2 -0
  189. package/dist/cjs/helpers/use-deprecation-warning.js.map +7 -0
  190. package/dist/cjs/hooks/index.js +2 -2
  191. package/dist/cjs/hooks/index.js.map +3 -3
  192. package/dist/cjs/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
  193. package/dist/cjs/hooks/use-body-pointer-events-cleanup.js +1 -1
  194. package/dist/cjs/hooks/use-body-pointer-events-cleanup.js.map +3 -3
  195. package/dist/cjs/hooks/use-breakpoint.d.ts +7 -3
  196. package/dist/cjs/hooks/use-breakpoint.d.ts.map +1 -1
  197. package/dist/cjs/hooks/use-breakpoint.js +1 -1
  198. package/dist/cjs/hooks/use-breakpoint.js.map +3 -3
  199. package/dist/cjs/hooks/use-prop-synced-state.d.ts +14 -0
  200. package/dist/cjs/hooks/use-prop-synced-state.d.ts.map +1 -0
  201. package/dist/cjs/hooks/use-prop-synced-state.js +2 -0
  202. package/dist/cjs/hooks/use-prop-synced-state.js.map +7 -0
  203. package/dist/cjs/index.js +5 -5
  204. package/dist/cjs/index.js.map +4 -4
  205. package/dist/cjs/props/index.js +1 -1
  206. package/dist/cjs/props/index.js.map +2 -2
  207. package/dist/esm/{chunk-WYA4IRU6.js → chunk-25WZA7ZU.js} +2 -2
  208. package/dist/esm/{chunk-ARGX2ZZK.js → chunk-2FYJTSOP.js} +2 -2
  209. package/dist/esm/chunk-2UPAYDKR.js +2 -0
  210. package/dist/esm/chunk-2UPAYDKR.js.map +7 -0
  211. package/dist/esm/chunk-374ZYJUP.js +2 -0
  212. package/dist/esm/chunk-374ZYJUP.js.map +7 -0
  213. package/dist/esm/{chunk-K3R4AH3E.js → chunk-3MWWP4MW.js} +2 -2
  214. package/dist/esm/{chunk-HQ35PM4O.js → chunk-43A5GUSI.js} +2 -2
  215. package/dist/esm/{chunk-Z5DQ6FSA.js → chunk-4AQTUBVP.js} +2 -2
  216. package/dist/esm/{chunk-QLIELX4I.js → chunk-4ME6O27S.js} +2 -2
  217. package/dist/esm/chunk-4XJY6FIK.js +2 -0
  218. package/dist/esm/chunk-4XJY6FIK.js.map +7 -0
  219. package/dist/esm/{chunk-JQOFJNCV.js → chunk-4YFJWXL2.js} +2 -2
  220. package/dist/esm/chunk-5TXQLK4G.js +2 -0
  221. package/dist/esm/chunk-5TXQLK4G.js.map +7 -0
  222. package/dist/esm/{chunk-IPJUHVM6.js → chunk-666GX7O5.js} +2 -2
  223. package/dist/esm/chunk-6FLLFCBU.js +2 -0
  224. package/dist/esm/chunk-6FLLFCBU.js.map +7 -0
  225. package/dist/esm/{chunk-7CBAHIVG.js → chunk-6IGTK4JE.js} +2 -2
  226. package/dist/esm/chunk-6XGZPIUT.js +2 -0
  227. package/dist/esm/{chunk-T27QHMW7.js.map → chunk-6XGZPIUT.js.map} +2 -2
  228. package/dist/esm/{chunk-DJBPM5QK.js → chunk-7FC7HF76.js} +2 -2
  229. package/dist/esm/{chunk-SVLY6B5F.js → chunk-7QDTSBJF.js} +2 -2
  230. package/dist/esm/{chunk-7MURQ6CR.js → chunk-A2RZGGMY.js} +2 -2
  231. package/dist/esm/{chunk-VF5TRT3H.js → chunk-AU3D6F42.js} +2 -2
  232. package/dist/esm/chunk-AX5S56DS.js +2 -0
  233. package/dist/esm/chunk-AX5S56DS.js.map +7 -0
  234. package/dist/esm/{chunk-DK5MHD6I.js → chunk-B24BDVG2.js} +2 -2
  235. package/dist/esm/{chunk-BJTJUIYJ.js → chunk-CRWYCLTE.js} +2 -2
  236. package/dist/esm/{chunk-OHJVFZMH.js → chunk-CSKZZOI2.js} +2 -2
  237. package/dist/esm/{chunk-4N5JU7XQ.js → chunk-CVWCKOHO.js} +2 -2
  238. package/dist/esm/chunk-CWRNW44F.js +2 -0
  239. package/dist/esm/chunk-CWRNW44F.js.map +7 -0
  240. package/dist/esm/{chunk-ADYTQCZX.js → chunk-D6B7IMZU.js} +2 -2
  241. package/dist/esm/{chunk-U7AASKZI.js → chunk-DNHUQLXO.js} +2 -2
  242. package/dist/esm/{chunk-USGTBZ43.js → chunk-E67CIG6A.js} +2 -2
  243. package/dist/esm/{chunk-YUZPSUJE.js → chunk-F7IYL2VW.js} +2 -2
  244. package/dist/esm/{chunk-FVCWNSRU.js → chunk-FHOCUZDR.js} +2 -2
  245. package/dist/esm/{chunk-APRBRAOT.js → chunk-FXUUI6Z2.js} +2 -2
  246. package/dist/esm/{chunk-WNSPLWRV.js → chunk-GJSGKE7B.js} +2 -2
  247. package/dist/esm/{chunk-OGOOZLUD.js → chunk-GLERJXVS.js} +2 -2
  248. package/dist/esm/{chunk-6VGPTAHM.js → chunk-GWXVETMF.js} +2 -2
  249. package/dist/esm/{chunk-ES7MK2MM.js → chunk-GYBLXQ4R.js} +2 -2
  250. package/dist/esm/{chunk-4OBMRJHC.js → chunk-H7ST535H.js} +2 -2
  251. package/dist/esm/{chunk-QLZ5XAW6.js → chunk-HF5WY5YE.js} +2 -2
  252. package/dist/esm/{chunk-RDP4UQ42.js → chunk-IEWCQU2S.js} +2 -2
  253. package/dist/esm/{chunk-XLOHPURR.js → chunk-IHK3H2OM.js} +2 -2
  254. package/dist/esm/{chunk-EJWAAFCI.js → chunk-IKSN4RNB.js} +2 -2
  255. package/dist/esm/{chunk-3F6I7YOR.js → chunk-JDGJSNWT.js} +2 -2
  256. package/dist/esm/chunk-JUY7CBSL.js +2 -0
  257. package/dist/esm/chunk-JUY7CBSL.js.map +7 -0
  258. package/dist/esm/{chunk-ZSEFZM5H.js → chunk-K6QZMNCD.js} +2 -2
  259. package/dist/esm/chunk-KKBP2CRH.js +2 -0
  260. package/dist/esm/chunk-KKBP2CRH.js.map +7 -0
  261. package/dist/esm/{chunk-ZHYOJNWV.js → chunk-LKAK5GXF.js} +2 -2
  262. package/dist/esm/{chunk-GWYFT3EI.js → chunk-M24UXMOQ.js} +2 -2
  263. package/dist/esm/{chunk-JCYI4NTV.js → chunk-MBCBP73P.js} +2 -2
  264. package/dist/esm/{chunk-UYNYUR7O.js → chunk-MBE2YSBU.js} +2 -2
  265. package/dist/esm/chunk-MHANZINI.js +2 -0
  266. package/dist/esm/chunk-MHANZINI.js.map +7 -0
  267. package/dist/esm/chunk-MK2R6DAU.js +2 -0
  268. package/dist/esm/chunk-MK2R6DAU.js.map +7 -0
  269. package/dist/esm/{chunk-DNI4QRXQ.js → chunk-MOR3NSXQ.js} +2 -2
  270. package/dist/esm/{chunk-H2G446JG.js → chunk-NMKPFUNP.js} +2 -2
  271. package/dist/esm/{chunk-TEULZKBM.js → chunk-OGXZHAQL.js} +2 -2
  272. package/dist/esm/{chunk-M3ZYJANH.js → chunk-OSRJRBKP.js} +2 -2
  273. package/dist/esm/{chunk-2AEELIG6.js → chunk-OWAUCLRT.js} +2 -2
  274. package/dist/esm/{chunk-7CXVHFMQ.js → chunk-P7HYVJSU.js} +2 -2
  275. package/dist/esm/{chunk-4532RT2B.js → chunk-P7IAHW4V.js} +2 -2
  276. package/dist/esm/{chunk-GLC4QJBF.js → chunk-PLWXTEVE.js} +2 -2
  277. package/dist/esm/{chunk-SGU4HUHF.js → chunk-PTLFMWCN.js} +2 -2
  278. package/dist/esm/{chunk-QOWA5LK5.js → chunk-QEOAXJLN.js} +2 -2
  279. package/dist/esm/{chunk-XHQGMOXV.js → chunk-RMKXWYOV.js} +2 -2
  280. package/dist/esm/chunk-S2HA3W3V.js +2 -0
  281. package/dist/esm/chunk-S2HA3W3V.js.map +7 -0
  282. package/dist/esm/{chunk-WZCZHCVE.js → chunk-S56YSRHP.js} +2 -2
  283. package/dist/esm/{chunk-E6IWYD3U.js → chunk-S5C5YRBS.js} +2 -2
  284. package/dist/esm/{chunk-A24PYRVV.js → chunk-SO67YEVQ.js} +2 -2
  285. package/dist/esm/chunk-TLWTUKKL.js +2 -0
  286. package/dist/esm/chunk-TLWTUKKL.js.map +7 -0
  287. package/dist/esm/{chunk-RQ2ZPMHJ.js → chunk-TOLLPRMM.js} +2 -2
  288. package/dist/esm/{chunk-HACQF6F4.js → chunk-TOOSHJOA.js} +2 -2
  289. package/dist/esm/{chunk-42HFGCHX.js → chunk-UGD7Z3L4.js} +2 -2
  290. package/dist/esm/chunk-VA5A4MHU.js +6 -0
  291. package/dist/esm/chunk-VA5A4MHU.js.map +7 -0
  292. package/dist/esm/{chunk-DXI5P5O4.js → chunk-VX6ARMWP.js} +2 -2
  293. package/dist/esm/{chunk-25U7DENY.js → chunk-W7N7V5YD.js} +2 -2
  294. package/dist/esm/chunk-WAURCNAS.js +2 -0
  295. package/dist/esm/chunk-WAURCNAS.js.map +7 -0
  296. package/dist/esm/chunk-WFMYNZXZ.js +2 -0
  297. package/dist/esm/chunk-WFMYNZXZ.js.map +7 -0
  298. package/dist/esm/{chunk-6FAICIYS.js → chunk-XMRIRFM7.js} +2 -2
  299. package/dist/esm/chunk-YEB3H7QN.js +2 -0
  300. package/dist/esm/chunk-YEB3H7QN.js.map +7 -0
  301. package/dist/esm/chunk-YUP6EICB.js +2 -0
  302. package/dist/esm/chunk-YUP6EICB.js.map +7 -0
  303. package/dist/esm/chunk-YV2KYHGR.js +2 -0
  304. package/dist/esm/chunk-YV2KYHGR.js.map +7 -0
  305. package/dist/esm/{chunk-UIEUZLZZ.js → chunk-ZY6SQWHT.js} +2 -2
  306. package/dist/esm/components/_internal/base-button.d.ts.map +1 -1
  307. package/dist/esm/components/_internal/base-button.js +1 -1
  308. package/dist/esm/components/_internal/dropdown-menu-drill-down.js +1 -1
  309. package/dist/esm/components/_internal/shell-bottom.js +1 -1
  310. package/dist/esm/components/_internal/shell-handles.d.ts.map +1 -1
  311. package/dist/esm/components/_internal/shell-handles.js +1 -1
  312. package/dist/esm/components/_internal/shell-inspector.js +1 -1
  313. package/dist/esm/components/_internal/shell-sidebar.js +1 -1
  314. package/dist/esm/components/accordion.d.ts.map +1 -1
  315. package/dist/esm/components/accordion.js +1 -1
  316. package/dist/esm/components/alert-dialog.d.ts.map +1 -1
  317. package/dist/esm/components/alert-dialog.js +1 -1
  318. package/dist/esm/components/avatar.js +1 -1
  319. package/dist/esm/components/badge.d.ts.map +1 -1
  320. package/dist/esm/components/badge.js +1 -1
  321. package/dist/esm/components/blockquote.js +1 -1
  322. package/dist/esm/components/box.js +1 -1
  323. package/dist/esm/components/button.js +1 -1
  324. package/dist/esm/components/callout.js +1 -1
  325. package/dist/esm/components/card.js +1 -1
  326. package/dist/esm/components/chatbar.js +1 -1
  327. package/dist/esm/components/checkbox-cards.js +1 -1
  328. package/dist/esm/components/checkbox-group.js +1 -1
  329. package/dist/esm/components/checkbox.js +1 -1
  330. package/dist/esm/components/code.js +1 -1
  331. package/dist/esm/components/combobox.js +1 -1
  332. package/dist/esm/components/container.js +1 -1
  333. package/dist/esm/components/context-menu.d.ts.map +1 -1
  334. package/dist/esm/components/context-menu.js +1 -1
  335. package/dist/esm/components/data-list.js +1 -1
  336. package/dist/esm/components/dialog.d.ts.map +1 -1
  337. package/dist/esm/components/dialog.js +1 -1
  338. package/dist/esm/components/dropdown-menu.d.ts.map +1 -1
  339. package/dist/esm/components/dropdown-menu.js +1 -1
  340. package/dist/esm/components/em.js +1 -1
  341. package/dist/esm/components/flex.js +1 -1
  342. package/dist/esm/components/grid.js +1 -1
  343. package/dist/esm/components/heading.js +1 -1
  344. package/dist/esm/components/hover-card.js +1 -1
  345. package/dist/esm/components/icon-button.js +1 -1
  346. package/dist/esm/components/image.js +1 -1
  347. package/dist/esm/components/index.js +1 -1
  348. package/dist/esm/components/inset.js +1 -1
  349. package/dist/esm/components/kbd.js +1 -1
  350. package/dist/esm/components/link.js +1 -1
  351. package/dist/esm/components/navbar.js +1 -1
  352. package/dist/esm/components/popover.js +1 -1
  353. package/dist/esm/components/progress.js +1 -1
  354. package/dist/esm/components/quote.js +1 -1
  355. package/dist/esm/components/radio-cards.js +1 -1
  356. package/dist/esm/components/radio-group.js +1 -1
  357. package/dist/esm/components/radio.js +1 -1
  358. package/dist/esm/components/schemas/base-button.schema.d.ts +2 -2
  359. package/dist/esm/components/schemas/button.schema.d.ts +2 -2
  360. package/dist/esm/components/schemas/icon-button.schema.d.ts +4 -4
  361. package/dist/esm/components/schemas/shell.schema.d.ts +2 -2
  362. package/dist/esm/components/schemas/toggle-button.schema.d.ts +6 -6
  363. package/dist/esm/components/schemas/toggle-icon-button.schema.d.ts +8 -8
  364. package/dist/esm/components/scroll-area.js +1 -1
  365. package/dist/esm/components/section.js +1 -1
  366. package/dist/esm/components/segmented-control.js +1 -1
  367. package/dist/esm/components/select.js +1 -1
  368. package/dist/esm/components/separator.js +1 -1
  369. package/dist/esm/components/sheet.d.ts.map +1 -1
  370. package/dist/esm/components/sheet.js +1 -1
  371. package/dist/esm/components/shell.js +1 -1
  372. package/dist/esm/components/sidebar.js +1 -1
  373. package/dist/esm/components/skeleton.js +1 -1
  374. package/dist/esm/components/slider.js +1 -1
  375. package/dist/esm/components/spinner.js +1 -1
  376. package/dist/esm/components/strong.js +1 -1
  377. package/dist/esm/components/switch.js +1 -1
  378. package/dist/esm/components/tab-nav.js +1 -1
  379. package/dist/esm/components/table.js +1 -1
  380. package/dist/esm/components/tabs.js +1 -1
  381. package/dist/esm/components/text-area.js +1 -1
  382. package/dist/esm/components/text-field.js +1 -1
  383. package/dist/esm/components/text.js +1 -1
  384. package/dist/esm/components/theme-panel.js +1 -1
  385. package/dist/esm/components/theme.d.ts +3 -0
  386. package/dist/esm/components/theme.d.ts.map +1 -1
  387. package/dist/esm/components/theme.js +1 -1
  388. package/dist/esm/components/theme.props.d.ts +15 -1
  389. package/dist/esm/components/theme.props.d.ts.map +1 -1
  390. package/dist/esm/components/theme.props.js +1 -1
  391. package/dist/esm/components/toggle-button.js +1 -1
  392. package/dist/esm/components/toggle-icon-button.js +1 -1
  393. package/dist/esm/components/toolbar.js +1 -1
  394. package/dist/esm/components/tooltip.js +1 -1
  395. package/dist/esm/components/user-card.js +1 -1
  396. package/dist/esm/helpers/compile-prop-defs.d.ts +49 -0
  397. package/dist/esm/helpers/compile-prop-defs.d.ts.map +1 -0
  398. package/dist/esm/helpers/compile-prop-defs.js +2 -0
  399. package/dist/esm/helpers/compile-prop-defs.js.map +7 -0
  400. package/dist/esm/helpers/extract-props.d.ts.map +1 -1
  401. package/dist/esm/helpers/extract-props.js +1 -1
  402. package/dist/esm/helpers/font-config.d.ts +84 -77
  403. package/dist/esm/helpers/font-config.d.ts.map +1 -1
  404. package/dist/esm/helpers/font-config.js +1 -1
  405. package/dist/esm/helpers/get-margin-styles.d.ts.map +1 -1
  406. package/dist/esm/helpers/get-margin-styles.js +1 -1
  407. package/dist/esm/helpers/get-responsive-styles.d.ts +5 -2
  408. package/dist/esm/helpers/get-responsive-styles.d.ts.map +1 -1
  409. package/dist/esm/helpers/get-responsive-styles.js +1 -1
  410. package/dist/esm/helpers/index.js +1 -1
  411. package/dist/esm/helpers/use-deprecation-warning.d.ts +10 -0
  412. package/dist/esm/helpers/use-deprecation-warning.d.ts.map +1 -0
  413. package/dist/esm/helpers/use-deprecation-warning.js +2 -0
  414. package/dist/esm/helpers/use-deprecation-warning.js.map +7 -0
  415. package/dist/esm/hooks/index.js +1 -1
  416. package/dist/esm/hooks/use-body-pointer-events-cleanup.d.ts.map +1 -1
  417. package/dist/esm/hooks/use-body-pointer-events-cleanup.js +1 -1
  418. package/dist/esm/hooks/use-breakpoint.d.ts +7 -3
  419. package/dist/esm/hooks/use-breakpoint.d.ts.map +1 -1
  420. package/dist/esm/hooks/use-breakpoint.js +1 -1
  421. package/dist/esm/hooks/use-prop-synced-state.d.ts +14 -0
  422. package/dist/esm/hooks/use-prop-synced-state.d.ts.map +1 -0
  423. package/dist/esm/hooks/use-prop-synced-state.js +2 -0
  424. package/dist/esm/hooks/use-prop-synced-state.js.map +7 -0
  425. package/dist/esm/index.js +1 -1
  426. package/dist/esm/props/index.js +1 -1
  427. package/fonts.css +8 -0
  428. package/package.json +18 -7
  429. package/schemas/base-button.json +0 -1
  430. package/schemas/button.json +0 -1
  431. package/schemas/icon-button.json +0 -1
  432. package/schemas/index.json +0 -6
  433. package/schemas/toggle-button.json +0 -1
  434. package/schemas/toggle-icon-button.json +0 -1
  435. package/src/components/_internal/base-button.css +2 -2
  436. package/src/components/_internal/base-button.tsx +3 -58
  437. package/src/components/_internal/base-card.css +19 -4
  438. package/src/components/_internal/base-checkbox.css +2 -2
  439. package/src/components/_internal/base-dialog.css +7 -0
  440. package/src/components/_internal/base-menu.css +7 -0
  441. package/src/components/_internal/base-radio.css +2 -2
  442. package/src/components/_internal/base-sidebar.css +7 -0
  443. package/src/components/_internal/base-tab-list.css +2 -2
  444. package/src/components/_internal/shell-handles.tsx +27 -0
  445. package/src/components/accordion.css +6 -6
  446. package/src/components/accordion.tsx +2 -8
  447. package/src/components/alert-dialog.tsx +22 -20
  448. package/src/components/avatar.css +2 -2
  449. package/src/components/badge.css +2 -2
  450. package/src/components/badge.tsx +2 -8
  451. package/src/components/callout.css +2 -2
  452. package/src/components/chatbar.css +1 -1
  453. package/src/components/context-menu.tsx +2 -8
  454. package/src/components/dialog.tsx +22 -20
  455. package/src/components/dropdown-menu.tsx +2 -8
  456. package/src/components/heading.css +10 -3
  457. package/src/components/popover.css +7 -0
  458. package/src/components/progress.css +21 -8
  459. package/src/components/segmented-control.css +2 -2
  460. package/src/components/select.css +9 -2
  461. package/src/components/sheet.tsx +31 -28
  462. package/src/components/shell.css +106 -69
  463. package/src/components/slider.css +2 -2
  464. package/src/components/switch.css +2 -2
  465. package/src/components/table.css +7 -0
  466. package/src/components/text-area.css +2 -2
  467. package/src/components/text-field.css +2 -2
  468. package/src/components/text.css +10 -3
  469. package/src/components/theme.props.tsx +13 -1
  470. package/src/components/theme.tsx +53 -34
  471. package/src/helpers/compile-prop-defs.ts +121 -0
  472. package/src/helpers/extract-props.ts +104 -83
  473. package/src/helpers/font-config.ts +130 -148
  474. package/src/helpers/get-margin-styles.ts +38 -71
  475. package/src/helpers/get-responsive-styles.ts +37 -38
  476. package/src/helpers/use-deprecation-warning.ts +26 -0
  477. package/src/hooks/use-body-pointer-events-cleanup.ts +36 -6
  478. package/src/hooks/use-breakpoint.ts +94 -53
  479. package/src/hooks/use-prop-synced-state.ts +24 -0
  480. package/src/styles/fonts.css +24 -29
  481. package/src/styles/index.css +0 -1
  482. package/src/styles/tokens/base.css +1 -0
  483. package/src/styles/tokens/blur.css +28 -0
  484. package/src/styles/tokens/color.css +3 -3
  485. package/src/styles/tokens/constants.css +11 -0
  486. package/src/styles/tokens/font-family.css +263 -0
  487. package/src/styles/tokens/typography.css +2 -216
  488. package/styles.css +8776 -8727
  489. package/tokens/base.css +50 -30
  490. package/tokens.css +53 -30
  491. package/dist/esm/chunk-2SS3FA3N.js +0 -2
  492. package/dist/esm/chunk-2SS3FA3N.js.map +0 -7
  493. package/dist/esm/chunk-5U2Q23K3.js +0 -2
  494. package/dist/esm/chunk-5U2Q23K3.js.map +0 -7
  495. package/dist/esm/chunk-6ELPYR73.js +0 -2
  496. package/dist/esm/chunk-6ELPYR73.js.map +0 -7
  497. package/dist/esm/chunk-DZ4H2KTP.js +0 -2
  498. package/dist/esm/chunk-DZ4H2KTP.js.map +0 -7
  499. package/dist/esm/chunk-H4MMVAGQ.js +0 -2
  500. package/dist/esm/chunk-H4MMVAGQ.js.map +0 -7
  501. package/dist/esm/chunk-ITRVKLYU.js +0 -2
  502. package/dist/esm/chunk-ITRVKLYU.js.map +0 -7
  503. package/dist/esm/chunk-KCAFSCOV.js +0 -2
  504. package/dist/esm/chunk-KCAFSCOV.js.map +0 -7
  505. package/dist/esm/chunk-KMPBTEZH.js +0 -2
  506. package/dist/esm/chunk-KMPBTEZH.js.map +0 -7
  507. package/dist/esm/chunk-LN5SP46K.js +0 -2
  508. package/dist/esm/chunk-LN5SP46K.js.map +0 -7
  509. package/dist/esm/chunk-OKJNS7Z7.js +0 -2
  510. package/dist/esm/chunk-OKJNS7Z7.js.map +0 -7
  511. package/dist/esm/chunk-Q73Y5O5P.js +0 -2
  512. package/dist/esm/chunk-Q73Y5O5P.js.map +0 -7
  513. package/dist/esm/chunk-Q7P6BTVU.js +0 -3
  514. package/dist/esm/chunk-Q7P6BTVU.js.map +0 -7
  515. package/dist/esm/chunk-T27QHMW7.js +0 -2
  516. package/dist/esm/chunk-UUX42HBM.js +0 -2
  517. package/dist/esm/chunk-UUX42HBM.js.map +0 -7
  518. package/dist/esm/chunk-X7BD5FLE.js +0 -2
  519. package/dist/esm/chunk-X7BD5FLE.js.map +0 -7
  520. package/dist/esm/chunk-YEA646GM.js +0 -2
  521. package/dist/esm/chunk-YEA646GM.js.map +0 -7
  522. package/dist/esm/chunk-ZMEXIPWM.js +0 -2
  523. package/dist/esm/chunk-ZMEXIPWM.js.map +0 -7
  524. /package/dist/esm/{chunk-WYA4IRU6.js.map → chunk-25WZA7ZU.js.map} +0 -0
  525. /package/dist/esm/{chunk-ARGX2ZZK.js.map → chunk-2FYJTSOP.js.map} +0 -0
  526. /package/dist/esm/{chunk-K3R4AH3E.js.map → chunk-3MWWP4MW.js.map} +0 -0
  527. /package/dist/esm/{chunk-HQ35PM4O.js.map → chunk-43A5GUSI.js.map} +0 -0
  528. /package/dist/esm/{chunk-Z5DQ6FSA.js.map → chunk-4AQTUBVP.js.map} +0 -0
  529. /package/dist/esm/{chunk-QLIELX4I.js.map → chunk-4ME6O27S.js.map} +0 -0
  530. /package/dist/esm/{chunk-JQOFJNCV.js.map → chunk-4YFJWXL2.js.map} +0 -0
  531. /package/dist/esm/{chunk-IPJUHVM6.js.map → chunk-666GX7O5.js.map} +0 -0
  532. /package/dist/esm/{chunk-7CBAHIVG.js.map → chunk-6IGTK4JE.js.map} +0 -0
  533. /package/dist/esm/{chunk-DJBPM5QK.js.map → chunk-7FC7HF76.js.map} +0 -0
  534. /package/dist/esm/{chunk-SVLY6B5F.js.map → chunk-7QDTSBJF.js.map} +0 -0
  535. /package/dist/esm/{chunk-7MURQ6CR.js.map → chunk-A2RZGGMY.js.map} +0 -0
  536. /package/dist/esm/{chunk-VF5TRT3H.js.map → chunk-AU3D6F42.js.map} +0 -0
  537. /package/dist/esm/{chunk-DK5MHD6I.js.map → chunk-B24BDVG2.js.map} +0 -0
  538. /package/dist/esm/{chunk-BJTJUIYJ.js.map → chunk-CRWYCLTE.js.map} +0 -0
  539. /package/dist/esm/{chunk-OHJVFZMH.js.map → chunk-CSKZZOI2.js.map} +0 -0
  540. /package/dist/esm/{chunk-4N5JU7XQ.js.map → chunk-CVWCKOHO.js.map} +0 -0
  541. /package/dist/esm/{chunk-ADYTQCZX.js.map → chunk-D6B7IMZU.js.map} +0 -0
  542. /package/dist/esm/{chunk-U7AASKZI.js.map → chunk-DNHUQLXO.js.map} +0 -0
  543. /package/dist/esm/{chunk-USGTBZ43.js.map → chunk-E67CIG6A.js.map} +0 -0
  544. /package/dist/esm/{chunk-YUZPSUJE.js.map → chunk-F7IYL2VW.js.map} +0 -0
  545. /package/dist/esm/{chunk-FVCWNSRU.js.map → chunk-FHOCUZDR.js.map} +0 -0
  546. /package/dist/esm/{chunk-APRBRAOT.js.map → chunk-FXUUI6Z2.js.map} +0 -0
  547. /package/dist/esm/{chunk-WNSPLWRV.js.map → chunk-GJSGKE7B.js.map} +0 -0
  548. /package/dist/esm/{chunk-OGOOZLUD.js.map → chunk-GLERJXVS.js.map} +0 -0
  549. /package/dist/esm/{chunk-6VGPTAHM.js.map → chunk-GWXVETMF.js.map} +0 -0
  550. /package/dist/esm/{chunk-ES7MK2MM.js.map → chunk-GYBLXQ4R.js.map} +0 -0
  551. /package/dist/esm/{chunk-4OBMRJHC.js.map → chunk-H7ST535H.js.map} +0 -0
  552. /package/dist/esm/{chunk-QLZ5XAW6.js.map → chunk-HF5WY5YE.js.map} +0 -0
  553. /package/dist/esm/{chunk-RDP4UQ42.js.map → chunk-IEWCQU2S.js.map} +0 -0
  554. /package/dist/esm/{chunk-XLOHPURR.js.map → chunk-IHK3H2OM.js.map} +0 -0
  555. /package/dist/esm/{chunk-EJWAAFCI.js.map → chunk-IKSN4RNB.js.map} +0 -0
  556. /package/dist/esm/{chunk-3F6I7YOR.js.map → chunk-JDGJSNWT.js.map} +0 -0
  557. /package/dist/esm/{chunk-ZSEFZM5H.js.map → chunk-K6QZMNCD.js.map} +0 -0
  558. /package/dist/esm/{chunk-ZHYOJNWV.js.map → chunk-LKAK5GXF.js.map} +0 -0
  559. /package/dist/esm/{chunk-GWYFT3EI.js.map → chunk-M24UXMOQ.js.map} +0 -0
  560. /package/dist/esm/{chunk-JCYI4NTV.js.map → chunk-MBCBP73P.js.map} +0 -0
  561. /package/dist/esm/{chunk-UYNYUR7O.js.map → chunk-MBE2YSBU.js.map} +0 -0
  562. /package/dist/esm/{chunk-DNI4QRXQ.js.map → chunk-MOR3NSXQ.js.map} +0 -0
  563. /package/dist/esm/{chunk-H2G446JG.js.map → chunk-NMKPFUNP.js.map} +0 -0
  564. /package/dist/esm/{chunk-TEULZKBM.js.map → chunk-OGXZHAQL.js.map} +0 -0
  565. /package/dist/esm/{chunk-M3ZYJANH.js.map → chunk-OSRJRBKP.js.map} +0 -0
  566. /package/dist/esm/{chunk-2AEELIG6.js.map → chunk-OWAUCLRT.js.map} +0 -0
  567. /package/dist/esm/{chunk-7CXVHFMQ.js.map → chunk-P7HYVJSU.js.map} +0 -0
  568. /package/dist/esm/{chunk-4532RT2B.js.map → chunk-P7IAHW4V.js.map} +0 -0
  569. /package/dist/esm/{chunk-GLC4QJBF.js.map → chunk-PLWXTEVE.js.map} +0 -0
  570. /package/dist/esm/{chunk-SGU4HUHF.js.map → chunk-PTLFMWCN.js.map} +0 -0
  571. /package/dist/esm/{chunk-QOWA5LK5.js.map → chunk-QEOAXJLN.js.map} +0 -0
  572. /package/dist/esm/{chunk-XHQGMOXV.js.map → chunk-RMKXWYOV.js.map} +0 -0
  573. /package/dist/esm/{chunk-WZCZHCVE.js.map → chunk-S56YSRHP.js.map} +0 -0
  574. /package/dist/esm/{chunk-E6IWYD3U.js.map → chunk-S5C5YRBS.js.map} +0 -0
  575. /package/dist/esm/{chunk-A24PYRVV.js.map → chunk-SO67YEVQ.js.map} +0 -0
  576. /package/dist/esm/{chunk-RQ2ZPMHJ.js.map → chunk-TOLLPRMM.js.map} +0 -0
  577. /package/dist/esm/{chunk-HACQF6F4.js.map → chunk-TOOSHJOA.js.map} +0 -0
  578. /package/dist/esm/{chunk-42HFGCHX.js.map → chunk-UGD7Z3L4.js.map} +0 -0
  579. /package/dist/esm/{chunk-DXI5P5O4.js.map → chunk-VX6ARMWP.js.map} +0 -0
  580. /package/dist/esm/{chunk-25U7DENY.js.map → chunk-W7N7V5YD.js.map} +0 -0
  581. /package/dist/esm/{chunk-6FAICIYS.js.map → chunk-XMRIRFM7.js.map} +0 -0
  582. /package/dist/esm/{chunk-UIEUZLZZ.js.map → chunk-ZY6SQWHT.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/components/card.tsx", "../../../src/props/as-child.prop.ts", "../../../src/components/card.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/margin.props.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n", "import classNames from 'classnames';\n\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef>\n ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T]\n : never;\n\nfunction mergePropDefs<T extends Record<string, PropDef>[]>(...args: T): Record<string, PropDef> {\n return Object.assign({}, ...args);\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<\n P extends { className?: string; style?: React.CSSProperties; [key: string]: any },\n T extends Record<string, PropDef>[]\n>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n let className: string | undefined;\n let style: ReturnType<typeof mergeStyles>;\n const extractedProps = { ...props };\n const allPropDefs = mergePropDefs(...propDefs);\n\n for (const key in allPropDefs) {\n let value = extractedProps[key];\n const propDef = allPropDefs[key];\n\n // Apply prop def defaults\n if (propDef.default !== undefined && value === undefined) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.type === 'enum') {\n const values = [propDef.default, ...propDef.values];\n\n if (!values.includes(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n }\n\n // Apply the value with defaults\n (extractedProps as Record<string, any>)[key] = value;\n\n if ('className' in propDef && propDef.className) {\n delete extractedProps[key];\n\n const isResponsivePropDef = 'responsive' in propDef;\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!value || (isResponsiveObject(value) && !isResponsivePropDef)) {\n continue;\n }\n\n if (isResponsiveObject(value)) {\n // Apply prop def defaults to the `initial` breakpoint\n if (propDef.default !== undefined && value.initial === undefined) {\n value.initial = propDef.default;\n }\n\n // Apply the default value to the `initial` breakpoint when it is not a valid enum value\n if (propDef.type === 'enum') {\n const values = [propDef.default, ...propDef.values];\n\n if (!values.includes(value.initial)) {\n value.initial = propDef.default;\n }\n }\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className,\n propValues: propDef.values,\n parseValue: propDef.parseValue,\n });\n\n className = classNames(className, propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const propDefValues = propDef.type === 'string' ? [] : propDef.values;\n\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className,\n customProperties: propDef.customProperties,\n propValues: propDefValues,\n parseValue: propDef.parseValue,\n value,\n });\n\n style = mergeStyles(style, propCustomProperties);\n className = classNames(className, propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean' && value) {\n // TODO handle responsive boolean props\n className = classNames(className, propDef.className);\n continue;\n }\n }\n }\n\n extractedProps.className = classNames(className, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps;\n}\n\nexport { extractProps };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({\n allowArbitraryValues,\n value,\n className,\n propValues,\n parseValue = (value) => value,\n}: GetResponsiveClassNamesOptions): string | undefined {\n const classNames: string[] = [];\n\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string' && propValues.includes(value)) {\n return getBaseClassName(className, value, parseValue);\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (propValues.includes(value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.join(' ');\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(\n className: string,\n value: string,\n parseValue: (value: string) => string | undefined\n): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({\n customProperties,\n value,\n propValues,\n parseValue = (value) => value,\n}: GetResponsiveCustomPropertiesOptions) {\n let styles: Record<string, string | undefined> = {};\n\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && propValues.includes(value))) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n styles = Object.fromEntries(customProperties.map((prop) => [prop, value]));\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (propValues.includes(value)) {\n continue;\n }\n\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = value;\n }\n }\n }\n\n for (const key in styles) {\n const value = styles[key];\n if (value !== undefined) {\n styles[key] = parseValue(value);\n }\n }\n\n return styles;\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBCArB,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECNA,IAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQL,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,CAC3C,ECjBA,IAAAG,EAAuB,yBCMvB,IAAMC,EAAc,CAAC,UAAW,KAAM,KAAM,KAAM,KAAM,IAAI,EACtDC,EAA6B,IAAI,IAAID,CAAW,ECNtD,SAASE,EACPC,EACAC,EACU,CACV,OAAO,OAAO,UAAU,eAAe,KAAKD,EAAKC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,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,EAaA,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,EAaA,GAAI,CACF,KAAM,gBACN,OAAQA,EACR,WAAY,GACZ,UAAW,UACX,iBAAkB,CAAC,MAAM,CAC3B,CACF,ET9HA,IAAME,EAAa,aAAmC,CAACC,EAAOC,IAAiB,CAC7E,GAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAU,EAAIC,EACpFT,EACAU,EACAC,CACF,EACMC,EAAoBP,GAAYD,EAChCS,EAAOX,EAAU,OAAK,KAAO,MACnC,OACE,gBAACW,EAAA,CACC,IAAKZ,EACJ,GAAGO,EACJ,wBAAuBI,EACvB,gBAAeA,EACf,aAAYN,EAAQ,OAAS,OAC7B,aAAYC,EAAQ,OAAS,OAC7B,aAAW,EAAAO,SAAW,WAAY,cAAe,UAAWX,CAAS,EACvE,CAEJ,CAAC,EACDJ,EAAK,YAAc",
6
- "names": ["card_exports", "__export", "Card", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "sizes", "variants", "panelBackgrounds", "materials", "cardPropDefs", "asChildPropDef", "import_classnames", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "value", "propValues", "parseValue", "classNames", "getBaseClassName", "isResponsiveObject", "object", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "prop", "customProperty", "bpProperty", "key", "mergeStyles", "styles", "result", "style", "mergePropDefs", "args", "extractProps", "props", "propDefs", "className", "style", "extractedProps", "allPropDefs", "key", "value", "propDef", "isResponsiveObject", "isResponsivePropDef", "propClassName", "getResponsiveClassNames", "classNames", "propDefValues", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "marginValues", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "extractProps", "cardPropDefs", "marginPropDefs", "effectiveMaterial", "Comp", "classNames"]
3
+ "sources": ["../../../src/components/card.tsx", "../../../src/props/as-child.prop.ts", "../../../src/components/card.props.tsx", "../../../src/helpers/extract-props.ts", "../../../src/helpers/compile-prop-defs.ts", "../../../src/props/prop-def.ts", "../../../src/helpers/has-own-property.ts", "../../../src/helpers/is-responsive-object.ts", "../../../src/helpers/get-responsive-styles.ts", "../../../src/helpers/merge-styles.ts", "../../../src/props/margin.props.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nimport classNames from 'classnames';\nimport { Slot } from 'radix-ui';\n\nimport { cardPropDefs } from './card.props.js';\nimport { extractProps } from '../helpers/extract-props.js';\nimport { marginPropDefs } from '../props/margin.props.js';\n\nimport type { MarginProps } from '../props/margin.props.js';\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';\nimport type { GetPropDefTypes } from '../props/prop-def.js';\n\ntype CardElement = React.ElementRef<'div'>;\ntype CardOwnProps = GetPropDefTypes<typeof cardPropDefs>;\ninterface CardProps extends ComponentPropsWithout<'div', RemovedProps>, MarginProps, CardOwnProps {}\nconst Card = React.forwardRef<CardElement, CardProps>((props, forwardedRef) => {\n const { asChild, className, panelBackground, material, flush, inset, ...cardProps } = extractProps(\n props,\n cardPropDefs,\n marginPropDefs,\n );\n const effectiveMaterial = material || panelBackground;\n const Comp = asChild ? Slot.Root : 'div';\n return (\n <Comp\n ref={forwardedRef}\n {...cardProps}\n data-panel-background={effectiveMaterial}\n data-material={effectiveMaterial}\n data-flush={flush ? 'true' : undefined}\n data-inset={inset ? 'true' : undefined}\n className={classNames('rt-reset', 'rt-BaseCard', 'rt-Card', className)}\n />\n );\n});\nCard.displayName = 'Card';\n\nexport { Card };\nexport type { CardProps };\n", "import type { PropDef } from './prop-def.js';\n\nconst asChildPropDef = {\n /**\n * Composes the component into its immediate child instead of rendering its own HTML element.\n * You\u2019ll have to provide a single React Element child.\n */\n asChild: {\n type: 'boolean',\n },\n} satisfies {\n asChild: PropDef<boolean>;\n};\n\nexport { asChildPropDef };\n", "import { asChildPropDef } from '../props/as-child.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4', '5'] as const;\nconst variants = ['surface', 'outline', 'classic', 'ghost', 'soft'] as const;\nconst panelBackgrounds = ['solid', 'translucent'] as const;\nconst materials = ['solid', 'translucent'] as const;\n\nconst cardPropDefs = {\n ...asChildPropDef,\n size: { type: 'enum', className: 'rt-r-size', values: sizes, default: '1', responsive: true },\n variant: { type: 'enum', className: 'rt-variant', values: variants, default: 'outline' },\n panelBackground: { type: 'enum', values: panelBackgrounds, default: undefined },\n material: { type: 'enum', values: materials, default: undefined },\n flush: { type: 'boolean', default: false },\n inset: { type: 'boolean', default: false },\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n panelBackground: PropDef<(typeof panelBackgrounds)[number] | undefined>;\n material: PropDef<(typeof materials)[number] | undefined>;\n flush: PropDef<boolean>;\n inset: PropDef<boolean>;\n};\n\nexport { cardPropDefs };\n", "import classNames from 'classnames';\n\nimport { getCompiledPropDefs } from './compile-prop-defs.js';\nimport { getResponsiveClassNames, getResponsiveStyles } from './get-responsive-styles.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\nimport { mergeStyles } from './merge-styles.js';\n\nimport type { CompiledPropDef } from './compile-prop-defs.js';\nimport type * as React from 'react';\nimport type { PropDef } from '../props/prop-def.js';\n\ntype PropDefsWithClassName<T> = T extends Record<string, PropDef> ? { [K in keyof T]: T[K] extends { className: string } ? K : never }[keyof T] : never;\n\ntype ResponsiveValue = Record<string, string | undefined>;\n\n/**\n * Fills in the `initial` breakpoint of a responsive value from the prop def's\n * default, and coerces an invalid `initial` enum value back to that default.\n *\n * Returns the value untouched when nothing needs changing, and a copy otherwise\n * \u2014 callers routinely hoist responsive objects to module scope, so mutating the\n * caller's object would corrupt it for every later render.\n */\nfunction normalizeResponsiveValue(value: ResponsiveValue, propDef: CompiledPropDef) {\n let initial = value.initial;\n let changed = false;\n\n if (propDef.hasDefault && initial === undefined) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(initial)) {\n initial = propDef.default as string | undefined;\n changed = true;\n }\n\n return changed ? { ...value, initial } : value;\n}\n\n/**\n * Takes props, checks them against prop defs that have a `className` on them,\n * adds necessary CSS classes and inline styles, and returns the props without\n * the corresponding prop defs that were used to formulate the new `className`\n * and `style` values. Also applies prop def defaults to every prop.\n */\nfunction extractProps<P extends { className?: string; style?: React.CSSProperties; [key: string]: any }, T extends Record<string, PropDef>[]>(\n props: P,\n ...propDefs: T\n): Omit<P & { className?: string; style?: React.CSSProperties }, PropDefsWithClassName<T[number]>> {\n const { styling, passthrough, stylingKeys } = getCompiledPropDefs(propDefs);\n\n // Copy the props that survive to the element rather than spreading and then\n // deleting the styling keys. Deleting off a spread demotes the object to\n // dictionary mode in V8, and this object is on the render path of every\n // component in the library.\n const extractedProps: Record<string, any> = {};\n for (const key in props) {\n if (stylingKeys.has(key)) continue;\n extractedProps[key] = props[key];\n }\n\n for (let i = 0; i < passthrough.length; i++) {\n const propDef = passthrough[i];\n const value = extractedProps[propDef.key];\n\n if (value === undefined) {\n if (propDef.hasDefault) extractedProps[propDef.key] = propDef.default;\n continue;\n }\n\n // Fall back to the default when the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n extractedProps[propDef.key] = propDef.default;\n }\n }\n\n let style: ReturnType<typeof mergeStyles>;\n const classes: string[] = [];\n\n for (let i = 0; i < styling.length; i++) {\n const propDef = styling[i];\n let value = props[propDef.key];\n\n // Apply prop def defaults\n if (value === undefined && propDef.hasDefault) {\n value = propDef.default;\n }\n\n // Apply the default value if the value is not a valid enum value\n if (propDef.enumValueSet !== undefined && !propDef.enumValueSet.has(value) && !isResponsiveObject(value)) {\n value = propDef.default;\n }\n\n if (!value) continue;\n\n if (isResponsiveObject(value)) {\n // Make sure we are not threading through responsive values for non-responsive prop defs\n if (!propDef.responsive) continue;\n value = normalizeResponsiveValue(value, propDef);\n }\n\n if (propDef.type === 'enum') {\n const propClassName = getResponsiveClassNames({\n allowArbitraryValues: false,\n value,\n className: propDef.className!,\n propValues: propDef.values,\n propValueSet: propDef.valueSet,\n parseValue: propDef.parseValue,\n });\n\n if (propClassName) classes.push(propClassName);\n continue;\n }\n\n if (propDef.type === 'string' || propDef.type === 'enum | string') {\n const [propClassNames, propCustomProperties] = getResponsiveStyles({\n className: propDef.className!,\n customProperties: propDef.customProperties!,\n // `string` prop defs have no enum values, so every value is arbitrary\n propValues: propDef.type === 'string' ? [] : propDef.values,\n propValueSet: propDef.type === 'string' ? undefined : propDef.valueSet,\n parseValue: propDef.parseValue,\n value,\n });\n\n if (propCustomProperties) style = mergeStyles(style, propCustomProperties);\n if (propClassNames) classes.push(propClassNames);\n continue;\n }\n\n if (propDef.type === 'boolean') {\n // TODO handle responsive boolean props\n classes.push(propDef.className!);\n continue;\n }\n }\n\n extractedProps.className = classNames(classes.length > 0 ? classes.join(' ') : undefined, props.className);\n extractedProps.style = mergeStyles(style, props.style);\n return extractedProps as ReturnType<typeof extractProps<P, T>>;\n}\n\nexport { extractProps };\n", "import type { PropDef } from '../props/prop-def.js';\n\n/**\n * A prop def pre-processed into the exact shape `extractProps` needs at render\n * time. Everything that can be derived from the static prop def \u2014 enum\n * membership sets, whether the def is responsive, whether it carries a default\n * \u2014 is computed once here instead of on every render.\n */\ninterface CompiledPropDef {\n key: string;\n type: PropDef['type'];\n default: unknown;\n hasDefault: boolean;\n responsive: boolean;\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n /** The prop def's own enum values, kept for the responsive class name helpers. */\n values: readonly string[];\n /** O(1) membership for `values`. */\n valueSet: ReadonlySet<string>;\n /**\n * `values` plus the default, used to coerce invalid enum values back to the\n * default. Only present for `type: 'enum'` \u2014 `'enum | string'` props accept\n * arbitrary strings and must not be coerced.\n */\n enumValueSet?: ReadonlySet<unknown>;\n}\n\ninterface CompiledPropDefs {\n /** Defs that contribute a class name and/or custom properties. */\n styling: CompiledPropDef[];\n /**\n * Defs that pass through to the element but still need a default applied or\n * an invalid enum value coerced. Defs that can do neither are omitted\n * entirely \u2014 they are already correct as passed.\n */\n passthrough: CompiledPropDef[];\n /** Keys consumed by `styling`, so they can be skipped when copying props. */\n stylingKeys: ReadonlySet<string>;\n}\n\nconst EMPTY_VALUES: readonly string[] = [];\nconst EMPTY_SET: ReadonlySet<string> = new Set();\n\nfunction compile(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n const merged: Record<string, PropDef> = Object.assign({}, ...propDefs);\n const styling: CompiledPropDef[] = [];\n const passthrough: CompiledPropDef[] = [];\n const stylingKeys = new Set<string>();\n\n for (const key in merged) {\n // The PropDef union is narrowed per-field below; reading the optional\n // members off the union directly is what the runtime actually needs.\n const def = merged[key] as PropDef & {\n default?: unknown;\n values?: readonly string[];\n className?: string;\n customProperties?: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n responsive?: true;\n };\n\n const values = def.values ?? EMPTY_VALUES;\n const compiled: CompiledPropDef = {\n key,\n type: def.type,\n default: def.default,\n hasDefault: def.default !== undefined,\n responsive: 'responsive' in def,\n className: def.className,\n customProperties: def.customProperties,\n parseValue: def.parseValue,\n values,\n valueSet: values.length > 0 ? new Set(values) : EMPTY_SET,\n enumValueSet: def.type === 'enum' ? new Set<unknown>([def.default, ...values]) : undefined,\n };\n\n if (def.className) {\n styling.push(compiled);\n stylingKeys.add(key);\n } else if (compiled.hasDefault || def.type === 'enum') {\n // Anything else is copied through untouched, so there is nothing to do.\n passthrough.push(compiled);\n }\n }\n\n return { styling, passthrough, stylingKeys };\n}\n\ninterface CacheNode {\n children: WeakMap<object, CacheNode>;\n compiled?: CompiledPropDefs;\n}\n\nconst cacheRoot: CacheNode = { children: new WeakMap() };\n\n/**\n * Compiles a set of prop defs, memoized on the identity of the prop def objects\n * themselves. Components always pass the same module-level constants, so after\n * the first render of a given component this is a couple of WeakMap lookups\n * instead of merging 50-odd prop defs into a fresh object.\n */\nfunction getCompiledPropDefs(propDefs: readonly Record<string, PropDef>[]): CompiledPropDefs {\n let node = cacheRoot;\n\n for (let i = 0; i < propDefs.length; i++) {\n const propDef = propDefs[i];\n let child = node.children.get(propDef);\n if (child === undefined) {\n child = { children: new WeakMap() };\n node.children.set(propDef, child);\n }\n node = child;\n }\n\n return (node.compiled ??= compile(propDefs));\n}\n\nexport { getCompiledPropDefs };\nexport type { CompiledPropDef, CompiledPropDefs };\n", "import type React from 'react';\n\n// Creates a union type of string literals with strings, but retains intellisense for the literals.\n// Union<string, 'foo' | 'bar'> => string | Omit<string, 'foo' | 'bar'>\ntype Union<S = string, T extends string | number = string> = T | Omit<S, T>;\n\nconst breakpoints = ['initial', 'xs', 'sm', 'md', 'lg', 'xl'] as const;\nconst breakpointSet: Set<string> = new Set(breakpoints);\ntype Breakpoint = (typeof breakpoints)[number];\ntype Responsive<T> = T | Partial<Record<Breakpoint, T>>;\n\ntype BooleanPropDef = {\n type: 'boolean';\n default?: boolean;\n required?: boolean;\n className?: string;\n};\ntype StringPropDef = {\n type: 'string';\n default?: string;\n required?: boolean;\n};\ntype ReactNodePropDef = {\n type: 'ReactNode';\n default?: React.ReactNode;\n required?: boolean;\n};\ntype EnumPropDef<T> = {\n type: 'enum';\n values: readonly T[];\n default?: T;\n required?: boolean;\n};\ntype EnumOrStringPropDef<T> = {\n type: 'enum | string';\n values: readonly T[];\n default?: T | string;\n required?: boolean;\n};\n\ntype NonStylingPropDef = {\n className?: never;\n customProperties?: never;\n parseValue?: never;\n};\n\ntype StylingPropDef = {\n className: string;\n parseValue?: (value: string) => string | undefined;\n};\n\ntype ArbitraryStylingPropDef = {\n className: string;\n customProperties: `--${string}`[];\n parseValue?: (value: string) => string | undefined;\n};\n\ntype RegularPropDef<T> =\n | ReactNodePropDef\n | BooleanPropDef\n | (StringPropDef & ArbitraryStylingPropDef)\n | (StringPropDef & NonStylingPropDef)\n | (EnumPropDef<T> & StylingPropDef)\n | (EnumPropDef<T> & NonStylingPropDef)\n | (EnumOrStringPropDef<T> & ArbitraryStylingPropDef)\n | (EnumOrStringPropDef<T> & NonStylingPropDef);\ntype ResponsivePropDef<T = any> = RegularPropDef<T> & { responsive: true };\ntype PropDef<T = any> = RegularPropDef<T> | ResponsivePropDef<T>;\n\n// prettier-ignore\ntype GetPropDefType<Def> =\n Def extends BooleanPropDef ? (Def extends ResponsivePropDef ? Responsive<boolean> : boolean)\n : Def extends StringPropDef ? (Def extends ResponsivePropDef ? Responsive<string> : string)\n : Def extends ReactNodePropDef ? (Def extends ResponsivePropDef ? Responsive<React.ReactNode> : React.ReactNode)\n : Def extends EnumOrStringPropDef<infer Type> ?\n Def extends ResponsivePropDef<infer Type extends string> ? Responsive<Union<string, Type>> : Type\n : Def extends EnumPropDef<infer Type> ? (Def extends ResponsivePropDef<infer Type> ? Responsive<Type> : Type)\n : never;\n\ntype GetPropDefTypes<P> = {\n [K in keyof P]?: GetPropDefType<P[K]>;\n};\n\nexport { breakpoints, breakpointSet };\nexport type {\n PropDef,\n GetPropDefTypes,\n ResponsivePropDef,\n //\n Breakpoint,\n Responsive,\n Union,\n};\n", "/** A util to check whether the object has a key, while inferring the correct key type */\nfunction hasOwnProperty<K extends string | number | symbol>(\n obj: Record<K, unknown>,\n key: string | number | symbol\n): key is K {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n\nexport { hasOwnProperty };\n", "import type { Responsive, Breakpoint } from '../props/prop-def.js';\n\n// Use a Set for O(1) lookup instead of array.includes() which is O(n)\nconst breakpointSet = new Set<string>(['initial', 'xs', 'sm', 'md', 'lg', 'xl']);\n\nexport function isResponsiveObject<Value extends string>(\n obj: Responsive<Value | Omit<string, Value>> | undefined\n): obj is Record<Breakpoint, string> {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n // Use for...in to avoid Object.keys() array allocation\n for (const key in obj) {\n if (breakpointSet.has(key)) {\n return true;\n }\n }\n return false;\n}\n", "import { breakpointSet } from '../props/prop-def.js';\nimport { hasOwnProperty } from './has-own-property.js';\nimport { isResponsiveObject } from './is-responsive-object.js';\n\nimport type { Responsive, Union } from '../props/prop-def.js';\n\n/**\n * Membership test against a prop def's enum values. Callers that already hold a\n * compiled prop def pass `propValueSet` for an O(1) lookup; the handful of call\n * sites that build options inline fall back to scanning the array.\n */\nfunction includesValue(propValues: string[] | readonly string[], propValueSet: ReadonlySet<string> | undefined, value: string): boolean {\n return propValueSet !== undefined ? propValueSet.has(value) : propValues.includes(value);\n}\n\ninterface GetResponsiveStylesOptions {\n className: string;\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveStyles({ className, customProperties, ...args }: GetResponsiveStylesOptions) {\n const responsiveClassNames = getResponsiveClassNames({\n allowArbitraryValues: true,\n className,\n ...args,\n });\n\n const responsiveCustomProperties = getResponsiveCustomProperties({ customProperties, ...args });\n return [responsiveClassNames, responsiveCustomProperties] as const;\n}\n\ninterface GetResponsiveClassNamesOptions {\n allowArbitraryValues?: boolean;\n className: string;\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveClassNames({ allowArbitraryValues, value, className, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveClassNamesOptions): string | undefined {\n if (!value) {\n return undefined;\n }\n\n if (typeof value === 'string') {\n if (includesValue(propValues, propValueSet, value)) {\n return getBaseClassName(className, value, parseValue);\n }\n return allowArbitraryValues ? className : undefined;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n const classNames: string[] = [];\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n if (value !== undefined) {\n if (includesValue(propValues, propValueSet, value)) {\n const baseClassName = getBaseClassName(className, value, parseValue);\n const bpClassName = bp === 'initial' ? baseClassName : `${bp}:${baseClassName}`;\n classNames.push(bpClassName);\n } else if (allowArbitraryValues) {\n const bpClassName = bp === 'initial' ? className : `${bp}:${className}`;\n classNames.push(bpClassName);\n }\n }\n }\n\n return classNames.length > 0 ? classNames.join(' ') : '';\n }\n\n if (allowArbitraryValues) {\n return className;\n }\n}\n\nfunction getBaseClassName(className: string, value: string, parseValue: (value: string) => string | undefined): string {\n const delimiter = className ? '-' : '';\n const matchedValue = parseValue(value);\n const isNegative = matchedValue?.startsWith('-');\n const minus = isNegative ? '-' : '';\n const absoluteValue = isNegative ? matchedValue?.substring(1) : matchedValue;\n return `${minus}${className}${delimiter}${absoluteValue}`;\n}\n\ninterface GetResponsiveCustomPropertiesOptions {\n customProperties: `--${string}`[];\n value: Responsive<Union> | Responsive<string> | undefined;\n propValues: string[] | readonly string[];\n propValueSet?: ReadonlySet<string>;\n parseValue?: (value: string) => string | undefined;\n}\n\nfunction getResponsiveCustomProperties({ customProperties, value, propValues, propValueSet, parseValue = (value) => value }: GetResponsiveCustomPropertiesOptions) {\n // Don't generate custom properties if the value is not arbitrary\n if (!value || (typeof value === 'string' && includesValue(propValues, propValueSet, value))) {\n return undefined;\n }\n\n let styles: Record<string, string | undefined> | undefined;\n\n if (typeof value === 'string') {\n const parsed = parseValue(value);\n styles = {};\n for (const customProperty of customProperties) {\n styles[customProperty] = parsed;\n }\n return styles;\n }\n\n if (isResponsiveObject(value)) {\n const object = value;\n\n for (const bp in object) {\n // Make sure we are not iterating over keys that aren't breakpoints\n if (!hasOwnProperty(object, bp) || !breakpointSet.has(bp)) {\n continue;\n }\n\n const value = object[bp];\n\n // Don't generate a custom property if the value is not arbitrary\n if (value === undefined || includesValue(propValues, propValueSet, value)) {\n continue;\n }\n\n const parsed = parseValue(value);\n styles ??= {};\n for (const customProperty of customProperties) {\n const bpProperty = bp === 'initial' ? customProperty : `${customProperty}-${bp}`;\n styles[bpProperty] = parsed;\n }\n }\n }\n\n return styles ?? {};\n}\n\nexport { getResponsiveStyles, getResponsiveCustomProperties, getResponsiveClassNames };\n", "type InlineStyle =\n | React.CSSProperties\n | Record<string, string | number | null | undefined>\n | undefined;\n\n// Merges CSS styles like `classNames` merges CSS classes\n// Optimized to avoid object spread in loop - uses Object.assign for in-place mutation\nexport function mergeStyles(...styles: Array<InlineStyle>): InlineStyle {\n let result: Record<string, string | number | null | undefined> | undefined;\n\n for (const style of styles) {\n if (style) {\n if (result === undefined) {\n // First non-empty style - create result object\n result = {};\n }\n Object.assign(result, style);\n }\n }\n\n return result;\n}\n", "import type { PropDef, GetPropDefTypes } from './prop-def.js';\n\n// prettier-ignore\nconst marginValues = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '-1', '-2', '-3', '-4', '-5', '-6', '-7', '-8', '-9', '-10', '-11', '-12'] as const;\n\nconst marginPropDefs = {\n /**\n * Sets the CSS **margin** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * m=\"4\"\n * m=\"100px\"\n * m={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin\n */\n m: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-m',\n customProperties: ['--m'],\n },\n /**\n * Sets the CSS **margin-left** and **margin-right** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mx=\"4\"\n * mx=\"100px\"\n * mx={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mx: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mx',\n customProperties: ['--ml', '--mr'],\n },\n /**\n * Sets the CSS **margin-top** and **margin-bottom** properties.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * my=\"4\"\n * my=\"100px\"\n * my={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n my: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-my',\n customProperties: ['--mt', '--mb'],\n },\n /**\n * Sets the CSS **margin-top** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mt=\"4\"\n * mt=\"100px\"\n * mt={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\n */\n mt: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mt',\n customProperties: ['--mt'],\n },\n /**\n * Sets the CSS **margin-right** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mr=\"4\"\n * mr=\"100px\"\n * mr={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\n */\n mr: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mr',\n customProperties: ['--mr'],\n },\n /**\n * Sets the CSS **margin-bottom** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * mb=\"4\"\n * mb=\"100px\"\n * mb={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\n */\n mb: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-mb',\n customProperties: ['--mb'],\n },\n /**\n * Sets the CSS **margin-left** property.\n * Supports space scale values, CSS strings, and responsive objects.\n *\n * @example\n * ml=\"4\"\n * ml=\"100px\"\n * ml={{ sm: '6', lg: '9' }}\n *\n * @link\n * https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\n */\n ml: {\n type: 'enum | string',\n values: marginValues,\n responsive: true,\n className: 'rt-r-ml',\n customProperties: ['--ml'],\n },\n} satisfies {\n m: PropDef<(typeof marginValues)[number]>;\n mx: PropDef<(typeof marginValues)[number]>;\n my: PropDef<(typeof marginValues)[number]>;\n mt: PropDef<(typeof marginValues)[number]>;\n mr: PropDef<(typeof marginValues)[number]>;\n mb: PropDef<(typeof marginValues)[number]>;\n ml: PropDef<(typeof marginValues)[number]>;\n};\n\ntype MarginProps = GetPropDefTypes<typeof marginPropDefs>;\n\nexport { marginPropDefs };\nexport type { MarginProps };\n"],
5
+ "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,UAAAE,IAAA,eAAAC,EAAAH,IAAA,IAAAI,EAAuB,oBACvBC,EAAuB,yBACvBC,EAAqB,oBCArB,IAAMC,EAAiB,CAKrB,QAAS,CACP,KAAM,SACR,CACF,ECNA,IAAMC,EAAQ,CAAC,IAAK,IAAK,IAAK,IAAK,GAAG,EAChCC,EAAW,CAAC,UAAW,UAAW,UAAW,QAAS,MAAM,EAC5DC,EAAmB,CAAC,QAAS,aAAa,EAC1CC,EAAY,CAAC,QAAS,aAAa,EAEnCC,EAAe,CACnB,GAAGC,EACH,KAAM,CAAE,KAAM,OAAQ,UAAW,YAAa,OAAQL,EAAO,QAAS,IAAK,WAAY,EAAK,EAC5F,QAAS,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQC,EAAU,QAAS,SAAU,EACvF,gBAAiB,CAAE,KAAM,OAAQ,OAAQC,EAAkB,QAAS,MAAU,EAC9E,SAAU,CAAE,KAAM,OAAQ,OAAQC,EAAW,QAAS,MAAU,EAChE,MA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Aa,aAAmC,CAACC,EAAOC,IAAiB,CAC7E,GAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,gBAAAC,EAAiB,SAAAC,EAAU,MAAAC,EAAO,MAAAC,EAAO,GAAGC,CAAU,EAAIC,EACpFT,EACAU,EACAC,CACF,EACMC,EAAoBP,GAAYD,EAChCS,EAAOX,EAAU,OAAK,KAAO,MACnC,OACE,gBAACW,EAAA,CACC,IAAKZ,EACJ,GAAGO,EACJ,wBAAuBI,EACvB,gBAAeA,EACf,aAAYN,EAAQ,OAAS,OAC7B,aAAYC,EAAQ,OAAS,OAC7B,aAAW,EAAAO,SAAW,WAAY,cAAe,UAAWX,CAAS,EACvE,CAEJ,CAAC,EACDJ,EAAK,YAAc",
6
+ "names": ["card_exports", "__export", "Card", "__toCommonJS", "React", "import_classnames", "import_radix_ui", "asChildPropDef", "sizes", "variants", "panelBackgrounds", "materials", "cardPropDefs", "asChildPropDef", "import_classnames", "EMPTY_VALUES", "EMPTY_SET", "compile", "propDefs", "merged", "styling", "passthrough", "stylingKeys", "key", "def", "values", "compiled", "cacheRoot", "getCompiledPropDefs", "node", "i", "propDef", "child", "breakpoints", "breakpointSet", "hasOwnProperty", "obj", "key", "breakpointSet", "isResponsiveObject", "obj", "key", "includesValue", "propValues", "propValueSet", "value", "getResponsiveStyles", "className", "customProperties", "args", "responsiveClassNames", "getResponsiveClassNames", "responsiveCustomProperties", "getResponsiveCustomProperties", "allowArbitraryValues", "parseValue", "getBaseClassName", "isResponsiveObject", "object", "classNames", "bp", "hasOwnProperty", "breakpointSet", "baseClassName", "bpClassName", "delimiter", "matchedValue", "isNegative", "minus", "absoluteValue", "styles", "parsed", "customProperty", "bpProperty", "mergeStyles", "styles", "result", "style", "normalizeResponsiveValue", "value", "propDef", "initial", "changed", "extractProps", "props", "propDefs", "styling", "passthrough", "stylingKeys", "getCompiledPropDefs", "extractedProps", "key", "isResponsiveObject", "style", "classes", "propClassName", "getResponsiveClassNames", "propClassNames", "propCustomProperties", "getResponsiveStyles", "mergeStyles", "classNames", "marginValues", "marginPropDefs", "Card", "props", "forwardedRef", "asChild", "className", "panelBackground", "material", "flush", "inset", "cardProps", "extractProps", "cardPropDefs", "marginPropDefs", "effectiveMaterial", "Comp", "classNames"]
7
7
  }
@@ -1,5 +1,5 @@
1
- "use strict";var qo=Object.create;var qe=Object.defineProperty;var _o=Object.getOwnPropertyDescriptor;var Zo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,Xo=Object.prototype.hasOwnProperty;var Jo=(e,t)=>{for(var r in t)qe(e,r,{get:t[r],enumerable:!0})},Ut=(e,t,r,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Zo(t))!Xo.call(e,n)&&n!==r&&qe(e,n,{get:()=>t[n],enumerable:!(p=_o(t,n))||p.enumerable});return e};var S=(e,t,r)=>(r=e!=null?qo(Yo(e)):{},Ut(t||!e||!e.__esModule?qe(r,"default",{value:e,enumerable:!0}):r,e)),Qo=e=>Ut(qe({},"__esModule",{value:!0}),e);var Ur={};Jo(Ur,{AttachTrigger:()=>Fo,Attachment:()=>Et,AttachmentsRow:()=>Io,InlineEnd:()=>Vo,InlineStart:()=>Oo,Root:()=>Bo,Row:()=>jo,RowEnd:()=>zo,RowStart:()=>Lo,Send:()=>Ho,Textarea:()=>Mo});module.exports=Qo(Ur);var o=S(require("react")),K=S(require("classnames")),le=require("motion/react");var We=S(require("react")),To=S(require("classnames"));var x=S(require("react")),io=S(require("classnames")),po=require("radix-ui"),lo=require("radix-ui/internal");var ne={asChild:{type:"boolean"}};var _e=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Kt=["auto","gray","mauve","slate","sage","olive","sand"],qt={color:{type:"enum",values:_e,default:void 0}},_t={color:{type:"enum",values:_e,default:""}};var Ze={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}};var ft=["none","small","medium","large","full"],Ye={radius:{type:"enum",values:ft,default:void 0}};var er=["1","2","3","4"],tr=["classic","solid","soft","surface","outline","ghost","override"],or=["solid","translucent"],rr=["solid","translucent"],dt={...ne,size:{type:"enum",className:"rt-r-size",values:er,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:tr,default:"solid"},..._t,...Ze,...Ye,loading:{type:"boolean",className:"rt-loading",default:!1},fullWidth:{type:"boolean",className:"rt-full-width",default:!1},material:{type:"enum",values:rr,default:void 0},panelBackground:{type:"enum",values:or,default:void 0},flush:{type:"boolean",default:!1}};var Je=S(require("react")),to=S(require("classnames"));var ze=S(require("classnames"));var nr=["initial","xs","sm","md","lg","xl"],yt=new Set(nr);function gt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var sr=new Set(["initial","xs","sm","md","lg","xl"]);function ve(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(sr.has(t))return!0;return!1}function se({className:e,customProperties:t,...r}){let p=ke({allowArbitraryValues:!0,className:e,...r}),n=ar({customProperties:t,...r});return[p,n]}function ke({allowArbitraryValues:e,value:t,className:r,propValues:p,parseValue:n=l=>l}){let l=[];if(t){if(typeof t=="string"&&p.includes(t))return Zt(r,t,n);if(ve(t)){let i=t;for(let a in i){if(!gt(i,a)||!yt.has(a))continue;let s=i[a];if(s!==void 0){if(p.includes(s)){let u=Zt(r,s,n),f=a==="initial"?u:`${a}:${u}`;l.push(f)}else if(e){let u=a==="initial"?r:`${a}:${r}`;l.push(u)}}}return l.join(" ")}if(e)return r}}function Zt(e,t,r){let p=e?"-":"",n=r(t),l=n?.startsWith("-"),i=l?"-":"",a=l?n?.substring(1):n;return`${i}${e}${p}${a}`}function ar({customProperties:e,value:t,propValues:r,parseValue:p=n=>n}){let n={};if(!(!t||typeof t=="string"&&r.includes(t))){if(typeof t=="string"&&(n=Object.fromEntries(e.map(l=>[l,t]))),ve(t)){let l=t;for(let i in l){if(!gt(l,i)||!yt.has(i))continue;let a=l[i];if(!r.includes(a))for(let s of e){let u=i==="initial"?s:`${s}-${i}`;n[u]=a}}}for(let l in n){let i=n[l];i!==void 0&&(n[l]=p(i))}return n}}function Ce(...e){let t;for(let r of e)r&&(t===void 0&&(t={}),Object.assign(t,r));return t}function ir(...e){return Object.assign({},...e)}function ae(e,...t){let r,p,n={...e},l=ir(...t);for(let i in l){let a=n[i],s=l[i];if(s.default!==void 0&&a===void 0&&(a=s.default),s.type==="enum"&&![s.default,...s.values].includes(a)&&!ve(a)&&(a=s.default),n[i]=a,"className"in s&&s.className){delete n[i];let u="responsive"in s;if(!a||ve(a)&&!u)continue;if(ve(a)&&(s.default!==void 0&&a.initial===void 0&&(a.initial=s.default),s.type==="enum"&&([s.default,...s.values].includes(a.initial)||(a.initial=s.default))),s.type==="enum"){let f=ke({allowArbitraryValues:!1,value:a,className:s.className,propValues:s.values,parseValue:s.parseValue});r=(0,ze.default)(r,f);continue}if(s.type==="string"||s.type==="enum | string"){let f=s.type==="string"?[]:s.values,[P,b]=se({className:s.className,customProperties:s.customProperties,propValues:f,parseValue:s.parseValue,value:a});p=Ce(p,b),r=(0,ze.default)(r,P);continue}if(s.type==="boolean"&&a){r=(0,ze.default)(r,s.className);continue}}}return n.className=(0,ze.default)(r,e.className),n.style=Ce(p,e.style),n}var Re=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Yt={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Re,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Re,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Re,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Re,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Re,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Re,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Re,responsive:!0}};var Xt={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}};var Be={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}};var ht=["visible","hidden","clip","scroll","auto"],pr=["static","relative","absolute","fixed","sticky"],He=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],lr=["0","1"],cr=["0","1"],mr=["start","center","end","baseline","stretch"],ur=["start","center","end","baseline","stretch"],Jt={...Yt,...Be,...Xt,position:{type:"enum",className:"rt-r-position",values:pr,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:He,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:He,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:He,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:He,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:He,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:ht,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:ht,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:ht,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:lr,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:cr,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:mr,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:ur,responsive:!0}};var xe=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],ie={m:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var Xe=require("radix-ui"),Dn=Xe.Slot.Root,X=Xe.Slot.Root,Tn=Xe.Slot.Slottable;var Pt=["0","1","2","3","4","5","6","7","8","9","10","11","12"],Qt={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:Pt,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:Pt,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:Pt,responsive:!0}};var fr=["div","span"],dr=["none","inline-flex","flex"],yr=["row","column","row-reverse","column-reverse"],gr=["start","center","end","baseline","stretch"],hr=["start","center","end","between"],Pr=["nowrap","wrap","wrap-reverse"],eo={as:{type:"enum",values:fr,default:"div"},...ne,display:{type:"enum",className:"rt-r-display",values:dr,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:yr,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:gr,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:hr,parseValue:br,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:Pr,responsive:!0},...Qt};function br(e){return e==="between"?"space-between":e}var J=Je.forwardRef((e,t)=>{let{className:r,asChild:p,as:n="div",...l}=ae(e,eo,Jt,ie);return Je.createElement(p?X:n,{...l,ref:t,className:(0,to.default)("rt-Flex",r)})});J.displayName="Flex";var I=S(require("react")),ro=S(require("classnames"));var vr=["1","2","3"],oo={size:{type:"enum",className:"rt-r-size",values:vr,default:"2",responsive:!0},loading:{type:"boolean",default:!0}};var bt=I.forwardRef((e,t)=>{let{className:r,children:p,loading:n,...l}=ae(e,oo,ie);if(!n)return p;let i=I.createElement("span",{...l,ref:t,className:(0,ro.default)("rt-Spinner",r)},I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}));return p===void 0?i:I.createElement(J,{asChild:!0,position:"relative",align:"center",justify:"center"},I.createElement("span",null,I.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},p),I.createElement(J,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},I.createElement("span",null,i))))});bt.displayName="Spinner";var vt=require("radix-ui"),no=vt.VisuallyHidden.Root,Gn=vt.VisuallyHidden.Root;function so(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([r,p])=>[r,t(p)]))}function ao(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}var Ct=x.forwardRef((e,t)=>{let{size:r=dt.size.default}=e,{className:p,children:n,asChild:l,as:i,color:a,radius:s,material:u,panelBackground:f,flush:P,disabled:b=e.loading,...c}=ae(e,dt,ie);x.useEffect(()=>{e.panelBackground!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.")},[e.panelBackground]);let g=u??f,R=x.useRef(null),M=x.useRef(g);M.current=g,x.useEffect(()=>{let O=R.current;if(!O)return;if(g==="translucent"){O.style.setProperty("will-change","backdrop-filter");let $,ee=()=>{let fe=getComputedStyle(O).getPropertyValue("--duration-2")||"75ms",_=parseInt(fe)||75;$=setTimeout(()=>{O&&M.current!=="translucent"&&O.style.setProperty("will-change","auto")},_)},q=new MutationObserver(ee);return q.observe(O,{attributes:!0,attributeFilter:["data-material"]}),()=>{$&&clearTimeout($),q.disconnect(),O.style.setProperty("will-change","auto")}}else O.style.setProperty("will-change","auto")},[g]);let D=l?po.Slot.Root:i||"button",A=l||!i||["button","input","textarea","select"].includes(i),F=!l&&(!i||i==="button"),V="type"in c,H=x.useId(),E=e.loading?`${H}-loading`:void 0,j=x.useMemo(()=>typeof n=="string"?n:x.isValidElement(n)&&typeof n.props?.children=="string"?n.props.children:"button",[n]),G=x.useMemo(()=>e.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":E,"aria-label":`${j} (loading)`}:{},[e.loading,E,j]);return x.createElement(D,{"data-disabled":b||void 0,"data-accent-color":a,"data-radius":s,"data-material":g,"data-panel-background":g,"data-flush":P?"true":void 0,...c,...G,ref:(0,lo.composeRefs)(R,t),className:(0,io.default)("rt-reset","rt-BaseButton",p),...A&&{disabled:b},...F&&!V?{type:"button"}:{}},e.loading?x.createElement(x.Fragment,null,x.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},n),x.createElement(no,null,x.createElement("span",{id:E},j," is loading, please wait..."),n),x.createElement(J,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},x.createElement("span",null,x.createElement(bt,{size:so(r,ao),"aria-hidden":"true"})))):n)});Ct.displayName="BaseButton";var pe=S(require("react")),xo=S(require("classnames")),Oe=require("radix-ui");var De=S(require("react")),Po=require("radix-ui");var Cr=["normal","start","end","both"],co={trim:{type:"enum",className:"rt-r-lt",values:Cr,responsive:!0}};var Rr=["left","center","right"],mo={align:{type:"enum",className:"rt-r-ta",values:Rr,responsive:!0}};var xr=["wrap","nowrap","pretty","balance"],uo={wrap:{type:"enum",className:"rt-r-tw",values:xr,responsive:!0}};var fo={truncate:{type:"boolean",className:"rt-truncate"}};var Dr=["sans","mono","serif"],yo={font:{type:"enum",className:"rt-r-ff",values:Dr}};var Tr=["thin","extralight","light","regular","medium","semibold","bold","extrabold"],go={weight:{type:"enum",className:"rt-r-weight",values:Tr,responsive:!0}};var wr=["span","div","label","p"],Nr=["0","1","2","3","4","5","6","7","8","9","10","11","12"],ho={as:{type:"enum",values:wr,default:"span"},...ne,size:{type:"enum",className:"rt-r-size",values:Nr,responsive:!0},...yo,...go,...mo,...co,...fo,...uo,...qt,...Ze};var Sr={...ho,...ie},Te=De.memo(De.forwardRef((e,t)=>{let{children:r,className:p,asChild:n,as:l="span",color:i,...a}=ae(e,Sr),s=p?`rt-Text ${p}`:"rt-Text";return n?De.createElement(Po.Slot.Root,{"data-accent-color":i,...a,ref:t,className:s},r):De.createElement(l,{"data-accent-color":i,...a,ref:t,className:s},r)}));Te.displayName="Text";var y=S(require("react")),vo=S(require("classnames")),Me=require("radix-ui");function bo(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Ar=["inherit","light","dark"],Er=["solid","translucent"],kr=["solid","translucent"],Br=["90%","95%","100%","105%","110%"],Mr=["sans","mono","serif"],C={...ne,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:Ar,default:"inherit"},accentColor:{type:"enum",values:_e,default:"blue"},grayColor:{type:"enum",values:Kt,default:"slate"},material:{type:"enum",values:kr,default:"translucent"},panelBackground:{type:"enum",values:Er,default:"translucent"},radius:{type:"enum",values:ft,default:"medium"},scaling:{type:"enum",values:Br,default:"100%"},fontFamily:{type:"enum",values:Mr,default:"sans"}};var L=()=>{},Ns={appearance:C.appearance.default,accentColor:C.accentColor.default,grayColor:C.grayColor.default,resolvedGrayColor:C.grayColor.default,material:C.material.default,panelBackground:C.panelBackground.default,radius:C.radius.default,scaling:C.scaling.default,fontFamily:C.fontFamily.default,onAppearanceChange:L,onAccentColorChange:L,onGrayColorChange:L,onMaterialChange:L,onPanelBackgroundChange:L,onRadiusChange:L,onScalingChange:L,onFontFamilyChange:L},Rt=y.createContext(void 0);var xt=y.forwardRef((e,t)=>y.useContext(Rt)===void 0?y.createElement(Me.Tooltip.Provider,{delayDuration:200},y.createElement(Me.Direction.Provider,{dir:"ltr"},y.createElement(Co,{...e,ref:t}))):y.createElement(Dt,{...e,ref:t}));xt.displayName="Theme";var Co=y.forwardRef((e,t)=>{let{appearance:r=C.appearance.default,accentColor:p=C.accentColor.default,grayColor:n=C.grayColor.default,material:l=C.material.default,panelBackground:i=C.panelBackground.default,radius:a=C.radius.default,scaling:s=C.scaling.default,fontFamily:u=C.fontFamily.default,hasBackground:f=C.hasBackground.default,...P}=e;y.useEffect(()=>{e.panelBackground!==void 0&&console.warn("Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.")},[e.panelBackground]);let[b,c]=y.useState(r);y.useEffect(()=>c(r),[r]);let[g,R]=y.useState(p);y.useEffect(()=>R(p),[p]);let[M,D]=y.useState(n);y.useEffect(()=>D(n),[n]);let A=l!==C.material.default?l:i,[F,V]=y.useState(A);y.useEffect(()=>V(A),[A]);let[H,E]=y.useState(i);y.useEffect(()=>E(F),[F]);let[j,G]=y.useState(a);y.useEffect(()=>G(a),[a]);let[O,Q]=y.useState(s);y.useEffect(()=>Q(s),[s]);let[$,ee]=y.useState(u);return y.useEffect(()=>ee(u),[u]),y.createElement(Dt,{...P,ref:t,isRoot:!0,hasBackground:f,appearance:b,accentColor:g,grayColor:M,material:F,panelBackground:H,radius:j,scaling:O,fontFamily:$,onAppearanceChange:c,onAccentColorChange:R,onGrayColorChange:D,onMaterialChange:V,onPanelBackgroundChange:E,onRadiusChange:G,onScalingChange:Q,onFontFamilyChange:ee})});Co.displayName="ThemeRoot";function Or(){if(typeof navigator>"u")return;let e=navigator.userAgent;if(e.includes("Win"))return"windows";if(e.includes("Mac"))return"macos";if(e.includes("Linux"))return"linux"}var Dt=y.forwardRef((e,t)=>{let r=y.useContext(Rt),{asChild:p,isRoot:n,hasBackground:l,appearance:i=e.appearance??r?.appearance??C.appearance.default,accentColor:a=e.accentColor??r?.accentColor??C.accentColor.default,grayColor:s=e.grayColor??r?.resolvedGrayColor??C.grayColor.default,material:u=e.material??r?.material??C.material.default,panelBackground:f=e.panelBackground??r?.panelBackground??C.panelBackground.default,radius:P=e.radius??r?.radius??C.radius.default,scaling:b=e.scaling??r?.scaling??C.scaling.default,fontFamily:c=e.fontFamily??r?.fontFamily??C.fontFamily.default,onAppearanceChange:g=L,onAccentColorChange:R=L,onGrayColorChange:M=L,onMaterialChange:D=L,onPanelBackgroundChange:A=L,onRadiusChange:F=L,onScalingChange:V=L,onFontFamilyChange:H=L,...E}=e,j=p?Me.Slot.Root:"div",G=s==="auto"?bo(a):s,O=e.appearance==="light"||e.appearance==="dark",Q=l===void 0?n||O:l,[$,ee]=y.useState(void 0);return y.useEffect(()=>{n&&ee(Or())},[n]),y.createElement(Rt.Provider,{value:y.useMemo(()=>({appearance:i,accentColor:a,grayColor:s,resolvedGrayColor:G,material:u,panelBackground:f,radius:P,scaling:b,fontFamily:c,onAppearanceChange:g,onAccentColorChange:R,onGrayColorChange:M,onMaterialChange:D,onPanelBackgroundChange:A,onRadiusChange:F,onScalingChange:V,onFontFamilyChange:H}),[i,a,s,G,u,f,P,b,c,g,R,M,D,A,F,V,H])},y.createElement(j,{"data-is-root-theme":n?"true":"false","data-accent-color":a,"data-gray-color":G,"data-has-background":Q?"true":"false","data-material":u,"data-panel-background":f,"data-radius":P,"data-scaling":b,"data-font-family":c,"data-os":n?$:void 0,ref:t,...E,className:(0,vo.default)("radix-themes",{light:i==="light",dark:i==="dark"},E.className)}))});Dt.displayName="ThemeImpl";var Ro={content:{type:"ReactNode",required:!0},width:Be.width,minWidth:Be.minWidth,maxWidth:{...Be.maxWidth,default:"360px"}};var Tt=pe.forwardRef((e,t)=>{let{children:r,className:p,open:n,defaultOpen:l,onOpenChange:i,delayDuration:a,disableHoverableContent:s,content:u,container:f,forceMount:P,...b}=ae(e,Ro),c={open:n,defaultOpen:l,onOpenChange:i,delayDuration:a,disableHoverableContent:s};return pe.createElement(Oe.Tooltip.Root,{...c},pe.createElement(Oe.Tooltip.Trigger,{asChild:!0},r),pe.createElement(Oe.Tooltip.Portal,{container:f,forceMount:P},pe.createElement(xt,{asChild:!0},pe.createElement(Oe.Tooltip.Content,{sideOffset:4,collisionPadding:10,...b,asChild:!1,ref:t,className:(0,xo.default)("rt-TooltipContent",p)},pe.createElement(Te,{as:"p",className:"rt-TooltipText",size:"1"},u),pe.createElement(Oe.Tooltip.Arrow,{className:"rt-TooltipArrow"})))))});Tt.displayName="Tooltip";var Qe=S(require("react"));function Do(e){let t=Qe.useId(),r=!!e,p=Qe.useMemo(()=>r?{"aria-describedby":t}:{},[r,t]);return{tooltipId:t,hasTooltip:r,accessibilityProps:p}}var et=We.forwardRef(({className:e,tooltip:t,tooltipSide:r="top",tooltipAlign:p="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:l,...i},a)=>{let{tooltipId:s,hasTooltip:u,accessibilityProps:f}=Do(t),P="aria-label"in i&&i["aria-label"],b="aria-labelledby"in i&&i["aria-labelledby"],c="children"in i&&i.children;!P&&!b&&!c&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
1
+ "use strict";var tr=Object.create;var Ue=Object.defineProperty;var or=Object.getOwnPropertyDescriptor;var rr=Object.getOwnPropertyNames;var nr=Object.getPrototypeOf,sr=Object.prototype.hasOwnProperty;var ar=(e,t)=>{for(var o in t)Ue(e,o,{get:t[o],enumerable:!0})},qt=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of rr(t))!sr.call(e,n)&&n!==o&&Ue(e,n,{get:()=>t[n],enumerable:!(a=or(t,n))||a.enumerable});return e};var w=(e,t,o)=>(o=e!=null?tr(nr(e)):{},qt(t||!e||!e.__esModule?Ue(o,"default",{value:e,enumerable:!0}):o,e)),ir=e=>qt(Ue({},"__esModule",{value:!0}),e);var sn={};ar(sn,{AttachTrigger:()=>Uo,Attachment:()=>Bt,AttachmentsRow:()=>$o,InlineEnd:()=>Go,InlineStart:()=>Wo,Root:()=>zo,Row:()=>Ko,RowEnd:()=>qo,RowStart:()=>_o,Send:()=>Yo,Textarea:()=>Ho});module.exports=ir(sn);var r=w(require("react")),U=w(require("classnames")),ie=require("motion/react");var ze=w(require("react")),Eo=w(require("classnames"));var k=w(require("react")),yo=w(require("classnames")),go=require("radix-ui");var oe={asChild:{type:"boolean"}};var Ke=["gray","gold","bronze","brown","yellow","amber","orange","tomato","red","ruby","crimson","pink","plum","purple","violet","iris","indigo","blue","cyan","teal","jade","green","grass","lime","mint","sky"],Yt=["auto","gray","mauve","slate","sage","olive","sand"],Zt={color:{type:"enum",values:Ke,default:void 0}},Xt={color:{type:"enum",values:Ke,default:""}};var _e={highContrast:{type:"boolean",className:"rt-high-contrast",default:void 0}};var yt=["none","small","medium","large","full"],qe={radius:{type:"enum",values:yt,default:void 0}};var pr=["1","2","3","4"],lr=["classic","solid","soft","surface","outline","ghost","override"],cr=["solid","translucent"],mr=["solid","translucent"],gt={...oe,size:{type:"enum",className:"rt-r-size",values:pr,default:"2",responsive:!0},variant:{type:"enum",className:"rt-variant",values:lr,default:"solid"},...Xt,..._e,...qe,loading:{type:"boolean",className:"rt-loading",default:!1},fullWidth:{type:"boolean",className:"rt-full-width",default:!1},material:{type:"enum",values:mr,default:void 0},panelBackground:{type:"enum",values:cr,default:void 0},flush:{type:"boolean",default:!1}};var Je=w(require("react")),ao=w(require("classnames"));var eo=w(require("classnames"));var ur=[],fr=new Set;function dr(e){let t=Object.assign({},...e),o=[],a=[],n=new Set;for(let l in t){let s=t[l],c=s.values??ur,i={key:l,type:s.type,default:s.default,hasDefault:s.default!==void 0,responsive:"responsive"in s,className:s.className,customProperties:s.customProperties,parseValue:s.parseValue,values:c,valueSet:c.length>0?new Set(c):fr,enumValueSet:s.type==="enum"?new Set([s.default,...c]):void 0};s.className?(o.push(i),n.add(l)):(i.hasDefault||s.type==="enum")&&a.push(i)}return{styling:o,passthrough:a,stylingKeys:n}}var yr={children:new WeakMap};function Jt(e){let t=yr;for(let o=0;o<e.length;o++){let a=e[o],n=t.children.get(a);n===void 0&&(n={children:new WeakMap},t.children.set(a,n)),t=n}return t.compiled??(t.compiled=dr(e))}var gr=["initial","xs","sm","md","lg","xl"],ht=new Set(gr);function Pt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var hr=new Set(["initial","xs","sm","md","lg","xl"]);function be(e){if(typeof e!="object"||e===null)return!1;for(let t in e)if(hr.has(t))return!0;return!1}function Ye(e,t,o){return t!==void 0?t.has(o):e.includes(o)}function Ze({className:e,customProperties:t,...o}){let a=ke({allowArbitraryValues:!0,className:e,...o}),n=Pr({customProperties:t,...o});return[a,n]}function ke({allowArbitraryValues:e,value:t,className:o,propValues:a,propValueSet:n,parseValue:l=s=>s}){if(t){if(typeof t=="string")return Ye(a,n,t)?Qt(o,t,l):e?o:void 0;if(be(t)){let s=t,c=[];for(let i in s){if(!Pt(s,i)||!ht.has(i))continue;let p=s[i];if(p!==void 0){if(Ye(a,n,p)){let m=Qt(o,p,l),y=i==="initial"?m:`${i}:${m}`;c.push(y)}else if(e){let m=i==="initial"?o:`${i}:${o}`;c.push(m)}}}return c.length>0?c.join(" "):""}if(e)return o}}function Qt(e,t,o){let a=e?"-":"",n=o(t),l=n?.startsWith("-"),s=l?"-":"",c=l?n?.substring(1):n;return`${s}${e}${a}${c}`}function Pr({customProperties:e,value:t,propValues:o,propValueSet:a,parseValue:n=l=>l}){if(!t||typeof t=="string"&&Ye(o,a,t))return;let l;if(typeof t=="string"){let s=n(t);l={};for(let c of e)l[c]=s;return l}if(be(t)){let s=t;for(let c in s){if(!Pt(s,c)||!ht.has(c))continue;let i=s[c];if(i===void 0||Ye(o,a,i))continue;let p=n(i);l??(l={});for(let m of e){let y=c==="initial"?m:`${m}-${c}`;l[y]=p}}}return l??{}}function Ce(...e){let t;for(let o of e)o&&(t===void 0&&(t={}),Object.assign(t,o));return t}function vr(e,t){let o=e.initial,a=!1;return t.hasDefault&&o===void 0&&(o=t.default,a=!0),t.enumValueSet!==void 0&&!t.enumValueSet.has(o)&&(o=t.default,a=!0),a?{...e,initial:o}:e}function re(e,...t){let{styling:o,passthrough:a,stylingKeys:n}=Jt(t),l={};for(let i in e)n.has(i)||(l[i]=e[i]);for(let i=0;i<a.length;i++){let p=a[i],m=l[p.key];if(m===void 0){p.hasDefault&&(l[p.key]=p.default);continue}p.enumValueSet!==void 0&&!p.enumValueSet.has(m)&&!be(m)&&(l[p.key]=p.default)}let s,c=[];for(let i=0;i<o.length;i++){let p=o[i],m=e[p.key];if(m===void 0&&p.hasDefault&&(m=p.default),p.enumValueSet!==void 0&&!p.enumValueSet.has(m)&&!be(m)&&(m=p.default),!!m){if(be(m)){if(!p.responsive)continue;m=vr(m,p)}if(p.type==="enum"){let y=ke({allowArbitraryValues:!1,value:m,className:p.className,propValues:p.values,propValueSet:p.valueSet,parseValue:p.parseValue});y&&c.push(y);continue}if(p.type==="string"||p.type==="enum | string"){let[y,v]=Ze({className:p.className,customProperties:p.customProperties,propValues:p.type==="string"?[]:p.values,propValueSet:p.type==="string"?void 0:p.valueSet,parseValue:p.parseValue,value:m});v&&(s=Ce(s,v)),y&&c.push(y);continue}if(p.type==="boolean"){c.push(p.className);continue}}}return l.className=(0,eo.default)(c.length>0?c.join(" "):void 0,e.className),l.style=Ce(s,e.style),l}var Re=["0","1","2","3","4","5","6","7","8","9","10","11","12"],to={p:{type:"enum | string",className:"rt-r-p",customProperties:["--p"],values:Re,responsive:!0},px:{type:"enum | string",className:"rt-r-px",customProperties:["--pl","--pr"],values:Re,responsive:!0},py:{type:"enum | string",className:"rt-r-py",customProperties:["--pt","--pb"],values:Re,responsive:!0},pt:{type:"enum | string",className:"rt-r-pt",customProperties:["--pt"],values:Re,responsive:!0},pr:{type:"enum | string",className:"rt-r-pr",customProperties:["--pr"],values:Re,responsive:!0},pb:{type:"enum | string",className:"rt-r-pb",customProperties:["--pb"],values:Re,responsive:!0},pl:{type:"enum | string",className:"rt-r-pl",customProperties:["--pl"],values:Re,responsive:!0}};var oo={height:{type:"string",className:"rt-r-h",customProperties:["--height"],responsive:!0},minHeight:{type:"string",className:"rt-r-min-h",customProperties:["--min-height"],responsive:!0},maxHeight:{type:"string",className:"rt-r-max-h",customProperties:["--max-height"],responsive:!0}};var Fe={width:{type:"string",className:"rt-r-w",customProperties:["--width"],responsive:!0},minWidth:{type:"string",className:"rt-r-min-w",customProperties:["--min-width"],responsive:!0},maxWidth:{type:"string",className:"rt-r-max-w",customProperties:["--max-width"],responsive:!0}};var vt=["visible","hidden","clip","scroll","auto"],br=["static","relative","absolute","fixed","sticky"],Le=["0","1","2","3","4","5","6","7","8","9","-1","-2","-3","-4","-5","-6","-7","-8","-9"],Cr=["0","1"],Rr=["0","1"],xr=["start","center","end","baseline","stretch"],Dr=["start","center","end","baseline","stretch"],ro={...to,...Fe,...oo,position:{type:"enum",className:"rt-r-position",values:br,responsive:!0},inset:{type:"enum | string",className:"rt-r-inset",customProperties:["--inset"],values:Le,responsive:!0},top:{type:"enum | string",className:"rt-r-top",customProperties:["--top"],values:Le,responsive:!0},right:{type:"enum | string",className:"rt-r-right",customProperties:["--right"],values:Le,responsive:!0},bottom:{type:"enum | string",className:"rt-r-bottom",customProperties:["--bottom"],values:Le,responsive:!0},left:{type:"enum | string",className:"rt-r-left",customProperties:["--left"],values:Le,responsive:!0},overflow:{type:"enum",className:"rt-r-overflow",values:vt,responsive:!0},overflowX:{type:"enum",className:"rt-r-ox",values:vt,responsive:!0},overflowY:{type:"enum",className:"rt-r-oy",values:vt,responsive:!0},flexBasis:{type:"string",className:"rt-r-fb",customProperties:["--flex-basis"],responsive:!0},flexShrink:{type:"enum | string",className:"rt-r-fs",customProperties:["--flex-shrink"],values:Cr,responsive:!0},flexGrow:{type:"enum | string",className:"rt-r-fg",customProperties:["--flex-grow"],values:Rr,responsive:!0},gridArea:{type:"string",className:"rt-r-ga",customProperties:["--grid-area"],responsive:!0},gridColumn:{type:"string",className:"rt-r-gc",customProperties:["--grid-column"],responsive:!0},gridColumnStart:{type:"string",className:"rt-r-gcs",customProperties:["--grid-column-start"],responsive:!0},gridColumnEnd:{type:"string",className:"rt-r-gce",customProperties:["--grid-column-end"],responsive:!0},gridRow:{type:"string",className:"rt-r-gr",customProperties:["--grid-row"],responsive:!0},gridRowStart:{type:"string",className:"rt-r-grs",customProperties:["--grid-row-start"],responsive:!0},gridRowEnd:{type:"string",className:"rt-r-gre",customProperties:["--grid-row-end"],responsive:!0},alignSelf:{type:"enum",className:"rt-r-as",values:xr,responsive:!0},justifySelf:{type:"enum",className:"rt-r-js",values:Dr,responsive:!0}};var xe=["0","1","2","3","4","5","6","7","8","9","10","11","12","-1","-2","-3","-4","-5","-6","-7","-8","-9","-10","-11","-12"],ne={m:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-m",customProperties:["--m"]},mx:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mx",customProperties:["--ml","--mr"]},my:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-my",customProperties:["--mt","--mb"]},mt:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mt",customProperties:["--mt"]},mr:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mr",customProperties:["--mr"]},mb:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-mb",customProperties:["--mb"]},ml:{type:"enum | string",values:xe,responsive:!0,className:"rt-r-ml",customProperties:["--ml"]}};var Xe=require("radix-ui"),zn=Xe.Slot.Root,q=Xe.Slot.Root,Hn=Xe.Slot.Slottable;var bt=["0","1","2","3","4","5","6","7","8","9","10","11","12"],no={gap:{type:"enum | string",className:"rt-r-gap",customProperties:["--gap"],values:bt,responsive:!0},gapX:{type:"enum | string",className:"rt-r-cg",customProperties:["--column-gap"],values:bt,responsive:!0},gapY:{type:"enum | string",className:"rt-r-rg",customProperties:["--row-gap"],values:bt,responsive:!0}};var Tr=["div","span"],wr=["none","inline-flex","flex"],Sr=["row","column","row-reverse","column-reverse"],Nr=["start","center","end","baseline","stretch"],Ar=["start","center","end","between"],kr=["nowrap","wrap","wrap-reverse"],so={as:{type:"enum",values:Tr,default:"div"},...oe,display:{type:"enum",className:"rt-r-display",values:wr,responsive:!0},direction:{type:"enum",className:"rt-r-fd",values:Sr,responsive:!0},align:{type:"enum",className:"rt-r-ai",values:Nr,responsive:!0},justify:{type:"enum",className:"rt-r-jc",values:Ar,parseValue:Fr,responsive:!0},wrap:{type:"enum",className:"rt-r-fw",values:kr,responsive:!0},...no};function Fr(e){return e==="between"?"space-between":e}var Y=Je.forwardRef((e,t)=>{let{className:o,asChild:a,as:n="div",...l}=re(e,so,ro,ne);return Je.createElement(a?q:n,{...l,ref:t,className:(0,ao.default)("rt-Flex",o)})});Y.displayName="Flex";var I=w(require("react")),po=w(require("classnames"));var Er=["1","2","3"],io={size:{type:"enum",className:"rt-r-size",values:Er,default:"2",responsive:!0},loading:{type:"boolean",default:!0}};var Ct=I.forwardRef((e,t)=>{let{className:o,children:a,loading:n,...l}=re(e,io,ne);if(!n)return a;let s=I.createElement("span",{...l,ref:t,className:(0,po.default)("rt-Spinner",o)},I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}),I.createElement("span",{className:"rt-SpinnerLeaf"}));return a===void 0?s:I.createElement(Y,{asChild:!0,position:"relative",align:"center",justify:"center"},I.createElement("span",null,I.createElement("span",{"aria-hidden":!0,style:{display:"contents",visibility:"hidden"},inert:void 0},a),I.createElement(Y,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},I.createElement("span",null,s))))});Ct.displayName="Spinner";var Rt=require("radix-ui"),lo=Rt.VisuallyHidden.Root,ss=Rt.VisuallyHidden.Root;var mo=w(require("react")),Br="Warning: The `panelBackground` prop is deprecated and will be removed in a future version. Use `material` prop instead.",co=new Set;function Vr(e){co.has(e)||(co.add(e),console.warn(e))}function Qe(e){mo.useEffect(()=>{},[e])}function uo(e,t){if(e!==void 0)return typeof e=="string"?t(e):Object.fromEntries(Object.entries(e).map(([o,a])=>[o,t(a)]))}function fo(e){switch(e){case"1":return"1";case"2":case"3":return"2";case"4":return"3"}}var xt=k.forwardRef((e,t)=>{let{size:o=gt.size.default}=e,{className:a,children:n,asChild:l,as:s,color:c,radius:i,material:p,panelBackground:m,flush:y,disabled:v=e.loading,...u}=re(e,gt,ne);Qe(e.panelBackground);let h=p??m,R=l?go.Slot.Root:s||"button",V=l||!s||["button","input","textarea","select"].includes(s),D=!l&&(!s||s==="button"),F="type"in u,L=k.useId(),E=e.loading?`${L}-loading`:void 0,j=k.useMemo(()=>typeof n=="string"?n:k.isValidElement(n)&&typeof n.props?.children=="string"?n.props.children:"button",[n]),M=k.useMemo(()=>e.loading?{"aria-busy":!0,"aria-disabled":!0,"aria-describedby":E,"aria-label":`${j} (loading)`}:{},[e.loading,E,j]);return k.createElement(R,{"data-disabled":v||void 0,"data-accent-color":c,"data-radius":i,"data-material":h,"data-panel-background":h,"data-flush":y?"true":void 0,...u,...M,ref:t,className:(0,yo.default)("rt-reset","rt-BaseButton",a),...V&&{disabled:v},...D&&!F?{type:"button"}:{}},e.loading?k.createElement(k.Fragment,null,k.createElement("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0},n),k.createElement(lo,null,k.createElement("span",{id:E},j," is loading, please wait..."),n),k.createElement(Y,{asChild:!0,align:"center",justify:"center",position:"absolute",inset:"0"},k.createElement("span",null,k.createElement(Ct,{size:uo(o,fo),"aria-hidden":"true"})))):n)});xt.displayName="BaseButton";var ae=w(require("react")),ko=w(require("classnames")),Be=require("radix-ui");var De=w(require("react")),Do=require("radix-ui");var Mr=["normal","start","end","both"],ho={trim:{type:"enum",className:"rt-r-lt",values:Mr,responsive:!0}};var Or=["left","center","right"],Po={align:{type:"enum",className:"rt-r-ta",values:Or,responsive:!0}};var Ir=["wrap","nowrap","pretty","balance"],vo={wrap:{type:"enum",className:"rt-r-tw",values:Ir,responsive:!0}};var bo={truncate:{type:"boolean",className:"rt-truncate"}};var jr=["sans","mono","serif"],Co={font:{type:"enum",className:"rt-r-ff",values:jr}};var Lr=["thin","extralight","light","regular","medium","semibold","bold","extrabold"],Ro={weight:{type:"enum",className:"rt-r-weight",values:Lr,responsive:!0}};var zr=["span","div","label","p"],Hr=["0","1","2","3","4","5","6","7","8","9","10","11","12"],xo={as:{type:"enum",values:zr,default:"span"},...oe,size:{type:"enum",className:"rt-r-size",values:Hr,responsive:!0},...Co,...Ro,...Po,...ho,...bo,...vo,...Zt,..._e};var Wr={...xo,...ne},Te=De.memo(De.forwardRef((e,t)=>{let{children:o,className:a,asChild:n,as:l="span",color:s,...c}=re(e,Wr),i=a?`rt-Text ${a}`:"rt-Text";return n?De.createElement(Do.Slot.Root,{"data-accent-color":s,...c,ref:t,className:i},o):De.createElement(l,{"data-accent-color":s,...c,ref:t,className:i},o)}));Te.displayName="Text";var S=w(require("react")),So=w(require("classnames")),Ee=require("radix-ui"),et=require("radix-ui/internal");function To(e){switch(e){case"tomato":case"red":case"ruby":case"crimson":case"pink":case"plum":case"purple":case"violet":return"mauve";case"iris":case"indigo":case"blue":case"sky":case"cyan":return"slate";case"teal":case"jade":case"mint":case"green":return"sage";case"grass":case"lime":return"olive";case"yellow":case"amber":case"orange":case"brown":case"gold":case"bronze":return"sand";case"gray":return"gray"}}var Dt=w(require("react"));function se(e){let[t,o]=Dt.useState(e),[a,n]=Dt.useState(e);return Object.is(e,a)||(n(e),o(e)),[t,o]}var Gr=["inherit","light","dark"],$r=["solid","translucent"],Ur=["solid","translucent"],Kr=["90%","95%","100%","105%","110%"],wo=["sans","mono","serif"],b={...oe,hasBackground:{type:"boolean",default:!0},appearance:{type:"enum",values:Gr,default:"inherit"},accentColor:{type:"enum",values:Ke,default:"blue"},grayColor:{type:"enum",values:Yt,default:"slate"},material:{type:"enum",values:Ur,default:"translucent"},panelBackground:{type:"enum",values:$r,default:"translucent"},radius:{type:"enum",values:yt,default:"medium"},scaling:{type:"enum",values:Kr,default:"100%"},fontFamily:{type:"enum",values:wo,default:"sans"},headingFontFamily:{type:"enum",values:wo}};var O=()=>{},qs={appearance:b.appearance.default,accentColor:b.accentColor.default,grayColor:b.grayColor.default,resolvedGrayColor:b.grayColor.default,material:b.material.default,panelBackground:b.panelBackground.default,radius:b.radius.default,scaling:b.scaling.default,fontFamily:b.fontFamily.default,headingFontFamily:void 0,onAppearanceChange:O,onAccentColorChange:O,onGrayColorChange:O,onMaterialChange:O,onPanelBackgroundChange:O,onRadiusChange:O,onScalingChange:O,onFontFamilyChange:O,onHeadingFontFamilyChange:O},Tt=S.createContext(void 0);var wt=S.forwardRef((e,t)=>S.useContext(Tt)===void 0?S.createElement(Ee.Tooltip.Provider,{delayDuration:200},S.createElement(Ee.Direction.Provider,{dir:"ltr"},S.createElement(No,{...e,ref:t}))):S.createElement(St,{...e,ref:t}));wt.displayName="Theme";var No=S.forwardRef((e,t)=>{let{appearance:o=b.appearance.default,accentColor:a=b.accentColor.default,grayColor:n=b.grayColor.default,material:l=b.material.default,panelBackground:s=b.panelBackground.default,radius:c=b.radius.default,scaling:i=b.scaling.default,fontFamily:p=b.fontFamily.default,headingFontFamily:m,hasBackground:y=b.hasBackground.default,...v}=e;Qe(e.panelBackground);let[u,h]=se(o),[R,V]=se(a),[D,F]=se(n),L=l!==b.material.default?l:s,[E,j]=se(L),[M,G]=se(E),[Z,pe]=se(c),[X,le]=se(i),[ve,z]=se(p),[J,H]=se(m);return S.createElement(St,{...v,ref:t,isRoot:!0,hasBackground:y,appearance:u,accentColor:R,grayColor:D,material:E,panelBackground:M,radius:Z,scaling:X,fontFamily:ve,headingFontFamily:J,onAppearanceChange:h,onAccentColorChange:V,onGrayColorChange:F,onMaterialChange:j,onPanelBackgroundChange:G,onRadiusChange:pe,onScalingChange:le,onFontFamilyChange:z,onHeadingFontFamilyChange:H})});No.displayName="ThemeRoot";function _r(){if(typeof navigator>"u")return;let e=navigator.userAgent;if(e.includes("Win"))return"windows";if(e.includes("Mac"))return"macos";if(e.includes("Linux"))return"linux"}var St=S.forwardRef((e,t)=>{let o=S.useContext(Tt),{asChild:a,isRoot:n,hasBackground:l,appearance:s=e.appearance??o?.appearance??b.appearance.default,accentColor:c=e.accentColor??o?.accentColor??b.accentColor.default,grayColor:i=e.grayColor??o?.resolvedGrayColor??b.grayColor.default,material:p=e.material??o?.material??b.material.default,panelBackground:m=e.panelBackground??o?.panelBackground??b.panelBackground.default,radius:y=e.radius??o?.radius??b.radius.default,scaling:v=e.scaling??o?.scaling??b.scaling.default,fontFamily:u=e.fontFamily??o?.fontFamily??b.fontFamily.default,headingFontFamily:h=e.headingFontFamily??o?.headingFontFamily,onAppearanceChange:R=O,onAccentColorChange:V=O,onGrayColorChange:D=O,onMaterialChange:F=O,onPanelBackgroundChange:L=O,onRadiusChange:E=O,onScalingChange:j=O,onFontFamilyChange:M=O,onHeadingFontFamilyChange:G=O,...Z}=e,pe=a?Ee.Slot.Root:"div",X=i==="auto"?To(c):i,le=e.appearance==="light"||e.appearance==="dark",ve=l===void 0?n||le:l,z=S.useRef(null),J=(0,et.useComposedRefs)(t,z),H="data-os"in Z;return(0,et.useLayoutEffect)(()=>{if(!n||H)return;let B=z.current;if(!B)return;let C=_r();if(C)return B.setAttribute("data-os",C),()=>B.removeAttribute("data-os")},[n,H]),S.createElement(Tt.Provider,{value:S.useMemo(()=>({appearance:s,accentColor:c,grayColor:i,resolvedGrayColor:X,material:p,panelBackground:m,radius:y,scaling:v,fontFamily:u,headingFontFamily:h,onAppearanceChange:R,onAccentColorChange:V,onGrayColorChange:D,onMaterialChange:F,onPanelBackgroundChange:L,onRadiusChange:E,onScalingChange:j,onFontFamilyChange:M,onHeadingFontFamilyChange:G}),[s,c,i,X,p,m,y,v,u,h,R,V,D,F,L,E,j,M,G])},S.createElement(pe,{"data-is-root-theme":n?"true":"false","data-accent-color":c,"data-gray-color":X,"data-has-background":ve?"true":"false","data-material":p,"data-panel-background":m,"data-radius":y,"data-scaling":v,"data-font-family":u,"data-heading-font-family":h,ref:J,...Z,className:(0,So.default)("radix-themes",{light:s==="light",dark:s==="dark"},Z.className)}))});St.displayName="ThemeImpl";var Ao={content:{type:"ReactNode",required:!0},width:Fe.width,minWidth:Fe.minWidth,maxWidth:{...Fe.maxWidth,default:"360px"}};var Nt=ae.forwardRef((e,t)=>{let{children:o,className:a,open:n,defaultOpen:l,onOpenChange:s,delayDuration:c,disableHoverableContent:i,content:p,container:m,forceMount:y,...v}=re(e,Ao),u={open:n,defaultOpen:l,onOpenChange:s,delayDuration:c,disableHoverableContent:i};return ae.createElement(Be.Tooltip.Root,{...u},ae.createElement(Be.Tooltip.Trigger,{asChild:!0},o),ae.createElement(Be.Tooltip.Portal,{container:m,forceMount:y},ae.createElement(wt,{asChild:!0},ae.createElement(Be.Tooltip.Content,{sideOffset:4,collisionPadding:10,...v,asChild:!1,ref:t,className:(0,ko.default)("rt-TooltipContent",a)},ae.createElement(Te,{as:"p",className:"rt-TooltipText",size:"1"},p),ae.createElement(Be.Tooltip.Arrow,{className:"rt-TooltipArrow"})))))});Nt.displayName="Tooltip";var tt=w(require("react"));function Fo(e){let t=tt.useId(),o=!!e,a=tt.useMemo(()=>o?{"aria-describedby":t}:{},[o,t]);return{tooltipId:t,hasTooltip:o,accessibilityProps:a}}var ot=ze.forwardRef(({className:e,tooltip:t,tooltipSide:o="top",tooltipAlign:a="center",tooltipDelayDuration:n,tooltipDisableHoverableContent:l,...s},c)=>{let{tooltipId:i,hasTooltip:p,accessibilityProps:m}=Fo(t),y="aria-label"in s&&s["aria-label"],v="aria-labelledby"in s&&s["aria-labelledby"],u="children"in s&&s.children;!y&&!v&&!u&&console.error(`IconButton: Icon buttons must have an accessible name. Please provide either:
2
2
  - aria-label prop with descriptive text
3
3
  - aria-labelledby prop referencing a label element
4
- - or visible text children`);let g=We.createElement(Ct,{...i,...f,ref:a,className:(0,To.default)("rt-IconButton",e)});return u?We.createElement(Tt,{content:t,side:r,align:p,delayDuration:n,disableHoverableContent:l,id:s},g):g});et.displayName="IconButton";var h=S(require("react")),Vr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));Vr.displayName="ThickDividerHorizontalIcon";var Ir=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Ir.displayName="ThickCheckIcon";var Fr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));Fr.displayName="ChevronDownIcon";var jr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));jr.displayName="ThickChevronRightIcon";var Lr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));Lr.displayName="ThickChevronLeftIcon";var zr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},h.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));zr.displayName="ThickDotIcon";var wt=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M18 6 6 18"}),h.default.createElement("path",{d:"m6 6 12 12"})));wt.displayName="CloseIcon";var Hr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));Hr.displayName="PaperclipIcon";var Wr=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));Wr.displayName="FileIcon";var Nt=h.default.forwardRef((e,t)=>h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),h.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),h.default.createElement("path",{d:"M10 9H8"}),h.default.createElement("path",{d:"M16 13H8"}),h.default.createElement("path",{d:"M16 17H8"})));Nt.displayName="FileTextIcon";var W=S(require("react")),ot=S(require("classnames")),Pe=require("radix-ui");var Gr=["1","2","3"],$r=["vertical","horizontal","both"],Ve={...ne,size:{type:"enum",className:"rt-r-size",values:Gr,default:"1",responsive:!0},...Ye,scrollbars:{type:"enum",values:$r,default:"both"}};function wo(e){let{m:t,mx:r,my:p,mt:n,mr:l,mb:i,ml:a,...s}=e;return{m:t,mx:r,my:p,mt:n,mr:l,mb:i,ml:a,rest:s}}var No=S(require("classnames"));var we=ie.m.values;function So(e){let[t,r]=se({className:"rt-r-m",customProperties:["--margin"],propValues:we,value:e.m}),[p,n]=se({className:"rt-r-mx",customProperties:["--margin-left","--margin-right"],propValues:we,value:e.mx}),[l,i]=se({className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"],propValues:we,value:e.my}),[a,s]=se({className:"rt-r-mt",customProperties:["--margin-top"],propValues:we,value:e.mt}),[u,f]=se({className:"rt-r-mr",customProperties:["--margin-right"],propValues:we,value:e.mr}),[P,b]=se({className:"rt-r-mb",customProperties:["--margin-bottom"],propValues:we,value:e.mb}),[c,g]=se({className:"rt-r-ml",customProperties:["--margin-left"],propValues:we,value:e.ml});return[(0,No.default)(t,p,l,a,u,P,c),Ce(r,n,i,s,f,b,g)]}var tt=S(require("react"));function Ao(e,t){let{asChild:r,children:p}=e;if(!r)return typeof t=="function"?t(p):t;let n=tt.Children.only(p);return tt.cloneElement(n,{children:typeof t=="function"?t(n.props.children):t})}var St=W.forwardRef((e,t)=>{let{rest:r,...p}=wo(e),[n,l]=So(p),{asChild:i,children:a,className:s,style:u,type:f,scrollHideDelay:P=f!=="scroll"?0:void 0,dir:b,size:c=Ve.size.default,radius:g=Ve.radius.default,scrollbars:R=Ve.scrollbars.default,...M}=r;return W.createElement(Pe.ScrollArea.Root,{type:f,scrollHideDelay:P,className:(0,ot.default)("rt-ScrollAreaRoot",n,s),style:Ce(l,u),asChild:i},Ao({asChild:i,children:a},D=>W.createElement(W.Fragment,null,W.createElement(Pe.ScrollArea.Viewport,{...M,ref:t,className:"rt-ScrollAreaViewport"},D),W.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),R!=="vertical"?W.createElement(Pe.ScrollArea.Scrollbar,{"data-radius":g,orientation:"horizontal",className:(0,ot.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:c,propValues:Ve.size.values}))},W.createElement(Pe.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,R!=="horizontal"?W.createElement(Pe.ScrollArea.Scrollbar,{"data-radius":g,orientation:"vertical",className:(0,ot.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:c,propValues:Ve.size.values}))},W.createElement(Pe.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,R==="both"?W.createElement(Pe.ScrollArea.Corner,{className:"rt-ScrollAreaCorner"}):null)))});St.displayName="ScrollArea";var Eo=require("react-dropzone"),At=typeof window<"u"?o.useLayoutEffect:o.useEffect,ko=o.createContext(null),be=()=>{let e=o.useContext(ko);if(!e)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return e},Bo=o.forwardRef((e,t)=>{let{className:r,style:p,children:n,value:l,defaultValue:i="",onValueChange:a,open:s,defaultOpen:u=!1,onOpenChange:f,expandOn:P="both",minLines:b=3,maxLines:c=6,sendMode:g="whenDirty",disabled:R,readOnly:M,onSubmit:D,size:A="2",variant:F,color:V,radius:H,panelBackground:E,material:j,width:G,maxWidth:O,asChild:Q,attachments:$,defaultAttachments:ee=[],onAttachmentsChange:q,accept:fe,multiple:_=!0,maxAttachments:z,maxFileSize:N,paste:Ge=!0,pasteAccept:Ne,clearOnSubmit:$e=!0,onAttachmentReject:de,dropzone:ce=!0,apiRef:d,...T}=e,k=j||E,B=l!=null,[te,rt]=o.useState(i),Se=B?l:te,Z=s!=null,[Ie,Ae]=o.useState(u),Ee=Z?s:Ie,nt=o.useRef(null),Ue=o.useRef(null),st=o.useRef(!1),ye="attachments"in e,[kt,Bt]=o.useState(ee),ge=o.useMemo(()=>ye?$??[]:kt,[ye,$,kt]),Ke=o.useRef(new Set),at=m=>Array.isArray(m)?m:typeof m=="string"?m.split(",").map(v=>v.trim()):[],Fe=at(fe),Mt=at(Ne).length>0?at(Ne):Fe,Ot=(m,v)=>{if(v.length===0)return!0;let Y=m.type.toLowerCase(),me=m.name.toLowerCase();for(let oe of v){let U=oe.toLowerCase();if(U.includes("/")){let[re,ue]=U.split("/"),[w,Le]=Y.split("/");if(re==="*"||re===w&&(ue==="*"||ue===Le))return!0}else if(U.startsWith(".")&&me.endsWith(U))return!0}return!1},it=o.useRef(ge);it.current=ge;let pt=o.useRef(Fe);pt.current=Fe;let Vt=o.useRef(Mt);Vt.current=Mt;let lt=o.useRef(z);lt.current=z;let ct=o.useRef(N);ct.current=N;let mt=o.useRef(de);mt.current=de;let It=o.useRef(q);It.current=q;let Ft=o.useRef(f);Ft.current=f;let je=o.useCallback(m=>{let v=it.current,Y=pt.current,me=lt.current,oe=ct.current,U=[],re=[],ue=typeof me=="number"?Math.max(me-v.length,0):1/0;for(let w of m){if(U.length>=ue){re.push({file:w,reason:"count"});continue}if(typeof oe=="number"&&w.size>oe){re.push({file:w,reason:"size"});continue}if(!Ot(w,Y)){re.push({file:w,reason:"type"});continue}let Le=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,he=/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(w.name),ut=(w.type||"").toLowerCase().startsWith("image/")||he?URL.createObjectURL(w):void 0;ut&&Ke.current.add(ut),U.push({id:Le,name:w.name,size:w.size,type:w.type,file:w,url:ut,status:"idle"})}if(U.length>0){let w=v.concat(U);ye||Bt(w),It.current?.(w),Z||Ae(!0),Ft.current?.(!0)}re.length>0&&mt.current?.(re)},[ye,Z]),jt=o.useCallback(m=>{let v=pt.current,Y=Vt.current,me=lt.current,oe=ct.current,U=it.current,re=Y.length>0?Y:v,ue=[],w=[],Le=typeof me=="number"?Math.max(me-U.length,0):1/0;for(let he of m){if(ue.length>=Le){w.push({file:he,reason:"count"});continue}if(typeof oe=="number"&&he.size>oe){w.push({file:he,reason:"size"});continue}if(!Ot(he,re)){w.push({file:he,reason:"type"});continue}ue.push(he)}ue.length>0&&je(ue),w.length>0&&mt.current?.(w)},[je]);o.useEffect(()=>{let m=new Set(ge.map(v=>v.url).filter(Boolean));for(let v of Array.from(Ke.current))m.has(v)||(URL.revokeObjectURL(v),Ke.current.delete(v))},[ge]),o.useEffect(()=>{let m=Ke.current;return()=>{for(let v of Array.from(m))URL.revokeObjectURL(v);m.clear()}},[]);let Wo=Q?X:"div",Lt=o.useCallback(m=>{Z||Ae(m),f?.(m)},[Z,f]),zt=o.useCallback(m=>{B||rt(m),a?.(m)},[B,a]),Ht=o.useCallback(m=>{ye||Bt(m),q?.(m)},[ye,q]),Go=o.useCallback(m=>{let v=m.relatedTarget,Y=nt.current;Y&&(v&&Y.contains(v)||st.current||(Se?.trim?.()??"").length===0&&ge.length===0&&(Z||Ae(!1),f?.(!1)))},[Z,f,Se,ge]),{getRootProps:$o,getInputProps:Uo,isDragActive:Wt,open:Gt}=(0,Eo.useDropzone)({onDrop:(m,v)=>{if(m.length>0&&je(m),v.length>0&&de){let Y=v.map(({file:me,errors:oe})=>{let U=oe[0]?.code==="file-too-large"?"size":oe[0]?.code==="file-invalid-type"?"type":"count";return{file:me,reason:U}});de(Y)}},accept:Fe.length>0?Fe.reduce((m,v)=>(v.includes("/")?m[v]=[]:v.startsWith(".")&&(m[v]=[]),m),{}):void 0,multiple:_,maxSize:N,noClick:!0,noKeyboard:!0,disabled:!ce||R});o.useImperativeHandle(d,()=>({focusTextarea:()=>Ue.current?.focus({preventScroll:!0}),openFilePicker:()=>{st.current=!0,Gt()}}),[Gt]);let $t=o.useCallback(m=>{if(!(m instanceof Element))return!1;let v=m;return v.closest(".rt-ChatbarDropOverlay")?!0:!!v.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')},[]),Ko=o.useCallback(m=>{R||$t(m.target)||m.pointerType==="mouse"&&m.button!==0||(m.preventDefault(),Ue.current?.focus({preventScroll:!0}))},[R,$t,Ue]);return o.createElement(ko.Provider,{value:o.useMemo(()=>({open:Ee,setOpen:Lt,isOpenControlled:Z,value:Se,setValue:zt,isValueControlled:B,size:A,expandOn:P,minLines:b,maxLines:c,sendMode:g,disabled:R,readOnly:M,onSubmit:D,rootRef:nt,textareaRef:Ue,attachments:ge,setAttachments:Ht,isAttachmentsControlled:ye,accept:fe,multiple:_,maxAttachments:z,maxFileSize:N,paste:Ge,pasteAccept:Ne,clearOnSubmit:$e,onAttachmentReject:de,dropzone:ce,appendFiles:je,appendFilesFromPaste:jt,fileDialogOpenRef:st}),[Ee,Lt,Z,Se,zt,B,A,P,b,c,g,R,M,D,ge,Ht,ye,fe,_,z,N,Ge,Ne,$e,de,ce,je,jt])},o.createElement(le.LazyMotion,{features:le.domAnimation},o.createElement(Wo,{...T,ref:m=>{typeof t=="function"?t(m):t&&(t.current=m),nt.current=m},className:(0,K.default)("rt-ChatbarRoot",`rt-r-size-${A}`,r),style:{position:"relative",width:G,maxWidth:O,...p},"data-state":Ee?"open":"closed","data-disabled":R?"":void 0,"data-readonly":M?"":void 0,"data-drop-active":ce&&Wt?"":void 0,"data-accent-color":V,"data-radius":H,"data-panel-background":k,"data-material":k,"aria-expanded":Ee,onBlurCapture:Go},ce&&o.createElement("input",{...Uo()}),o.createElement("div",{...ce?$o():{},style:{width:"100%",height:"100%"},onPointerDown:Ko},o.createElement(le.m.div,{className:(0,K.default)("rt-ChatbarBox",`rt-variant-${F??"surface"}`),style:{position:"relative"},"data-accent-color":V,"data-radius":H,"data-panel-background":k,"data-material":k,layout:!0,transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(le.m.div,{className:"rt-ChatbarGrid",layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},n),ce&&Wt&&o.createElement("div",{className:"rt-ChatbarDropOverlay"},o.createElement("div",{className:"rt-ChatbarDropContent"},o.createElement(Te,{color:"gray",size:A,weight:"medium"},"Drop files here to attach"))))))))});Bo.displayName="Chatbar.Root";var Mo=o.forwardRef((e,t)=>{let{className:r,style:p,asChild:n,onFocus:l,onInput:i,onChange:a,onPaste:s,onKeyDown:u,submitOnEnter:f=!1,rows:P,...b}=e,c=be(),{open:g,minLines:R,maxLines:M,expandOn:D,disabled:A,readOnly:F,setOpen:V,setValue:H,textareaRef:E,value:j,isValueControlled:G,sendMode:O,paste:Q,appendFilesFromPaste:$,size:ee}=c,q=o.useRef(0),fe=o.useRef(0),_=o.useRef(0),z=o.useCallback(()=>{let d=E.current;if(!d)return;let T=window.getComputedStyle(d),k=parseFloat(T.lineHeight)||20,B=parseFloat(T.paddingTop)||0,te=parseFloat(T.paddingBottom)||0;q.current=k,fe.current=B+te,_.current=Math.ceil(1*k)+B+te},[E]),N=o.useCallback(d=>{let T=E.current;if(!T)return;T.style.height="auto",q.current===0&&z();let k=q.current,B=fe.current,te=d??g,rt=te?R:1,Se=te?M:1,Z=Math.ceil(rt*k)+B,Ie=Math.ceil(Se*k)+B,Ae=Math.max(T.scrollHeight,Z),Ee=Math.min(Ae,Ie);T.style.height=`${Ee}px`,Ae>Ie?(T.style.overflowY="auto",T.style.maxHeight=`${Ie}px`):(T.style.overflowY="hidden",T.style.maxHeight="none")},[g,R,M,E,z]);At(()=>{N()},[N,j,g]),At(()=>{if(!(D==="overflow"||D==="both")||g)return;let d=E.current;if(!d)return;d.style.height="auto",_.current===0&&z(),d.scrollHeight>_.current+1&&(V(!0),N(!0),requestAnimationFrame(()=>N(!0)))},[j,D,g,V,E,z,N]),At(()=>{z(),N()},[z,N,ee]),o.useEffect(()=>{let d=E.current;if(!d||typeof ResizeObserver>"u")return;let T=q.current,k=new ResizeObserver(()=>{let B=window.getComputedStyle(d),te=parseFloat(B.lineHeight)||20;te!==T&&(T=te,z(),requestAnimationFrame(()=>N()))});return k.observe(d),()=>k.disconnect()},[E,z,N]),o.useEffect(()=>{},[]);let Ge=o.useCallback(d=>{A||F||((D==="focus"||D==="both")&&!g&&V(!0),l?.(d))},[A,F,D,g,V,l]),Ne=o.useCallback(d=>{let T=d.currentTarget,k=T.value;H(k),(D==="overflow"||D==="both")&&!g&&(T.style.height="auto",_.current===0&&z(),T.scrollHeight>_.current+1&&(V(!0),N(!0),requestAnimationFrame(()=>N(!0)))),requestAnimationFrame(()=>N()),a?.(d)},[D,g,V,H,a,N,z]),$e=o.useCallback(d=>{if(Q){let k=Array.from(d.clipboardData?.items??[]).filter(B=>B.kind==="file").map(B=>B.getAsFile()).filter(B=>!!B);k.length>0&&(d.preventDefault(),$(k))}setTimeout(()=>{g?N():N(!0)},0),s?.(d)},[Q,g,N,s,$]),de=o.useCallback(d=>{if(!f){u?.(d);return}if(d.key==="Enter"&&!d.shiftKey&&!d.altKey&&!d.ctrlKey&&!d.metaKey&&!d.nativeEvent.isComposing){if(A||F){u?.(d);return}if(O==="never"){u?.(d);return}let k=j.trim().length>0||c.attachments.length>0;if(O==="whenDirty"&&!k){u?.(d);return}d.preventDefault(),c.onSubmit?.({value:j,attachments:c.attachments}),c.clearOnSubmit&&(G||H(""),c.setAttachments([]))}u?.(d)},[f,A,F,O,j,G,H,c,u]),ce=n?X:"textarea";return o.createElement(le.m.div,{className:(0,K.default)("rt-ChatbarField","rt-ChatbarTextarea",r),layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(ce,{...b,ref:d=>{typeof t=="function"?t(d):t&&(t.current=d),E.current=d},className:"rt-ChatbarInput",value:j,onInput:i,onChange:Ne,onFocus:Ge,onPaste:$e,onKeyDown:de,disabled:A,readOnly:F,rows:g?R:1,spellCheck:b.spellCheck??!0,autoCorrect:b.autoCorrect??"on",style:p}))});Mo.displayName="Chatbar.Textarea";var Oo=o.forwardRef((e,t)=>{let{children:r,asChild:p,style:n,className:l,...i}=e;return be().open?null:o.createElement(p?X:"div",{...i,ref:t,className:(0,K.default)("rt-ChatbarInlineStart",l),style:n},r)});Oo.displayName="Chatbar.InlineStart";var Vo=o.forwardRef((e,t)=>{let{children:r,asChild:p,style:n,className:l,...i}=e;return be().open?null:o.createElement(p?X:"div",{...i,ref:t,className:(0,K.default)("rt-ChatbarInlineEnd",l),style:n},r)});Vo.displayName="Chatbar.InlineEnd";var Io=o.forwardRef((e,t)=>{let{asChild:r,forceMount:p,renderAttachment:n,className:l,style:i,...a}=e,s=be();if(!(s.attachments.length>0)&&!p)return null;let f=r?X:"div";return o.createElement(le.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(f,{...a,ref:t,className:(0,K.default)("rt-ChatbarAttachmentsRow",l),style:i,role:"list","aria-label":a["aria-label"]??"Attachments"},o.createElement(St,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},o.createElement(J,{align:"center",gap:"2",style:{minWidth:"fit-content"}},s.attachments.map(P=>o.createElement(Et,{key:P.id,attachment:P,asChild:!!n},n?.(P)))))))});Io.displayName="Chatbar.AttachmentsRow";var Et=o.forwardRef((e,t)=>{let{attachment:r,asChild:p,className:n,style:l,children:i,...a}=e,s=be(),u=p?X:"div",f=!!r.url&&r.type.startsWith("image/");return o.createElement(u,{...a,ref:t,className:(0,K.default)("rt-ChatbarAttachment",n),style:l,role:"listitem","data-kind":f?"image":"file",title:r.name},i??o.createElement(J,{align:"center",gap:"2",pr:f?void 0:"6"},o.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},f?o.createElement("img",{className:"rt-ChatbarAttachmentImage",src:r.url,alt:""}):o.createElement(Nt,null)),!f&&o.createElement(J,{direction:"column",gap:"0",style:{minWidth:0}},o.createElement(Te,{size:s.size,weight:"medium",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},r.name),o.createElement(Te,{size:"1",color:"gray"},Math.ceil(r.size/1024)," KB")),o.createElement(et,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${r.name}`,size:"1",variant:"classic",highContrast:!0,color:"gray",onClick:()=>s.setAttachments(s.attachments.filter(P=>P.id!==r.id))},o.createElement(wt,null))))});Et.displayName="Chatbar.Attachment";var Fo=o.forwardRef((e,t)=>{let{asChild:r,accept:p,multiple:n,className:l,style:i,...a}=e,s=be(),u=o.useRef(null),f=r?X:"button",P=p??s.accept,b=(Array.isArray(P)?P:P?.split(",")??[]).join(",");return o.useEffect(()=>{let c=()=>{s.fileDialogOpenRef.current=!1};return window.addEventListener("focus",c),()=>window.removeEventListener("focus",c)},[s.fileDialogOpenRef]),o.createElement(o.Fragment,null,o.createElement(f,{...a,ref:t,className:(0,K.default)("rt-ChatbarAttachTrigger",l),style:i,type:a.type??"button","aria-label":a["aria-label"]??"Add attachments",onPointerDown:c=>{s.fileDialogOpenRef.current=!0,a.onPointerDown?.(c)},onMouseDown:c=>{s.fileDialogOpenRef.current=!0,a.onMouseDown?.(c)},onClick:c=>{s.fileDialogOpenRef.current=!0,u.current&&u.current.click(),a.onClick?.(c)}}),o.createElement("input",{ref:u,type:"file",accept:b,multiple:n??s.multiple,tabIndex:-1,style:{display:"none"},onChange:c=>{let g=Array.from(c.currentTarget.files??[]);g.length>0&&s.appendFiles(g),s.fileDialogOpenRef.current=!1,c.currentTarget.value=""}}))});Fo.displayName="Chatbar.AttachTrigger";var jo=o.forwardRef((e,t)=>{let{asChild:r,children:p,className:n,style:l,...i}=e;if(!be().open)return null;let s=r?X:"div";return o.createElement(le.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},o.createElement(s,{...i,ref:t,className:(0,K.default)("rt-ChatbarRow",n),style:l},o.createElement(J,{align:"center",justify:"between",width:"100%"},p)))});jo.displayName="Chatbar.Row";var Lo=o.forwardRef((e,t)=>{let{className:r,style:p,...n}=e;return o.createElement("div",{...n,ref:t,className:(0,K.default)("rt-ChatbarRowStart",r),style:p})});Lo.displayName="Chatbar.RowStart";var zo=o.forwardRef((e,t)=>{let{className:r,style:p,...n}=e;return o.createElement("div",{...n,ref:t,className:(0,K.default)("rt-ChatbarRowEnd",r),style:p})});zo.displayName="Chatbar.RowEnd";var Ho=o.forwardRef((e,t)=>{let{asChild:r,clearOnSend:p=!0,disabled:n,children:l,className:i,style:a,size:s,variant:u,"aria-label":f,"aria-labelledby":P,...b}=e,c=be(),R=c.value.trim().length>0||c.attachments.length>0,M=c.sendMode==="always"||c.sendMode==="whenDirty"&&R;if(c.sendMode==="never")return null;let D=A=>{c.disabled||c.readOnly||(c.onSubmit?.({value:c.value,attachments:c.attachments}),p&&(c.isValueControlled||c.setValue(""),c.clearOnSubmit&&c.setAttachments([])),b.onClick?.(A))};return o.createElement(et,{...b,ref:t,size:s??c.size,variant:u??(c.open?"solid":"ghost"),disabled:n||c.disabled||c.readOnly,className:(0,K.default)("rt-ChatbarSend",i),style:{opacity:M?1:0,pointerEvents:M?"auto":"none",...a},asChild:r,onClick:D,"aria-label":f??(P?void 0:"Send"),"aria-labelledby":P},l??o.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-arrow-right-icon lucide-arrow-right"},o.createElement("path",{d:"M5 12h14"}),o.createElement("path",{d:"m12 5 7 7-7 7"})))});Ho.displayName="Chatbar.Send";
4
+ - or visible text children`);let h=ze.createElement(xt,{...s,...m,ref:c,className:(0,Eo.default)("rt-IconButton",e)});return p?ze.createElement(Nt,{content:t,side:o,align:a,delayDuration:n,disableHoverableContent:l,id:i},h):h});ot.displayName="IconButton";var g=w(require("react")),qr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 4.5C0.75 4.08579 1.08579 3.75 1.5 3.75H7.5C7.91421 3.75 8.25 4.08579 8.25 4.5C8.25 4.91421 7.91421 5.25 7.5 5.25H1.5C1.08579 5.25 0.75 4.91421 0.75 4.5Z"})));qr.displayName="ThickDividerHorizontalIcon";var Yr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.53547 0.62293C8.88226 0.849446 8.97976 1.3142 8.75325 1.66099L4.5083 8.1599C4.38833 8.34356 4.19397 8.4655 3.9764 8.49358C3.75883 8.52167 3.53987 8.45309 3.3772 8.30591L0.616113 5.80777C0.308959 5.52987 0.285246 5.05559 0.563148 4.74844C0.84105 4.44128 1.31533 4.41757 1.62249 4.69547L3.73256 6.60459L7.49741 0.840706C7.72393 0.493916 8.18868 0.396414 8.53547 0.62293Z"})));Yr.displayName="ThickCheckIcon";var Zr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{d:"M0.135232 3.15803C0.324102 2.95657 0.640521 2.94637 0.841971 3.13523L4.5 6.56464L8.158 3.13523C8.3595 2.94637 8.6759 2.95657 8.8648 3.15803C9.0536 3.35949 9.0434 3.67591 8.842 3.86477L4.84197 7.6148C4.64964 7.7951 4.35036 7.7951 4.15803 7.6148L0.158031 3.86477C-0.0434285 3.67591 -0.0536285 3.35949 0.135232 3.15803Z"})));Zr.displayName="ChevronDownIcon";var Xr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.23826 0.201711C3.54108 -0.0809141 4.01567 -0.0645489 4.29829 0.238264L7.79829 3.98826C8.06724 4.27642 8.06724 4.72359 7.79829 5.01174L4.29829 8.76174C4.01567 9.06455 3.54108 9.08092 3.23826 8.79829C2.93545 8.51567 2.91909 8.04108 3.20171 7.73826L6.22409 4.5L3.20171 1.26174C2.91909 0.958928 2.93545 0.484337 3.23826 0.201711Z"})));Xr.displayName="ThickChevronRightIcon";var Jr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.76174 0.201711C5.45892 -0.0809141 4.98433 -0.0645489 4.70171 0.238264L1.20171 3.98826C0.932757 4.27642 0.932757 4.72359 1.20171 5.01174L4.70171 8.76174C4.98433 9.06455 5.45892 9.08092 5.76174 8.79829C6.06455 8.51567 6.08091 8.04108 5.79829 7.73826L2.77591 4.5L5.79829 1.26174C6.08091 0.958928 6.06455 0.484337 5.76174 0.201711Z"})));Jr.displayName="ThickChevronLeftIcon";var Qr=g.default.forwardRef((e,t)=>g.default.createElement("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",...e,ref:t},g.default.createElement("circle",{cx:"4.5",cy:"4.5",r:"2"})));Qr.displayName="ThickDotIcon";var At=g.default.forwardRef((e,t)=>g.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"M18 6 6 18"}),g.default.createElement("path",{d:"m6 6 12 12"})));At.displayName="CloseIcon";var en=g.default.forwardRef((e,t)=>g.default.createElement("svg",{...e,ref:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"})));en.displayName="PaperclipIcon";var tn=g.default.forwardRef((e,t)=>g.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),g.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"})));tn.displayName="FileIcon";var kt=g.default.forwardRef((e,t)=>g.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g.default.createElement("path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}),g.default.createElement("path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}),g.default.createElement("path",{d:"M10 9H8"}),g.default.createElement("path",{d:"M16 13H8"}),g.default.createElement("path",{d:"M16 17H8"})));kt.displayName="FileTextIcon";var W=w(require("react")),nt=w(require("classnames")),he=require("radix-ui");var on=["1","2","3"],rn=["vertical","horizontal","both"],Ve={...oe,size:{type:"enum",className:"rt-r-size",values:on,default:"1",responsive:!0},...qe,scrollbars:{type:"enum",values:rn,default:"both"}};function Bo(e){let{m:t,mx:o,my:a,mt:n,mr:l,mb:s,ml:c,...i}=e;return{m:t,mx:o,my:a,mt:n,mr:l,mb:s,ml:c,rest:i}}var Mo=ne.m.values,nn=new Set(Mo),Vo=[{key:"m",className:"rt-r-m",customProperties:["--margin"]},{key:"mx",className:"rt-r-mx",customProperties:["--margin-left","--margin-right"]},{key:"my",className:"rt-r-my",customProperties:["--margin-top","--margin-bottom"]},{key:"mt",className:"rt-r-mt",customProperties:["--margin-top"]},{key:"mr",className:"rt-r-mr",customProperties:["--margin-right"]},{key:"mb",className:"rt-r-mb",customProperties:["--margin-bottom"]},{key:"ml",className:"rt-r-ml",customProperties:["--margin-left"]}];function Oo(e){let t,o;for(let a=0;a<Vo.length;a++){let{key:n,className:l,customProperties:s}=Vo[a],c=e[n];if(c===void 0)continue;let[i,p]=Ze({className:l,customProperties:s,propValues:Mo,propValueSet:nn,value:c});i&&(t??(t=[])).push(i),p&&(o=Ce(o,p))}return[t!==void 0?t.join(" "):"",o]}var rt=w(require("react"));function Io(e,t){let{asChild:o,children:a}=e;if(!o)return typeof t=="function"?t(a):t;let n=rt.Children.only(a);return rt.cloneElement(n,{children:typeof t=="function"?t(n.props.children):t})}var Ft=W.forwardRef((e,t)=>{let{rest:o,...a}=Bo(e),[n,l]=Oo(a),{asChild:s,children:c,className:i,style:p,type:m,scrollHideDelay:y=m!=="scroll"?0:void 0,dir:v,size:u=Ve.size.default,radius:h=Ve.radius.default,scrollbars:R=Ve.scrollbars.default,...V}=o;return W.createElement(he.ScrollArea.Root,{type:m,scrollHideDelay:y,className:(0,nt.default)("rt-ScrollAreaRoot",n,i),style:Ce(l,p),asChild:s},Io({asChild:s,children:c},D=>W.createElement(W.Fragment,null,W.createElement(he.ScrollArea.Viewport,{...V,ref:t,className:"rt-ScrollAreaViewport"},D),W.createElement("div",{className:"rt-ScrollAreaViewportFocusRing"}),R!=="vertical"?W.createElement(he.ScrollArea.Scrollbar,{"data-radius":h,orientation:"horizontal",className:(0,nt.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:u,propValues:Ve.size.values}))},W.createElement(he.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,R!=="horizontal"?W.createElement(he.ScrollArea.Scrollbar,{"data-radius":h,orientation:"vertical",className:(0,nt.default)("rt-ScrollAreaScrollbar",ke({className:"rt-r-size",value:u,propValues:Ve.size.values}))},W.createElement(he.ScrollArea.Thumb,{className:"rt-ScrollAreaThumb"})):null,R==="both"?W.createElement(he.ScrollArea.Corner,{className:"rt-ScrollAreaCorner"}):null)))});Ft.displayName="ScrollArea";var jo=require("react-dropzone"),Et=typeof window<"u"?r.useLayoutEffect:r.useEffect,Lo=r.createContext(null),Pe=()=>{let e=r.useContext(Lo);if(!e)throw new Error("Chatbar context not found. Wrap parts in <Chatbar.Root>.");return e},zo=r.forwardRef((e,t)=>{let{className:o,style:a,children:n,value:l,defaultValue:s="",onValueChange:c,open:i,defaultOpen:p=!1,onOpenChange:m,expandOn:y="both",minLines:v=3,maxLines:u=6,sendMode:h="whenDirty",disabled:R,readOnly:V,onSubmit:D,size:F="2",variant:L,color:E,radius:j,panelBackground:M,material:G,width:Z,maxWidth:pe,asChild:X,attachments:le,defaultAttachments:ve=[],onAttachmentsChange:z,accept:J,multiple:H=!0,maxAttachments:B,maxFileSize:C,paste:He=!0,pasteAccept:we,clearOnSubmit:We=!0,onAttachmentReject:fe,dropzone:ce=!0,apiRef:d,...x}=e,N=G||M,A=l!=null,[Q,st]=r.useState(s),Se=A?l:Q,K=i!=null,[Me,Ne]=r.useState(p),Ae=K?i:Me,at=r.useRef(null),Ge=r.useRef(null),it=r.useRef(!1),de="attachments"in e,[Vt,Mt]=r.useState(ve),ye=r.useMemo(()=>de?le??[]:Vt,[de,le,Vt]),$e=r.useRef(new Set),pt=f=>Array.isArray(f)?f:typeof f=="string"?f.split(",").map(P=>P.trim()):[],Oe=pt(J),Ot=pt(we).length>0?pt(we):Oe,It=(f,P)=>{if(P.length===0)return!0;let _=f.type.toLowerCase(),me=f.name.toLowerCase();for(let ee of P){let $=ee.toLowerCase();if($.includes("/")){let[te,ue]=$.split("/"),[T,je]=_.split("/");if(te==="*"||te===T&&(ue==="*"||ue===je))return!0}else if($.startsWith(".")&&me.endsWith($))return!0}return!1},lt=r.useRef(ye);lt.current=ye;let ct=r.useRef(Oe);ct.current=Oe;let jt=r.useRef(Ot);jt.current=Ot;let mt=r.useRef(B);mt.current=B;let ut=r.useRef(C);ut.current=C;let ft=r.useRef(fe);ft.current=fe;let Lt=r.useRef(z);Lt.current=z;let zt=r.useRef(m);zt.current=m;let Ie=r.useCallback(f=>{let P=lt.current,_=ct.current,me=mt.current,ee=ut.current,$=[],te=[],ue=typeof me=="number"?Math.max(me-P.length,0):1/0;for(let T of f){if($.length>=ue){te.push({file:T,reason:"count"});continue}if(typeof ee=="number"&&T.size>ee){te.push({file:T,reason:"size"});continue}if(!It(T,_)){te.push({file:T,reason:"type"});continue}let je=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ge=/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(T.name),dt=(T.type||"").toLowerCase().startsWith("image/")||ge?URL.createObjectURL(T):void 0;dt&&$e.current.add(dt),$.push({id:je,name:T.name,size:T.size,type:T.type,file:T,url:dt,status:"idle"})}if($.length>0){let T=P.concat($);de||Mt(T),Lt.current?.(T),K||Ne(!0),zt.current?.(!0)}te.length>0&&ft.current?.(te)},[de,K]),Ht=r.useCallback(f=>{let P=ct.current,_=jt.current,me=mt.current,ee=ut.current,$=lt.current,te=_.length>0?_:P,ue=[],T=[],je=typeof me=="number"?Math.max(me-$.length,0):1/0;for(let ge of f){if(ue.length>=je){T.push({file:ge,reason:"count"});continue}if(typeof ee=="number"&&ge.size>ee){T.push({file:ge,reason:"size"});continue}if(!It(ge,te)){T.push({file:ge,reason:"type"});continue}ue.push(ge)}ue.length>0&&Ie(ue),T.length>0&&ft.current?.(T)},[Ie]);r.useEffect(()=>{let f=new Set(ye.map(P=>P.url).filter(Boolean));for(let P of Array.from($e.current))f.has(P)||(URL.revokeObjectURL(P),$e.current.delete(P))},[ye]),r.useEffect(()=>{let f=$e.current;return()=>{for(let P of Array.from(f))URL.revokeObjectURL(P);f.clear()}},[]);let Zo=X?q:"div",Wt=r.useCallback(f=>{K||Ne(f),m?.(f)},[K,m]),Gt=r.useCallback(f=>{A||st(f),c?.(f)},[A,c]),$t=r.useCallback(f=>{de||Mt(f),z?.(f)},[de,z]),Xo=r.useCallback(f=>{let P=f.relatedTarget,_=at.current;_&&(P&&_.contains(P)||it.current||(Se?.trim?.()??"").length===0&&ye.length===0&&(K||Ne(!1),m?.(!1)))},[K,m,Se,ye]),{getRootProps:Jo,getInputProps:Qo,isDragActive:Ut,open:Kt}=(0,jo.useDropzone)({onDrop:(f,P)=>{if(f.length>0&&Ie(f),P.length>0&&fe){let _=P.map(({file:me,errors:ee})=>{let $=ee[0]?.code==="file-too-large"?"size":ee[0]?.code==="file-invalid-type"?"type":"count";return{file:me,reason:$}});fe(_)}},accept:Oe.length>0?Oe.reduce((f,P)=>(P.includes("/")?f[P]=[]:P.startsWith(".")&&(f[P]=[]),f),{}):void 0,multiple:H,maxSize:C,noClick:!0,noKeyboard:!0,disabled:!ce||R});r.useImperativeHandle(d,()=>({focusTextarea:()=>Ge.current?.focus({preventScroll:!0}),openFilePicker:()=>{it.current=!0,Kt()}}),[Kt]);let _t=r.useCallback(f=>{if(!(f instanceof Element))return!1;let P=f;return P.closest(".rt-ChatbarDropOverlay")?!0:!!P.closest('button, [role="button"], a[href], input, textarea, select, [contenteditable], [tabindex]:not([tabindex="-1"])')},[]),er=r.useCallback(f=>{R||_t(f.target)||f.pointerType==="mouse"&&f.button!==0||(f.preventDefault(),Ge.current?.focus({preventScroll:!0}))},[R,_t,Ge]);return r.createElement(Lo.Provider,{value:r.useMemo(()=>({open:Ae,setOpen:Wt,isOpenControlled:K,value:Se,setValue:Gt,isValueControlled:A,size:F,expandOn:y,minLines:v,maxLines:u,sendMode:h,disabled:R,readOnly:V,onSubmit:D,rootRef:at,textareaRef:Ge,attachments:ye,setAttachments:$t,isAttachmentsControlled:de,accept:J,multiple:H,maxAttachments:B,maxFileSize:C,paste:He,pasteAccept:we,clearOnSubmit:We,onAttachmentReject:fe,dropzone:ce,appendFiles:Ie,appendFilesFromPaste:Ht,fileDialogOpenRef:it}),[Ae,Wt,K,Se,Gt,A,F,y,v,u,h,R,V,D,ye,$t,de,J,H,B,C,He,we,We,fe,ce,Ie,Ht])},r.createElement(ie.LazyMotion,{features:ie.domAnimation},r.createElement(Zo,{...x,ref:f=>{typeof t=="function"?t(f):t&&(t.current=f),at.current=f},className:(0,U.default)("rt-ChatbarRoot",`rt-r-size-${F}`,o),style:{position:"relative",width:Z,maxWidth:pe,...a},"data-state":Ae?"open":"closed","data-disabled":R?"":void 0,"data-readonly":V?"":void 0,"data-drop-active":ce&&Ut?"":void 0,"data-accent-color":E,"data-radius":j,"data-panel-background":N,"data-material":N,"aria-expanded":Ae,onBlurCapture:Xo},ce&&r.createElement("input",{...Qo()}),r.createElement("div",{...ce?Jo():{},style:{width:"100%",height:"100%"},onPointerDown:er},r.createElement(ie.m.div,{className:(0,U.default)("rt-ChatbarBox",`rt-variant-${L??"surface"}`),style:{position:"relative"},"data-accent-color":E,"data-radius":j,"data-panel-background":N,"data-material":N,layout:!0,transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(ie.m.div,{className:"rt-ChatbarGrid",layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},n),ce&&Ut&&r.createElement("div",{className:"rt-ChatbarDropOverlay"},r.createElement("div",{className:"rt-ChatbarDropContent"},r.createElement(Te,{color:"gray",size:F,weight:"medium"},"Drop files here to attach"))))))))});zo.displayName="Chatbar.Root";var Ho=r.forwardRef((e,t)=>{let{className:o,style:a,asChild:n,onFocus:l,onInput:s,onChange:c,onPaste:i,onKeyDown:p,submitOnEnter:m=!1,rows:y,...v}=e,u=Pe(),{open:h,minLines:R,maxLines:V,expandOn:D,disabled:F,readOnly:L,setOpen:E,setValue:j,textareaRef:M,value:G,isValueControlled:Z,sendMode:pe,paste:X,appendFilesFromPaste:le,size:ve}=u,z=r.useRef(0),J=r.useRef(0),H=r.useRef(0),B=r.useCallback(()=>{let d=M.current;if(!d)return;let x=window.getComputedStyle(d),N=parseFloat(x.lineHeight)||20,A=parseFloat(x.paddingTop)||0,Q=parseFloat(x.paddingBottom)||0;z.current=N,J.current=A+Q,H.current=Math.ceil(1*N)+A+Q},[M]),C=r.useCallback(d=>{let x=M.current;if(!x)return;x.style.height="auto",z.current===0&&B();let N=z.current,A=J.current,Q=d??h,st=Q?R:1,Se=Q?V:1,K=Math.ceil(st*N)+A,Me=Math.ceil(Se*N)+A,Ne=Math.max(x.scrollHeight,K),Ae=Math.min(Ne,Me);x.style.height=`${Ae}px`,Ne>Me?(x.style.overflowY="auto",x.style.maxHeight=`${Me}px`):(x.style.overflowY="hidden",x.style.maxHeight="none")},[h,R,V,M,B]);Et(()=>{C()},[C,G,h]),Et(()=>{if(!(D==="overflow"||D==="both")||h)return;let d=M.current;if(!d)return;d.style.height="auto",H.current===0&&B(),d.scrollHeight>H.current+1&&(E(!0),C(!0),requestAnimationFrame(()=>C(!0)))},[G,D,h,E,M,B,C]),Et(()=>{B(),C()},[B,C,ve]),r.useEffect(()=>{let d=M.current;if(!d||typeof ResizeObserver>"u")return;let x=z.current,N=new ResizeObserver(()=>{let A=window.getComputedStyle(d),Q=parseFloat(A.lineHeight)||20;Q!==x&&(x=Q,B(),requestAnimationFrame(()=>C()))});return N.observe(d),()=>N.disconnect()},[M,B,C]),r.useEffect(()=>{},[]);let He=r.useCallback(d=>{F||L||((D==="focus"||D==="both")&&!h&&E(!0),l?.(d))},[F,L,D,h,E,l]),we=r.useCallback(d=>{let x=d.currentTarget,N=x.value;j(N),(D==="overflow"||D==="both")&&!h&&(x.style.height="auto",H.current===0&&B(),x.scrollHeight>H.current+1&&(E(!0),C(!0),requestAnimationFrame(()=>C(!0)))),requestAnimationFrame(()=>C()),c?.(d)},[D,h,E,j,c,C,B]),We=r.useCallback(d=>{if(X){let N=Array.from(d.clipboardData?.items??[]).filter(A=>A.kind==="file").map(A=>A.getAsFile()).filter(A=>!!A);N.length>0&&(d.preventDefault(),le(N))}setTimeout(()=>{h?C():C(!0)},0),i?.(d)},[X,h,C,i,le]),fe=r.useCallback(d=>{if(!m){p?.(d);return}if(d.key==="Enter"&&!d.shiftKey&&!d.altKey&&!d.ctrlKey&&!d.metaKey&&!d.nativeEvent.isComposing){if(F||L){p?.(d);return}if(pe==="never"){p?.(d);return}let N=G.trim().length>0||u.attachments.length>0;if(pe==="whenDirty"&&!N){p?.(d);return}d.preventDefault(),u.onSubmit?.({value:G,attachments:u.attachments}),u.clearOnSubmit&&(Z||j(""),u.setAttachments([]))}p?.(d)},[m,F,L,pe,G,Z,j,u,p]),ce=n?q:"textarea";return r.createElement(ie.m.div,{className:(0,U.default)("rt-ChatbarField","rt-ChatbarTextarea",o),layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(ce,{...v,ref:d=>{typeof t=="function"?t(d):t&&(t.current=d),M.current=d},className:"rt-ChatbarInput",value:G,onInput:s,onChange:we,onFocus:He,onPaste:We,onKeyDown:fe,disabled:F,readOnly:L,rows:h?R:1,spellCheck:v.spellCheck??!0,autoCorrect:v.autoCorrect??"on",style:a}))});Ho.displayName="Chatbar.Textarea";var Wo=r.forwardRef((e,t)=>{let{children:o,asChild:a,style:n,className:l,...s}=e;return Pe().open?null:r.createElement(a?q:"div",{...s,ref:t,className:(0,U.default)("rt-ChatbarInlineStart",l),style:n},o)});Wo.displayName="Chatbar.InlineStart";var Go=r.forwardRef((e,t)=>{let{children:o,asChild:a,style:n,className:l,...s}=e;return Pe().open?null:r.createElement(a?q:"div",{...s,ref:t,className:(0,U.default)("rt-ChatbarInlineEnd",l),style:n},o)});Go.displayName="Chatbar.InlineEnd";var $o=r.forwardRef((e,t)=>{let{asChild:o,forceMount:a,renderAttachment:n,className:l,style:s,...c}=e,i=Pe();if(!(i.attachments.length>0)&&!a)return null;let m=o?q:"div";return r.createElement(ie.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(m,{...c,ref:t,className:(0,U.default)("rt-ChatbarAttachmentsRow",l),style:s,role:"list","aria-label":c["aria-label"]??"Attachments"},r.createElement(Ft,{className:"rt-ChatbarScrollArea",scrollbars:"horizontal",size:"1"},r.createElement(Y,{align:"center",gap:"2",style:{minWidth:"fit-content"}},i.attachments.map(y=>r.createElement(Bt,{key:y.id,attachment:y,asChild:!!n},n?.(y)))))))});$o.displayName="Chatbar.AttachmentsRow";var Bt=r.forwardRef((e,t)=>{let{attachment:o,asChild:a,className:n,style:l,children:s,...c}=e,i=Pe(),p=a?q:"div",m=!!o.url&&o.type.startsWith("image/");return r.createElement(p,{...c,ref:t,className:(0,U.default)("rt-ChatbarAttachment",n),style:l,role:"listitem","data-kind":m?"image":"file",title:o.name},s??r.createElement(Y,{align:"center",gap:"2",pr:m?void 0:"6"},r.createElement("div",{className:"rt-ChatbarAttachmentPreview","aria-hidden":!0},m?r.createElement("img",{className:"rt-ChatbarAttachmentImage",src:o.url,alt:""}):r.createElement(kt,null)),!m&&r.createElement(Y,{direction:"column",gap:"0",style:{minWidth:0}},r.createElement(Te,{size:i.size,weight:"medium",style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},o.name),r.createElement(Te,{size:"1",color:"gray"},Math.ceil(o.size/1024)," KB")),r.createElement(ot,{className:"rt-ChatbarAttachmentRemove","aria-label":`Remove ${o.name}`,size:"1",variant:"classic",highContrast:!0,color:"gray",onClick:()=>i.setAttachments(i.attachments.filter(y=>y.id!==o.id))},r.createElement(At,null))))});Bt.displayName="Chatbar.Attachment";var Uo=r.forwardRef((e,t)=>{let{asChild:o,accept:a,multiple:n,className:l,style:s,...c}=e,i=Pe(),p=r.useRef(null),m=o?q:"button",y=a??i.accept,v=(Array.isArray(y)?y:y?.split(",")??[]).join(",");return r.useEffect(()=>{let u=()=>{i.fileDialogOpenRef.current=!1};return window.addEventListener("focus",u),()=>window.removeEventListener("focus",u)},[i.fileDialogOpenRef]),r.createElement(r.Fragment,null,r.createElement(m,{...c,ref:t,className:(0,U.default)("rt-ChatbarAttachTrigger",l),style:s,type:c.type??"button","aria-label":c["aria-label"]??"Add attachments",onPointerDown:u=>{i.fileDialogOpenRef.current=!0,c.onPointerDown?.(u)},onMouseDown:u=>{i.fileDialogOpenRef.current=!0,c.onMouseDown?.(u)},onClick:u=>{i.fileDialogOpenRef.current=!0,p.current&&p.current.click(),c.onClick?.(u)}}),r.createElement("input",{ref:p,type:"file",accept:v,multiple:n??i.multiple,tabIndex:-1,style:{display:"none"},onChange:u=>{let h=Array.from(u.currentTarget.files??[]);h.length>0&&i.appendFiles(h),i.fileDialogOpenRef.current=!1,u.currentTarget.value=""}}))});Uo.displayName="Chatbar.AttachTrigger";var Ko=r.forwardRef((e,t)=>{let{asChild:o,children:a,className:n,style:l,...s}=e;if(!Pe().open)return null;let i=o?q:"div";return r.createElement(ie.m.div,{layout:"position",transition:{layout:{type:"spring",visualDuration:.15,bounce:.1}}},r.createElement(i,{...s,ref:t,className:(0,U.default)("rt-ChatbarRow",n),style:l},r.createElement(Y,{align:"center",justify:"between",width:"100%"},a)))});Ko.displayName="Chatbar.Row";var _o=r.forwardRef((e,t)=>{let{className:o,style:a,...n}=e;return r.createElement("div",{...n,ref:t,className:(0,U.default)("rt-ChatbarRowStart",o),style:a})});_o.displayName="Chatbar.RowStart";var qo=r.forwardRef((e,t)=>{let{className:o,style:a,...n}=e;return r.createElement("div",{...n,ref:t,className:(0,U.default)("rt-ChatbarRowEnd",o),style:a})});qo.displayName="Chatbar.RowEnd";var Yo=r.forwardRef((e,t)=>{let{asChild:o,clearOnSend:a=!0,disabled:n,children:l,className:s,style:c,size:i,variant:p,"aria-label":m,"aria-labelledby":y,...v}=e,u=Pe(),R=u.value.trim().length>0||u.attachments.length>0,V=u.sendMode==="always"||u.sendMode==="whenDirty"&&R;if(u.sendMode==="never")return null;let D=F=>{u.disabled||u.readOnly||(u.onSubmit?.({value:u.value,attachments:u.attachments}),a&&(u.isValueControlled||u.setValue(""),u.clearOnSubmit&&u.setAttachments([])),v.onClick?.(F))};return r.createElement(ot,{...v,ref:t,size:i??u.size,variant:p??(u.open?"solid":"ghost"),disabled:n||u.disabled||u.readOnly,className:(0,U.default)("rt-ChatbarSend",s),style:{opacity:V?1:0,pointerEvents:V?"auto":"none",...c},asChild:o,onClick:D,"aria-label":m??(y?void 0:"Send"),"aria-labelledby":y},l??r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-arrow-right-icon lucide-arrow-right"},r.createElement("path",{d:"M5 12h14"}),r.createElement("path",{d:"m12 5 7 7-7 7"})))});Yo.displayName="Chatbar.Send";
5
5
  //# sourceMappingURL=chatbar.js.map