@mieweb/ui 0.6.1 → 0.7.0-dev.178

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 (450) hide show
  1. package/README.md +90 -53
  2. package/dist/CsvBlock-2A5VEDD3.cjs +15 -0
  3. package/dist/CsvBlock-2A5VEDD3.cjs.map +1 -0
  4. package/dist/CsvBlock-D6PWAJ5X.js +6 -0
  5. package/dist/CsvBlock-D6PWAJ5X.js.map +1 -0
  6. package/dist/HtmlPreviewBlock-PEHTJ6C3.js +6 -0
  7. package/dist/HtmlPreviewBlock-PEHTJ6C3.js.map +1 -0
  8. package/dist/HtmlPreviewBlock-SYXCV5RH.cjs +15 -0
  9. package/dist/HtmlPreviewBlock-SYXCV5RH.cjs.map +1 -0
  10. package/dist/MedicationEditor-Bp4NLy7y.d.cts +352 -0
  11. package/dist/MedicationEditor-Bp4NLy7y.d.ts +352 -0
  12. package/dist/MermaidBlock-7NK3AVK2.js +6 -0
  13. package/dist/MermaidBlock-7NK3AVK2.js.map +1 -0
  14. package/dist/MermaidBlock-AFXNP5NK.cjs +15 -0
  15. package/dist/MermaidBlock-AFXNP5NK.cjs.map +1 -0
  16. package/dist/SurveyBlock-6KRNKFH5.cjs +15 -0
  17. package/dist/SurveyBlock-6KRNKFH5.cjs.map +1 -0
  18. package/dist/SurveyBlock-NNDGXGG4.js +6 -0
  19. package/dist/SurveyBlock-NNDGXGG4.js.map +1 -0
  20. package/dist/ag-grid.cjs +6 -6
  21. package/dist/ag-grid.cjs.map +1 -1
  22. package/dist/ag-grid.js +2 -2
  23. package/dist/ag-grid.js.map +1 -1
  24. package/dist/brands/index.cjs +17 -17
  25. package/dist/brands/index.js +4 -4
  26. package/dist/chunk-372IIHUA.cjs +2017 -0
  27. package/dist/chunk-372IIHUA.cjs.map +1 -0
  28. package/dist/{chunk-2DS3RJ2D.js → chunk-3TERETXH.js} +112 -3
  29. package/dist/chunk-3TERETXH.js.map +1 -0
  30. package/dist/chunk-44CK4CT2.cjs +336 -0
  31. package/dist/chunk-44CK4CT2.cjs.map +1 -0
  32. package/dist/{chunk-FSBFQBNE.cjs → chunk-4GXECTPS.cjs} +2 -2
  33. package/dist/{chunk-FSBFQBNE.cjs.map → chunk-4GXECTPS.cjs.map} +1 -1
  34. package/dist/chunk-4LVPQ44A.js +228 -0
  35. package/dist/chunk-4LVPQ44A.js.map +1 -0
  36. package/dist/{chunk-6555OYRU.js → chunk-5BQE6BEL.js} +2 -2
  37. package/dist/{chunk-6555OYRU.js.map → chunk-5BQE6BEL.js.map} +1 -1
  38. package/dist/chunk-62ZOA6PX.js +31 -0
  39. package/dist/chunk-62ZOA6PX.js.map +1 -0
  40. package/dist/chunk-63KVQHGQ.cjs +1802 -0
  41. package/dist/chunk-63KVQHGQ.cjs.map +1 -0
  42. package/dist/chunk-6AHYYWVB.js +78 -0
  43. package/dist/chunk-6AHYYWVB.js.map +1 -0
  44. package/dist/chunk-6I7IDZ4A.js +51 -0
  45. package/dist/chunk-6I7IDZ4A.js.map +1 -0
  46. package/dist/chunk-6ZYE6JUK.cjs +80 -0
  47. package/dist/chunk-6ZYE6JUK.cjs.map +1 -0
  48. package/dist/chunk-7QXG5BBB.cjs +164 -0
  49. package/dist/chunk-7QXG5BBB.cjs.map +1 -0
  50. package/dist/chunk-7WMSUXOQ.js +182 -0
  51. package/dist/chunk-7WMSUXOQ.js.map +1 -0
  52. package/dist/chunk-7XUN3OQT.js +3 -0
  53. package/dist/{chunk-V2DF2GUE.js.map → chunk-7XUN3OQT.js.map} +1 -1
  54. package/dist/chunk-7ZVTLTJF.js +109 -0
  55. package/dist/chunk-7ZVTLTJF.js.map +1 -0
  56. package/dist/chunk-AES2BKEW.cjs +229 -0
  57. package/dist/chunk-AES2BKEW.cjs.map +1 -0
  58. package/dist/chunk-AFKKJEV5.cjs +72 -0
  59. package/dist/chunk-AFKKJEV5.cjs.map +1 -0
  60. package/dist/chunk-AT732HC6.cjs +4 -0
  61. package/dist/{chunk-74K3RRU7.cjs.map → chunk-AT732HC6.cjs.map} +1 -1
  62. package/dist/chunk-BB4WQ4LV.cjs +137 -0
  63. package/dist/chunk-BB4WQ4LV.cjs.map +1 -0
  64. package/dist/chunk-BIT27PPD.js +49 -0
  65. package/dist/chunk-BIT27PPD.js.map +1 -0
  66. package/dist/chunk-BLPCYP4D.cjs +537 -0
  67. package/dist/chunk-BLPCYP4D.cjs.map +1 -0
  68. package/dist/chunk-BT3ZQJGT.cjs +130 -0
  69. package/dist/chunk-BT3ZQJGT.cjs.map +1 -0
  70. package/dist/chunk-BX6BTDTR.js +34 -0
  71. package/dist/chunk-BX6BTDTR.js.map +1 -0
  72. package/dist/chunk-C2544GKZ.js +313 -0
  73. package/dist/chunk-C2544GKZ.js.map +1 -0
  74. package/dist/chunk-C7RVKV25.cjs +25 -0
  75. package/dist/chunk-C7RVKV25.cjs.map +1 -0
  76. package/dist/chunk-CKD554XR.cjs +100 -0
  77. package/dist/chunk-CKD554XR.cjs.map +1 -0
  78. package/dist/chunk-CVC4NWFA.cjs +154 -0
  79. package/dist/chunk-CVC4NWFA.cjs.map +1 -0
  80. package/dist/{chunk-K3IVCUPP.js → chunk-CYMZ2QS5.js} +2 -2
  81. package/dist/{chunk-K3IVCUPP.js.map → chunk-CYMZ2QS5.js.map} +1 -1
  82. package/dist/{chunk-FRT6RQND.cjs → chunk-DAPZPT5N.cjs} +92 -56
  83. package/dist/chunk-DAPZPT5N.cjs.map +1 -0
  84. package/dist/chunk-DHKYGVP7.js +3 -0
  85. package/dist/{chunk-LEMY57MI.js.map → chunk-DHKYGVP7.js.map} +1 -1
  86. package/dist/chunk-DLNJLCNO.cjs +101 -0
  87. package/dist/chunk-DLNJLCNO.cjs.map +1 -0
  88. package/dist/chunk-DUPR6FEL.js +43 -0
  89. package/dist/chunk-DUPR6FEL.js.map +1 -0
  90. package/dist/{chunk-4FALCEJI.cjs → chunk-EL2RSQTJ.cjs} +2 -2
  91. package/dist/{chunk-4FALCEJI.cjs.map → chunk-EL2RSQTJ.cjs.map} +1 -1
  92. package/dist/chunk-ERLPVXOV.js +22 -0
  93. package/dist/chunk-ERLPVXOV.js.map +1 -0
  94. package/dist/chunk-FIWKHLWY.js +197 -0
  95. package/dist/chunk-FIWKHLWY.js.map +1 -0
  96. package/dist/chunk-FJH7P5WG.js +513 -0
  97. package/dist/chunk-FJH7P5WG.js.map +1 -0
  98. package/dist/chunk-FSGEDDF2.cjs +33 -0
  99. package/dist/chunk-FSGEDDF2.cjs.map +1 -0
  100. package/dist/chunk-GLXTVCHN.cjs +4 -0
  101. package/dist/{chunk-4ZU53GNR.cjs.map → chunk-GLXTVCHN.cjs.map} +1 -1
  102. package/dist/chunk-HRS6W74P.js +1568 -0
  103. package/dist/chunk-HRS6W74P.js.map +1 -0
  104. package/dist/chunk-I2W24RHW.js +196 -0
  105. package/dist/chunk-I2W24RHW.js.map +1 -0
  106. package/dist/chunk-I6CY5C6A.js +12 -0
  107. package/dist/chunk-I6CY5C6A.js.map +1 -0
  108. package/dist/chunk-IQ4KQJAO.js +3 -0
  109. package/dist/chunk-IQ4KQJAO.js.map +1 -0
  110. package/dist/chunk-IWDQPSJN.cjs +1452 -0
  111. package/dist/chunk-IWDQPSJN.cjs.map +1 -0
  112. package/dist/chunk-J7KWQJOB.js +14 -0
  113. package/dist/chunk-J7KWQJOB.js.map +1 -0
  114. package/dist/{chunk-R25H4N4Z.js → chunk-J7Z7467B.js} +92 -56
  115. package/dist/chunk-J7Z7467B.js.map +1 -0
  116. package/dist/{chunk-NINI4WVS.cjs → chunk-JC6Y3LGF.cjs} +297 -84
  117. package/dist/chunk-JC6Y3LGF.cjs.map +1 -0
  118. package/dist/chunk-JCNPVK74.cjs +347 -0
  119. package/dist/chunk-JCNPVK74.cjs.map +1 -0
  120. package/dist/chunk-JFLC7SHM.cjs +35 -0
  121. package/dist/chunk-JFLC7SHM.cjs.map +1 -0
  122. package/dist/chunk-JHYFHEHS.js +1967 -0
  123. package/dist/chunk-JHYFHEHS.js.map +1 -0
  124. package/dist/{chunk-IBZXDX4L.cjs → chunk-JQEY53SH.cjs} +112 -3
  125. package/dist/chunk-JQEY53SH.cjs.map +1 -0
  126. package/dist/chunk-JTBQNOSL.cjs +1605 -0
  127. package/dist/chunk-JTBQNOSL.cjs.map +1 -0
  128. package/dist/chunk-JYZW2PZS.cjs +166 -0
  129. package/dist/chunk-JYZW2PZS.cjs.map +1 -0
  130. package/dist/chunk-KBEKQMVY.cjs +198 -0
  131. package/dist/chunk-KBEKQMVY.cjs.map +1 -0
  132. package/dist/chunk-KJ5BSGEO.cjs +258 -0
  133. package/dist/chunk-KJ5BSGEO.cjs.map +1 -0
  134. package/dist/{chunk-DNPRRYPQ.js → chunk-KL2S36FM.js} +2 -2
  135. package/dist/chunk-KL2S36FM.js.map +1 -0
  136. package/dist/chunk-LIH3IZYK.js +689 -0
  137. package/dist/chunk-LIH3IZYK.js.map +1 -0
  138. package/dist/chunk-MAMY5HTT.cjs +1177 -0
  139. package/dist/chunk-MAMY5HTT.cjs.map +1 -0
  140. package/dist/{chunk-WFS6R2F5.js → chunk-MKWGKASO.js} +114 -101
  141. package/dist/chunk-MKWGKASO.js.map +1 -0
  142. package/dist/{chunk-CV4CVGLO.cjs → chunk-MZPF2QGM.cjs} +95 -74
  143. package/dist/chunk-MZPF2QGM.cjs.map +1 -0
  144. package/dist/chunk-NQME7MCK.js +1416 -0
  145. package/dist/chunk-NQME7MCK.js.map +1 -0
  146. package/dist/chunk-NTYGCBCL.js +543 -0
  147. package/dist/chunk-NTYGCBCL.js.map +1 -0
  148. package/dist/chunk-OF7NTZ2I.js +3 -0
  149. package/dist/chunk-OF7NTZ2I.js.map +1 -0
  150. package/dist/chunk-OXYFTCRW.cjs +57 -0
  151. package/dist/chunk-OXYFTCRW.cjs.map +1 -0
  152. package/dist/chunk-QA6ZDHFP.js +117 -0
  153. package/dist/chunk-QA6ZDHFP.js.map +1 -0
  154. package/dist/chunk-RHNPILZQ.cjs +4 -0
  155. package/dist/chunk-RHNPILZQ.cjs.map +1 -0
  156. package/dist/chunk-RHYIFIT5.js +98 -0
  157. package/dist/chunk-RHYIFIT5.js.map +1 -0
  158. package/dist/chunk-RI56YPED.cjs +201 -0
  159. package/dist/chunk-RI56YPED.cjs.map +1 -0
  160. package/dist/chunk-RISZWWEQ.js +3 -0
  161. package/dist/chunk-RISZWWEQ.js.map +1 -0
  162. package/dist/chunk-S6Z3KDEM.js +140 -0
  163. package/dist/chunk-S6Z3KDEM.js.map +1 -0
  164. package/dist/chunk-S7JQ3FV5.cjs +16 -0
  165. package/dist/chunk-S7JQ3FV5.cjs.map +1 -0
  166. package/dist/{chunk-OXGUG57G.cjs → chunk-SNEQXSC5.cjs} +2 -2
  167. package/dist/{chunk-OXGUG57G.cjs.map → chunk-SNEQXSC5.cjs.map} +1 -1
  168. package/dist/chunk-SQHMGT4W.js +164 -0
  169. package/dist/chunk-SQHMGT4W.js.map +1 -0
  170. package/dist/{chunk-JHPFOG2N.cjs → chunk-ST2RE5UB.cjs} +30 -18
  171. package/dist/chunk-ST2RE5UB.cjs.map +1 -0
  172. package/dist/{chunk-QVJBUWJQ.js → chunk-STPK44AU.js} +46 -12
  173. package/dist/chunk-STPK44AU.js.map +1 -0
  174. package/dist/chunk-T3C4RNJ4.js +106 -0
  175. package/dist/chunk-T3C4RNJ4.js.map +1 -0
  176. package/dist/chunk-T3RWXOCM.js +148 -0
  177. package/dist/chunk-T3RWXOCM.js.map +1 -0
  178. package/dist/{chunk-DCER2QQB.js → chunk-T42BCIUA.js} +2 -2
  179. package/dist/{chunk-DCER2QQB.js.map → chunk-T42BCIUA.js.map} +1 -1
  180. package/dist/{chunk-OYKS2JBB.cjs → chunk-TN33E2VN.cjs} +2 -2
  181. package/dist/chunk-TN33E2VN.cjs.map +1 -0
  182. package/dist/{chunk-K7IGBNZA.cjs → chunk-TR2OJKQ4.cjs} +46 -12
  183. package/dist/chunk-TR2OJKQ4.cjs.map +1 -0
  184. package/dist/chunk-UFYXU7KV.js +135 -0
  185. package/dist/chunk-UFYXU7KV.js.map +1 -0
  186. package/dist/chunk-UM6NA7HL.js +1145 -0
  187. package/dist/chunk-UM6NA7HL.js.map +1 -0
  188. package/dist/chunk-UO3KEUYK.cjs +220 -0
  189. package/dist/chunk-UO3KEUYK.cjs.map +1 -0
  190. package/dist/chunk-UOOH356R.cjs +66 -0
  191. package/dist/chunk-UOOH356R.cjs.map +1 -0
  192. package/dist/{chunk-4ZU53GNR.cjs → chunk-UTYUT5YY.cjs} +62 -2
  193. package/dist/chunk-UTYUT5YY.cjs.map +1 -0
  194. package/dist/chunk-UVSODK6V.cjs +53 -0
  195. package/dist/chunk-UVSODK6V.cjs.map +1 -0
  196. package/dist/chunk-V25Z5GR6.cjs +184 -0
  197. package/dist/chunk-V25Z5GR6.cjs.map +1 -0
  198. package/dist/chunk-VBWRH4UW.cjs +4 -0
  199. package/dist/chunk-VBWRH4UW.cjs.map +1 -0
  200. package/dist/chunk-VJOVJTFP.cjs +370 -0
  201. package/dist/chunk-VJOVJTFP.cjs.map +1 -0
  202. package/dist/{chunk-7BARESXI.cjs → chunk-VPNURIAY.cjs} +114 -101
  203. package/dist/chunk-VPNURIAY.cjs.map +1 -0
  204. package/dist/{chunk-I56VBDSC.js → chunk-XDFDVF2O.js} +30 -18
  205. package/dist/chunk-XDFDVF2O.js.map +1 -0
  206. package/dist/chunk-XL7TTKHP.js +327 -0
  207. package/dist/chunk-XL7TTKHP.js.map +1 -0
  208. package/dist/chunk-Y2S6QMKU.js +78 -0
  209. package/dist/chunk-Y2S6QMKU.js.map +1 -0
  210. package/dist/chunk-Y4ESBDQ5.cjs +552 -0
  211. package/dist/chunk-Y4ESBDQ5.cjs.map +1 -0
  212. package/dist/chunk-Y5KEFV5O.js +192 -0
  213. package/dist/chunk-Y5KEFV5O.js.map +1 -0
  214. package/dist/chunk-YBLIDESO.js +365 -0
  215. package/dist/chunk-YBLIDESO.js.map +1 -0
  216. package/dist/chunk-YVLP3ATI.js +1776 -0
  217. package/dist/chunk-YVLP3ATI.js.map +1 -0
  218. package/dist/chunk-YVPC65ZJ.cjs +134 -0
  219. package/dist/chunk-YVPC65ZJ.cjs.map +1 -0
  220. package/dist/{chunk-MPOWJVV4.js → chunk-YZT62IMX.js} +95 -74
  221. package/dist/chunk-YZT62IMX.js.map +1 -0
  222. package/dist/chunk-ZAIEQWRA.js +207 -0
  223. package/dist/chunk-ZAIEQWRA.js.map +1 -0
  224. package/dist/chunk-ZDEYV373.cjs +139 -0
  225. package/dist/chunk-ZDEYV373.cjs.map +1 -0
  226. package/dist/{chunk-Q7NBJFEB.js → chunk-ZGSC2CB2.js} +2 -2
  227. package/dist/{chunk-Q7NBJFEB.js.map → chunk-ZGSC2CB2.js.map} +1 -1
  228. package/dist/{chunk-3M4P2KMG.cjs → chunk-ZHBANUBI.cjs} +2 -2
  229. package/dist/{chunk-3M4P2KMG.cjs.map → chunk-ZHBANUBI.cjs.map} +1 -1
  230. package/dist/components/AlertDialog/index.cjs +18 -0
  231. package/dist/components/AlertDialog/index.cjs.map +1 -0
  232. package/dist/components/AlertDialog/index.d.cts +56 -0
  233. package/dist/components/AlertDialog/index.d.ts +56 -0
  234. package/dist/components/AlertDialog/index.js +9 -0
  235. package/dist/components/AlertDialog/index.js.map +1 -0
  236. package/dist/components/AudioRecorder/index.d.cts +1 -1
  237. package/dist/components/AudioRecorder/index.d.ts +1 -1
  238. package/dist/components/Autocomplete/index.cjs +16 -0
  239. package/dist/components/Autocomplete/index.cjs.map +1 -0
  240. package/dist/components/Autocomplete/index.d.cts +77 -0
  241. package/dist/components/Autocomplete/index.d.ts +77 -0
  242. package/dist/components/Autocomplete/index.js +7 -0
  243. package/dist/components/Autocomplete/index.js.map +1 -0
  244. package/dist/components/Badge/index.cjs +4 -3
  245. package/dist/components/Badge/index.js +2 -1
  246. package/dist/components/Card/index.cjs +16 -15
  247. package/dist/components/Card/index.js +2 -1
  248. package/dist/components/Collapsible/index.cjs +21 -0
  249. package/dist/components/Collapsible/index.cjs.map +1 -0
  250. package/dist/components/Collapsible/index.d.cts +33 -0
  251. package/dist/components/Collapsible/index.d.ts +33 -0
  252. package/dist/components/Collapsible/index.js +4 -0
  253. package/dist/components/Collapsible/index.js.map +1 -0
  254. package/dist/components/CountryCodeDropdown/index.cjs +6 -5
  255. package/dist/components/CountryCodeDropdown/index.js +3 -2
  256. package/dist/components/DateInput/index.cjs +2 -2
  257. package/dist/components/DateInput/index.d.cts +8 -2
  258. package/dist/components/DateInput/index.d.ts +8 -2
  259. package/dist/components/DateInput/index.js +1 -1
  260. package/dist/components/Dropdown/index.cjs +9 -8
  261. package/dist/components/Dropdown/index.d.cts +2 -1
  262. package/dist/components/Dropdown/index.d.ts +2 -1
  263. package/dist/components/Dropdown/index.js +3 -2
  264. package/dist/components/FloatingWindow/index.cjs +18 -0
  265. package/dist/components/FloatingWindow/index.cjs.map +1 -0
  266. package/dist/components/FloatingWindow/index.d.cts +64 -0
  267. package/dist/components/FloatingWindow/index.d.ts +64 -0
  268. package/dist/components/FloatingWindow/index.js +5 -0
  269. package/dist/components/FloatingWindow/index.js.map +1 -0
  270. package/dist/components/Label/index.cjs +17 -0
  271. package/dist/components/Label/index.cjs.map +1 -0
  272. package/dist/components/Label/index.d.cts +23 -0
  273. package/dist/components/Label/index.d.ts +23 -0
  274. package/dist/components/Label/index.js +4 -0
  275. package/dist/components/Label/index.js.map +1 -0
  276. package/dist/components/Markdown/index.cjs +51 -0
  277. package/dist/components/Markdown/index.cjs.map +1 -0
  278. package/dist/components/Markdown/index.css +331 -0
  279. package/dist/components/Markdown/index.css.map +1 -0
  280. package/dist/components/Markdown/index.d.cts +82 -0
  281. package/dist/components/Markdown/index.d.ts +82 -0
  282. package/dist/components/Markdown/index.js +10 -0
  283. package/dist/components/Markdown/index.js.map +1 -0
  284. package/dist/components/Markdown/styles.css +354 -0
  285. package/dist/components/MediaEditor/index.cjs +44 -0
  286. package/dist/components/MediaEditor/index.cjs.map +1 -0
  287. package/dist/components/MediaEditor/index.d.cts +151 -0
  288. package/dist/components/MediaEditor/index.d.ts +151 -0
  289. package/dist/components/MediaEditor/index.js +19 -0
  290. package/dist/components/MediaEditor/index.js.map +1 -0
  291. package/dist/components/MediaPlayer/index.cjs +24 -0
  292. package/dist/components/MediaPlayer/index.cjs.map +1 -0
  293. package/dist/components/MediaPlayer/index.d.cts +71 -0
  294. package/dist/components/MediaPlayer/index.d.ts +71 -0
  295. package/dist/components/MediaPlayer/index.js +7 -0
  296. package/dist/components/MediaPlayer/index.js.map +1 -0
  297. package/dist/components/RecordButton/index.cjs +4 -4
  298. package/dist/components/RecordButton/index.js +1 -1
  299. package/dist/components/RichTextEditor/index.cjs +33 -0
  300. package/dist/components/RichTextEditor/index.cjs.map +1 -0
  301. package/dist/components/RichTextEditor/index.d.cts +62 -0
  302. package/dist/components/RichTextEditor/index.d.ts +62 -0
  303. package/dist/components/RichTextEditor/index.js +12 -0
  304. package/dist/components/RichTextEditor/index.js.map +1 -0
  305. package/dist/components/ScrollArea/index.cjs +17 -0
  306. package/dist/components/ScrollArea/index.cjs.map +1 -0
  307. package/dist/components/ScrollArea/index.d.cts +22 -0
  308. package/dist/components/ScrollArea/index.d.ts +22 -0
  309. package/dist/components/ScrollArea/index.js +4 -0
  310. package/dist/components/ScrollArea/index.js.map +1 -0
  311. package/dist/components/Select/index.cjs +5 -3
  312. package/dist/components/Select/index.js +3 -1
  313. package/dist/components/Separator/index.cjs +17 -0
  314. package/dist/components/Separator/index.cjs.map +1 -0
  315. package/dist/components/Separator/index.d.cts +27 -0
  316. package/dist/components/Separator/index.d.ts +27 -0
  317. package/dist/components/Separator/index.js +4 -0
  318. package/dist/components/Separator/index.js.map +1 -0
  319. package/dist/components/Sheet/index.cjs +48 -0
  320. package/dist/components/Sheet/index.cjs.map +1 -0
  321. package/dist/components/Sheet/index.d.cts +62 -0
  322. package/dist/components/Sheet/index.d.ts +62 -0
  323. package/dist/components/Sheet/index.js +7 -0
  324. package/dist/components/Sheet/index.js.map +1 -0
  325. package/dist/components/SuperChat/index.cjs +1373 -0
  326. package/dist/components/SuperChat/index.cjs.map +1 -0
  327. package/dist/components/SuperChat/index.d.cts +189 -0
  328. package/dist/components/SuperChat/index.d.ts +189 -0
  329. package/dist/components/SuperChat/index.js +1336 -0
  330. package/dist/components/SuperChat/index.js.map +1 -0
  331. package/dist/components/SuperChat/plugins/index.cjs +1292 -0
  332. package/dist/components/SuperChat/plugins/index.cjs.map +1 -0
  333. package/dist/components/SuperChat/plugins/index.d.cts +233 -0
  334. package/dist/components/SuperChat/plugins/index.d.ts +233 -0
  335. package/dist/components/SuperChat/plugins/index.js +1252 -0
  336. package/dist/components/SuperChat/plugins/index.js.map +1 -0
  337. package/dist/components/Table/index.cjs +9 -9
  338. package/dist/components/Table/index.d.cts +4 -0
  339. package/dist/components/Table/index.d.ts +4 -0
  340. package/dist/components/Table/index.js +1 -1
  341. package/dist/components/ThemeProvider/index.cjs +7 -7
  342. package/dist/components/ThemeProvider/index.js +1 -1
  343. package/dist/components/Toggle/index.cjs +17 -0
  344. package/dist/components/Toggle/index.cjs.map +1 -0
  345. package/dist/components/Toggle/index.d.cts +28 -0
  346. package/dist/components/Toggle/index.d.ts +28 -0
  347. package/dist/components/Toggle/index.js +4 -0
  348. package/dist/components/Toggle/index.js.map +1 -0
  349. package/dist/components/TranscriptView/index.cjs +21 -0
  350. package/dist/components/TranscriptView/index.cjs.map +1 -0
  351. package/dist/components/TranscriptView/index.d.cts +55 -0
  352. package/dist/components/TranscriptView/index.d.ts +55 -0
  353. package/dist/components/TranscriptView/index.js +4 -0
  354. package/dist/components/TranscriptView/index.js.map +1 -0
  355. package/dist/datavis.cjs +268 -227
  356. package/dist/datavis.cjs.map +1 -1
  357. package/dist/datavis.d.cts +83 -9
  358. package/dist/datavis.d.ts +83 -9
  359. package/dist/datavis.js +235 -229
  360. package/dist/datavis.js.map +1 -1
  361. package/dist/esheet.cjs +184 -0
  362. package/dist/esheet.cjs.map +1 -1
  363. package/dist/esheet.d.cts +117 -0
  364. package/dist/esheet.d.ts +117 -0
  365. package/dist/esheet.js +163 -0
  366. package/dist/esheet.js.map +1 -1
  367. package/dist/hey-buddy-CLUVAY2X.cjs +1133 -0
  368. package/dist/hey-buddy-CLUVAY2X.cjs.map +1 -0
  369. package/dist/hey-buddy-NMSWZ4TN.js +1131 -0
  370. package/dist/hey-buddy-NMSWZ4TN.js.map +1 -0
  371. package/dist/hooks/index.cjs +76 -16
  372. package/dist/hooks/index.d.cts +151 -2
  373. package/dist/hooks/index.d.ts +151 -2
  374. package/dist/hooks/index.js +6 -2
  375. package/dist/html-MdxqSzjD.d.cts +13 -0
  376. package/dist/html-MdxqSzjD.d.ts +13 -0
  377. package/dist/index.cjs +10394 -6565
  378. package/dist/index.cjs.map +1 -1
  379. package/dist/index.css +331 -0
  380. package/dist/index.css.map +1 -0
  381. package/dist/index.d.cts +2020 -249
  382. package/dist/index.d.ts +2020 -249
  383. package/dist/index.js +9223 -5969
  384. package/dist/index.js.map +1 -1
  385. package/dist/kerebron.cjs +119 -0
  386. package/dist/kerebron.cjs.map +1 -0
  387. package/dist/kerebron.css +11 -0
  388. package/dist/kerebron.d.cts +23 -0
  389. package/dist/kerebron.d.ts +23 -0
  390. package/dist/kerebron.js +116 -0
  391. package/dist/kerebron.js.map +1 -0
  392. package/dist/nitroTableGrid-3J2GY6CK.cjs +47 -0
  393. package/dist/nitroTableGrid-3J2GY6CK.cjs.map +1 -0
  394. package/dist/nitroTableGrid-SIMT7635.js +25 -0
  395. package/dist/nitroTableGrid-SIMT7635.js.map +1 -0
  396. package/dist/orderRows-BUJYgSc7.d.cts +221 -0
  397. package/dist/orderRows-BUJYgSc7.d.ts +221 -0
  398. package/dist/speaker-verify-5GTWAN5Y.cjs +357 -0
  399. package/dist/speaker-verify-5GTWAN5Y.cjs.map +1 -0
  400. package/dist/speaker-verify-R67P433H.js +355 -0
  401. package/dist/speaker-verify-R67P433H.js.map +1 -0
  402. package/dist/styles/init.css +5 -0
  403. package/dist/styles.css +1 -1
  404. package/dist/tailwind-preset.cjs +4 -4
  405. package/dist/tailwind-preset.js +1 -1
  406. package/dist/transcript-oaWqY3yr.d.cts +81 -0
  407. package/dist/transcript-oaWqY3yr.d.ts +81 -0
  408. package/dist/types-BYnLjEFg.d.cts +248 -0
  409. package/dist/types-BYnLjEFg.d.ts +248 -0
  410. package/dist/types-CBh8Zlje.d.cts +240 -0
  411. package/dist/types-CyCwYBlr.d.ts +240 -0
  412. package/dist/useAnchoredPosition-nXdSFKHf.d.cts +65 -0
  413. package/dist/useAnchoredPosition-nXdSFKHf.d.ts +65 -0
  414. package/dist/useTranscriptEdits-BUylQFg0.d.cts +168 -0
  415. package/dist/useTranscriptEdits-CWYnjbGP.d.ts +168 -0
  416. package/dist/utils/index.cjs +27 -18
  417. package/dist/utils/index.d.cts +1 -0
  418. package/dist/utils/index.d.ts +1 -0
  419. package/dist/utils/index.js +3 -2
  420. package/package.json +180 -55
  421. package/dist/chunk-2DS3RJ2D.js.map +0 -1
  422. package/dist/chunk-74K3RRU7.cjs +0 -4
  423. package/dist/chunk-7BARESXI.cjs.map +0 -1
  424. package/dist/chunk-CV4CVGLO.cjs.map +0 -1
  425. package/dist/chunk-DNPRRYPQ.js.map +0 -1
  426. package/dist/chunk-FRT6RQND.cjs.map +0 -1
  427. package/dist/chunk-HYEJLKXI.js +0 -476
  428. package/dist/chunk-HYEJLKXI.js.map +0 -1
  429. package/dist/chunk-I56VBDSC.js.map +0 -1
  430. package/dist/chunk-IBZXDX4L.cjs.map +0 -1
  431. package/dist/chunk-IKMR2ADM.cjs +0 -25
  432. package/dist/chunk-IKMR2ADM.cjs.map +0 -1
  433. package/dist/chunk-JHPFOG2N.cjs.map +0 -1
  434. package/dist/chunk-K7IGBNZA.cjs.map +0 -1
  435. package/dist/chunk-LEMY57MI.js +0 -3
  436. package/dist/chunk-MPOWJVV4.js.map +0 -1
  437. package/dist/chunk-NINI4WVS.cjs.map +0 -1
  438. package/dist/chunk-OKBR6PX4.js +0 -23
  439. package/dist/chunk-OKBR6PX4.js.map +0 -1
  440. package/dist/chunk-OYKS2JBB.cjs.map +0 -1
  441. package/dist/chunk-QVJBUWJQ.js.map +0 -1
  442. package/dist/chunk-R25H4N4Z.js.map +0 -1
  443. package/dist/chunk-V2DF2GUE.js +0 -3
  444. package/dist/chunk-WFS6R2F5.js.map +0 -1
  445. package/dist/ozwell.cjs +0 -385
  446. package/dist/ozwell.cjs.map +0 -1
  447. package/dist/ozwell.d.cts +0 -15
  448. package/dist/ozwell.d.ts +0 -15
  449. package/dist/ozwell.js +0 -360
  450. package/dist/ozwell.js.map +0 -1
@@ -0,0 +1,1373 @@
1
+ 'use strict';
2
+
3
+ var chunkJFLC7SHM_cjs = require('../../chunk-JFLC7SHM.cjs');
4
+ var chunkIWDQPSJN_cjs = require('../../chunk-IWDQPSJN.cjs');
5
+ var chunkMAMY5HTT_cjs = require('../../chunk-MAMY5HTT.cjs');
6
+ var chunkMZPF2QGM_cjs = require('../../chunk-MZPF2QGM.cjs');
7
+ require('../../chunk-LOTMAKUG.cjs');
8
+ var chunkFQ3UCZUX_cjs = require('../../chunk-FQ3UCZUX.cjs');
9
+ require('../../chunk-VBWRH4UW.cjs');
10
+ require('../../chunk-MSRU3XBH.cjs');
11
+ var chunkEL2RSQTJ_cjs = require('../../chunk-EL2RSQTJ.cjs');
12
+ require('../../chunk-FHY3K6PL.cjs');
13
+ require('../../chunk-FSGEDDF2.cjs');
14
+ require('../../chunk-ZDEYV373.cjs');
15
+ var chunkOR5DRJCW_cjs = require('../../chunk-OR5DRJCW.cjs');
16
+ var React4 = require('react');
17
+ var Markdown = require('react-markdown');
18
+ var remarkGfm = require('remark-gfm');
19
+ var rehypeSanitize = require('rehype-sanitize');
20
+ var jsxRuntime = require('react/jsx-runtime');
21
+ var classVarianceAuthority = require('class-variance-authority');
22
+ var lucideReact = require('lucide-react');
23
+ var reactVirtual = require('@tanstack/react-virtual');
24
+
25
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
26
+
27
+ function _interopNamespace(e) {
28
+ if (e && e.__esModule) return e;
29
+ var n = Object.create(null);
30
+ if (e) {
31
+ Object.keys(e).forEach(function (k) {
32
+ if (k !== 'default') {
33
+ var d = Object.getOwnPropertyDescriptor(e, k);
34
+ Object.defineProperty(n, k, d.get ? d : {
35
+ enumerable: true,
36
+ get: function () { return e[k]; }
37
+ });
38
+ }
39
+ });
40
+ }
41
+ n.default = e;
42
+ return Object.freeze(n);
43
+ }
44
+
45
+ var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
46
+ var Markdown__default = /*#__PURE__*/_interopDefault(Markdown);
47
+ var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
48
+ var rehypeSanitize__default = /*#__PURE__*/_interopDefault(rehypeSanitize);
49
+
50
+ function remarkPreserveLineBreaks() {
51
+ const splitNode = (node) => {
52
+ if (!node.children) return;
53
+ const next = [];
54
+ for (const child of node.children) {
55
+ if (child.type === "text" && child.value && child.value.includes("\n")) {
56
+ const segments = child.value.split("\n");
57
+ segments.forEach((segment, i) => {
58
+ if (i > 0) next.push({ type: "break" });
59
+ if (segment) next.push({ type: "text", value: segment });
60
+ });
61
+ } else {
62
+ splitNode(child);
63
+ next.push(child);
64
+ }
65
+ }
66
+ node.children = next;
67
+ };
68
+ return (tree) => splitNode(tree);
69
+ }
70
+ function baseSanitizeSchema() {
71
+ const schema = JSON.parse(JSON.stringify(rehypeSanitize.defaultSchema));
72
+ const attributes = schema.attributes ?? {};
73
+ const allowClass = (tag) => {
74
+ const existing = attributes[tag] ?? [];
75
+ const withoutClass = existing.filter(
76
+ (a) => !(Array.isArray(a) && a[0] === "className")
77
+ );
78
+ attributes[tag] = [...withoutClass, "className"];
79
+ };
80
+ allowClass("code");
81
+ allowClass("pre");
82
+ allowClass("span");
83
+ allowClass("div");
84
+ schema.attributes = attributes;
85
+ return schema;
86
+ }
87
+ function mergeSanitizeSchema(base, extra) {
88
+ if (!extra) return base;
89
+ const out = { ...base };
90
+ if (Array.isArray(extra.tagNames)) {
91
+ const a = base.tagNames ?? [];
92
+ out.tagNames = Array.from(/* @__PURE__ */ new Set([...a, ...extra.tagNames]));
93
+ }
94
+ if (extra.attributes && typeof extra.attributes === "object") {
95
+ const baseAttrs = {
96
+ ...base.attributes ?? {}
97
+ };
98
+ for (const [tag, attrs] of Object.entries(
99
+ extra.attributes
100
+ )) {
101
+ baseAttrs[tag] = [...baseAttrs[tag] ?? [], ...attrs];
102
+ }
103
+ out.attributes = baseAttrs;
104
+ }
105
+ if (extra.protocols && typeof extra.protocols === "object") {
106
+ const baseProtocols = {
107
+ ...base.protocols ?? {}
108
+ };
109
+ for (const [attr, protocols] of Object.entries(
110
+ extra.protocols
111
+ )) {
112
+ baseProtocols[attr] = Array.from(
113
+ /* @__PURE__ */ new Set([...baseProtocols[attr] ?? [], ...protocols])
114
+ );
115
+ }
116
+ out.protocols = baseProtocols;
117
+ }
118
+ for (const [k, v] of Object.entries(extra)) {
119
+ if (k === "tagNames" || k === "attributes" || k === "protocols") continue;
120
+ out[k] = v;
121
+ }
122
+ return out;
123
+ }
124
+ function baseComponents() {
125
+ return {
126
+ a: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
127
+ "a",
128
+ {
129
+ ...props,
130
+ className: chunkOR5DRJCW_cjs.cn(
131
+ "text-primary-800 hover:text-primary-900 dark:text-primary-300 underline underline-offset-2",
132
+ props.className
133
+ ),
134
+ target: props.target ?? "_blank",
135
+ rel: props.rel ?? "noopener noreferrer",
136
+ children
137
+ }
138
+ ),
139
+ pre: ({ node: _node, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
140
+ "pre",
141
+ {
142
+ ...props,
143
+ tabIndex: 0,
144
+ className: chunkOR5DRJCW_cjs.cn(
145
+ "overflow-x-auto rounded-lg bg-neutral-900 p-3 text-sm text-neutral-100 dark:bg-neutral-950",
146
+ props.className
147
+ )
148
+ }
149
+ ),
150
+ code: ({ node: _node, ...props }) => {
151
+ const isBlock = typeof props.className === "string" && props.className.includes("language-");
152
+ return /* @__PURE__ */ jsxRuntime.jsx(
153
+ "code",
154
+ {
155
+ ...props,
156
+ className: chunkOR5DRJCW_cjs.cn(
157
+ !isBlock && "rounded bg-neutral-200 px-1 py-0.5 text-[0.85em] text-neutral-800 dark:bg-neutral-700 dark:text-neutral-100",
158
+ props.className
159
+ )
160
+ }
161
+ );
162
+ },
163
+ input: ({ node: _node, ...props }) => {
164
+ if (props.type === "checkbox") {
165
+ return /* @__PURE__ */ jsxRuntime.jsx(
166
+ "input",
167
+ {
168
+ ...props,
169
+ "aria-label": props["aria-label"] ?? (props["aria-labelledby"] ? void 0 : "Task list item")
170
+ }
171
+ );
172
+ }
173
+ return /* @__PURE__ */ jsxRuntime.jsx("input", { ...props });
174
+ },
175
+ table: ({ node: _node, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-2 overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
176
+ "table",
177
+ {
178
+ ...props,
179
+ className: chunkOR5DRJCW_cjs.cn(
180
+ "w-full border-collapse text-sm [&_td]:border [&_td]:border-neutral-200 [&_td]:px-2 [&_td]:py-1 dark:[&_td]:border-neutral-700 [&_th]:border [&_th]:border-neutral-200 [&_th]:px-2 [&_th]:py-1 [&_th]:text-left dark:[&_th]:border-neutral-700",
181
+ props.className
182
+ )
183
+ }
184
+ ) }),
185
+ // Tailwind's preflight resets list markers/padding; restore them explicitly
186
+ // so bullets/numbers show without depending on the typography plugin.
187
+ ul: ({ node: _node, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("ul", { ...props, className: chunkOR5DRJCW_cjs.cn("list-disc ps-5", props.className) }),
188
+ ol: ({ node: _node, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("ol", { ...props, className: chunkOR5DRJCW_cjs.cn("list-decimal ps-5", props.className) }),
189
+ li: ({ node: _node, ...props }) => /* @__PURE__ */ jsxRuntime.jsx("li", { ...props, className: chunkOR5DRJCW_cjs.cn("ps-1", props.className) }),
190
+ // Preflight also flattens headings to body size/weight; restore a sensible
191
+ // hierarchy without depending on the typography plugin.
192
+ h1: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
193
+ "h1",
194
+ {
195
+ ...props,
196
+ className: chunkOR5DRJCW_cjs.cn("mt-3 mb-1 text-xl font-semibold", props.className),
197
+ children
198
+ }
199
+ ),
200
+ h2: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
201
+ "h2",
202
+ {
203
+ ...props,
204
+ className: chunkOR5DRJCW_cjs.cn("mt-3 mb-1 text-lg font-semibold", props.className),
205
+ children
206
+ }
207
+ ),
208
+ h3: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
209
+ "h3",
210
+ {
211
+ ...props,
212
+ className: chunkOR5DRJCW_cjs.cn("mt-2 mb-1 text-base font-semibold", props.className),
213
+ children
214
+ }
215
+ ),
216
+ h4: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
217
+ "h4",
218
+ {
219
+ ...props,
220
+ className: chunkOR5DRJCW_cjs.cn("mt-2 mb-1 text-sm font-semibold", props.className),
221
+ children
222
+ }
223
+ ),
224
+ h5: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
225
+ "h5",
226
+ {
227
+ ...props,
228
+ className: chunkOR5DRJCW_cjs.cn("mt-2 mb-1 text-sm font-semibold", props.className),
229
+ children
230
+ }
231
+ ),
232
+ h6: ({ node: _node, children, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
233
+ "h6",
234
+ {
235
+ ...props,
236
+ className: chunkOR5DRJCW_cjs.cn(
237
+ "mt-2 mb-1 text-xs font-semibold tracking-wide uppercase",
238
+ props.className
239
+ ),
240
+ children
241
+ }
242
+ ),
243
+ hr: ({ node: _node, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
244
+ "hr",
245
+ {
246
+ ...props,
247
+ className: chunkOR5DRJCW_cjs.cn(
248
+ "my-2 border-neutral-300 dark:border-neutral-600",
249
+ props.className
250
+ )
251
+ }
252
+ )
253
+ };
254
+ }
255
+ function createMarkdownRenderer(options = {}) {
256
+ const { plugins = [], trusted = false } = options;
257
+ const remarkPlugins = [
258
+ remarkGfm__default.default,
259
+ remarkPreserveLineBreaks,
260
+ ...plugins.flatMap((p) => p.remarkPlugins ?? [])
261
+ ];
262
+ const pluginRehype = plugins.flatMap(
263
+ (p) => p.rehypePlugins ?? []
264
+ );
265
+ const sanitizeSchema = plugins.reduce(
266
+ (acc, p) => mergeSanitizeSchema(acc, p.sanitizeSchema),
267
+ baseSanitizeSchema()
268
+ );
269
+ const rehypePlugins = trusted ? pluginRehype : [...pluginRehype, [rehypeSanitize__default.default, sanitizeSchema]];
270
+ const components = plugins.reduce(
271
+ (acc, p) => ({ ...acc, ...p.components }),
272
+ baseComponents()
273
+ );
274
+ const MarkdownRenderer = (text, ctx) => /* @__PURE__ */ jsxRuntime.jsx(
275
+ MarkdownContent,
276
+ {
277
+ text,
278
+ messageId: ctx.messageId,
279
+ streaming: ctx.streaming,
280
+ remarkPlugins,
281
+ rehypePlugins,
282
+ components
283
+ },
284
+ ctx.messageId
285
+ );
286
+ return MarkdownRenderer;
287
+ }
288
+ var transformUrl = (url, key, node) => {
289
+ if (key === "src" && node.tagName === "img" && (/^data:image\//i.test(url) || /^blob:/i.test(url))) {
290
+ return url;
291
+ }
292
+ return Markdown.defaultUrlTransform(url);
293
+ };
294
+ var MarkdownContent = React4__namespace.memo(function MarkdownContent2({
295
+ text,
296
+ messageId,
297
+ streaming,
298
+ remarkPlugins,
299
+ rehypePlugins,
300
+ components
301
+ }) {
302
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkJFLC7SHM_cjs.TextRenderContext.Provider, { value: { messageId, streaming }, children: /* @__PURE__ */ jsxRuntime.jsx(
303
+ Markdown__default.default,
304
+ {
305
+ remarkPlugins,
306
+ rehypePlugins,
307
+ urlTransform: transformUrl,
308
+ components,
309
+ children: text
310
+ }
311
+ ) });
312
+ });
313
+ function formatTime(time) {
314
+ return new Date(time).toLocaleTimeString(void 0, {
315
+ hour: "numeric",
316
+ minute: "2-digit"
317
+ });
318
+ }
319
+ function byTime(a, b) {
320
+ return new Date(a.time).getTime() - new Date(b.time).getTime();
321
+ }
322
+ function lastActivityOf(c) {
323
+ if (c.lastActivity) return new Date(c.lastActivity).getTime();
324
+ const last = lastMessageByTime(c.thread);
325
+ return last ? new Date(last.time).getTime() : 0;
326
+ }
327
+ function escapeRegExp(value) {
328
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
329
+ }
330
+ function detectMentions(text, participants) {
331
+ const ids = [];
332
+ for (const p of participants) {
333
+ if (p.kind === "system") continue;
334
+ const token = "@" + p.name.split(" ")[0];
335
+ const pattern = new RegExp(
336
+ `(?<![\\w@])${escapeRegExp(token)}(?![\\w])`,
337
+ "i"
338
+ );
339
+ if (pattern.test(text)) ids.push(p.id);
340
+ }
341
+ return ids;
342
+ }
343
+ function lastMessageByTime(thread) {
344
+ let latest;
345
+ let latestTime = -Infinity;
346
+ for (const message of thread) {
347
+ const t = new Date(message.time).getTime();
348
+ if (t >= latestTime) {
349
+ latest = message;
350
+ latestTime = t;
351
+ }
352
+ }
353
+ return latest;
354
+ }
355
+ function parseHexColor(value) {
356
+ const hex = value.trim();
357
+ if (!/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(hex)) return null;
358
+ const normalized = hex.length === 4 ? "#" + [...hex.slice(1)].map((char) => char + char).join("") : hex;
359
+ return [1, 3, 5].map(
360
+ (start) => parseInt(normalized.slice(start, start + 2), 16)
361
+ );
362
+ }
363
+ function relativeLuminanceChannel(channel) {
364
+ const normalized = channel / 255;
365
+ return normalized <= 0.03928 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
366
+ }
367
+ function relativeLuminance(value) {
368
+ const rgb = parseHexColor(value);
369
+ if (!rgb) return null;
370
+ const [red, green, blue] = rgb;
371
+ return 0.2126 * relativeLuminanceChannel(red) + 0.7152 * relativeLuminanceChannel(green) + 0.0722 * relativeLuminanceChannel(blue);
372
+ }
373
+ function contrastRatio(foreground, background) {
374
+ const foregroundLuminance = relativeLuminance(foreground);
375
+ const backgroundLuminance = relativeLuminance(background);
376
+ if (foregroundLuminance === null || backgroundLuminance === null) return null;
377
+ const lighter = Math.max(foregroundLuminance, backgroundLuminance);
378
+ const darker = Math.min(foregroundLuminance, backgroundLuminance);
379
+ return (lighter + 0.05) / (darker + 0.05);
380
+ }
381
+ function minimumContrastRatio(value, backgrounds) {
382
+ const contrasts = backgrounds.map((background) => contrastRatio(value, background)).filter((contrast) => contrast !== null);
383
+ if (contrasts.length !== backgrounds.length) return null;
384
+ return Math.min(...contrasts);
385
+ }
386
+ function accessibleAccentTextColor(value) {
387
+ if (!value) return void 0;
388
+ const contrast = minimumContrastRatio(value, ["#f5f5f5", "#262626"]);
389
+ if (contrast === null) return value;
390
+ return contrast < 4.5 ? void 0 : value;
391
+ }
392
+ function ParticipantAvatar({
393
+ participant
394
+ }) {
395
+ const isAgent = participant?.kind === "agent";
396
+ const backgroundColor = participant?.color ?? (isAgent ? "var(--mieweb-primary-700, #1f2937)" : "#64748b");
397
+ return /* @__PURE__ */ jsxRuntime.jsx(
398
+ chunkFQ3UCZUX_cjs.Avatar,
399
+ {
400
+ size: "xs",
401
+ src: participant?.avatar,
402
+ alt: "",
403
+ name: participant?.name ?? "?",
404
+ fallback: isAgent ? /* @__PURE__ */ jsxRuntime.jsx(chunkIWDQPSJN_cjs.SparklesIcon, { size: "sm" }) : void 0,
405
+ style: { backgroundColor },
406
+ "aria-hidden": "true",
407
+ className: "shrink-0"
408
+ }
409
+ );
410
+ }
411
+ function ReferenceChip({
412
+ reference,
413
+ linkBuilder,
414
+ onReferenceClick
415
+ }) {
416
+ const href = linkBuilder?.(reference);
417
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
418
+ /* @__PURE__ */ jsxRuntime.jsx(
419
+ chunkEL2RSQTJ_cjs.Badge,
420
+ {
421
+ variant: "default",
422
+ size: "sm",
423
+ className: "rounded px-1.5 text-[10px] font-semibold tracking-wide uppercase",
424
+ children: reference.refType
425
+ }
426
+ ),
427
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: reference.title })
428
+ ] });
429
+ const className = "inline-flex max-w-full items-center gap-2 rounded-lg border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-700 hover:border-primary-300 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200";
430
+ if (href) {
431
+ return /* @__PURE__ */ jsxRuntime.jsx(
432
+ "a",
433
+ {
434
+ href,
435
+ className,
436
+ onClick: () => onReferenceClick?.(reference),
437
+ children: content
438
+ }
439
+ );
440
+ }
441
+ return /* @__PURE__ */ jsxRuntime.jsx(
442
+ "button",
443
+ {
444
+ type: "button",
445
+ className,
446
+ onClick: () => onReferenceClick?.(reference),
447
+ children: content
448
+ }
449
+ );
450
+ }
451
+ var ATTACHMENT_KIND_CONFIG = {
452
+ image: { accept: "image/*", match: (t) => t.startsWith("image/") },
453
+ video: { accept: "video/*", match: (t) => t.startsWith("video/") },
454
+ audio: { accept: "audio/*", match: (t) => t.startsWith("audio/") },
455
+ pdf: { accept: "application/pdf", match: (t) => t === "application/pdf" }
456
+ };
457
+ var DEFAULT_ACCEPTED_FILE_TYPES = [
458
+ "image",
459
+ "video",
460
+ "audio",
461
+ "pdf"
462
+ ];
463
+ function acceptTokensFor(kinds = DEFAULT_ACCEPTED_FILE_TYPES) {
464
+ const source = kinds.length > 0 ? kinds : DEFAULT_ACCEPTED_FILE_TYPES;
465
+ return Array.from(
466
+ new Set(source.map((k) => ATTACHMENT_KIND_CONFIG[k].accept))
467
+ );
468
+ }
469
+ function filesToComposerAttachments(files) {
470
+ return Promise.all(
471
+ files.map(
472
+ (file, i) => new Promise((resolve, reject) => {
473
+ const reader = new window.FileReader();
474
+ reader.onload = () => {
475
+ const dataUrl = typeof reader.result === "string" ? reader.result : "";
476
+ resolve({
477
+ id: `att-${Date.now()}-${i}`,
478
+ name: file.name || `attachment-${i}`,
479
+ type: file.type || "application/octet-stream",
480
+ dataUrl
481
+ });
482
+ };
483
+ reader.onerror = () => reject(reader.error);
484
+ reader.readAsDataURL(file);
485
+ })
486
+ )
487
+ );
488
+ }
489
+ function CopyMenu({ isSelf, markdown, getHtml, getText }) {
490
+ const [open, setOpen] = React4__namespace.useState(false);
491
+ const [copied, setCopied] = React4__namespace.useState(false);
492
+ const copiedTimer = React4__namespace.useRef(
493
+ void 0
494
+ );
495
+ React4__namespace.useEffect(() => () => window.clearTimeout(copiedTimer.current), []);
496
+ const flash = () => {
497
+ setCopied(true);
498
+ window.clearTimeout(copiedTimer.current);
499
+ copiedTimer.current = setTimeout(() => setCopied(false), 1200);
500
+ };
501
+ const writeText = async (value) => {
502
+ if (!navigator.clipboard?.writeText) {
503
+ throw new Error("Clipboard API unavailable");
504
+ }
505
+ await navigator.clipboard.writeText(value);
506
+ };
507
+ const writeBoth = async () => {
508
+ const html = getHtml();
509
+ const text = markdown || getText();
510
+ try {
511
+ if (typeof window !== "undefined" && "ClipboardItem" in window && navigator.clipboard?.write) {
512
+ await navigator.clipboard.write([
513
+ new window.ClipboardItem({
514
+ "text/html": new Blob([html], { type: "text/html" }),
515
+ "text/plain": new Blob([text], { type: "text/plain" })
516
+ })
517
+ ]);
518
+ } else {
519
+ await writeText(text);
520
+ }
521
+ } catch {
522
+ await writeText(text);
523
+ }
524
+ };
525
+ const run = (fn) => {
526
+ setOpen(false);
527
+ void fn().then(flash, () => {
528
+ });
529
+ };
530
+ return /* @__PURE__ */ jsxRuntime.jsx(
531
+ "div",
532
+ {
533
+ className: chunkOR5DRJCW_cjs.cn(
534
+ "sticky bottom-2 shrink-0 self-end",
535
+ // Rich content (e.g. NITRO tables) layers internals up to z-50, so the
536
+ // open menu's stacking context must clear that.
537
+ open ? "z-[60]" : "z-10"
538
+ ),
539
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
540
+ chunkMZPF2QGM_cjs.Dropdown,
541
+ {
542
+ open,
543
+ onOpenChange: setOpen,
544
+ placement: isSelf ? "top-end" : "top-start",
545
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
546
+ "button",
547
+ {
548
+ type: "button",
549
+ "data-slot": "superchat-copy-button",
550
+ "aria-label": "Copy message",
551
+ className: "rounded p-1 text-neutral-400 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 hover:text-neutral-600 focus-visible:opacity-100 dark:hover:text-neutral-200",
552
+ children: copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { size: 14, "aria-hidden": "true" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clipboard, { size: 14, "aria-hidden": "true" })
553
+ }
554
+ ),
555
+ children: [
556
+ /* @__PURE__ */ jsxRuntime.jsx(chunkMZPF2QGM_cjs.DropdownItem, { onClick: () => run(writeBoth), children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex flex-col items-start", children: [
557
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Copy" }),
558
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-normal text-neutral-400", children: "Rich text + Markdown" })
559
+ ] }) }),
560
+ /* @__PURE__ */ jsxRuntime.jsx(
561
+ chunkMZPF2QGM_cjs.DropdownItem,
562
+ {
563
+ onClick: () => run(() => writeText(markdown || getText())),
564
+ children: "Copy as Markdown"
565
+ }
566
+ ),
567
+ /* @__PURE__ */ jsxRuntime.jsx(chunkMZPF2QGM_cjs.DropdownItem, { onClick: () => run(() => writeText(getText())), children: "Copy as plain text" })
568
+ ]
569
+ }
570
+ )
571
+ }
572
+ );
573
+ }
574
+ var MessageRow = React4__namespace.memo(function MessageRow2({
575
+ message,
576
+ participant,
577
+ isSelf,
578
+ renderText,
579
+ linkBuilder,
580
+ onReferenceClick,
581
+ editable,
582
+ onMessageEdited
583
+ }) {
584
+ const streaming = message.status === "streaming";
585
+ const hasBody = !!message.text || (message.content?.length ?? 0) > 0;
586
+ const [isEditing, setIsEditing] = React4__namespace.useState(false);
587
+ const [draft, setDraft] = React4__namespace.useState(message.text ?? "");
588
+ const editRef = React4__namespace.useRef(null);
589
+ const bubbleRef = React4__namespace.useRef(null);
590
+ const autosize = React4__namespace.useCallback(() => {
591
+ const el = editRef.current;
592
+ if (!el) return;
593
+ el.style.height = "auto";
594
+ el.style.height = `${el.scrollHeight}px`;
595
+ }, []);
596
+ React4__namespace.useEffect(() => {
597
+ if (!isEditing) return;
598
+ const el = editRef.current;
599
+ if (!el) return;
600
+ el.focus();
601
+ el.setSelectionRange(el.value.length, el.value.length);
602
+ autosize();
603
+ }, [isEditing, autosize]);
604
+ if (message.type === "system") {
605
+ return /* @__PURE__ */ jsxRuntime.jsx(
606
+ "div",
607
+ {
608
+ "data-slot": "superchat-system-message",
609
+ role: "status",
610
+ className: "my-1 text-center text-xs text-neutral-500 dark:text-neutral-400",
611
+ children: message.text
612
+ }
613
+ );
614
+ }
615
+ if (message.type === "ref" && message.ref) {
616
+ return /* @__PURE__ */ jsxRuntime.jsx(
617
+ "div",
618
+ {
619
+ "data-slot": "superchat-reference",
620
+ className: chunkOR5DRJCW_cjs.cn("flex", isSelf && "justify-end"),
621
+ children: /* @__PURE__ */ jsxRuntime.jsx(
622
+ ReferenceChip,
623
+ {
624
+ reference: message.ref,
625
+ linkBuilder,
626
+ onReferenceClick
627
+ }
628
+ )
629
+ }
630
+ );
631
+ }
632
+ const accent = participant?.color;
633
+ const accentTextColor = accessibleAccentTextColor(accent);
634
+ const authorName = participant?.name ?? "Unknown";
635
+ const canEdit = !!editable && isSelf && !streaming && typeof message.text === "string" && !message.content?.length;
636
+ const startEdit = () => {
637
+ setDraft(message.text ?? "");
638
+ setIsEditing(true);
639
+ };
640
+ const cancelEdit = () => setIsEditing(false);
641
+ const saveEdit = () => {
642
+ const next = draft.trim();
643
+ if (next && next !== message.text) onMessageEdited?.(message.id, next);
644
+ setIsEditing(false);
645
+ };
646
+ const handleEditPaste = (e) => {
647
+ const files = Array.from(e.clipboardData.items).filter((item) => item.kind === "file" && item.type.startsWith("image/")).map((item) => item.getAsFile()).filter((f) => f !== null);
648
+ if (files.length === 0) return;
649
+ e.preventDefault();
650
+ const el = e.currentTarget;
651
+ const start = el.selectionStart ?? draft.length;
652
+ const end = el.selectionEnd ?? draft.length;
653
+ Promise.all(
654
+ files.map(
655
+ (file, i) => new Promise((resolve) => {
656
+ const reader = new window.FileReader();
657
+ reader.onload = () => {
658
+ const dataUrl = typeof reader.result === "string" ? reader.result : "";
659
+ const name = file.name || `pasted-image-${i + 1}.png`;
660
+ resolve(dataUrl ? `![${name}](${dataUrl})` : "");
661
+ };
662
+ reader.readAsDataURL(file);
663
+ })
664
+ )
665
+ ).then((snippets) => {
666
+ const insert = snippets.filter(Boolean).join("\n");
667
+ if (!insert) return;
668
+ el.focus();
669
+ el.setSelectionRange(start, end);
670
+ const text = `${insert}
671
+ `;
672
+ const inserted = typeof document !== "undefined" && typeof document.execCommand === "function" && document.execCommand("insertText", false, text);
673
+ if (!inserted) {
674
+ setDraft((prev) => `${prev.slice(0, start)}${text}${prev.slice(end)}`);
675
+ }
676
+ requestAnimationFrame(autosize);
677
+ });
678
+ };
679
+ const markdownSource = typeof message.text === "string" && message.text ? message.text : message.content?.map((block) => {
680
+ if (block.type === "code" && block.text) {
681
+ return `\`\`\`${block.language ?? ""}
682
+ ${block.text}
683
+ \`\`\``;
684
+ }
685
+ if ((block.type === "text" || block.type === "thinking") && block.text) {
686
+ return block.text;
687
+ }
688
+ return "";
689
+ }).filter(Boolean).join("\n\n") ?? "";
690
+ const canCopy = !isEditing && (!!message.content?.length || typeof message.text === "string" && message.text.length > 0);
691
+ return /* @__PURE__ */ jsxRuntime.jsxs(
692
+ "div",
693
+ {
694
+ "data-slot": "superchat-message",
695
+ role: "article",
696
+ "aria-label": `${authorName}, ${formatTime(message.time)}`,
697
+ className: chunkOR5DRJCW_cjs.cn(
698
+ "group flex gap-2",
699
+ isSelf ? "flex-row-reverse" : "flex-row"
700
+ ),
701
+ children: [
702
+ /* @__PURE__ */ jsxRuntime.jsx(ParticipantAvatar, { participant }),
703
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkOR5DRJCW_cjs.cn("flex min-w-0 flex-col gap-1", isSelf && "items-end"), children: [
704
+ /* @__PURE__ */ jsxRuntime.jsxs(
705
+ "div",
706
+ {
707
+ "data-slot": "superchat-message-meta",
708
+ className: "flex items-baseline gap-2",
709
+ children: [
710
+ /* @__PURE__ */ jsxRuntime.jsx(
711
+ "span",
712
+ {
713
+ className: "text-xs font-medium",
714
+ style: accentTextColor ? { color: accentTextColor } : void 0,
715
+ children: authorName
716
+ }
717
+ ),
718
+ participant?.role && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: participant.role }),
719
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-neutral-500 dark:text-neutral-400", children: formatTime(message.time) }),
720
+ message.editedAt && /* @__PURE__ */ jsxRuntime.jsx(
721
+ "span",
722
+ {
723
+ "data-slot": "superchat-edited-indicator",
724
+ className: "text-[10px] text-neutral-500 dark:text-neutral-400",
725
+ title: `Edited ${formatTime(message.editedAt)}`,
726
+ children: "(edited)"
727
+ }
728
+ ),
729
+ canEdit && !isEditing && /* @__PURE__ */ jsxRuntime.jsx(
730
+ "button",
731
+ {
732
+ type: "button",
733
+ "data-slot": "superchat-edit-button",
734
+ onClick: startEdit,
735
+ "aria-label": "Edit message",
736
+ className: "rounded p-0.5 text-neutral-400 opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 hover:text-neutral-600 focus-visible:opacity-100 dark:hover:text-neutral-200",
737
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { size: 14, "aria-hidden": "true" })
738
+ }
739
+ )
740
+ ]
741
+ }
742
+ ),
743
+ /* @__PURE__ */ jsxRuntime.jsxs(
744
+ "div",
745
+ {
746
+ className: chunkOR5DRJCW_cjs.cn(
747
+ "flex items-center gap-1",
748
+ isSelf ? "flex-row-reverse" : "flex-row"
749
+ ),
750
+ children: [
751
+ canCopy && /* @__PURE__ */ jsxRuntime.jsx(
752
+ CopyMenu,
753
+ {
754
+ isSelf,
755
+ markdown: markdownSource,
756
+ getHtml: () => bubbleRef.current?.innerHTML ?? "",
757
+ getText: () => bubbleRef.current?.textContent ?? ""
758
+ }
759
+ ),
760
+ /* @__PURE__ */ jsxRuntime.jsx(
761
+ chunkIWDQPSJN_cjs.ChatBubble,
762
+ {
763
+ ref: bubbleRef,
764
+ "data-slot": "superchat-bubble",
765
+ variant: isSelf ? "user" : "assistant",
766
+ hasError: message.status === "error",
767
+ className: "text-sm has-[[data-slot=superchat-nitro-table]]:w-full has-[[data-slot=superchat-nitro-table]]:max-w-full",
768
+ children: isEditing ? /* @__PURE__ */ jsxRuntime.jsxs(
769
+ "div",
770
+ {
771
+ "data-slot": "superchat-message-editor",
772
+ className: "flex w-80 max-w-full flex-col gap-2",
773
+ children: [
774
+ /* @__PURE__ */ jsxRuntime.jsx(
775
+ "textarea",
776
+ {
777
+ value: draft,
778
+ ref: editRef,
779
+ rows: 2,
780
+ onChange: (e) => {
781
+ setDraft(e.target.value);
782
+ autosize();
783
+ },
784
+ onPaste: handleEditPaste,
785
+ onKeyDown: (e) => {
786
+ if (e.key === "Enter" && !e.shiftKey) {
787
+ e.preventDefault();
788
+ saveEdit();
789
+ } else if (e.key === "Escape") {
790
+ e.preventDefault();
791
+ cancelEdit();
792
+ }
793
+ },
794
+ "aria-label": "Edit message",
795
+ className: "focus:ring-primary-500 max-h-60 min-h-16 w-full resize-none rounded-lg border border-neutral-300 bg-white px-3 py-2 text-sm text-neutral-900 focus:ring-1 focus:outline-none dark:border-neutral-600 dark:bg-neutral-900 dark:text-white"
796
+ }
797
+ ),
798
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
799
+ /* @__PURE__ */ jsxRuntime.jsx(
800
+ "button",
801
+ {
802
+ type: "button",
803
+ onClick: cancelEdit,
804
+ className: "rounded-md px-2.5 py-1 text-xs font-medium text-neutral-200 hover:bg-white/10",
805
+ children: "Cancel"
806
+ }
807
+ ),
808
+ /* @__PURE__ */ jsxRuntime.jsx(
809
+ "button",
810
+ {
811
+ type: "button",
812
+ onClick: saveEdit,
813
+ disabled: !draft.trim() || draft.trim() === message.text,
814
+ className: "rounded-md bg-white px-2.5 py-1 text-xs font-medium text-neutral-900 hover:bg-neutral-100 disabled:opacity-40",
815
+ children: "Save"
816
+ }
817
+ )
818
+ ] })
819
+ ]
820
+ }
821
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
822
+ message.content?.map((block, i) => {
823
+ if (block.type === "tool_use" && block.toolCall) {
824
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkIWDQPSJN_cjs.MCPToolCallDisplay, { toolCall: block.toolCall }, i);
825
+ }
826
+ if ((block.type === "text" || block.type === "thinking") && block.text) {
827
+ return /* @__PURE__ */ jsxRuntime.jsx(
828
+ "div",
829
+ {
830
+ className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
831
+ children: renderText(block.text, {
832
+ messageId: message.id,
833
+ streaming,
834
+ role: participant?.kind === "human" ? "user" : "assistant"
835
+ })
836
+ },
837
+ i
838
+ );
839
+ }
840
+ if (block.type === "code" && block.text) {
841
+ const fenced = `\`\`\`${block.language ?? ""}
842
+ ${block.text}
843
+ \`\`\``;
844
+ return /* @__PURE__ */ jsxRuntime.jsx(
845
+ "div",
846
+ {
847
+ className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word",
848
+ children: renderText(fenced, {
849
+ messageId: message.id,
850
+ streaming,
851
+ role: participant?.kind === "human" ? "user" : "assistant"
852
+ })
853
+ },
854
+ i
855
+ );
856
+ }
857
+ return null;
858
+ }),
859
+ message.text && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none **:wrap-break-word", children: renderText(message.text, {
860
+ messageId: message.id,
861
+ streaming,
862
+ role: participant?.kind === "human" ? "user" : "assistant"
863
+ }) }),
864
+ streaming && !hasBody && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIWDQPSJN_cjs.AITypingIndicator, {}) })
865
+ ] })
866
+ }
867
+ )
868
+ ]
869
+ }
870
+ )
871
+ ] })
872
+ ]
873
+ }
874
+ );
875
+ });
876
+ var sidebarItem = classVarianceAuthority.cva(
877
+ "flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors",
878
+ {
879
+ variants: {
880
+ active: {
881
+ true: "bg-primary-100 text-primary-900 dark:bg-primary-900/40 dark:text-primary-100",
882
+ false: "text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800"
883
+ }
884
+ },
885
+ defaultVariants: { active: false }
886
+ }
887
+ );
888
+ function VirtualThread({
889
+ items,
890
+ participantById,
891
+ currentParticipantId,
892
+ renderText,
893
+ linkBuilder,
894
+ onReferenceClick,
895
+ editable,
896
+ onMessageEdited,
897
+ order,
898
+ conversationId,
899
+ containerProps
900
+ }) {
901
+ const parentRef = React4__namespace.useRef(null);
902
+ const virtualizer = reactVirtual.useVirtualizer({
903
+ count: items.length,
904
+ getScrollElement: () => parentRef.current,
905
+ // Rough first guess; real heights are measured via measureElement.
906
+ estimateSize: () => 88,
907
+ overscan: 10,
908
+ getItemKey: (index) => items[index]?.id ?? index
909
+ });
910
+ const count = items.length;
911
+ React4__namespace.useEffect(() => {
912
+ if (count === 0) return;
913
+ if (order === "desc") {
914
+ virtualizer.scrollToIndex(0, { align: "start" });
915
+ } else {
916
+ virtualizer.scrollToIndex(count - 1, { align: "end" });
917
+ }
918
+ }, [count, conversationId, order]);
919
+ const virtualItems = virtualizer.getVirtualItems();
920
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ...containerProps, ref: parentRef, children: /* @__PURE__ */ jsxRuntime.jsx(
921
+ "div",
922
+ {
923
+ style: {
924
+ height: virtualizer.getTotalSize(),
925
+ position: "relative",
926
+ width: "100%"
927
+ },
928
+ children: virtualItems.map((virtualRow) => {
929
+ const message = items[virtualRow.index];
930
+ if (!message) return null;
931
+ return /* @__PURE__ */ jsxRuntime.jsx(
932
+ "div",
933
+ {
934
+ "data-index": virtualRow.index,
935
+ ref: virtualizer.measureElement,
936
+ style: {
937
+ position: "absolute",
938
+ top: 0,
939
+ left: 0,
940
+ width: "100%",
941
+ transform: `translateY(${virtualRow.start}px)`
942
+ },
943
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pb-4", children: /* @__PURE__ */ jsxRuntime.jsx(
944
+ MessageRow,
945
+ {
946
+ message,
947
+ participant: participantById.get(message.participantId),
948
+ isSelf: !!currentParticipantId && message.participantId === currentParticipantId,
949
+ renderText,
950
+ linkBuilder,
951
+ onReferenceClick,
952
+ editable,
953
+ onMessageEdited
954
+ }
955
+ ) })
956
+ },
957
+ virtualRow.key
958
+ );
959
+ })
960
+ }
961
+ ) });
962
+ }
963
+ function SuperChat({
964
+ conversation,
965
+ currentParticipantId,
966
+ renderPlugins,
967
+ renderTextContent,
968
+ trustedContent,
969
+ readOnly,
970
+ acceptedFileTypes,
971
+ order = "asc",
972
+ virtualized = false,
973
+ linkBuilder,
974
+ className,
975
+ onMessageSent,
976
+ onMessageEdited,
977
+ onConversationClosed,
978
+ onReferenceClick,
979
+ onBack
980
+ }) {
981
+ const headingId = React4__namespace.useId();
982
+ const renderText = React4__namespace.useMemo(
983
+ () => renderTextContent ?? createMarkdownRenderer({
984
+ plugins: renderPlugins,
985
+ trusted: trustedContent
986
+ }),
987
+ [renderTextContent, renderPlugins, trustedContent]
988
+ );
989
+ const threadRef = React4__namespace.useRef(null);
990
+ React4__namespace.useEffect(() => {
991
+ if (virtualized) return;
992
+ const el = threadRef.current;
993
+ if (!el) return;
994
+ el.scrollTop = order === "desc" ? 0 : el.scrollHeight;
995
+ }, [conversation.thread.length, conversation.id, order, virtualized]);
996
+ const participantById = React4__namespace.useMemo(() => {
997
+ const map = /* @__PURE__ */ new Map();
998
+ conversation.participants.forEach((p) => map.set(p.id, p));
999
+ return map;
1000
+ }, [conversation]);
1001
+ const orderedThread = React4__namespace.useMemo(() => {
1002
+ const sorted = [...conversation.thread].sort(byTime);
1003
+ return order === "desc" ? sorted.reverse() : sorted;
1004
+ }, [conversation, order]);
1005
+ const onMessageEditedRef = React4__namespace.useRef(onMessageEdited);
1006
+ onMessageEditedRef.current = onMessageEdited;
1007
+ const conversationRef = React4__namespace.useRef(conversation);
1008
+ conversationRef.current = conversation;
1009
+ const handleMessageEdited = React4__namespace.useCallback(
1010
+ (messageId, text) => {
1011
+ onMessageEditedRef.current?.(messageId, text, {
1012
+ conversation: conversationRef.current
1013
+ });
1014
+ },
1015
+ []
1016
+ );
1017
+ const editable = !readOnly && !!onMessageEdited;
1018
+ const mentionOptions = React4__namespace.useMemo(
1019
+ () => conversation.participants.filter((p) => p.kind !== "system").map((p) => ({
1020
+ id: p.id,
1021
+ label: p.name,
1022
+ description: p.role,
1023
+ meta: p.kind,
1024
+ icon: /* @__PURE__ */ jsxRuntime.jsx(ParticipantAvatar, { participant: p })
1025
+ })),
1026
+ [conversation.participants]
1027
+ );
1028
+ const composerAccept = React4__namespace.useMemo(
1029
+ () => acceptTokensFor(acceptedFileTypes),
1030
+ [acceptedFileTypes]
1031
+ );
1032
+ const handleComposerSend = React4__namespace.useCallback(
1033
+ async (message) => {
1034
+ const text = message.content;
1035
+ const mentions = detectMentions(text, conversation.participants);
1036
+ const attachments = await filesToComposerAttachments(
1037
+ message.attachments ?? []
1038
+ );
1039
+ onMessageSent?.(text, { conversation, mentions, attachments });
1040
+ },
1041
+ [conversation, onMessageSent]
1042
+ );
1043
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1044
+ "section",
1045
+ {
1046
+ "data-slot": "superchat",
1047
+ role: "group",
1048
+ "aria-labelledby": headingId,
1049
+ className: chunkOR5DRJCW_cjs.cn(
1050
+ "flex min-w-0 flex-1 flex-col bg-white dark:bg-neutral-900",
1051
+ className
1052
+ ),
1053
+ children: [
1054
+ /* @__PURE__ */ jsxRuntime.jsxs(
1055
+ "header",
1056
+ {
1057
+ "data-slot": "superchat-header",
1058
+ className: "flex items-center justify-between gap-2 border-b border-neutral-200 p-3 dark:border-neutral-700",
1059
+ children: [
1060
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
1061
+ onBack && /* @__PURE__ */ jsxRuntime.jsx(
1062
+ "button",
1063
+ {
1064
+ type: "button",
1065
+ onClick: onBack,
1066
+ "aria-label": "Back to conversations",
1067
+ className: "-ml-1 shrink-0 rounded-md p-1 text-neutral-500 hover:bg-neutral-100 sm:hidden dark:text-neutral-300 dark:hover:bg-neutral-800",
1068
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1069
+ "svg",
1070
+ {
1071
+ viewBox: "0 0 24 24",
1072
+ width: "20",
1073
+ height: "20",
1074
+ fill: "none",
1075
+ stroke: "currentColor",
1076
+ strokeWidth: "2",
1077
+ strokeLinecap: "round",
1078
+ strokeLinejoin: "round",
1079
+ "aria-hidden": "true",
1080
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m15 18-6-6 6-6" })
1081
+ }
1082
+ )
1083
+ }
1084
+ ),
1085
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
1086
+ /* @__PURE__ */ jsxRuntime.jsx(
1087
+ "h2",
1088
+ {
1089
+ id: headingId,
1090
+ className: "truncate text-sm font-semibold text-neutral-800 dark:text-neutral-100",
1091
+ children: conversation.title
1092
+ }
1093
+ ),
1094
+ /* @__PURE__ */ jsxRuntime.jsx(
1095
+ "div",
1096
+ {
1097
+ "data-slot": "superchat-participants",
1098
+ role: "group",
1099
+ "aria-label": "Participants",
1100
+ className: "mt-0.5 flex items-center gap-1",
1101
+ children: conversation.participants.slice(0, 6).map((p) => /* @__PURE__ */ jsxRuntime.jsx("span", { role: "img", "aria-label": p.name, children: /* @__PURE__ */ jsxRuntime.jsx(ParticipantAvatar, { participant: p }) }, p.id))
1102
+ }
1103
+ )
1104
+ ] })
1105
+ ] }),
1106
+ onConversationClosed && /* @__PURE__ */ jsxRuntime.jsx(
1107
+ "button",
1108
+ {
1109
+ type: "button",
1110
+ onClick: () => onConversationClosed(conversation),
1111
+ "aria-label": "Close conversation",
1112
+ className: "rounded-md p-1 text-neutral-400 hover:bg-neutral-100 dark:hover:bg-neutral-800",
1113
+ children: /* @__PURE__ */ jsxRuntime.jsx(chunkIWDQPSJN_cjs.CloseIcon, {})
1114
+ }
1115
+ )
1116
+ ]
1117
+ }
1118
+ ),
1119
+ virtualized ? /* @__PURE__ */ jsxRuntime.jsx(
1120
+ VirtualThread,
1121
+ {
1122
+ items: orderedThread,
1123
+ participantById,
1124
+ currentParticipantId,
1125
+ renderText,
1126
+ linkBuilder,
1127
+ onReferenceClick,
1128
+ editable,
1129
+ onMessageEdited: handleMessageEdited,
1130
+ order,
1131
+ conversationId: conversation.id,
1132
+ containerProps: {
1133
+ "data-slot": "superchat-thread",
1134
+ role: "log",
1135
+ "aria-label": "Messages",
1136
+ "aria-live": "polite",
1137
+ // Focusable so keyboard-only users can scroll the message history.
1138
+ tabIndex: 0,
1139
+ className: "flex-1 overflow-y-auto p-4"
1140
+ }
1141
+ }
1142
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1143
+ "div",
1144
+ {
1145
+ "data-slot": "superchat-thread",
1146
+ ref: threadRef,
1147
+ role: "log",
1148
+ "aria-label": "Messages",
1149
+ "aria-live": "polite",
1150
+ tabIndex: 0,
1151
+ className: "flex-1 space-y-4 overflow-y-auto p-4",
1152
+ children: orderedThread.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
1153
+ MessageRow,
1154
+ {
1155
+ message: m,
1156
+ participant: participantById.get(m.participantId),
1157
+ isSelf: !!currentParticipantId && m.participantId === currentParticipantId,
1158
+ renderText,
1159
+ linkBuilder,
1160
+ onReferenceClick,
1161
+ editable,
1162
+ onMessageEdited: handleMessageEdited
1163
+ },
1164
+ m.id
1165
+ ))
1166
+ }
1167
+ ),
1168
+ /* @__PURE__ */ jsxRuntime.jsx(
1169
+ chunkMAMY5HTT_cjs.MessageComposer,
1170
+ {
1171
+ onSend: handleComposerSend,
1172
+ disabled: readOnly,
1173
+ placeholder: readOnly ? "Read-only conversation" : "Type a message\u2026 use @ to address an agent",
1174
+ mentionOptions,
1175
+ showAttachmentPicker: !readOnly,
1176
+ showCameraButton: false,
1177
+ acceptedFileTypes: composerAccept,
1178
+ maxLength: 1e5
1179
+ }
1180
+ )
1181
+ ]
1182
+ }
1183
+ );
1184
+ }
1185
+ function SuperChatConversations({
1186
+ conversations,
1187
+ activeConversationId,
1188
+ defaultActiveConversationId,
1189
+ className,
1190
+ onConversationOpened,
1191
+ onNewConversation
1192
+ }) {
1193
+ const [internalActive, setInternalActive] = React4__namespace.useState(
1194
+ defaultActiveConversationId ?? conversations[0]?.id
1195
+ );
1196
+ const requestedId = activeConversationId ?? internalActive;
1197
+ const activeId = conversations.some((c) => c.id === requestedId) ? requestedId : conversations[0]?.id;
1198
+ const sortedConversations = React4__namespace.useMemo(
1199
+ () => [...conversations].sort((a, b) => lastActivityOf(b) - lastActivityOf(a)),
1200
+ [conversations]
1201
+ );
1202
+ const selectConversation = (c) => {
1203
+ if (activeConversationId === void 0) setInternalActive(c.id);
1204
+ onConversationOpened?.(c);
1205
+ };
1206
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1207
+ "aside",
1208
+ {
1209
+ "data-slot": "superchat-conversations",
1210
+ "aria-label": "Conversations",
1211
+ className: chunkOR5DRJCW_cjs.cn(
1212
+ "flex w-64 shrink-0 flex-col border-r border-neutral-200 dark:border-neutral-700",
1213
+ className
1214
+ ),
1215
+ children: [
1216
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
1217
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-neutral-700 dark:text-neutral-200", children: "Conversations" }),
1218
+ onNewConversation && /* @__PURE__ */ jsxRuntime.jsx(
1219
+ "button",
1220
+ {
1221
+ type: "button",
1222
+ onClick: onNewConversation,
1223
+ "aria-label": "New conversation",
1224
+ className: "rounded-md px-2 py-1 text-lg leading-none text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",
1225
+ children: "+"
1226
+ }
1227
+ )
1228
+ ] }),
1229
+ /* @__PURE__ */ jsxRuntime.jsx(
1230
+ "div",
1231
+ {
1232
+ "data-slot": "superchat-conversation-list",
1233
+ role: "list",
1234
+ className: "flex-1 space-y-1 overflow-y-auto px-2 pb-2",
1235
+ children: sortedConversations.map((c) => {
1236
+ const last = lastMessageByTime(c.thread);
1237
+ const isActive = c.id === activeId;
1238
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "listitem", children: /* @__PURE__ */ jsxRuntime.jsxs(
1239
+ "button",
1240
+ {
1241
+ type: "button",
1242
+ "aria-current": isActive ? "true" : void 0,
1243
+ onClick: () => selectConversation(c),
1244
+ className: sidebarItem({ active: isActive }),
1245
+ children: [
1246
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex-1 truncate", children: [
1247
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate font-medium", children: c.title }),
1248
+ last?.text && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block truncate text-xs text-neutral-600 dark:text-neutral-400", children: last.text })
1249
+ ] }),
1250
+ !!c.unread && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "bg-primary-600 ml-1 inline-flex h-5 min-w-5 items-center justify-center rounded-full px-1.5 text-[10px] font-semibold text-white", children: [
1251
+ c.unread,
1252
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: " unread messages" })
1253
+ ] })
1254
+ ]
1255
+ }
1256
+ ) }, c.id);
1257
+ })
1258
+ }
1259
+ )
1260
+ ]
1261
+ }
1262
+ );
1263
+ }
1264
+ function SuperChatInbox({
1265
+ conversations,
1266
+ activeConversationId,
1267
+ defaultActiveConversationId,
1268
+ currentParticipantId,
1269
+ renderPlugins,
1270
+ renderTextContent,
1271
+ trustedContent,
1272
+ readOnly,
1273
+ acceptedFileTypes,
1274
+ order,
1275
+ virtualized,
1276
+ showSidebar = true,
1277
+ linkBuilder,
1278
+ className,
1279
+ onMessageSent,
1280
+ onMessageEdited,
1281
+ onConversationOpened,
1282
+ onConversationClosed,
1283
+ onNewConversation,
1284
+ onReferenceClick
1285
+ }) {
1286
+ const [internalActive, setInternalActive] = React4__namespace.useState(
1287
+ defaultActiveConversationId ?? conversations[0]?.id
1288
+ );
1289
+ const requestedId = activeConversationId ?? internalActive;
1290
+ const active = conversations.find((c) => c.id === requestedId) ?? conversations[0];
1291
+ const activeId = active?.id;
1292
+ const [mobileView, setMobileView] = React4__namespace.useState("list");
1293
+ const handleOpen = (c) => {
1294
+ if (activeConversationId === void 0) setInternalActive(c.id);
1295
+ setMobileView("chat");
1296
+ onConversationOpened?.(c);
1297
+ };
1298
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1299
+ "div",
1300
+ {
1301
+ "data-slot": "superchat-inbox",
1302
+ role: "group",
1303
+ "aria-label": active ? `Chat: ${active.title}` : "Chat",
1304
+ className: chunkOR5DRJCW_cjs.cn(
1305
+ "flex h-full overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-700 dark:bg-neutral-900",
1306
+ className
1307
+ ),
1308
+ children: [
1309
+ showSidebar && /* @__PURE__ */ jsxRuntime.jsx(
1310
+ SuperChatConversations,
1311
+ {
1312
+ conversations,
1313
+ activeConversationId: activeId,
1314
+ onConversationOpened: handleOpen,
1315
+ onNewConversation,
1316
+ className: chunkOR5DRJCW_cjs.cn(
1317
+ "w-full sm:w-64",
1318
+ mobileView === "chat" && "hidden sm:flex"
1319
+ )
1320
+ }
1321
+ ),
1322
+ active ? /* @__PURE__ */ jsxRuntime.jsx(
1323
+ SuperChat,
1324
+ {
1325
+ conversation: active,
1326
+ currentParticipantId,
1327
+ renderPlugins,
1328
+ renderTextContent,
1329
+ trustedContent,
1330
+ readOnly,
1331
+ acceptedFileTypes,
1332
+ order,
1333
+ virtualized,
1334
+ linkBuilder,
1335
+ onMessageSent,
1336
+ onMessageEdited,
1337
+ onConversationClosed,
1338
+ onReferenceClick,
1339
+ onBack: showSidebar ? () => setMobileView("list") : void 0,
1340
+ className: chunkOR5DRJCW_cjs.cn(
1341
+ showSidebar && mobileView === "list" && "hidden sm:flex"
1342
+ )
1343
+ }
1344
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1345
+ "section",
1346
+ {
1347
+ "data-slot": "superchat",
1348
+ className: chunkOR5DRJCW_cjs.cn(
1349
+ "min-w-0 flex-1 items-center justify-center text-sm text-neutral-400",
1350
+ showSidebar && mobileView === "list" ? "hidden sm:flex" : "flex"
1351
+ ),
1352
+ children: "No conversation selected"
1353
+ }
1354
+ )
1355
+ ]
1356
+ }
1357
+ );
1358
+ }
1359
+
1360
+ Object.defineProperty(exports, "TextRenderContext", {
1361
+ enumerable: true,
1362
+ get: function () { return chunkJFLC7SHM_cjs.TextRenderContext; }
1363
+ });
1364
+ Object.defineProperty(exports, "useTextRenderContext", {
1365
+ enumerable: true,
1366
+ get: function () { return chunkJFLC7SHM_cjs.useTextRenderContext; }
1367
+ });
1368
+ exports.SuperChat = SuperChat;
1369
+ exports.SuperChatConversations = SuperChatConversations;
1370
+ exports.SuperChatInbox = SuperChatInbox;
1371
+ exports.createMarkdownRenderer = createMarkdownRenderer;
1372
+ //# sourceMappingURL=index.cjs.map
1373
+ //# sourceMappingURL=index.cjs.map