@devalok/shilp-sutra 0.34.0 → 0.36.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 (541) hide show
  1. package/LICENSE +21 -21
  2. package/dist/_chunks/badge-group.js +306 -246
  3. package/dist/_chunks/badge-group.js.map +1 -0
  4. package/dist/_chunks/chat.js +518 -0
  5. package/dist/_chunks/chat.js.map +1 -0
  6. package/dist/_chunks/date-picker.js +748 -0
  7. package/dist/_chunks/date-picker.js.map +1 -0
  8. package/dist/_chunks/document-preview.js +109 -90
  9. package/dist/_chunks/document-preview.js.map +1 -0
  10. package/dist/_chunks/file-preview.js +492 -504
  11. package/dist/_chunks/file-preview.js.map +1 -0
  12. package/dist/_chunks/framer.js +5564 -5613
  13. package/dist/_chunks/framer.js.map +1 -0
  14. package/dist/_chunks/image-preview.js +127 -88
  15. package/dist/_chunks/image-preview.js.map +1 -0
  16. package/dist/_chunks/keybinding.js +12 -14
  17. package/dist/_chunks/keybinding.js.map +1 -0
  18. package/dist/_chunks/link-context.js +19 -16
  19. package/dist/_chunks/link-context.js.map +1 -0
  20. package/dist/_chunks/mention-suggestion.js +353 -350
  21. package/dist/_chunks/mention-suggestion.js.map +1 -0
  22. package/dist/_chunks/motion-provider.js +26 -20
  23. package/dist/_chunks/motion-provider.js.map +1 -0
  24. package/dist/_chunks/popover.js +123 -0
  25. package/dist/_chunks/popover.js.map +1 -0
  26. package/dist/_chunks/primitives.js +7585 -6426
  27. package/dist/_chunks/primitives.js.map +1 -0
  28. package/dist/_chunks/rich-chat-input.js +2071 -0
  29. package/dist/_chunks/rich-chat-input.js.map +1 -0
  30. package/dist/_chunks/rolldown-runtime.js +21 -0
  31. package/dist/_chunks/shared.js +126 -0
  32. package/dist/_chunks/shared.js.map +1 -0
  33. package/dist/_chunks/sonner.js +605 -734
  34. package/dist/_chunks/sonner.js.map +1 -0
  35. package/dist/_chunks/stat-row.js +418 -440
  36. package/dist/_chunks/stat-row.js.map +1 -0
  37. package/dist/_chunks/tiptap.js +15850 -19964
  38. package/dist/_chunks/tiptap.js.map +1 -0
  39. package/dist/_chunks/tree-view.js +231 -290
  40. package/dist/_chunks/tree-view.js.map +1 -0
  41. package/dist/_chunks/use-calendar.js +161 -208
  42. package/dist/_chunks/use-calendar.js.map +1 -0
  43. package/dist/_chunks/vendor-client.js +314 -2199
  44. package/dist/_chunks/vendor-client.js.map +1 -0
  45. package/dist/_chunks/vendor-utils.js +1721 -2978
  46. package/dist/_chunks/vendor-utils.js.map +1 -0
  47. package/dist/ai/ai-command-provider.js +23 -17
  48. package/dist/ai/ai-command-provider.js.map +1 -0
  49. package/dist/ai/block-renderer.js +68 -51
  50. package/dist/ai/block-renderer.js.map +1 -0
  51. package/dist/ai/blocks/index.js +2 -12
  52. package/dist/ai/blocks/loading.d.ts.map +1 -1
  53. package/dist/ai/command-bar.js +470 -519
  54. package/dist/ai/command-bar.js.map +1 -0
  55. package/dist/ai/conversation.js +241 -227
  56. package/dist/ai/conversation.js.map +1 -0
  57. package/dist/ai/devadoot-icon.d.ts.map +1 -1
  58. package/dist/ai/index.js +181 -167
  59. package/dist/ai/index.js.map +1 -0
  60. package/dist/ai/types.js +0 -1
  61. package/dist/composed/activity-feed.js +232 -202
  62. package/dist/composed/activity-feed.js.map +1 -0
  63. package/dist/composed/avatar-group.js +164 -222
  64. package/dist/composed/avatar-group.js.map +1 -0
  65. package/dist/composed/bulk-action-bar.js +166 -165
  66. package/dist/composed/bulk-action-bar.js.map +1 -0
  67. package/dist/composed/command-palette.js +290 -308
  68. package/dist/composed/command-palette.js.map +1 -0
  69. package/dist/composed/confirm-dialog.js +28 -48
  70. package/dist/composed/confirm-dialog.js.map +1 -0
  71. package/dist/composed/content-card.js +69 -108
  72. package/dist/composed/content-card.js.map +1 -0
  73. package/dist/composed/date-picker/index.js +3 -13
  74. package/dist/composed/deadline-indicator.js +68 -74
  75. package/dist/composed/deadline-indicator.js.map +1 -0
  76. package/dist/composed/emoji-picker.js +83 -110
  77. package/dist/composed/emoji-picker.js.map +1 -0
  78. package/dist/composed/empty-state.d.ts.map +1 -1
  79. package/dist/composed/empty-state.js +64 -103
  80. package/dist/composed/empty-state.js.map +1 -0
  81. package/dist/composed/error-boundary.js +129 -127
  82. package/dist/composed/error-boundary.js.map +1 -0
  83. package/dist/composed/file-preview.js +2 -12
  84. package/dist/composed/filter-bar.js +98 -130
  85. package/dist/composed/filter-bar.js.map +1 -0
  86. package/dist/composed/form-section.js +61 -45
  87. package/dist/composed/form-section.js.map +1 -0
  88. package/dist/composed/global-loading.js +34 -47
  89. package/dist/composed/global-loading.js.map +1 -0
  90. package/dist/composed/index.js +34 -92
  91. package/dist/composed/inline-edit.js +92 -107
  92. package/dist/composed/inline-edit.js.map +1 -0
  93. package/dist/composed/lib/string-utils.js +8 -8
  94. package/dist/composed/lib/string-utils.js.map +1 -0
  95. package/dist/composed/loading-skeleton.js +103 -171
  96. package/dist/composed/loading-skeleton.js.map +1 -0
  97. package/dist/composed/markdown-viewer.js +187 -139
  98. package/dist/composed/markdown-viewer.js.map +1 -0
  99. package/dist/composed/master-detail.js +147 -156
  100. package/dist/composed/master-detail.js.map +1 -0
  101. package/dist/composed/member-picker.js +46 -49
  102. package/dist/composed/member-picker.js.map +1 -0
  103. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  104. package/dist/composed/multi-select-popover.js +185 -179
  105. package/dist/composed/multi-select-popover.js.map +1 -0
  106. package/dist/composed/page-header.js +54 -76
  107. package/dist/composed/page-header.js.map +1 -0
  108. package/dist/composed/page-skeletons.js +143 -127
  109. package/dist/composed/page-skeletons.js.map +1 -0
  110. package/dist/composed/priority-indicator.js +105 -111
  111. package/dist/composed/priority-indicator.js.map +1 -0
  112. package/dist/composed/responsive-overlay.js +36 -41
  113. package/dist/composed/responsive-overlay.js.map +1 -0
  114. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  115. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  116. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  117. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  118. package/dist/composed/rich-chat-input.js +2 -1860
  119. package/dist/composed/rich-text-editor.js +561 -424
  120. package/dist/composed/rich-text-editor.js.map +1 -0
  121. package/dist/composed/schedule-view.js +134 -185
  122. package/dist/composed/schedule-view.js.map +1 -0
  123. package/dist/composed/simple-tooltip.js +21 -21
  124. package/dist/composed/simple-tooltip.js.map +1 -0
  125. package/dist/composed/status-badge.d.ts.map +1 -1
  126. package/dist/composed/status-badge.js +133 -137
  127. package/dist/composed/status-badge.js.map +1 -0
  128. package/dist/hooks/index.js +7 -12
  129. package/dist/hooks/use-color-mode.js +28 -25
  130. package/dist/hooks/use-color-mode.js.map +1 -0
  131. package/dist/hooks/use-mobile.js +13 -13
  132. package/dist/hooks/use-mobile.js.map +1 -0
  133. package/dist/hooks/use-toast.js +2 -4
  134. package/dist/hooks/use-touch-device.js +9 -11
  135. package/dist/hooks/use-touch-device.js.map +1 -0
  136. package/dist/hooks/use-viewport-height.js +14 -14
  137. package/dist/hooks/use-viewport-height.js.map +1 -0
  138. package/dist/motion/check-motion-provider.d.ts +3 -0
  139. package/dist/motion/check-motion-provider.d.ts.map +1 -0
  140. package/dist/motion/index.js +17 -11
  141. package/dist/motion/index.js.map +1 -0
  142. package/dist/motion/primitives-index.js +226 -186
  143. package/dist/motion/primitives-index.js.map +1 -0
  144. package/dist/primitives/react-accordion.d.ts +114 -114
  145. package/dist/primitives/react-alert-dialog.d.ts +51 -51
  146. package/dist/primitives/react-aspect-ratio.d.ts +11 -11
  147. package/dist/primitives/react-avatar.d.ts +24 -24
  148. package/dist/primitives/react-checkbox.d.ts +50 -50
  149. package/dist/primitives/react-collapsible.d.ts +33 -33
  150. package/dist/primitives/react-context-menu.d.ts +96 -96
  151. package/dist/primitives/react-dialog.d.ts +103 -103
  152. package/dist/primitives/react-dropdown-menu.d.ts +97 -97
  153. package/dist/primitives/react-hover-card.d.ts +79 -79
  154. package/dist/primitives/react-label.d.ts +10 -10
  155. package/dist/primitives/react-menu.d.ts +169 -169
  156. package/dist/primitives/react-menubar.d.ts +115 -115
  157. package/dist/primitives/react-navigation-menu.d.ts +126 -126
  158. package/dist/primitives/react-popover.d.ts +85 -85
  159. package/dist/primitives/react-progress.d.ts +19 -19
  160. package/dist/primitives/react-radio-group.d.ts +58 -58
  161. package/dist/primitives/react-roving-focus.d.ts +49 -49
  162. package/dist/primitives/react-select.d.ts +137 -137
  163. package/dist/primitives/react-separator.d.ts +21 -21
  164. package/dist/primitives/react-slider.d.ts +75 -75
  165. package/dist/primitives/react-switch.d.ts +21 -21
  166. package/dist/primitives/react-tabs.d.ts +56 -56
  167. package/dist/primitives/react-toast.d.ts +120 -120
  168. package/dist/primitives/react-toggle-group.d.ts +75 -75
  169. package/dist/primitives/react-toggle.d.ts +24 -24
  170. package/dist/primitives/react-tooltip.d.ts +101 -101
  171. package/dist/primitives/react-visually-hidden.d.ts +22 -22
  172. package/dist/shell/app-command-palette.d.ts +2 -0
  173. package/dist/shell/app-command-palette.d.ts.map +1 -1
  174. package/dist/shell/app-command-palette.js +94 -238
  175. package/dist/shell/app-command-palette.js.map +1 -0
  176. package/dist/shell/bottom-navbar.js +150 -190
  177. package/dist/shell/bottom-navbar.js.map +1 -0
  178. package/dist/shell/command-registry.js +13 -14
  179. package/dist/shell/command-registry.js.map +1 -0
  180. package/dist/shell/index.js +10 -20
  181. package/dist/shell/link-context.js +2 -5
  182. package/dist/shell/notification-center.d.ts.map +1 -1
  183. package/dist/shell/notification-center.js +263 -259
  184. package/dist/shell/notification-center.js.map +1 -0
  185. package/dist/shell/notification-preferences.js +241 -184
  186. package/dist/shell/notification-preferences.js.map +1 -0
  187. package/dist/shell/sidebar.js +251 -281
  188. package/dist/shell/sidebar.js.map +1 -0
  189. package/dist/shell/top-bar.js +203 -237
  190. package/dist/shell/top-bar.js.map +1 -0
  191. package/dist/tailwind/index.cjs +473 -442
  192. package/dist/tailwind/index.js +2 -4
  193. package/dist/tailwind/preset.d.ts.map +1 -1
  194. package/dist/tailwind/preset.js +490 -459
  195. package/dist/tailwind/preset.js.map +1 -0
  196. package/dist/tokens/index.css +4 -4
  197. package/dist/tokens/primitives.css +442 -442
  198. package/dist/tokens/semantic.css +742 -547
  199. package/dist/tokens/typography-semantic.css +123 -100
  200. package/dist/tokens/typography.css +422 -422
  201. package/dist/ui/accordion.js +52 -60
  202. package/dist/ui/accordion.js.map +1 -0
  203. package/dist/ui/alert-dialog.d.ts +6 -2
  204. package/dist/ui/alert-dialog.d.ts.map +1 -1
  205. package/dist/ui/alert-dialog.js +112 -156
  206. package/dist/ui/alert-dialog.js.map +1 -0
  207. package/dist/ui/alert.d.ts +3 -2
  208. package/dist/ui/alert.d.ts.map +1 -1
  209. package/dist/ui/alert.js +203 -99
  210. package/dist/ui/alert.js.map +1 -0
  211. package/dist/ui/aspect-ratio.js +13 -16
  212. package/dist/ui/aspect-ratio.js.map +1 -0
  213. package/dist/ui/autocomplete.d.ts.map +1 -1
  214. package/dist/ui/autocomplete.js +137 -148
  215. package/dist/ui/autocomplete.js.map +1 -0
  216. package/dist/ui/avatar.js +196 -169
  217. package/dist/ui/avatar.js.map +1 -0
  218. package/dist/ui/badge-group.js +2 -7
  219. package/dist/ui/badge-indicator.js +42 -51
  220. package/dist/ui/badge-indicator.js.map +1 -0
  221. package/dist/ui/badge.js +2 -15
  222. package/dist/ui/banner.js +76 -68
  223. package/dist/ui/banner.js.map +1 -0
  224. package/dist/ui/breadcrumb.js +65 -84
  225. package/dist/ui/breadcrumb.js.map +1 -0
  226. package/dist/ui/button-group.js +109 -102
  227. package/dist/ui/button-group.js.map +1 -0
  228. package/dist/ui/button-processing.d.ts.map +1 -1
  229. package/dist/ui/button-processing.js +89 -72
  230. package/dist/ui/button-processing.js.map +1 -0
  231. package/dist/ui/button.js +393 -279
  232. package/dist/ui/button.js.map +1 -0
  233. package/dist/ui/card.js +151 -157
  234. package/dist/ui/card.js.map +1 -0
  235. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  236. package/dist/ui/charts/chart-container.d.ts +2 -0
  237. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  238. package/dist/ui/charts/index.js +1025 -1319
  239. package/dist/ui/charts/index.js.map +1 -0
  240. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  241. package/dist/ui/chat/index.js +2 -11
  242. package/dist/ui/chat/message-input.d.ts.map +1 -1
  243. package/dist/ui/chat/message-list.d.ts +1 -1
  244. package/dist/ui/chat/message-list.d.ts.map +1 -1
  245. package/dist/ui/chat/message.d.ts.map +1 -1
  246. package/dist/ui/chat/system-message.d.ts.map +1 -1
  247. package/dist/ui/checkbox.d.ts.map +1 -1
  248. package/dist/ui/checkbox.js +82 -100
  249. package/dist/ui/checkbox.js.map +1 -0
  250. package/dist/ui/code.js +18 -32
  251. package/dist/ui/code.js.map +1 -0
  252. package/dist/ui/collapsible.js +21 -29
  253. package/dist/ui/collapsible.js.map +1 -0
  254. package/dist/ui/color-input.d.ts.map +1 -1
  255. package/dist/ui/color-input.js +455 -372
  256. package/dist/ui/color-input.js.map +1 -0
  257. package/dist/ui/color-swatch.js +60 -90
  258. package/dist/ui/color-swatch.js.map +1 -0
  259. package/dist/ui/combobox.d.ts +7 -0
  260. package/dist/ui/combobox.d.ts.map +1 -1
  261. package/dist/ui/combobox.js +278 -293
  262. package/dist/ui/combobox.js.map +1 -0
  263. package/dist/ui/container.js +18 -24
  264. package/dist/ui/container.js.map +1 -0
  265. package/dist/ui/context-menu.js +154 -203
  266. package/dist/ui/context-menu.js.map +1 -0
  267. package/dist/ui/data-table-body.js +116 -213
  268. package/dist/ui/data-table-body.js.map +1 -0
  269. package/dist/ui/data-table-bulk-actions.js +43 -59
  270. package/dist/ui/data-table-bulk-actions.js.map +1 -0
  271. package/dist/ui/data-table-card.js +84 -71
  272. package/dist/ui/data-table-card.js.map +1 -0
  273. package/dist/ui/data-table-context.js +39 -42
  274. package/dist/ui/data-table-context.js.map +1 -0
  275. package/dist/ui/data-table-header.js +98 -139
  276. package/dist/ui/data-table-header.js.map +1 -0
  277. package/dist/ui/data-table-pagination.js +69 -82
  278. package/dist/ui/data-table-pagination.js.map +1 -0
  279. package/dist/ui/data-table-toolbar.js +104 -130
  280. package/dist/ui/data-table-toolbar.js.map +1 -0
  281. package/dist/ui/data-table.js +281 -354
  282. package/dist/ui/data-table.js.map +1 -0
  283. package/dist/ui/devalok-grain.js +77 -66
  284. package/dist/ui/devalok-grain.js.map +1 -0
  285. package/dist/ui/dialog.js +118 -151
  286. package/dist/ui/dialog.js.map +1 -0
  287. package/dist/ui/dropdown-menu.js +152 -203
  288. package/dist/ui/dropdown-menu.js.map +1 -0
  289. package/dist/ui/file-upload.js +242 -266
  290. package/dist/ui/file-upload.js.map +1 -0
  291. package/dist/ui/form.d.ts +8 -0
  292. package/dist/ui/form.d.ts.map +1 -1
  293. package/dist/ui/form.js +62 -56
  294. package/dist/ui/form.js.map +1 -0
  295. package/dist/ui/hover-card.js +54 -54
  296. package/dist/ui/hover-card.js.map +1 -0
  297. package/dist/ui/icon-button.js +21 -26
  298. package/dist/ui/icon-button.js.map +1 -0
  299. package/dist/ui/icon-context.js +17 -17
  300. package/dist/ui/icon-context.js.map +1 -0
  301. package/dist/ui/icon-group.js +22 -29
  302. package/dist/ui/icon-group.js.map +1 -0
  303. package/dist/ui/icon.js +201 -121
  304. package/dist/ui/icon.js.map +1 -0
  305. package/dist/ui/index.d.ts +4 -4
  306. package/dist/ui/index.d.ts.map +1 -1
  307. package/dist/ui/index.js +90 -350
  308. package/dist/ui/index.js.map +1 -0
  309. package/dist/ui/input-otp.d.ts +12 -3
  310. package/dist/ui/input-otp.d.ts.map +1 -1
  311. package/dist/ui/input-otp.js +58 -48
  312. package/dist/ui/input-otp.js.map +1 -0
  313. package/dist/ui/input.d.ts.map +1 -1
  314. package/dist/ui/input.js +93 -169
  315. package/dist/ui/input.js.map +1 -0
  316. package/dist/ui/label.d.ts.map +1 -1
  317. package/dist/ui/label.js +23 -23
  318. package/dist/ui/label.js.map +1 -0
  319. package/dist/ui/lib/check-tokens.d.ts +3 -0
  320. package/dist/ui/lib/check-tokens.d.ts.map +1 -0
  321. package/dist/ui/lib/date-utils.js +14 -11
  322. package/dist/ui/lib/date-utils.js.map +1 -0
  323. package/dist/ui/lib/motion.d.ts +15 -4
  324. package/dist/ui/lib/motion.d.ts.map +1 -1
  325. package/dist/ui/lib/motion.js +83 -33
  326. package/dist/ui/lib/motion.js.map +1 -0
  327. package/dist/ui/lib/utils.js +39 -16
  328. package/dist/ui/lib/utils.js.map +1 -0
  329. package/dist/ui/link.js +13 -24
  330. package/dist/ui/link.js.map +1 -0
  331. package/dist/ui/menubar.js +132 -210
  332. package/dist/ui/menubar.js.map +1 -0
  333. package/dist/ui/navigation-menu.js +163 -193
  334. package/dist/ui/navigation-menu.js.map +1 -0
  335. package/dist/ui/number-input.d.ts +16 -1
  336. package/dist/ui/number-input.d.ts.map +1 -1
  337. package/dist/ui/number-input.js +102 -95
  338. package/dist/ui/number-input.js.map +1 -0
  339. package/dist/ui/pagination.js +122 -159
  340. package/dist/ui/pagination.js.map +1 -0
  341. package/dist/ui/popover.js +2 -131
  342. package/dist/ui/progress-ring.d.ts.map +1 -1
  343. package/dist/ui/progress-ring.js +133 -143
  344. package/dist/ui/progress-ring.js.map +1 -0
  345. package/dist/ui/progress.js +51 -95
  346. package/dist/ui/progress.js.map +1 -0
  347. package/dist/ui/radio.d.ts.map +1 -1
  348. package/dist/ui/radio.js +47 -49
  349. package/dist/ui/radio.js.map +1 -0
  350. package/dist/ui/search-input.js +51 -53
  351. package/dist/ui/search-input.js.map +1 -0
  352. package/dist/ui/segmented-control.d.ts +1 -1
  353. package/dist/ui/segmented-control.d.ts.map +1 -1
  354. package/dist/ui/segmented-control.js +95 -114
  355. package/dist/ui/segmented-control.js.map +1 -0
  356. package/dist/ui/select.d.ts.map +1 -1
  357. package/dist/ui/select.js +137 -157
  358. package/dist/ui/select.js.map +1 -0
  359. package/dist/ui/separator.d.ts.map +1 -1
  360. package/dist/ui/separator.js +18 -25
  361. package/dist/ui/separator.js.map +1 -0
  362. package/dist/ui/sheet.js +135 -163
  363. package/dist/ui/sheet.js.map +1 -0
  364. package/dist/ui/sidebar.js +357 -600
  365. package/dist/ui/sidebar.js.map +1 -0
  366. package/dist/ui/skeleton.js +179 -231
  367. package/dist/ui/skeleton.js.map +1 -0
  368. package/dist/ui/slider.d.ts +22 -3
  369. package/dist/ui/slider.d.ts.map +1 -1
  370. package/dist/ui/slider.js +62 -34
  371. package/dist/ui/slider.js.map +1 -0
  372. package/dist/ui/spinner.js +226 -205
  373. package/dist/ui/spinner.js.map +1 -0
  374. package/dist/ui/split-button.d.ts.map +1 -1
  375. package/dist/ui/split-button.js +228 -276
  376. package/dist/ui/split-button.js.map +1 -0
  377. package/dist/ui/stack.js +56 -70
  378. package/dist/ui/stack.js.map +1 -0
  379. package/dist/ui/stat-card.js +259 -251
  380. package/dist/ui/stat-card.js.map +1 -0
  381. package/dist/ui/status-dot.js +67 -63
  382. package/dist/ui/status-dot.js.map +1 -0
  383. package/dist/ui/stepper.d.ts +10 -0
  384. package/dist/ui/stepper.d.ts.map +1 -1
  385. package/dist/ui/stepper.js +124 -168
  386. package/dist/ui/stepper.js.map +1 -0
  387. package/dist/ui/switch.d.ts.map +1 -1
  388. package/dist/ui/switch.js +56 -55
  389. package/dist/ui/switch.js.map +1 -0
  390. package/dist/ui/table.js +57 -90
  391. package/dist/ui/table.js.map +1 -0
  392. package/dist/ui/tabs.d.ts +3 -1
  393. package/dist/ui/tabs.d.ts.map +1 -1
  394. package/dist/ui/tabs.js +159 -156
  395. package/dist/ui/tabs.js.map +1 -0
  396. package/dist/ui/text.d.ts +1 -1
  397. package/dist/ui/text.d.ts.map +1 -1
  398. package/dist/ui/text.js +60 -59
  399. package/dist/ui/text.js.map +1 -0
  400. package/dist/ui/textarea.js +40 -57
  401. package/dist/ui/textarea.js.map +1 -0
  402. package/dist/ui/toast-registry.d.ts +8 -0
  403. package/dist/ui/toast-registry.d.ts.map +1 -0
  404. package/dist/ui/toast-registry.js +13 -0
  405. package/dist/ui/toast-registry.js.map +1 -0
  406. package/dist/ui/toast-types.js +0 -1
  407. package/dist/ui/toast.d.ts.map +1 -1
  408. package/dist/ui/toast.js +559 -536
  409. package/dist/ui/toast.js.map +1 -0
  410. package/dist/ui/toaster.d.ts.map +1 -1
  411. package/dist/ui/toaster.js +24 -33
  412. package/dist/ui/toaster.js.map +1 -0
  413. package/dist/ui/toggle-group.d.ts +2 -0
  414. package/dist/ui/toggle-group.d.ts.map +1 -1
  415. package/dist/ui/toggle-group.js +44 -41
  416. package/dist/ui/toggle-group.js.map +1 -0
  417. package/dist/ui/toggle.d.ts +2 -0
  418. package/dist/ui/toggle.d.ts.map +1 -1
  419. package/dist/ui/toggle.js +44 -40
  420. package/dist/ui/toggle.js.map +1 -0
  421. package/dist/ui/tooltip.js +80 -65
  422. package/dist/ui/tooltip.js.map +1 -0
  423. package/dist/ui/tree-view/index.js +2 -6
  424. package/dist/ui/visually-hidden.js +12 -10
  425. package/dist/ui/visually-hidden.js.map +1 -0
  426. package/docs/components/_header.md +85 -85
  427. package/docs/components/composed/activity-feed.md +62 -62
  428. package/docs/components/composed/avatar-group.md +65 -65
  429. package/docs/components/composed/bulk-action-bar.md +40 -40
  430. package/docs/components/composed/command-palette.md +40 -40
  431. package/docs/components/composed/confirm-dialog.md +46 -46
  432. package/docs/components/composed/content-card.md +36 -36
  433. package/docs/components/composed/date-picker.md +130 -130
  434. package/docs/components/composed/deadline-indicator.md +27 -27
  435. package/docs/components/composed/emoji-picker.md +52 -52
  436. package/docs/components/composed/empty-state.md +53 -53
  437. package/docs/components/composed/error-boundary.md +29 -29
  438. package/docs/components/composed/file-preview.md +40 -40
  439. package/docs/components/composed/filter-bar.md +57 -57
  440. package/docs/components/composed/form-section.md +31 -31
  441. package/docs/components/composed/global-loading.md +27 -27
  442. package/docs/components/composed/inline-edit.md +35 -35
  443. package/docs/components/composed/loading-skeleton.md +51 -51
  444. package/docs/components/composed/markdown-viewer.md +27 -27
  445. package/docs/components/composed/master-detail.md +48 -48
  446. package/docs/components/composed/member-picker.md +35 -35
  447. package/docs/components/composed/multi-select-popover.md +62 -62
  448. package/docs/components/composed/page-header.md +41 -41
  449. package/docs/components/composed/page-skeletons.md +32 -32
  450. package/docs/components/composed/priority-indicator.md +32 -32
  451. package/docs/components/composed/responsive-overlay.md +34 -34
  452. package/docs/components/composed/rich-text-editor.md +82 -82
  453. package/docs/components/composed/schedule-view.md +39 -39
  454. package/docs/components/composed/simple-tooltip.md +33 -33
  455. package/docs/components/composed/status-badge.md +55 -55
  456. package/docs/components/shell/app-command-palette.md +44 -44
  457. package/docs/components/shell/bottom-navbar.md +52 -52
  458. package/docs/components/shell/command-registry.md +48 -48
  459. package/docs/components/shell/link-context.md +41 -41
  460. package/docs/components/shell/notification-center.md +63 -63
  461. package/docs/components/shell/notification-preferences.md +42 -42
  462. package/docs/components/shell/sidebar.md +92 -92
  463. package/docs/components/shell/top-bar.md +143 -143
  464. package/docs/components/ui/accordion.md +51 -51
  465. package/docs/components/ui/alert-dialog.md +61 -61
  466. package/docs/components/ui/alert.md +46 -46
  467. package/docs/components/ui/aspect-ratio.md +25 -25
  468. package/docs/components/ui/autocomplete.md +48 -48
  469. package/docs/components/ui/avatar.md +56 -56
  470. package/docs/components/ui/badge.md +83 -82
  471. package/docs/components/ui/banner.md +42 -42
  472. package/docs/components/ui/breadcrumb.md +37 -37
  473. package/docs/components/ui/button-group.md +41 -41
  474. package/docs/components/ui/button.md +94 -93
  475. package/docs/components/ui/card.md +52 -52
  476. package/docs/components/ui/charts.md +43 -43
  477. package/docs/components/ui/checkbox.md +36 -36
  478. package/docs/components/ui/chip.md +47 -47
  479. package/docs/components/ui/code.md +28 -28
  480. package/docs/components/ui/collapsible.md +40 -40
  481. package/docs/components/ui/color-input.md +91 -91
  482. package/docs/components/ui/color-swatch.md +25 -25
  483. package/docs/components/ui/combobox.md +54 -54
  484. package/docs/components/ui/container.md +26 -26
  485. package/docs/components/ui/context-menu.md +43 -43
  486. package/docs/components/ui/data-table-body.md +1 -1
  487. package/docs/components/ui/data-table-bulk-actions.md +1 -1
  488. package/docs/components/ui/data-table-card.md +1 -1
  489. package/docs/components/ui/data-table-context.md +1 -1
  490. package/docs/components/ui/data-table-header.md +1 -1
  491. package/docs/components/ui/data-table-pagination.md +1 -1
  492. package/docs/components/ui/data-table-toolbar.md +44 -44
  493. package/docs/components/ui/data-table.md +94 -94
  494. package/docs/components/ui/dialog.md +54 -54
  495. package/docs/components/ui/dropdown-menu.md +48 -48
  496. package/docs/components/ui/file-upload.md +41 -41
  497. package/docs/components/ui/form.md +51 -51
  498. package/docs/components/ui/hover-card.md +32 -32
  499. package/docs/components/ui/icon-button.md +40 -40
  500. package/docs/components/ui/input-otp.md +44 -44
  501. package/docs/components/ui/input.md +74 -74
  502. package/docs/components/ui/label.md +25 -25
  503. package/docs/components/ui/link.md +29 -29
  504. package/docs/components/ui/menubar.md +44 -44
  505. package/docs/components/ui/navigation-menu.md +46 -46
  506. package/docs/components/ui/number-input.md +44 -44
  507. package/docs/components/ui/pagination.md +48 -48
  508. package/docs/components/ui/popover.md +30 -30
  509. package/docs/components/ui/progress-ring.md +41 -41
  510. package/docs/components/ui/progress.md +34 -34
  511. package/docs/components/ui/radio.md +34 -34
  512. package/docs/components/ui/search-input.md +43 -43
  513. package/docs/components/ui/segmented-control.md +50 -50
  514. package/docs/components/ui/select.md +53 -53
  515. package/docs/components/ui/separator.md +32 -32
  516. package/docs/components/ui/sheet.md +47 -47
  517. package/docs/components/ui/sidebar.md +72 -72
  518. package/docs/components/ui/skeleton.md +77 -77
  519. package/docs/components/ui/slider.md +29 -29
  520. package/docs/components/ui/spinner.md +54 -54
  521. package/docs/components/ui/stack.md +39 -39
  522. package/docs/components/ui/stat-card.md +61 -61
  523. package/docs/components/ui/status-dot.md +26 -26
  524. package/docs/components/ui/stepper.md +49 -49
  525. package/docs/components/ui/switch.md +47 -47
  526. package/docs/components/ui/table.md +47 -47
  527. package/docs/components/ui/tabs.md +60 -60
  528. package/docs/components/ui/text.md +37 -37
  529. package/docs/components/ui/textarea.md +39 -39
  530. package/docs/components/ui/toast.md +65 -65
  531. package/docs/components/ui/toaster.md +47 -47
  532. package/docs/components/ui/toggle-group.md +43 -43
  533. package/docs/components/ui/toggle.md +37 -37
  534. package/docs/components/ui/tooltip.md +38 -38
  535. package/docs/components/ui/tree-view.md +65 -65
  536. package/docs/components/ui/visually-hidden.md +21 -21
  537. package/llms-full.txt +5266 -5264
  538. package/llms.txt +624 -580
  539. package/package.json +7 -8
  540. package/dist/_chunks/date-time-picker.js +0 -851
  541. package/dist/_chunks/typing-indicator.js +0 -565
@@ -0,0 +1,2071 @@
1
+ "use client";
2
+ import { ln as e, mn as t, pn as n, un as r } from "./primitives.js";
3
+ import { a as i, c as a, n as o } from "./framer.js";
4
+ import { durations as s } from "../ui/lib/motion.js";
5
+ import { cn as c } from "../ui/lib/utils.js";
6
+ import { Spinner as l } from "../ui/spinner.js";
7
+ import { Icon as u } from "../ui/icon.js";
8
+ import { useIsMobile as d } from "../hooks/use-mobile.js";
9
+ import { Button as f } from "../ui/button.js";
10
+ import { Dialog as p, DialogContent as m, DialogFooter as h, DialogHeader as g, DialogTitle as _ } from "../ui/dialog.js";
11
+ import { SplitButton as v } from "../ui/split-button.js";
12
+ import { emojiDataLoaders as y } from "../composed/emoji-picker.js";
13
+ import { c as b, d as x, g as ee, h as S, i as C, l as te, m as ne, n as re, o as ie, r as w, s as ae, t as T, y as oe } from "./tiptap.js";
14
+ import { a as se, i as ce, n as le, o as ue, r as de, t as fe } from "./mention-suggestion.js";
15
+ import { useColorMode as pe } from "../hooks/use-color-mode.js";
16
+ import { n as me, t as E } from "./use-calendar.js";
17
+ import * as D from "react";
18
+ import { useCallback as O, useEffect as he, useRef as k, useState as A } from "react";
19
+ import { Fragment as ge, jsx as j, jsxs as M } from "react/jsx-runtime";
20
+ import * as _e from "react-dom";
21
+ import { IconAt as ve, IconBlockquote as N, IconBold as ye, IconCalendarEvent as be, IconChevronDown as xe, IconClock as Se, IconCode as Ce, IconFile as we, IconHighlight as Te, IconItalic as P, IconLink as Ee, IconList as F, IconListNumbers as De, IconMicrophone as Oe, IconMoodSmile as ke, IconPencil as Ae, IconPlayerPause as je, IconPlayerPlay as I, IconPlus as Me, IconSend as Ne, IconSlash as L, IconSquare as Pe, IconStrikethrough as R, IconTextSize as Fe, IconTrash as Ie, IconUnderline as Le, IconX as z } from "@tabler/icons-react";
22
+ import { createRoot as Re } from "react-dom/client";
23
+ //#region src/composed/extensions/slash-command.tsx
24
+ var B = D.forwardRef(({ groups: e, query: t, command: n }, r) => {
25
+ let [i, a] = D.useState(0), o = D.useMemo(() => {
26
+ let n = t.toLowerCase(), r = [];
27
+ return e.forEach((e, t) => {
28
+ e.commands.forEach((e) => {
29
+ (!n || e.label.toLowerCase().includes(n) || e.description?.toLowerCase().includes(n)) && r.push({
30
+ command: e,
31
+ groupIndex: t
32
+ });
33
+ });
34
+ }), r;
35
+ }, [e, t]);
36
+ if (D.useEffect(() => a(0), [o]), D.useImperativeHandle(r, () => ({ onKeyDown: ({ event: e }) => e.key === "ArrowUp" ? (a((e) => (e + o.length - 1) % o.length), !0) : e.key === "ArrowDown" ? (a((e) => (e + 1) % o.length), !0) : e.key === "Enter" ? (o[i] && n(o[i].command), !0) : !1 })), !o.length) return null;
37
+ let s = [], l = 0;
38
+ for (let t of o) {
39
+ let n = e[t.groupIndex].label, r = s[s.length - 1];
40
+ (!r || r.label !== n) && (r = {
41
+ label: n,
42
+ items: []
43
+ }, s.push(r)), r.items.push({
44
+ command: t.command,
45
+ flatIndex: l
46
+ }), l++;
47
+ }
48
+ return /* @__PURE__ */ j("div", {
49
+ role: "listbox",
50
+ "aria-label": "Slash commands",
51
+ className: "z-popover max-h-[320px] min-w-[220px] overflow-x-hidden overflow-y-auto rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating",
52
+ children: s.map((e, t) => /* @__PURE__ */ M("div", {
53
+ role: "group",
54
+ "aria-label": e.label,
55
+ children: [
56
+ t > 0 && /* @__PURE__ */ j("div", { className: "my-ds-01 border-t border-surface-border" }),
57
+ /* @__PURE__ */ j("div", {
58
+ className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
59
+ children: e.label
60
+ }),
61
+ e.items.map(({ command: e, flatIndex: t }) => {
62
+ let r = e.icon;
63
+ return /* @__PURE__ */ M("button", {
64
+ type: "button",
65
+ role: "option",
66
+ "aria-selected": t === i,
67
+ onClick: () => n(e),
68
+ className: c("flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-left cursor-pointer", t === i ? "bg-surface-raised-hover" : "hover:bg-surface-raised-hover"),
69
+ children: [r && /* @__PURE__ */ j("span", {
70
+ className: "flex h-4 w-4 shrink-0 items-center justify-center text-surface-fg-muted",
71
+ children: /* @__PURE__ */ j(r, { className: "h-4 w-4" })
72
+ }), /* @__PURE__ */ M("div", {
73
+ className: "flex flex-col",
74
+ children: [/* @__PURE__ */ j("span", {
75
+ className: "text-ds-sm text-surface-fg",
76
+ children: e.label
77
+ }), e.description && /* @__PURE__ */ j("span", {
78
+ className: "text-ds-xs text-surface-fg-subtle",
79
+ children: e.description
80
+ })]
81
+ })]
82
+ }, e.id);
83
+ })
84
+ ]
85
+ }, e.label))
86
+ });
87
+ });
88
+ B.displayName = "SlashCommandList";
89
+ function ze(e) {
90
+ return () => {
91
+ let t = null, n = null, r = null;
92
+ return {
93
+ onStart: (i) => {
94
+ n = document.createElement("div"), n.style.position = "absolute", n.style.zIndex = "1400";
95
+ let a = i.clientRect?.();
96
+ a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), document.body.appendChild(n), t = Re(n), t.render(/* @__PURE__ */ j(B, {
97
+ ref: (e) => {
98
+ r = e;
99
+ },
100
+ groups: e,
101
+ query: i.query,
102
+ command: (e) => i.command(e)
103
+ }));
104
+ },
105
+ onUpdate: (i) => {
106
+ if (!t || !n) return;
107
+ let a = i.clientRect?.();
108
+ a && (n.style.left = `${a.left}px`, n.style.top = `${a.bottom + 4}px`), t.render(/* @__PURE__ */ j(B, {
109
+ ref: (e) => {
110
+ r = e;
111
+ },
112
+ groups: e,
113
+ query: i.query,
114
+ command: (e) => i.command(e)
115
+ }));
116
+ },
117
+ onKeyDown: (e) => e.event.key === "Escape" ? (n && (t?.unmount(), n.remove(), n = null, t = null), !0) : r?.onKeyDown(e) ?? !1,
118
+ onExit: () => {
119
+ n && (t?.unmount(), n.remove(), n = null, t = null);
120
+ }
121
+ };
122
+ };
123
+ }
124
+ function Be(e) {
125
+ let t = e.flatMap((e) => e.commands);
126
+ return ee.create({
127
+ name: "slashCommand",
128
+ addProseMirrorPlugins() {
129
+ return [w({
130
+ pluginKey: new oe("slashCommand"),
131
+ editor: this.editor,
132
+ char: "/",
133
+ startOfLine: !0,
134
+ allowSpaces: !1,
135
+ items: ({ query: e }) => {
136
+ if (!e) return t.slice(0, 8);
137
+ let n = e.toLowerCase();
138
+ return t.filter((e) => e.label.toLowerCase().includes(n) || e.description?.toLowerCase().includes(n)).slice(0, 8);
139
+ },
140
+ command: ({ editor: e, range: t, props: n }) => {
141
+ e.chain().focus().deleteRange(t).run(), n.action(e);
142
+ },
143
+ render: ze(e)
144
+ })];
145
+ }
146
+ });
147
+ }
148
+ //#endregion
149
+ //#region src/composed/rich-chat-input/reply-banner.tsx
150
+ function Ve({ author: e, preview: t, onDismiss: n }) {
151
+ return /* @__PURE__ */ j(i.div, {
152
+ initial: {
153
+ height: 0,
154
+ opacity: 0
155
+ },
156
+ animate: {
157
+ height: "auto",
158
+ opacity: 1
159
+ },
160
+ exit: {
161
+ height: 0,
162
+ opacity: 0
163
+ },
164
+ transition: {
165
+ duration: s.moderate02,
166
+ ease: [
167
+ .2,
168
+ 0,
169
+ .38,
170
+ .9
171
+ ]
172
+ },
173
+ className: "overflow-hidden",
174
+ children: /* @__PURE__ */ M("div", {
175
+ role: "status",
176
+ "aria-label": `Replying to ${e}`,
177
+ className: "flex items-center gap-ds-03 border-b border-surface-border px-ds-04 py-ds-02b",
178
+ children: [/* @__PURE__ */ M("div", {
179
+ className: "flex-1 min-w-0",
180
+ children: [
181
+ /* @__PURE__ */ M("span", {
182
+ className: "text-ds-sm font-semibold text-surface-fg",
183
+ children: ["Replying to ", e]
184
+ }),
185
+ /* @__PURE__ */ j("span", {
186
+ className: "mx-ds-02 text-surface-fg-subtle",
187
+ children: "·"
188
+ }),
189
+ /* @__PURE__ */ j("span", {
190
+ className: "text-ds-sm text-surface-fg-muted truncate",
191
+ children: t
192
+ })
193
+ ]
194
+ }), /* @__PURE__ */ j("button", {
195
+ type: "button",
196
+ onClick: n,
197
+ className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", "transition-colors duration-fast-01 ease-productive-standard", "active:scale-95"),
198
+ "aria-label": "Cancel reply",
199
+ title: "Cancel reply",
200
+ children: /* @__PURE__ */ j(u, {
201
+ icon: z,
202
+ size: "xs"
203
+ })
204
+ })]
205
+ })
206
+ });
207
+ }
208
+ //#endregion
209
+ //#region src/composed/rich-chat-input/schedule-send.tsx
210
+ function He() {
211
+ let e = /* @__PURE__ */ new Date(), t = e.getHours(), n = [], r = (t, n = 0) => {
212
+ let r = new Date(e);
213
+ return r.setDate(r.getDate() + n), r.setHours(t, 0, 0, 0), r;
214
+ }, i = (t) => {
215
+ let n = new Date(e), r = n.getDay(), i = r === 0 ? 1 : r === 1 ? 7 : 8 - r;
216
+ return n.setDate(n.getDate() + i), n.setHours(t, 0, 0, 0), n;
217
+ };
218
+ t < 9 ? (n.push({
219
+ label: "Later this morning · 9:00 AM",
220
+ date: r(9)
221
+ }), n.push({
222
+ label: "This afternoon · 1:00 PM",
223
+ date: r(13)
224
+ }), n.push({
225
+ label: "This evening · 6:00 PM",
226
+ date: r(18)
227
+ })) : t < 13 ? (n.push({
228
+ label: "This afternoon · 1:00 PM",
229
+ date: r(13)
230
+ }), n.push({
231
+ label: "This evening · 6:00 PM",
232
+ date: r(18)
233
+ }), n.push({
234
+ label: "Tomorrow morning · 9:00 AM",
235
+ date: r(9, 1)
236
+ })) : t < 18 ? (n.push({
237
+ label: "This evening · 6:00 PM",
238
+ date: r(18)
239
+ }), n.push({
240
+ label: "Tomorrow morning · 9:00 AM",
241
+ date: r(9, 1)
242
+ }), n.push({
243
+ label: "Tomorrow afternoon · 1:00 PM",
244
+ date: r(13, 1)
245
+ })) : (n.push({
246
+ label: "Tomorrow morning · 9:00 AM",
247
+ date: r(9, 1)
248
+ }), n.push({
249
+ label: "Tomorrow afternoon · 1:00 PM",
250
+ date: r(13, 1)
251
+ }));
252
+ let a = i(9);
253
+ return a.getTime() - e.getTime() > 2880 * 60 * 1e3 && n.push({
254
+ label: "Next Monday · 9:00 AM",
255
+ date: a
256
+ }), n;
257
+ }
258
+ function Ue({ value: e, onChange: t }) {
259
+ let n = e.getHours() % 12 || 12, r = e.getMinutes(), i = e.getHours() >= 12, a = (n) => {
260
+ let r = new Date(e);
261
+ r.setHours(i ? n % 12 + 12 : n % 12), t(r);
262
+ }, o = (n) => {
263
+ let r = new Date(e);
264
+ r.setMinutes(n), t(r);
265
+ }, s = (n) => {
266
+ let r = new Date(e), i = r.getHours();
267
+ n && i < 12 ? r.setHours(i + 12) : !n && i >= 12 && r.setHours(i - 12), t(r);
268
+ };
269
+ return /* @__PURE__ */ M("div", {
270
+ className: "flex items-center gap-ds-02",
271
+ children: [
272
+ /* @__PURE__ */ j("select", {
273
+ value: n,
274
+ onChange: (e) => a(Number(e.target.value)),
275
+ className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
276
+ "aria-label": "Hour",
277
+ children: Array.from({ length: 12 }, (e, t) => t + 1).map((e) => /* @__PURE__ */ j("option", {
278
+ value: e,
279
+ children: e
280
+ }, e))
281
+ }),
282
+ /* @__PURE__ */ j("span", {
283
+ className: "text-ds-sm text-surface-fg-subtle font-medium",
284
+ children: ":"
285
+ }),
286
+ /* @__PURE__ */ j("select", {
287
+ value: r - r % 5,
288
+ onChange: (e) => o(Number(e.target.value)),
289
+ className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-02 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9",
290
+ "aria-label": "Minute",
291
+ children: Array.from({ length: 12 }, (e, t) => t * 5).map((e) => /* @__PURE__ */ j("option", {
292
+ value: e,
293
+ children: String(e).padStart(2, "0")
294
+ }, e))
295
+ }),
296
+ /* @__PURE__ */ M("div", {
297
+ className: "inline-flex rounded-ds-md border border-surface-border-strong overflow-hidden",
298
+ children: [/* @__PURE__ */ j("button", {
299
+ type: "button",
300
+ onClick: () => s(!1),
301
+ className: c("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover" : "bg-accent-9 text-white"),
302
+ children: "AM"
303
+ }), /* @__PURE__ */ j("button", {
304
+ type: "button",
305
+ onClick: () => s(!0),
306
+ className: c("px-ds-02b py-ds-01 text-ds-xs font-medium transition-colors duration-fast-01", i ? "bg-accent-9 text-white" : "bg-surface-raised text-surface-fg-subtle hover:bg-surface-raised-hover"),
307
+ children: "PM"
308
+ })]
309
+ })
310
+ ]
311
+ });
312
+ }
313
+ function We({ value: e, onChange: t, minDate: n }) {
314
+ let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
315
+ let e = new Date(r);
316
+ return e.setHours(e.getHours() + 1, 0, 0, 0), e;
317
+ })(), a = `${i.getFullYear()}-${String(i.getMonth() + 1).padStart(2, "0")}-${String(i.getDate()).padStart(2, "0")}`, o = (e) => {
318
+ let n = e.target.value.split("-");
319
+ if (n.length !== 3) return;
320
+ let r = new Date(i);
321
+ r.setFullYear(Number(n[0]), Number(n[1]) - 1, Number(n[2])), t(r);
322
+ }, s = n ? `${n.getFullYear()}-${String(n.getMonth() + 1).padStart(2, "0")}-${String(n.getDate()).padStart(2, "0")}` : void 0;
323
+ return /* @__PURE__ */ M("div", {
324
+ className: "space-y-ds-03",
325
+ children: [/* @__PURE__ */ M("div", {
326
+ className: "flex items-center justify-between",
327
+ children: [/* @__PURE__ */ j("span", {
328
+ className: "text-ds-xs font-medium text-surface-fg-subtle",
329
+ children: "Date"
330
+ }), /* @__PURE__ */ j("input", {
331
+ type: "date",
332
+ value: a,
333
+ min: s,
334
+ onChange: o,
335
+ className: "h-ds-sm rounded-ds-md border border-surface-border-strong bg-surface-raised px-ds-03 text-ds-sm text-surface-fg focus:outline-hidden focus:ring-2 focus:ring-accent-9"
336
+ })]
337
+ }), /* @__PURE__ */ M("div", {
338
+ className: "flex items-center justify-between",
339
+ children: [/* @__PURE__ */ j("span", {
340
+ className: "text-ds-xs font-medium text-surface-fg-subtle",
341
+ children: "Time"
342
+ }), /* @__PURE__ */ j(Ue, {
343
+ value: i,
344
+ onChange: t
345
+ })]
346
+ })]
347
+ });
348
+ }
349
+ function Ge({ value: e, onChange: t, minDate: n }) {
350
+ let r = /* @__PURE__ */ new Date(), i = e ?? (() => {
351
+ let e = new Date(r);
352
+ return e.setHours(e.getHours() + 1, 0, 0, 0), e;
353
+ })(), { currentMonth: a, goToPreviousMonth: o, goToNextMonth: s } = E(i);
354
+ return /* @__PURE__ */ M("div", {
355
+ className: "space-y-ds-03",
356
+ children: [/* @__PURE__ */ j(me, {
357
+ currentMonth: a,
358
+ selected: i,
359
+ onSelect: (e) => {
360
+ let n = new Date(e);
361
+ n.setHours(i.getHours(), i.getMinutes(), 0, 0), t(n);
362
+ },
363
+ onMonthChange: (e) => {
364
+ e < a ? o() : s();
365
+ },
366
+ minDate: n,
367
+ className: "w-full"
368
+ }), /* @__PURE__ */ M("div", {
369
+ className: "flex items-center justify-between border-t border-surface-border pt-ds-03",
370
+ children: [/* @__PURE__ */ j("span", {
371
+ className: "text-ds-xs font-medium text-surface-fg-subtle",
372
+ children: "Time"
373
+ }), /* @__PURE__ */ j(Ue, {
374
+ value: i,
375
+ onChange: t
376
+ })]
377
+ })]
378
+ });
379
+ }
380
+ function Ke({ onSchedule: e, onClose: t, onOpenDialog: n }) {
381
+ let [r, i] = D.useState(!1), [a, o] = D.useState(null), s = D.useMemo(() => He(), []), c = (n) => {
382
+ e(n), t();
383
+ };
384
+ return r ? /* @__PURE__ */ M("div", {
385
+ className: "p-ds-04",
386
+ style: { minWidth: 270 },
387
+ children: [
388
+ /* @__PURE__ */ M("div", {
389
+ className: "mb-ds-03 flex items-center justify-between",
390
+ children: [/* @__PURE__ */ j("p", {
391
+ className: "text-ds-sm font-medium text-surface-fg",
392
+ children: "Pick date & time"
393
+ }), /* @__PURE__ */ j("button", {
394
+ type: "button",
395
+ onClick: () => i(!1),
396
+ className: "inline-flex items-center justify-center rounded-ds-md p-ds-01 text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg transition-colors",
397
+ "aria-label": "Back to presets",
398
+ children: /* @__PURE__ */ j(u, {
399
+ icon: z,
400
+ size: "sm"
401
+ })
402
+ })]
403
+ }),
404
+ /* @__PURE__ */ j(We, {
405
+ value: a,
406
+ onChange: o,
407
+ minDate: /* @__PURE__ */ new Date()
408
+ }),
409
+ /* @__PURE__ */ j("div", {
410
+ className: "mt-ds-03 flex justify-end",
411
+ children: /* @__PURE__ */ j(f, {
412
+ variant: "solid",
413
+ size: "sm",
414
+ onClick: () => {
415
+ a && a > /* @__PURE__ */ new Date() && (e(a), t(), o(null), i(!1));
416
+ },
417
+ disabled: !a || a <= /* @__PURE__ */ new Date(),
418
+ children: "Confirm"
419
+ })
420
+ })
421
+ ]
422
+ }) : /* @__PURE__ */ M("div", {
423
+ className: "p-ds-02",
424
+ style: { minWidth: 260 },
425
+ children: [
426
+ /* @__PURE__ */ j("p", {
427
+ className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
428
+ children: "Schedule send"
429
+ }),
430
+ s.map((e, t) => /* @__PURE__ */ M("button", {
431
+ type: "button",
432
+ onClick: () => c(e.date),
433
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
434
+ children: [/* @__PURE__ */ j(u, {
435
+ icon: Se,
436
+ size: "sm",
437
+ className: "shrink-0 text-surface-fg-muted"
438
+ }), e.label]
439
+ }, t)),
440
+ /* @__PURE__ */ j("div", { className: "mx-ds-02 my-ds-02 h-px bg-surface-border" }),
441
+ /* @__PURE__ */ M("button", {
442
+ type: "button",
443
+ onClick: () => i(!0),
444
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
445
+ children: [/* @__PURE__ */ j(u, {
446
+ icon: be,
447
+ size: "sm",
448
+ className: "shrink-0 text-accent-11"
449
+ }), "Pick date & time..."]
450
+ }),
451
+ n && /* @__PURE__ */ M("button", {
452
+ type: "button",
453
+ onClick: () => {
454
+ n(), t();
455
+ },
456
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02b text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
457
+ children: [/* @__PURE__ */ j(u, {
458
+ icon: be,
459
+ size: "sm",
460
+ className: "shrink-0 text-surface-fg-muted"
461
+ }), "Open full picker..."]
462
+ })
463
+ ]
464
+ });
465
+ }
466
+ function qe({ open: e, onOpenChange: t, onSchedule: n, initialDate: r }) {
467
+ let [i, a] = D.useState(r ?? null);
468
+ return D.useEffect(() => {
469
+ e && a(r ?? null);
470
+ }, [e, r]), /* @__PURE__ */ j(p, {
471
+ open: e,
472
+ onOpenChange: t,
473
+ children: /* @__PURE__ */ M(m, {
474
+ className: "sm:max-w-[380px]",
475
+ children: [
476
+ /* @__PURE__ */ j(g, { children: /* @__PURE__ */ j(_, { children: r ? "Reschedule message" : "Schedule send" }) }),
477
+ /* @__PURE__ */ j(Ge, {
478
+ value: i,
479
+ onChange: a,
480
+ minDate: /* @__PURE__ */ new Date()
481
+ }),
482
+ /* @__PURE__ */ M(h, {
483
+ className: "gap-ds-02",
484
+ children: [/* @__PURE__ */ j(f, {
485
+ variant: "soft",
486
+ onClick: () => t(!1),
487
+ children: "Cancel"
488
+ }), /* @__PURE__ */ j(f, {
489
+ variant: "solid",
490
+ onClick: () => {
491
+ i && i > /* @__PURE__ */ new Date() && (n(i), t(!1));
492
+ },
493
+ disabled: !i || i <= /* @__PURE__ */ new Date(),
494
+ children: r ? "Reschedule" : "Schedule"
495
+ })]
496
+ })
497
+ ]
498
+ })
499
+ });
500
+ }
501
+ function Je(e) {
502
+ let t = /* @__PURE__ */ new Date(), n = new Date(t);
503
+ n.setDate(n.getDate() + 1);
504
+ let r = e.toDateString() === t.toDateString(), i = e.toDateString() === n.toDateString(), a = e.toLocaleTimeString(void 0, {
505
+ hour: "numeric",
506
+ minute: "2-digit"
507
+ });
508
+ return r ? `Today at ${a}` : i ? `Tomorrow at ${a}` : `${e.toLocaleDateString(void 0, {
509
+ weekday: "short",
510
+ month: "short",
511
+ day: "numeric"
512
+ })} at ${a}`;
513
+ }
514
+ function Ye({ date: e, onClear: t, onEdit: n }) {
515
+ return /* @__PURE__ */ j(i.div, {
516
+ initial: {
517
+ height: 0,
518
+ opacity: 0
519
+ },
520
+ animate: {
521
+ height: "auto",
522
+ opacity: 1
523
+ },
524
+ exit: {
525
+ height: 0,
526
+ opacity: 0
527
+ },
528
+ transition: { duration: s.moderate01 },
529
+ className: "overflow-hidden",
530
+ children: /* @__PURE__ */ M("div", {
531
+ className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b text-ds-xs text-accent-11 bg-accent-2 border-b border-accent-4",
532
+ children: [
533
+ /* @__PURE__ */ j(u, {
534
+ icon: Se,
535
+ size: "xs",
536
+ className: "shrink-0"
537
+ }),
538
+ /* @__PURE__ */ M("span", {
539
+ className: "flex-1 truncate",
540
+ children: ["Scheduled for ", Je(e)]
541
+ }),
542
+ n && /* @__PURE__ */ j("button", {
543
+ type: "button",
544
+ onClick: n,
545
+ className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
546
+ "aria-label": "Edit schedule",
547
+ children: /* @__PURE__ */ j(u, {
548
+ icon: Ae,
549
+ size: "xs"
550
+ })
551
+ }),
552
+ /* @__PURE__ */ j("button", {
553
+ type: "button",
554
+ onClick: t,
555
+ className: "inline-flex shrink-0 items-center justify-center rounded-ds-sm p-ds-01 hover:bg-accent-3 transition-colors",
556
+ "aria-label": "Cancel schedule",
557
+ children: /* @__PURE__ */ j(u, {
558
+ icon: z,
559
+ size: "xs"
560
+ })
561
+ })
562
+ ]
563
+ })
564
+ });
565
+ }
566
+ //#endregion
567
+ //#region src/composed/rich-chat-input/attachment-strip.tsx
568
+ function Xe(e) {
569
+ return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
570
+ }
571
+ function Ze({ attachments: e, onRemoveAttachment: t }) {
572
+ return /* @__PURE__ */ j(i.div, {
573
+ initial: {
574
+ height: 0,
575
+ opacity: 0
576
+ },
577
+ animate: {
578
+ height: "auto",
579
+ opacity: 1
580
+ },
581
+ exit: {
582
+ height: 0,
583
+ opacity: 0
584
+ },
585
+ transition: {
586
+ duration: s.moderate02,
587
+ ease: [
588
+ .2,
589
+ 0,
590
+ .38,
591
+ .9
592
+ ]
593
+ },
594
+ className: "overflow-hidden",
595
+ children: /* @__PURE__ */ j("div", {
596
+ role: "list",
597
+ "aria-label": "Attachments",
598
+ className: "flex gap-ds-02 overflow-x-auto px-ds-04 py-ds-02b border-b border-surface-border",
599
+ children: /* @__PURE__ */ j(a, {
600
+ initial: !1,
601
+ children: e.map((e) => e.type === "image" ? /* @__PURE__ */ M(i.div, {
602
+ role: "listitem",
603
+ "aria-label": `Image: ${e.name}`,
604
+ layout: !0,
605
+ initial: {
606
+ scale: 0,
607
+ opacity: 0
608
+ },
609
+ animate: {
610
+ scale: 1,
611
+ opacity: 1
612
+ },
613
+ exit: {
614
+ scale: .95,
615
+ opacity: 0
616
+ },
617
+ transition: {
618
+ layout: {
619
+ type: "spring",
620
+ stiffness: 400,
621
+ damping: 30
622
+ },
623
+ scale: {
624
+ type: "spring",
625
+ stiffness: 400,
626
+ damping: 30
627
+ },
628
+ opacity: { duration: s.fast02 }
629
+ },
630
+ className: "relative h-12 w-12 shrink-0 group",
631
+ children: [
632
+ /* @__PURE__ */ j("img", {
633
+ src: e.url,
634
+ alt: e.name,
635
+ className: "h-full w-full rounded-ds-md object-cover"
636
+ }),
637
+ /* @__PURE__ */ j("button", {
638
+ onClick: () => t(e.id),
639
+ className: "absolute -top-1 -right-1 h-ico-sm w-ico-sm rounded-full bg-error-9 text-error-fg flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
640
+ "aria-label": `Remove ${e.name}`,
641
+ title: "Remove",
642
+ children: /* @__PURE__ */ j(u, {
643
+ icon: z,
644
+ size: "xs"
645
+ })
646
+ }),
647
+ e.uploading && /* @__PURE__ */ j("div", {
648
+ className: "absolute inset-0 rounded-ds-md bg-surface-overlay/50 flex items-center justify-center",
649
+ children: /* @__PURE__ */ j(l, { size: "sm" })
650
+ })
651
+ ]
652
+ }, e.id) : /* @__PURE__ */ M(i.div, {
653
+ role: "listitem",
654
+ "aria-label": `File: ${e.name}, ${Xe(e.size)}`,
655
+ layout: !0,
656
+ initial: {
657
+ scale: 0,
658
+ opacity: 0
659
+ },
660
+ animate: {
661
+ scale: 1,
662
+ opacity: 1
663
+ },
664
+ exit: {
665
+ scale: .95,
666
+ opacity: 0
667
+ },
668
+ transition: {
669
+ layout: {
670
+ type: "spring",
671
+ stiffness: 400,
672
+ damping: 30
673
+ },
674
+ scale: {
675
+ type: "spring",
676
+ stiffness: 400,
677
+ damping: 30
678
+ },
679
+ opacity: { duration: s.fast02 }
680
+ },
681
+ className: "flex items-center gap-ds-02 shrink-0 rounded-ds-md bg-surface-raised px-ds-03 py-ds-01 group",
682
+ children: [
683
+ /* @__PURE__ */ j(u, {
684
+ icon: we,
685
+ size: "xs",
686
+ className: "text-surface-fg-muted"
687
+ }),
688
+ /* @__PURE__ */ j("span", {
689
+ className: "text-ds-xs text-surface-fg-muted truncate max-w-[120px]",
690
+ children: e.name
691
+ }),
692
+ /* @__PURE__ */ j("span", {
693
+ className: "text-ds-xs text-surface-fg-subtle",
694
+ children: Xe(e.size)
695
+ }),
696
+ /* @__PURE__ */ j("button", {
697
+ onClick: () => t(e.id),
698
+ className: "text-surface-fg-subtle hover:text-error-11 opacity-0 group-hover:opacity-100 transition-opacity duration-fast-02",
699
+ "aria-label": `Remove ${e.name}`,
700
+ title: "Remove",
701
+ children: /* @__PURE__ */ j(u, {
702
+ icon: z,
703
+ size: "xs"
704
+ })
705
+ })
706
+ ]
707
+ }, e.id))
708
+ })
709
+ })
710
+ });
711
+ }
712
+ //#endregion
713
+ //#region src/composed/rich-chat-input/audio-waveform.tsx
714
+ var V = D.forwardRef(function({ mode: e, analyserNode: t, data: n, progress: r = 0, barWidth: i = 3, barGap: a = 2, barCount: o = 40, height: s = 32, className: l, ...u }, d) {
715
+ let [f, p] = D.useState(() => Array(o).fill(.05)), m = D.useRef(0), h = D.useRef(f);
716
+ D.useEffect(() => {
717
+ if (e !== "live" || !t) return;
718
+ let n = new Uint8Array(t.frequencyBinCount), r = () => {
719
+ t.getByteFrequencyData(n);
720
+ let e = Math.floor(n.length / o), i = Array(o);
721
+ for (let t = 0; t < o; t++) {
722
+ let r = 0;
723
+ for (let i = 0; i < e; i++) r += n[t * e + i];
724
+ let a = r / (e * 255);
725
+ i[t] = h.current[t] + (a - h.current[t]) * .3;
726
+ }
727
+ h.current = i, p(i), m.current = requestAnimationFrame(r);
728
+ };
729
+ return m.current = requestAnimationFrame(r), () => cancelAnimationFrame(m.current);
730
+ }, [
731
+ e,
732
+ t,
733
+ o
734
+ ]), D.useEffect(() => {
735
+ if (!(e !== "static" || !n)) if (n.length === o) p(n);
736
+ else {
737
+ let e = Array(o), t = n.length / o;
738
+ for (let r = 0; r < o; r++) {
739
+ let i = Math.floor(r * t);
740
+ e[r] = n[Math.min(i, n.length - 1)];
741
+ }
742
+ p(e);
743
+ }
744
+ }, [
745
+ e,
746
+ n,
747
+ o
748
+ ]);
749
+ let g = o * (i + a) - a, _ = D.useMemo(() => f.map((t, n) => {
750
+ let c = Math.max(2, t * s), l = n * (i + a), u = (s - c) / 2, d = e === "static" && r > 0 && n / o <= r;
751
+ return /* @__PURE__ */ j("rect", {
752
+ x: l,
753
+ y: u,
754
+ width: i,
755
+ height: c,
756
+ rx: i / 2,
757
+ fill: d ? "var(--color-accent-9)" : "var(--color-surface-border)"
758
+ }, n);
759
+ }), [
760
+ f,
761
+ r,
762
+ e,
763
+ i,
764
+ a,
765
+ o,
766
+ s
767
+ ]);
768
+ return /* @__PURE__ */ j("svg", {
769
+ ref: d,
770
+ height: s,
771
+ viewBox: `0 0 ${g} ${s}`,
772
+ preserveAspectRatio: "none",
773
+ "aria-hidden": "true",
774
+ className: c("shrink-0", l),
775
+ ...u,
776
+ children: _
777
+ });
778
+ });
779
+ V.displayName = "AudioWaveform";
780
+ //#endregion
781
+ //#region src/composed/rich-chat-input/recording-overlay.tsx
782
+ function Qe(e) {
783
+ let t = Math.floor(e / 60), n = Math.floor(e % 60);
784
+ return {
785
+ minutes: String(t),
786
+ separator: ":",
787
+ secs: n.toString().padStart(2, "0")
788
+ };
789
+ }
790
+ function $e({ duration: e, analyserNode: t, maxDuration: n, onCancel: r }) {
791
+ let i = o();
792
+ D.useEffect(() => {
793
+ let e = (e) => {
794
+ e.key === "Escape" && r();
795
+ };
796
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
797
+ }, [r]);
798
+ let a = n != null && n > 0 && e >= n - 10, s = n != null && n > 0 && e >= n - 5, l = s ? "animate-[pulse_500ms_ease-in-out_infinite]" : "animate-[pulse_1s_ease-in-out_infinite]", u = Qe(e), d = s ? "text-error-11" : a ? "text-warning-11" : "text-surface-fg";
799
+ return /* @__PURE__ */ M("div", {
800
+ role: "status",
801
+ "aria-live": "polite",
802
+ "aria-label": "Recording voice message",
803
+ className: "absolute inset-0 flex items-center gap-ds-03 px-ds-04 py-ds-03 bg-surface-raised-hover rounded-ds-lg z-10",
804
+ children: [
805
+ /* @__PURE__ */ j("span", {
806
+ className: c("w-ds-02b h-ds-02b shrink-0 rounded-ds-full bg-error-9", i ? "opacity-100" : l),
807
+ "aria-hidden": "true"
808
+ }),
809
+ /* @__PURE__ */ M("span", {
810
+ className: c("text-ds-sm font-mono tabular-nums whitespace-nowrap", d),
811
+ "aria-label": `${u.minutes} minutes ${u.secs} seconds`,
812
+ children: [
813
+ u.minutes,
814
+ /* @__PURE__ */ j("span", {
815
+ className: i ? void 0 : "animate-[blink_1s_step-end_infinite]",
816
+ "aria-hidden": "true",
817
+ children: u.separator
818
+ }),
819
+ u.secs
820
+ ]
821
+ }),
822
+ /* @__PURE__ */ j("div", {
823
+ className: "flex-1 min-w-0 overflow-hidden",
824
+ children: /* @__PURE__ */ j(V, {
825
+ mode: "live",
826
+ analyserNode: t,
827
+ height: 24,
828
+ barCount: 60,
829
+ className: "w-full"
830
+ })
831
+ })
832
+ ]
833
+ });
834
+ }
835
+ $e.displayName = "RecordingOverlay";
836
+ //#endregion
837
+ //#region src/composed/rich-chat-input/chat-toolbar.tsx
838
+ var H = D.createContext(null);
839
+ function U() {
840
+ let e = D.useContext(H);
841
+ if (!e) throw Error("Toolbar primitives must be used inside <ChatToolbar>");
842
+ return e;
843
+ }
844
+ function W({ onClick: e, isActive: t, disabled: n, title: r, children: i, className: a }) {
845
+ let { disabled: o } = U();
846
+ return /* @__PURE__ */ j("button", {
847
+ type: "button",
848
+ onClick: e,
849
+ disabled: n ?? o,
850
+ title: r,
851
+ "aria-label": r,
852
+ "aria-pressed": t,
853
+ className: c("inline-flex h-ds-xs-plus items-center justify-center rounded-ds-md touch-target", !a?.includes("w-") && "w-ds-xs-plus", "transition-[color,background-color,transform] duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover hover:text-surface-fg", "active:scale-95", "disabled:pointer-events-none disabled:opacity-action-disabled", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle", a),
854
+ children: i
855
+ });
856
+ }
857
+ function G() {
858
+ return /* @__PURE__ */ j("div", { className: "h-4 w-px bg-surface-border-subtle mx-ds-01" });
859
+ }
860
+ function K({ children: e, className: t }) {
861
+ return /* @__PURE__ */ j("div", {
862
+ className: c("flex items-center gap-ds-01", t),
863
+ children: e
864
+ });
865
+ }
866
+ function et() {
867
+ let { editor: e } = U(), { isActive: t } = S({
868
+ editor: e,
869
+ selector: ({ editor: e }) => ({ isActive: e.isActive("bold") })
870
+ });
871
+ return /* @__PURE__ */ j(W, {
872
+ onClick: () => e.chain().focus().toggleBold().run(),
873
+ isActive: t,
874
+ title: "Bold",
875
+ children: /* @__PURE__ */ j(u, {
876
+ icon: ye,
877
+ size: "xs"
878
+ })
879
+ });
880
+ }
881
+ function tt() {
882
+ let { editor: e } = U(), { isActive: t } = S({
883
+ editor: e,
884
+ selector: ({ editor: e }) => ({ isActive: e.isActive("italic") })
885
+ });
886
+ return /* @__PURE__ */ j(W, {
887
+ onClick: () => e.chain().focus().toggleItalic().run(),
888
+ isActive: t,
889
+ title: "Italic",
890
+ children: /* @__PURE__ */ j(u, {
891
+ icon: P,
892
+ size: "xs"
893
+ })
894
+ });
895
+ }
896
+ function nt() {
897
+ let { editor: e } = U(), { isActive: t } = S({
898
+ editor: e,
899
+ selector: ({ editor: e }) => ({ isActive: e.isActive("underline") })
900
+ });
901
+ return /* @__PURE__ */ j(W, {
902
+ onClick: () => e.chain().focus().toggleUnderline().run(),
903
+ isActive: t,
904
+ title: "Underline",
905
+ children: /* @__PURE__ */ j(u, {
906
+ icon: Le,
907
+ size: "xs"
908
+ })
909
+ });
910
+ }
911
+ function rt() {
912
+ let { editor: e } = U(), { isActive: t } = S({
913
+ editor: e,
914
+ selector: ({ editor: e }) => ({ isActive: e.isActive("strike") })
915
+ });
916
+ return /* @__PURE__ */ j(W, {
917
+ onClick: () => e.chain().focus().toggleStrike().run(),
918
+ isActive: t,
919
+ title: "Strikethrough",
920
+ children: /* @__PURE__ */ j(u, {
921
+ icon: R,
922
+ size: "xs"
923
+ })
924
+ });
925
+ }
926
+ function it() {
927
+ let { editor: e } = U(), { isActive: t } = S({
928
+ editor: e,
929
+ selector: ({ editor: e }) => ({ isActive: e.isActive("highlight") })
930
+ });
931
+ return /* @__PURE__ */ j(W, {
932
+ onClick: () => e.chain().focus().toggleHighlight().run(),
933
+ isActive: t,
934
+ title: "Highlight",
935
+ children: /* @__PURE__ */ j(u, {
936
+ icon: Te,
937
+ size: "xs"
938
+ })
939
+ });
940
+ }
941
+ function at() {
942
+ let { editor: e } = U(), { isActive: t } = S({
943
+ editor: e,
944
+ selector: ({ editor: e }) => ({ isActive: e.isActive("code") })
945
+ });
946
+ return /* @__PURE__ */ j(W, {
947
+ onClick: () => e.chain().focus().toggleCode().run(),
948
+ isActive: t,
949
+ title: "Inline code",
950
+ children: /* @__PURE__ */ j(u, {
951
+ icon: Ce,
952
+ size: "xs"
953
+ })
954
+ });
955
+ }
956
+ function ot() {
957
+ let { editor: e } = U(), { isActive: t } = S({
958
+ editor: e,
959
+ selector: ({ editor: e }) => ({ isActive: e.isActive("bulletList") })
960
+ });
961
+ return /* @__PURE__ */ j(W, {
962
+ onClick: () => e.chain().focus().toggleBulletList().run(),
963
+ isActive: t,
964
+ title: "Bullet list",
965
+ children: /* @__PURE__ */ j(u, {
966
+ icon: F,
967
+ size: "xs"
968
+ })
969
+ });
970
+ }
971
+ function q() {
972
+ let { editor: e } = U(), { isActive: t } = S({
973
+ editor: e,
974
+ selector: ({ editor: e }) => ({ isActive: e.isActive("orderedList") })
975
+ });
976
+ return /* @__PURE__ */ j(W, {
977
+ onClick: () => e.chain().focus().toggleOrderedList().run(),
978
+ isActive: t,
979
+ title: "Ordered list",
980
+ children: /* @__PURE__ */ j(u, {
981
+ icon: De,
982
+ size: "xs"
983
+ })
984
+ });
985
+ }
986
+ function st() {
987
+ let { editor: e } = U(), { isActive: t } = S({
988
+ editor: e,
989
+ selector: ({ editor: e }) => ({ isActive: e.isActive("blockquote") })
990
+ });
991
+ return /* @__PURE__ */ j(W, {
992
+ onClick: () => e.chain().focus().toggleBlockquote().run(),
993
+ isActive: t,
994
+ title: "Quote",
995
+ children: /* @__PURE__ */ j(u, {
996
+ icon: N,
997
+ size: "xs"
998
+ })
999
+ });
1000
+ }
1001
+ function J() {
1002
+ let { editor: e } = U(), { isActive: t } = S({
1003
+ editor: e,
1004
+ selector: ({ editor: e }) => ({ isActive: e.isActive("link") })
1005
+ });
1006
+ return /* @__PURE__ */ j(W, {
1007
+ onClick: () => {
1008
+ let t = window.prompt("URL");
1009
+ t && e.chain().focus().setLink({ href: t }).run();
1010
+ },
1011
+ isActive: t,
1012
+ title: "Link",
1013
+ children: /* @__PURE__ */ j(u, {
1014
+ icon: Ee,
1015
+ size: "xs"
1016
+ })
1017
+ });
1018
+ }
1019
+ function ct() {
1020
+ let { editor: e } = U();
1021
+ return /* @__PURE__ */ j(W, {
1022
+ onClick: () => e.chain().focus().insertContent("@").run(),
1023
+ title: "Mention",
1024
+ children: /* @__PURE__ */ j(u, {
1025
+ icon: ve,
1026
+ size: "xs"
1027
+ })
1028
+ });
1029
+ }
1030
+ function lt() {
1031
+ let { editor: e } = U();
1032
+ return /* @__PURE__ */ j(W, {
1033
+ onClick: () => e.chain().focus().insertContent(":").run(),
1034
+ title: "Emoji",
1035
+ children: /* @__PURE__ */ j(u, {
1036
+ icon: ke,
1037
+ size: "xs"
1038
+ })
1039
+ });
1040
+ }
1041
+ function ut() {
1042
+ let { editor: e } = U();
1043
+ return /* @__PURE__ */ j(W, {
1044
+ onClick: () => e.chain().focus().insertContent("/").run(),
1045
+ title: "Slash command",
1046
+ children: /* @__PURE__ */ j(u, {
1047
+ icon: L,
1048
+ size: "xs"
1049
+ })
1050
+ });
1051
+ }
1052
+ function Y({ items: e, isMobile: t, hasMentions: n, hasSlashCommands: r }) {
1053
+ let i = (t) => !e || e.includes(t);
1054
+ return /* @__PURE__ */ M(ge, { children: [
1055
+ !t && /* @__PURE__ */ M(K, { children: [
1056
+ i("bold") && /* @__PURE__ */ j(et, {}),
1057
+ i("italic") && /* @__PURE__ */ j(tt, {}),
1058
+ i("underline") && /* @__PURE__ */ j(nt, {}),
1059
+ i("strike") && /* @__PURE__ */ j(rt, {}),
1060
+ i("highlight") && /* @__PURE__ */ j(it, {})
1061
+ ] }),
1062
+ !t && /* @__PURE__ */ j(G, {}),
1063
+ !t && /* @__PURE__ */ M(K, { children: [i("bulletList") && /* @__PURE__ */ j(ot, {}), i("orderedList") && /* @__PURE__ */ j(q, {})] }),
1064
+ !t && (i("blockquote") || i("link") || i("code")) && /* @__PURE__ */ j(G, {}),
1065
+ !t && /* @__PURE__ */ M(K, { children: [
1066
+ i("blockquote") && /* @__PURE__ */ j(st, {}),
1067
+ i("link") && /* @__PURE__ */ j(J, {}),
1068
+ i("code") && /* @__PURE__ */ j(at, {})
1069
+ ] }),
1070
+ !t && (n || r) && /* @__PURE__ */ j(G, {}),
1071
+ /* @__PURE__ */ M(K, { children: [
1072
+ n && i("mention") && /* @__PURE__ */ j(ct, {}),
1073
+ i("emoji") && /* @__PURE__ */ j(lt, {}),
1074
+ r && i("slash") && /* @__PURE__ */ j(ut, {})
1075
+ ] })
1076
+ ] });
1077
+ }
1078
+ function dt({ editor: e, toolbar: t, isMobile: n, hasMentions: r, hasSlashCommands: i, disabled: a }) {
1079
+ if (t === !1) return null;
1080
+ let o = typeof t != "boolean" && !Array.isArray(t), s = Array.isArray(t) ? t : null;
1081
+ return /* @__PURE__ */ j(H.Provider, {
1082
+ value: {
1083
+ editor: e,
1084
+ disabled: a
1085
+ },
1086
+ children: /* @__PURE__ */ j("div", {
1087
+ role: "toolbar",
1088
+ "aria-label": "Text formatting",
1089
+ className: "flex flex-wrap items-center gap-ds-01 border-t border-surface-border px-ds-04 py-ds-02b",
1090
+ children: o ? t : /* @__PURE__ */ j(Y, {
1091
+ items: s,
1092
+ isMobile: n,
1093
+ hasMentions: r,
1094
+ hasSlashCommands: i
1095
+ })
1096
+ })
1097
+ });
1098
+ }
1099
+ //#endregion
1100
+ //#region src/composed/rich-chat-input/audio-player.tsx
1101
+ var X = [
1102
+ 1,
1103
+ 1.5,
1104
+ 2
1105
+ ];
1106
+ function Z(e) {
1107
+ return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
1108
+ }
1109
+ var ft = D.forwardRef(function({ src: e, duration: t, waveformData: n, className: r, ...i }, a) {
1110
+ let o = D.useRef(null), s = D.useRef(null), [l, u] = D.useState(!1), [d, f] = D.useState(0), [p, m] = D.useState(0), [h, g] = D.useState(null), _ = D.useMemo(() => {
1111
+ if (typeof e == "string") return e;
1112
+ let t = URL.createObjectURL(e);
1113
+ return g(t), t;
1114
+ }, [e]);
1115
+ D.useEffect(() => () => {
1116
+ h && URL.revokeObjectURL(h);
1117
+ }, [h]), D.useEffect(() => {
1118
+ let e = o.current;
1119
+ if (!e) return;
1120
+ let t = () => f(e.currentTime), n = () => {
1121
+ u(!1), f(0);
1122
+ };
1123
+ return e.addEventListener("timeupdate", t), e.addEventListener("ended", n), () => {
1124
+ e.removeEventListener("timeupdate", t), e.removeEventListener("ended", n);
1125
+ };
1126
+ }, []);
1127
+ let v = D.useCallback(() => {
1128
+ let e = o.current;
1129
+ e && (l ? (e.pause(), u(!1)) : (e.play(), u(!0)));
1130
+ }, [l]), y = D.useCallback((e) => {
1131
+ (e.key === " " || e.key === "Enter") && (e.preventDefault(), v());
1132
+ }, [v]), b = D.useCallback((e) => {
1133
+ let n = o.current, r = s.current;
1134
+ if (!n || !r || t <= 0) return;
1135
+ let i = r.getBoundingClientRect(), a = e.clientX - i.left;
1136
+ n.currentTime = Math.max(0, Math.min(1, a / i.width)) * t, f(n.currentTime);
1137
+ }, [t]), x = D.useCallback(() => {
1138
+ let e = (p + 1) % X.length;
1139
+ m(e), o.current && (o.current.playbackRate = X[e]);
1140
+ }, [p]), ee = t > 0 ? d / t : 0, S = X[p];
1141
+ return /* @__PURE__ */ M("div", {
1142
+ ref: a,
1143
+ role: "group",
1144
+ "aria-label": "Voice message player",
1145
+ className: c("flex items-center gap-ds-03", r),
1146
+ ...i,
1147
+ children: [
1148
+ /* @__PURE__ */ j("audio", {
1149
+ ref: o,
1150
+ src: _,
1151
+ preload: "metadata"
1152
+ }),
1153
+ /* @__PURE__ */ j("button", {
1154
+ type: "button",
1155
+ onClick: v,
1156
+ onKeyDown: y,
1157
+ "aria-label": l ? "Pause voice message" : "Play voice message",
1158
+ className: "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-ds-full bg-accent-9 text-accent-fg hover:bg-accent-10 active:scale-95 transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
1159
+ children: j(l ? je : I, {
1160
+ size: 16,
1161
+ stroke: 2,
1162
+ "aria-hidden": "true"
1163
+ })
1164
+ }),
1165
+ /* @__PURE__ */ j(V, {
1166
+ ref: s,
1167
+ mode: "static",
1168
+ data: n,
1169
+ progress: ee,
1170
+ className: "cursor-pointer",
1171
+ onClick: b
1172
+ }),
1173
+ /* @__PURE__ */ M("span", {
1174
+ className: "text-ds-xs tabular-nums text-surface-fg-subtle whitespace-nowrap",
1175
+ children: [
1176
+ Z(d),
1177
+ " / ",
1178
+ Z(t)
1179
+ ]
1180
+ }),
1181
+ /* @__PURE__ */ M("button", {
1182
+ type: "button",
1183
+ onClick: x,
1184
+ "aria-label": `Playback speed ${S}x`,
1185
+ className: "shrink-0 text-ds-xs bg-surface-raised rounded-ds-full px-ds-02 py-[1px] hover:bg-surface-raised-hover tabular-nums transition-colors duration-fast-01 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-accent-9 focus-visible:ring-offset-2",
1186
+ children: [S, "x"]
1187
+ })
1188
+ ]
1189
+ });
1190
+ });
1191
+ ft.displayName = "AudioPlayer";
1192
+ //#endregion
1193
+ //#region src/composed/rich-chat-input/use-voice-recorder.ts
1194
+ function pt() {
1195
+ return typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : typeof MediaRecorder < "u" && MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "";
1196
+ }
1197
+ function mt(e) {
1198
+ let { maxDuration: t, onComplete: n } = e, [r, i] = A("idle"), [a, o] = A(0), [s, c] = A(null), [l, u] = A([]), d = k(null), f = k(null), p = k(null), m = k([]), h = k(null), g = k(null), _ = k(null), v = k(null), y = k(0), b = k([]), x = k(!1), ee = k(n);
1199
+ ee.current = n;
1200
+ let S = O(() => {
1201
+ h.current !== null && (clearInterval(h.current), h.current = null), g.current !== null && (clearInterval(g.current), g.current = null), _.current !== null && (clearTimeout(_.current), _.current = null), p.current &&= (p.current.getTracks().forEach((e) => e.stop()), null), f.current &&= (f.current.close().catch(() => {}), null), v.current = null, c(null), d.current = null, m.current = [];
1202
+ }, []), C = O(async () => {
1203
+ if (typeof MediaRecorder > "u") throw Error("MediaRecorder is not supported in this browser. Voice recording requires a modern browser with MediaRecorder support.");
1204
+ let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
1205
+ p.current = e;
1206
+ let n = pt(), r = n ? new MediaRecorder(e, { mimeType: n }) : new MediaRecorder(e);
1207
+ d.current = r, m.current = [], x.current = !1;
1208
+ let a = new AudioContext();
1209
+ f.current = a;
1210
+ let s = a.createMediaStreamSource(e), l = a.createAnalyser();
1211
+ l.fftSize = 256, l.smoothingTimeConstant = .7, s.connect(l), v.current = l, c(l), r.ondataavailable = (e) => {
1212
+ e.data.size > 0 && m.current.push(e.data);
1213
+ }, r.onstop = () => {
1214
+ if (x.current) S(), i("idle"), o(0), u([]);
1215
+ else {
1216
+ let e = new Blob(m.current, { type: r.mimeType || "audio/webm" }), t = y.current, n = b.current;
1217
+ S(), i("idle"), o(0), u([]), ee.current(e, t, n);
1218
+ }
1219
+ }, r.start(), o(0), y.current = 0, h.current = setInterval(() => {
1220
+ y.current += 1, o((e) => e + 1);
1221
+ }, 1e3);
1222
+ let C = new Uint8Array(l.frequencyBinCount);
1223
+ u([]), b.current = [], g.current = setInterval(() => {
1224
+ if (v.current) {
1225
+ v.current.getByteFrequencyData(C);
1226
+ let e = 0;
1227
+ for (let t = 0; t < C.length; t++) e += C[t];
1228
+ let t = e / C.length / 255;
1229
+ b.current = [...b.current, t], u((e) => [...e, t]);
1230
+ }
1231
+ }, 100), t !== void 0 && t > 0 && (_.current = setTimeout(() => {
1232
+ d.current && d.current.state !== "inactive" && d.current.stop();
1233
+ }, t * 1e3)), i("recording");
1234
+ }, [t, S]), te = O(() => {
1235
+ d.current && d.current.state !== "inactive" && (x.current = !1, d.current.stop());
1236
+ }, []), ne = O(() => {
1237
+ d.current && d.current.state !== "inactive" ? (x.current = !0, d.current.stop()) : (S(), i("idle"), o(0), u([]));
1238
+ }, [S]), re = O(() => {
1239
+ d.current && d.current.state === "recording" && (d.current.pause(), h.current !== null && (clearInterval(h.current), h.current = null), g.current !== null && (clearInterval(g.current), g.current = null), i("paused"));
1240
+ }, []), ie = O(() => {
1241
+ if (d.current && d.current.state === "paused") {
1242
+ d.current.resume(), h.current = setInterval(() => {
1243
+ y.current += 1, o((e) => e + 1);
1244
+ }, 1e3);
1245
+ let e = new Uint8Array(v.current?.frequencyBinCount ?? 128);
1246
+ g.current = setInterval(() => {
1247
+ if (v.current) {
1248
+ v.current.getByteFrequencyData(e);
1249
+ let t = 0;
1250
+ for (let n = 0; n < e.length; n++) t += e[n];
1251
+ let n = t / e.length / 255;
1252
+ b.current = [...b.current, n], u((e) => [...e, n]);
1253
+ }
1254
+ }, 100), i("recording");
1255
+ }
1256
+ }, []);
1257
+ return he(() => () => {
1258
+ h.current !== null && clearInterval(h.current), g.current !== null && clearInterval(g.current), _.current !== null && clearTimeout(_.current), d.current && d.current.state !== "inactive" && d.current.stop(), p.current && p.current.getTracks().forEach((e) => e.stop()), f.current && f.current.close().catch(() => {});
1259
+ }, []), {
1260
+ state: r,
1261
+ duration: a,
1262
+ analyserNode: s,
1263
+ waveformData: l,
1264
+ start: C,
1265
+ stop: te,
1266
+ cancel: ne,
1267
+ pause: re,
1268
+ resume: ie
1269
+ };
1270
+ }
1271
+ //#endregion
1272
+ //#region src/composed/rich-chat-input.tsx
1273
+ var ht = {
1274
+ compact: {
1275
+ minHeight: 44,
1276
+ maxHeight: 256,
1277
+ showToolbar: !0,
1278
+ toolbarPosition: "bottom"
1279
+ },
1280
+ expanded: {
1281
+ minHeight: 96,
1282
+ maxHeight: 384,
1283
+ showToolbar: !0,
1284
+ toolbarPosition: "bottom"
1285
+ },
1286
+ minimal: {
1287
+ minHeight: 44,
1288
+ maxHeight: 128,
1289
+ showToolbar: !1,
1290
+ toolbarPosition: "bottom"
1291
+ },
1292
+ inline: {
1293
+ minHeight: 40,
1294
+ maxHeight: 160,
1295
+ showToolbar: !1,
1296
+ toolbarPosition: "top"
1297
+ }
1298
+ }, gt = [
1299
+ "prose prose-sm max-w-none focus:outline-hidden",
1300
+ "font-body text-ds-md leading-relaxed text-surface-fg",
1301
+ "[&_p.is-editor-empty:first-child]:relative",
1302
+ "[&_p.is-editor-empty:first-child::before]:text-surface-fg-subtle [&_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_p.is-editor-empty:first-child::before]:pointer-events-none [&_p.is-editor-empty:first-child::before]:absolute [&_p.is-editor-empty:first-child::before]:left-0 [&_p.is-editor-empty:first-child::before]:top-0 [&_p.is-editor-empty:first-child::before]:w-full [&_p.is-editor-empty:first-child::before]:truncate",
1303
+ "[&_p]:mb-ds-01 [&_p]:text-surface-fg",
1304
+ "[&_p:last-child]:mb-0",
1305
+ "[&_ul]:ml-ds-04 [&_ul]:list-disc [&_ol]:ml-ds-04 [&_ol]:list-decimal",
1306
+ "[&_li]:text-surface-fg",
1307
+ "[&_code]:rounded [&_code]:bg-surface-raised [&_code]:px-ds-02 [&_code]:py-[1px] [&_code]:text-ds-md [&_code]:text-accent-11",
1308
+ "[&_strong]:font-semibold [&_strong]:text-surface-fg",
1309
+ "[[&_mark]:rounded-sm_mark]:rounded-xs [&_mark]:bg-warning-3 [&_mark]:px-[2px]",
1310
+ "[&_a]:text-accent-11 [&_a]:underline",
1311
+ "[&_.mention]:rounded-ds-sm [&_.mention]:bg-accent-2 [&_.mention]:px-ds-02 [&_.mention]:py-[1px] [&_.mention]:font-medium [&_.mention]:text-accent-11"
1312
+ ].join(" ");
1313
+ function _t({ options: e }) {
1314
+ let [t, n] = D.useState(!1), r = D.useRef(null);
1315
+ return D.useEffect(() => {
1316
+ if (!t) return;
1317
+ let e = (e) => {
1318
+ r.current && !r.current.contains(e.target) && n(!1);
1319
+ };
1320
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1321
+ }, [t]), /* @__PURE__ */ M("div", {
1322
+ ref: r,
1323
+ className: "relative",
1324
+ children: [/* @__PURE__ */ j("button", {
1325
+ type: "button",
1326
+ onClick: () => n((e) => !e),
1327
+ title: "More send options",
1328
+ "aria-label": "More send options",
1329
+ "aria-expanded": t,
1330
+ className: c("inline-flex h-ds-xs-plus w-5 items-center justify-center rounded-ds-md touch-target", "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg", "transition-colors duration-fast-01 ease-productive-standard", t && "bg-surface-raised-hover text-surface-fg"),
1331
+ children: /* @__PURE__ */ j(u, {
1332
+ icon: xe,
1333
+ size: "xs"
1334
+ })
1335
+ }), t && /* @__PURE__ */ M("div", {
1336
+ className: "absolute bottom-full right-0 mb-ds-02 min-w-[200px] rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating z-popover",
1337
+ children: [/* @__PURE__ */ j("p", {
1338
+ className: "px-ds-03 py-ds-01 text-ds-xs font-medium text-surface-fg-subtle",
1339
+ children: "Send options"
1340
+ }), e.map((e, t) => /* @__PURE__ */ M("button", {
1341
+ type: "button",
1342
+ onClick: () => {
1343
+ e.onSelect(), n(!1);
1344
+ },
1345
+ className: "flex w-full items-center gap-ds-03 rounded-ds-md px-ds-03 py-ds-02 text-ds-sm text-surface-fg hover:bg-surface-raised-hover transition-colors duration-fast-01",
1346
+ children: [e.icon && /* @__PURE__ */ j(e.icon, { className: "h-ico-sm w-ico-sm text-surface-fg-muted" }), e.label]
1347
+ }, t))]
1348
+ })]
1349
+ });
1350
+ }
1351
+ var vt = D.lazy(() => import("@emoji-mart/react"));
1352
+ function yt({ set: e = "native", onSelect: t, onClose: n }) {
1353
+ let [r, i] = D.useState(null), { colorMode: a } = pe(), o = D.useRef(null);
1354
+ D.useEffect(() => {
1355
+ (y[e] ?? y.native)().then((e) => i(e.default));
1356
+ }, [e]), D.useEffect(() => {
1357
+ let e = (e) => {
1358
+ o.current && !o.current.contains(e.target) && n();
1359
+ };
1360
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1361
+ }, [n]), D.useEffect(() => {
1362
+ let e = (e) => {
1363
+ e.key === "Escape" && n();
1364
+ };
1365
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1366
+ }, [n]);
1367
+ let s = /* @__PURE__ */ j("div", {
1368
+ className: "flex h-[350px] w-[352px] items-center justify-center rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating",
1369
+ children: /* @__PURE__ */ j("span", {
1370
+ className: "text-ds-sm text-surface-fg-subtle",
1371
+ children: "Loading..."
1372
+ })
1373
+ });
1374
+ return /* @__PURE__ */ j("div", {
1375
+ ref: o,
1376
+ className: "rounded-ds-lg border border-surface-border-strong bg-surface-overlay shadow-floating overflow-hidden",
1377
+ children: r ? /* @__PURE__ */ j(D.Suspense, {
1378
+ fallback: s,
1379
+ children: /* @__PURE__ */ j(vt, {
1380
+ data: r,
1381
+ set: e,
1382
+ onEmojiSelect: (e) => t({
1383
+ id: e.id,
1384
+ native: e.native
1385
+ }),
1386
+ theme: a === "dark" ? "dark" : "light",
1387
+ previewPosition: "none",
1388
+ skinTonePosition: "none"
1389
+ })
1390
+ }) : s
1391
+ });
1392
+ }
1393
+ function Q({ onClick: e, isActive: t = !1, title: n, children: r }) {
1394
+ return /* @__PURE__ */ j("button", {
1395
+ type: "button",
1396
+ onClick: e,
1397
+ title: n,
1398
+ "aria-label": n,
1399
+ "aria-pressed": t,
1400
+ className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", t ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
1401
+ children: r
1402
+ });
1403
+ }
1404
+ function bt({ editor: e }) {
1405
+ let t = S({
1406
+ editor: e,
1407
+ selector: ({ editor: e }) => ({
1408
+ isBold: e.isActive("bold"),
1409
+ isItalic: e.isActive("italic"),
1410
+ isUnderline: e.isActive("underline"),
1411
+ isStrike: e.isActive("strike"),
1412
+ isHighlight: e.isActive("highlight"),
1413
+ isCode: e.isActive("code")
1414
+ })
1415
+ });
1416
+ return /* @__PURE__ */ M(T, {
1417
+ editor: e,
1418
+ className: "flex gap-ds-01 rounded-ds-lg border border-surface-border-strong bg-surface-overlay p-ds-02 shadow-floating",
1419
+ children: [
1420
+ /* @__PURE__ */ j(Q, {
1421
+ onClick: () => e.chain().focus().toggleBold().run(),
1422
+ isActive: t.isBold,
1423
+ title: "Bold",
1424
+ children: /* @__PURE__ */ j(u, {
1425
+ icon: ye,
1426
+ size: "xs"
1427
+ })
1428
+ }),
1429
+ /* @__PURE__ */ j(Q, {
1430
+ onClick: () => e.chain().focus().toggleItalic().run(),
1431
+ isActive: t.isItalic,
1432
+ title: "Italic",
1433
+ children: /* @__PURE__ */ j(u, {
1434
+ icon: P,
1435
+ size: "xs"
1436
+ })
1437
+ }),
1438
+ /* @__PURE__ */ j(Q, {
1439
+ onClick: () => e.chain().focus().toggleUnderline().run(),
1440
+ isActive: t.isUnderline,
1441
+ title: "Underline",
1442
+ children: /* @__PURE__ */ j(u, {
1443
+ icon: Le,
1444
+ size: "xs"
1445
+ })
1446
+ }),
1447
+ /* @__PURE__ */ j(Q, {
1448
+ onClick: () => e.chain().focus().toggleStrike().run(),
1449
+ isActive: t.isStrike,
1450
+ title: "Strikethrough",
1451
+ children: /* @__PURE__ */ j(u, {
1452
+ icon: R,
1453
+ size: "xs"
1454
+ })
1455
+ }),
1456
+ /* @__PURE__ */ j(Q, {
1457
+ onClick: () => e.chain().focus().toggleHighlight().run(),
1458
+ isActive: t.isHighlight,
1459
+ title: "Highlight",
1460
+ children: /* @__PURE__ */ j(u, {
1461
+ icon: Te,
1462
+ size: "xs"
1463
+ })
1464
+ }),
1465
+ /* @__PURE__ */ j(Q, {
1466
+ onClick: () => e.chain().focus().toggleCode().run(),
1467
+ isActive: t.isCode,
1468
+ title: "Code",
1469
+ children: /* @__PURE__ */ j(u, {
1470
+ icon: Ce,
1471
+ size: "xs"
1472
+ })
1473
+ })
1474
+ ]
1475
+ });
1476
+ }
1477
+ var xt = D.forwardRef(function({ onSubmit: o, placeholder: l = "Type a message...", disabled: p = !1, content: m = "", variant: h = "compact", enterBehavior: g = "send", maxLength: _, charCountDisplay: y = "near-limit", mentions: w, onMentionSearch: T, onMentionSelect: oe, onFileUpload: pe, onImageUpload: me, slashCommands: E, onVoiceRecord: O, onTranscribe: he, maxDuration: k, replyTo: A, onTyping: ge, onEmpty: ve, isStreaming: N = !1, onCancel: ye, leadingSlot: be, trailingSlot: xe, disclaimer: Ce, toolbar: we = !0, sendOptions: Te, onSchedule: P, actionButton: Ee, emojiSet: F = "native", className: De, ...Ae }, je) {
1478
+ let [I, L] = D.useState("idle"), [R, Le] = D.useState(!1), [z, Re] = D.useState(!1), [B, ze] = D.useState(null), [He, Ue] = D.useState(!1), [We, Ge] = D.useState(!1), [Je, Xe] = D.useState(0), V = D.useRef(null), Qe = D.useRef(null);
1479
+ D.useEffect(() => {
1480
+ if (!z || !V.current || !Qe.current) return;
1481
+ let i = V.current, a = Qe.current, o = () => {
1482
+ e(i, a, {
1483
+ placement: "top-end",
1484
+ middleware: [
1485
+ n(8),
1486
+ r(),
1487
+ t({ padding: 8 })
1488
+ ]
1489
+ }).then(({ x: e, y: t }) => {
1490
+ Object.assign(a.style, {
1491
+ left: `${e}px`,
1492
+ top: `${t}px`
1493
+ });
1494
+ });
1495
+ };
1496
+ return o(), window.addEventListener("scroll", o, !0), window.addEventListener("resize", o), () => {
1497
+ window.removeEventListener("scroll", o, !0), window.removeEventListener("resize", o);
1498
+ };
1499
+ }, [z]);
1500
+ let [H, U] = D.useState([]), [W, G] = D.useState(null), [K, et] = D.useState(!1), tt = D.useRef(null), nt = D.useRef(null), rt = D.useRef(void 0), it = D.useRef(void 0), at = D.useRef(g);
1501
+ at.current = g;
1502
+ let ot = d(), q = ht[h], st = q.maxHeight, J = mt({
1503
+ maxDuration: k,
1504
+ onComplete: async (e, t, n) => {
1505
+ if (O?.(e, t), he) {
1506
+ let n = await he(e, t);
1507
+ if (n != null) {
1508
+ Y?.chain().focus().insertContent(n).run(), L("idle");
1509
+ return;
1510
+ }
1511
+ }
1512
+ G({
1513
+ blob: e,
1514
+ duration: t,
1515
+ waveformData: n
1516
+ }), L("review");
1517
+ }
1518
+ }), ct = D.useCallback(() => {
1519
+ J.start(), L("recording");
1520
+ }, [J]), lt = D.useCallback(() => {
1521
+ J.stop();
1522
+ }, [J]), ut = D.useCallback(() => {
1523
+ J.cancel(), L("idle");
1524
+ }, [J]), Y = ne({
1525
+ immediatelyRender: !1,
1526
+ extensions: D.useMemo(() => {
1527
+ let e = [
1528
+ ae.configure({
1529
+ heading: !1,
1530
+ horizontalRule: !1,
1531
+ codeBlock: !1,
1532
+ blockquote: !1,
1533
+ link: {
1534
+ openOnClick: !1,
1535
+ HTMLAttributes: { class: "text-accent-11 underline" }
1536
+ }
1537
+ }),
1538
+ te.configure({ placeholder: l }),
1539
+ ie.configure({ multicolor: !1 }),
1540
+ C,
1541
+ b.configure({ limit: _ || void 0 }),
1542
+ ue,
1543
+ de,
1544
+ le(F),
1545
+ ee.create({
1546
+ name: "enterToSend",
1547
+ addKeyboardShortcuts() {
1548
+ return {
1549
+ Enter: () => at.current === "send" ? (it.current?.(), !0) : !1,
1550
+ "Shift-Enter": () => at.current === "send" ? (this.editor.commands.splitBlock(), !0) : !1,
1551
+ "Mod-Enter": () => (it.current?.(), !0)
1552
+ };
1553
+ }
1554
+ })
1555
+ ];
1556
+ return (w || T) && e.push(re.configure({
1557
+ HTMLAttributes: { class: "mention" },
1558
+ suggestion: {
1559
+ items: async ({ query: e }) => T ? await T(e) : w ? w.filter((t) => t.label.toLowerCase().includes(e.toLowerCase())).slice(0, 8) : [],
1560
+ render: fe(oe)
1561
+ }
1562
+ })), E && e.push(Be(E)), e;
1563
+ }, [
1564
+ l,
1565
+ _,
1566
+ F,
1567
+ !!w,
1568
+ !!T,
1569
+ !!E
1570
+ ]),
1571
+ content: m || void 0,
1572
+ editable: !p,
1573
+ editorProps: {
1574
+ attributes: { class: gt },
1575
+ handlePaste: (e, t) => {
1576
+ let n = Array.from(t.clipboardData?.files ?? []);
1577
+ return n.length > 0 ? (n.forEach(Z), !0) : !1;
1578
+ }
1579
+ }
1580
+ }), X = D.useCallback(() => {
1581
+ if (!Y) return;
1582
+ let e = !Y.isEmpty, t = H.length > 0, n = !!W;
1583
+ if (!e && !t && !n || N) return;
1584
+ let r = {
1585
+ html: e ? Y.getHTML() : "",
1586
+ plainText: e ? Y.getText() : ""
1587
+ };
1588
+ t && (r.attachments = H.filter((e) => !e.uploading && e.url).map((e) => ({
1589
+ url: e.url,
1590
+ name: e.name,
1591
+ size: e.size,
1592
+ type: e.type
1593
+ }))), n && (r.voiceNote = {
1594
+ blob: W.blob,
1595
+ duration: W.duration
1596
+ }), B && P ? P(r, B) : o(r), Y.commands.clearContent(), U([]), G(null), ze(null), L("idle");
1597
+ }, [
1598
+ Y,
1599
+ H,
1600
+ W,
1601
+ N,
1602
+ o,
1603
+ P,
1604
+ B
1605
+ ]);
1606
+ it.current = X, D.useEffect(() => {
1607
+ if (!Y || !ge) return;
1608
+ let e = () => {
1609
+ ge(!0), clearTimeout(rt.current), rt.current = setTimeout(() => ge(!1), 2e3);
1610
+ };
1611
+ return Y.on("update", e), () => {
1612
+ Y.off("update", e), clearTimeout(rt.current);
1613
+ };
1614
+ }, [Y, ge]), D.useEffect(() => {
1615
+ if (!Y || !ve) return;
1616
+ let e = () => {
1617
+ ve(Y.isEmpty);
1618
+ };
1619
+ return Y.on("update", e), e(), () => {
1620
+ Y.off("update", e);
1621
+ };
1622
+ }, [Y, ve]);
1623
+ let Z = D.useCallback(async (e) => {
1624
+ let t = Math.random().toString(36).slice(2), n = e.type.startsWith("image/");
1625
+ U((r) => [...r, {
1626
+ id: t,
1627
+ name: e.name,
1628
+ size: e.size,
1629
+ type: n ? "image" : "file",
1630
+ uploading: !0
1631
+ }]);
1632
+ try {
1633
+ if (n && me) {
1634
+ let n = await me(e);
1635
+ U((e) => e.map((e) => e.id === t ? {
1636
+ ...e,
1637
+ url: n,
1638
+ uploading: !1
1639
+ } : e));
1640
+ } else if (pe) {
1641
+ let n = await pe(e);
1642
+ U((e) => e.map((e) => e.id === t ? {
1643
+ ...e,
1644
+ url: n.url,
1645
+ name: n.name,
1646
+ size: n.size,
1647
+ uploading: !1
1648
+ } : e));
1649
+ } else if (n) {
1650
+ let n = URL.createObjectURL(e);
1651
+ U((e) => e.map((e) => e.id === t ? {
1652
+ ...e,
1653
+ url: n,
1654
+ uploading: !1
1655
+ } : e));
1656
+ } else U((e) => e.filter((e) => e.id !== t));
1657
+ } catch {
1658
+ U((e) => e.filter((e) => e.id !== t));
1659
+ }
1660
+ }, [pe, me]), pt = D.useCallback((e) => {
1661
+ U((t) => t.filter((t) => t.id !== e));
1662
+ }, []), vt = D.useCallback((e) => {
1663
+ e.preventDefault(), et(!1), Array.from(e.dataTransfer.files).forEach(Z);
1664
+ }, [Z]), Q = D.useCallback((e) => {
1665
+ Array.from(e.target.files || []).forEach(Z), e.target.value = "";
1666
+ }, [Z]), xt = D.useCallback(() => {
1667
+ G(null), L("idle");
1668
+ }, []), St = S({
1669
+ editor: Y,
1670
+ selector: ({ editor: e }) => e ? { editorIsEmpty: e.isEmpty } : null
1671
+ })?.editorIsEmpty ?? !0;
1672
+ D.useEffect(() => {
1673
+ if (!Y) return;
1674
+ let e = () => {
1675
+ Xe(Y.state.doc.textBetween(0, Y.state.doc.content.size, void 0, " ").length);
1676
+ };
1677
+ return e(), Y.on("update", e), () => {
1678
+ Y.off("update", e);
1679
+ };
1680
+ }, [Y]);
1681
+ let Ct = !St || H.length > 0 || !!W, wt = R || I === "review" || h === "expanded", $ = "icon-md";
1682
+ return /* @__PURE__ */ M("div", {
1683
+ ref: je,
1684
+ className: c("border-t border-surface-border-subtle px-ds-05 py-ds-04", "flex items-center gap-ds-03", De),
1685
+ ...Ae,
1686
+ children: [
1687
+ Ee !== !1 && (Ee ?? (pe || me ? /* @__PURE__ */ j(f, {
1688
+ variant: "solid",
1689
+ size: "icon-md",
1690
+ onClick: () => tt.current?.click(),
1691
+ title: "Attach",
1692
+ "aria-label": "Attach file",
1693
+ className: "shrink-0",
1694
+ children: /* @__PURE__ */ j(u, {
1695
+ icon: Me,
1696
+ size: "md"
1697
+ })
1698
+ }) : null)),
1699
+ /* @__PURE__ */ M("div", {
1700
+ role: "region",
1701
+ "aria-label": "Message composer",
1702
+ className: c("flex-1 min-w-0 overflow-hidden rounded-ds-lg border border-surface-border-strong bg-surface-raised-hover", "transition-[color,background-color,border-color,box-shadow] duration-fast-02 ease-productive-standard", "hover:bg-surface-raised-active", "focus-within:ring-2 focus-within:ring-accent-9 focus-within:ring-offset-2 focus-within:border-accent-9", I === "recording" && "border-error-7/30", K && "border-dashed border-accent-7 bg-accent-2", p && "opacity-action-disabled cursor-not-allowed"),
1703
+ onFocus: () => Ge(!0),
1704
+ onBlur: (e) => {
1705
+ e.currentTarget.contains(e.relatedTarget) || Ge(!1);
1706
+ },
1707
+ onDragOver: (e) => {
1708
+ e.preventDefault(), et(!0);
1709
+ },
1710
+ onDragLeave: () => et(!1),
1711
+ onDrop: vt,
1712
+ children: [
1713
+ be,
1714
+ /* @__PURE__ */ j(a, { children: A && /* @__PURE__ */ j(Ve, {
1715
+ author: A.author,
1716
+ preview: A.preview,
1717
+ onDismiss: A.onDismiss
1718
+ }, "reply") }),
1719
+ /* @__PURE__ */ j(a, { children: B && /* @__PURE__ */ j(Ye, {
1720
+ date: B,
1721
+ onEdit: () => Ue(!0),
1722
+ onClear: () => ze(null)
1723
+ }, "schedule") }),
1724
+ /* @__PURE__ */ j(a, { children: H.length > 0 && /* @__PURE__ */ j(Ze, {
1725
+ attachments: H,
1726
+ onRemoveAttachment: pt
1727
+ }, "attachments") }),
1728
+ q.toolbarPosition === "top" && Y && /* @__PURE__ */ j("div", {
1729
+ className: c("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", R ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
1730
+ children: /* @__PURE__ */ j("div", {
1731
+ className: "overflow-hidden",
1732
+ children: /* @__PURE__ */ j(dt, {
1733
+ editor: Y,
1734
+ toolbar: we,
1735
+ isMobile: !1,
1736
+ hasMentions: !!(w || T),
1737
+ hasSlashCommands: !!E,
1738
+ disabled: p
1739
+ })
1740
+ })
1741
+ }),
1742
+ /* @__PURE__ */ M("div", {
1743
+ className: "relative",
1744
+ children: [I === "recording" && /* @__PURE__ */ j($e, {
1745
+ duration: J.duration,
1746
+ analyserNode: J.analyserNode,
1747
+ maxDuration: k,
1748
+ onCancel: ut
1749
+ }), /* @__PURE__ */ M("div", {
1750
+ ref: nt,
1751
+ className: c("flex items-center px-ds-04 py-ds-03 cursor-text [&_.tiptap]:w-full [&_.tiptap]:outline-hidden", I === "recording" && "invisible"),
1752
+ style: {
1753
+ minHeight: q.minHeight,
1754
+ maxHeight: st,
1755
+ overflowY: "auto"
1756
+ },
1757
+ onClick: () => Y?.commands.focus(),
1758
+ children: [/* @__PURE__ */ j("div", {
1759
+ className: "flex-1 min-w-0",
1760
+ children: /* @__PURE__ */ j(x, { editor: Y })
1761
+ }), Y && I !== "recording" && /* @__PURE__ */ M("div", {
1762
+ className: "flex items-center gap-ds-01 shrink-0 ml-ds-03",
1763
+ children: [/* @__PURE__ */ j("button", {
1764
+ type: "button",
1765
+ onClick: () => Le((e) => !e),
1766
+ title: R ? "Hide formatting" : "Show formatting",
1767
+ "aria-label": R ? "Hide formatting" : "Show formatting",
1768
+ "aria-pressed": R,
1769
+ className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target", "transition-colors duration-fast-01 ease-productive-standard", "hover:bg-surface-raised-hover", R ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle"),
1770
+ children: /* @__PURE__ */ j(u, {
1771
+ icon: Fe,
1772
+ size: "xs"
1773
+ })
1774
+ }), /* @__PURE__ */ M("div", {
1775
+ className: "relative",
1776
+ children: [/* @__PURE__ */ j("button", {
1777
+ ref: V,
1778
+ type: "button",
1779
+ onClick: () => Re((e) => !e),
1780
+ title: "Emoji",
1781
+ "aria-label": "Emoji",
1782
+ className: c("inline-flex h-ds-xs-plus w-ds-xs-plus items-center justify-center rounded-ds-md touch-target transition-colors duration-fast-01", z ? "bg-surface-raised-hover text-accent-11" : "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg"),
1783
+ children: /* @__PURE__ */ j(u, {
1784
+ icon: ke,
1785
+ size: "xs"
1786
+ })
1787
+ }), z && _e.createPortal(/* @__PURE__ */ j("div", {
1788
+ ref: Qe,
1789
+ className: "absolute z-popover",
1790
+ style: {
1791
+ top: 0,
1792
+ left: 0
1793
+ },
1794
+ children: /* @__PURE__ */ j(yt, {
1795
+ set: F,
1796
+ onSelect: async ({ id: e, native: t }) => {
1797
+ let n = se(await ce(F), e);
1798
+ n ? Y.chain().focus().insertContent({
1799
+ type: "emojiNode",
1800
+ attrs: {
1801
+ id: e,
1802
+ native: n.native,
1803
+ set: F,
1804
+ x: n.x,
1805
+ y: n.y
1806
+ }
1807
+ }).run() : Y.chain().focus().insertContent(t).run(), Re(!1);
1808
+ },
1809
+ onClose: () => Re(!1)
1810
+ })
1811
+ }), document.body)]
1812
+ })]
1813
+ })]
1814
+ })]
1815
+ }),
1816
+ I === "review" && W && /* @__PURE__ */ M("div", {
1817
+ className: "flex items-center gap-ds-03 px-ds-04 py-ds-02b border-b border-surface-border",
1818
+ children: [/* @__PURE__ */ j(ft, {
1819
+ src: W.blob,
1820
+ duration: W.duration,
1821
+ waveformData: W.waveformData,
1822
+ className: "flex-1"
1823
+ }), /* @__PURE__ */ j(f, {
1824
+ variant: "ghost",
1825
+ size: "icon-sm",
1826
+ onClick: xt,
1827
+ "aria-label": "Discard voice note",
1828
+ title: "Discard voice note",
1829
+ className: "text-surface-fg-subtle hover:text-error-11",
1830
+ children: /* @__PURE__ */ j(u, {
1831
+ icon: Ie,
1832
+ size: "sm"
1833
+ })
1834
+ })]
1835
+ }),
1836
+ ot && Y && !St && /* @__PURE__ */ j(bt, { editor: Y }),
1837
+ q.toolbarPosition === "bottom" && Y && /* @__PURE__ */ j("div", {
1838
+ className: c("grid transition-[grid-template-rows,opacity] duration-moderate-01 ease-productive-standard", wt ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0 pointer-events-none"),
1839
+ children: /* @__PURE__ */ j("div", {
1840
+ className: "overflow-hidden",
1841
+ children: /* @__PURE__ */ j(dt, {
1842
+ editor: Y,
1843
+ toolbar: we,
1844
+ isMobile: ot,
1845
+ hasMentions: !!(w || T),
1846
+ hasSlashCommands: !!E,
1847
+ disabled: p
1848
+ })
1849
+ })
1850
+ }),
1851
+ _ && y !== "hidden" && (() => {
1852
+ let e = Je / _;
1853
+ return y === "always" || y === "focus" && We || (y === "near-limit" || !y) && e >= .8 || e >= 1 ? /* @__PURE__ */ M("div", {
1854
+ className: c("flex justify-end px-ds-04 pb-ds-02 text-ds-xs tabular-nums transition-opacity duration-fast-01", e >= 1 ? "text-error-11 font-medium" : e >= .9 ? "text-warning-11" : "text-surface-fg-subtle"),
1855
+ children: [
1856
+ Je,
1857
+ "/",
1858
+ _
1859
+ ]
1860
+ }) : null;
1861
+ })(),
1862
+ xe,
1863
+ /* @__PURE__ */ j("input", {
1864
+ ref: tt,
1865
+ type: "file",
1866
+ multiple: !0,
1867
+ className: "hidden",
1868
+ onChange: Q
1869
+ })
1870
+ ]
1871
+ }),
1872
+ /* @__PURE__ */ M("div", {
1873
+ className: "flex items-center gap-ds-02 shrink-0",
1874
+ children: [Te && Te.length > 0 && I !== "recording" && /* @__PURE__ */ j(_t, { options: Te }), /* @__PURE__ */ M(a, {
1875
+ mode: "popLayout",
1876
+ initial: !1,
1877
+ children: [
1878
+ I === "recording" && /* @__PURE__ */ M(i.div, {
1879
+ initial: {
1880
+ scale: .8,
1881
+ opacity: 0
1882
+ },
1883
+ animate: {
1884
+ scale: 1,
1885
+ opacity: 1
1886
+ },
1887
+ exit: {
1888
+ scale: .8,
1889
+ opacity: 0
1890
+ },
1891
+ transition: { duration: s.moderate01 },
1892
+ className: "flex items-center gap-ds-02",
1893
+ children: [/* @__PURE__ */ j(f, {
1894
+ variant: "soft",
1895
+ size: $,
1896
+ onClick: ut,
1897
+ "aria-label": "Cancel recording",
1898
+ title: "Cancel recording",
1899
+ className: "text-surface-fg-subtle hover:text-error-11",
1900
+ children: /* @__PURE__ */ j(u, {
1901
+ icon: Ie,
1902
+ size: "md"
1903
+ })
1904
+ }), /* @__PURE__ */ j(f, {
1905
+ variant: "solid",
1906
+ size: $,
1907
+ color: "error",
1908
+ onClick: lt,
1909
+ "aria-label": "Stop recording",
1910
+ title: "Stop recording",
1911
+ children: /* @__PURE__ */ j(u, {
1912
+ icon: Pe,
1913
+ size: "md"
1914
+ })
1915
+ })]
1916
+ }, "recording"),
1917
+ N && I !== "recording" && /* @__PURE__ */ j(i.div, {
1918
+ initial: {
1919
+ scale: .8,
1920
+ opacity: 0
1921
+ },
1922
+ animate: {
1923
+ scale: 1,
1924
+ opacity: 1
1925
+ },
1926
+ exit: {
1927
+ scale: .8,
1928
+ opacity: 0
1929
+ },
1930
+ transition: { duration: s.moderate01 },
1931
+ children: /* @__PURE__ */ j(f, {
1932
+ variant: "solid",
1933
+ size: $,
1934
+ color: "error",
1935
+ onClick: ye,
1936
+ "aria-label": "Stop",
1937
+ title: "Stop",
1938
+ children: /* @__PURE__ */ j(u, {
1939
+ icon: Pe,
1940
+ size: "md"
1941
+ })
1942
+ })
1943
+ }, "streaming"),
1944
+ !N && I !== "recording" && Ct && P && /* @__PURE__ */ j(i.div, {
1945
+ initial: {
1946
+ scale: .8,
1947
+ opacity: 0
1948
+ },
1949
+ animate: {
1950
+ scale: 1,
1951
+ opacity: 1
1952
+ },
1953
+ exit: {
1954
+ scale: .8,
1955
+ opacity: 0
1956
+ },
1957
+ transition: { duration: s.moderate01 },
1958
+ children: /* @__PURE__ */ j(v, {
1959
+ onClick: X,
1960
+ disabled: p,
1961
+ "aria-label": B ? "Schedule send" : "Send",
1962
+ size: $,
1963
+ dropdownContent: /* @__PURE__ */ j(Ke, {
1964
+ onSchedule: (e) => ze(e),
1965
+ onClose: () => {},
1966
+ onOpenDialog: () => Ue(!0)
1967
+ }),
1968
+ children: /* @__PURE__ */ j(u, {
1969
+ icon: B ? Se : Ne,
1970
+ size: "md"
1971
+ })
1972
+ })
1973
+ }, "split-send"),
1974
+ !N && I !== "recording" && Ct && !P && /* @__PURE__ */ j(i.div, {
1975
+ initial: {
1976
+ scale: .8,
1977
+ opacity: 0
1978
+ },
1979
+ animate: {
1980
+ scale: 1,
1981
+ opacity: 1
1982
+ },
1983
+ exit: {
1984
+ scale: .8,
1985
+ opacity: 0
1986
+ },
1987
+ transition: { duration: s.moderate01 },
1988
+ children: /* @__PURE__ */ j(f, {
1989
+ variant: "solid",
1990
+ size: $,
1991
+ onClick: X,
1992
+ disabled: p,
1993
+ "aria-label": "Send",
1994
+ title: "Send",
1995
+ children: /* @__PURE__ */ j(u, {
1996
+ icon: Ne,
1997
+ size: "md"
1998
+ })
1999
+ })
2000
+ }, "send"),
2001
+ !N && I !== "recording" && !Ct && O && /* @__PURE__ */ j(i.div, {
2002
+ initial: {
2003
+ scale: .8,
2004
+ opacity: 0
2005
+ },
2006
+ animate: {
2007
+ scale: 1,
2008
+ opacity: 1
2009
+ },
2010
+ exit: {
2011
+ scale: .8,
2012
+ opacity: 0
2013
+ },
2014
+ transition: { duration: s.moderate01 },
2015
+ children: /* @__PURE__ */ j(f, {
2016
+ variant: "soft",
2017
+ size: $,
2018
+ onClick: ct,
2019
+ "aria-label": "Record voice message",
2020
+ title: "Record voice message",
2021
+ children: /* @__PURE__ */ j(u, {
2022
+ icon: Oe,
2023
+ size: "md"
2024
+ })
2025
+ })
2026
+ }, "mic"),
2027
+ !N && I !== "recording" && !Ct && !O && /* @__PURE__ */ j(i.div, {
2028
+ initial: {
2029
+ scale: .8,
2030
+ opacity: 0
2031
+ },
2032
+ animate: {
2033
+ scale: 1,
2034
+ opacity: 1
2035
+ },
2036
+ exit: {
2037
+ scale: .8,
2038
+ opacity: 0
2039
+ },
2040
+ transition: { duration: s.moderate01 },
2041
+ children: /* @__PURE__ */ j(f, {
2042
+ variant: "solid",
2043
+ size: $,
2044
+ disabled: !0,
2045
+ "aria-label": "Send",
2046
+ title: "Send",
2047
+ children: /* @__PURE__ */ j(u, {
2048
+ icon: Ne,
2049
+ size: "md"
2050
+ })
2051
+ })
2052
+ }, "send-disabled")
2053
+ ]
2054
+ })]
2055
+ }),
2056
+ Ce && /* @__PURE__ */ j("p", {
2057
+ className: "mt-ds-02 text-center text-ds-xs text-surface-fg-subtle/50",
2058
+ children: Ce
2059
+ }),
2060
+ P && /* @__PURE__ */ j(qe, {
2061
+ open: He,
2062
+ onOpenChange: Ue,
2063
+ onSchedule: (e) => ze(e),
2064
+ initialDate: B
2065
+ })
2066
+ ]
2067
+ });
2068
+ });
2069
+ xt.displayName = "RichChatInput";
2070
+ //#endregion
2071
+ export { G as _, et as a, V as b, lt as c, J as d, ct as f, W as g, rt as h, st as i, it as l, ut as m, mt as n, ot as o, q as p, ft as r, at as s, xt as t, tt as u, K as v, nt as y };