@chatsdk-dev/ui 0.0.1 → 0.1.3

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 (468) hide show
  1. package/README.md +7 -7
  2. package/dist/atoms/accordion.d.ts +7 -0
  3. package/dist/atoms/accordion.d.ts.map +1 -0
  4. package/dist/atoms/accordion.js +18 -0
  5. package/dist/atoms/alert-dialog.d.ts +19 -0
  6. package/dist/atoms/alert-dialog.d.ts.map +1 -0
  7. package/dist/atoms/alert-dialog.js +42 -0
  8. package/dist/atoms/alert.d.ts +11 -0
  9. package/dist/atoms/alert.d.ts.map +1 -0
  10. package/dist/atoms/alert.js +27 -0
  11. package/dist/atoms/avatar.d.ts +12 -0
  12. package/dist/atoms/avatar.d.ts.map +1 -0
  13. package/dist/atoms/avatar.js +23 -0
  14. package/dist/atoms/badge.d.ts +8 -0
  15. package/dist/atoms/badge.d.ts.map +1 -0
  16. package/dist/atoms/badge.js +44 -0
  17. package/dist/atoms/button-group.d.ts +11 -0
  18. package/dist/atoms/button-group.d.ts.map +1 -0
  19. package/dist/atoms/button-group.js +36 -0
  20. package/dist/atoms/button-loader.d.ts +9 -0
  21. package/dist/atoms/button-loader.d.ts.map +1 -0
  22. package/dist/atoms/button-loader.js +10 -0
  23. package/dist/atoms/button.d.ts +9 -0
  24. package/dist/atoms/button.d.ts.map +1 -0
  25. package/dist/atoms/button.js +32 -0
  26. package/dist/atoms/card.d.ts +12 -0
  27. package/dist/atoms/card.d.ts.map +1 -0
  28. package/dist/atoms/card.js +25 -0
  29. package/dist/atoms/carousel.d.ts +29 -0
  30. package/dist/atoms/carousel.d.ts.map +1 -0
  31. package/dist/atoms/carousel.js +91 -0
  32. package/dist/atoms/collapsible.d.ts +6 -0
  33. package/dist/atoms/collapsible.d.ts.map +1 -0
  34. package/dist/atoms/collapsible.js +13 -0
  35. package/dist/atoms/command.d.ts +20 -0
  36. package/dist/atoms/command.d.ts.map +1 -0
  37. package/dist/atoms/command.js +35 -0
  38. package/dist/atoms/container.d.ts +8 -0
  39. package/dist/atoms/container.d.ts.map +1 -0
  40. package/dist/atoms/container.js +5 -0
  41. package/dist/atoms/dialog.d.ts +19 -0
  42. package/dist/atoms/dialog.d.ts.map +1 -0
  43. package/dist/atoms/dialog.js +38 -0
  44. package/dist/atoms/dots-loader.d.ts +15 -0
  45. package/dist/atoms/dots-loader.d.ts.map +1 -0
  46. package/dist/atoms/dots-loader.js +21 -0
  47. package/dist/atoms/drawer.d.ts +14 -0
  48. package/dist/atoms/drawer.d.ts.map +1 -0
  49. package/dist/atoms/drawer.js +35 -0
  50. package/dist/atoms/dropdown-menu.d.ts +26 -0
  51. package/dist/atoms/dropdown-menu.d.ts.map +1 -0
  52. package/dist/atoms/dropdown-menu.js +51 -0
  53. package/dist/atoms/empty.d.ts +12 -0
  54. package/dist/atoms/empty.d.ts.map +1 -0
  55. package/dist/atoms/empty.js +33 -0
  56. package/dist/atoms/field.d.ts +25 -0
  57. package/dist/atoms/field.d.ts.map +1 -0
  58. package/dist/atoms/field.js +68 -0
  59. package/dist/atoms/form.d.ts +23 -0
  60. package/dist/atoms/form.d.ts.map +1 -0
  61. package/dist/atoms/form.js +68 -0
  62. package/dist/atoms/header.d.ts +6 -0
  63. package/dist/atoms/header.d.ts.map +1 -0
  64. package/dist/atoms/header.js +6 -0
  65. package/dist/atoms/hover-card.d.ts +6 -0
  66. package/dist/atoms/hover-card.d.ts.map +1 -0
  67. package/dist/atoms/hover-card.js +14 -0
  68. package/dist/atoms/index.d.ts +5 -0
  69. package/dist/atoms/index.d.ts.map +1 -0
  70. package/dist/atoms/index.js +5 -0
  71. package/dist/atoms/input-group.d.ts +19 -0
  72. package/dist/atoms/input-group.d.ts.map +1 -0
  73. package/dist/atoms/input-group.js +57 -0
  74. package/dist/atoms/input.d.ts +7 -0
  75. package/dist/atoms/input.d.ts.map +1 -0
  76. package/dist/atoms/input.js +6 -0
  77. package/dist/atoms/label.d.ts +3 -0
  78. package/dist/atoms/label.d.ts.map +1 -0
  79. package/dist/atoms/label.js +7 -0
  80. package/dist/atoms/logo.d.ts +7 -0
  81. package/dist/atoms/logo.d.ts.map +1 -0
  82. package/dist/atoms/logo.js +6 -0
  83. package/dist/atoms/number-flow.d.ts +3 -0
  84. package/dist/atoms/number-flow.d.ts.map +1 -0
  85. package/dist/atoms/number-flow.js +6 -0
  86. package/dist/atoms/popover.d.ts +10 -0
  87. package/dist/atoms/popover.d.ts.map +1 -0
  88. package/dist/atoms/popover.js +23 -0
  89. package/dist/atoms/progress.d.ts +8 -0
  90. package/dist/atoms/progress.d.ts.map +1 -0
  91. package/dist/atoms/progress.js +20 -0
  92. package/dist/atoms/radio-group.d.ts +6 -0
  93. package/dist/atoms/radio-group.d.ts.map +1 -0
  94. package/dist/atoms/radio-group.js +13 -0
  95. package/dist/atoms/scroll-area.d.ts +5 -0
  96. package/dist/atoms/scroll-area.d.ts.map +1 -0
  97. package/dist/atoms/scroll-area.js +11 -0
  98. package/dist/atoms/select.d.ts +17 -0
  99. package/dist/atoms/select.d.ts.map +1 -0
  100. package/dist/atoms/select.js +34 -0
  101. package/dist/atoms/separator.d.ts +3 -0
  102. package/dist/atoms/separator.d.ts.map +1 -0
  103. package/dist/atoms/separator.js +7 -0
  104. package/dist/atoms/sheet.d.ts +15 -0
  105. package/dist/atoms/sheet.d.ts.map +1 -0
  106. package/dist/atoms/sheet.js +37 -0
  107. package/dist/atoms/sidebar.d.ts +65 -0
  108. package/dist/atoms/sidebar.d.ts.map +1 -0
  109. package/dist/atoms/sidebar.js +258 -0
  110. package/dist/atoms/skeleton.d.ts +2 -0
  111. package/dist/atoms/skeleton.d.ts.map +1 -0
  112. package/dist/atoms/skeleton.js +5 -0
  113. package/dist/atoms/spinner.d.ts +3 -0
  114. package/dist/atoms/spinner.d.ts.map +1 -0
  115. package/dist/atoms/spinner.js +7 -0
  116. package/dist/atoms/switch.d.ts +5 -0
  117. package/dist/atoms/switch.d.ts.map +1 -0
  118. package/dist/atoms/switch.js +7 -0
  119. package/dist/atoms/table.d.ts +13 -0
  120. package/dist/atoms/table.d.ts.map +1 -0
  121. package/dist/atoms/table.js +28 -0
  122. package/dist/atoms/tabs.d.ts +12 -0
  123. package/dist/atoms/tabs.d.ts.map +1 -0
  124. package/dist/atoms/tabs.js +32 -0
  125. package/dist/atoms/textarea.d.ts +3 -0
  126. package/dist/atoms/textarea.d.ts.map +1 -0
  127. package/dist/atoms/textarea.js +5 -0
  128. package/dist/atoms/toggle.d.ts +9 -0
  129. package/dist/atoms/toggle.d.ts.map +1 -0
  130. package/dist/atoms/toggle.js +26 -0
  131. package/dist/atoms/tooltip.d.ts +7 -0
  132. package/dist/atoms/tooltip.d.ts.map +1 -0
  133. package/dist/atoms/tooltip.js +17 -0
  134. package/dist/atoms/typography/h1.d.ts +10 -0
  135. package/dist/atoms/typography/h1.d.ts.map +1 -0
  136. package/dist/atoms/typography/h1.js +6 -0
  137. package/dist/atoms/typography/paragraph.d.ts +6 -0
  138. package/dist/atoms/typography/paragraph.d.ts.map +1 -0
  139. package/dist/atoms/typography/paragraph.js +6 -0
  140. package/dist/atoms/typography/text.d.ts +14 -0
  141. package/dist/atoms/typography/text.d.ts.map +1 -0
  142. package/dist/atoms/typography/text.js +41 -0
  143. package/dist/components/responsive-alert-dialog.d.ts +16 -0
  144. package/dist/components/responsive-alert-dialog.d.ts.map +1 -0
  145. package/dist/components/responsive-alert-dialog.js +20 -0
  146. package/dist/components/responsive-dialog.d.ts +11 -0
  147. package/dist/components/responsive-dialog.d.ts.map +1 -0
  148. package/dist/components/responsive-dialog.js +21 -0
  149. package/dist/hooks/use-copy-to-clipboard.d.ts +2 -0
  150. package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
  151. package/dist/hooks/use-copy-to-clipboard.js +31 -0
  152. package/dist/index.css +1580 -39
  153. package/dist/molecules/actions.d.ts +10 -0
  154. package/dist/molecules/actions.d.ts.map +1 -0
  155. package/dist/molecules/actions.js +13 -0
  156. package/dist/molecules/agent.d.ts +27 -0
  157. package/dist/molecules/agent.d.ts.map +1 -0
  158. package/dist/molecules/agent.js +27 -0
  159. package/dist/molecules/ai/actions.d.ts +10 -0
  160. package/dist/molecules/ai/actions.d.ts.map +1 -0
  161. package/dist/molecules/ai/actions.js +13 -0
  162. package/dist/molecules/ai/agent.d.ts +27 -0
  163. package/dist/molecules/ai/agent.d.ts.map +1 -0
  164. package/dist/molecules/ai/agent.js +27 -0
  165. package/dist/molecules/ai/artifact.d.ts +24 -0
  166. package/dist/molecules/ai/artifact.d.ts.map +1 -0
  167. package/dist/molecules/ai/artifact.js +20 -0
  168. package/dist/molecules/ai/attachments.d.ts +55 -0
  169. package/dist/molecules/ai/attachments.d.ts.map +1 -0
  170. package/dist/molecules/ai/attachments.js +125 -0
  171. package/dist/molecules/ai/audio-player.d.ts +30 -0
  172. package/dist/molecules/ai/audio-player.d.ts.map +1 -0
  173. package/dist/molecules/ai/audio-player.js +43 -0
  174. package/dist/molecules/ai/canvas.d.ts +9 -0
  175. package/dist/molecules/ai/canvas.d.ts.map +1 -0
  176. package/dist/molecules/ai/canvas.js +5 -0
  177. package/dist/molecules/ai/chain-of-thought.d.ts +30 -0
  178. package/dist/molecules/ai/chain-of-thought.d.ts.map +1 -0
  179. package/dist/molecules/ai/chain-of-thought.js +49 -0
  180. package/dist/molecules/ai/checkpoint.d.ts +12 -0
  181. package/dist/molecules/ai/checkpoint.d.ts.map +1 -0
  182. package/dist/molecules/ai/checkpoint.js +10 -0
  183. package/dist/molecules/ai/code-block.d.ts +46 -0
  184. package/dist/molecules/ai/code-block.d.ts.map +1 -0
  185. package/dist/molecules/ai/code-block.js +216 -0
  186. package/dist/molecules/ai/commit.d.ts +65 -0
  187. package/dist/molecules/ai/commit.d.ts.map +1 -0
  188. package/dist/molecules/ai/commit.js +95 -0
  189. package/dist/molecules/ai/confirmation.d.ts +50 -0
  190. package/dist/molecules/ai/confirmation.d.ts.map +1 -0
  191. package/dist/molecules/ai/confirmation.js +61 -0
  192. package/dist/molecules/ai/connection.d.ts +3 -0
  193. package/dist/molecules/ai/connection.d.ts.map +1 -0
  194. package/dist/molecules/ai/connection.js +3 -0
  195. package/dist/molecules/ai/context.d.ts +33 -0
  196. package/dist/molecules/ai/context.d.ts.map +1 -0
  197. package/dist/molecules/ai/context.js +164 -0
  198. package/dist/molecules/ai/controls.d.ts +5 -0
  199. package/dist/molecules/ai/controls.d.ts.map +1 -0
  200. package/dist/molecules/ai/controls.js +5 -0
  201. package/dist/molecules/ai/conversation.d.ts +24 -0
  202. package/dist/molecules/ai/conversation.d.ts.map +1 -0
  203. package/dist/molecules/ai/conversation.js +41 -0
  204. package/dist/molecules/ai/edge.d.ts +6 -0
  205. package/dist/molecules/ai/edge.d.ts.map +1 -0
  206. package/dist/molecules/ai/edge.js +87 -0
  207. package/dist/molecules/ai/environment-variables.d.ts +39 -0
  208. package/dist/molecules/ai/environment-variables.d.ts.map +1 -0
  209. package/dist/molecules/ai/environment-variables.js +87 -0
  210. package/dist/molecules/ai/file-tree.d.ts +27 -0
  211. package/dist/molecules/ai/file-tree.d.ts.map +1 -0
  212. package/dist/molecules/ai/file-tree.js +71 -0
  213. package/dist/molecules/ai/image.d.ts +7 -0
  214. package/dist/molecules/ai/image.d.ts.map +1 -0
  215. package/dist/molecules/ai/image.js +3 -0
  216. package/dist/molecules/ai/inline-citation.d.ts +39 -0
  217. package/dist/molecules/ai/inline-citation.d.ts.map +1 -0
  218. package/dist/molecules/ai/inline-citation.js +68 -0
  219. package/dist/molecules/ai/jsx-preview.d.ts +30 -0
  220. package/dist/molecules/ai/jsx-preview.d.ts.map +1 -0
  221. package/dist/molecules/ai/jsx-preview.js +167 -0
  222. package/dist/molecules/ai/loader.d.ts +6 -0
  223. package/dist/molecules/ai/loader.d.ts.map +1 -0
  224. package/dist/molecules/ai/loader.js +4 -0
  225. package/dist/molecules/ai/message.d.ts +38 -0
  226. package/dist/molecules/ai/message.d.ts.map +1 -0
  227. package/dist/molecules/ai/message.js +92 -0
  228. package/dist/molecules/ai/mic-selector.d.ts +46 -0
  229. package/dist/molecules/ai/mic-selector.d.ts.map +1 -0
  230. package/dist/molecules/ai/mic-selector.js +184 -0
  231. package/dist/molecules/ai/model-selector.d.ts +36 -0
  232. package/dist/molecules/ai/model-selector.d.ts.map +1 -0
  233. package/dist/molecules/ai/model-selector.js +18 -0
  234. package/dist/molecules/ai/node.d.ts +22 -0
  235. package/dist/molecules/ai/node.d.ts.map +1 -0
  236. package/dist/molecules/ai/node.js +11 -0
  237. package/dist/molecules/ai/open-in-chat.d.ts +29 -0
  238. package/dist/molecules/ai/open-in-chat.d.ts.map +1 -0
  239. package/dist/molecules/ai/open-in-chat.js +100 -0
  240. package/dist/molecules/ai/package-info.d.ts +30 -0
  241. package/dist/molecules/ai/package-info.d.ts.map +1 -0
  242. package/dist/molecules/ai/package-info.js +50 -0
  243. package/dist/molecules/ai/panel.d.ts +6 -0
  244. package/dist/molecules/ai/panel.d.ts.map +1 -0
  245. package/dist/molecules/ai/panel.js +4 -0
  246. package/dist/molecules/ai/persona.d.ts +49 -0
  247. package/dist/molecules/ai/persona.d.ts.map +1 -0
  248. package/dist/molecules/ai/persona.js +189 -0
  249. package/dist/molecules/ai/plan.d.ts +26 -0
  250. package/dist/molecules/ai/plan.d.ts.map +1 -0
  251. package/dist/molecules/ai/plan.js +34 -0
  252. package/dist/molecules/ai/prompt-input.d.ts +149 -0
  253. package/dist/molecules/ai/prompt-input.d.ts.map +1 -0
  254. package/dist/molecules/ai/prompt-input.js +702 -0
  255. package/dist/molecules/ai/queue.d.ts +62 -0
  256. package/dist/molecules/ai/queue.d.ts.map +1 -0
  257. package/dist/molecules/ai/queue.js +28 -0
  258. package/dist/molecules/ai/reasoning.d.ts +27 -0
  259. package/dist/molecules/ai/reasoning.d.ts.map +1 -0
  260. package/dist/molecules/ai/reasoning.js +95 -0
  261. package/dist/molecules/ai/response.d.ts +6 -0
  262. package/dist/molecules/ai/response.d.ts.map +1 -0
  263. package/dist/molecules/ai/response.js +18 -0
  264. package/dist/molecules/ai/sandbox.d.ts +25 -0
  265. package/dist/molecules/ai/sandbox.d.ts.map +1 -0
  266. package/dist/molecules/ai/sandbox.js +15 -0
  267. package/dist/molecules/ai/schema-display.d.ts +56 -0
  268. package/dist/molecules/ai/schema-display.d.ts.map +1 -0
  269. package/dist/molecules/ai/schema-display.js +73 -0
  270. package/dist/molecules/ai/shimmer.d.ts +10 -0
  271. package/dist/molecules/ai/shimmer.d.ts.map +1 -0
  272. package/dist/molecules/ai/shimmer.js +28 -0
  273. package/dist/molecules/ai/snippet.d.ts +19 -0
  274. package/dist/molecules/ai/snippet.d.ts.map +1 -0
  275. package/dist/molecules/ai/snippet.js +46 -0
  276. package/dist/molecules/ai/sources.d.ts +13 -0
  277. package/dist/molecules/ai/sources.d.ts.map +1 -0
  278. package/dist/molecules/ai/sources.js +9 -0
  279. package/dist/molecules/ai/speech-input.d.ts +55 -0
  280. package/dist/molecules/ai/speech-input.d.ts.map +1 -0
  281. package/dist/molecules/ai/speech-input.js +187 -0
  282. package/dist/molecules/ai/stack-trace.d.ts +38 -0
  283. package/dist/molecules/ai/stack-trace.d.ts.map +1 -0
  284. package/dist/molecules/ai/stack-trace.js +194 -0
  285. package/dist/molecules/ai/suggestion.d.ts +11 -0
  286. package/dist/molecules/ai/suggestion.d.ts.map +1 -0
  287. package/dist/molecules/ai/suggestion.js +13 -0
  288. package/dist/molecules/ai/task.d.ts +15 -0
  289. package/dist/molecules/ai/task.d.ts.map +1 -0
  290. package/dist/molecules/ai/task.js +10 -0
  291. package/dist/molecules/ai/terminal.d.ts +28 -0
  292. package/dist/molecules/ai/terminal.d.ts.map +1 -0
  293. package/dist/molecules/ai/terminal.js +68 -0
  294. package/dist/molecules/ai/test-results.d.ts +59 -0
  295. package/dist/molecules/ai/test-results.d.ts.map +1 -0
  296. package/dist/molecules/ai/test-results.js +97 -0
  297. package/dist/molecules/ai/tool.d.ts +32 -0
  298. package/dist/molecules/ai/tool.d.ts.map +1 -0
  299. package/dist/molecules/ai/tool.js +49 -0
  300. package/dist/molecules/ai/toolbar.d.ts +6 -0
  301. package/dist/molecules/ai/toolbar.d.ts.map +1 -0
  302. package/dist/molecules/ai/toolbar.js +4 -0
  303. package/dist/molecules/ai/transcription.d.ts +17 -0
  304. package/dist/molecules/ai/transcription.d.ts.map +1 -0
  305. package/dist/molecules/ai/transcription.js +36 -0
  306. package/dist/molecules/ai/voice-selector.d.ts +64 -0
  307. package/dist/molecules/ai/voice-selector.d.ts.map +1 -0
  308. package/dist/molecules/ai/voice-selector.js +224 -0
  309. package/dist/molecules/ai/web-preview.d.ts +35 -0
  310. package/dist/molecules/ai/web-preview.d.ts.map +1 -0
  311. package/dist/molecules/ai/web-preview.js +65 -0
  312. package/dist/molecules/artifact.d.ts +24 -0
  313. package/dist/molecules/artifact.d.ts.map +1 -0
  314. package/dist/molecules/artifact.js +20 -0
  315. package/dist/molecules/attachments.d.ts +55 -0
  316. package/dist/molecules/attachments.d.ts.map +1 -0
  317. package/dist/molecules/attachments.js +125 -0
  318. package/dist/molecules/audio-player.d.ts +30 -0
  319. package/dist/molecules/audio-player.d.ts.map +1 -0
  320. package/dist/molecules/audio-player.js +43 -0
  321. package/dist/molecules/canvas.d.ts +9 -0
  322. package/dist/molecules/canvas.d.ts.map +1 -0
  323. package/dist/molecules/canvas.js +5 -0
  324. package/dist/molecules/chain-of-thought.d.ts +30 -0
  325. package/dist/molecules/chain-of-thought.d.ts.map +1 -0
  326. package/dist/molecules/chain-of-thought.js +49 -0
  327. package/dist/molecules/chat-message.d.ts +10 -0
  328. package/dist/molecules/chat-message.d.ts.map +1 -0
  329. package/dist/molecules/chat-message.js +53 -0
  330. package/dist/molecules/checkpoint.d.ts +12 -0
  331. package/dist/molecules/checkpoint.d.ts.map +1 -0
  332. package/dist/molecules/checkpoint.js +10 -0
  333. package/dist/molecules/code-block.d.ts +46 -0
  334. package/dist/molecules/code-block.d.ts.map +1 -0
  335. package/dist/molecules/code-block.js +216 -0
  336. package/dist/molecules/commit.d.ts +65 -0
  337. package/dist/molecules/commit.d.ts.map +1 -0
  338. package/dist/molecules/commit.js +95 -0
  339. package/dist/molecules/confirmation.d.ts +50 -0
  340. package/dist/molecules/confirmation.d.ts.map +1 -0
  341. package/dist/molecules/confirmation.js +61 -0
  342. package/dist/molecules/connection.d.ts +3 -0
  343. package/dist/molecules/connection.d.ts.map +1 -0
  344. package/dist/molecules/connection.js +3 -0
  345. package/dist/molecules/context.d.ts +33 -0
  346. package/dist/molecules/context.d.ts.map +1 -0
  347. package/dist/molecules/context.js +164 -0
  348. package/dist/molecules/controls.d.ts +5 -0
  349. package/dist/molecules/controls.d.ts.map +1 -0
  350. package/dist/molecules/controls.js +5 -0
  351. package/dist/molecules/conversation.d.ts +24 -0
  352. package/dist/molecules/conversation.d.ts.map +1 -0
  353. package/dist/molecules/conversation.js +41 -0
  354. package/dist/molecules/edge.d.ts +6 -0
  355. package/dist/molecules/edge.d.ts.map +1 -0
  356. package/dist/molecules/edge.js +87 -0
  357. package/dist/molecules/environment-variables.d.ts +39 -0
  358. package/dist/molecules/environment-variables.d.ts.map +1 -0
  359. package/dist/molecules/environment-variables.js +87 -0
  360. package/dist/molecules/file-tree.d.ts +27 -0
  361. package/dist/molecules/file-tree.d.ts.map +1 -0
  362. package/dist/molecules/file-tree.js +71 -0
  363. package/dist/molecules/image.d.ts +7 -0
  364. package/dist/molecules/image.d.ts.map +1 -0
  365. package/dist/molecules/image.js +3 -0
  366. package/dist/molecules/inline-citation.d.ts +39 -0
  367. package/dist/molecules/inline-citation.d.ts.map +1 -0
  368. package/dist/molecules/inline-citation.js +68 -0
  369. package/dist/molecules/jsx-preview.d.ts +30 -0
  370. package/dist/molecules/jsx-preview.d.ts.map +1 -0
  371. package/dist/molecules/jsx-preview.js +167 -0
  372. package/dist/molecules/loader.d.ts +6 -0
  373. package/dist/molecules/loader.d.ts.map +1 -0
  374. package/dist/molecules/loader.js +4 -0
  375. package/dist/molecules/message.d.ts +38 -0
  376. package/dist/molecules/message.d.ts.map +1 -0
  377. package/dist/molecules/message.js +92 -0
  378. package/dist/molecules/mic-selector.d.ts +46 -0
  379. package/dist/molecules/mic-selector.d.ts.map +1 -0
  380. package/dist/molecules/mic-selector.js +184 -0
  381. package/dist/molecules/model-selector.d.ts +36 -0
  382. package/dist/molecules/model-selector.d.ts.map +1 -0
  383. package/dist/molecules/model-selector.js +18 -0
  384. package/dist/molecules/node.d.ts +22 -0
  385. package/dist/molecules/node.d.ts.map +1 -0
  386. package/dist/molecules/node.js +11 -0
  387. package/dist/molecules/open-in-chat.d.ts +29 -0
  388. package/dist/molecules/open-in-chat.d.ts.map +1 -0
  389. package/dist/molecules/open-in-chat.js +100 -0
  390. package/dist/molecules/package-info.d.ts +30 -0
  391. package/dist/molecules/package-info.d.ts.map +1 -0
  392. package/dist/molecules/package-info.js +50 -0
  393. package/dist/molecules/panel.d.ts +6 -0
  394. package/dist/molecules/panel.d.ts.map +1 -0
  395. package/dist/molecules/panel.js +4 -0
  396. package/dist/molecules/persona.d.ts +49 -0
  397. package/dist/molecules/persona.d.ts.map +1 -0
  398. package/dist/molecules/persona.js +189 -0
  399. package/dist/molecules/plan.d.ts +26 -0
  400. package/dist/molecules/plan.d.ts.map +1 -0
  401. package/dist/molecules/plan.js +34 -0
  402. package/dist/molecules/prompt-input.d.ts +149 -0
  403. package/dist/molecules/prompt-input.d.ts.map +1 -0
  404. package/dist/molecules/prompt-input.js +702 -0
  405. package/dist/molecules/queue.d.ts +62 -0
  406. package/dist/molecules/queue.d.ts.map +1 -0
  407. package/dist/molecules/queue.js +28 -0
  408. package/dist/molecules/reasoning.d.ts +27 -0
  409. package/dist/molecules/reasoning.d.ts.map +1 -0
  410. package/dist/molecules/reasoning.js +95 -0
  411. package/dist/molecules/response.d.ts +6 -0
  412. package/dist/molecules/response.d.ts.map +1 -0
  413. package/dist/molecules/response.js +18 -0
  414. package/dist/molecules/responsive-alert-dialog.d.ts +16 -0
  415. package/dist/molecules/responsive-alert-dialog.d.ts.map +1 -0
  416. package/dist/molecules/responsive-alert-dialog.js +20 -0
  417. package/dist/molecules/responsive-dialog.d.ts +11 -0
  418. package/dist/molecules/responsive-dialog.d.ts.map +1 -0
  419. package/dist/molecules/responsive-dialog.js +21 -0
  420. package/dist/molecules/sandbox.d.ts +25 -0
  421. package/dist/molecules/sandbox.d.ts.map +1 -0
  422. package/dist/molecules/sandbox.js +15 -0
  423. package/dist/molecules/schema-display.d.ts +56 -0
  424. package/dist/molecules/schema-display.d.ts.map +1 -0
  425. package/dist/molecules/schema-display.js +73 -0
  426. package/dist/molecules/shimmer.d.ts +10 -0
  427. package/dist/molecules/shimmer.d.ts.map +1 -0
  428. package/dist/molecules/shimmer.js +28 -0
  429. package/dist/molecules/snippet.d.ts +19 -0
  430. package/dist/molecules/snippet.d.ts.map +1 -0
  431. package/dist/molecules/snippet.js +46 -0
  432. package/dist/molecules/sources.d.ts +13 -0
  433. package/dist/molecules/sources.d.ts.map +1 -0
  434. package/dist/molecules/sources.js +9 -0
  435. package/dist/molecules/speech-input.d.ts +55 -0
  436. package/dist/molecules/speech-input.d.ts.map +1 -0
  437. package/dist/molecules/speech-input.js +187 -0
  438. package/dist/molecules/stack-trace.d.ts +38 -0
  439. package/dist/molecules/stack-trace.d.ts.map +1 -0
  440. package/dist/molecules/stack-trace.js +194 -0
  441. package/dist/molecules/suggestion.d.ts +11 -0
  442. package/dist/molecules/suggestion.d.ts.map +1 -0
  443. package/dist/molecules/suggestion.js +13 -0
  444. package/dist/molecules/task.d.ts +15 -0
  445. package/dist/molecules/task.d.ts.map +1 -0
  446. package/dist/molecules/task.js +10 -0
  447. package/dist/molecules/terminal.d.ts +28 -0
  448. package/dist/molecules/terminal.d.ts.map +1 -0
  449. package/dist/molecules/terminal.js +68 -0
  450. package/dist/molecules/test-results.d.ts +59 -0
  451. package/dist/molecules/test-results.d.ts.map +1 -0
  452. package/dist/molecules/test-results.js +97 -0
  453. package/dist/molecules/tool.d.ts +32 -0
  454. package/dist/molecules/tool.d.ts.map +1 -0
  455. package/dist/molecules/tool.js +49 -0
  456. package/dist/molecules/toolbar.d.ts +6 -0
  457. package/dist/molecules/toolbar.d.ts.map +1 -0
  458. package/dist/molecules/toolbar.js +4 -0
  459. package/dist/molecules/transcription.d.ts +17 -0
  460. package/dist/molecules/transcription.d.ts.map +1 -0
  461. package/dist/molecules/transcription.js +36 -0
  462. package/dist/molecules/voice-selector.d.ts +64 -0
  463. package/dist/molecules/voice-selector.d.ts.map +1 -0
  464. package/dist/molecules/voice-selector.js +224 -0
  465. package/dist/molecules/web-preview.d.ts +35 -0
  466. package/dist/molecules/web-preview.d.ts.map +1 -0
  467. package/dist/molecules/web-preview.js +65 -0
  468. package/package.json +27 -8
@@ -0,0 +1,224 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useControllableState } from "@radix-ui/react-use-controllable-state";
4
+ import { Button } from "@chatsdk-dev/ui/atoms/button";
5
+ import { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "@chatsdk-dev/ui/atoms/command";
6
+ import { Dialog, DialogContent, DialogTitle, DialogTrigger, } from "@chatsdk-dev/ui/atoms/dialog";
7
+ import { Spinner } from "@chatsdk-dev/ui/atoms/spinner";
8
+ import { cn } from "@chatsdk-dev/ui/lib/utils";
9
+ import { CircleSmallIcon, MarsIcon, MarsStrokeIcon, NonBinaryIcon, PauseIcon, PlayIcon, TransgenderIcon, VenusAndMarsIcon, VenusIcon, } from "lucide-react";
10
+ import { createContext, useCallback, useContext, useMemo } from "react";
11
+ const VoiceSelectorContext = createContext(null);
12
+ export const useVoiceSelector = () => {
13
+ const context = useContext(VoiceSelectorContext);
14
+ if (!context) {
15
+ throw new Error("VoiceSelector components must be used within VoiceSelector");
16
+ }
17
+ return context;
18
+ };
19
+ export const VoiceSelector = ({ value: valueProp, defaultValue, onValueChange, open: openProp, defaultOpen = false, onOpenChange, children, ...props }) => {
20
+ const [value, setValue] = useControllableState({
21
+ defaultProp: defaultValue,
22
+ onChange: onValueChange,
23
+ prop: valueProp,
24
+ });
25
+ const [open, setOpen] = useControllableState({
26
+ defaultProp: defaultOpen,
27
+ onChange: (open) => onOpenChange?.(open, {}),
28
+ prop: openProp,
29
+ });
30
+ const voiceSelectorContext = useMemo(() => ({ open, setOpen, setValue, value }), [value, setValue, open, setOpen]);
31
+ return (_jsx(VoiceSelectorContext.Provider, { value: voiceSelectorContext, children: _jsx(Dialog, { onOpenChange: setOpen, open: open, ...props, children: children }) }));
32
+ };
33
+ export const VoiceSelectorTrigger = (props) => (_jsx(DialogTrigger, { ...props }));
34
+ export const VoiceSelectorContent = ({ className, children, title = "Voice Selector", ...props }) => (_jsxs(DialogContent, { "aria-describedby": undefined, className: cn("p-0", className), ...props, children: [_jsx(DialogTitle, { className: "sr-only", children: title }), _jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-auto", children: children })] }));
35
+ export const VoiceSelectorDialog = (props) => (_jsx(CommandDialog, { ...props }));
36
+ export const VoiceSelectorInput = ({ className, ...props }) => (_jsx(CommandInput, { className: cn("h-auto py-3.5", className), ...props }));
37
+ export const VoiceSelectorList = (props) => (_jsx(CommandList, { ...props }));
38
+ export const VoiceSelectorEmpty = (props) => (_jsx(CommandEmpty, { ...props }));
39
+ export const VoiceSelectorGroup = (props) => (_jsx(CommandGroup, { ...props }));
40
+ export const VoiceSelectorItem = ({ className, ...props }) => (_jsx(CommandItem, { className: cn("px-4 py-2", className), ...props }));
41
+ export const VoiceSelectorShortcut = (props) => (_jsx(CommandShortcut, { ...props }));
42
+ export const VoiceSelectorSeparator = (props) => (_jsx(CommandSeparator, { ...props }));
43
+ export const VoiceSelectorGender = ({ className, value, children, ...props }) => {
44
+ let icon = null;
45
+ switch (value) {
46
+ case "male": {
47
+ icon = _jsx(MarsIcon, { className: "size-4" });
48
+ break;
49
+ }
50
+ case "female": {
51
+ icon = _jsx(VenusIcon, { className: "size-4" });
52
+ break;
53
+ }
54
+ case "transgender": {
55
+ icon = _jsx(TransgenderIcon, { className: "size-4" });
56
+ break;
57
+ }
58
+ case "androgyne": {
59
+ icon = _jsx(MarsStrokeIcon, { className: "size-4" });
60
+ break;
61
+ }
62
+ case "non-binary": {
63
+ icon = _jsx(NonBinaryIcon, { className: "size-4" });
64
+ break;
65
+ }
66
+ case "intersex": {
67
+ icon = _jsx(VenusAndMarsIcon, { className: "size-4" });
68
+ break;
69
+ }
70
+ default: {
71
+ icon = _jsx(CircleSmallIcon, { className: "size-4" });
72
+ }
73
+ }
74
+ return (_jsx("span", { className: cn("text-muted-foreground text-xs", className), ...props, children: children ?? icon }));
75
+ };
76
+ export const VoiceSelectorAccent = ({ className, value, children, ...props }) => {
77
+ let emoji = null;
78
+ switch (value) {
79
+ case "american": {
80
+ emoji = "🇺🇸";
81
+ break;
82
+ }
83
+ case "british": {
84
+ emoji = "🇬🇧";
85
+ break;
86
+ }
87
+ case "australian": {
88
+ emoji = "🇦🇺";
89
+ break;
90
+ }
91
+ case "canadian": {
92
+ emoji = "🇨🇦";
93
+ break;
94
+ }
95
+ case "irish": {
96
+ emoji = "🇮🇪";
97
+ break;
98
+ }
99
+ case "scottish": {
100
+ emoji = "🏴󠁧󠁢󠁳󠁣󠁴󠁿";
101
+ break;
102
+ }
103
+ case "indian": {
104
+ emoji = "🇮🇳";
105
+ break;
106
+ }
107
+ case "south-african": {
108
+ emoji = "🇿🇦";
109
+ break;
110
+ }
111
+ case "new-zealand": {
112
+ emoji = "🇳🇿";
113
+ break;
114
+ }
115
+ case "spanish": {
116
+ emoji = "🇪🇸";
117
+ break;
118
+ }
119
+ case "french": {
120
+ emoji = "🇫🇷";
121
+ break;
122
+ }
123
+ case "german": {
124
+ emoji = "🇩🇪";
125
+ break;
126
+ }
127
+ case "italian": {
128
+ emoji = "🇮🇹";
129
+ break;
130
+ }
131
+ case "portuguese": {
132
+ emoji = "🇵🇹";
133
+ break;
134
+ }
135
+ case "brazilian": {
136
+ emoji = "🇧🇷";
137
+ break;
138
+ }
139
+ case "mexican": {
140
+ emoji = "🇲🇽";
141
+ break;
142
+ }
143
+ case "argentinian": {
144
+ emoji = "🇦🇷";
145
+ break;
146
+ }
147
+ case "japanese": {
148
+ emoji = "🇯🇵";
149
+ break;
150
+ }
151
+ case "chinese": {
152
+ emoji = "🇨🇳";
153
+ break;
154
+ }
155
+ case "korean": {
156
+ emoji = "🇰🇷";
157
+ break;
158
+ }
159
+ case "russian": {
160
+ emoji = "🇷🇺";
161
+ break;
162
+ }
163
+ case "arabic": {
164
+ emoji = "🇸🇦";
165
+ break;
166
+ }
167
+ case "dutch": {
168
+ emoji = "🇳🇱";
169
+ break;
170
+ }
171
+ case "swedish": {
172
+ emoji = "🇸🇪";
173
+ break;
174
+ }
175
+ case "norwegian": {
176
+ emoji = "🇳🇴";
177
+ break;
178
+ }
179
+ case "danish": {
180
+ emoji = "🇩🇰";
181
+ break;
182
+ }
183
+ case "finnish": {
184
+ emoji = "🇫🇮";
185
+ break;
186
+ }
187
+ case "polish": {
188
+ emoji = "🇵🇱";
189
+ break;
190
+ }
191
+ case "turkish": {
192
+ emoji = "🇹🇷";
193
+ break;
194
+ }
195
+ case "greek": {
196
+ emoji = "🇬🇷";
197
+ break;
198
+ }
199
+ default: {
200
+ emoji = null;
201
+ }
202
+ }
203
+ return (_jsx("span", { className: cn("text-muted-foreground text-xs", className), ...props, children: children ?? emoji }));
204
+ };
205
+ export const VoiceSelectorAge = ({ className, ...props }) => (_jsx("span", { className: cn("text-muted-foreground text-xs tabular-nums", className), ...props }));
206
+ export const VoiceSelectorName = ({ className, ...props }) => (_jsx("span", { className: cn("flex-1 truncate text-left font-medium", className), ...props }));
207
+ export const VoiceSelectorDescription = ({ className, ...props }) => (_jsx("span", { className: cn("text-muted-foreground text-xs", className), ...props }));
208
+ export const VoiceSelectorAttributes = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center text-xs", className), ...props, children: children }));
209
+ export const VoiceSelectorBullet = ({ className, ...props }) => (_jsx("span", { "aria-hidden": "true", className: cn("select-none text-border", className), ...props, children: "\u2022" }));
210
+ export const VoiceSelectorPreview = ({ className, playing, loading, onPlay, onClick, ...props }) => {
211
+ const handleClick = useCallback((event) => {
212
+ event.stopPropagation();
213
+ onClick?.(event);
214
+ onPlay?.();
215
+ }, [onClick, onPlay]);
216
+ let icon = _jsx(PlayIcon, { className: "size-3" });
217
+ if (loading) {
218
+ icon = _jsx(Spinner, { className: "size-3" });
219
+ }
220
+ else if (playing) {
221
+ icon = _jsx(PauseIcon, { className: "size-3" });
222
+ }
223
+ return (_jsx(Button, { "aria-label": playing ? "Pause preview" : "Play preview", className: cn("size-6", className), disabled: loading, onClick: handleClick, size: "icon", type: "button", variant: "outline", ...props, children: icon }));
224
+ };
@@ -0,0 +1,35 @@
1
+ import { Button } from "@chatsdk-dev/ui/atoms/button";
2
+ import { Input } from "@chatsdk-dev/ui/atoms/input";
3
+ import type { ComponentProps, ReactNode } from "react";
4
+ export interface WebPreviewContextValue {
5
+ url: string;
6
+ setUrl: (url: string) => void;
7
+ consoleOpen: boolean;
8
+ setConsoleOpen: (open: boolean) => void;
9
+ }
10
+ export type WebPreviewProps = ComponentProps<"div"> & {
11
+ defaultUrl?: string;
12
+ onUrlChange?: (url: string) => void;
13
+ };
14
+ export declare const WebPreview: ({ className, children, defaultUrl, onUrlChange, ...props }: WebPreviewProps) => import("react/jsx-runtime").JSX.Element;
15
+ export type WebPreviewNavigationProps = ComponentProps<"div">;
16
+ export declare const WebPreviewNavigation: ({ className, children, ...props }: WebPreviewNavigationProps) => import("react/jsx-runtime").JSX.Element;
17
+ export type WebPreviewNavigationButtonProps = ComponentProps<typeof Button> & {
18
+ tooltip?: string;
19
+ };
20
+ export declare const WebPreviewNavigationButton: ({ onClick, disabled, tooltip, children, ...props }: WebPreviewNavigationButtonProps) => import("react/jsx-runtime").JSX.Element;
21
+ export type WebPreviewUrlProps = ComponentProps<typeof Input>;
22
+ export declare const WebPreviewUrl: ({ value, onChange, onKeyDown, ...props }: WebPreviewUrlProps) => import("react/jsx-runtime").JSX.Element;
23
+ export type WebPreviewBodyProps = ComponentProps<"iframe"> & {
24
+ loading?: ReactNode;
25
+ };
26
+ export declare const WebPreviewBody: ({ className, loading, src, ...props }: WebPreviewBodyProps) => import("react/jsx-runtime").JSX.Element;
27
+ export type WebPreviewConsoleProps = ComponentProps<"div"> & {
28
+ logs?: {
29
+ level: "log" | "warn" | "error";
30
+ message: string;
31
+ timestamp: Date;
32
+ }[];
33
+ };
34
+ export declare const WebPreviewConsole: ({ className, logs, children, ...props }: WebPreviewConsoleProps) => import("react/jsx-runtime").JSX.Element;
35
+ //# sourceMappingURL=web-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-preview.d.ts","sourceRoot":"","sources":["../../../src/molecules/ai/web-preview.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAMtD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AASpD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvD,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAYD,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,4DAMxB,eAAe,4CAmCjB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAE9D,eAAO,MAAM,oBAAoB,GAAI,mCAIlC,yBAAyB,4CAO3B,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,oDAMxC,+BAA+B,4CAsBjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,OAAO,KAAK,CAAC,CAAC;AAE9D,eAAO,MAAM,aAAa,GAAI,0CAK3B,kBAAkB,4CAqCpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,uCAK5B,mBAAmB,4CAgBrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC3D,IAAI,CAAC,EAAE;QACL,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,IAAI,CAAC;KACjB,EAAE,CAAC;CACL,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,yCAK/B,sBAAsB,4CAoDxB,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button } from "@chatsdk-dev/ui/atoms/button";
4
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@chatsdk-dev/ui/atoms/collapsible";
5
+ import { Input } from "@chatsdk-dev/ui/atoms/input";
6
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/atoms/tooltip";
7
+ import { cn } from "@chatsdk-dev/ui/lib/utils";
8
+ import { createContext, useCallback, useContext, useMemo, useState, } from "react";
9
+ const WebPreviewContext = createContext(null);
10
+ const useWebPreview = () => {
11
+ const context = useContext(WebPreviewContext);
12
+ if (!context) {
13
+ throw new Error("WebPreview components must be used within a WebPreview");
14
+ }
15
+ return context;
16
+ };
17
+ export const WebPreview = ({ className, children, defaultUrl = "", onUrlChange, ...props }) => {
18
+ const [url, setUrl] = useState(defaultUrl);
19
+ const [consoleOpen, setConsoleOpen] = useState(false);
20
+ const handleUrlChange = useCallback((newUrl) => {
21
+ setUrl(newUrl);
22
+ onUrlChange?.(newUrl);
23
+ }, [onUrlChange]);
24
+ const contextValue = useMemo(() => ({
25
+ consoleOpen,
26
+ setConsoleOpen,
27
+ setUrl: handleUrlChange,
28
+ url,
29
+ }), [consoleOpen, handleUrlChange, url]);
30
+ return (_jsx(WebPreviewContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("flex size-full flex-col rounded-lg border bg-card", className), ...props, children: children }) }));
31
+ };
32
+ export const WebPreviewNavigation = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center gap-1 border-b p-2", className), ...props, children: children }));
33
+ export const WebPreviewNavigationButton = ({ onClick, disabled, tooltip, children, ...props }) => (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: () => (_jsx(Button, { className: "h-8 w-8 p-0 hover:text-foreground", disabled: disabled, onClick: onClick, size: "sm", variant: "ghost", ...props, children: children })) }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
34
+ export const WebPreviewUrl = ({ value, onChange, onKeyDown, ...props }) => {
35
+ const { url, setUrl } = useWebPreview();
36
+ const [prevUrl, setPrevUrl] = useState(url);
37
+ const [inputValue, setInputValue] = useState(url);
38
+ // Sync input value with context URL when it changes externally (derived state pattern)
39
+ if (url !== prevUrl) {
40
+ setPrevUrl(url);
41
+ setInputValue(url);
42
+ }
43
+ const handleChange = (event) => {
44
+ setInputValue(event.target.value);
45
+ onChange?.(event);
46
+ };
47
+ const handleKeyDown = useCallback((event) => {
48
+ if (event.key === "Enter") {
49
+ const target = event.target;
50
+ setUrl(target.value);
51
+ }
52
+ onKeyDown?.(event);
53
+ }, [setUrl, onKeyDown]);
54
+ return (_jsx(Input, { className: "h-8 flex-1 text-sm", onChange: onChange ?? handleChange, onKeyDown: handleKeyDown, placeholder: "Enter URL...", value: value ?? inputValue, ...props }));
55
+ };
56
+ export const WebPreviewBody = ({ className, loading, src, ...props }) => {
57
+ const { url } = useWebPreview();
58
+ return (_jsxs("div", { className: "flex-1", children: [_jsx("iframe", { className: cn("size-full", className),
59
+ // oxlint-disable-next-line eslint-plugin-react(iframe-missing-sandbox)
60
+ sandbox: "allow-scripts allow-same-origin allow-forms allow-popups allow-presentation", src: (src ?? url) || undefined, title: "Preview", ...props }), loading] }));
61
+ };
62
+ export const WebPreviewConsole = ({ className, logs = [], children, ...props }) => {
63
+ const { consoleOpen, setConsoleOpen } = useWebPreview();
64
+ return (_jsxs(Collapsible, { className: cn("border-t bg-muted/50 font-mono text-sm", className), onOpenChange: setConsoleOpen, open: consoleOpen, ...props, children: [_jsx(CollapsibleTrigger, { render: () => (_jsx(Button, { className: "flex w-full items-center justify-between p-4 text-left font-medium hover:bg-muted/50", variant: "ghost", children: "Console" })) }), _jsx(CollapsibleContent, { className: cn("px-4 pb-4", "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 outline-none data-[state=closed]:animate-out data-[state=open]:animate-in"), children: _jsxs("div", { className: "max-h-48 space-y-1 overflow-y-auto", children: [logs.length === 0 ? (_jsx("p", { className: "text-muted-foreground", children: "No console output" })) : (logs.map((log) => (_jsxs("div", { className: cn("text-xs", log.level === "error" && "text-destructive", log.level === "warn" && "text-yellow-600", log.level === "log" && "text-foreground"), children: [_jsx("span", { className: "text-muted-foreground", children: log.timestamp.toLocaleTimeString() }), " ", log.message] }, `${log.timestamp.getTime()}-${log.level}-${log.message}`)))), children] }) })] }));
65
+ };
@@ -0,0 +1,24 @@
1
+ import { Button } from "@chatsdk-dev/ui/components/button";
2
+ import type { LucideIcon } from "lucide-react";
3
+ import type { ComponentProps, HTMLAttributes } from "react";
4
+ export type ArtifactProps = HTMLAttributes<HTMLDivElement>;
5
+ export declare const Artifact: ({ className, ...props }: ArtifactProps) => import("react/jsx-runtime").JSX.Element;
6
+ export type ArtifactHeaderProps = HTMLAttributes<HTMLDivElement>;
7
+ export declare const ArtifactHeader: ({ className, ...props }: ArtifactHeaderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export type ArtifactCloseProps = ComponentProps<typeof Button>;
9
+ export declare const ArtifactClose: ({ className, children, size, variant, ...props }: ArtifactCloseProps) => import("react/jsx-runtime").JSX.Element;
10
+ export type ArtifactTitleProps = HTMLAttributes<HTMLParagraphElement>;
11
+ export declare const ArtifactTitle: ({ className, ...props }: ArtifactTitleProps) => import("react/jsx-runtime").JSX.Element;
12
+ export type ArtifactDescriptionProps = HTMLAttributes<HTMLParagraphElement>;
13
+ export declare const ArtifactDescription: ({ className, ...props }: ArtifactDescriptionProps) => import("react/jsx-runtime").JSX.Element;
14
+ export type ArtifactActionsProps = HTMLAttributes<HTMLDivElement>;
15
+ export declare const ArtifactActions: ({ className, ...props }: ArtifactActionsProps) => import("react/jsx-runtime").JSX.Element;
16
+ export type ArtifactActionProps = ComponentProps<typeof Button> & {
17
+ tooltip?: string;
18
+ label?: string;
19
+ icon?: LucideIcon;
20
+ };
21
+ export declare const ArtifactAction: ({ tooltip, label, icon: Icon, children, className, size, variant, ...props }: ArtifactActionProps) => import("react/jsx-runtime").JSX.Element;
22
+ export type ArtifactContentProps = HTMLAttributes<HTMLDivElement>;
23
+ export declare const ArtifactContent: ({ className, ...props }: ArtifactContentProps) => import("react/jsx-runtime").JSX.Element;
24
+ //# sourceMappingURL=artifact.d.ts.map
@@ -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AAc,GAAI,8EAS5B,mBAAmB,4CA+BrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAElE,eAAO,MAAM,eAAe,GAAI,yBAG7B,oBAAoB,4CAEtB,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Button } from "@chatsdk-dev/ui/components/button";
4
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "@chatsdk-dev/ui/components/tooltip";
5
+ import { cn } from "@chatsdk-dev/ui/lib/utils";
6
+ import { XIcon } from "lucide-react";
7
+ export const Artifact = ({ className, ...props }) => (_jsx("div", { className: cn("flex flex-col overflow-hidden rounded-lg border bg-background shadow-sm", className), ...props }));
8
+ export const ArtifactHeader = ({ className, ...props }) => (_jsx("div", { className: cn("flex items-center justify-between border-b bg-muted/50 px-4 py-3", className), ...props }));
9
+ export const ArtifactClose = ({ className, children, size = "sm", variant = "ghost", ...props }) => (_jsxs(Button, { className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className), size: size, type: "button", variant: variant, ...props, children: [children ?? _jsx(XIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] }));
10
+ export const ArtifactTitle = ({ className, ...props }) => (_jsx("p", { className: cn("font-medium text-foreground text-sm", className), ...props }));
11
+ export const ArtifactDescription = ({ className, ...props }) => (_jsx("p", { className: cn("text-muted-foreground text-sm", className), ...props }));
12
+ export const ArtifactActions = ({ className, ...props }) => (_jsx("div", { className: cn("flex items-center gap-1", className), ...props }));
13
+ export const ArtifactAction = ({ tooltip, label, icon: Icon, children, className, size = "sm", variant = "ghost", ...props }) => {
14
+ const button = (_jsxs(Button, { className: cn("size-8 p-0 text-muted-foreground hover:text-foreground", className), size: size, type: "button", variant: variant, ...props, children: [Icon ? _jsx(Icon, { className: "size-4" }) : children, _jsx("span", { className: "sr-only", children: label || tooltip })] }));
15
+ if (tooltip) {
16
+ return (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: button }), _jsx(TooltipContent, { children: _jsx("p", { children: tooltip }) })] }) }));
17
+ }
18
+ return button;
19
+ };
20
+ export const ArtifactContent = ({ className, ...props }) => (_jsx("div", { className: cn("flex-1 overflow-auto p-4", className), ...props }));
@@ -0,0 +1,55 @@
1
+ import { Button } from "@chatsdk-dev/ui/components/button";
2
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@chatsdk-dev/ui/components/hover-card";
3
+ import type { FileUIPart, SourceDocumentUIPart } from "ai";
4
+ import type { ComponentProps, HTMLAttributes, ReactNode } from "react";
5
+ export type AttachmentData = (FileUIPart & {
6
+ id: string;
7
+ }) | (SourceDocumentUIPart & {
8
+ id: string;
9
+ });
10
+ export type AttachmentMediaCategory = "image" | "video" | "audio" | "document" | "source" | "unknown";
11
+ export type AttachmentVariant = "grid" | "inline" | "list";
12
+ export declare const getMediaCategory: (data: AttachmentData) => AttachmentMediaCategory;
13
+ export declare const getAttachmentLabel: (data: AttachmentData) => string;
14
+ interface AttachmentsContextValue {
15
+ variant: AttachmentVariant;
16
+ }
17
+ interface AttachmentContextValue {
18
+ data: AttachmentData;
19
+ mediaCategory: AttachmentMediaCategory;
20
+ onRemove?: () => void;
21
+ variant: AttachmentVariant;
22
+ }
23
+ export declare const useAttachmentsContext: () => AttachmentsContextValue;
24
+ export declare const useAttachmentContext: () => AttachmentContextValue;
25
+ export type AttachmentsProps = HTMLAttributes<HTMLDivElement> & {
26
+ variant?: AttachmentVariant;
27
+ };
28
+ export declare const Attachments: ({ variant, className, children, ...props }: AttachmentsProps) => import("react/jsx-runtime").JSX.Element;
29
+ export type AttachmentProps = HTMLAttributes<HTMLDivElement> & {
30
+ data: AttachmentData;
31
+ onRemove?: () => void;
32
+ };
33
+ export declare const Attachment: ({ data, onRemove, className, children, ...props }: AttachmentProps) => import("react/jsx-runtime").JSX.Element;
34
+ export type AttachmentPreviewProps = HTMLAttributes<HTMLDivElement> & {
35
+ fallbackIcon?: ReactNode;
36
+ };
37
+ export declare const AttachmentPreview: ({ fallbackIcon, className, ...props }: AttachmentPreviewProps) => import("react/jsx-runtime").JSX.Element;
38
+ export type AttachmentInfoProps = HTMLAttributes<HTMLDivElement> & {
39
+ showMediaType?: boolean;
40
+ };
41
+ export declare const AttachmentInfo: ({ showMediaType, className, ...props }: AttachmentInfoProps) => import("react/jsx-runtime").JSX.Element | null;
42
+ export type AttachmentRemoveProps = ComponentProps<typeof Button> & {
43
+ label?: string;
44
+ };
45
+ export declare const AttachmentRemove: ({ label, className, children, ...props }: AttachmentRemoveProps) => import("react/jsx-runtime").JSX.Element | null;
46
+ export type AttachmentHoverCardProps = ComponentProps<typeof HoverCard>;
47
+ export declare const AttachmentHoverCard: ({ ...props }: AttachmentHoverCardProps) => import("react/jsx-runtime").JSX.Element;
48
+ export type AttachmentHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;
49
+ export declare const AttachmentHoverCardTrigger: ({ delay, closeDelay, ...props }: AttachmentHoverCardTriggerProps) => import("react/jsx-runtime").JSX.Element;
50
+ export type AttachmentHoverCardContentProps = ComponentProps<typeof HoverCardContent>;
51
+ export declare const AttachmentHoverCardContent: ({ align, className, ...props }: AttachmentHoverCardContentProps) => import("react/jsx-runtime").JSX.Element;
52
+ export type AttachmentEmptyProps = HTMLAttributes<HTMLDivElement>;
53
+ export declare const AttachmentEmpty: ({ className, children, ...props }: AttachmentEmptyProps) => import("react/jsx-runtime").JSX.Element;
54
+ export {};
55
+ //# sourceMappingURL=attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/molecules/attachments.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,K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ui/components/button";
4
+ import { HoverCard, HoverCardContent, HoverCardTrigger, } from "@chatsdk-dev/ui/components/hover-card";
5
+ import { cn } from "@chatsdk-dev/ui/lib/utils";
6
+ import { FileTextIcon, GlobeIcon, ImageIcon, Music2Icon, PaperclipIcon, VideoIcon, XIcon, } from "lucide-react";
7
+ import { createContext, useCallback, useContext, useMemo } from "react";
8
+ const mediaCategoryIcons = {
9
+ audio: Music2Icon,
10
+ document: FileTextIcon,
11
+ image: ImageIcon,
12
+ source: GlobeIcon,
13
+ unknown: PaperclipIcon,
14
+ video: VideoIcon,
15
+ };
16
+ // ============================================================================
17
+ // Utility Functions
18
+ // ============================================================================
19
+ export const getMediaCategory = (data) => {
20
+ if (data.type === "source-document") {
21
+ return "source";
22
+ }
23
+ const mediaType = data.mediaType ?? "";
24
+ if (mediaType.startsWith("image/")) {
25
+ return "image";
26
+ }
27
+ if (mediaType.startsWith("video/")) {
28
+ return "video";
29
+ }
30
+ if (mediaType.startsWith("audio/")) {
31
+ return "audio";
32
+ }
33
+ if (mediaType.startsWith("application/") || mediaType.startsWith("text/")) {
34
+ return "document";
35
+ }
36
+ return "unknown";
37
+ };
38
+ export const getAttachmentLabel = (data) => {
39
+ if (data.type === "source-document") {
40
+ return data.title || data.filename || "Source";
41
+ }
42
+ const category = getMediaCategory(data);
43
+ return data.filename || (category === "image" ? "Image" : "Attachment");
44
+ };
45
+ const renderAttachmentImage = (url, filename, isGrid) => isGrid ? (_jsx("img", { alt: filename || "Image", className: "size-full object-cover", height: 96, src: url, width: 96 })) : (_jsx("img", { alt: filename || "Image", className: "size-full rounded object-cover", height: 20, src: url, width: 20 }));
46
+ const AttachmentsContext = createContext(null);
47
+ const AttachmentContext = createContext(null);
48
+ // ============================================================================
49
+ // Hooks
50
+ // ============================================================================
51
+ export const useAttachmentsContext = () => useContext(AttachmentsContext) ?? { variant: "grid" };
52
+ export const useAttachmentContext = () => {
53
+ const ctx = useContext(AttachmentContext);
54
+ if (!ctx) {
55
+ throw new Error("Attachment components must be used within <Attachment>");
56
+ }
57
+ return ctx;
58
+ };
59
+ export const Attachments = ({ variant = "grid", className, children, ...props }) => {
60
+ const contextValue = useMemo(() => ({ variant }), [variant]);
61
+ return (_jsx(AttachmentsContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("flex items-start", variant === "list" ? "flex-col gap-2" : "flex-wrap gap-2", variant === "grid" && "ml-auto w-fit", className), ...props, children: children }) }));
62
+ };
63
+ export const Attachment = ({ data, onRemove, className, children, ...props }) => {
64
+ const { variant } = useAttachmentsContext();
65
+ const mediaCategory = getMediaCategory(data);
66
+ const contextValue = useMemo(() => ({ data, mediaCategory, onRemove, variant }), [data, mediaCategory, onRemove, variant]);
67
+ return (_jsx(AttachmentContext.Provider, { value: contextValue, children: _jsx("div", { className: cn("group relative", variant === "grid" && "size-24 overflow-hidden rounded-lg", variant === "inline" && [
68
+ "flex h-8 cursor-pointer select-none items-center gap-1.5",
69
+ "rounded-md border border-border px-1.5",
70
+ "font-medium text-sm transition-all",
71
+ "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
72
+ ], variant === "list" && [
73
+ "flex w-full items-center gap-3 rounded-lg border p-3",
74
+ "hover:bg-accent/50",
75
+ ], className), ...props, children: children }) }));
76
+ };
77
+ export const AttachmentPreview = ({ fallbackIcon, className, ...props }) => {
78
+ const { data, mediaCategory, variant } = useAttachmentContext();
79
+ const iconSize = variant === "inline" ? "size-3" : "size-4";
80
+ const renderIcon = (Icon) => (_jsx(Icon, { className: cn(iconSize, "text-muted-foreground") }));
81
+ const renderContent = () => {
82
+ if (mediaCategory === "image" && data.type === "file" && data.url) {
83
+ return renderAttachmentImage(data.url, data.filename, variant === "grid");
84
+ }
85
+ if (mediaCategory === "video" && data.type === "file" && data.url) {
86
+ return _jsx("video", { className: "size-full object-cover", muted: true, src: data.url });
87
+ }
88
+ const Icon = mediaCategoryIcons[mediaCategory];
89
+ return fallbackIcon ?? renderIcon(Icon);
90
+ };
91
+ return (_jsx("div", { className: cn("flex shrink-0 items-center justify-center overflow-hidden", variant === "grid" && "size-full bg-muted", variant === "inline" && "size-5 rounded bg-background", variant === "list" && "size-12 rounded bg-muted", className), ...props, children: renderContent() }));
92
+ };
93
+ export const AttachmentInfo = ({ showMediaType = false, className, ...props }) => {
94
+ const { data, variant } = useAttachmentContext();
95
+ const label = getAttachmentLabel(data);
96
+ if (variant === "grid") {
97
+ return null;
98
+ }
99
+ return (_jsxs("div", { className: cn("min-w-0 flex-1", className), ...props, children: [_jsx("span", { className: "block truncate", children: label }), showMediaType && data.mediaType && (_jsx("span", { className: "block truncate text-muted-foreground text-xs", children: data.mediaType }))] }));
100
+ };
101
+ export const AttachmentRemove = ({ label = "Remove", className, children, ...props }) => {
102
+ const { onRemove, variant } = useAttachmentContext();
103
+ const handleClick = useCallback((e) => {
104
+ e.stopPropagation();
105
+ onRemove?.();
106
+ }, [onRemove]);
107
+ if (!onRemove) {
108
+ return null;
109
+ }
110
+ return (_jsxs(Button, { "aria-label": label, className: cn(variant === "grid" && [
111
+ "absolute top-2 right-2 size-6 rounded-full p-0",
112
+ "bg-background/80 backdrop-blur-sm",
113
+ "opacity-0 transition-opacity group-hover:opacity-100",
114
+ "hover:bg-background",
115
+ "[&>svg]:size-3",
116
+ ], variant === "inline" && [
117
+ "size-5 rounded p-0",
118
+ "opacity-0 transition-opacity group-hover:opacity-100",
119
+ "[&>svg]:size-2.5",
120
+ ], variant === "list" && ["size-8 shrink-0 rounded p-0", "[&>svg]:size-4"], className), onClick: handleClick, type: "button", variant: "ghost", ...props, children: [children ?? _jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: label })] }));
121
+ };
122
+ export const AttachmentHoverCard = ({ ...props }) => (_jsx(HoverCard, { ...props }));
123
+ export const AttachmentHoverCardTrigger = ({ delay = 0, closeDelay = 0, ...props }) => (_jsx(HoverCardTrigger, { delay: delay, closeDelay: closeDelay, ...props }));
124
+ export const AttachmentHoverCardContent = ({ align = "start", className, ...props }) => (_jsx(HoverCardContent, { align: align, className: cn("w-auto p-2", className), ...props }));
125
+ export const AttachmentEmpty = ({ className, children, ...props }) => (_jsx("div", { className: cn("flex items-center justify-center p-4 text-muted-foreground text-sm", className), ...props, children: children ?? "No attachments" }));
@@ -0,0 +1,30 @@
1
+ import type { Experimental_SpeechResult as SpeechResult } from "ai";
2
+ import { MediaControlBar, MediaController, MediaDurationDisplay, MediaMuteButton, MediaPlayButton, MediaSeekBackwardButton, MediaSeekForwardButton, MediaTimeDisplay, MediaTimeRange, MediaVolumeRange } from "media-chrome/react";
3
+ import type { ComponentProps } from "react";
4
+ export type AudioPlayerProps = Omit<ComponentProps<typeof MediaController>, "audio">;
5
+ export declare const AudioPlayer: ({ children, style, ...props }: AudioPlayerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export type AudioPlayerElementProps = Omit<ComponentProps<"audio">, "src"> & ({
7
+ data: SpeechResult["audio"];
8
+ } | {
9
+ src: string;
10
+ });
11
+ export declare const AudioPlayerElement: ({ ...props }: AudioPlayerElementProps) => import("react/jsx-runtime").JSX.Element;
12
+ export type AudioPlayerControlBarProps = ComponentProps<typeof MediaControlBar>;
13
+ export declare const AudioPlayerControlBar: ({ children, ...props }: AudioPlayerControlBarProps) => import("react/jsx-runtime").JSX.Element;
14
+ export type AudioPlayerPlayButtonProps = ComponentProps<typeof MediaPlayButton>;
15
+ export declare const AudioPlayerPlayButton: ({ className, ...props }: AudioPlayerPlayButtonProps) => import("react/jsx-runtime").JSX.Element;
16
+ export type AudioPlayerSeekBackwardButtonProps = ComponentProps<typeof MediaSeekBackwardButton>;
17
+ export declare const AudioPlayerSeekBackwardButton: ({ seekOffset, ...props }: AudioPlayerSeekBackwardButtonProps) => import("react/jsx-runtime").JSX.Element;
18
+ export type AudioPlayerSeekForwardButtonProps = ComponentProps<typeof MediaSeekForwardButton>;
19
+ export declare const AudioPlayerSeekForwardButton: ({ seekOffset, ...props }: AudioPlayerSeekForwardButtonProps) => import("react/jsx-runtime").JSX.Element;
20
+ export type AudioPlayerTimeDisplayProps = ComponentProps<typeof MediaTimeDisplay>;
21
+ export declare const AudioPlayerTimeDisplay: ({ className, ...props }: AudioPlayerTimeDisplayProps) => import("react/jsx-runtime").JSX.Element;
22
+ export type AudioPlayerTimeRangeProps = ComponentProps<typeof MediaTimeRange>;
23
+ export declare const AudioPlayerTimeRange: ({ className, ...props }: AudioPlayerTimeRangeProps) => import("react/jsx-runtime").JSX.Element;
24
+ export type AudioPlayerDurationDisplayProps = ComponentProps<typeof MediaDurationDisplay>;
25
+ export declare const AudioPlayerDurationDisplay: ({ className, ...props }: AudioPlayerDurationDisplayProps) => import("react/jsx-runtime").JSX.Element;
26
+ export type AudioPlayerMuteButtonProps = ComponentProps<typeof MediaMuteButton>;
27
+ export declare const AudioPlayerMuteButton: ({ className, ...props }: AudioPlayerMuteButtonProps) => import("react/jsx-runtime").JSX.Element;
28
+ export type AudioPlayerVolumeRangeProps = ComponentProps<typeof MediaVolumeRange>;
29
+ export declare const AudioPlayerVolumeRange: ({ className, ...props }: AudioPlayerVolumeRangeProps) => import("react/jsx-runtime").JSX.Element;
30
+ //# sourceMappingURL=audio-player.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio-player.d.ts","sourceRoot":"","sources":["../../src/molecules/audio-player.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,yBAAyB,IAAI,YAAY,EAAE,MAAM,IAAI,CAAC;AACpE,OAAO,EACL,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,OAAO,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,cAAc,CAAC,OAAO,eAAe,CAAC,EACtC,OAAO,CACR,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,+BAIz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