@xpert-ai/chatkit-ui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (611) hide show
  1. package/dist/app/assets/_baseUniq-Cjg58ynO.js +1 -0
  2. package/dist/app/assets/abap-CaHNU3KZ.js +1 -0
  3. package/dist/app/assets/abnf-D-YMXYdM.js +1 -0
  4. package/dist/app/assets/actionscript-CrHB5nA4.js +1 -0
  5. package/dist/app/assets/ada-Dv2nikaa.js +1 -0
  6. package/dist/app/assets/agda-DFaAW7Yp.js +1 -0
  7. package/dist/app/assets/al-CgiCJJan.js +1 -0
  8. package/dist/app/assets/antlr4-BtYcfzHN.js +1 -0
  9. package/dist/app/assets/apacheconf-CQ7_TaHr.js +1 -0
  10. package/dist/app/assets/apex-B4zhZGbX.js +1 -0
  11. package/dist/app/assets/apl-CYl9UMD4.js +1 -0
  12. package/dist/app/assets/applescript-CqOg5uaM.js +1 -0
  13. package/dist/app/assets/aql-g4FQmCtN.js +1 -0
  14. package/dist/app/assets/arc-Dg9GdpOd.js +1 -0
  15. package/dist/app/assets/architectureDiagram-Q4EWVU46-D_Hf6A9k.js +36 -0
  16. package/dist/app/assets/arduino-CLAoEDGh.js +1 -0
  17. package/dist/app/assets/arff-CkPQOMpJ.js +1 -0
  18. package/dist/app/assets/asciidoc-D6FBYhU4.js +1 -0
  19. package/dist/app/assets/asm6502-BNREQutf.js +1 -0
  20. package/dist/app/assets/asmatmel-AsGe04C5.js +1 -0
  21. package/dist/app/assets/aspnet-BowT6uwS.js +1 -0
  22. package/dist/app/assets/autohotkey-CYQjpY2v.js +1 -0
  23. package/dist/app/assets/autoit-DZuwPYYs.js +1 -0
  24. package/dist/app/assets/avisynth-BApmLDkf.js +1 -0
  25. package/dist/app/assets/avro-idl-DTdqv6Sr.js +1 -0
  26. package/dist/app/assets/{basic-B4YxRCle.js → bash-COtf9s5e.js} +1 -1
  27. package/dist/app/assets/basic-0Wk0Z9hh.js +1 -0
  28. package/dist/app/assets/batch-yLGV74r2.js +1 -0
  29. package/dist/app/assets/bbcode-gj0k8ZdD.js +1 -0
  30. package/dist/app/assets/bicep-BsCXg-ZU.js +1 -0
  31. package/dist/app/assets/birb-CrVXepVH.js +1 -0
  32. package/dist/app/assets/bison-CEkN9m61.js +1 -0
  33. package/dist/app/assets/blockDiagram-DXYQGD6D-Cxg7TJzM.js +132 -0
  34. package/dist/app/assets/bnf-BNo5FkNz.js +1 -0
  35. package/dist/app/assets/brainfuck-Be3VzThb.js +1 -0
  36. package/dist/app/assets/brightscript-DvlnFSog.js +1 -0
  37. package/dist/app/assets/bro-v-4Gv7xz.js +1 -0
  38. package/dist/app/assets/bsl-Ckf08F6h.js +1 -0
  39. package/dist/app/assets/c-DzIU03a7.js +1 -0
  40. package/dist/app/assets/c4Diagram-AHTNJAMY-ClK737fG.js +10 -0
  41. package/dist/app/assets/cfscript-BjMiAM6E.js +1 -0
  42. package/dist/app/assets/chaiscript-B43Wj-Sh.js +1 -0
  43. package/dist/app/assets/channel-SVZNtrjN.js +1 -0
  44. package/dist/app/assets/chunk-4BX2VUAB-CLpouVUP.js +1 -0
  45. package/dist/app/assets/chunk-4TB4RGXK-Bx935_8R.js +206 -0
  46. package/dist/app/assets/chunk-55IACEB6-BBvPym8v.js +1 -0
  47. package/dist/app/assets/chunk-EDXVE4YY-DjPOkQ8M.js +1 -0
  48. package/dist/app/assets/chunk-FMBD7UC4-DYYB_Z9z.js +15 -0
  49. package/dist/app/assets/chunk-OYMX7WX6-D6RNfja3.js +231 -0
  50. package/dist/app/assets/chunk-QZHKN3VN-C8ZgdC9O.js +1 -0
  51. package/dist/app/assets/chunk-YZCP3GAM-BBgDUOse.js +1 -0
  52. package/dist/app/assets/cil-B9ihzdF2.js +1 -0
  53. package/dist/app/assets/classDiagram-6PBFFD2Q-BiMmE_Ro.js +1 -0
  54. package/dist/app/assets/classDiagram-v2-HSJHXN6E-BiMmE_Ro.js +1 -0
  55. package/dist/app/assets/clike-CJh4oCgy.js +1 -0
  56. package/dist/app/assets/clojure-TlSbaE4l.js +1 -0
  57. package/dist/app/assets/clone-E2Stvins.js +1 -0
  58. package/dist/app/assets/cmake-BSn84SxA.js +1 -0
  59. package/dist/app/assets/cobol-CJ6-cTtI.js +1 -0
  60. package/dist/app/assets/coffeescript-stKJEoMv.js +1 -0
  61. package/dist/app/assets/concurnas-1ifwVnR3.js +1 -0
  62. package/dist/app/assets/coq-DVFU6UV7.js +1 -0
  63. package/dist/app/assets/core-Yh44uZBs.js +1 -0
  64. package/dist/app/assets/cose-bilkent-S5V4N54A-Dx7-_QHb.js +1 -0
  65. package/dist/app/assets/cpp-Zzzi5FD8.js +1 -0
  66. package/dist/app/assets/crystal-DDbZAA_E.js +1 -0
  67. package/dist/app/assets/csharp-BZcvKq6n.js +1 -0
  68. package/dist/app/assets/cshtml-9x1DpGIK.js +1 -0
  69. package/dist/app/assets/csp-D1hHVDgG.js +1 -0
  70. package/dist/app/assets/css-BFu7Iqqk.js +1 -0
  71. package/dist/app/assets/css-extras-COx1Ei_l.js +1 -0
  72. package/dist/app/assets/csv-D0CxHXjS.js +1 -0
  73. package/dist/app/assets/cypher-BsuAyRBu.js +1 -0
  74. package/dist/app/assets/cytoscape.esm-DkOyvmE4.js +321 -0
  75. package/dist/app/assets/d-CtjOdpDZ.js +1 -0
  76. package/dist/app/assets/dagre-KV5264BT-DjhJCF-B.js +4 -0
  77. package/dist/app/assets/dart-BN9c8RLX.js +1 -0
  78. package/dist/app/assets/dataweave-DzlUCFjQ.js +1 -0
  79. package/dist/app/assets/dax-D0KU-54t.js +1 -0
  80. package/dist/app/assets/defaultLocale-DX6XiGOO.js +1 -0
  81. package/dist/app/assets/dhall-BZJS2G5U.js +1 -0
  82. package/dist/app/assets/diagram-5BDNPKRD-DSws8TSr.js +10 -0
  83. package/dist/app/assets/diagram-G4DWMVQ6-Cx7BBH89.js +24 -0
  84. package/dist/app/assets/diagram-MMDJMWI5-D9n-fpq5.js +43 -0
  85. package/dist/app/assets/diagram-TYMM5635-A2Du0da2.js +24 -0
  86. package/dist/app/assets/diff-2klWb1Uo.js +3 -0
  87. package/dist/app/assets/django-B2AbqJYz.js +1 -0
  88. package/dist/app/assets/dns-zone-file-CvZSGx-4.js +1 -0
  89. package/dist/app/assets/docker-Cn7U_QhX.js +1 -0
  90. package/dist/app/assets/dot-B8xtegaK.js +1 -0
  91. package/dist/app/assets/ebnf-oe3GchaY.js +1 -0
  92. package/dist/app/assets/editorconfig-BcXP_CBv.js +1 -0
  93. package/dist/app/assets/eiffel-2H-hw0_M.js +1 -0
  94. package/dist/app/assets/ejs-Ba0Dl3hs.js +1 -0
  95. package/dist/app/assets/elixir-Zqex1hfd.js +1 -0
  96. package/dist/app/assets/elm-BaLOxH54.js +1 -0
  97. package/dist/app/assets/erDiagram-SMLLAGMA-lphP26u7.js +85 -0
  98. package/dist/app/assets/erb-D4zKB7vm.js +1 -0
  99. package/dist/app/assets/erlang-hK3qlNLz.js +1 -0
  100. package/dist/app/assets/etlua-DmORWQ6o.js +1 -0
  101. package/dist/app/assets/excel-formula-Dyve7tHx.js +1 -0
  102. package/dist/app/assets/factor-aKN6m8fH.js +1 -0
  103. package/dist/app/assets/false-CIRDgfm3.js +1 -0
  104. package/dist/app/assets/firestore-security-rules-D8Ht8z5e.js +1 -0
  105. package/dist/app/assets/flow-CoMa0rFO.js +1 -0
  106. package/dist/app/assets/flowDiagram-DWJPFMVM-BLg6doOr.js +162 -0
  107. package/dist/app/assets/fortran-CN_uZJ_i.js +1 -0
  108. package/dist/app/assets/fsharp-C9nE9g7s.js +1 -0
  109. package/dist/app/assets/ftl-DvqhmJFJ.js +1 -0
  110. package/dist/app/assets/ganttDiagram-T4ZO3ILL-20MMEZeq.js +292 -0
  111. package/dist/app/assets/gap-ChJ4bKbS.js +1 -0
  112. package/dist/app/assets/gcode-D6-Q_Sls.js +1 -0
  113. package/dist/app/assets/gdscript-uy9Z57J0.js +1 -0
  114. package/dist/app/assets/gedcom-DKejVBFQ.js +1 -0
  115. package/dist/app/assets/gherkin-D309wbrl.js +1 -0
  116. package/dist/app/assets/git-CXyU-4Kx.js +1 -0
  117. package/dist/app/assets/gitGraphDiagram-UUTBAWPF-CdbhEKk_.js +106 -0
  118. package/dist/app/assets/glsl-CUHcECEi.js +1 -0
  119. package/dist/app/assets/gml-BYJwp8Mq.js +1 -0
  120. package/dist/app/assets/gn-C5jDEgl-.js +1 -0
  121. package/dist/app/assets/go-4DBR4Ukq.js +1 -0
  122. package/dist/app/assets/go-module-BDCY5HMb.js +1 -0
  123. package/dist/app/assets/graph-CasqcucB.js +1 -0
  124. package/dist/app/assets/graphql-CUOhePaJ.js +1 -0
  125. package/dist/app/assets/groovy-C6NRtaMF.js +1 -0
  126. package/dist/app/assets/haml-CeFDFdq_.js +1 -0
  127. package/dist/app/assets/handlebars-Diav69MK.js +1 -0
  128. package/dist/app/assets/haskell-BRtS7ZYk.js +1 -0
  129. package/dist/app/assets/haxe-okolorzn.js +1 -0
  130. package/dist/app/assets/hcl-DUovHBmz.js +1 -0
  131. package/dist/app/assets/hlsl-Est_RcA2.js +1 -0
  132. package/dist/app/assets/hoon-BiOVdLrI.js +1 -0
  133. package/dist/app/assets/hpkp-Bm0WuAFk.js +1 -0
  134. package/dist/app/assets/hsts-CbOaMMM4.js +1 -0
  135. package/dist/app/assets/http-D0tGKTH_.js +1 -0
  136. package/dist/app/assets/ichigojam-WTyjHjN0.js +1 -0
  137. package/dist/app/assets/icon-Bcw6nO7C.js +1 -0
  138. package/dist/app/assets/icu-message-format-1IVITSOw.js +1 -0
  139. package/dist/app/assets/idris-DGiKWxqv.js +1 -0
  140. package/dist/app/assets/iecst-_G6fk-6o.js +1 -0
  141. package/dist/app/assets/ignore-CGGRjy1I.js +1 -0
  142. package/dist/app/assets/index-BnLZxiSt.js +747 -0
  143. package/dist/app/assets/index-D58ynlvg.css +1 -0
  144. package/dist/app/assets/infoDiagram-42DDH7IO-DNXFcEYI.js +2 -0
  145. package/dist/app/assets/inform7-DJNO-7Vs.js +1 -0
  146. package/dist/app/assets/ini-BXxeA4dZ.js +1 -0
  147. package/dist/app/assets/init-Gi6I4Gst.js +1 -0
  148. package/dist/app/assets/io-CZYqA1fa.js +1 -0
  149. package/dist/app/assets/ishikawaDiagram-UXIWVN3A-1FFzVMOS.js +70 -0
  150. package/dist/app/assets/j-CLXGTuej.js +1 -0
  151. package/dist/app/assets/java-DgCJQY9_.js +1 -0
  152. package/dist/app/assets/javadoc-rf7ABQVy.js +1 -0
  153. package/dist/app/assets/javadoclike-BhPYSoi1.js +1 -0
  154. package/dist/app/assets/javascript-DOESY9kn.js +1 -0
  155. package/dist/app/assets/javastacktrace-B40tpYFc.js +1 -0
  156. package/dist/app/assets/jexl-CVSwBfWj.js +1 -0
  157. package/dist/app/assets/jolie-CuMdzw00.js +1 -0
  158. package/dist/app/assets/journeyDiagram-VCZTEJTY-DCh9QB_1.js +139 -0
  159. package/dist/app/assets/jq-rSPG4wjz.js +1 -0
  160. package/dist/app/assets/js-extras-DtC7d85t.js +1 -0
  161. package/dist/app/assets/js-templates-BkzRtF3M.js +1 -0
  162. package/dist/app/assets/jsdoc-CdEDtKIx.js +1 -0
  163. package/dist/app/assets/json-DFUISOXb.js +1 -0
  164. package/dist/app/assets/json5-DDXB8kVt.js +1 -0
  165. package/dist/app/assets/jsonp-B6KceYOu.js +1 -0
  166. package/dist/app/assets/jsstacktrace-BmLmkRns.js +1 -0
  167. package/dist/app/assets/jsx-tZerg2PH.js +1 -0
  168. package/dist/app/assets/julia-Bc1WscpO.js +1 -0
  169. package/dist/app/assets/kanban-definition-6JOO6SKY-BG2AO71l.js +89 -0
  170. package/dist/app/assets/keepalived-C-VxfNGq.js +1 -0
  171. package/dist/app/assets/keyman-EjQIu4mX.js +1 -0
  172. package/dist/app/assets/kotlin-CQALgAA5.js +1 -0
  173. package/dist/app/assets/kumir-7Nk84McD.js +1 -0
  174. package/dist/app/assets/kusto-DaP91ut7.js +1 -0
  175. package/dist/app/assets/latex-DjQNRo9H.js +1 -0
  176. package/dist/app/assets/latte-5JEuNRoR.js +1 -0
  177. package/dist/app/assets/layout-FVsf45l9.js +1 -0
  178. package/dist/app/assets/less-8yUOsL09.js +1 -0
  179. package/dist/app/assets/lilypond-COsmQkBk.js +1 -0
  180. package/dist/app/assets/linear-C_63YKi4.js +1 -0
  181. package/dist/app/assets/liquid--Ji9gJSD.js +1 -0
  182. package/dist/app/assets/lisp-DuUkFEfd.js +1 -0
  183. package/dist/app/assets/livescript-Cs6PchSa.js +1 -0
  184. package/dist/app/assets/llvm-COqWFLYS.js +1 -0
  185. package/dist/app/assets/log-C8QHMZzv.js +1 -0
  186. package/dist/app/assets/lolcode-BIsqHJ6H.js +1 -0
  187. package/dist/app/assets/{java-DvhwWZfy.js → lua-Ds7uGUxB.js} +1 -1
  188. package/dist/app/assets/magma-DLHoFFMW.js +1 -0
  189. package/dist/app/assets/makefile-CW_5azpn.js +1 -0
  190. package/dist/app/assets/markdown-wU5DnlD5.js +1 -0
  191. package/dist/app/assets/markup-BjK1nSyh.js +1 -0
  192. package/dist/app/assets/markup-templating-CfGV0lcD.js +1 -0
  193. package/dist/app/assets/matlab-Bs2eP0LD.js +1 -0
  194. package/dist/app/assets/maxscript-D8jwXiPi.js +1 -0
  195. package/dist/app/assets/mel-Cmbsj11e.js +1 -0
  196. package/dist/app/assets/mermaid-C-cxdm_P.js +1 -0
  197. package/dist/app/assets/min-BctQ8xDj.js +1 -0
  198. package/dist/app/assets/mindmap-definition-QFDTVHPH-DHcgEjW6.js +96 -0
  199. package/dist/app/assets/mizar-Ca1dbNOh.js +1 -0
  200. package/dist/app/assets/mongodb-BocaDOlW.js +1 -0
  201. package/dist/app/assets/monkey-BLhpedmj.js +1 -0
  202. package/dist/app/assets/moonscript-CElpz-Ug.js +1 -0
  203. package/dist/app/assets/n1ql-CwNqjlWA.js +1 -0
  204. package/dist/app/assets/n4js-B1i6cZX9.js +1 -0
  205. package/dist/app/assets/nand2tetris-hdl-DO01eHXa.js +1 -0
  206. package/dist/app/assets/naniscript-C86I87cR.js +1 -0
  207. package/dist/app/assets/nasm-X9SuO04-.js +1 -0
  208. package/dist/app/assets/neon-Cb3VrB_2.js +1 -0
  209. package/dist/app/assets/nevod-BiEf92s6.js +1 -0
  210. package/dist/app/assets/nginx-CUAldmyK.js +1 -0
  211. package/dist/app/assets/nim-CicsGaXu.js +1 -0
  212. package/dist/app/assets/nix-CqX4i_yR.js +1 -0
  213. package/dist/app/assets/nsis-TyCoq1Up.js +1 -0
  214. package/dist/app/assets/objectivec-COzECw8M.js +1 -0
  215. package/dist/app/assets/ocaml-CouJ1SZ_.js +1 -0
  216. package/dist/app/assets/opencl-BNCeQsDQ.js +1 -0
  217. package/dist/app/assets/openqasm-DX-rtDDv.js +1 -0
  218. package/dist/app/assets/ordinal-Cboi1Yqb.js +1 -0
  219. package/dist/app/assets/oz-CAFaEfY9.js +1 -0
  220. package/dist/app/assets/parigp-DTj7bCjF.js +1 -0
  221. package/dist/app/assets/parser-Dw8xYjDE.js +1 -0
  222. package/dist/app/assets/pascal-rnwnKrYC.js +1 -0
  223. package/dist/app/assets/pascaligo-x1XdfDyr.js +1 -0
  224. package/dist/app/assets/pcaxis-2ZAgxxTO.js +1 -0
  225. package/dist/app/assets/peoplecode-pTltM-sq.js +1 -0
  226. package/dist/app/assets/perl-CdAlw2Ho.js +1 -0
  227. package/dist/app/assets/php-C2mFD2oC.js +1 -0
  228. package/dist/app/assets/php-extras-D7Zt-ImZ.js +1 -0
  229. package/dist/app/assets/phpdoc-C1kmfh9i.js +1 -0
  230. package/dist/app/assets/pieDiagram-DEJITSTG-B_eQU9Uk.js +30 -0
  231. package/dist/app/assets/plsql-Im5gOG9c.js +1 -0
  232. package/dist/app/assets/powerquery-poq2eyPm.js +1 -0
  233. package/dist/app/assets/powershell-DJ56nmEi.js +1 -0
  234. package/dist/app/assets/processing-Bn-H7mMf.js +1 -0
  235. package/dist/app/assets/prolog-BCb-6dWU.js +1 -0
  236. package/dist/app/assets/promql-CtbjoMKF.js +1 -0
  237. package/dist/app/assets/properties-CU4TDD4l.js +1 -0
  238. package/dist/app/assets/protobuf-_Q2Yj86k.js +1 -0
  239. package/dist/app/assets/psl-DqN21NC_.js +1 -0
  240. package/dist/app/assets/pug-DAgKMecD.js +1 -0
  241. package/dist/app/assets/puppet-Cc2ljXH1.js +1 -0
  242. package/dist/app/assets/pure-B0x_E1bn.js +1 -0
  243. package/dist/app/assets/purebasic-DcsxzNqC.js +1 -0
  244. package/dist/app/assets/purescript-Cc11iskN.js +1 -0
  245. package/dist/app/assets/q-SRKQXeFP.js +1 -0
  246. package/dist/app/assets/qml-COWYdH0A.js +1 -0
  247. package/dist/app/assets/qore-AdoWA6sw.js +1 -0
  248. package/dist/app/assets/qsharp-k5lgGfSV.js +1 -0
  249. package/dist/app/assets/quadrantDiagram-34T5L4WZ-U_BUH870.js +7 -0
  250. package/dist/app/assets/r-Bmcjr3EC.js +1 -0
  251. package/dist/app/assets/racket-506ZDFuM.js +1 -0
  252. package/dist/app/assets/reason-BngsaqkW.js +1 -0
  253. package/dist/app/assets/regex-BC6jlFZr.js +1 -0
  254. package/dist/app/assets/rego-BYCQ91X3.js +1 -0
  255. package/dist/app/assets/renpy-D95h89N9.js +1 -0
  256. package/dist/app/assets/requirementDiagram-MS252O5E-CWAV9Lki.js +84 -0
  257. package/dist/app/assets/rest-DiYuUdld.js +1 -0
  258. package/dist/app/assets/rip-B1Ip8kd2.js +1 -0
  259. package/dist/app/assets/roboconf-DHaw-Q3G.js +1 -0
  260. package/dist/app/assets/robotframework-HN9oBCJd.js +1 -0
  261. package/dist/app/assets/ruby-C42HzAMc.js +1 -0
  262. package/dist/app/assets/rust-DJdUDgl0.js +1 -0
  263. package/dist/app/assets/sankeyDiagram-XADWPNL6-DzoDqMzU.js +10 -0
  264. package/dist/app/assets/sas-EmHkISJg.js +1 -0
  265. package/dist/app/assets/sass-BEWMjvc2.js +1 -0
  266. package/dist/app/assets/scala-Y9l-QmB_.js +1 -0
  267. package/dist/app/assets/scheme-oQH0YeM4.js +1 -0
  268. package/dist/app/assets/scss-DDqkkzfA.js +1 -0
  269. package/dist/app/assets/sequenceDiagram-FGHM5R23-BRWyyuf5.js +157 -0
  270. package/dist/app/assets/shell-session-DUtkYnuZ.js +1 -0
  271. package/dist/app/assets/smali-CQN_R6JD.js +1 -0
  272. package/dist/app/assets/smalltalk-C5vveBjr.js +1 -0
  273. package/dist/app/assets/smarty-BF9avlDB.js +1 -0
  274. package/dist/app/assets/sml-C_smEF_i.js +1 -0
  275. package/dist/app/assets/solidity-CsmKUFUp.js +1 -0
  276. package/dist/app/assets/solution-file-5OHlEmXf.js +1 -0
  277. package/dist/app/assets/soy-DHS0rtw_.js +1 -0
  278. package/dist/app/assets/sparql-BxBq3H35.js +1 -0
  279. package/dist/app/assets/splunk-spl-C8VgtuYE.js +1 -0
  280. package/dist/app/assets/sqf-hSDek24H.js +1 -0
  281. package/dist/app/assets/sql-DYgxUZFA.js +1 -0
  282. package/dist/app/assets/squirrel-C7uGEJgW.js +1 -0
  283. package/dist/app/assets/stan-CGYqPG3F.js +1 -0
  284. package/dist/app/assets/stateDiagram-FHFEXIEX-Dj_QL8hp.js +1 -0
  285. package/dist/app/assets/stateDiagram-v2-QKLJ7IA2-BJgU_5Se.js +1 -0
  286. package/dist/app/assets/stylus-BCrv-hm1.js +1 -0
  287. package/dist/app/assets/swift-3XnbN5uB.js +1 -0
  288. package/dist/app/assets/systemd-DzUq_PeH.js +2 -0
  289. package/dist/app/assets/t4-cs-DaXmHhdA.js +1 -0
  290. package/dist/app/assets/t4-templating-C1pqdj2v.js +1 -0
  291. package/dist/app/assets/t4-vb-4wqP1_sy.js +1 -0
  292. package/dist/app/assets/tap-FHe0A6pH.js +1 -0
  293. package/dist/app/assets/tcl-DlumdfOH.js +1 -0
  294. package/dist/app/assets/textile-BmxrCmib.js +1 -0
  295. package/dist/app/assets/timeline-definition-GMOUNBTQ-BcI-XOle.js +120 -0
  296. package/dist/app/assets/toml-BngAbTT7.js +1 -0
  297. package/dist/app/assets/tremor-BoVxotcN.js +1 -0
  298. package/dist/app/assets/tt2-BoBfCiJa.js +1 -0
  299. package/dist/app/assets/turtle-CJfK17BD.js +1 -0
  300. package/dist/app/assets/twig-BoM58FfM.js +1 -0
  301. package/dist/app/assets/typescript-BU7mQ9Me.js +1 -0
  302. package/dist/app/assets/typoscript-BQMBCyle.js +1 -0
  303. package/dist/app/assets/unrealscript-Bly1rszO.js +1 -0
  304. package/dist/app/assets/uorazor-AR6v804j.js +1 -0
  305. package/dist/app/assets/uri-DQN5AlR9.js +1 -0
  306. package/dist/app/assets/v-CzlNjPFF.js +1 -0
  307. package/dist/app/assets/vala-D4j-TYUj.js +1 -0
  308. package/dist/app/assets/{turtle-BtZWKoZ_.js → vbnet-BO_zrLTA.js} +1 -1
  309. package/dist/app/assets/velocity-D14EQjuJ.js +1 -0
  310. package/dist/app/assets/vennDiagram-DHZGUBPP-Ct-BJj4e.js +34 -0
  311. package/dist/app/assets/verilog-8HBCyzJW.js +1 -0
  312. package/dist/app/assets/vhdl-CABoGFHh.js +1 -0
  313. package/dist/app/assets/vim-BqejDUiH.js +1 -0
  314. package/dist/app/assets/visual-basic-BBFqe9IH.js +1 -0
  315. package/dist/app/assets/wardley-RL74JXVD-DF76BHVV.js +162 -0
  316. package/dist/app/assets/wardleyDiagram-NUSXRM2D-tb9-DpEL.js +20 -0
  317. package/dist/app/assets/warpscript-D8JsH2aH.js +1 -0
  318. package/dist/app/assets/wasm-usuPS3UI.js +1 -0
  319. package/dist/app/assets/web-idl-CtjhIrn5.js +1 -0
  320. package/dist/app/assets/wiki-nE7oYJAm.js +1 -0
  321. package/dist/app/assets/wolfram-BpCCg-Fp.js +1 -0
  322. package/dist/app/assets/wren-Dtkpodh6.js +1 -0
  323. package/dist/app/assets/xeora-BpTlDPdY.js +1 -0
  324. package/dist/app/assets/xml-doc-CcDifcyn.js +1 -0
  325. package/dist/app/assets/xojo-O-0SvFwZ.js +1 -0
  326. package/dist/app/assets/xquery-UAB2jKQB.js +1 -0
  327. package/dist/app/assets/xychartDiagram-5P7HB3ND-d6FXhzUl.js +7 -0
  328. package/dist/app/assets/yaml-eCAjf2lJ.js +1 -0
  329. package/dist/app/assets/yang-BkCZ0omw.js +1 -0
  330. package/dist/app/assets/zig-DEIPVEHz.js +1 -0
  331. package/dist/app/index.html +2 -2
  332. package/dist/index.cjs +1623 -555
  333. package/dist/index.d.cts +3 -2
  334. package/dist/index.d.ts +3 -2
  335. package/dist/index.js +1643 -552
  336. package/package.json +6 -2
  337. package/dist/app/assets/abap-DMqO-Um8.js +0 -1
  338. package/dist/app/assets/abnf-CBYpoE1H.js +0 -1
  339. package/dist/app/assets/actionscript-ieE-wJMz.js +0 -1
  340. package/dist/app/assets/ada-0-3Dx7g-.js +0 -1
  341. package/dist/app/assets/agda-uvq9b4Kv.js +0 -1
  342. package/dist/app/assets/al-BmajJCAx.js +0 -1
  343. package/dist/app/assets/antlr4-DnRRgAfR.js +0 -1
  344. package/dist/app/assets/apacheconf-BWoRK3Q3.js +0 -1
  345. package/dist/app/assets/apex-u3cbevj3.js +0 -1
  346. package/dist/app/assets/apl-Cifc7IZj.js +0 -1
  347. package/dist/app/assets/applescript-CpHbiQqz.js +0 -1
  348. package/dist/app/assets/aql-C_VCCvUl.js +0 -1
  349. package/dist/app/assets/arduino-CSAc4iDr.js +0 -1
  350. package/dist/app/assets/arff-B8hSQDyJ.js +0 -1
  351. package/dist/app/assets/asciidoc-Guc1Uqnw.js +0 -1
  352. package/dist/app/assets/asm6502-CxPqNdV6.js +0 -1
  353. package/dist/app/assets/asmatmel-C76CHB5e.js +0 -1
  354. package/dist/app/assets/aspnet-BQFc33QF.js +0 -1
  355. package/dist/app/assets/autohotkey-uQeN2mix.js +0 -1
  356. package/dist/app/assets/autoit-Bmy0PsAQ.js +0 -1
  357. package/dist/app/assets/avisynth-BvuIlb62.js +0 -1
  358. package/dist/app/assets/avro-idl-DWeVWQR3.js +0 -1
  359. package/dist/app/assets/bash-HypWaeXO.js +0 -1
  360. package/dist/app/assets/batch-B1yKhArW.js +0 -1
  361. package/dist/app/assets/bbcode-BIDNxh7c.js +0 -1
  362. package/dist/app/assets/bicep-DkupOIs7.js +0 -1
  363. package/dist/app/assets/birb-Jo6NYQYX.js +0 -1
  364. package/dist/app/assets/bison-BjPiLxuX.js +0 -1
  365. package/dist/app/assets/bnf-BjygHCSE.js +0 -1
  366. package/dist/app/assets/brainfuck-CsnLnGPx.js +0 -1
  367. package/dist/app/assets/brightscript-CwmmyoHc.js +0 -1
  368. package/dist/app/assets/bro-BNKXu22N.js +0 -1
  369. package/dist/app/assets/bsl-DOwsbsXU.js +0 -1
  370. package/dist/app/assets/c-DyedRTs7.js +0 -1
  371. package/dist/app/assets/cfscript-DCpmh-J_.js +0 -1
  372. package/dist/app/assets/chaiscript-DRaisf-4.js +0 -1
  373. package/dist/app/assets/cil-C5bobqND.js +0 -1
  374. package/dist/app/assets/clike-CvmXR497.js +0 -1
  375. package/dist/app/assets/clojure-BH_u6xTK.js +0 -1
  376. package/dist/app/assets/cmake-CZruZSdT.js +0 -1
  377. package/dist/app/assets/cobol-qc5xAkcg.js +0 -1
  378. package/dist/app/assets/coffeescript-DGM4CLoq.js +0 -1
  379. package/dist/app/assets/concurnas-DFyZRxPp.js +0 -1
  380. package/dist/app/assets/coq-DbZe2f_H.js +0 -1
  381. package/dist/app/assets/core-BWUnDrKt.js +0 -1
  382. package/dist/app/assets/cpp-CidpRyAJ.js +0 -1
  383. package/dist/app/assets/crystal-DZE9-h5D.js +0 -1
  384. package/dist/app/assets/csharp-Cf2K5CJJ.js +0 -1
  385. package/dist/app/assets/cshtml-DRjf7C5F.js +0 -1
  386. package/dist/app/assets/csp-dEoRcP0N.js +0 -1
  387. package/dist/app/assets/css-BWUfAyau.js +0 -1
  388. package/dist/app/assets/css-extras-pPY_Crez.js +0 -1
  389. package/dist/app/assets/csv-DdkqZn4I.js +0 -1
  390. package/dist/app/assets/cypher-BXQbix41.js +0 -1
  391. package/dist/app/assets/d-BctgRQp0.js +0 -1
  392. package/dist/app/assets/dart-DuiikcDB.js +0 -1
  393. package/dist/app/assets/dataweave-ClZ_D-Ju.js +0 -1
  394. package/dist/app/assets/dax-DXNfCTH9.js +0 -1
  395. package/dist/app/assets/dhall-Cbz5hfMr.js +0 -1
  396. package/dist/app/assets/diff-bify6WLh.js +0 -3
  397. package/dist/app/assets/django-5DdvW3LZ.js +0 -1
  398. package/dist/app/assets/dns-zone-file-DIIW7lsW.js +0 -1
  399. package/dist/app/assets/docker-BxIMVoJD.js +0 -1
  400. package/dist/app/assets/dot-DLEHPnum.js +0 -1
  401. package/dist/app/assets/ebnf-DHWaG3pk.js +0 -1
  402. package/dist/app/assets/editorconfig-D2gTUSqU.js +0 -1
  403. package/dist/app/assets/eiffel-C3dcM2dq.js +0 -1
  404. package/dist/app/assets/ejs-0qd3jtKi.js +0 -1
  405. package/dist/app/assets/elixir-BbBaHIGe.js +0 -1
  406. package/dist/app/assets/elm-KJmeOU7e.js +0 -1
  407. package/dist/app/assets/erb-BncgAY0M.js +0 -1
  408. package/dist/app/assets/erlang-DS2SHYdK.js +0 -1
  409. package/dist/app/assets/etlua-CvdrPEPO.js +0 -1
  410. package/dist/app/assets/excel-formula-BSj1zROW.js +0 -1
  411. package/dist/app/assets/factor-DAbcpTN7.js +0 -1
  412. package/dist/app/assets/false-CI895JmG.js +0 -1
  413. package/dist/app/assets/firestore-security-rules-CJ33YIQv.js +0 -1
  414. package/dist/app/assets/flow-a2eNz08o.js +0 -1
  415. package/dist/app/assets/fortran-Bt9e6qJa.js +0 -1
  416. package/dist/app/assets/fsharp-Y0Qf2U16.js +0 -1
  417. package/dist/app/assets/ftl-D-TrqPet.js +0 -1
  418. package/dist/app/assets/gap-CP5bMoJx.js +0 -1
  419. package/dist/app/assets/gcode-DQNcGCou.js +0 -1
  420. package/dist/app/assets/gdscript-Bxt6W-z5.js +0 -1
  421. package/dist/app/assets/gedcom-Cqgp4wkt.js +0 -1
  422. package/dist/app/assets/gherkin-D7pNUe8Z.js +0 -1
  423. package/dist/app/assets/git-C4ec-8cM.js +0 -1
  424. package/dist/app/assets/glsl-8sVKxech.js +0 -1
  425. package/dist/app/assets/gml-TuwFoFK6.js +0 -1
  426. package/dist/app/assets/gn-BwHrmBhU.js +0 -1
  427. package/dist/app/assets/go-module-cqolzX_W.js +0 -1
  428. package/dist/app/assets/go-vGJJNlGP.js +0 -1
  429. package/dist/app/assets/graphql-Do6Lisgl.js +0 -1
  430. package/dist/app/assets/groovy--87wZh42.js +0 -1
  431. package/dist/app/assets/haml-vhodueeI.js +0 -1
  432. package/dist/app/assets/handlebars-CNLRaZ5R.js +0 -1
  433. package/dist/app/assets/haskell-BWTsCqP4.js +0 -1
  434. package/dist/app/assets/haxe-CSb0SWYW.js +0 -1
  435. package/dist/app/assets/hcl-ftOASTH-.js +0 -1
  436. package/dist/app/assets/hlsl-BnaGHwDi.js +0 -1
  437. package/dist/app/assets/hoon-wyj1oNzn.js +0 -1
  438. package/dist/app/assets/hpkp-Broim0YQ.js +0 -1
  439. package/dist/app/assets/hsts-BSMt-Rhs.js +0 -1
  440. package/dist/app/assets/http-yK1zPe9M.js +0 -1
  441. package/dist/app/assets/ichigojam-Bpzuxs1S.js +0 -1
  442. package/dist/app/assets/icon-DjPW0ImK.js +0 -1
  443. package/dist/app/assets/icu-message-format-CTS86FWW.js +0 -1
  444. package/dist/app/assets/idris-DkPie8bu.js +0 -1
  445. package/dist/app/assets/iecst-CG1KmB8U.js +0 -1
  446. package/dist/app/assets/ignore-D9eho3CQ.js +0 -1
  447. package/dist/app/assets/index-4J46qBCc.js +0 -445
  448. package/dist/app/assets/index-DTn9OjqV.css +0 -1
  449. package/dist/app/assets/inform7-DD1mc6Wh.js +0 -1
  450. package/dist/app/assets/ini-Db6U4nBT.js +0 -1
  451. package/dist/app/assets/io-BRkH6hzB.js +0 -1
  452. package/dist/app/assets/j-CD22iLrA.js +0 -1
  453. package/dist/app/assets/javadoc-Ecoxhe_9.js +0 -1
  454. package/dist/app/assets/javadoclike-Realhpv4.js +0 -1
  455. package/dist/app/assets/javascript-BBd1k8wl.js +0 -1
  456. package/dist/app/assets/javastacktrace-C8QW0vuU.js +0 -1
  457. package/dist/app/assets/jexl-CT2UXrnH.js +0 -1
  458. package/dist/app/assets/jolie-qtyDXXST.js +0 -1
  459. package/dist/app/assets/jq-CNJQULTZ.js +0 -1
  460. package/dist/app/assets/js-extras-DwIZLd4T.js +0 -1
  461. package/dist/app/assets/js-templates-glA_Un9b.js +0 -1
  462. package/dist/app/assets/jsdoc-BsXlBBjy.js +0 -1
  463. package/dist/app/assets/json-BC3xmMOU.js +0 -1
  464. package/dist/app/assets/json5-CiePGcB9.js +0 -1
  465. package/dist/app/assets/jsonp-B9HJmhak.js +0 -1
  466. package/dist/app/assets/jsstacktrace-3xS0eyZd.js +0 -1
  467. package/dist/app/assets/jsx-B5kMqxBm.js +0 -1
  468. package/dist/app/assets/julia-B5Udq0EY.js +0 -1
  469. package/dist/app/assets/keepalived-CI0hMS1b.js +0 -1
  470. package/dist/app/assets/keyman-BCtXwe5i.js +0 -1
  471. package/dist/app/assets/kotlin-B3l0V1Fn.js +0 -1
  472. package/dist/app/assets/kumir-BmC_PBOp.js +0 -1
  473. package/dist/app/assets/kusto-B0p1ppsT.js +0 -1
  474. package/dist/app/assets/latex-CHwNDYz_.js +0 -1
  475. package/dist/app/assets/latte-DihAtCCl.js +0 -1
  476. package/dist/app/assets/less-BLGkFSp1.js +0 -1
  477. package/dist/app/assets/lilypond-CCsAc8Nl.js +0 -1
  478. package/dist/app/assets/liquid-jBSQx5I5.js +0 -1
  479. package/dist/app/assets/lisp-CgzQXnYE.js +0 -1
  480. package/dist/app/assets/livescript-u96H-zdx.js +0 -1
  481. package/dist/app/assets/llvm-WmVcvcNM.js +0 -1
  482. package/dist/app/assets/log-990P-Rch.js +0 -1
  483. package/dist/app/assets/lolcode-DdFIjfxs.js +0 -1
  484. package/dist/app/assets/lua-GkhnMu0T.js +0 -1
  485. package/dist/app/assets/magma-wajb6K9F.js +0 -1
  486. package/dist/app/assets/makefile-CGHjuGaS.js +0 -1
  487. package/dist/app/assets/markdown-BFWQ31vs.js +0 -1
  488. package/dist/app/assets/markup-1ihI0X17.js +0 -1
  489. package/dist/app/assets/markup-templating-DblqKZLi.js +0 -1
  490. package/dist/app/assets/matlab-CPqo7ZUC.js +0 -1
  491. package/dist/app/assets/maxscript-CTgVjA7o.js +0 -1
  492. package/dist/app/assets/mel-Cxah6vYr.js +0 -1
  493. package/dist/app/assets/mermaid-BAgJSsZ7.js +0 -1
  494. package/dist/app/assets/mizar-BL3spn8_.js +0 -1
  495. package/dist/app/assets/mongodb-DXzP7tR0.js +0 -1
  496. package/dist/app/assets/monkey-anPtBsfj.js +0 -1
  497. package/dist/app/assets/moonscript-Y_tcmLfW.js +0 -1
  498. package/dist/app/assets/n1ql-B7NGFYRY.js +0 -1
  499. package/dist/app/assets/n4js-zh8URwWB.js +0 -1
  500. package/dist/app/assets/nand2tetris-hdl-CDUtzUHw.js +0 -1
  501. package/dist/app/assets/naniscript-CjJGU6C6.js +0 -1
  502. package/dist/app/assets/nasm-D6biC9Vr.js +0 -1
  503. package/dist/app/assets/neon-C3Z0pCuH.js +0 -1
  504. package/dist/app/assets/nevod-BT4Ivkzb.js +0 -1
  505. package/dist/app/assets/nginx-vHHTRs1B.js +0 -1
  506. package/dist/app/assets/nim-Jk1NOWk0.js +0 -1
  507. package/dist/app/assets/nix-CEkA_w3B.js +0 -1
  508. package/dist/app/assets/nsis-Du9w_Qb8.js +0 -1
  509. package/dist/app/assets/objectivec-BciYUGRR.js +0 -1
  510. package/dist/app/assets/ocaml-CpZ_M4DP.js +0 -1
  511. package/dist/app/assets/opencl-C-4M-Mvx.js +0 -1
  512. package/dist/app/assets/openqasm-CilZXlSe.js +0 -1
  513. package/dist/app/assets/oz-DluYJ10T.js +0 -1
  514. package/dist/app/assets/parigp-BlIaVN51.js +0 -1
  515. package/dist/app/assets/parser-BZVTYRp4.js +0 -1
  516. package/dist/app/assets/pascal-CMz_wkC0.js +0 -1
  517. package/dist/app/assets/pascaligo-DLQY1QwY.js +0 -1
  518. package/dist/app/assets/pcaxis-C-5nzMDp.js +0 -1
  519. package/dist/app/assets/peoplecode-BhTicHl8.js +0 -1
  520. package/dist/app/assets/perl-BArlZZ8M.js +0 -1
  521. package/dist/app/assets/php-C6zNUOf5.js +0 -1
  522. package/dist/app/assets/php-extras-DD5Glhrz.js +0 -1
  523. package/dist/app/assets/phpdoc-Buj0qa-9.js +0 -1
  524. package/dist/app/assets/plsql-o2-C-Ezr.js +0 -1
  525. package/dist/app/assets/powerquery-Cl0Dbp57.js +0 -1
  526. package/dist/app/assets/powershell-BVFtl1FS.js +0 -1
  527. package/dist/app/assets/processing-BHJTqgxZ.js +0 -1
  528. package/dist/app/assets/prolog-C9gykhtA.js +0 -1
  529. package/dist/app/assets/promql-TzYBDR1F.js +0 -1
  530. package/dist/app/assets/properties-Bi8GxxCM.js +0 -1
  531. package/dist/app/assets/protobuf-s08U24Jk.js +0 -1
  532. package/dist/app/assets/psl-By228u9L.js +0 -1
  533. package/dist/app/assets/pug-CahxgaMR.js +0 -1
  534. package/dist/app/assets/puppet-BAY6TBQY.js +0 -1
  535. package/dist/app/assets/pure-IA8ihD9R.js +0 -1
  536. package/dist/app/assets/purebasic-B6joY-ZH.js +0 -1
  537. package/dist/app/assets/purescript-DczXEj8E.js +0 -1
  538. package/dist/app/assets/q-CEXq_tpX.js +0 -1
  539. package/dist/app/assets/qml-ND31CBLa.js +0 -1
  540. package/dist/app/assets/qore-DAjVLL2F.js +0 -1
  541. package/dist/app/assets/qsharp-jccBvH6Y.js +0 -1
  542. package/dist/app/assets/r-pv5Xhvsd.js +0 -1
  543. package/dist/app/assets/racket-xRigDwdL.js +0 -1
  544. package/dist/app/assets/reason-DnAP7dec.js +0 -1
  545. package/dist/app/assets/regex-Dwkma1bN.js +0 -1
  546. package/dist/app/assets/rego-3dHPz-ut.js +0 -1
  547. package/dist/app/assets/renpy-Czxc7hu0.js +0 -1
  548. package/dist/app/assets/rest-BP_JQ_AG.js +0 -1
  549. package/dist/app/assets/rip-Nredd5kD.js +0 -1
  550. package/dist/app/assets/roboconf-CkR4ACer.js +0 -1
  551. package/dist/app/assets/robotframework-CYYV7JaP.js +0 -1
  552. package/dist/app/assets/ruby-EA_sSyU6.js +0 -1
  553. package/dist/app/assets/rust-BM2hEYJt.js +0 -1
  554. package/dist/app/assets/sas-jaxOWx-0.js +0 -1
  555. package/dist/app/assets/sass-pkiTdYnF.js +0 -1
  556. package/dist/app/assets/scala-lTsQiijh.js +0 -1
  557. package/dist/app/assets/scheme-DkPZYA1o.js +0 -1
  558. package/dist/app/assets/scss-DZjxUgqE.js +0 -1
  559. package/dist/app/assets/shell-session-CKXJ0a90.js +0 -1
  560. package/dist/app/assets/smali-DVWpHHAX.js +0 -1
  561. package/dist/app/assets/smalltalk-ChiRh9QF.js +0 -1
  562. package/dist/app/assets/smarty-C4i7AVoC.js +0 -1
  563. package/dist/app/assets/sml-v9dKzil3.js +0 -1
  564. package/dist/app/assets/solidity-DaxM8K8t.js +0 -1
  565. package/dist/app/assets/solution-file-Ch7ajMI6.js +0 -1
  566. package/dist/app/assets/soy-CHeWJZPl.js +0 -1
  567. package/dist/app/assets/sparql-f56EhPSR.js +0 -1
  568. package/dist/app/assets/splunk-spl-CNX2IshN.js +0 -1
  569. package/dist/app/assets/sqf-B9Z5kTgF.js +0 -1
  570. package/dist/app/assets/sql-PZTLdUd4.js +0 -1
  571. package/dist/app/assets/squirrel-_QTHEJtD.js +0 -1
  572. package/dist/app/assets/stan-y02QaMQQ.js +0 -1
  573. package/dist/app/assets/stylus-CGYq1GKp.js +0 -1
  574. package/dist/app/assets/swift-BBMLpv3H.js +0 -1
  575. package/dist/app/assets/systemd-CD7Dfv8Y.js +0 -2
  576. package/dist/app/assets/t4-cs-BtxQixNP.js +0 -1
  577. package/dist/app/assets/t4-templating-BX2jWZwS.js +0 -1
  578. package/dist/app/assets/t4-vb-CX3AQUVf.js +0 -1
  579. package/dist/app/assets/tap-BRBB20R0.js +0 -1
  580. package/dist/app/assets/tcl-CWrqc_vL.js +0 -1
  581. package/dist/app/assets/textile-EJMS8IJv.js +0 -1
  582. package/dist/app/assets/toml-DLWr0_Sd.js +0 -1
  583. package/dist/app/assets/tremor-D0DGH64h.js +0 -1
  584. package/dist/app/assets/tt2-CaSD1IpZ.js +0 -1
  585. package/dist/app/assets/twig-BQ0AWwu3.js +0 -1
  586. package/dist/app/assets/typescript-sByRs_H7.js +0 -1
  587. package/dist/app/assets/typoscript-Bs3x5DVu.js +0 -1
  588. package/dist/app/assets/unrealscript-BPk-JGuX.js +0 -1
  589. package/dist/app/assets/uorazor-Dxr1B729.js +0 -1
  590. package/dist/app/assets/uri-B18d7fGy.js +0 -1
  591. package/dist/app/assets/v-B-4se_c_.js +0 -1
  592. package/dist/app/assets/vala-CZJMpckw.js +0 -1
  593. package/dist/app/assets/vbnet-Bon1nLZm.js +0 -1
  594. package/dist/app/assets/velocity-Ck8gHF4B.js +0 -1
  595. package/dist/app/assets/verilog-zADKtd-6.js +0 -1
  596. package/dist/app/assets/vhdl-Ce3jhJNh.js +0 -1
  597. package/dist/app/assets/vim-CwgyIdo-.js +0 -1
  598. package/dist/app/assets/visual-basic-BWQC7pBF.js +0 -1
  599. package/dist/app/assets/warpscript-CVp7w3zz.js +0 -1
  600. package/dist/app/assets/wasm-yPowz3sM.js +0 -1
  601. package/dist/app/assets/web-idl-BkghLEob.js +0 -1
  602. package/dist/app/assets/wiki-TBH4TnLK.js +0 -1
  603. package/dist/app/assets/wolfram-BmgF1AlB.js +0 -1
  604. package/dist/app/assets/wren-CJ8nrMy_.js +0 -1
  605. package/dist/app/assets/xeora-N6_5XQpC.js +0 -1
  606. package/dist/app/assets/xml-doc-GBGxTNFc.js +0 -1
  607. package/dist/app/assets/xojo-CmpAfzYO.js +0 -1
  608. package/dist/app/assets/xquery-BA22D3yp.js +0 -1
  609. package/dist/app/assets/yaml-CDGmAMpu.js +0 -1
  610. package/dist/app/assets/yang-rFKIXOjI.js +0 -1
  611. package/dist/app/assets/zig-rH4Tzjve.js +0 -1
package/dist/index.cjs CHANGED
@@ -66,8 +66,8 @@ __export(index_exports, {
66
66
  module.exports = __toCommonJS(index_exports);
67
67
 
68
68
  // src/components/chat.tsx
69
- var React21 = __toESM(require("react"), 1);
70
- var import_lucide_react10 = require("lucide-react");
69
+ var React23 = __toESM(require("react"), 1);
70
+ var import_lucide_react12 = require("lucide-react");
71
71
 
72
72
  // src/lib/utils.ts
73
73
  var import_clsx = require("clsx");
@@ -283,6 +283,9 @@ function isObjectLike(value) {
283
283
  function isNonEmptyString(value) {
284
284
  return typeof value === "string" && value.trim().length > 0;
285
285
  }
286
+ function isOptionalString(value) {
287
+ return value === void 0 || typeof value === "string";
288
+ }
286
289
  function toOptionalString(value) {
287
290
  return isNonEmptyString(value) ? value.trim() : void 0;
288
291
  }
@@ -295,42 +298,90 @@ function toLineNumber(value) {
295
298
  }
296
299
  return null;
297
300
  }
298
- function normalizeCodeReference(candidate) {
299
- const path = toOptionalString(candidate.path);
300
- const text = toReferenceText(candidate.text);
301
- const startLine = toLineNumber(candidate.startLine);
302
- const endLine = toLineNumber(candidate.endLine);
303
- if (!path || !text || startLine === null || endLine === null) {
304
- return null;
301
+ function isOptionalNumber(value) {
302
+ return value === void 0 || Number.isFinite(value);
303
+ }
304
+ function toOptionalNumber(value, options) {
305
+ const allowZero = options?.allowZero ?? false;
306
+ if (!Number.isFinite(value)) {
307
+ return void 0;
308
+ }
309
+ const numberValue = value;
310
+ if (numberValue > 0 || allowZero && numberValue === 0) {
311
+ return numberValue;
312
+ }
313
+ return void 0;
314
+ }
315
+ function hasImageReferenceLocator(candidate) {
316
+ return isNonEmptyString(candidate.fileId) || isNonEmptyString(candidate.url) || isNonEmptyString(candidate.name) || isNonEmptyString(candidate.label) || isNonEmptyString(candidate.text);
317
+ }
318
+ function isCodeReferenceCandidate(value) {
319
+ if (!isObjectLike(value)) {
320
+ return false;
321
+ }
322
+ const candidate = value;
323
+ return isNonEmptyString(candidate.path) && toLineNumber(candidate.startLine) !== null && toLineNumber(candidate.endLine) !== null && toReferenceText(candidate.text) !== null && isOptionalString(candidate.id) && isOptionalString(candidate.label) && isOptionalString(candidate.language) && isOptionalString(candidate.taskId);
324
+ }
325
+ function isQuoteReferenceCandidate(value) {
326
+ if (!isObjectLike(value)) {
327
+ return false;
328
+ }
329
+ const candidate = value;
330
+ return candidate.type === "quote" && toReferenceText(candidate.text) !== null && isOptionalString(candidate.id) && isOptionalString(candidate.label) && isOptionalString(candidate.messageId) && isOptionalString(candidate.source);
331
+ }
332
+ function isImageReferenceCandidate(value) {
333
+ if (!isObjectLike(value)) {
334
+ return false;
305
335
  }
336
+ const candidate = value;
337
+ return candidate.type === "image" && isOptionalString(candidate.id) && isOptionalString(candidate.label) && isOptionalString(candidate.text) && isOptionalString(candidate.fileId) && isOptionalString(candidate.url) && isOptionalString(candidate.mimeType) && isOptionalString(candidate.name) && isOptionalNumber(candidate.size) && isOptionalNumber(candidate.width) && isOptionalNumber(candidate.height) && hasImageReferenceLocator(candidate);
338
+ }
339
+ function toCodeReference(candidate) {
306
340
  return {
307
341
  type: "code",
308
342
  ...toOptionalString(candidate.id) ? { id: toOptionalString(candidate.id) } : {},
309
343
  ...toOptionalString(candidate.label) ? { label: toOptionalString(candidate.label) } : {},
310
- path,
311
- startLine,
312
- endLine,
313
- text,
344
+ path: candidate.path.trim(),
345
+ startLine: candidate.startLine,
346
+ endLine: candidate.endLine,
347
+ text: candidate.text,
314
348
  ...toOptionalString(candidate.language) ? { language: toOptionalString(candidate.language) } : {},
315
349
  ...toOptionalString(candidate.taskId) ? { taskId: toOptionalString(candidate.taskId) } : {}
316
350
  };
317
351
  }
318
- function normalizeQuoteReference(candidate) {
319
- const text = toReferenceText(candidate.text);
320
- if (!text) {
321
- return null;
322
- }
352
+ function toQuoteReference(candidate) {
323
353
  return {
324
354
  type: "quote",
325
355
  ...toOptionalString(candidate.id) ? { id: toOptionalString(candidate.id) } : {},
326
356
  ...toOptionalString(candidate.label) ? { label: toOptionalString(candidate.label) } : {},
327
- text,
357
+ text: candidate.text,
328
358
  ...toOptionalString(candidate.messageId) ? { messageId: toOptionalString(candidate.messageId) } : {},
329
359
  ...toOptionalString(candidate.source) ? { source: toOptionalString(candidate.source) } : {}
330
360
  };
331
361
  }
362
+ function toImageReference(candidate) {
363
+ const fileId = toOptionalString(candidate.fileId);
364
+ const url = toOptionalString(candidate.url);
365
+ const name = toOptionalString(candidate.name);
366
+ const label = toOptionalString(candidate.label);
367
+ const rawText = toReferenceText(candidate.text);
368
+ const text = rawText ?? name ?? label ?? "Pasted image";
369
+ return {
370
+ type: "image",
371
+ ...toOptionalString(candidate.id) ? { id: toOptionalString(candidate.id) } : {},
372
+ ...label ? { label } : {},
373
+ text,
374
+ ...fileId ? { fileId } : {},
375
+ ...url ? { url } : {},
376
+ ...toOptionalString(candidate.mimeType) ? { mimeType: toOptionalString(candidate.mimeType) } : {},
377
+ ...name ? { name } : {},
378
+ ...toOptionalNumber(candidate.size, { allowZero: true }) !== void 0 ? { size: toOptionalNumber(candidate.size, { allowZero: true }) } : {},
379
+ ...toOptionalNumber(candidate.width) !== void 0 ? { width: toOptionalNumber(candidate.width) } : {},
380
+ ...toOptionalNumber(candidate.height) !== void 0 ? { height: toOptionalNumber(candidate.height) } : {}
381
+ };
382
+ }
332
383
  function isLegacyCodeReference(candidate) {
333
- return isNonEmptyString(candidate.path) && toLineNumber(candidate.startLine) !== null && toLineNumber(candidate.endLine) !== null && toReferenceText(candidate.text) !== null;
384
+ return candidate.type === void 0 && isNonEmptyString(candidate.path) && toLineNumber(candidate.startLine) !== null && toLineNumber(candidate.endLine) !== null && toReferenceText(candidate.text) !== null;
334
385
  }
335
386
  function normalizeReference(value) {
336
387
  if (!isObjectLike(value)) {
@@ -338,14 +389,17 @@ function normalizeReference(value) {
338
389
  }
339
390
  const candidate = value;
340
391
  const type = toOptionalString(candidate.type);
341
- if (type === "code") {
342
- return normalizeCodeReference(candidate);
392
+ if (type === "code" && isCodeReferenceCandidate(candidate)) {
393
+ return toCodeReference(candidate);
394
+ }
395
+ if (isQuoteReferenceCandidate(candidate)) {
396
+ return toQuoteReference(candidate);
343
397
  }
344
- if (type === "quote") {
345
- return normalizeQuoteReference(candidate);
398
+ if (isImageReferenceCandidate(candidate)) {
399
+ return toImageReference(candidate);
346
400
  }
347
401
  if (type === void 0 && isLegacyCodeReference(candidate)) {
348
- return normalizeCodeReference(candidate);
402
+ return toCodeReference(candidate);
349
403
  }
350
404
  return null;
351
405
  }
@@ -368,7 +422,32 @@ function getQuoteExcerpt(reference) {
368
422
  function getCodeReferenceLocation(reference) {
369
423
  return `${reference.path}:${getCodeReferenceRange(reference)}`;
370
424
  }
425
+ function formatReferenceSize(size2) {
426
+ if (size2 < 1024) {
427
+ return `${size2} B`;
428
+ }
429
+ if (size2 < 1024 * 1024) {
430
+ return `${(size2 / 1024).toFixed(size2 < 10 * 1024 ? 1 : 0)} KB`;
431
+ }
432
+ return `${(size2 / (1024 * 1024)).toFixed(size2 < 10 * 1024 * 1024 ? 1 : 0)} MB`;
433
+ }
434
+ function getImageReferenceDimensions(reference) {
435
+ if (!reference.width || !reference.height) {
436
+ return null;
437
+ }
438
+ return `${reference.width}x${reference.height}`;
439
+ }
440
+ function getImageReferenceMetaParts(reference) {
441
+ return [
442
+ reference.mimeType?.trim() || null,
443
+ getImageReferenceDimensions(reference),
444
+ typeof reference.size === "number" ? formatReferenceSize(reference.size) : null
445
+ ].filter((part) => Boolean(part));
446
+ }
371
447
  function getReferenceKey(reference) {
448
+ if (reference.type === "image" && reference.fileId?.trim()) {
449
+ return `image:${reference.fileId.trim()}`;
450
+ }
372
451
  if (reference.id && reference.id.trim()) {
373
452
  return reference.id.trim();
374
453
  }
@@ -381,6 +460,18 @@ function getReferenceKey(reference) {
381
460
  reference.text
382
461
  ].join(":");
383
462
  }
463
+ if (reference.type === "image") {
464
+ return [
465
+ reference.type,
466
+ reference.url ?? "",
467
+ reference.name ?? "",
468
+ reference.mimeType ?? "",
469
+ reference.size ?? "",
470
+ reference.width ?? "",
471
+ reference.height ?? "",
472
+ reference.text
473
+ ].join(":");
474
+ }
384
475
  return [
385
476
  reference.type,
386
477
  reference.messageId ?? "",
@@ -410,6 +501,9 @@ function getReferenceLabel(reference) {
410
501
  const fileName = segments[segments.length - 1] || reference.path;
411
502
  return `${fileName} ${getCodeReferenceRange(reference)}`;
412
503
  }
504
+ if (reference.type === "image") {
505
+ return reference.name?.trim() || "Pasted image";
506
+ }
413
507
  if (reference.source && reference.source.trim()) {
414
508
  return reference.source.trim();
415
509
  }
@@ -419,6 +513,10 @@ function getReferenceMetaLine(reference) {
419
513
  if (reference.type === "code") {
420
514
  return getCodeReferenceLocation(reference);
421
515
  }
516
+ if (reference.type === "image") {
517
+ const parts = getImageReferenceMetaParts(reference);
518
+ return parts.length ? parts.join(" \u2022 ") : null;
519
+ }
422
520
  if (reference.source && reference.source.trim()) {
423
521
  return getQuoteExcerpt(reference);
424
522
  }
@@ -433,6 +531,21 @@ function getReferenceTitle(reference) {
433
531
 
434
532
  ${reference.text}`;
435
533
  }
534
+ if (reference.type === "image") {
535
+ const titleLines = [getReferenceLabel(reference)];
536
+ const metaLine = getReferenceMetaLine(reference);
537
+ const url = reference.url?.trim() && !reference.url.trim().startsWith("data:") ? reference.url.trim() : null;
538
+ if (metaLine) {
539
+ titleLines.push(metaLine);
540
+ }
541
+ if (url) {
542
+ titleLines.push(url);
543
+ }
544
+ if (reference.text.trim() && reference.text.trim() !== getReferenceLabel(reference)) {
545
+ titleLines.push("", reference.text.trim());
546
+ }
547
+ return titleLines.join("\n");
548
+ }
436
549
  const header = reference.label?.trim() || reference.source?.trim() || "Quoted text";
437
550
  return `${header}
438
551
 
@@ -837,6 +950,22 @@ function resolveUsedContextSize(options) {
837
950
  return normalizeContextUsageNumber(options.fallbackUsedTokens) ?? 0;
838
951
  }
839
952
 
953
+ // src/lib/follow-ups.ts
954
+ function getComposerFollowUpShortcutLabels(queueShortcutLabel) {
955
+ return {
956
+ steer: "Enter",
957
+ queue: queueShortcutLabel
958
+ };
959
+ }
960
+ function getBusyComposerShortcutFollowUpMode(useQueueShortcut) {
961
+ return useQueueShortcut ? "queue" : "steer";
962
+ }
963
+
964
+ // src/lib/todos.ts
965
+ function countCompletedTodos(items) {
966
+ return items.filter((item) => item.status === "completed").length;
967
+ }
968
+
840
969
  // src/providers/Stream.tsx
841
970
  var import_jsx_runtime2 = require("react/jsx-runtime");
842
971
  var import_meta = {};
@@ -991,6 +1120,9 @@ var en_US_default = {
991
1120
  manualQueueHint: "Ready to send as a new run",
992
1121
  steerHint: "Injects after the current tool call"
993
1122
  },
1123
+ todos: {
1124
+ summary: "{{total}} tasks, {{completed}} completed"
1125
+ },
994
1126
  errors: {
995
1127
  loadMessages: "Failed to load thread messages",
996
1128
  createThread: "Failed to create thread",
@@ -1029,7 +1161,16 @@ var en_US_default = {
1029
1161
  close: "Close"
1030
1162
  },
1031
1163
  markdown: {
1032
- copy: "Copy"
1164
+ copy: "Copy",
1165
+ mermaid: {
1166
+ title: "Mermaid",
1167
+ diagram: "Diagram",
1168
+ code: "Code",
1169
+ download: "Download SVG",
1170
+ fullScreen: "Open full screen",
1171
+ rendering: "Rendering diagram",
1172
+ failed: "Failed to render diagram"
1173
+ }
1033
1174
  },
1034
1175
  thread: {
1035
1176
  errorToast: "An error occurred. Please try again.",
@@ -1075,7 +1216,7 @@ var zh_CN_default = {
1075
1216
  pending: "\u5F85\u5904\u7406 Follow-up",
1076
1217
  queue: "\u6392\u961F",
1077
1218
  steer: "\u5F15\u5BFC",
1078
- steerAction: "Steer",
1219
+ steerAction: "\u5F15\u5BFC",
1079
1220
  promoteToSteer: "\u8F6C\u4E3A\u5F15\u5BFC",
1080
1221
  sendNow: "\u7ACB\u5373\u53D1\u9001",
1081
1222
  remove: "\u79FB\u9664\u6B64\u5F85\u5904\u7406 Follow-up",
@@ -1086,6 +1227,9 @@ var zh_CN_default = {
1086
1227
  manualQueueHint: "\u4FDD\u7559\u4E3A\u5F85\u53D1\u9001\uFF0C\u53EF\u624B\u52A8\u5F00\u542F\u65B0\u4E00\u8F6E",
1087
1228
  steerHint: "\u5F53\u524D\u5DE5\u5177\u8C03\u7528\u5B8C\u6210\u540E\u6CE8\u5165"
1088
1229
  },
1230
+ todos: {
1231
+ summary: "\u5171 {{total}} \u4E2A\u4EFB\u52A1\uFF0C\u5DF2\u7ECF\u5B8C\u6210 {{completed}} \u4E2A"
1232
+ },
1089
1233
  errors: {
1090
1234
  loadMessages: "\u52A0\u8F7D\u7EBF\u7A0B\u6D88\u606F\u5931\u8D25",
1091
1235
  createThread: "\u521B\u5EFA\u7EBF\u7A0B\u5931\u8D25",
@@ -1124,7 +1268,16 @@ var zh_CN_default = {
1124
1268
  close: "\u5173\u95ED"
1125
1269
  },
1126
1270
  markdown: {
1127
- copy: "\u590D\u5236"
1271
+ copy: "\u590D\u5236",
1272
+ mermaid: {
1273
+ title: "Mermaid",
1274
+ diagram: "\u56FE\u8868",
1275
+ code: "\u4EE3\u7801",
1276
+ download: "\u4E0B\u8F7D SVG",
1277
+ fullScreen: "\u5168\u5C4F\u67E5\u770B",
1278
+ rendering: "\u6B63\u5728\u6E32\u67D3\u56FE\u8868",
1279
+ failed: "\u56FE\u8868\u6E32\u67D3\u5931\u8D25"
1280
+ }
1128
1281
  },
1129
1282
  thread: {
1130
1283
  errorToast: "\u53D1\u751F\u9519\u8BEF\uFF0C\u8BF7\u91CD\u8BD5\u3002",
@@ -1657,19 +1810,86 @@ function ComposerMenu({
1657
1810
 
1658
1811
  // src/components/composer/SendButton.tsx
1659
1812
  var import_lucide_react2 = require("lucide-react");
1813
+
1814
+ // src/components/ui/tooltip.tsx
1815
+ var React6 = require("react");
1816
+ var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
1660
1817
  var import_jsx_runtime7 = require("react/jsx-runtime");
1818
+ function TooltipProvider({
1819
+ delayDuration = 0,
1820
+ ...props
1821
+ }) {
1822
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1823
+ TooltipPrimitive.Provider,
1824
+ {
1825
+ "data-slot": "tooltip-provider",
1826
+ delayDuration,
1827
+ ...props
1828
+ }
1829
+ );
1830
+ }
1831
+ function Tooltip({
1832
+ ...props
1833
+ }) {
1834
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1835
+ TooltipPrimitive.Root,
1836
+ {
1837
+ "data-slot": "tooltip",
1838
+ ...props
1839
+ }
1840
+ ) });
1841
+ }
1842
+ function TooltipTrigger({
1843
+ ...props
1844
+ }) {
1845
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1846
+ TooltipPrimitive.Trigger,
1847
+ {
1848
+ "data-slot": "tooltip-trigger",
1849
+ ...props
1850
+ }
1851
+ );
1852
+ }
1853
+ function TooltipContent({
1854
+ className,
1855
+ sideOffset = 0,
1856
+ hideArrow = false,
1857
+ children,
1858
+ ...props
1859
+ }) {
1860
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1861
+ TooltipPrimitive.Content,
1862
+ {
1863
+ "data-slot": "tooltip-content",
1864
+ sideOffset,
1865
+ className: cn(
1866
+ "bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
1867
+ className
1868
+ ),
1869
+ ...props,
1870
+ children: [
1871
+ children,
1872
+ !hideArrow ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" }) : null
1873
+ ]
1874
+ }
1875
+ ) });
1876
+ }
1877
+
1878
+ // src/components/composer/SendButton.tsx
1879
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1661
1880
  function SendButton({
1662
1881
  disabled = false,
1663
1882
  isLoading = false,
1664
1883
  showStop = isLoading,
1665
1884
  onStop,
1666
1885
  stopLabel = "Stop",
1667
- sendLabel = "Send"
1886
+ sendLabel = "Send",
1887
+ shortcuts
1668
1888
  }) {
1669
1889
  const { theme } = useTheme();
1670
1890
  const roundedClass = getRoundedClass(theme.radius);
1671
1891
  if (showStop) {
1672
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1892
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1673
1893
  "button",
1674
1894
  {
1675
1895
  type: "button",
@@ -1682,11 +1902,11 @@ function SendButton({
1682
1902
  "hover:scale-105 active:scale-95"
1683
1903
  ),
1684
1904
  "aria-label": stopLabel,
1685
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.Square, { size: 14, fill: "currentColor", stroke: "currentColor", strokeWidth: 0 })
1905
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Square, { size: 14, fill: "currentColor", stroke: "currentColor", strokeWidth: 0 })
1686
1906
  }
1687
1907
  );
1688
1908
  }
1689
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1909
+ const button = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1690
1910
  "button",
1691
1911
  {
1692
1912
  type: "submit",
@@ -1700,34 +1920,63 @@ function SendButton({
1700
1920
  "disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:scale-100"
1701
1921
  ),
1702
1922
  "aria-label": sendLabel,
1703
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react2.ArrowUp, { size: 18, strokeWidth: 2.5 })
1923
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.ArrowUp, { size: 18, strokeWidth: 2.5 })
1704
1924
  }
1705
1925
  );
1926
+ if (!shortcuts?.length || disabled) {
1927
+ return button;
1928
+ }
1929
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(Tooltip, { children: [
1930
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipTrigger, { asChild: true, children: button }),
1931
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1932
+ TooltipContent,
1933
+ {
1934
+ side: "top",
1935
+ sideOffset: 10,
1936
+ hideArrow: true,
1937
+ className: cn(
1938
+ "min-w-36 border border-border/70 bg-background px-3 py-2 text-foreground shadow-lg",
1939
+ roundedClass
1940
+ ),
1941
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "space-y-1", children: shortcuts.map((shortcut) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1942
+ "div",
1943
+ {
1944
+ className: "flex items-center justify-between gap-4 text-sm",
1945
+ children: [
1946
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-medium", children: shortcut.label }),
1947
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("kbd", { className: "inline-flex min-w-16 items-center justify-center rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground", children: shortcut.keys })
1948
+ ]
1949
+ },
1950
+ `${shortcut.label}-${shortcut.keys}`
1951
+ )) })
1952
+ }
1953
+ )
1954
+ ] });
1706
1955
  }
1707
1956
 
1708
1957
  // src/components/history/HistorySidebar.tsx
1709
- var React8 = __toESM(require("react"), 1);
1958
+ var React9 = __toESM(require("react"), 1);
1710
1959
  var import_lucide_react4 = require("lucide-react");
1711
1960
 
1712
1961
  // src/components/ui/scroll-area.tsx
1713
- var React6 = __toESM(require("react"), 1);
1962
+ var React7 = __toESM(require("react"), 1);
1714
1963
  var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
1715
- var import_jsx_runtime8 = require("react/jsx-runtime");
1716
- var ScrollArea = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1964
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1965
+ var ScrollArea = React7.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1717
1966
  ScrollAreaPrimitive.Root,
1718
1967
  {
1719
1968
  ref,
1720
1969
  className: cn("relative overflow-hidden", className),
1721
1970
  ...props,
1722
1971
  children: [
1723
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
1724
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ScrollBar, {}),
1725
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ScrollAreaPrimitive.Corner, {})
1972
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollAreaPrimitive.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
1973
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollBar, {}),
1974
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollAreaPrimitive.Corner, {})
1726
1975
  ]
1727
1976
  }
1728
1977
  ));
1729
1978
  ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
1730
- var ScrollBar = React6.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1979
+ var ScrollBar = React7.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1731
1980
  ScrollAreaPrimitive.ScrollAreaScrollbar,
1732
1981
  {
1733
1982
  ref,
@@ -1739,30 +1988,30 @@ var ScrollBar = React6.forwardRef(({ className, orientation = "vertical", ...pro
1739
1988
  className
1740
1989
  ),
1741
1990
  ...props,
1742
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
1991
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScrollAreaPrimitive.ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
1743
1992
  }
1744
1993
  ));
1745
1994
  ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
1746
1995
 
1747
1996
  // src/components/ui/sheet.tsx
1748
- var React7 = require("react");
1997
+ var React8 = require("react");
1749
1998
  var import_lucide_react3 = require("lucide-react");
1750
1999
  var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
1751
- var import_jsx_runtime9 = require("react/jsx-runtime");
2000
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1752
2001
  function Sheet({ ...props }) {
1753
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SheetPrimitive.Root, { ...props });
2002
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetPrimitive.Root, { ...props });
1754
2003
  }
1755
2004
  function SheetTrigger({ ...props }) {
1756
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SheetPrimitive.Trigger, { ...props });
2005
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetPrimitive.Trigger, { ...props });
1757
2006
  }
1758
2007
  function SheetPortal({ ...props }) {
1759
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SheetPrimitive.Portal, { ...props });
2008
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetPrimitive.Portal, { ...props });
1760
2009
  }
1761
2010
  function SheetOverlay({
1762
2011
  className,
1763
2012
  ...props
1764
2013
  }) {
1765
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2014
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1766
2015
  SheetPrimitive.Overlay,
1767
2016
  {
1768
2017
  className: cn(
@@ -1786,9 +2035,9 @@ function SheetContent({
1786
2035
  left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
1787
2036
  right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
1788
2037
  };
1789
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(SheetPortal, { children: [
1790
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SheetOverlay, {}),
1791
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2038
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(SheetPortal, { children: [
2039
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetOverlay, {}),
2040
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1792
2041
  SheetPrimitive.Content,
1793
2042
  {
1794
2043
  className: cn(
@@ -1799,9 +2048,9 @@ function SheetContent({
1799
2048
  ...props,
1800
2049
  children: [
1801
2050
  children,
1802
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1803
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { size: 16 }),
1804
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sr-only", children: t("sheet.close") })
2051
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
2052
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react3.X, { size: 16 }),
2053
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: t("sheet.close") })
1805
2054
  ] })
1806
2055
  ]
1807
2056
  }
@@ -1812,7 +2061,7 @@ function SheetHeader({
1812
2061
  className,
1813
2062
  ...props
1814
2063
  }) {
1815
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2064
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1816
2065
  "div",
1817
2066
  {
1818
2067
  className: cn(
@@ -1827,7 +2076,7 @@ function SheetTitle({
1827
2076
  className,
1828
2077
  ...props
1829
2078
  }) {
1830
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2079
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1831
2080
  SheetPrimitive.Title,
1832
2081
  {
1833
2082
  className: cn("text-lg font-semibold text-foreground", className),
@@ -1837,7 +2086,7 @@ function SheetTitle({
1837
2086
  }
1838
2087
 
1839
2088
  // src/components/history/HistorySidebar.tsx
1840
- var import_jsx_runtime10 = require("react/jsx-runtime");
2089
+ var import_jsx_runtime11 = require("react/jsx-runtime");
1841
2090
  function HistorySidebar({
1842
2091
  threads = [],
1843
2092
  currentThreadId,
@@ -1848,7 +2097,7 @@ function HistorySidebar({
1848
2097
  disabled = false
1849
2098
  }) {
1850
2099
  const { t } = useChatkitTranslation();
1851
- const [open, setOpen] = React8.useState(false);
2100
+ const [open, setOpen] = React9.useState(false);
1852
2101
  const handleNewThread = () => {
1853
2102
  onNewThread?.();
1854
2103
  setOpen(false);
@@ -1857,8 +2106,8 @@ function HistorySidebar({
1857
2106
  onSelectThread?.(id);
1858
2107
  setOpen(false);
1859
2108
  };
1860
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Sheet, { open, onOpenChange: setOpen, children: [
1861
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2109
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Sheet, { open, onOpenChange: setOpen, children: [
2110
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SheetTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1862
2111
  Button,
1863
2112
  {
1864
2113
  variant: "ghost",
@@ -1866,26 +2115,26 @@ function HistorySidebar({
1866
2115
  disabled,
1867
2116
  className: "h-8 w-8 cursor-pointer",
1868
2117
  children: [
1869
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.History, { size: 16 }),
1870
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: t("history.threadHistory") })
2118
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.History, { size: 16 }),
2119
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "sr-only", children: t("history.threadHistory") })
1871
2120
  ]
1872
2121
  }
1873
2122
  ) }),
1874
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(SheetContent, { side: "right", className: "w-80 p-0", children: [
1875
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetHeader, { className: "border-b p-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SheetTitle, { children: t("history.title") }) }),
1876
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2123
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(SheetContent, { side: "right", className: "w-80 p-0", children: [
2124
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SheetHeader, { className: "border-b p-4", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SheetTitle, { children: t("history.title") }) }),
2125
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1877
2126
  Button,
1878
2127
  {
1879
2128
  onClick: handleNewThread,
1880
2129
  className: "w-full justify-start gap-2",
1881
2130
  variant: "secondary",
1882
2131
  children: [
1883
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.PlusCircle, { size: 16 }),
2132
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.PlusCircle, { size: 16 }),
1884
2133
  t("history.newThread")
1885
2134
  ]
1886
2135
  }
1887
2136
  ) }),
1888
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScrollArea, { className: "h-[calc(100vh-140px)]", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "px-4 pb-4", children: threads.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "py-8 text-center text-sm text-muted-foreground", children: t("history.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "space-y-1", children: threads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
2137
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScrollArea, { className: "h-[calc(100vh-140px)]", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "px-4 pb-4", children: threads.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "py-8 text-center text-sm text-muted-foreground", children: t("history.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "space-y-1", children: threads.map((thread) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1889
2138
  "div",
1890
2139
  {
1891
2140
  className: cn(
@@ -1895,9 +2144,9 @@ function HistorySidebar({
1895
2144
  ),
1896
2145
  onClick: () => handleSelectThread(thread.id),
1897
2146
  children: [
1898
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.MessageSquare, { size: 16 }) }),
1899
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex-1 truncate", children: thread.title }),
1900
- showDelete && onDeleteThread && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
2147
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.MessageSquare, { size: 16 }) }),
2148
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex-1 truncate", children: thread.title }),
2149
+ showDelete && onDeleteThread && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1901
2150
  "button",
1902
2151
  {
1903
2152
  type: "button",
@@ -1906,7 +2155,7 @@ function HistorySidebar({
1906
2155
  onDeleteThread(thread.id);
1907
2156
  },
1908
2157
  className: "opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 hover:text-destructive transition-all",
1909
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Trash2, { size: 14 })
2158
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react4.Trash2, { size: 14 })
1910
2159
  }
1911
2160
  )
1912
2161
  ]
@@ -1920,71 +2169,6 @@ function HistorySidebar({
1920
2169
  // src/components/composer/pending-follow-ups.tsx
1921
2170
  var React10 = __toESM(require("react"), 1);
1922
2171
  var import_lucide_react5 = require("lucide-react");
1923
-
1924
- // src/components/ui/tooltip.tsx
1925
- var React9 = require("react");
1926
- var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
1927
- var import_jsx_runtime11 = require("react/jsx-runtime");
1928
- function TooltipProvider({
1929
- delayDuration = 0,
1930
- ...props
1931
- }) {
1932
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1933
- TooltipPrimitive.Provider,
1934
- {
1935
- "data-slot": "tooltip-provider",
1936
- delayDuration,
1937
- ...props
1938
- }
1939
- );
1940
- }
1941
- function Tooltip({
1942
- ...props
1943
- }) {
1944
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1945
- TooltipPrimitive.Root,
1946
- {
1947
- "data-slot": "tooltip",
1948
- ...props
1949
- }
1950
- ) });
1951
- }
1952
- function TooltipTrigger({
1953
- ...props
1954
- }) {
1955
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1956
- TooltipPrimitive.Trigger,
1957
- {
1958
- "data-slot": "tooltip-trigger",
1959
- ...props
1960
- }
1961
- );
1962
- }
1963
- function TooltipContent({
1964
- className,
1965
- sideOffset = 0,
1966
- children,
1967
- ...props
1968
- }) {
1969
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1970
- TooltipPrimitive.Content,
1971
- {
1972
- "data-slot": "tooltip-content",
1973
- sideOffset,
1974
- className: cn(
1975
- "bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance",
1976
- className
1977
- ),
1978
- ...props,
1979
- children: [
1980
- children,
1981
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
1982
- ]
1983
- }
1984
- ) });
1985
- }
1986
-
1987
- // src/components/composer/pending-follow-ups.tsx
1988
2172
  var import_jsx_runtime12 = require("react/jsx-runtime");
1989
2173
  function getPendingFollowUpText(item, referencedContentFallback) {
1990
2174
  const text = item.request?.input?.input?.trim() ?? "";
@@ -2024,6 +2208,7 @@ function PendingFollowUps({
2024
2208
  onSendNow,
2025
2209
  onEdit,
2026
2210
  onRemove,
2211
+ attachToComposer = true,
2027
2212
  className
2028
2213
  }) {
2029
2214
  const { t } = useChatkitTranslation();
@@ -2046,8 +2231,9 @@ function PendingFollowUps({
2046
2231
  "div",
2047
2232
  {
2048
2233
  className: cn(
2049
- "space-y-2 mx-2 p-2 border border-border border-b-0",
2050
- rounded.top,
2234
+ "space-y-2 mx-2 p-2 border border-border",
2235
+ attachToComposer ? "border-b-0" : null,
2236
+ attachToComposer ? rounded.top : rounded.panel,
2051
2237
  className
2052
2238
  ),
2053
2239
  children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1", children: [
@@ -2278,31 +2464,150 @@ function PendingFollowUps({
2278
2464
  );
2279
2465
  }
2280
2466
 
2467
+ // src/components/composer/pending-todos.tsx
2468
+ var React11 = __toESM(require("react"), 1);
2469
+ var import_lucide_react6 = require("lucide-react");
2470
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2471
+ function useRoundedClasses2() {
2472
+ const { theme } = useTheme();
2473
+ return {
2474
+ top: theme.radius ? {
2475
+ pill: "rounded-t-full",
2476
+ round: "rounded-t-xl",
2477
+ soft: "rounded-t-lg",
2478
+ sharp: "rounded-t-none"
2479
+ }[theme.radius] : "rounded-t-lg",
2480
+ panel: getRoundedClass(theme.radius, "rounded-lg")
2481
+ };
2482
+ }
2483
+ function TodoStatusIcon({ status }) {
2484
+ if (status === "completed") {
2485
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react6.CheckCircle2, { className: "mt-1 h-4 w-4 shrink-0 text-emerald-600" });
2486
+ }
2487
+ if (status === "in_progress") {
2488
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react6.CircleDashed, { className: "mt-1 h-4 w-4 shrink-0 text-foreground/70" });
2489
+ }
2490
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react6.Circle, { className: "mt-1 h-4 w-4 shrink-0 text-muted-foreground" });
2491
+ }
2492
+ function PendingTodos({
2493
+ snapshot,
2494
+ attachToComposer = true,
2495
+ className
2496
+ }) {
2497
+ const { t } = useChatkitTranslation();
2498
+ const rounded = useRoundedClasses2();
2499
+ const listId = React11.useId();
2500
+ const [isCollapsed, setIsCollapsed] = React11.useState(false);
2501
+ React11.useEffect(() => {
2502
+ setIsCollapsed(false);
2503
+ }, [snapshot?.componentId]);
2504
+ if (!snapshot || snapshot.items.length === 0) {
2505
+ return null;
2506
+ }
2507
+ const completedCount = countCompletedTodos(snapshot.items);
2508
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2509
+ "div",
2510
+ {
2511
+ "aria-live": "polite",
2512
+ className: cn(
2513
+ "mx-2 border border-border bg-background/95 px-3 py-3 shadow-sm",
2514
+ attachToComposer ? "border-b-0" : null,
2515
+ attachToComposer ? rounded.top : rounded.panel,
2516
+ className
2517
+ ),
2518
+ children: [
2519
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2520
+ "button",
2521
+ {
2522
+ type: "button",
2523
+ className: "flex w-full items-center justify-between gap-3 text-left",
2524
+ "aria-expanded": !isCollapsed,
2525
+ "aria-controls": listId,
2526
+ onClick: () => setIsCollapsed((prev) => !prev),
2527
+ children: [
2528
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex min-w-0 items-center gap-2 text-sm font-medium text-foreground", children: [
2529
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react6.ListTodo, { className: "h-4 w-4 shrink-0 text-muted-foreground" }),
2530
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "truncate", children: t("chat.todos.summary", {
2531
+ total: snapshot.items.length,
2532
+ completed: completedCount
2533
+ }) })
2534
+ ] }),
2535
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "flex items-center shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2536
+ import_lucide_react6.ChevronDown,
2537
+ {
2538
+ className: cn(
2539
+ "h-4 w-4 text-muted-foreground transition-transform",
2540
+ isCollapsed ? null : "rotate-180"
2541
+ )
2542
+ }
2543
+ ) })
2544
+ ]
2545
+ }
2546
+ ),
2547
+ !isCollapsed && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ol", { id: listId, className: "mt-3 space-y-2.5", children: snapshot.items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2548
+ "li",
2549
+ {
2550
+ className: "grid min-w-0 grid-cols-[16px_24px_minmax(0,1fr)] items-start gap-2 overflow-hidden",
2551
+ children: [
2552
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TodoStatusIcon, { status: item.status }),
2553
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2554
+ "span",
2555
+ {
2556
+ className: cn(
2557
+ "text-sm leading-6 text-foreground",
2558
+ item.status === "completed" ? "text-muted-foreground" : null
2559
+ ),
2560
+ children: [
2561
+ index + 1,
2562
+ "."
2563
+ ]
2564
+ }
2565
+ ),
2566
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2567
+ "span",
2568
+ {
2569
+ title: item.content,
2570
+ className: cn(
2571
+ "block min-w-0 truncate text-sm leading-6 text-foreground",
2572
+ item.status === "completed" ? "text-muted-foreground line-through" : item.status === "in_progress" ? "font-medium" : null
2573
+ ),
2574
+ children: item.content
2575
+ }
2576
+ )
2577
+ ]
2578
+ },
2579
+ item.id
2580
+ )) })
2581
+ ]
2582
+ }
2583
+ );
2584
+ }
2585
+
2281
2586
  // src/components/thread/messages/ai.tsx
2282
- var React14 = __toESM(require("react"), 1);
2283
- var import_lucide_react7 = require("lucide-react");
2587
+ var React16 = __toESM(require("react"), 1);
2588
+ var import_lucide_react9 = require("lucide-react");
2284
2589
 
2285
2590
  // src/components/ui/badge.tsx
2286
- var React11 = __toESM(require("react"), 1);
2287
- var import_jsx_runtime13 = require("react/jsx-runtime");
2591
+ var React12 = __toESM(require("react"), 1);
2592
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2288
2593
  var base = "inline-flex items-center rounded-full border border-transparent px-2.5 py-0.5 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background";
2289
2594
  var variants = {
2290
2595
  default: "bg-primary text-primary-foreground",
2291
2596
  secondary: "bg-secondary text-secondary-foreground",
2292
2597
  outline: "border-input text-foreground"
2293
2598
  };
2294
- var Badge = React11.forwardRef(
2599
+ var Badge = React12.forwardRef(
2295
2600
  ({ className, variant = "default", ...props }, ref) => {
2296
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { ref, className: cn(base, variants[variant], className), ...props });
2601
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { ref, className: cn(base, variants[variant], className), ...props });
2297
2602
  }
2298
2603
  );
2299
2604
  Badge.displayName = "Badge";
2300
2605
 
2301
2606
  // src/components/ui/card.tsx
2302
- var React12 = __toESM(require("react"), 1);
2303
- var import_jsx_runtime14 = require("react/jsx-runtime");
2304
- var Card = React12.forwardRef(
2305
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2607
+ var React13 = __toESM(require("react"), 1);
2608
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2609
+ var Card = React13.forwardRef(
2610
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2306
2611
  "div",
2307
2612
  {
2308
2613
  ref,
@@ -2315,50 +2620,50 @@ var Card = React12.forwardRef(
2315
2620
  )
2316
2621
  );
2317
2622
  Card.displayName = "Card";
2318
- var CardHeader = React12.forwardRef(
2319
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref, className: cn("flex flex-col gap-1.5 px-6 pt-6", className), ...props })
2623
+ var CardHeader = React13.forwardRef(
2624
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref, className: cn("flex flex-col gap-1.5 px-6 pt-6", className), ...props })
2320
2625
  );
2321
2626
  CardHeader.displayName = "CardHeader";
2322
- var CardTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { ref, className: cn("text-lg font-semibold leading-tight", className), ...props }));
2627
+ var CardTitle = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { ref, className: cn("text-lg font-semibold leading-tight", className), ...props }));
2323
2628
  CardTitle.displayName = "CardTitle";
2324
- var CardDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
2629
+ var CardDescription = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props }));
2325
2630
  CardDescription.displayName = "CardDescription";
2326
- var CardContent = React12.forwardRef(
2327
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref, className: cn("px-6 pb-6", className), ...props })
2631
+ var CardContent = React13.forwardRef(
2632
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref, className: cn("px-6 pb-6", className), ...props })
2328
2633
  );
2329
2634
  CardContent.displayName = "CardContent";
2330
- var CardFooter = React12.forwardRef(
2331
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref, className: cn("flex items-center px-6 pb-6", className), ...props })
2635
+ var CardFooter = React13.forwardRef(
2636
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref, className: cn("flex items-center px-6 pb-6", className), ...props })
2332
2637
  );
2333
2638
  CardFooter.displayName = "CardFooter";
2334
- var CardAction = React12.forwardRef(
2335
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { ref, className: cn("ml-auto flex items-center", className), ...props })
2639
+ var CardAction = React13.forwardRef(
2640
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref, className: cn("ml-auto flex items-center", className), ...props })
2336
2641
  );
2337
2642
  CardAction.displayName = "CardAction";
2338
2643
 
2339
2644
  // src/components/ui/tabs.tsx
2340
- var React13 = __toESM(require("react"), 1);
2341
- var import_jsx_runtime15 = require("react/jsx-runtime");
2342
- var TabsContext = React13.createContext(null);
2645
+ var React14 = __toESM(require("react"), 1);
2646
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2647
+ var TabsContext = React14.createContext(null);
2343
2648
  function Tabs({ className, defaultValue, value, onValueChange, ...props }) {
2344
- const [internalValue, setInternalValue] = React13.useState(defaultValue ?? "");
2649
+ const [internalValue, setInternalValue] = React14.useState(defaultValue ?? "");
2345
2650
  const activeValue = value ?? internalValue;
2346
- const setValue = React13.useCallback(
2651
+ const setValue = React14.useCallback(
2347
2652
  (nextValue) => {
2348
2653
  if (value === void 0) setInternalValue(nextValue);
2349
2654
  onValueChange?.(nextValue);
2350
2655
  },
2351
2656
  [onValueChange, value]
2352
2657
  );
2353
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TabsContext.Provider, { value: { value: activeValue, setValue }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: cn("w-full", className), ...props }) });
2658
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(TabsContext.Provider, { value: { value: activeValue, setValue }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: cn("w-full", className), ...props }) });
2354
2659
  }
2355
- var TabsList = React13.forwardRef(
2356
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2660
+ var TabsList = React14.forwardRef(
2661
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2357
2662
  "div",
2358
2663
  {
2359
2664
  ref,
2360
2665
  className: cn(
2361
- "inline-flex h-11 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
2666
+ "inline-flex items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
2362
2667
  className
2363
2668
  ),
2364
2669
  role: "tablist",
@@ -2367,14 +2672,14 @@ var TabsList = React13.forwardRef(
2367
2672
  )
2368
2673
  );
2369
2674
  TabsList.displayName = "TabsList";
2370
- var TabsTrigger = React13.forwardRef(
2675
+ var TabsTrigger = React14.forwardRef(
2371
2676
  ({ className, value, onClick, ...props }, ref) => {
2372
- const context = React13.useContext(TabsContext);
2677
+ const context = React14.useContext(TabsContext);
2373
2678
  if (!context) {
2374
2679
  throw new Error("TabsTrigger must be used within Tabs");
2375
2680
  }
2376
2681
  const isActive = context.value === value;
2377
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2682
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2378
2683
  "button",
2379
2684
  {
2380
2685
  ref,
@@ -2383,7 +2688,7 @@ var TabsTrigger = React13.forwardRef(
2383
2688
  "aria-selected": isActive,
2384
2689
  "data-state": isActive ? "active" : "inactive",
2385
2690
  className: cn(
2386
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-2 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
2691
+ "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
2387
2692
  className
2388
2693
  ),
2389
2694
  onClick: (event) => {
@@ -2396,14 +2701,14 @@ var TabsTrigger = React13.forwardRef(
2396
2701
  }
2397
2702
  );
2398
2703
  TabsTrigger.displayName = "TabsTrigger";
2399
- var TabsContent = React13.forwardRef(
2704
+ var TabsContent = React14.forwardRef(
2400
2705
  ({ className, value, ...props }, ref) => {
2401
- const context = React13.useContext(TabsContext);
2706
+ const context = React14.useContext(TabsContext);
2402
2707
  if (!context) {
2403
2708
  throw new Error("TabsContent must be used within Tabs");
2404
2709
  }
2405
2710
  if (context.value !== value) return null;
2406
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2711
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2407
2712
  "div",
2408
2713
  {
2409
2714
  ref,
@@ -2425,7 +2730,7 @@ var import_remark_gfm = __toESM(require("remark-gfm"), 1);
2425
2730
  var import_rehype_katex = __toESM(require("rehype-katex"), 1);
2426
2731
  var import_remark_math = __toESM(require("remark-math"), 1);
2427
2732
  var import_react6 = require("react");
2428
- var import_lucide_react6 = require("lucide-react");
2733
+ var import_lucide_react8 = require("lucide-react");
2429
2734
 
2430
2735
  // src/components/thread/syntax-highlighter.tsx
2431
2736
  var import_react_syntax_highlighter = require("react-syntax-highlighter");
@@ -2433,7 +2738,7 @@ var import_tsx = __toESM(require("react-syntax-highlighter/dist/esm/languages/pr
2433
2738
  var import_python = __toESM(require("react-syntax-highlighter/dist/esm/languages/prism/python"), 1);
2434
2739
  var import_prism = require("react-syntax-highlighter/dist/cjs/styles/prism");
2435
2740
  var import_react4 = require("react");
2436
- var import_jsx_runtime16 = require("react/jsx-runtime");
2741
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2437
2742
  import_react_syntax_highlighter.PrismAsyncLight.registerLanguage("js", import_tsx.default);
2438
2743
  import_react_syntax_highlighter.PrismAsyncLight.registerLanguage("jsx", import_tsx.default);
2439
2744
  import_react_syntax_highlighter.PrismAsyncLight.registerLanguage("ts", import_tsx.default);
@@ -2444,7 +2749,7 @@ var SyntaxHighlighter = ({
2444
2749
  language,
2445
2750
  className
2446
2751
  }) => {
2447
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2752
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2448
2753
  import_react_syntax_highlighter.PrismAsyncLight,
2449
2754
  {
2450
2755
  language,
@@ -2459,41 +2764,544 @@ var SyntaxHighlighter = ({
2459
2764
  children
2460
2765
  }
2461
2766
  );
2462
- };
2463
-
2464
- // src/components/thread/tooltip-icon-button.tsx
2465
- var import_react5 = require("react");
2466
- var import_jsx_runtime17 = require("react/jsx-runtime");
2467
- var TooltipIconButton = (0, import_react5.forwardRef)(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
2468
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Tooltip, { children: [
2469
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2470
- Button,
2767
+ };
2768
+
2769
+ // src/components/thread/mermaid-block.tsx
2770
+ var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
2771
+ var import_mermaid = __toESM(require("mermaid"), 1);
2772
+ var import_lucide_react7 = require("lucide-react");
2773
+ var React15 = __toESM(require("react"), 1);
2774
+
2775
+ // src/components/thread/tooltip-icon-button.tsx
2776
+ var import_react5 = require("react");
2777
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2778
+ var TooltipIconButton = (0, import_react5.forwardRef)(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
2779
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(Tooltip, { children: [
2780
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2781
+ Button,
2782
+ {
2783
+ variant: "ghost",
2784
+ size: "icon",
2785
+ ...rest,
2786
+ className: cn("size-6 p-1", className),
2787
+ ref,
2788
+ children: [
2789
+ children,
2790
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: tooltip })
2791
+ ]
2792
+ }
2793
+ ) }),
2794
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(TooltipContent, { side, children: tooltip })
2795
+ ] }) });
2796
+ });
2797
+ TooltipIconButton.displayName = "TooltipIconButton";
2798
+
2799
+ // src/components/thread/mermaid-block.tsx
2800
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2801
+ var HEX_COLOR_PATTERN = /^#([\da-f]{3,8})$/i;
2802
+ var MERMAID_DIRECTIVE_PATTERN = /%{2}{\s*(?:(\w+)\s*:|(\w+))\s*(?:(\w+)|((?:(?!}%{2}).|\r?\n)*))?\s*(?:}%{2})?/gi;
2803
+ var MERMAID_FRONTMATTER_PATTERN = /^-{3}\s*[\n\r](.*?)[\n\r]-{3}\s*[\n\r]+/s;
2804
+ var OKLCH_COLOR_PATTERN = /^oklch\((.+)\)$/i;
2805
+ var RGB_COLOR_PATTERN = /^rgba?\((.+)\)$/i;
2806
+ var MERMAID_SECURE_KEYS = [
2807
+ "fontFamily",
2808
+ "maxEdges",
2809
+ "maxTextSize",
2810
+ "securityLevel",
2811
+ "secure",
2812
+ "startOnLoad",
2813
+ "suppressErrorRendering",
2814
+ "theme",
2815
+ "themeVariables"
2816
+ ];
2817
+ function clamp(value, min, max) {
2818
+ return Math.min(max, Math.max(min, value));
2819
+ }
2820
+ function normalizeMermaidCode(code) {
2821
+ return code.replace(MERMAID_FRONTMATTER_PATTERN, "").replace(MERMAID_DIRECTIVE_PATTERN, "").trim();
2822
+ }
2823
+ function parseAlpha(value) {
2824
+ if (!value) return 1;
2825
+ const normalized = value.trim();
2826
+ if (!normalized) return 1;
2827
+ if (normalized.endsWith("%")) {
2828
+ return clamp(Number.parseFloat(normalized) / 100, 0, 1);
2829
+ }
2830
+ return clamp(Number.parseFloat(normalized), 0, 1);
2831
+ }
2832
+ function parseHexColor(value) {
2833
+ const match = value.trim().match(HEX_COLOR_PATTERN);
2834
+ if (!match) return null;
2835
+ const hex = match[1];
2836
+ if (hex.length === 3 || hex.length === 4) {
2837
+ const [r, g, b, a = "f"] = hex.split("");
2838
+ return {
2839
+ r: Number.parseInt(r + r, 16),
2840
+ g: Number.parseInt(g + g, 16),
2841
+ b: Number.parseInt(b + b, 16),
2842
+ a: Number.parseInt(a + a, 16) / 255
2843
+ };
2844
+ }
2845
+ if (hex.length === 6 || hex.length === 8) {
2846
+ const alphaHex = hex.length === 8 ? hex.slice(6, 8) : "ff";
2847
+ return {
2848
+ r: Number.parseInt(hex.slice(0, 2), 16),
2849
+ g: Number.parseInt(hex.slice(2, 4), 16),
2850
+ b: Number.parseInt(hex.slice(4, 6), 16),
2851
+ a: Number.parseInt(alphaHex, 16) / 255
2852
+ };
2853
+ }
2854
+ return null;
2855
+ }
2856
+ function parseRgbChannel(value) {
2857
+ const normalized = value.trim();
2858
+ if (normalized.endsWith("%")) {
2859
+ return clamp(Math.round(Number.parseFloat(normalized) / 100 * 255), 0, 255);
2860
+ }
2861
+ return clamp(Math.round(Number.parseFloat(normalized)), 0, 255);
2862
+ }
2863
+ function parseRgbColor(value) {
2864
+ const match = value.trim().match(RGB_COLOR_PATTERN);
2865
+ if (!match) return null;
2866
+ const parts = match[1].split(/[,\s/]+/).map((part) => part.trim()).filter(Boolean);
2867
+ if (parts.length < 3) return null;
2868
+ return {
2869
+ r: parseRgbChannel(parts[0]),
2870
+ g: parseRgbChannel(parts[1]),
2871
+ b: parseRgbChannel(parts[2]),
2872
+ a: parseAlpha(parts[3])
2873
+ };
2874
+ }
2875
+ function parseOklchLightness(value) {
2876
+ const normalized = value.trim();
2877
+ if (normalized.endsWith("%")) {
2878
+ return clamp(Number.parseFloat(normalized) / 100, 0, 1);
2879
+ }
2880
+ return clamp(Number.parseFloat(normalized), 0, 1);
2881
+ }
2882
+ function parseHue(value) {
2883
+ const normalized = value.trim().toLowerCase();
2884
+ const numeric = Number.parseFloat(normalized);
2885
+ if (Number.isNaN(numeric)) return 0;
2886
+ if (normalized.endsWith("turn")) return numeric * 360;
2887
+ if (normalized.endsWith("rad")) return numeric * (180 / Math.PI);
2888
+ if (normalized.endsWith("grad")) return numeric * 0.9;
2889
+ return numeric;
2890
+ }
2891
+ function linearToSrgb(linear) {
2892
+ if (linear <= 31308e-7) {
2893
+ return 12.92 * linear;
2894
+ }
2895
+ return 1.055 * Math.pow(linear, 1 / 2.4) - 0.055;
2896
+ }
2897
+ function parseOklchColor(value) {
2898
+ const match = value.trim().match(OKLCH_COLOR_PATTERN);
2899
+ if (!match) return null;
2900
+ const [base2, alphaSegment] = match[1].split("/");
2901
+ const parts = base2.trim().split(/\s+/).map((part) => part.trim()).filter(Boolean);
2902
+ if (parts.length < 3) return null;
2903
+ const lightness = parseOklchLightness(parts[0]);
2904
+ const chroma = Number.parseFloat(parts[1]);
2905
+ const hueRadians = parseHue(parts[2]) * Math.PI / 180;
2906
+ const alpha = parseAlpha(alphaSegment);
2907
+ const a = chroma * Math.cos(hueRadians);
2908
+ const b = chroma * Math.sin(hueRadians);
2909
+ const l_ = lightness + 0.3963377774 * a + 0.2158037573 * b;
2910
+ const m_ = lightness - 0.1055613458 * a - 0.0638541728 * b;
2911
+ const s_ = lightness - 0.0894841775 * a - 1.291485548 * b;
2912
+ const l = l_ * l_ * l_;
2913
+ const m = m_ * m_ * m_;
2914
+ const s = s_ * s_ * s_;
2915
+ const linearR = 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s;
2916
+ const linearG = -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s;
2917
+ const linearB = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
2918
+ return {
2919
+ r: clamp(Math.round(linearToSrgb(linearR) * 255), 0, 255),
2920
+ g: clamp(Math.round(linearToSrgb(linearG) * 255), 0, 255),
2921
+ b: clamp(Math.round(linearToSrgb(linearB) * 255), 0, 255),
2922
+ a: alpha
2923
+ };
2924
+ }
2925
+ function parseCssColor(value) {
2926
+ const normalized = value.trim();
2927
+ if (!normalized) return null;
2928
+ return parseHexColor(normalized) ?? parseRgbColor(normalized) ?? parseOklchColor(normalized);
2929
+ }
2930
+ function compositeColor(foreground, background) {
2931
+ const alpha = foreground.a + background.a * (1 - foreground.a);
2932
+ if (alpha <= 0) {
2933
+ return { r: 0, g: 0, b: 0, a: 0 };
2934
+ }
2935
+ const r = (foreground.r * foreground.a + background.r * background.a * (1 - foreground.a)) / alpha;
2936
+ const g = (foreground.g * foreground.a + background.g * background.a * (1 - foreground.a)) / alpha;
2937
+ const b = (foreground.b * foreground.a + background.b * background.a * (1 - foreground.a)) / alpha;
2938
+ return {
2939
+ r: clamp(Math.round(r), 0, 255),
2940
+ g: clamp(Math.round(g), 0, 255),
2941
+ b: clamp(Math.round(b), 0, 255),
2942
+ a: clamp(alpha, 0, 1)
2943
+ };
2944
+ }
2945
+ function toHexChannel(value) {
2946
+ return value.toString(16).padStart(2, "0");
2947
+ }
2948
+ function rgbaToHex(value) {
2949
+ return `#${toHexChannel(value.r)}${toHexChannel(value.g)}${toHexChannel(value.b)}`;
2950
+ }
2951
+ function getFallbackPalette(isDarkMode) {
2952
+ if (isDarkMode) {
2953
+ return {
2954
+ background: "#171717",
2955
+ border: "#52525b",
2956
+ fontFamily: "Inter Variable, sans-serif",
2957
+ line: "#a1a1aa",
2958
+ surface: "#262626",
2959
+ surfaceAlt: "#3f3f46",
2960
+ text: "#fafafa"
2961
+ };
2962
+ }
2963
+ return {
2964
+ background: "#ffffff",
2965
+ border: "#e4e4e7",
2966
+ fontFamily: "Inter Variable, sans-serif",
2967
+ line: "#71717a",
2968
+ surface: "#ffffff",
2969
+ surfaceAlt: "#f4f4f5",
2970
+ text: "#18181b"
2971
+ };
2972
+ }
2973
+ function resolveColor(styles, property, fallback, background) {
2974
+ const parsed = parseCssColor(styles.getPropertyValue(property));
2975
+ if (!parsed) return fallback;
2976
+ if (parsed.a < 1 && background) {
2977
+ return rgbaToHex(compositeColor(parsed, background));
2978
+ }
2979
+ return rgbaToHex(parsed);
2980
+ }
2981
+ function resolvePalette(element, isDarkMode) {
2982
+ const fallback = getFallbackPalette(isDarkMode);
2983
+ const styles = window.getComputedStyle(element);
2984
+ const backgroundColor = parseCssColor(styles.getPropertyValue("--card")) ?? parseCssColor(styles.getPropertyValue("--background")) ?? parseCssColor(fallback.surface);
2985
+ return {
2986
+ background: resolveColor(styles, "--background", fallback.background, backgroundColor),
2987
+ border: resolveColor(styles, "--border", fallback.border, backgroundColor),
2988
+ fontFamily: styles.getPropertyValue("font-family").trim() || fallback.fontFamily,
2989
+ line: resolveColor(styles, "--muted-foreground", fallback.line, backgroundColor),
2990
+ surface: resolveColor(styles, "--card", fallback.surface, backgroundColor),
2991
+ surfaceAlt: resolveColor(styles, "--muted", fallback.surfaceAlt, backgroundColor),
2992
+ text: resolveColor(styles, "--foreground", fallback.text, backgroundColor)
2993
+ };
2994
+ }
2995
+ function buildThemeVariables(palette) {
2996
+ return {
2997
+ background: palette.background,
2998
+ clusterBkg: palette.surfaceAlt,
2999
+ clusterBorder: palette.border,
3000
+ edgeLabelBackground: palette.surface,
3001
+ fontFamily: palette.fontFamily,
3002
+ lineColor: palette.line,
3003
+ mainBkg: palette.surface,
3004
+ nodeBorder: palette.border,
3005
+ nodeTextColor: palette.text,
3006
+ primaryBorderColor: palette.border,
3007
+ primaryColor: palette.surfaceAlt,
3008
+ primaryTextColor: palette.text,
3009
+ secondaryBorderColor: palette.border,
3010
+ secondaryColor: palette.surface,
3011
+ secondaryTextColor: palette.text,
3012
+ tertiaryBorderColor: palette.border,
3013
+ tertiaryColor: palette.surface,
3014
+ tertiaryTextColor: palette.text,
3015
+ textColor: palette.text
3016
+ };
3017
+ }
3018
+ async function renderMermaidDiagram({
3019
+ code,
3020
+ host,
3021
+ id,
3022
+ palette
3023
+ }) {
3024
+ host.innerHTML = "";
3025
+ import_mermaid.default.initialize({
3026
+ flowchart: {
3027
+ htmlLabels: false,
3028
+ useMaxWidth: true
3029
+ },
3030
+ fontFamily: palette.fontFamily,
3031
+ secure: [...MERMAID_SECURE_KEYS],
3032
+ securityLevel: "strict",
3033
+ startOnLoad: false,
3034
+ theme: "base",
3035
+ themeVariables: buildThemeVariables(palette)
3036
+ });
3037
+ const { svg } = await import_mermaid.default.render(id, code, host);
3038
+ host.innerHTML = "";
3039
+ return svg;
3040
+ }
3041
+ function MermaidPreviewDialog({
3042
+ closeLabel,
3043
+ onOpenChange,
3044
+ open,
3045
+ svgMarkup,
3046
+ title
3047
+ }) {
3048
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Root, { open, onOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Dialog.Portal, { children: [
3049
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Overlay, { className: "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0" }),
3050
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Dialog.Content, { className: "fixed inset-[5vh] z-50 flex flex-col overflow-hidden rounded-3xl border border-border bg-background shadow-2xl outline-none data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95", children: [
3051
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between gap-4 border-b border-border px-5 py-4", children: [
3052
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Title, { className: "text-base font-semibold text-foreground", children: title }),
3053
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3054
+ "button",
3055
+ {
3056
+ type: "button",
3057
+ className: "inline-flex size-10 items-center justify-center rounded-full border border-border bg-card text-muted-foreground transition-colors hover:text-foreground",
3058
+ children: [
3059
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.X, { className: "size-4" }),
3060
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "sr-only", children: closeLabel })
3061
+ ]
3062
+ }
3063
+ ) })
3064
+ ] }),
3065
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex-1 overflow-auto bg-card p-6", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3066
+ "div",
3067
+ {
3068
+ "data-slot": "mermaid-preview",
3069
+ className: "min-h-full rounded-[calc(var(--radius)+0.5rem)] border border-border bg-background p-6 [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-none",
3070
+ dangerouslySetInnerHTML: { __html: svgMarkup }
3071
+ }
3072
+ ) })
3073
+ ] })
3074
+ ] }) });
3075
+ }
3076
+ function MermaidBlock({ code }) {
3077
+ const { t } = useChatkitTranslation();
3078
+ const { theme, isDarkMode } = useTheme();
3079
+ const containerRef = React15.useRef(null);
3080
+ const renderHostRef = React15.useRef(null);
3081
+ const renderSequenceRef = React15.useRef(0);
3082
+ const copyResetTimeoutRef = React15.useRef(null);
3083
+ const diagramId = React15.useId().replace(/:/g, "");
3084
+ const [activeTab, setActiveTab] = React15.useState("diagram");
3085
+ const [isCopied, setIsCopied] = React15.useState(false);
3086
+ const [isPreviewOpen, setIsPreviewOpen] = React15.useState(false);
3087
+ const [isRendering, setIsRendering] = React15.useState(true);
3088
+ const [renderError, setRenderError] = React15.useState(null);
3089
+ const [svgMarkup, setSvgMarkup] = React15.useState(null);
3090
+ const normalizedCode = React15.useMemo(() => normalizeMermaidCode(code), [code]);
3091
+ const clearCopyResetTimeout = React15.useCallback(() => {
3092
+ if (copyResetTimeoutRef.current === null) return;
3093
+ window.clearTimeout(copyResetTimeoutRef.current);
3094
+ copyResetTimeoutRef.current = null;
3095
+ }, []);
3096
+ React15.useEffect(() => {
3097
+ let isActive = true;
3098
+ async function runRender() {
3099
+ const container = containerRef.current;
3100
+ const renderHost = renderHostRef.current;
3101
+ if (!container || !renderHost) return;
3102
+ setIsRendering(true);
3103
+ setRenderError(null);
3104
+ try {
3105
+ renderSequenceRef.current += 1;
3106
+ const svg = await renderMermaidDiagram({
3107
+ code: normalizedCode,
3108
+ host: renderHost,
3109
+ id: `mermaid-${diagramId}-${renderSequenceRef.current}`,
3110
+ palette: resolvePalette(container, isDarkMode)
3111
+ });
3112
+ if (!isActive) return;
3113
+ setSvgMarkup(svg);
3114
+ } catch (error) {
3115
+ if (!isActive) return;
3116
+ setSvgMarkup(null);
3117
+ setRenderError(error instanceof Error ? error.message : "render_failed");
3118
+ setActiveTab((currentTab) => currentTab === "diagram" ? "code" : currentTab);
3119
+ } finally {
3120
+ if (isActive) {
3121
+ setIsRendering(false);
3122
+ renderHost.innerHTML = "";
3123
+ }
3124
+ }
3125
+ }
3126
+ void runRender();
3127
+ return () => {
3128
+ isActive = false;
3129
+ if (renderHostRef.current) {
3130
+ renderHostRef.current.innerHTML = "";
3131
+ }
3132
+ };
3133
+ }, [diagramId, isDarkMode, normalizedCode, theme]);
3134
+ React15.useEffect(() => {
3135
+ clearCopyResetTimeout();
3136
+ setIsCopied(false);
3137
+ }, [activeTab, clearCopyResetTimeout, code]);
3138
+ React15.useEffect(
3139
+ () => () => {
3140
+ clearCopyResetTimeout();
3141
+ },
3142
+ [clearCopyResetTimeout]
3143
+ );
3144
+ const handleDownload = React15.useCallback(() => {
3145
+ if (!svgMarkup) return;
3146
+ const blob = new Blob([svgMarkup], {
3147
+ type: "image/svg+xml;charset=utf-8"
3148
+ });
3149
+ const url = window.URL.createObjectURL(blob);
3150
+ const anchor = document.createElement("a");
3151
+ anchor.href = url;
3152
+ anchor.download = `mermaid-diagram-${diagramId}.svg`;
3153
+ document.body.append(anchor);
3154
+ anchor.click();
3155
+ anchor.remove();
3156
+ window.URL.revokeObjectURL(url);
3157
+ }, [diagramId, svgMarkup]);
3158
+ const handleCopyCode = React15.useCallback(() => {
3159
+ if (!code || isCopied) return;
3160
+ navigator.clipboard.writeText(code).then(() => {
3161
+ setIsCopied(true);
3162
+ clearCopyResetTimeout();
3163
+ copyResetTimeoutRef.current = window.setTimeout(() => {
3164
+ setIsCopied(false);
3165
+ copyResetTimeoutRef.current = null;
3166
+ }, 3e3);
3167
+ }).catch(() => {
3168
+ });
3169
+ }, [clearCopyResetTimeout, code, isCopied]);
3170
+ const hasRenderedDiagram = svgMarkup !== null && !renderError;
3171
+ const statusMessage = isRendering ? t("markdown.mermaid.rendering") : t("markdown.mermaid.failed");
3172
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
3173
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3174
+ Tabs,
2471
3175
  {
2472
- variant: "ghost",
2473
- size: "icon",
2474
- ...rest,
2475
- className: cn("size-6 p-1", className),
2476
- ref,
2477
- children: [
2478
- children,
2479
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "sr-only", children: tooltip })
2480
- ]
3176
+ className: "w-full",
3177
+ onValueChange: (value) => setActiveTab(value),
3178
+ value: activeTab,
3179
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3180
+ "div",
3181
+ {
3182
+ ref: containerRef,
3183
+ "data-slot": "mermaid-block",
3184
+ className: "relative overflow-hidden text-card-foreground",
3185
+ children: [
3186
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3187
+ "div",
3188
+ {
3189
+ ref: renderHostRef,
3190
+ "aria-hidden": "true",
3191
+ className: "pointer-events-none absolute inset-0 -z-10 overflow-hidden opacity-0",
3192
+ "data-slot": "mermaid-render-host"
3193
+ }
3194
+ ),
3195
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 px-4 py-3", children: [
3196
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
3197
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "inline-flex size-9 shrink-0 items-center justify-center rounded-full bg-muted text-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Code2Icon, { className: "size-4" }) }),
3198
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate text-base font-semibold text-foreground", children: t("markdown.mermaid.title") })
3199
+ ] }),
3200
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
3201
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-1", children: [
3202
+ activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3203
+ TooltipIconButton,
3204
+ {
3205
+ onClick: handleDownload,
3206
+ tooltip: t("markdown.mermaid.download"),
3207
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.DownloadIcon, { className: "size-4" })
3208
+ }
3209
+ ) : null,
3210
+ activeTab === "diagram" && hasRenderedDiagram ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3211
+ TooltipIconButton,
3212
+ {
3213
+ onClick: () => setIsPreviewOpen(true),
3214
+ tooltip: t("markdown.mermaid.fullScreen"),
3215
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.ExpandIcon, { className: "size-4" })
3216
+ }
3217
+ ) : null,
3218
+ activeTab === "code" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3219
+ TooltipIconButton,
3220
+ {
3221
+ onClick: handleCopyCode,
3222
+ tooltip: t("markdown.copy"),
3223
+ children: isCopied ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CheckIcon, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.CopyIcon, { className: "size-4" })
3224
+ }
3225
+ ) : null
3226
+ ] }),
3227
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(TabsList, { children: [
3228
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsTrigger, { value: "diagram", children: t("markdown.mermaid.diagram") }),
3229
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsTrigger, { value: "code", children: t("markdown.mermaid.code") })
3230
+ ] })
3231
+ ] })
3232
+ ] }),
3233
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "border-t border-border pt-4", children: [
3234
+ renderError ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { role: "alert", className: "mb-4 text-sm font-medium text-destructive", children: t("markdown.mermaid.failed") }) : null,
3235
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsContent, { value: "diagram", className: "mt-0 space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3236
+ "div",
3237
+ {
3238
+ className: cn(
3239
+ "relative overflow-auto rounded-[calc(var(--radius)+0.5rem)] border border-border bg-background p-4",
3240
+ hasRenderedDiagram ? "[&_svg]:mx-auto [&_svg]:h-auto [&_svg]:w-full [&_svg]:max-w-none" : "min-h-[14rem]"
3241
+ ),
3242
+ children: hasRenderedDiagram ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3243
+ "div",
3244
+ {
3245
+ "data-slot": "mermaid-diagram",
3246
+ dangerouslySetInnerHTML: { __html: svgMarkup }
3247
+ }
3248
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex min-h-[12rem] flex-col items-center justify-center gap-3 text-center text-muted-foreground", children: [
3249
+ isRendering ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.Loader2, { className: "size-5 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react7.TriangleAlert, { className: "size-5 text-destructive" }),
3250
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3251
+ "p",
3252
+ {
3253
+ className: cn("text-sm font-medium", !isRendering && "text-destructive"),
3254
+ role: renderError ? "alert" : void 0,
3255
+ children: statusMessage
3256
+ }
3257
+ )
3258
+ ] })
3259
+ }
3260
+ ) }),
3261
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsContent, { value: "code", className: "mt-0", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3262
+ "pre",
3263
+ {
3264
+ "data-slot": "mermaid-code",
3265
+ className: "overflow-x-auto rounded-[calc(var(--radius)+0.5rem)] border border-border bg-zinc-950 px-4 py-4 text-sm text-zinc-50",
3266
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("code", { className: "block whitespace-pre font-mono", children: code })
3267
+ }
3268
+ ) })
3269
+ ] })
3270
+ ]
3271
+ }
3272
+ )
2481
3273
  }
2482
- ) }),
2483
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(TooltipContent, { side, children: tooltip })
2484
- ] }) });
2485
- });
2486
- TooltipIconButton.displayName = "TooltipIconButton";
3274
+ ),
3275
+ svgMarkup ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3276
+ MermaidPreviewDialog,
3277
+ {
3278
+ closeLabel: t("sheet.close"),
3279
+ onOpenChange: setIsPreviewOpen,
3280
+ open: isPreviewOpen,
3281
+ svgMarkup,
3282
+ title: t("markdown.mermaid.title")
3283
+ }
3284
+ ) : null
3285
+ ] });
3286
+ }
2487
3287
 
2488
3288
  // src/components/thread/markdown-text.tsx
2489
3289
  var import_katex_min = require("katex/dist/katex.min.css");
2490
- var import_jsx_runtime18 = require("react/jsx-runtime");
3290
+ var import_jsx_runtime20 = require("react/jsx-runtime");
3291
+ var markdownTableMinWidth = "max(7rem, calc(8rem * var(--density-spacing, 1)))";
3292
+ var markdownTableCellPaddingInline = "calc(var(--density-padding, 1rem) * 1.25)";
3293
+ var markdownTableCellPaddingBlock = "max(0.5rem, calc(var(--density-padding, 1rem) * 0.75))";
3294
+ var markdownTableLineHeight = "max(1.375rem, calc(1.5rem * var(--density-spacing, 1)))";
3295
+ var markdownInlineCodePaddingInline = "max(0.25rem, calc(var(--density-gap, 0.5rem) * 0.75))";
3296
+ var markdownInlineCodePaddingBlock = "max(0.125rem, calc(var(--density-gap, 0.5rem) * 0.5))";
2491
3297
  var getTextContent = (children) => import_react6.Children.toArray(children).map((child) => {
2492
3298
  if (typeof child === "string" || typeof child === "number") {
2493
3299
  return String(child);
2494
3300
  }
2495
3301
  return "";
2496
3302
  }).join("");
3303
+ var isMermaidBlockChild = (child) => (0, import_react6.isValidElement)(child) && child.type === MermaidBlock;
3304
+ var isMermaidCodeElement = (child) => (0, import_react6.isValidElement)(child) && typeof child.props.className === "string" && child.props.className.includes("language-mermaid");
2497
3305
  var useCopyToClipboard = ({
2498
3306
  copiedDuration = 3e3
2499
3307
  } = {}) => {
@@ -2514,23 +3322,23 @@ var CodeHeader = ({ language, code }) => {
2514
3322
  if (!code || isCopied) return;
2515
3323
  copyToClipboard(code);
2516
3324
  };
2517
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-center justify-between gap-4 rounded-t-lg bg-zinc-900 px-4 py-2 text-sm font-semibold text-white", children: [
2518
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "lowercase [&>span]:text-xs", children: language }),
2519
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
3325
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center justify-between gap-4 rounded-t-lg bg-zinc-900 px-4 py-2 text-sm font-semibold text-white", children: [
3326
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "lowercase [&>span]:text-xs", children: language }),
3327
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2520
3328
  TooltipIconButton,
2521
3329
  {
2522
3330
  tooltip: t("markdown.copy"),
2523
3331
  onClick: onCopy,
2524
3332
  children: [
2525
- !isCopied && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CopyIcon, {}),
2526
- isCopied && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react6.CheckIcon, {})
3333
+ !isCopied && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.CopyIcon, {}),
3334
+ isCopied && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react8.CheckIcon, {})
2527
3335
  ]
2528
3336
  }
2529
3337
  )
2530
3338
  ] });
2531
3339
  };
2532
3340
  var defaultComponents = {
2533
- h1: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3341
+ h1: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2534
3342
  "h1",
2535
3343
  {
2536
3344
  className: cn(
@@ -2540,7 +3348,7 @@ var defaultComponents = {
2540
3348
  ...props
2541
3349
  }
2542
3350
  ),
2543
- h2: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3351
+ h2: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2544
3352
  "h2",
2545
3353
  {
2546
3354
  className: cn(
@@ -2550,7 +3358,7 @@ var defaultComponents = {
2550
3358
  ...props
2551
3359
  }
2552
3360
  ),
2553
- h3: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3361
+ h3: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2554
3362
  "h3",
2555
3363
  {
2556
3364
  className: cn(
@@ -2560,7 +3368,7 @@ var defaultComponents = {
2560
3368
  ...props
2561
3369
  }
2562
3370
  ),
2563
- h4: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3371
+ h4: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2564
3372
  "h4",
2565
3373
  {
2566
3374
  className: cn(
@@ -2570,7 +3378,7 @@ var defaultComponents = {
2570
3378
  ...props
2571
3379
  }
2572
3380
  ),
2573
- h5: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3381
+ h5: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2574
3382
  "h5",
2575
3383
  {
2576
3384
  className: cn(
@@ -2580,21 +3388,21 @@ var defaultComponents = {
2580
3388
  ...props
2581
3389
  }
2582
3390
  ),
2583
- h6: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3391
+ h6: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2584
3392
  "h6",
2585
3393
  {
2586
3394
  className: cn("my-4 font-semibold first:mt-0 last:mb-0", className),
2587
3395
  ...props
2588
3396
  }
2589
3397
  ),
2590
- p: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3398
+ p: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2591
3399
  "p",
2592
3400
  {
2593
3401
  className: cn("mt-5 mb-5 leading-7 first:mt-0 last:mb-0", className),
2594
3402
  ...props
2595
3403
  }
2596
3404
  ),
2597
- a: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3405
+ a: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2598
3406
  "a",
2599
3407
  {
2600
3408
  className: cn(
@@ -2610,7 +3418,7 @@ var defaultComponents = {
2610
3418
  className,
2611
3419
  node: _node,
2612
3420
  ...props
2613
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3421
+ }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2614
3422
  "blockquote",
2615
3423
  {
2616
3424
  className: cn(
@@ -2620,21 +3428,21 @@ var defaultComponents = {
2620
3428
  ...props
2621
3429
  }
2622
3430
  ),
2623
- ul: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3431
+ ul: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2624
3432
  "ul",
2625
3433
  {
2626
3434
  className: cn("my-5 list-outside list-disc pl-6 [&>li]:mt-2", className),
2627
3435
  ...props
2628
3436
  }
2629
3437
  ),
2630
- ol: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3438
+ ol: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2631
3439
  "ol",
2632
3440
  {
2633
3441
  className: cn("my-5 list-outside list-decimal pl-8 [&>li]:mt-2", className),
2634
3442
  ...props
2635
3443
  }
2636
3444
  ),
2637
- hr: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3445
+ hr: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2638
3446
  "hr",
2639
3447
  {
2640
3448
  className: cn("my-5 border-b", className),
@@ -2644,85 +3452,123 @@ var defaultComponents = {
2644
3452
  table: ({
2645
3453
  className,
2646
3454
  node: _node,
3455
+ style,
2647
3456
  ...props
2648
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2649
- "table",
3457
+ }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3458
+ "div",
2650
3459
  {
2651
- className: cn(
2652
- "my-5 w-full border-separate border-spacing-0 overflow-y-auto",
2653
- className
2654
- ),
2655
- ...props
3460
+ "data-slot": "markdown-table-container",
3461
+ className: "my-5 max-w-full overflow-x-auto rounded-xl border border-border bg-background",
3462
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3463
+ "table",
3464
+ {
3465
+ className: cn(
3466
+ "min-w-full w-max border-separate border-spacing-0 text-sm",
3467
+ className
3468
+ ),
3469
+ style: {
3470
+ lineHeight: markdownTableLineHeight,
3471
+ ...style
3472
+ },
3473
+ ...props
3474
+ }
3475
+ )
2656
3476
  }
2657
3477
  ),
2658
- th: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3478
+ th: ({
3479
+ className,
3480
+ node: _node,
3481
+ style,
3482
+ ...props
3483
+ }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2659
3484
  "th",
2660
3485
  {
2661
3486
  className: cn(
2662
- "bg-muted border-border border-y border-l px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",
3487
+ "bg-muted/80 border-border border-l text-left align-top font-semibold whitespace-normal break-words first:border-l-0 first:rounded-tl-xl last:rounded-tr-xl [&[align=center]]:text-center [&[align=right]]:text-right",
2663
3488
  className
2664
3489
  ),
3490
+ style: {
3491
+ minWidth: markdownTableMinWidth,
3492
+ paddingInline: markdownTableCellPaddingInline,
3493
+ paddingBlock: markdownTableCellPaddingBlock,
3494
+ ...style
3495
+ },
2665
3496
  ...props
2666
3497
  }
2667
3498
  ),
2668
- td: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3499
+ td: ({
3500
+ className,
3501
+ node: _node,
3502
+ style,
3503
+ ...props
3504
+ }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2669
3505
  "td",
2670
3506
  {
2671
3507
  className: cn(
2672
- "border-border border-b border-l px-4 py-2 text-left last:border-r [&[align=center]]:text-center [&[align=right]]:text-right",
3508
+ "border-border border-t border-l text-left align-top whitespace-normal break-words first:border-l-0 [&[align=center]]:text-center [&[align=right]]:text-right [&_code]:break-words [&_code]:whitespace-pre-wrap [&_code]:[overflow-wrap:anywhere]",
2673
3509
  className
2674
3510
  ),
3511
+ style: {
3512
+ minWidth: markdownTableMinWidth,
3513
+ paddingInline: markdownTableCellPaddingInline,
3514
+ paddingBlock: markdownTableCellPaddingBlock,
3515
+ ...style
3516
+ },
2675
3517
  ...props
2676
3518
  }
2677
3519
  ),
2678
- tr: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3520
+ tr: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2679
3521
  "tr",
2680
3522
  {
2681
3523
  className: cn(
2682
- "m-0 p-0 even:bg-muted/50 [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",
3524
+ "m-0 p-0 even:bg-muted/30 [&:last-child>td:first-child]:rounded-bl-xl [&:last-child>td:last-child]:rounded-br-xl",
2683
3525
  className
2684
3526
  ),
2685
3527
  ...props
2686
3528
  }
2687
3529
  ),
2688
- sup: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3530
+ sup: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2689
3531
  "sup",
2690
3532
  {
2691
3533
  className: cn("[&>a]:text-xs [&>a]:no-underline", className),
2692
3534
  ...props
2693
3535
  }
2694
3536
  ),
2695
- pre: ({ className, node: _node, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3537
+ pre: ({ className, children, node: _node }) => import_react6.Children.toArray(children).length === 1 && (isMermaidBlockChild(import_react6.Children.toArray(children)[0]) || isMermaidCodeElement(import_react6.Children.toArray(children)[0])) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2696
3538
  "div",
2697
3539
  {
2698
3540
  className: cn(
2699
3541
  "max-w-4xl overflow-x-auto rounded-lg text-sm bg-black text-white dark:bg-zinc-800",
2700
3542
  className
2701
3543
  ),
2702
- ...props
3544
+ children
2703
3545
  }
2704
3546
  ),
2705
3547
  code: ({
2706
3548
  className,
2707
3549
  children,
2708
3550
  node: _node,
3551
+ style,
2709
3552
  ...props
2710
3553
  }) => {
2711
- const match = /language-(\w+)/.exec(className || "");
3554
+ const match = /language-([\w-]+)/.exec(className || "");
2712
3555
  const code = getTextContent(children);
2713
3556
  const isBlockCode = code.includes("\n");
2714
3557
  if (match) {
2715
3558
  const language = match[1];
2716
3559
  const normalizedCode = code.replace(/\n$/, "");
2717
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
2718
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3560
+ if (language === "mermaid") {
3561
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MermaidBlock, { code: normalizedCode });
3562
+ }
3563
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
3564
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2719
3565
  CodeHeader,
2720
3566
  {
2721
3567
  language,
2722
3568
  code: normalizedCode
2723
3569
  }
2724
3570
  ),
2725
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3571
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2726
3572
  SyntaxHighlighter,
2727
3573
  {
2728
3574
  language,
@@ -2733,7 +3579,7 @@ var defaultComponents = {
2733
3579
  ] });
2734
3580
  }
2735
3581
  if (isBlockCode) {
2736
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3582
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2737
3583
  "code",
2738
3584
  {
2739
3585
  className: cn(
@@ -2745,13 +3591,18 @@ var defaultComponents = {
2745
3591
  }
2746
3592
  );
2747
3593
  }
2748
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3594
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2749
3595
  "code",
2750
3596
  {
2751
3597
  className: cn(
2752
- "bg-muted rounded px-1.5 py-0.5 font-mono text-[0.9em] font-semibold break-all",
3598
+ "bg-muted rounded font-mono text-[0.9em] font-semibold whitespace-pre-wrap [overflow-wrap:anywhere]",
2753
3599
  className
2754
3600
  ),
3601
+ style: {
3602
+ paddingInline: markdownInlineCodePaddingInline,
3603
+ paddingBlock: markdownInlineCodePaddingBlock,
3604
+ ...style
3605
+ },
2755
3606
  ...props,
2756
3607
  children
2757
3608
  }
@@ -2759,7 +3610,7 @@ var defaultComponents = {
2759
3610
  }
2760
3611
  };
2761
3612
  var MarkdownTextImpl = ({ children }) => {
2762
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "markdown-content", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
3613
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "markdown-content", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2763
3614
  import_react_markdown.default,
2764
3615
  {
2765
3616
  remarkPlugins: [import_remark_gfm.default, import_remark_math.default],
@@ -2773,18 +3624,18 @@ var MarkdownText = (0, import_react6.memo)(MarkdownTextImpl);
2773
3624
 
2774
3625
  // src/components/thread/messages/widget.tsx
2775
3626
  var import_a2ui_react = require("@xpert-ai/a2ui-react");
2776
- var import_jsx_runtime19 = require("react/jsx-runtime");
3627
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2777
3628
  function WidgetMessage({ messageId, data }) {
2778
3629
  const widgets = Array.isArray(data.widgets) ? data.widgets : [];
2779
3630
  if (widgets.length === 0) return null;
2780
3631
  const baseSurfaceId = `widget-${messageId}`;
2781
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
3632
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "space-y-3", children: widgets.map((widget, index) => {
2782
3633
  const config = widget?.config;
2783
3634
  if (!config || typeof config !== "object") {
2784
3635
  return null;
2785
3636
  }
2786
3637
  const surfaceId = widgets.length > 1 ? `${baseSurfaceId}-${index}` : baseSurfaceId;
2787
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
3638
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2788
3639
  import_a2ui_react.SurfaceRenderer,
2789
3640
  {
2790
3641
  surfaceId,
@@ -2796,7 +3647,7 @@ function WidgetMessage({ messageId, data }) {
2796
3647
  }
2797
3648
 
2798
3649
  // src/components/thread/messages/ai.tsx
2799
- var import_jsx_runtime20 = require("react/jsx-runtime");
3650
+ var import_jsx_runtime22 = require("react/jsx-runtime");
2800
3651
  function isTextContent(content) {
2801
3652
  return content.type === "text";
2802
3653
  }
@@ -2812,15 +3663,15 @@ function isComponentContent(content) {
2812
3663
  var statusConfig = {
2813
3664
  success: {
2814
3665
  iconClass: "border-green-500 text-green-700",
2815
- icon: import_lucide_react7.CheckCircle2
3666
+ icon: import_lucide_react9.CheckCircle2
2816
3667
  },
2817
3668
  fail: {
2818
3669
  iconClass: "border-red-500 text-red-700",
2819
- icon: import_lucide_react7.XCircle
3670
+ icon: import_lucide_react9.XCircle
2820
3671
  },
2821
3672
  running: {
2822
3673
  iconClass: "border-blue-500 text-blue-700",
2823
- icon: import_lucide_react7.Loader2
3674
+ icon: import_lucide_react9.Loader2
2824
3675
  }
2825
3676
  };
2826
3677
  function isWidgetComponent(content) {
@@ -2837,14 +3688,17 @@ function safeJson(value) {
2837
3688
  return String(value);
2838
3689
  }
2839
3690
  }
3691
+ function formatDisplayValue(value) {
3692
+ return typeof value === "string" ? value : safeJson(value);
3693
+ }
2840
3694
  function ReasoningBlock({ reasoning }) {
2841
3695
  const blocks = reasoning.filter((item) => item.text?.trim());
2842
3696
  if (blocks.length === 0) return null;
2843
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3697
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-2", children: blocks.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2844
3698
  "div",
2845
3699
  {
2846
3700
  className: "rounded-lg border bg-muted/40 p-3 text-xs text-muted-foreground",
2847
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
3701
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "whitespace-pre-wrap wrap-break-word leading-relaxed", children: item.text })
2848
3702
  },
2849
3703
  item.id ?? `reasoning-${index}`
2850
3704
  )) });
@@ -2852,27 +3706,57 @@ function ReasoningBlock({ reasoning }) {
2852
3706
  function ImageBlock({ content }) {
2853
3707
  const imageUrl = typeof content.image_url === "string" ? content.image_url : typeof content.image_url?.url === "string" ? content.image_url.url : null;
2854
3708
  if (!imageUrl) {
2855
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Card, { children: [
2856
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
2857
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson(content) })
3709
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Card, { children: [
3710
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardHeader, { className: "space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardTitle, { className: "text-sm", children: "Image" }) }),
3711
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: safeJson(content) })
2858
3712
  ] });
2859
3713
  }
2860
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
3714
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("figure", { className: "overflow-hidden rounded-lg border bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("img", { src: imageUrl, alt: "Assistant output", className: "h-auto w-full object-cover" }) });
2861
3715
  }
2862
3716
  function MemoryBlock({ content }) {
2863
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Card, { children: [
2864
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
2865
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
2866
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { variant: "secondary", children: "Memory" })
3717
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Card, { children: [
3718
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
3719
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardTitle, { className: "text-sm", children: "Memory" }),
3720
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Badge, { variant: "secondary", children: "Memory" })
2867
3721
  ] }),
2868
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson(content.data ?? []) }) })
3722
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: safeJson(content.data ?? []) }) })
2869
3723
  ] });
2870
3724
  }
3725
+ function parseStepDate(value) {
3726
+ if (value instanceof Date) {
3727
+ const timestamp2 = value.getTime();
3728
+ return Number.isNaN(timestamp2) ? null : timestamp2;
3729
+ }
3730
+ if (typeof value !== "string") {
3731
+ return null;
3732
+ }
3733
+ const timestamp = Date.parse(value);
3734
+ return Number.isNaN(timestamp) ? null : timestamp;
3735
+ }
3736
+ function formatStepDuration(durationMs) {
3737
+ if (durationMs < 1e3) {
3738
+ return `${durationMs}ms`;
3739
+ }
3740
+ if (durationMs < 1e4) {
3741
+ return `${(durationMs / 1e3).toFixed(1)}s`;
3742
+ }
3743
+ if (durationMs < 6e4) {
3744
+ return `${Math.round(durationMs / 1e3)}s`;
3745
+ }
3746
+ const hours = Math.floor(durationMs / 36e5);
3747
+ const minutes = Math.floor(durationMs % 36e5 / 6e4);
3748
+ const seconds = Math.floor(durationMs % 6e4 / 1e3);
3749
+ if (hours > 0) {
3750
+ return `${hours}h ${minutes}m ${seconds}s`;
3751
+ }
3752
+ return `${minutes}m ${seconds}s`;
3753
+ }
2871
3754
  function ComponentBlock({ content }) {
2872
- const [isExpanded, setIsExpanded] = React14.useState(false);
2873
- const contentRef = React14.useRef(null);
2874
- const shouldAutoScrollRef = React14.useRef(true);
2875
- const previousScrollTopRef = React14.useRef(0);
3755
+ const [isExpanded, setIsExpanded] = React16.useState(false);
3756
+ const contentRef = React16.useRef(null);
3757
+ const shouldAutoScrollRef = React16.useRef(true);
3758
+ const previousScrollTopRef = React16.useRef(0);
3759
+ const [durationNow, setDurationNow] = React16.useState(() => Date.now());
2876
3760
  const data = content.data ?? {};
2877
3761
  const category = data.category ?? "Component";
2878
3762
  const title = data.tool && category === "Tool" ? data.tool : data.title ?? data.type ?? "Component";
@@ -2880,12 +3764,28 @@ function ComponentBlock({ content }) {
2880
3764
  const message = data.message ?? null;
2881
3765
  const output = data.output ?? null;
2882
3766
  const error = data.error ?? null;
2883
- const fallback = message ?? output ?? safeJson(data.data ?? data);
3767
+ const fallback = message ?? output ?? data.data ?? data;
2884
3768
  const hasOutput = message !== null || output !== null;
2885
- React14.useEffect(() => {
3769
+ const createdAt = parseStepDate(data.created_date);
3770
+ const endedAt = parseStepDate(data.end_date);
3771
+ const durationMs = createdAt === null ? null : Math.max(0, (endedAt ?? durationNow) - createdAt);
3772
+ const durationLabel = durationMs === null ? null : formatStepDuration(durationMs);
3773
+ React16.useEffect(() => {
2886
3774
  if (status === "running" && output !== null) setIsExpanded(true);
2887
3775
  }, [status, output]);
2888
- React14.useEffect(() => {
3776
+ React16.useEffect(() => {
3777
+ if (status !== "running" || createdAt === null || endedAt !== null) {
3778
+ return;
3779
+ }
3780
+ setDurationNow(Date.now());
3781
+ const timer = window.setInterval(() => {
3782
+ setDurationNow(Date.now());
3783
+ }, 100);
3784
+ return () => {
3785
+ window.clearInterval(timer);
3786
+ };
3787
+ }, [createdAt, endedAt, status]);
3788
+ React16.useEffect(() => {
2889
3789
  const element = contentRef.current;
2890
3790
  if (!element) return;
2891
3791
  previousScrollTopRef.current = element.scrollTop;
@@ -2905,7 +3805,7 @@ function ComponentBlock({ content }) {
2905
3805
  element.removeEventListener("scroll", updateAutoScrollState);
2906
3806
  };
2907
3807
  }, [isExpanded]);
2908
- React14.useEffect(() => {
3808
+ React16.useEffect(() => {
2909
3809
  if (status !== "running") {
2910
3810
  shouldAutoScrollRef.current = true;
2911
3811
  return;
@@ -2918,21 +3818,25 @@ function ComponentBlock({ content }) {
2918
3818
  }, [isExpanded, output, status]);
2919
3819
  const config = status ? statusConfig[status] : null;
2920
3820
  const StatusIcon = config?.icon;
2921
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Card, { children: [
2922
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
2923
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
2924
- status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
2925
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardTitle, { className: "text-sm truncate", children: title })
3821
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Card, { children: [
3822
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2 px-2 py-1 cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
3823
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center space-x-1 flex-1 min-w-0", children: [
3824
+ status && StatusIcon && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(StatusIcon, { className: cn("h-4 w-4", config?.iconClass, status === "running" && "animate-spin") }),
3825
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardTitle, { className: "text-sm truncate", children: title })
2926
3826
  ] }),
2927
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
2928
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
2929
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
3827
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-wrap items-center gap-2 shrink-0", children: [
3828
+ durationLabel && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "inline-flex items-center gap-1 text-[11px] text-muted-foreground tabular-nums", children: [
3829
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Clock3, { className: "h-3 w-3" }),
3830
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: durationLabel })
3831
+ ] }),
3832
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Badge, { variant: "secondary", className: "rounded-lg px-1.5", children: category }),
3833
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
2930
3834
  "button",
2931
3835
  {
2932
3836
  className: "text-muted-foreground hover:text-foreground transition-colors",
2933
3837
  "aria-label": isExpanded ? "Collapse" : "Expand",
2934
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2935
- import_lucide_react7.ChevronDown,
3838
+ children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3839
+ import_lucide_react9.ChevronDown,
2936
3840
  {
2937
3841
  className: cn("h-4 w-4 transition-transform", isExpanded && "rotate-180")
2938
3842
  }
@@ -2941,55 +3845,55 @@ function ComponentBlock({ content }) {
2941
3845
  )
2942
3846
  ] })
2943
3847
  ] }),
2944
- isExpanded && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
2945
- data.input && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: JSON.stringify(data.input, null, 2) }),
2946
- error ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: typeof error === "string" ? error : safeJson(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: fallback })
3848
+ isExpanded && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CardContent, { ref: contentRef, className: "text-xs text-muted-foreground max-h-60 overflow-auto", children: [
3849
+ data.input && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue(data.input) }),
3850
+ error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word text-destructive", children: formatDisplayValue(error) }) : hasOutput && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { className: "whitespace-pre-wrap wrap-break-word", children: formatDisplayValue(fallback) })
2947
3851
  ] })
2948
3852
  ] });
2949
3853
  }
2950
3854
  function UnknownBlock({ content }) {
2951
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Card, { children: [
2952
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
2953
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
2954
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
3855
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Card, { children: [
3856
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(CardHeader, { className: "flex flex-row items-center justify-between gap-2", children: [
3857
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardTitle, { className: "text-sm", children: "Assistant Content" }),
3858
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Badge, { variant: "outline", children: content.type ?? "unknown" })
2955
3859
  ] }),
2956
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson(content) }) })
3860
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CardContent, { className: "text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("pre", { className: "whitespace-pre-wrap break-words", children: safeJson(content) }) })
2957
3861
  ] });
2958
3862
  }
2959
3863
  function renderContentItem(content, index, messageId) {
2960
3864
  if (typeof content === "string") {
2961
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
2962
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MarkdownText, { children: content }),
3865
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
3866
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MarkdownText, { children: content }),
2963
3867
  ";"
2964
3868
  ] }, `text-${index}`);
2965
3869
  }
2966
3870
  if (isTextContent(content)) {
2967
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
3871
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MarkdownText, { children: content.text }) }, content.id ?? `text-${index}`);
2968
3872
  }
2969
3873
  if (isReasoningContent(content)) {
2970
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
3874
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ReasoningBlock, { reasoning: [content] }) }, content.id ?? `reasoning-${index}`);
2971
3875
  }
2972
3876
  if (isImageContent(content)) {
2973
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
3877
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ImageBlock, { content }) }, content.id ?? `image-${index}`);
2974
3878
  }
2975
3879
  if (isComponentContent(content)) {
2976
3880
  if (isWidgetComponent(content)) {
2977
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
3881
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(WidgetMessage, { messageId, data: content.data }) }, content.id ?? `widget-${index}`);
2978
3882
  }
2979
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
3883
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ComponentBlock, { content }) }, content.id ?? `component-${index}`);
2980
3884
  }
2981
3885
  if (isMemoryContent(content)) {
2982
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
3886
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MemoryBlock, { content }) }, content.id ?? `memory-${index}`);
2983
3887
  }
2984
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
3888
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(UnknownBlock, { content }) }, content.id ?? `unknown-${index}`);
2985
3889
  }
2986
3890
  function renderContent(content, messageId) {
2987
3891
  if (typeof content === "string") {
2988
3892
  if (!content.trim()) return null;
2989
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(MarkdownText, { children: content });
3893
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(MarkdownText, { children: content });
2990
3894
  }
2991
3895
  if (!Array.isArray(content) || content.length === 0) return null;
2992
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-3", children: content.map((item, index) => renderContentItem(item, index, messageId)) });
3896
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "space-y-3", children: content.map((item, index) => renderContentItem(item, index, messageId)) });
2993
3897
  }
2994
3898
  function AssistantStreamingIndicator({
2995
3899
  status,
@@ -3001,19 +3905,19 @@ function AssistantStreamingIndicator({
3001
3905
  thinking: t("message.thinking"),
3002
3906
  answering: t("message.answering")
3003
3907
  };
3004
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("flex items-center gap-2 text-xs text-muted-foreground", className), children: [
3005
- status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react7.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
3006
- status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
3007
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
3008
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
3009
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
3908
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cn("flex items-center gap-2 text-xs text-muted-foreground", className), children: [
3909
+ status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Loader2, { className: "h-3.5 w-3.5 animate-spin" }),
3910
+ status === "thinking" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
3911
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.3s]" }),
3912
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce [animation-delay:-0.15s]" }),
3913
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-current animate-bounce" })
3010
3914
  ] }),
3011
- status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
3012
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
3013
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
3014
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
3915
+ status === "answering" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-end gap-1", "aria-hidden": "true", children: [
3916
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-2 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.25s]" }),
3917
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-3 w-0.5 rounded-full bg-current animate-pulse [animation-delay:-0.1s]" }),
3918
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "h-2.5 w-0.5 rounded-full bg-current animate-pulse" })
3015
3919
  ] }),
3016
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: labelMap[status] })
3920
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: labelMap[status] })
3017
3921
  ] });
3018
3922
  }
3019
3923
  function AssistantMessage({
@@ -3027,42 +3931,42 @@ function AssistantMessage({
3027
3931
  const hasReasoning = hasRenderableReasoning(message.reasoning);
3028
3932
  const resolvedStreamingStatus = streamingStatus ?? getAssistantStreamingStatus(message, isStreaming);
3029
3933
  const answerNode = renderContent(message.content, message.id);
3030
- const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ReasoningBlock, { reasoning: message.reasoning ?? [] }) : null;
3934
+ const reasoningNode = hasReasoning ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ReasoningBlock, { reasoning: message.reasoning ?? [] }) : null;
3031
3935
  if (!hasRenderableAssistantMessage(message) && !resolvedStreamingStatus) return null;
3032
3936
  const streamingClass = isStreaming ? "streaming-active" : "";
3033
3937
  if (!hasRenderableAssistantMessage(message) && resolvedStreamingStatus) {
3034
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
3938
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cn("space-y-3", streamingClass, className), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) });
3035
3939
  }
3036
3940
  if (hasContent && hasReasoning) {
3037
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
3038
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3941
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
3942
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3039
3943
  Tabs,
3040
3944
  {
3041
3945
  defaultValue: message.status === "reasoning" ? "reasoning" : "answer",
3042
3946
  className: "w-full",
3043
3947
  children: [
3044
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(TabsList, { className: "h-9", children: [
3045
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
3046
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
3948
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(TabsList, { className: "", children: [
3949
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabsTrigger, { value: "answer", children: t("message.answer") }),
3950
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabsTrigger, { value: "reasoning", children: t("message.reasoning") })
3047
3951
  ] }),
3048
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
3049
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
3952
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabsContent, { value: "answer", className: "space-y-3", children: answerNode }),
3953
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(TabsContent, { value: "reasoning", className: "space-y-3", children: reasoningNode })
3050
3954
  ]
3051
3955
  }
3052
3956
  ),
3053
- resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
3957
+ resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
3054
3958
  ] });
3055
3959
  }
3056
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
3960
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cn("space-y-3", streamingClass, className), children: [
3057
3961
  hasReasoning ? reasoningNode : answerNode,
3058
- resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
3962
+ resolvedStreamingStatus ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AssistantStreamingIndicator, { status: resolvedStreamingStatus }) : null
3059
3963
  ] });
3060
3964
  }
3061
3965
 
3062
3966
  // src/components/thread/MessageActions.tsx
3063
- var React15 = __toESM(require("react"), 1);
3064
- var import_lucide_react8 = require("lucide-react");
3065
- var import_jsx_runtime21 = require("react/jsx-runtime");
3967
+ var React17 = __toESM(require("react"), 1);
3968
+ var import_lucide_react10 = require("lucide-react");
3969
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3066
3970
  function MessageActions({
3067
3971
  content,
3068
3972
  isAssistant = false,
@@ -3071,7 +3975,7 @@ function MessageActions({
3071
3975
  className
3072
3976
  }) {
3073
3977
  const { t } = useChatkitTranslation();
3074
- const [copied, setCopied] = React15.useState(false);
3978
+ const [copied, setCopied] = React17.useState(false);
3075
3979
  const handleCopy = async () => {
3076
3980
  try {
3077
3981
  await navigator.clipboard.writeText(content);
@@ -3084,7 +3988,7 @@ function MessageActions({
3084
3988
  if (isStreaming) {
3085
3989
  return null;
3086
3990
  }
3087
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
3991
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3088
3992
  "div",
3089
3993
  {
3090
3994
  className: cn(
@@ -3092,7 +3996,7 @@ function MessageActions({
3092
3996
  className
3093
3997
  ),
3094
3998
  children: [
3095
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3999
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3096
4000
  "button",
3097
4001
  {
3098
4002
  type: "button",
@@ -3102,17 +4006,17 @@ function MessageActions({
3102
4006
  copied && "text-green-500"
3103
4007
  ),
3104
4008
  title: copied ? t("messageActions.copied") : t("messageActions.copy"),
3105
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.Copy, { size: 14 })
4009
+ children: copied ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.Copy, { size: 14 })
3106
4010
  }
3107
4011
  ),
3108
- isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4012
+ isAssistant && onRetry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
3109
4013
  "button",
3110
4014
  {
3111
4015
  type: "button",
3112
4016
  onClick: onRetry,
3113
4017
  className: "p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",
3114
4018
  title: t("messageActions.regenerate"),
3115
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react8.RefreshCw, { size: 14 })
4019
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react10.RefreshCw, { size: 14 })
3116
4020
  }
3117
4021
  )
3118
4022
  ]
@@ -3121,20 +4025,20 @@ function MessageActions({
3121
4025
  }
3122
4026
 
3123
4027
  // src/components/thread/StartScreen.tsx
3124
- var React16 = require("react");
3125
- var import_lucide_react9 = require("lucide-react");
3126
- var import_jsx_runtime22 = require("react/jsx-runtime");
4028
+ var React18 = require("react");
4029
+ var import_lucide_react11 = require("lucide-react");
4030
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3127
4031
  function getIconComponent2(icon) {
3128
4032
  const iconMap = {
3129
- "circle-question": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.HelpCircle, { size: 20 }),
3130
- "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Lightbulb, { size: 20 }),
3131
- "sparkle": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Sparkles, { size: 20 }),
3132
- "write": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Pencil, { size: 20 }),
3133
- "search": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Search, { size: 20 }),
3134
- "globe": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Globe, { size: 20 }),
3135
- "book-open": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.BookOpen, { size: 20 }),
3136
- "compass": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Compass, { size: 20 }),
3137
- "bolt": /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react9.Zap, { size: 20 })
4033
+ "circle-question": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.HelpCircle, { size: 20 }),
4034
+ "lightbulb": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Lightbulb, { size: 20 }),
4035
+ "sparkle": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Sparkles, { size: 20 }),
4036
+ "write": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Pencil, { size: 20 }),
4037
+ "search": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Search, { size: 20 }),
4038
+ "globe": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Globe, { size: 20 }),
4039
+ "book-open": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.BookOpen, { size: 20 }),
4040
+ "compass": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Compass, { size: 20 }),
4041
+ "bolt": /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react11.Zap, { size: 20 })
3138
4042
  };
3139
4043
  return icon ? iconMap[icon] || iconMap["sparkle"] : iconMap["sparkle"];
3140
4044
  }
@@ -3142,9 +4046,9 @@ function StartScreen({ startScreen, onPromptClick, className }) {
3142
4046
  const { t } = useChatkitTranslation();
3143
4047
  const greeting = startScreen?.greeting ?? t("startScreen.greeting");
3144
4048
  const prompts = startScreen?.prompts ?? [];
3145
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
3146
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
3147
- prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
4049
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cn("flex flex-col items-center justify-center py-12 px-4", className), children: [
4050
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "mb-8 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "text-2xl font-semibold text-foreground mb-2", children: greeting }) }),
4051
+ prompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "w-full max-w-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: prompts.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
3148
4052
  "button",
3149
4053
  {
3150
4054
  type: "button",
@@ -3155,8 +4059,8 @@ function StartScreen({ startScreen, onPromptClick, className }) {
3155
4059
  "focus:outline-none focus:ring-2 focus:ring-primary/20"
3156
4060
  ),
3157
4061
  children: [
3158
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
3159
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
4062
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary", children: getIconComponent2(item.icon) }),
4063
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-sm font-medium text-foreground", children: item.label })
3160
4064
  ]
3161
4065
  },
3162
4066
  `prompt-${index}`
@@ -3165,13 +4069,13 @@ function StartScreen({ startScreen, onPromptClick, className }) {
3165
4069
  }
3166
4070
 
3167
4071
  // src/components/ui/chatkit-avatar.tsx
3168
- var React18 = require("react");
4072
+ var React20 = require("react");
3169
4073
 
3170
4074
  // src/components/ui/avatar.tsx
3171
- var React17 = __toESM(require("react"), 1);
4075
+ var React19 = __toESM(require("react"), 1);
3172
4076
  var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"), 1);
3173
- var import_jsx_runtime23 = require("react/jsx-runtime");
3174
- var Avatar = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4077
+ var import_jsx_runtime25 = require("react/jsx-runtime");
4078
+ var Avatar = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3175
4079
  AvatarPrimitive.Root,
3176
4080
  {
3177
4081
  ref,
@@ -3183,7 +4087,7 @@ var Avatar = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
3183
4087
  }
3184
4088
  ));
3185
4089
  Avatar.displayName = AvatarPrimitive.Root.displayName;
3186
- var AvatarImage = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4090
+ var AvatarImage = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3187
4091
  AvatarPrimitive.Image,
3188
4092
  {
3189
4093
  ref,
@@ -3192,7 +4096,7 @@ var AvatarImage = React17.forwardRef(({ className, ...props }, ref) => /* @__PUR
3192
4096
  }
3193
4097
  ));
3194
4098
  AvatarImage.displayName = AvatarPrimitive.Image.displayName;
3195
- var AvatarFallback = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4099
+ var AvatarFallback = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
3196
4100
  AvatarPrimitive.Fallback,
3197
4101
  {
3198
4102
  ref,
@@ -3206,7 +4110,7 @@ var AvatarFallback = React17.forwardRef(({ className, ...props }, ref) => /* @__
3206
4110
  AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
3207
4111
 
3208
4112
  // src/components/ui/chatkit-avatar.tsx
3209
- var import_jsx_runtime24 = require("react/jsx-runtime");
4113
+ var import_jsx_runtime26 = require("react/jsx-runtime");
3210
4114
  function asRecord(value) {
3211
4115
  return value && typeof value === "object" ? value : null;
3212
4116
  }
@@ -3279,21 +4183,21 @@ function ChatkitAvatar({
3279
4183
  const fallbackStyle = {
3280
4184
  ...avatar?.background ? { background: avatar.background } : {}
3281
4185
  };
3282
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Avatar, { className: cn(roundedClass, className), style, ...props, children: [
3283
- avatar?.url ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(AvatarImage, { className: imageClassName, src: avatar.url, alt: label }) : null,
3284
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4186
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Avatar, { className: cn(roundedClass, className), style, ...props, children: [
4187
+ avatar?.url ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(AvatarImage, { className: imageClassName, src: avatar.url, alt: label }) : null,
4188
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
3285
4189
  AvatarFallback,
3286
4190
  {
3287
4191
  className: cn(roundedClass, "text-sm font-medium text-foreground", fallbackClassName),
3288
4192
  style: fallbackStyle,
3289
- children: emojiCharacter ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-[1.1em] leading-none", style: emojiStyle, children: emojiCharacter }) : fallbackText
4193
+ children: emojiCharacter ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-[1.1em] leading-none", style: emojiStyle, children: emojiCharacter }) : fallbackText
3290
4194
  }
3291
4195
  )
3292
4196
  ] });
3293
4197
  }
3294
4198
 
3295
4199
  // src/hooks/useThreads.ts
3296
- var React19 = __toESM(require("react"), 1);
4200
+ var React21 = __toESM(require("react"), 1);
3297
4201
  var DEFAULT_LIMIT = 50;
3298
4202
  var getThreadTitle = (threadRecord) => {
3299
4203
  const title = threadRecord.title?.trim();
@@ -3331,16 +4235,16 @@ function useThreads(limit = DEFAULT_LIMIT) {
3331
4235
  isReady,
3332
4236
  isLoading: isStreamLoading
3333
4237
  } = useStreamContext();
3334
- const [threadRecords, setThreadRecords] = React19.useState([]);
3335
- const [isLoading, setIsLoading] = React19.useState(false);
3336
- const [error, setError] = React19.useState(null);
3337
- const upsertThreadRecord = React19.useCallback((threadRecord) => {
4238
+ const [threadRecords, setThreadRecords] = React21.useState([]);
4239
+ const [isLoading, setIsLoading] = React21.useState(false);
4240
+ const [error, setError] = React21.useState(null);
4241
+ const upsertThreadRecord = React21.useCallback((threadRecord) => {
3338
4242
  setThreadRecords((prev) => {
3339
4243
  const next = prev.filter((item) => item.id !== threadRecord.id);
3340
4244
  return sortThreadRecords([threadRecord, ...next]);
3341
4245
  });
3342
4246
  }, []);
3343
- const refreshThreads = React19.useCallback(async () => {
4247
+ const refreshThreads = React21.useCallback(async () => {
3344
4248
  setIsLoading(true);
3345
4249
  setError(null);
3346
4250
  try {
@@ -3356,7 +4260,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
3356
4260
  setIsLoading(false);
3357
4261
  }
3358
4262
  }, [client, limit, assistantId]);
3359
- const createThread = React19.useCallback(
4263
+ const createThread = React21.useCallback(
3360
4264
  async (input) => {
3361
4265
  setError(null);
3362
4266
  const payload = {};
@@ -3370,7 +4274,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
3370
4274
  },
3371
4275
  [client, upsertThreadRecord]
3372
4276
  );
3373
- const updateThread = React19.useCallback(
4277
+ const updateThread = React21.useCallback(
3374
4278
  async (recordId, payload) => {
3375
4279
  setError(null);
3376
4280
  const updated = await client.conversations.update(recordId, payload);
@@ -3379,7 +4283,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
3379
4283
  },
3380
4284
  [client, upsertThreadRecord]
3381
4285
  );
3382
- const deleteThread = React19.useCallback(
4286
+ const deleteThread = React21.useCallback(
3383
4287
  async (recordId) => {
3384
4288
  setError(null);
3385
4289
  await client.conversations.delete(recordId);
@@ -3387,23 +4291,24 @@ function useThreads(limit = DEFAULT_LIMIT) {
3387
4291
  },
3388
4292
  [client]
3389
4293
  );
3390
- React19.useEffect(() => {
4294
+ React21.useEffect(() => {
3391
4295
  if (!isReady) return;
3392
4296
  void refreshThreads();
3393
4297
  }, [refreshThreads, isReady]);
3394
- React19.useEffect(() => {
4298
+ React21.useEffect(() => {
3395
4299
  if (!threadId || !isStreamLoading) return;
3396
4300
  const now = (/* @__PURE__ */ new Date()).toISOString();
4301
+ const busyStatus = "busy";
3397
4302
  setThreadRecords((prev) => {
3398
4303
  let changed = false;
3399
4304
  const next = prev.map((item) => {
3400
4305
  const isCurrentThread = item.threadId === threadId || item.id === threadId;
3401
4306
  if (!isCurrentThread) return item;
3402
- if (item.status === "busy" && !item.error) return item;
4307
+ if (item.status === busyStatus && !item.error) return item;
3403
4308
  changed = true;
3404
4309
  return {
3405
4310
  ...item,
3406
- status: "busy",
4311
+ status: busyStatus,
3407
4312
  error: void 0,
3408
4313
  updatedAt: now
3409
4314
  };
@@ -3411,7 +4316,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
3411
4316
  return changed ? sortThreadRecords(next) : prev;
3412
4317
  });
3413
4318
  }, [threadId, isStreamLoading]);
3414
- React19.useEffect(() => {
4319
+ React21.useEffect(() => {
3415
4320
  if (!isReady || !threadId || isStreamLoading) return;
3416
4321
  let cancelled = false;
3417
4322
  void client.conversations.search({ where: { threadId }, limit: 1 }).then((result) => {
@@ -3425,7 +4330,7 @@ function useThreads(limit = DEFAULT_LIMIT) {
3425
4330
  cancelled = true;
3426
4331
  };
3427
4332
  }, [client, threadId, upsertThreadRecord, isReady, isStreamLoading]);
3428
- const threads = React19.useMemo(
4333
+ const threads = React21.useMemo(
3429
4334
  () => threadRecords.map((threadRecord) => toThreadItem(threadRecord)),
3430
4335
  [threadRecords]
3431
4336
  );
@@ -3442,22 +4347,22 @@ function useThreads(limit = DEFAULT_LIMIT) {
3442
4347
  }
3443
4348
 
3444
4349
  // src/components/thread/context-usage-indicator.tsx
3445
- var React20 = __toESM(require("react"), 1);
4350
+ var React22 = __toESM(require("react"), 1);
3446
4351
 
3447
4352
  // src/components/ui/progress-circle.tsx
3448
- var import_jsx_runtime25 = (
4353
+ var import_jsx_runtime27 = (
3449
4354
  // biome-ignore lint/a11y/useFocusableInteractive: false positive (progress + progressbar are not focusable interactives)
3450
4355
  // biome-ignore lint/nursery/useAriaPropsSupportedByRole: biome rule at odds with mdn docs (presumed nursary bug with rule)
3451
4356
  require("react/jsx-runtime")
3452
4357
  );
3453
- function clamp(input, a, b) {
4358
+ function clamp2(input, a, b) {
3454
4359
  return Math.max(Math.min(input, Math.max(a, b)), Math.min(a, b));
3455
4360
  }
3456
4361
  var size = 24;
3457
4362
  var strokeWidth = 4;
3458
4363
  var total = 100;
3459
4364
  var ProgressCircle = ({ value, className, ...restSvgProps }) => {
3460
- const normalizedValue = clamp(value, 0, total);
4365
+ const normalizedValue = clamp2(value, 0, total);
3461
4366
  const radius = (size - strokeWidth) / 2;
3462
4367
  const circumference = 2 * Math.PI * radius;
3463
4368
  const progress = normalizedValue / total * circumference;
@@ -3469,7 +4374,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
3469
4374
  fill: "none",
3470
4375
  strokeWidth
3471
4376
  };
3472
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4377
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
3473
4378
  "svg",
3474
4379
  {
3475
4380
  role: "progressbar",
@@ -3480,8 +4385,8 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
3480
4385
  "aria-valuemax": 100,
3481
4386
  ...restSvgProps,
3482
4387
  children: [
3483
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
3484
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4388
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("circle", { ...commonParams, className: "stroke-current/25" }),
4389
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
3485
4390
  "circle",
3486
4391
  {
3487
4392
  ...commonParams,
@@ -3499,7 +4404,7 @@ var ProgressCircle = ({ value, className, ...restSvgProps }) => {
3499
4404
  };
3500
4405
 
3501
4406
  // src/components/thread/context-usage-indicator.tsx
3502
- var import_jsx_runtime26 = require("react/jsx-runtime");
4407
+ var import_jsx_runtime28 = require("react/jsx-runtime");
3503
4408
  var kNumberFormatter = new Intl.NumberFormat("en-US", {
3504
4409
  minimumFractionDigits: 0,
3505
4410
  maximumFractionDigits: 1
@@ -3532,20 +4437,20 @@ function ContextUsageIndicator({
3532
4437
  }) {
3533
4438
  const { t } = useChatkitTranslation();
3534
4439
  const stream = useStreamContext();
3535
- const [maxContextSize, setMaxContextSize] = React20.useState(null);
3536
- const [usedContextSize, setUsedContextSize] = React20.useState(null);
3537
- const [assistantAgentKey, setAssistantAgentKey] = React20.useState(null);
3538
- const latestRealtimeUsageRef = React20.useRef({
4440
+ const [maxContextSize, setMaxContextSize] = React22.useState(null);
4441
+ const [usedContextSize, setUsedContextSize] = React22.useState(null);
4442
+ const [assistantAgentKey, setAssistantAgentKey] = React22.useState(null);
4443
+ const latestRealtimeUsageRef = React22.useRef({
3539
4444
  threadId: null,
3540
4445
  agentKey: null,
3541
4446
  usedTokens: null
3542
4447
  });
3543
- const realtimeUsage = React20.useMemo(
4448
+ const realtimeUsage = React22.useMemo(
3544
4449
  () => getThreadContextUsage(stream.contextUsageByAgentKey, assistantAgentKey),
3545
4450
  [assistantAgentKey, stream.contextUsageByAgentKey]
3546
4451
  );
3547
4452
  const realtimeUsedContextSize = getThreadContextUsageTotalTokens(realtimeUsage);
3548
- React20.useEffect(() => {
4453
+ React22.useEffect(() => {
3549
4454
  if (!stream.client || !stream.assistantId) {
3550
4455
  setMaxContextSize(null);
3551
4456
  setAssistantAgentKey(null);
@@ -3565,18 +4470,18 @@ function ContextUsageIndicator({
3565
4470
  cancelled = true;
3566
4471
  };
3567
4472
  }, [stream.client, stream.assistantId]);
3568
- React20.useEffect(() => {
4473
+ React22.useEffect(() => {
3569
4474
  latestRealtimeUsageRef.current = {
3570
4475
  threadId: stream.threadId ?? null,
3571
4476
  agentKey: assistantAgentKey,
3572
4477
  usedTokens: realtimeUsedContextSize
3573
4478
  };
3574
4479
  }, [assistantAgentKey, realtimeUsedContextSize, stream.threadId]);
3575
- React20.useEffect(() => {
4480
+ React22.useEffect(() => {
3576
4481
  if (realtimeUsedContextSize == null) return;
3577
4482
  setUsedContextSize(realtimeUsedContextSize);
3578
4483
  }, [realtimeUsedContextSize]);
3579
- React20.useEffect(() => {
4484
+ React22.useEffect(() => {
3580
4485
  if (!stream.client) {
3581
4486
  setUsedContextSize(null);
3582
4487
  return;
@@ -3641,8 +4546,8 @@ function ContextUsageIndicator({
3641
4546
  });
3642
4547
  const usageLabelWithSuffix = usageLabel.endsWith(":") ? usageLabel : `${usageLabel}:`;
3643
4548
  const progressClassName = percent >= 90 ? "text-destructive" : percent >= 75 ? "text-amber-500" : "text-primary dark:text-zinc-300";
3644
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Tooltip, { children: [
3645
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4549
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Tooltip, { children: [
4550
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
3646
4551
  "button",
3647
4552
  {
3648
4553
  type: "button",
@@ -3651,22 +4556,74 @@ function ContextUsageIndicator({
3651
4556
  className
3652
4557
  ),
3653
4558
  "aria-label": `${usageLabelWithSuffix} ${usageFullLabel}. ${usageTokensLabel}`,
3654
- children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
4559
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ProgressCircle, { value: percent, className: cn("size-3.5", progressClassName) })
3655
4560
  }
3656
4561
  ) }),
3657
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
3658
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
3659
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
3660
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
4562
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(TooltipContent, { side: "top", sideOffset: 6, className: "space-y-0.5 px-3 py-2 text-center", children: [
4563
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-primary-foreground/70", children: usageLabelWithSuffix }),
4564
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "font-medium text-primary-foreground/80", children: usageFullLabel }),
4565
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "text-sm font-semibold", children: usageTokensLabel })
3661
4566
  ] })
3662
4567
  ] });
3663
4568
  }
3664
4569
 
3665
4570
  // src/components/chat.tsx
3666
- var import_jsx_runtime27 = require("react/jsx-runtime");
4571
+ var import_jsx_runtime29 = require("react/jsx-runtime");
3667
4572
  var import_meta2 = {};
3668
4573
  var defaultApiUrl2 = import_meta2.env.VITE_XPERTAI_API_URL;
3669
4574
  var COMPOSER_INPUT_MAX_HEIGHT = 128;
4575
+ var LONG_TEXT_REFERENCE_THRESHOLD = 5e3;
4576
+ async function readImageDimensions(file) {
4577
+ if (typeof window === "undefined" || typeof URL === "undefined") {
4578
+ return {};
4579
+ }
4580
+ return new Promise((resolve) => {
4581
+ const objectUrl = URL.createObjectURL(file);
4582
+ const image = new window.Image();
4583
+ const cleanup = () => {
4584
+ URL.revokeObjectURL(objectUrl);
4585
+ };
4586
+ image.onload = () => {
4587
+ resolve({
4588
+ width: image.naturalWidth || void 0,
4589
+ height: image.naturalHeight || void 0
4590
+ });
4591
+ cleanup();
4592
+ };
4593
+ image.onerror = () => {
4594
+ resolve({});
4595
+ cleanup();
4596
+ };
4597
+ image.src = objectUrl;
4598
+ });
4599
+ }
4600
+ function getStorageFileUrl(file) {
4601
+ return file.url ?? file.fileUrl ?? file.thumbUrl;
4602
+ }
4603
+ function buildPastedImageReference(file, storageFile, dimensions) {
4604
+ const name = storageFile.originalName?.trim() || file.name.trim() || "Pasted image";
4605
+ const mimeType = storageFile.mimetype?.trim() || file.type.trim() || "image/*";
4606
+ const size2 = storageFile.size ?? file.size;
4607
+ const width = dimensions?.width;
4608
+ const height = dimensions?.height;
4609
+ const metaParts = [
4610
+ mimeType,
4611
+ width && height ? `${width}x${height}` : null,
4612
+ typeof size2 === "number" ? `${size2} bytes` : null
4613
+ ].filter((part) => Boolean(part));
4614
+ return {
4615
+ type: "image",
4616
+ id: storageFile.id,
4617
+ fileId: storageFile.id,
4618
+ url: getStorageFileUrl(storageFile),
4619
+ mimeType,
4620
+ name,
4621
+ ...typeof size2 === "number" ? { size: size2 } : {},
4622
+ ...width ? { width } : {},
4623
+ ...height ? { height } : {},
4624
+ text: `Pasted image${metaParts.length ? ` (${metaParts.join(", ")})` : ""}: ${name}`
4625
+ };
4626
+ }
3670
4627
  function formatMessageContent(content) {
3671
4628
  if (typeof content === "string") {
3672
4629
  return content;
@@ -3703,8 +4660,8 @@ function ReferenceChip({
3703
4660
  }) {
3704
4661
  const metaLine = getReferenceMetaLine(reference);
3705
4662
  const isComposer = variant === "composer";
3706
- const Icon = reference.type === "quote" ? import_lucide_react10.Quote : import_lucide_react10.FileText;
3707
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
4663
+ const Icon = reference.type === "quote" ? import_lucide_react12.Quote : reference.type === "image" ? import_lucide_react12.ImageIcon : import_lucide_react12.FileText;
4664
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
3708
4665
  "div",
3709
4666
  {
3710
4667
  className: cn(
@@ -3713,7 +4670,7 @@ function ReferenceChip({
3713
4670
  ),
3714
4671
  title: getReferenceTitle(reference),
3715
4672
  children: [
3716
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4673
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3717
4674
  Icon,
3718
4675
  {
3719
4676
  size: isComposer ? 14 : 12,
@@ -3723,29 +4680,29 @@ function ReferenceChip({
3723
4680
  )
3724
4681
  }
3725
4682
  ),
3726
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "min-w-0 flex-1", children: [
3727
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4683
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "min-w-0 flex-1", children: [
4684
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3728
4685
  "div",
3729
4686
  {
3730
4687
  className: cn(
3731
- "truncate",
4688
+ "truncate whitespace-pre-wrap",
3732
4689
  isComposer ? "text-sm" : "text-xs font-medium"
3733
4690
  ),
3734
4691
  children: getReferenceLabel(reference)
3735
4692
  }
3736
4693
  ),
3737
- metaLine && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4694
+ metaLine && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3738
4695
  "div",
3739
4696
  {
3740
4697
  className: cn(
3741
- "truncate",
4698
+ "truncate whitespace-pre-wrap",
3742
4699
  isComposer ? "text-xs text-muted-foreground" : "text-[10px] text-primary-foreground/75"
3743
4700
  ),
3744
4701
  children: metaLine
3745
4702
  }
3746
4703
  )
3747
4704
  ] }),
3748
- onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4705
+ onRemove && removeLabel && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
3749
4706
  "button",
3750
4707
  {
3751
4708
  type: "button",
@@ -3756,7 +4713,7 @@ function ReferenceChip({
3756
4713
  ),
3757
4714
  title: removeLabel,
3758
4715
  "aria-label": removeLabel,
3759
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.X, { size: 12 })
4716
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.X, { size: 12 })
3760
4717
  }
3761
4718
  )
3762
4719
  ]
@@ -3780,20 +4737,20 @@ function Chat({
3780
4737
  const { setStream } = useStreamManager();
3781
4738
  const stream = useStreamContext();
3782
4739
  const { theme } = useTheme();
3783
- const [isHistoryLoading, setIsHistoryLoading] = React21.useState(false);
3784
- const [historyError, setHistoryError] = React21.useState(null);
3785
- const [assistantName, setAssistantName] = React21.useState(null);
3786
- const [assistantAvatar, setAssistantAvatar] = React21.useState(null);
4740
+ const [isHistoryLoading, setIsHistoryLoading] = React23.useState(false);
4741
+ const [historyError, setHistoryError] = React23.useState(null);
4742
+ const [assistantName, setAssistantName] = React23.useState(null);
4743
+ const [assistantAvatar, setAssistantAvatar] = React23.useState(null);
3787
4744
  const LOADING_DOTS_MIN_DURATION = 800;
3788
4745
  const STREAMING_STATUS_REFRESH_MS = 250;
3789
- const [showLoadingDots, setShowLoadingDots] = React21.useState(false);
3790
- const [streamingNow, setStreamingNow] = React21.useState(() => Date.now());
3791
- const loadingStartTimeRef = React21.useRef(null);
3792
- const lastStreamOutputAtRef = React21.useRef(null);
3793
- React21.useEffect(() => {
4746
+ const [showLoadingDots, setShowLoadingDots] = React23.useState(false);
4747
+ const [streamingNow, setStreamingNow] = React23.useState(() => Date.now());
4748
+ const loadingStartTimeRef = React23.useRef(null);
4749
+ const lastStreamOutputAtRef = React23.useRef(null);
4750
+ React23.useEffect(() => {
3794
4751
  setStream(stream);
3795
4752
  }, [setStream, stream]);
3796
- React21.useEffect(() => {
4753
+ React23.useEffect(() => {
3797
4754
  if (stream.isLoading) {
3798
4755
  if (!loadingStartTimeRef.current) {
3799
4756
  loadingStartTimeRef.current = Date.now();
@@ -3816,7 +4773,7 @@ function Chat({
3816
4773
  }
3817
4774
  }
3818
4775
  }, [stream.isLoading]);
3819
- React21.useEffect(() => {
4776
+ React23.useEffect(() => {
3820
4777
  if (!stream.isLoading) {
3821
4778
  lastStreamOutputAtRef.current = null;
3822
4779
  setStreamingNow(Date.now());
@@ -3826,7 +4783,7 @@ function Chat({
3826
4783
  lastStreamOutputAtRef.current = now;
3827
4784
  setStreamingNow(now);
3828
4785
  }, [stream.messages, stream.isLoading]);
3829
- React21.useEffect(() => {
4786
+ React23.useEffect(() => {
3830
4787
  if (!stream.isLoading) {
3831
4788
  return;
3832
4789
  }
@@ -3835,51 +4792,53 @@ function Chat({
3835
4792
  }, STREAMING_STATUS_REFRESH_MS);
3836
4793
  return () => window.clearInterval(timer);
3837
4794
  }, [stream.isLoading]);
3838
- const [draft, setDraft] = React21.useState("");
3839
- const [selectedTool, setSelectedTool] = React21.useState(
4795
+ const [draft, setDraft] = React23.useState("");
4796
+ const [selectedTool, setSelectedTool] = React23.useState(
3840
4797
  null
3841
4798
  );
3842
- const [attachments, setAttachments] = React21.useState([]);
3843
- const [references, setReferences] = React21.useState([]);
3844
- const [quoteSelection, setQuoteSelection] = React21.useState(null);
3845
- const [isAtBottom, setIsAtBottom] = React21.useState(true);
3846
- const [hasUpdatesBelow, setHasUpdatesBelow] = React21.useState(false);
4799
+ const [attachments, setAttachments] = React23.useState([]);
4800
+ const [references, setReferences] = React23.useState([]);
4801
+ const [isUploadingReferenceImages, setIsUploadingReferenceImages] = React23.useState(false);
4802
+ const [quoteSelection, setQuoteSelection] = React23.useState(null);
4803
+ const [isAtBottom, setIsAtBottom] = React23.useState(true);
4804
+ const [hasUpdatesBelow, setHasUpdatesBelow] = React23.useState(false);
3847
4805
  const {
3848
4806
  threads,
3849
4807
  deleteThread,
3850
4808
  refreshThreads,
3851
4809
  isLoading: isThreadsLoading
3852
4810
  } = useThreads();
3853
- const viewportRef = React21.useRef(null);
3854
- const fileInputRef = React21.useRef(null);
3855
- const composerInputRef = React21.useRef(null);
3856
- const shouldAutoScrollRef = React21.useRef(true);
3857
- const forceFollowRef = React21.useRef(false);
3858
- const previousMessageCountRef = React21.useRef(0);
3859
- const previousScrollTopRef = React21.useRef(0);
3860
- const autoScrollFrameRef = React21.useRef(null);
3861
- const isPointerDownRef = React21.useRef(false);
3862
- const lastTouchYRef = React21.useRef(null);
4811
+ const viewportRef = React23.useRef(null);
4812
+ const fileInputRef = React23.useRef(null);
4813
+ const composerInputRef = React23.useRef(null);
4814
+ const shouldAutoScrollRef = React23.useRef(true);
4815
+ const forceFollowRef = React23.useRef(false);
4816
+ const previousMessageCountRef = React23.useRef(0);
4817
+ const previousScrollTopRef = React23.useRef(0);
4818
+ const autoScrollFrameRef = React23.useRef(null);
4819
+ const isPointerDownRef = React23.useRef(false);
4820
+ const lastTouchYRef = React23.useRef(null);
3863
4821
  const resolvedTitle = title ?? t("chat.title");
3864
4822
  const resolvedPlaceholder = placeholder ?? t("chat.placeholder");
3865
4823
  const inputPlaceholder = selectedTool?.placeholderOverride ?? composer?.placeholder ?? resolvedPlaceholder;
3866
- const messages = React21.useMemo(
4824
+ const messages = React23.useMemo(
3867
4825
  () => stream.messages ?? [],
3868
4826
  [stream.messages]
3869
4827
  );
3870
4828
  const trimmedDraft = draft.trim();
3871
4829
  const hasReferences = references.length > 0;
3872
- const pendingFollowUps = React21.useMemo(
4830
+ const pendingFollowUps = React23.useMemo(
3873
4831
  () => [...stream.pendingFollowUps ?? []].sort(
3874
4832
  (a, b) => a.createdAt - b.createdAt
3875
4833
  ),
3876
4834
  [stream.pendingFollowUps]
3877
4835
  );
3878
- const clearQuoteSelection = React21.useCallback(() => {
4836
+ const hasPendingFollowUps = pendingFollowUps.length > 0;
4837
+ const clearQuoteSelection = React23.useCallback(() => {
3879
4838
  setQuoteSelection(null);
3880
4839
  }, []);
3881
4840
  useParentMessenger({
3882
- onSetComposerValue: React21.useCallback(
4841
+ onSetComposerValue: React23.useCallback(
3883
4842
  (payload) => {
3884
4843
  if (!payload) {
3885
4844
  return;
@@ -3902,11 +4861,11 @@ function Chat({
3902
4861
  },
3903
4862
  [composer?.tools]
3904
4863
  ),
3905
- onFocusComposer: React21.useCallback(() => {
4864
+ onFocusComposer: React23.useCallback(() => {
3906
4865
  composerInputRef.current?.focus();
3907
4866
  }, [])
3908
4867
  });
3909
- const syncQuoteSelection = React21.useCallback(() => {
4868
+ const syncQuoteSelection = React23.useCallback(() => {
3910
4869
  if (typeof window === "undefined") {
3911
4870
  clearQuoteSelection();
3912
4871
  return;
@@ -3951,23 +4910,23 @@ function Chat({
3951
4910
  left
3952
4911
  });
3953
4912
  }, [clearQuoteSelection]);
3954
- const cancelPendingAutoScroll = React21.useCallback(() => {
4913
+ const cancelPendingAutoScroll = React23.useCallback(() => {
3955
4914
  if (autoScrollFrameRef.current !== null) {
3956
4915
  cancelAnimationFrame(autoScrollFrameRef.current);
3957
4916
  autoScrollFrameRef.current = null;
3958
4917
  }
3959
4918
  }, []);
3960
- const disableAutoFollow = React21.useCallback(() => {
4919
+ const disableAutoFollow = React23.useCallback(() => {
3961
4920
  forceFollowRef.current = false;
3962
4921
  shouldAutoScrollRef.current = false;
3963
4922
  cancelPendingAutoScroll();
3964
4923
  }, [cancelPendingAutoScroll]);
3965
- const enableAutoFollow = React21.useCallback(() => {
4924
+ const enableAutoFollow = React23.useCallback(() => {
3966
4925
  forceFollowRef.current = true;
3967
4926
  shouldAutoScrollRef.current = true;
3968
4927
  setHasUpdatesBelow(false);
3969
4928
  }, []);
3970
- const scrollToBottom = React21.useCallback(
4929
+ const scrollToBottom = React23.useCallback(
3971
4930
  (smooth = false, force = false) => {
3972
4931
  if (force) {
3973
4932
  enableAutoFollow();
@@ -3989,7 +4948,7 @@ function Chat({
3989
4948
  },
3990
4949
  [cancelPendingAutoScroll, enableAutoFollow]
3991
4950
  );
3992
- React21.useEffect(() => {
4951
+ React23.useEffect(() => {
3993
4952
  const viewport = viewportRef.current;
3994
4953
  if (!viewport) return;
3995
4954
  previousScrollTopRef.current = viewport.scrollTop;
@@ -4070,14 +5029,14 @@ function Chat({
4070
5029
  window.removeEventListener("pointercancel", stopPointerTracking);
4071
5030
  };
4072
5031
  }, [cancelPendingAutoScroll, disableAutoFollow]);
4073
- React21.useEffect(() => {
5032
+ React23.useEffect(() => {
4074
5033
  shouldAutoScrollRef.current = true;
4075
5034
  forceFollowRef.current = false;
4076
5035
  previousScrollTopRef.current = 0;
4077
5036
  setIsAtBottom(true);
4078
5037
  setHasUpdatesBelow(false);
4079
5038
  }, [stream.threadId]);
4080
- React21.useEffect(() => {
5039
+ React23.useEffect(() => {
4081
5040
  const messageCountChanged = messages.length !== previousMessageCountRef.current;
4082
5041
  previousMessageCountRef.current = messages.length;
4083
5042
  if (!shouldAutoScrollRef.current) {
@@ -4096,7 +5055,7 @@ function Chat({
4096
5055
  clientSecret: effectiveClientSecret
4097
5056
  });
4098
5057
  const missingConfig = Boolean(missingConfigKind);
4099
- const missingConfigShortMessage = React21.useMemo(() => {
5058
+ const missingConfigShortMessage = React23.useMemo(() => {
4100
5059
  switch (missingConfigKind) {
4101
5060
  case "apiUrl":
4102
5061
  return t("chat.missingApiUrlShort");
@@ -4108,7 +5067,7 @@ function Chat({
4108
5067
  return t("chat.missingConfigShort");
4109
5068
  }
4110
5069
  }, [missingConfigKind, t]);
4111
- const missingConfigDetailMessage = React21.useMemo(() => {
5070
+ const missingConfigDetailMessage = React23.useMemo(() => {
4112
5071
  switch (missingConfigKind) {
4113
5072
  case "apiUrl":
4114
5073
  return t("chat.missingApiUrlDetail");
@@ -4122,8 +5081,8 @@ function Chat({
4122
5081
  }, [missingConfigKind, t]);
4123
5082
  const showMissingConfig = !isClientSecretInitializing && missingConfig;
4124
5083
  const hasUploadingFiles = attachments.some((a) => a.status === "uploading");
4125
- const isSendDisabled = !trimmedDraft && !hasReferences || missingConfig || isHistoryLoading || hasUploadingFiles;
4126
- const resizeComposerInput = React21.useCallback(() => {
5084
+ const isSendDisabled = !trimmedDraft && !hasReferences || missingConfig || isHistoryLoading || hasUploadingFiles || isUploadingReferenceImages;
5085
+ const resizeComposerInput = React23.useCallback(() => {
4127
5086
  const textarea = composerInputRef.current;
4128
5087
  if (!textarea) {
4129
5088
  return;
@@ -4136,16 +5095,16 @@ function Chat({
4136
5095
  textarea.style.height = `${nextHeight}px`;
4137
5096
  textarea.style.overflowY = textarea.scrollHeight > COMPOSER_INPUT_MAX_HEIGHT ? "auto" : "hidden";
4138
5097
  }, []);
4139
- React21.useEffect(() => {
5098
+ React23.useEffect(() => {
4140
5099
  resizeComposerInput();
4141
5100
  }, [draft, resizeComposerInput]);
4142
- React21.useEffect(() => {
5101
+ React23.useEffect(() => {
4143
5102
  document.addEventListener("selectionchange", syncQuoteSelection);
4144
5103
  return () => {
4145
5104
  document.removeEventListener("selectionchange", syncQuoteSelection);
4146
5105
  };
4147
5106
  }, [syncQuoteSelection]);
4148
- React21.useEffect(() => {
5107
+ React23.useEffect(() => {
4149
5108
  const viewport = viewportRef.current;
4150
5109
  if (!viewport) {
4151
5110
  return;
@@ -4162,14 +5121,14 @@ function Chat({
4162
5121
  window.removeEventListener("resize", handleViewportScroll);
4163
5122
  };
4164
5123
  }, [clearQuoteSelection]);
4165
- React21.useEffect(() => {
5124
+ React23.useEffect(() => {
4166
5125
  clearQuoteSelection();
4167
5126
  }, [messages.length, stream.threadId, clearQuoteSelection]);
4168
- React21.useEffect(() => {
5127
+ React23.useEffect(() => {
4169
5128
  if (missingConfig) return;
4170
5129
  void refreshThreads();
4171
5130
  }, [missingConfig, refreshThreads]);
4172
- React21.useEffect(() => {
5131
+ React23.useEffect(() => {
4173
5132
  if (missingConfig || !stream.client || !stream.assistantId) {
4174
5133
  setAssistantName(null);
4175
5134
  setAssistantAvatar(null);
@@ -4200,7 +5159,7 @@ function Chat({
4200
5159
  mimetype: a.storageFile?.mimetype ?? a.file.type,
4201
5160
  size: a.storageFile?.size ?? a.file.size
4202
5161
  }));
4203
- const submitDraft = React21.useCallback(
5162
+ const submitDraft = React23.useCallback(
4204
5163
  (followUpOverride) => {
4205
5164
  if (isSendDisabled) return;
4206
5165
  const filesToSend = uploadedFiles.length > 0 ? [...uploadedFiles] : void 0;
@@ -4274,7 +5233,7 @@ function Chat({
4274
5233
  event.preventDefault();
4275
5234
  submitDraft();
4276
5235
  };
4277
- const handleEditPendingFollowUp = React21.useCallback(
5236
+ const handleEditPendingFollowUp = React23.useCallback(
4278
5237
  (id) => {
4279
5238
  const item = pendingFollowUps.find(
4280
5239
  (entry) => entry.id === id && entry.mode === "queue"
@@ -4301,7 +5260,7 @@ function Chat({
4301
5260
  },
4302
5261
  [pendingFollowUps, stream]
4303
5262
  );
4304
- const handleQuoteSelection = React21.useCallback(() => {
5263
+ const handleQuoteSelection = React23.useCallback(() => {
4305
5264
  if (!quoteSelection) {
4306
5265
  return;
4307
5266
  }
@@ -4317,21 +5276,14 @@ function Chat({
4317
5276
  const handleAttachmentClick = () => {
4318
5277
  fileInputRef.current?.click();
4319
5278
  };
5279
+ const uploadContextFile = React23.useCallback(
5280
+ (file) => stream.client.contexts.uploadFile(file),
5281
+ [stream.client]
5282
+ );
4320
5283
  const handleComposerKeyDown = (event) => {
4321
5284
  if (event.key !== "Enter") {
4322
5285
  return;
4323
5286
  }
4324
- if (event.shiftKey && (event.metaKey || event.ctrlKey)) {
4325
- if (event.nativeEvent.isComposing) {
4326
- return;
4327
- }
4328
- event.preventDefault();
4329
- if (isSendDisabled) {
4330
- return;
4331
- }
4332
- submitDraft(stream.followUpBehavior === "queue" ? "steer" : "queue");
4333
- return;
4334
- }
4335
5287
  if (event.shiftKey) {
4336
5288
  return;
4337
5289
  }
@@ -4342,12 +5294,108 @@ function Chat({
4342
5294
  if (isSendDisabled) {
4343
5295
  return;
4344
5296
  }
5297
+ if (stream.isLoading) {
5298
+ submitDraft(
5299
+ getBusyComposerShortcutFollowUpMode(event.metaKey || event.ctrlKey)
5300
+ );
5301
+ return;
5302
+ }
4345
5303
  submitDraft();
4346
5304
  };
4347
- const uploadFile = React21.useCallback(
5305
+ const handleComposerPaste = React23.useCallback(
5306
+ (event) => {
5307
+ const clipboardData = event.clipboardData;
5308
+ if (!clipboardData) {
5309
+ return;
5310
+ }
5311
+ const imageFiles = Array.from(clipboardData.items).filter(
5312
+ (item) => item.kind === "file" && item.type.startsWith("image/")
5313
+ ).map((item) => item.getAsFile()).filter((item) => Boolean(item));
5314
+ if (imageFiles.length > 0) {
5315
+ event.preventDefault();
5316
+ const maxCount = composer?.attachments?.maxCount ?? 10;
5317
+ const maxSize = composer?.attachments?.maxSize ?? 100 * 1024 * 1024;
5318
+ const currentImageReferenceCount = references.filter(
5319
+ (reference) => reference.type === "image"
5320
+ ).length;
5321
+ const availableSlots = Math.max(
5322
+ 0,
5323
+ maxCount - currentImageReferenceCount
5324
+ );
5325
+ const nextFiles = imageFiles.filter((file) => file.size <= maxSize).slice(0, availableSlots);
5326
+ if (nextFiles.length === 0) {
5327
+ return;
5328
+ }
5329
+ setIsUploadingReferenceImages(true);
5330
+ void Promise.allSettled(
5331
+ nextFiles.map(async (file) => {
5332
+ const [dimensions, storageFile] = await Promise.all([
5333
+ readImageDimensions(file),
5334
+ uploadContextFile(file)
5335
+ ]);
5336
+ return buildPastedImageReference(file, storageFile, dimensions);
5337
+ })
5338
+ ).then((results) => {
5339
+ const nextReferences = results.filter(
5340
+ (result) => result.status === "fulfilled"
5341
+ ).map((result) => result.value);
5342
+ if (nextReferences.length > 0) {
5343
+ setReferences(
5344
+ (previous) => mergeReferences(previous, nextReferences)
5345
+ );
5346
+ composerInputRef.current?.focus();
5347
+ }
5348
+ results.filter(
5349
+ (result) => result.status === "rejected"
5350
+ ).forEach((result) => {
5351
+ console.warn(
5352
+ "[Chat] Failed to upload pasted image reference:",
5353
+ result.reason
5354
+ );
5355
+ });
5356
+ }).finally(() => {
5357
+ setIsUploadingReferenceImages(false);
5358
+ });
5359
+ return;
5360
+ }
5361
+ const pastedText = clipboardData.getData("text/plain");
5362
+ if (pastedText.trim().length <= LONG_TEXT_REFERENCE_THRESHOLD) {
5363
+ return;
5364
+ }
5365
+ event.preventDefault();
5366
+ setReferences(
5367
+ (previous) => mergeReferences(previous, [
5368
+ {
5369
+ type: "quote",
5370
+ source: "Pasted text",
5371
+ text: pastedText
5372
+ }
5373
+ ])
5374
+ );
5375
+ composerInputRef.current?.focus();
5376
+ },
5377
+ [
5378
+ composer?.attachments?.maxCount,
5379
+ composer?.attachments?.maxSize,
5380
+ references,
5381
+ uploadContextFile
5382
+ ]
5383
+ );
5384
+ const alternateFollowUpShortcutLabel = React23.useMemo(() => {
5385
+ if (typeof navigator === "undefined") {
5386
+ return "\u2318Enter";
5387
+ }
5388
+ const platform = navigator.platform || navigator.userAgent;
5389
+ return /Mac|iPhone|iPad|iPod/i.test(platform) ? "\u2318Enter" : "Ctrl+Enter";
5390
+ }, []);
5391
+ const followUpShortcutLabels = React23.useMemo(
5392
+ () => getComposerFollowUpShortcutLabels(alternateFollowUpShortcutLabel),
5393
+ [alternateFollowUpShortcutLabel]
5394
+ );
5395
+ const uploadFile = React23.useCallback(
4348
5396
  async (localId, file) => {
4349
5397
  try {
4350
- const result = await stream.client.contexts.uploadFile(file);
5398
+ const result = await uploadContextFile(file);
4351
5399
  setAttachments(
4352
5400
  (prev) => prev.map(
4353
5401
  (item) => item.localId === localId ? { ...item, status: "success", storageFile: result } : item
@@ -4365,9 +5413,9 @@ function Chat({
4365
5413
  );
4366
5414
  }
4367
5415
  },
4368
- [stream.client]
5416
+ [uploadContextFile]
4369
5417
  );
4370
- const handleRetryUpload = React21.useCallback(
5418
+ const handleRetryUpload = React23.useCallback(
4371
5419
  (localId) => {
4372
5420
  const attachment = attachments.find((a) => a.localId === localId);
4373
5421
  if (!attachment || attachment.status !== "error") return;
@@ -4452,7 +5500,7 @@ function Chat({
4452
5500
  );
4453
5501
  scrollToBottom(true, true);
4454
5502
  };
4455
- const loadConversationMessages = React21.useCallback(
5503
+ const loadConversationMessages = React23.useCallback(
4456
5504
  async (recordId) => {
4457
5505
  if (missingConfig) {
4458
5506
  setHistoryError(missingConfigShortMessage);
@@ -4538,18 +5586,18 @@ function Chat({
4538
5586
  }
4539
5587
  };
4540
5588
  const acceptMimes = composer?.attachments?.accept ? Object.entries(composer.attachments.accept).map(([mime, exts]) => [mime, ...exts.map((e) => `.${e}`)].join(",")).join(",") : void 0;
4541
- const currentThread = React21.useMemo(
5589
+ const currentThread = React23.useMemo(
4542
5590
  () => threads.find((item) => item.id === stream.threadId),
4543
5591
  [threads, stream.threadId]
4544
5592
  );
4545
5593
  const errorMessage = stream.error instanceof Error ? stream.error.message : void 0;
4546
- const threadErrorMessage = React21.useMemo(() => {
5594
+ const threadErrorMessage = React23.useMemo(() => {
4547
5595
  if (currentThread?.status !== "error") return void 0;
4548
5596
  const message = currentThread.error?.trim();
4549
5597
  return message || t("thread.errorToast");
4550
5598
  }, [currentThread, t]);
4551
5599
  const assistantTitle = assistantName || resolvedTitle;
4552
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5600
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4553
5601
  "div",
4554
5602
  {
4555
5603
  ref: viewportRef,
@@ -4558,10 +5606,10 @@ function Chat({
4558
5606
  className
4559
5607
  ),
4560
5608
  children: [
4561
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
4562
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
4563
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "relative shrink-0", children: [
4564
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5609
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center justify-between border-b p-2 sticky top-0 z-10 bg-background", children: [
5610
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
5611
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "relative shrink-0", children: [
5612
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4565
5613
  ChatkitAvatar,
4566
5614
  {
4567
5615
  avatar: assistantAvatar,
@@ -4569,10 +5617,10 @@ function Chat({
4569
5617
  label: assistantTitle
4570
5618
  }
4571
5619
  ),
4572
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
5620
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "absolute bottom-0 right-0 h-2.5 w-2.5 rounded-full border-2 border-background bg-green-500" })
4573
5621
  ] }),
4574
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "truncate", children: [
4575
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5622
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "truncate", children: [
5623
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4576
5624
  "h2",
4577
5625
  {
4578
5626
  className: "text-lg font-semibold truncate",
@@ -4580,11 +5628,11 @@ function Chat({
4580
5628
  children: assistantTitle
4581
5629
  }
4582
5630
  ),
4583
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
5631
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-xs text-muted-foreground", children: t("chat.statusOnline") })
4584
5632
  ] })
4585
5633
  ] }),
4586
- history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex items-center gap-1", children: [
4587
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5634
+ history?.enabled !== false && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex items-center gap-1", children: [
5635
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4588
5636
  "button",
4589
5637
  {
4590
5638
  type: "button",
@@ -4597,10 +5645,10 @@ function Chat({
4597
5645
  "disabled:opacity-50 disabled:cursor-not-allowed"
4598
5646
  ),
4599
5647
  title: t("history.newThread"),
4600
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.Pencil, { size: 16 })
5648
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.Pencil, { size: 16 })
4601
5649
  }
4602
5650
  ),
4603
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5651
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4604
5652
  HistorySidebar,
4605
5653
  {
4606
5654
  threads,
@@ -4614,18 +5662,18 @@ function Chat({
4614
5662
  )
4615
5663
  ] })
4616
5664
  ] }),
4617
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex-1 p-4", children: [
4618
- errorMessage && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
4619
- historyError && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
4620
- showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
4621
- isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
4622
- messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5665
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex-1 p-4", children: [
5666
+ errorMessage && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-4 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive", children: errorMessage }),
5667
+ historyError && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: historyError }),
5668
+ showMissingConfig && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-4 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900", children: missingConfigDetailMessage }),
5669
+ isHistoryLoading && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-4 rounded-lg border border-muted px-3 py-2 text-sm text-muted-foreground", children: t("chat.loadingThread") }),
5670
+ messages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4623
5671
  StartScreen,
4624
5672
  {
4625
5673
  startScreen,
4626
5674
  onPromptClick: handlePromptClick
4627
5675
  }
4628
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "space-y-4", children: [
5676
+ ) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "space-y-4", children: [
4629
5677
  messages.map((message, index) => {
4630
5678
  const messageType = String(message.type);
4631
5679
  const isAssistantMessage = messageType === "assistant" || messageType === "ai";
@@ -4652,7 +5700,7 @@ function Chat({
4652
5700
  if (!isAssistantMessage && !hasPlainRenderableContent && !hasHumanAttachments && humanReferences.length === 0) {
4653
5701
  return null;
4654
5702
  }
4655
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5703
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4656
5704
  "div",
4657
5705
  {
4658
5706
  className: cn(
@@ -4660,8 +5708,8 @@ function Chat({
4660
5708
  message.type === "human" ? "justify-end" : "justify-start -ml-1"
4661
5709
  // AI messages: slightly closer to left
4662
5710
  ),
4663
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "flex flex-col px-3 overflow-hidden", children: [
4664
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5711
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-col px-3 overflow-hidden", children: [
5712
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4665
5713
  "div",
4666
5714
  {
4667
5715
  ...canQuoteMessage ? {
@@ -4673,7 +5721,7 @@ function Chat({
4673
5721
  message.type === "human" ? "bg-primary text-primary-foreground px-4 py-2.5" : message.type === "system" ? "bg-muted text-muted-foreground text-xs px-4 py-2.5" : "py-1 text-chat-foreground"
4674
5722
  // AI messages: use chat-specific foreground color
4675
5723
  ),
4676
- children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5724
+ children: isAssistantMessage ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4677
5725
  AssistantMessage,
4678
5726
  {
4679
5727
  message: {
@@ -4683,8 +5731,8 @@ function Chat({
4683
5731
  isStreaming: isStreamingMessage,
4684
5732
  streamingStatus
4685
5733
  }
4686
- ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
4687
- message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5734
+ ) : /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
5735
+ message.type === "human" && humanReferences.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-2 flex flex-wrap gap-1.5", children: humanReferences.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4688
5736
  ReferenceChip,
4689
5737
  {
4690
5738
  reference,
@@ -4692,29 +5740,29 @@ function Chat({
4692
5740
  },
4693
5741
  getReferenceKey(reference)
4694
5742
  )) }),
4695
- message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5743
+ message.type === "human" && humanAttachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2", children: humanAttachments.map((file, fileIndex) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4696
5744
  "div",
4697
5745
  {
4698
5746
  className: "flex items-center gap-1.5 rounded-md bg-primary-foreground/20 px-2 py-1 text-xs",
4699
5747
  children: [
4700
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.FileText, { size: 12 }),
4701
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
5748
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.FileText, { size: 12 }),
5749
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "max-w-[100px] truncate", children: file.originalName })
4702
5750
  ]
4703
5751
  },
4704
5752
  fileIndex
4705
5753
  )) }),
4706
- Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5754
+ Array.isArray(message.content) ? message.content.map((part, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4707
5755
  "p",
4708
5756
  {
4709
5757
  className: "wrap-break-word text-sm leading-relaxed",
4710
5758
  children: formatMessageContent(part)
4711
5759
  },
4712
5760
  `${part.type}-${partIndex}`
4713
- )) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
5761
+ )) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "wrap-break-word text-sm leading-relaxed", children: formatMessageContent(message.content) })
4714
5762
  ] })
4715
5763
  }
4716
5764
  ),
4717
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5765
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4718
5766
  MessageActions,
4719
5767
  {
4720
5768
  content: messageContent,
@@ -4750,7 +5798,7 @@ function Chat({
4750
5798
  stream.isLoading,
4751
5799
  { now: streamingNow }
4752
5800
  );
4753
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5801
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex justify-start gap-3 -ml-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "max-w-full rounded-2xl py-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4754
5802
  AssistantStreamingIndicator,
4755
5803
  {
4756
5804
  status: fallbackStreamingStatus ?? "loading"
@@ -4759,7 +5807,7 @@ function Chat({
4759
5807
  })()
4760
5808
  ] })
4761
5809
  ] }),
4762
- !isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5810
+ !isAtBottom && messages.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "sticky bottom-20 z-20 flex justify-center px-4 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4763
5811
  Button,
4764
5812
  {
4765
5813
  type: "button",
@@ -4772,10 +5820,10 @@ function Chat({
4772
5820
  onClick: () => scrollToBottom(true, true),
4773
5821
  "aria-label": t("chat.scrollToBottom"),
4774
5822
  title: t("chat.scrollToBottom"),
4775
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.ArrowDown, { size: 16 })
5823
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.ArrowDown, { size: 16 })
4776
5824
  }
4777
5825
  ) }),
4778
- quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5826
+ quoteSelection && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4779
5827
  "div",
4780
5828
  {
4781
5829
  className: "pointer-events-none fixed z-50",
@@ -4784,7 +5832,7 @@ function Chat({
4784
5832
  left: `${quoteSelection.left}px`,
4785
5833
  transform: "translateX(-50%)"
4786
5834
  },
4787
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5835
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4788
5836
  Button,
4789
5837
  {
4790
5838
  type: "button",
@@ -4796,16 +5844,16 @@ function Chat({
4796
5844
  "aria-label": t("composer.quoteSelection"),
4797
5845
  title: t("composer.quoteSelection"),
4798
5846
  children: [
4799
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.Quote, { size: 14 }),
5847
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.Quote, { size: 14 }),
4800
5848
  t("composer.quoteSelection")
4801
5849
  ]
4802
5850
  }
4803
5851
  )
4804
5852
  }
4805
5853
  ),
4806
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
4807
- threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
4808
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5854
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "p-2 sticky bottom-0 z-10 bg-background", children: [
5855
+ threadErrorMessage && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-3 rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive overflow-auto", children: threadErrorMessage }),
5856
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4809
5857
  "input",
4810
5858
  {
4811
5859
  ref: fileInputRef,
@@ -4816,7 +5864,7 @@ function Chat({
4816
5864
  className: "hidden"
4817
5865
  }
4818
5866
  ),
4819
- attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5867
+ attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: attachments.map((item) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4820
5868
  "div",
4821
5869
  {
4822
5870
  className: cn(
@@ -4824,16 +5872,16 @@ function Chat({
4824
5872
  item.status === "error" ? "bg-destructive/10 border border-destructive/30" : "bg-muted"
4825
5873
  ),
4826
5874
  children: [
4827
- item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
4828
- import_lucide_react10.Loader2,
5875
+ item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5876
+ import_lucide_react12.Loader2,
4829
5877
  {
4830
5878
  size: 14,
4831
5879
  className: "animate-spin text-muted-foreground"
4832
5880
  }
4833
5881
  ),
4834
- item.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.FileText, { size: 14, className: "text-muted-foreground" }),
4835
- item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.FileText, { size: 14, className: "text-destructive" }),
4836
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5882
+ item.status === "success" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.FileText, { size: 14, className: "text-muted-foreground" }),
5883
+ item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.FileText, { size: 14, className: "text-destructive" }),
5884
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4837
5885
  "span",
4838
5886
  {
4839
5887
  className: cn(
@@ -4843,17 +5891,17 @@ function Chat({
4843
5891
  children: item.file.name
4844
5892
  }
4845
5893
  ),
4846
- item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5894
+ item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4847
5895
  "button",
4848
5896
  {
4849
5897
  type: "button",
4850
5898
  onClick: () => handleRetryUpload(item.localId),
4851
5899
  className: "ml-1 rounded-full p-0.5 text-destructive hover:bg-destructive/20",
4852
5900
  title: t("chat.retryUpload"),
4853
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.RefreshCw, { size: 12 })
5901
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.RefreshCw, { size: 12 })
4854
5902
  }
4855
5903
  ),
4856
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5904
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4857
5905
  "button",
4858
5906
  {
4859
5907
  type: "button",
@@ -4862,14 +5910,14 @@ function Chat({
4862
5910
  "ml-1 rounded-full p-0.5",
4863
5911
  item.status === "error" ? "text-destructive hover:bg-destructive/20" : "hover:bg-muted-foreground/20"
4864
5912
  ),
4865
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.X, { size: 12 })
5913
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.X, { size: 12 })
4866
5914
  }
4867
5915
  )
4868
5916
  ]
4869
5917
  },
4870
5918
  item.localId
4871
5919
  )) }),
4872
- references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5920
+ references.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "mb-3 flex flex-wrap gap-2", children: references.map((reference) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4873
5921
  ReferenceChip,
4874
5922
  {
4875
5923
  reference,
@@ -4883,19 +5931,27 @@ function Chat({
4883
5931
  },
4884
5932
  getReferenceKey(reference)
4885
5933
  )) }),
4886
- selectedTool && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mb-2 flex items-center gap-2", children: [
4887
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary", children: selectedTool.shortLabel ?? selectedTool.label }),
4888
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5934
+ selectedTool && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mb-2 flex items-center gap-2", children: [
5935
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary", children: selectedTool.shortLabel ?? selectedTool.label }),
5936
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4889
5937
  "button",
4890
5938
  {
4891
5939
  type: "button",
4892
5940
  onClick: () => setSelectedTool(null),
4893
5941
  className: "rounded-full p-0.5 text-muted-foreground hover:bg-muted",
4894
- children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react10.X, { size: 12 })
5942
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react12.X, { size: 12 })
4895
5943
  }
4896
5944
  )
4897
5945
  ] }),
4898
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5946
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5947
+ PendingTodos,
5948
+ {
5949
+ snapshot: stream.todos,
5950
+ attachToComposer: !hasPendingFollowUps,
5951
+ className: hasPendingFollowUps ? "mb-2" : void 0
5952
+ }
5953
+ ),
5954
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4899
5955
  PendingFollowUps,
4900
5956
  {
4901
5957
  items: pendingFollowUps,
@@ -4906,10 +5962,11 @@ function Chat({
4906
5962
  canSendNow: stream.canSendPendingFollowUpNow,
4907
5963
  onSendNow: (id) => stream.sendPendingFollowUpNow(id),
4908
5964
  onEdit: handleEditPendingFollowUp,
4909
- onRemove: stream.removePendingFollowUp
5965
+ onRemove: stream.removePendingFollowUp,
5966
+ attachToComposer: true
4910
5967
  }
4911
5968
  ),
4912
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5969
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("form", { className: "flex items-end", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
4913
5970
  "div",
4914
5971
  {
4915
5972
  className: cn(
@@ -4921,7 +5978,7 @@ function Chat({
4921
5978
  getRoundedClass(theme.radius)
4922
5979
  ),
4923
5980
  children: [
4924
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5981
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4925
5982
  ComposerMenu,
4926
5983
  {
4927
5984
  composer,
@@ -4931,12 +5988,13 @@ function Chat({
4931
5988
  disabled: missingConfig || isHistoryLoading
4932
5989
  }
4933
5990
  ),
4934
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5991
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4935
5992
  "textarea",
4936
5993
  {
4937
5994
  ref: composerInputRef,
4938
5995
  value: draft,
4939
5996
  onChange: (event) => setDraft(event.target.value),
5997
+ onPaste: handleComposerPaste,
4940
5998
  onKeyDown: handleComposerKeyDown,
4941
5999
  rows: 1,
4942
6000
  placeholder: inputPlaceholder,
@@ -4948,7 +6006,7 @@ function Chat({
4948
6006
  )
4949
6007
  }
4950
6008
  ),
4951
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6009
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4952
6010
  SendButton,
4953
6011
  {
4954
6012
  disabled: isSendDisabled,
@@ -4956,13 +6014,23 @@ function Chat({
4956
6014
  showStop: stream.isLoading && !trimmedDraft,
4957
6015
  onStop: () => stream.stop(),
4958
6016
  stopLabel: t("chat.stop"),
4959
- sendLabel: t("chat.send")
6017
+ sendLabel: t("chat.send"),
6018
+ shortcuts: stream.isLoading && trimmedDraft ? [
6019
+ {
6020
+ label: t("chat.followUps.steer"),
6021
+ keys: followUpShortcutLabels.steer
6022
+ },
6023
+ {
6024
+ label: t("chat.followUps.queue"),
6025
+ keys: followUpShortcutLabels.queue
6026
+ }
6027
+ ] : void 0
4960
6028
  }
4961
6029
  )
4962
6030
  ]
4963
6031
  }
4964
6032
  ) }),
4965
- disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6033
+ disclaimer?.text && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4966
6034
  "p",
4967
6035
  {
4968
6036
  className: cn(
@@ -4972,9 +6040,9 @@ function Chat({
4972
6040
  children: disclaimer.text
4973
6041
  }
4974
6042
  ),
4975
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
4976
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: t("chat.poweredBy") }),
4977
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
6043
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "mt-2 flex items-center justify-center gap-2 text-xs text-muted-foreground", children: [
6044
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { children: t("chat.poweredBy") }),
6045
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ContextUsageIndicator, { className: "absolute right-4" })
4978
6046
  ] })
4979
6047
  ] })
4980
6048
  ]
@@ -4983,11 +6051,11 @@ function Chat({
4983
6051
  }
4984
6052
 
4985
6053
  // src/components/ui/input.tsx
4986
- var React22 = __toESM(require("react"), 1);
4987
- var import_jsx_runtime28 = require("react/jsx-runtime");
4988
- var Input = React22.forwardRef(
6054
+ var React24 = __toESM(require("react"), 1);
6055
+ var import_jsx_runtime30 = require("react/jsx-runtime");
6056
+ var Input = React24.forwardRef(
4989
6057
  ({ className, type, ...props }, ref) => {
4990
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
6058
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
4991
6059
  "input",
4992
6060
  {
4993
6061
  ref,
@@ -5004,10 +6072,10 @@ var Input = React22.forwardRef(
5004
6072
  Input.displayName = "Input";
5005
6073
 
5006
6074
  // src/components/ui/separator.tsx
5007
- var React23 = __toESM(require("react"), 1);
5008
- var import_jsx_runtime29 = require("react/jsx-runtime");
5009
- var Separator = React23.forwardRef(
5010
- ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
6075
+ var React25 = __toESM(require("react"), 1);
6076
+ var import_jsx_runtime31 = require("react/jsx-runtime");
6077
+ var Separator = React25.forwardRef(
6078
+ ({ className, orientation = "horizontal", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5011
6079
  "div",
5012
6080
  {
5013
6081
  ref,