thursday-agent 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  11. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  12. package/.next/server/app/_not-found.html +1 -1
  13. package/.next/server/app/_not-found.rsc +2 -2
  14. package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  15. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  16. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  17. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  18. package/.next/server/app/api/bot/keep-working/route.js.nft.json +1 -1
  19. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  22. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  24. package/.next/server/app/api/config/route.js.nft.json +1 -1
  25. package/.next/server/app/api/events/route.js.nft.json +1 -1
  26. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  29. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  30. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  31. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  32. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  34. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  35. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  36. package/.next/server/app/api/memory/edit/route.js +1 -1
  37. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  38. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  39. package/.next/server/app/api/probe/route.js.nft.json +1 -1
  40. package/.next/server/app/api/reach/route.js +11 -11
  41. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  42. package/.next/server/app/api/routine/route.js +6 -6
  43. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  44. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  45. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  46. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  47. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  48. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  49. package/.next/server/app/api/thursday/text/route.js +11 -11
  50. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  51. package/.next/server/app/api/thursday/tool-call/route.js +6 -6
  52. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  53. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  54. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  55. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  56. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  57. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  58. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  59. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  60. package/.next/server/app/page/server-reference-manifest.json +56 -56
  61. package/.next/server/app/page.js +3 -3
  62. package/.next/server/app/page.js.nft.json +1 -1
  63. package/.next/server/app/page_client-reference-manifest.js +1 -1
  64. package/.next/server/chunks/[root-of-the-server]__012s2o8._.js +1 -1
  65. package/.next/server/chunks/[root-of-the-server]__04r4h-2._.js +1 -1
  66. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  67. package/.next/server/chunks/[root-of-the-server]__0nmhgeo._.js +3 -0
  68. package/.next/server/chunks/[root-of-the-server]__1fy2g82._.js +3 -0
  69. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  70. package/.next/server/chunks/[root-of-the-server]__1nmflqk._.js +3 -0
  71. package/.next/server/chunks/[root-of-the-server]__1v7-zke._.js +1 -1
  72. package/.next/server/chunks/[root-of-the-server]__1wnzmx9._.js +3 -0
  73. package/.next/server/chunks/[root-of-the-server]__1xv-5cq._.js +1 -1
  74. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  75. package/.next/server/chunks/_05v8k21._.js +1 -1
  76. package/.next/server/chunks/_0awtznl._.js +4 -4
  77. package/.next/server/chunks/_0k6qjcf._.js +1 -1
  78. package/.next/server/chunks/_0na2fj1._.js +5 -5
  79. package/.next/server/chunks/_0x-ej3f._.js +21 -21
  80. package/.next/server/chunks/_1dc_d1q._.js +22 -20
  81. package/.next/server/chunks/_1jc5g4p._.js +2 -2
  82. package/.next/server/chunks/_1jn-aep._.js +50 -48
  83. package/.next/server/chunks/{_1u8ygbz._.js → _1m88lkh._.js} +7 -7
  84. package/.next/server/chunks/_1uuucy-._.js +4 -4
  85. package/.next/server/chunks/_1v9r2ke._.js +1 -1
  86. package/.next/server/chunks/ssr/{[root-of-the-server]__1h4bnrf._.js → [root-of-the-server]__0oo-wlv._.js} +2 -2
  87. package/.next/server/chunks/ssr/{[root-of-the-server]__1kyi568._.js → [root-of-the-server]__0tvavy9._.js} +1 -1
  88. package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +1 -1
  89. package/.next/server/chunks/ssr/[root-of-the-server]__0zuns7e._.js +3 -0
  90. package/.next/server/chunks/ssr/[root-of-the-server]__1se25x0._.js +1 -1
  91. package/.next/server/chunks/ssr/{_1i3ddn7._.js → _05pl_u8._.js} +1 -1
  92. package/.next/server/chunks/ssr/_070nv1_._.js +3 -0
  93. package/.next/server/chunks/ssr/_097-ljd._.js +1 -1
  94. package/.next/server/chunks/ssr/_0dshsh4._.js +3 -0
  95. package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
  96. package/.next/server/chunks/ssr/{_0z8jpch._.js → _0ital-2._.js} +2 -2
  97. package/.next/server/chunks/ssr/{_19g570d._.js → _0kjj5ts._.js} +3 -3
  98. package/.next/server/chunks/ssr/{_1nod5hh._.js → _0l_mcfz._.js} +2 -2
  99. package/.next/server/chunks/ssr/_0ld9_qq._.js +1 -1
  100. package/.next/server/chunks/ssr/_0ltz2q5._.js +3 -0
  101. package/.next/server/chunks/ssr/_0scf7xy._.js +3 -0
  102. package/.next/server/chunks/ssr/_0u5xv6g._.js +3 -0
  103. package/.next/server/chunks/ssr/{_0ewory0._.js → _0urj3mc._.js} +2 -2
  104. package/.next/server/chunks/ssr/{_0pm-2p-._.js → _1-zyvdb._.js} +2 -2
  105. package/.next/server/chunks/ssr/{_1_rqu8x._.js → _12mijol._.js} +7 -7
  106. package/.next/server/chunks/ssr/_15zqt-t._.js +1 -1
  107. package/.next/server/chunks/ssr/_184327j._.js +1 -1
  108. package/.next/server/chunks/ssr/{_1y-ea28._.js → _1a-nuxx._.js} +2 -2
  109. package/.next/server/chunks/ssr/_1alxym6._.js +3 -0
  110. package/.next/server/chunks/ssr/{_0hzz82u._.js → _1d423aj._.js} +25 -23
  111. package/.next/server/chunks/ssr/{_1u1mxu9._.js → _1flbs77._.js} +2 -2
  112. package/.next/server/chunks/ssr/_1mqn9mc._.js +1 -1
  113. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  114. package/.next/server/chunks/ssr/{_1oijqjw._.js → _1tmu8z-._.js} +2 -2
  115. package/.next/server/chunks/ssr/{_10y6r1n._.js → _1uy0xom._.js} +3 -3
  116. package/.next/server/chunks/ssr/_1x-kojb._.js +20 -0
  117. package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
  118. package/.next/server/chunks/ssr/_1z74dmq._.js +164 -0
  119. package/.next/server/chunks/ssr/features_bot_1nr94ks._.js +3 -0
  120. package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +1 -1
  121. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  122. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  123. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  124. package/.next/server/chunks/ssr/{node_modules_111sh9o._.js → node_modules_03d0rfz._.js} +1 -1
  125. package/.next/server/chunks/ssr/{node_modules_0lg75qx._.js → node_modules_04_sbbc._.js} +1 -1
  126. package/.next/server/chunks/ssr/{node_modules_10gbm2y._.js → node_modules_05ybmta._.js} +1 -1
  127. package/.next/server/chunks/ssr/{node_modules_1v9tc1c._.js → node_modules_068ws5v._.js} +1 -1
  128. package/.next/server/chunks/ssr/{node_modules_1_8mv4v._.js → node_modules_06bb4q8._.js} +1 -1
  129. package/.next/server/chunks/ssr/{node_modules_01f8_se._.js → node_modules_07rs_p2._.js} +1 -1
  130. package/.next/server/chunks/ssr/{node_modules_0ii1l89._.js → node_modules_0dzm4um._.js} +1 -1
  131. package/.next/server/chunks/ssr/{node_modules_20xmwtu._.js → node_modules_0jljel9._.js} +1 -1
  132. package/.next/server/chunks/ssr/{node_modules_1ix-g49._.js → node_modules_0sgy-dc._.js} +1 -1
  133. package/.next/server/chunks/ssr/{node_modules_0woscox._.js → node_modules_0t_ez6-._.js} +1 -1
  134. package/.next/server/chunks/ssr/{node_modules_059vtf2._.js → node_modules_0th357h._.js} +1 -1
  135. package/.next/server/chunks/ssr/{node_modules_06w645b._.js → node_modules_0ubdtk-._.js} +1 -1
  136. package/.next/server/chunks/ssr/{node_modules_0b8df3s._.js → node_modules_0uyh_vb._.js} +1 -1
  137. package/.next/server/chunks/ssr/{node_modules_07ih6wb._.js → node_modules_0wnlddw._.js} +1 -1
  138. package/.next/server/chunks/ssr/{node_modules_0gt-uw9._.js → node_modules_0x630an._.js} +1 -1
  139. package/.next/server/chunks/ssr/{node_modules_1x825hz._.js → node_modules_0yvz9e0._.js} +1 -1
  140. package/.next/server/chunks/ssr/{node_modules_0t-44lj._.js → node_modules_12et8d5._.js} +1 -1
  141. package/.next/server/chunks/ssr/{node_modules_1m3gb16._.js → node_modules_13kwejm._.js} +1 -1
  142. package/.next/server/chunks/ssr/{node_modules_1p9rdsy._.js → node_modules_1af3w91._.js} +1 -1
  143. package/.next/server/chunks/ssr/{node_modules_0sz5yg1._.js → node_modules_1bucjlk._.js} +1 -1
  144. package/.next/server/chunks/ssr/{node_modules_1teyzfa._.js → node_modules_1lkix61._.js} +1 -1
  145. package/.next/server/chunks/ssr/{node_modules_1lsyy7k._.js → node_modules_1ogczzz._.js} +1 -1
  146. package/.next/server/chunks/ssr/{node_modules_1-7qawg._.js → node_modules_1s-gb-1._.js} +1 -1
  147. package/.next/server/chunks/ssr/{node_modules_0yv-re6._.js → node_modules_1uwg-gz._.js} +1 -1
  148. package/.next/server/chunks/ssr/{node_modules_03ptrl9._.js → node_modules_1wbkzl9._.js} +1 -1
  149. package/.next/server/chunks/ssr/{node_modules_00jv9_3._.js → node_modules_1z1lrbk._.js} +1 -1
  150. package/.next/server/chunks/ssr/{node_modules_@base-ui_react_0jne69c._.js → node_modules_@base-ui_react_0buz1-j._.js} +1 -1
  151. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_00q1oa3._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0r443fh._.js} +1 -1
  152. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1-2_5z7._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_10wnlbk._.js} +1 -1
  153. package/.next/server/middleware-build-manifest.js +3 -3
  154. package/.next/server/pages/404.html +1 -1
  155. package/.next/server/pages/500.html +1 -1
  156. package/.next/server/server-reference-manifest.js +1 -1
  157. package/.next/server/server-reference-manifest.json +57 -57
  158. package/.next/static/chunks/06nt9tatr-dug.js +1 -0
  159. package/.next/static/chunks/0_awn8tucznxc.js +1 -0
  160. package/.next/static/chunks/{34s52v8f841zo.js → 0ge-hx0ed83a1.js} +1 -1
  161. package/.next/static/chunks/0pda_vf-abwvx.js +1 -0
  162. package/.next/static/chunks/{2u9yjkpkoij75.js → 0qmd8n52hp-6v.js} +1 -1
  163. package/.next/static/chunks/0rowp9rx3qbxu.js +18 -0
  164. package/.next/static/chunks/{1ocy4w0v20a3v.js → 13ixzheqw7o-w.js} +2 -2
  165. package/.next/static/chunks/1grkt5gr8pbg1.js +17 -0
  166. package/.next/static/chunks/{21gf2t_whhurc.js → 1yugpvvi8qrbu.js} +2 -2
  167. package/.next/static/chunks/{1e4yrzs5evq_r.js → 245hb85nsy6j4.js} +1 -1
  168. package/.next/static/chunks/27lkanxvtdn09.js +1 -0
  169. package/.next/static/chunks/{0oz7a68qanm99.js → 27tvv1i-smrck.js} +1 -1
  170. package/.next/static/chunks/{2zhfdbq50ee5i.js → 2c64drdevdla3.js} +1 -1
  171. package/.next/static/chunks/{0k5tkt_qi52kb.js → 2ndw4w4u2x51r.js} +1 -1
  172. package/.next/static/chunks/37j27b3e1gt7r.js +1 -0
  173. package/.next/static/chunks/{2om4lkg86feb4.js → 38301ji-85i30.js} +1 -1
  174. package/.next/static/chunks/{09c13vnqy7al3.js → 3bbzsitgiltnt.js} +2 -2
  175. package/.next/static/chunks/3fec-aeteddr-.js +1 -0
  176. package/.next/static/chunks/3go3hwp1z2_h2.css +1 -0
  177. package/.next/static/chunks/3h2bun3hcggg8.js +1 -0
  178. package/.next/static/chunks/{0g1p98s2pfx2w.js → 3h2e-xv1zxh_f.js} +2 -2
  179. package/.next/static/chunks/3j1y335o95mj7.js +1 -0
  180. package/.next/static/chunks/3obf9n3cxj99k.js +1 -0
  181. package/.next/static/chunks/{2upc9mkcc3nlq.js → 427qsc6kahxyo.js} +1 -1
  182. package/README.md +31 -14
  183. package/bin/port.mjs +11 -7
  184. package/bin/thursday.mjs +1 -1
  185. package/components/ui/radio-group.tsx +2 -2
  186. package/components/ui/shiny-text.tsx +3 -22
  187. package/docs/how-it-works.md +11 -3
  188. package/docs/images/first-run.png +0 -0
  189. package/docs/images/keeps-going.png +0 -0
  190. package/docs/images/two-minds.png +0 -0
  191. package/features/ai/components/model-browser.tsx +1 -1
  192. package/features/ai/components/model-picker.tsx +1 -1
  193. package/features/ai/guide.ts +9 -4
  194. package/features/ai/prompts/bot.prompt.ts +4 -1
  195. package/features/ai/tools/routine.tool.ts +28 -16
  196. package/features/bot/bot.runner.ts +3 -1
  197. package/features/bot/components/bot-mark.tsx +6 -1
  198. package/features/bot/components/bot-setting.tsx +2 -4
  199. package/features/bot/components/bot-tool.tsx +2 -0
  200. package/features/bot/components/room-list.tsx +12 -3
  201. package/features/bot/components/room-pill.tsx +26 -19
  202. package/features/config/components/config-setting.tsx +17 -5
  203. package/features/config/components/voice-key.tsx +38 -18
  204. package/features/connectors/mcp.const.ts +90 -59
  205. package/features/intro/components/intro.tsx +50 -27
  206. package/features/routine/components/routine-mark.tsx +4 -6
  207. package/features/routine/components/routine-setting.tsx +332 -143
  208. package/features/routine/routine.query.ts +24 -3
  209. package/features/routine/routine.schema.ts +55 -4
  210. package/features/settings/components/install-app.tsx +1 -4
  211. package/features/settings/components/setting-ui.tsx +1 -1
  212. package/features/skills/skills.discover.ts +2 -1
  213. package/features/skills/skills.query.ts +5 -1
  214. package/features/skills/skills.schema.ts +2 -0
  215. package/features/thursday/components/ascii-orb.tsx +39 -10
  216. package/features/thursday/components/connect-wave.tsx +284 -0
  217. package/features/thursday/components/side-captions.tsx +29 -17
  218. package/features/thursday/components/thursday-setting.tsx +2 -2
  219. package/features/thursday/components/thursday.tsx +130 -58
  220. package/features/thursday/components/voice-picker.tsx +1 -1
  221. package/features/thursday/components/write-line.tsx +2 -2
  222. package/features/thursday/open-work.ts +11 -3
  223. package/features/thursday/tool-line.ts +94 -12
  224. package/features/thursday/use-text-call.ts +3 -2
  225. package/features/thursday/use-thursday.ts +5 -2
  226. package/features/workspace/components/artifact-view.tsx +129 -7
  227. package/guide/bots.md +17 -5
  228. package/guide/calls.md +15 -7
  229. package/guide/setup.md +10 -2
  230. package/lib/desktop-notify.ts +3 -2
  231. package/package.json +1 -1
  232. package/scripts/bot-context.test.mts +1 -1
  233. package/skills/computer/SKILL.md +1 -0
  234. package/skills/interactive-page/SKILL.md +4 -0
  235. package/.next/server/chunks/[root-of-the-server]__0n-l_n_._.js +0 -3
  236. package/.next/server/chunks/[root-of-the-server]__0wvo2of._.js +0 -3
  237. package/.next/server/chunks/[root-of-the-server]__1e6aut3._.js +0 -3
  238. package/.next/server/chunks/[root-of-the-server]__1ziojdq._.js +0 -3
  239. package/.next/server/chunks/ssr/[root-of-the-server]__1srp8l5._.js +0 -3
  240. package/.next/server/chunks/ssr/_0mes4s0._.js +0 -3
  241. package/.next/server/chunks/ssr/_0ya0cb0._.js +0 -3
  242. package/.next/server/chunks/ssr/_0yto5s7._.js +0 -20
  243. package/.next/server/chunks/ssr/_10dw2nv._.js +0 -3
  244. package/.next/server/chunks/ssr/_1p0gxeo._.js +0 -164
  245. package/.next/server/chunks/ssr/_1r41yvh._.js +0 -3
  246. package/.next/server/chunks/ssr/_1r79ksv._.js +0 -3
  247. package/.next/server/chunks/ssr/features_bot_1ogjt52._.js +0 -3
  248. package/.next/server/chunks/ssr/node_modules_@base-ui_react_0b3d4m9._.js +0 -3
  249. package/.next/static/chunks/03omwz_vi2ndg.js +0 -1
  250. package/.next/static/chunks/0_1bqgd6wt_og.js +0 -1
  251. package/.next/static/chunks/0abgkzikaznxc.js +0 -1
  252. package/.next/static/chunks/0bddkpash59-o.js +0 -17
  253. package/.next/static/chunks/0c2-bzhy3a0ib.js +0 -1
  254. package/.next/static/chunks/0iilfb1ocevnx.js +0 -1
  255. package/.next/static/chunks/0imbhx-j830a_.css +0 -1
  256. package/.next/static/chunks/24h1y9dhy3m_2.js +0 -1
  257. package/.next/static/chunks/2be08eqxsfc1y.js +0 -1
  258. package/.next/static/chunks/2d3yhjtafgmtw.js +0 -1
  259. package/.next/static/chunks/2f_5saocsko_b.js +0 -1
  260. package/.next/static/chunks/2lwbr5vx0ixaj.js +0 -18
  261. package/.next/static/chunks/44kjmi5h_p8px.js +0 -1
  262. /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_buildManifest.js +0 -0
  263. /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_clientMiddlewareManifest.js +0 -0
  264. /package/.next/static/{UiOMPYpQ4fqGyu5PzS-7j → u8kJqShUAa49vY7BxAWsw}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null);return(0,a.useEffect)(()=>c(!1),[e]),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),h=e.i(660302),f=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7f220551c6465300b702969a592872219cbd5034ef",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),C=e.i(647163),T=e.i(553429),_=e.i(978411),M=e.i(222055);function B({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})}function $({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{thread:e}),(0,t.jsx)(R,{thread:e}),(0,t.jsx)(I,{thread:e})]})}function A({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,C.formatCount)(n)} tokens \xb7 in total in ${(0,C.formatCount)(a.input)} \xb7 out ${(0,C.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,C.formatCount)(n)}):null}function R({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)});if((0,m.useEffect)(()=>r(!1),[n]),!n||!a)return null;let l=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name).catch(()=>{}),title:s?"It summarizes itself at its next step":`Context ${(0,C.formatCount)(n)} of ${(0,C.formatCount)(a)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,C.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":l>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*l))}%`}})})})}let D={working:"text-muted-foreground",waiting:C.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"};function I({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(h.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,C.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:e.status})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(f.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,C.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(f.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:n.map(n=>{let a=q(e,n.name);return(0,t.jsxs)(f.TabsTrigger,{value:n.name,className:(0,C.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function q(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===Q.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(Z,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(Y,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(O,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==Q.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(ee,{line:o.line,surface:r,mention:d},o.key)})})})}function O({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?q(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),f=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",f?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":f,onClick:()=>{o(e=>!e),c(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(h.ShinyText,{text:"asking"===u?"waiting on you":b?G(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:"min-w-0 truncate text-[12px] leading-4"}):(0,t.jsx)(U,{words:b?G(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · ")}),e.length>0&&(0,t.jsx)(H,{open:f})]}),!f&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),f&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ed(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(eo,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e,inset:!0},e.id)))})]})}function K({lines:e,trailing:n,bot:a,thread:s}){let r=n?q(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ed(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(eo,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e},e.id))),r&&!i&&(0,t.jsx)(h.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,C.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function H({open:e}){return(0,t.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,t.jsx)(s.ChevronDown,{className:(0,C.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function G(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,C.plainText)(e.text).replace(/\s+/g," ").trim()}function V({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{from:Q,to:e.bot}),(0,t.jsx)(Z,{side:"end",name:Q.name,mark:(0,t.jsx)(Y,{bot:Q}),children:(0,t.jsx)(J,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let Q={name:T.ROOM_THURSDAY};function W({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(X,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(X,{bot:n})]})})}function X({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function Y({bot:e}){return e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function J({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,C.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,C.cn)("min-w-0",e&&"inverse"),children:n})})})}function Z({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,C.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function ee({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(es,{}),a?(0,t.jsx)(ea,{bot:a,bubble:i,children:o}):(0,t.jsx)(et,{bubble:i,className:(0,C.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(J,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(ei,{text:e.text})})]})}function et({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,C.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",n&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",a),children:e})}function en({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,C.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function ea({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(en,{bot:e,bubble:n}),(0,t.jsx)(et,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function es(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function er({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(et,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(et,{className:(0,C.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function ei({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,C.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function eo({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:el(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let el=e=>e.split(" (")[0].replace(/\.$/,"");function ed(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||el(a.lines[0].text)===el(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=(0,_.rosterOf)(e),c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&q(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>`${e.bot}
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,496336,e=>{"use strict";var t=e.i(843476),n=e.i(716327),a=e.i(271645),s=e.i(647163);e.s(["FoldedText",0,function({text:e,subject:r,clamp:i="line-clamp-3",tall:o="max-h-40",className:l}){let[d,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),x=(0,a.useRef)(null);return(0,a.useEffect)(()=>c(!1),[e]),(0,a.useEffect)(()=>{let e=x.current;e&&!d&&m(e.scrollHeight>e.clientHeight+1)},[d,e]),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-start gap-1",l),children:[(0,t.jsx)("p",{ref:x,className:(0,s.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",d?(0,s.cn)(o,"overflow-y-auto scrollbar-none"):i),children:e}),(u||d)&&(0,t.jsx)("button",{type:"button",onClick:()=>c(e=>!e),"aria-label":d?`Fold the ${r}`:`Read the whole ${r}`,className:"shrink-0 rounded-md p-0.5 opacity-60 outline-none transition-opacity hover:opacity-100 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(n.ChevronDown,{className:(0,s.cn)("size-3.5",d&&"rotate-180")})})]})}])},835878,e=>{"use strict";var t=e.i(843476),n=e.i(635963);e.s(["BotRoster",0,function({bots:e}){return e.length<2?null:(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:e.map(e=>e.name).join(", "),children:[(0,t.jsx)("span",{className:"flex items-center gap-0.5",children:e.slice(0,3).map(e=>(0,t.jsx)(n.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"},e.name))}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[e.length," bots"]})]})}])},351866,e=>{"use strict";var t=e.i(843476),n=e.i(401851),a=e.i(689664),s=e.i(716327),r=e.i(24071),i=e.i(51481),o=e.i(508734),l=e.i(919191),d=e.i(632781),c=e.i(825398),u=e.i(263676),m=e.i(271645),x=e.i(815731),p=e.i(496336),b=e.i(683408),f=e.i(660302),h=e.i(127341),g=e.i(6799),k=e.i(95187);let j=(0,k.createServerReference)("7f1bea5380a307b807a64d5494b95f438f73b84926",k.callServer,void 0,k.findSourceMapURL,"compactThreadAction");var v=e.i(807038),w=e.i(635963),y=e.i(256604),N=e.i(621285),S=e.i(245629),z=e.i(609856),C=e.i(647163),T=e.i(553429),_=e.i(978411),M=e.i(222055);function B({onClick:e}){return(0,t.jsx)("button",{type:"button",onClick:e,"aria-label":"Fold the room away",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-muted-foreground/20 focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})}function $({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{thread:e}),(0,t.jsx)(R,{thread:e}),(0,t.jsx)(I,{thread:e})]})}function A({thread:e}){let{contextTokens:n,tokens:a}=e;return n?(0,t.jsx)("span",{title:`Last step ${(0,C.formatCount)(n)} tokens \xb7 in total in ${(0,C.formatCount)(a.input)} \xb7 out ${(0,C.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,C.formatCount)(n)}):null}function R({thread:e}){let{contextTokens:n,contextBudget:a}=e,[s,r]=(0,m.useState)(!1),[i,o]=(0,z.useServerAction)(j,{onOk:()=>r(!0)});if((0,m.useEffect)(()=>r(!1),[n]),!n||!a)return null;let l=Math.min(1,n/a);return(0,t.jsx)("button",{type:"button",disabled:o||s,onClick:()=>void i(e.id,e.bot.name).catch(()=>{}),title:s?"It summarizes itself at its next step":`Context ${(0,C.formatCount)(n)} of ${(0,C.formatCount)(a)} — it summarizes itself at the end of the bar. Press to have it do so at its next step`,"aria-label":"Summarize this thread's context at its next step",className:"-my-2 flex h-6 shrink-0 items-center rounded-sm outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:(0,t.jsx)("span",{className:"block h-[3px] w-9 overflow-hidden rounded-full bg-muted",children:(0,t.jsx)("span",{className:(0,C.cn)("block h-full rounded-full",s?"animate-pulse bg-muted-foreground/40":l>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*l))}%`}})})})}let D={working:"text-muted-foreground",waiting:C.WAITING_INK,done:"text-foreground",cancelled:"text-muted-foreground"};function I({thread:e}){let n="done"===e.status&&e.seen?"text-muted-foreground":D[e.status];return"working"===e.status?(0,t.jsx)(f.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,t.jsx)("span",{className:(0,C.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",n),children:e.status})}function F({thread:e,roster:n,side:a,onPick:s,className:r}){return(0,t.jsx)(h.Tabs,{value:a??e.bot.name,onValueChange:t=>s(t===e.bot.name?null:String(t)),className:(0,C.cn)("shrink-0 gap-0 px-3 pt-1 pb-0.5",r),children:(0,t.jsx)(h.TabsList,{className:"w-full justify-start gap-1 overflow-x-auto rounded-none bg-transparent p-0 scrollbar-none group-data-horizontal/tabs:h-auto",children:n.map(n=>{let a=q(e,n.name);return(0,t.jsxs)(h.TabsTrigger,{value:n.name,className:(0,C.cn)(L,"pl-1.5"),children:[(0,t.jsx)(w.BotMark,{size:16,seed:n.name,color:n.icon?.color,shape:n.icon?.shape,outline:n.icon?.outline,paint:n.icon?.paint,notify:"asking"===a,className:"shrink-0"}),(0,t.jsx)("span",{className:"max-w-28 truncate",children:n.name}),"running"===a&&(0,t.jsx)(d.Loader2,{className:"size-3 animate-spin text-muted-foreground/70"})]},n.name)})})})}let L="h-7 flex-none rounded-full px-3 py-0 text-[12px] text-muted-foreground hover:bg-muted/60 data-active:bg-muted data-active:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:border-transparent dark:data-active:bg-muted";function q(e,t){let{room:n}=e;return n.questions.some(e=>e.bot===t)?"asking":"working"===e.status&&n.participants.some(e=>e.bot===t&&"running"===e.state)?"running":null}function E({turn:e,thread:n,self:a}){let s=e.speaker.name===a,r=s?"none":e.speaker.name===Q.name?"dark":"secondary",i=null;return(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,t.jsx)(Z,{side:s?"start":"end",name:e.speaker.name,mark:(0,t.jsx)(Y,{bot:e.speaker}),children:e.entries.map(o=>{if("work"===o.kind)return s?(0,t.jsx)(K,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key):(0,t.jsx)(O,{lines:o.lines,trailing:o.open,bot:e.speaker,thread:n},o.key);let l=(0,_.heardBy)(o.line),d=l&&l.name!==e.speaker.name&&l.name!==a&&l.name!==Q.name&&l.name!==i?l:null;return l&&(i=l.name),(0,t.jsx)(ee,{line:o.line,surface:r,mention:d},o.key)})})})}function O({lines:e,trailing:n,bot:a,thread:s}){var r;let[i,o]=(0,m.useState)(!1),[l,c]=(0,m.useState)(null),u=n?q(s,a.name):null,x=(r=e,[["tool","step"],["say","note"],["stop","stop"],["note","compaction"]].map(([e,t])=>[r.filter(t=>t.kind===e).length,t]).filter(([e])=>e>0).map(([e,t])=>`${e} ${t}${1===e?"":"s"}`).join(" · ")),p=e.filter(e=>e.tool?.results!==void 0);if(!u&&!x)return null;let b=e.findLast(e=>"tool"===e.kind||"say"===e.kind),h=i&&e.length>0;return(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 p-1",h?"w-full":"w-fit max-w-full"),children:[(0,t.jsxs)("button",{type:"button",disabled:!e.length,"aria-expanded":h,onClick:()=>{o(e=>!e),c(null)},className:"flex min-w-0 items-center gap-2 rounded-xl px-2.5 py-1.5 text-left outline-none transition-colors enabled:hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:["running"===u&&(0,t.jsx)(d.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/60"}),u?(0,t.jsx)(f.ShinyText,{text:"asking"===u?"waiting on you":b?G(b):"working",tone:"asking"===u?"waiting":"muted",speed:2.4,className:"min-w-0 truncate text-[12px] leading-4"}):(0,t.jsx)(U,{words:b?G(b):"",facts:[x,function(e){let t=e.flatMap(e=>e.at?[(0,S.toDate)(e.at).getTime()]:[]);if(t.length<2)return"";let n=Math.round((Math.max(...t)-Math.min(...t))/1e3);if(n<1)return"";if(n<60)return`${n}s`;let a=Math.round(n/60);return a<60?`${a} min`:`${Math.floor(a/60)}h ${a%60}m`}(e)].filter(Boolean).join(" · ")}),e.length>0&&(0,t.jsx)(H,{open:h})]}),!h&&p.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1 px-2 pt-0.5 pb-1.5",children:p.map(e=>e.tool&&(0,t.jsx)(M.StepTile,{tool:e.tool,onOpen:()=>{c(e.id),o(!0)}},e.id))}),h&&(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-0.5 pt-0.5",children:ed(e).map(e=>"tools"===e.kind?e.lines.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:s.id,collapsed:e.id!==l},e.id)):"stops"===e.kind?(0,t.jsx)("div",{className:"px-1.5 py-1",children:(0,t.jsx)(eo,{lines:e.lines})},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e,inset:!0},e.id)))})]})}function K({lines:e,trailing:n,bot:a,thread:s}){let r=n?q(s,a.name):null,i=e.some(e=>e.tool&&void 0===e.tool.results);return(0,t.jsxs)(t.Fragment,{children:[ed(e).map(e=>"tools"===e.kind?(0,t.jsx)(P,{lines:e.lines,threadId:s.id},e.key):"stops"===e.kind?(0,t.jsx)(eo,{lines:e.lines},e.key):e.lines.map(e=>(0,t.jsx)(er,{line:e},e.id))),r&&!i&&(0,t.jsx)(f.ShinyText,{text:"asking"===r?"waiting on you":"on the next step…",tone:"asking"===r?"waiting":"muted",speed:2.2,className:"block px-1 font-mono text-[10px]"})]})}function P({lines:e,threadId:n}){return(0,t.jsx)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:e.map(e=>e.tool&&(0,t.jsx)(M.BotTool,{tool:e.tool,threadId:n,collapsed:!0},e.id))})}function U({words:e,facts:n,grow:a=!1}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:(0,C.cn)("min-w-0 truncate text-[12.5px] leading-5 text-foreground/80",a&&"flex-1"),children:e}),(0,t.jsx)("span",{className:"shrink-0 font-mono text-[10.5px] leading-4 text-muted-foreground",children:n})]})}function H({open:e}){return(0,t.jsx)("span",{className:"grid size-5.5 shrink-0 place-items-center rounded-md bg-background text-muted-foreground ring-1 ring-border/60",children:(0,t.jsx)(s.ChevronDown,{className:(0,C.cn)("size-3.5 transition-transform",e&&"rotate-180")})})}function G(e){return"tool"===e.kind&&e.tool?e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`:(0,C.plainText)(e.text).replace(/\s+/g," ").trim()}function V({thread:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{from:Q,to:e.bot}),(0,t.jsx)(Z,{side:"end",name:Q.name,mark:(0,t.jsx)(Y,{bot:Q}),children:(0,t.jsx)(J,{dark:!0,className:"py-2 pr-2 pl-3.5",children:(0,t.jsx)(p.FoldedText,{text:e.request,subject:"request",className:"wrap-anywhere"})})})]})}let Q={name:T.ROOM_THURSDAY};function W({from:e,to:n}){return(0,t.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,t.jsxs)("span",{className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted px-2.5 py-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(X,{bot:e}),(0,t.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,t.jsx)(X,{bot:n})]})})}function X({bot:e}){return(0,t.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:15,className:"shrink-0"}):(0,t.jsx)(w.BotMark,{size:15,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function Y({bot:e}){return e.name===Q.name?(0,t.jsx)(y.ThursdayMark,{size:26,className:"mt-1 shrink-0"}):(0,t.jsx)(w.BotMark,{size:26,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"mt-1 shrink-0"})}function J({dark:e=!1,children:n,className:a}){return(0,t.jsx)(x.Bubble,{align:"end",variant:e?"default":"secondary",className:"max-w-full",children:(0,t.jsx)(x.BubbleContent,{className:(0,C.cn)("rounded-tr-md px-3.5",a),children:(0,t.jsx)("div",{className:(0,C.cn)("min-w-0",e&&"inverse"),children:n})})})}function Z({side:e,mark:n,name:a,children:s}){return(0,t.jsxs)("div",{className:(0,C.cn)("flex gap-2.5","end"===e&&"flex-row-reverse"),children:[n,(0,t.jsxs)("div",{className:(0,C.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===e&&"items-end"),children:[(0,t.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:a}),s]})]})}function ee({line:e,surface:n,mention:a}){let s=!!e.question,r="result"===e.kind,i="none"!==n,o=(0,v.shortenPaths)(e.text),d=(0,t.jsxs)(t.Fragment,{children:[s&&(0,t.jsx)(es,{}),a?(0,t.jsx)(ea,{bot:a,bubble:i,children:o}):(0,t.jsx)(et,{bubble:i,className:(0,C.cn)(!r&&"leading-snug"),children:o}),(0,t.jsx)(v.Attachments,{text:e.text,onBubble:i,className:"mt-2"})]});return(0,t.jsxs)(t.Fragment,{children:[i?(0,t.jsx)(J,{dark:"dark"===n,children:d}):(0,t.jsx)("div",{className:"min-w-0 max-w-full px-1",children:d}),e.steppedIn&&(0,t.jsxs)("p",{className:"flex items-center gap-1 px-1 font-mono text-[10px] text-muted-foreground",children:[(0,t.jsx)(l.CornerDownLeft,{className:"size-2.5"}),"stepped in"]}),r&&(0,t.jsx)("div",{className:"flex px-1",children:(0,t.jsx)(ei,{text:e.text})})]})}function et({children:e,bubble:n=!1,className:a}){return(0,t.jsx)(b.Markdown,{className:(0,C.cn)("min-w-0 max-w-full text-[13px] leading-relaxed wrap-anywhere break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&_table]:wrap-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",n&&"[&_[data-streamdown=inline-code]]:text-[12px] [&_[data-streamdown=code-block]]:my-2 [&_[data-streamdown=code-block]]:gap-0 [&_[data-streamdown=code-block]]:rounded-[10px] [&_[data-streamdown=code-block]]:border-0 [&_[data-streamdown=code-block]]:bg-background [&_[data-streamdown=code-block]]:p-0 [&_[data-streamdown=code-block-header]]:h-7 [&_[data-streamdown=code-block-header]]:px-2.5 [&_[data-streamdown=code-block-header]]:text-[11px] [&_[data-streamdown=code-block-body]]:border-0 [&_[data-streamdown=code-block-body]]:bg-transparent! [&_[data-streamdown=code-block-body]]:px-2.5 [&_[data-streamdown=code-block-body]]:pt-0 [&_[data-streamdown=code-block-body]]:pb-2.5 [&_[data-streamdown=code-block-body]]:text-[12.5px] [&_[data-streamdown=code-block]_div:has(>[data-streamdown=code-block-actions])]:-mt-7 [&_[data-streamdown=code-block-actions]]:mr-1 [&_[data-streamdown=code-block-actions]]:border-0 [&_[data-streamdown=code-block-actions]]:bg-transparent!",a),children:e})}function en({bot:e,bubble:n}){return(0,t.jsxs)("span",{className:(0,C.cn)("mr-1.5 inline-flex h-5 max-w-full items-center gap-1 rounded-full pr-2 pl-[3px] align-[-4px] text-[12px] leading-none font-medium whitespace-nowrap text-foreground",n?"bg-background":"bg-muted"),children:[(0,t.jsx)(w.BotMark,{size:14,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]})}function ea({bot:e,bubble:n,children:a}){return(0,t.jsxs)("div",{className:"min-w-0 max-w-full text-[13px] leading-snug",children:[(0,t.jsx)(en,{bot:e,bubble:n}),(0,t.jsx)(et,{bubble:n,className:"contents leading-snug [&>p:first-child]:inline",children:a})]})}function es(){return(0,t.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-[12px] leading-4 font-medium text-muted-foreground",children:[(0,t.jsx)(i.CircleQuestionMark,{className:"size-3.5 shrink-0"}),"Question"]})}function er({line:e,inset:n=!1}){return"note"===e.kind?(0,t.jsxs)("details",{className:"w-full px-2 py-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,t.jsx)("span",{className:"min-w-0 text-center font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,t.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,t.jsx)(et,{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px]",children:e.text})]}):(0,t.jsx)(et,{className:(0,C.cn)("text-[12.5px] text-muted-foreground",n?"px-2.5 py-1":"px-1"),children:e.text})}function ei({text:e}){let[n,s]=(0,m.useState)(!1),r=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,t.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(e),s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),1400)}catch(e){g.toast.add({type:"error",title:"Could not copy the answer",description:(0,C.errorToString)(e)})}},className:"grid size-5 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:n?(0,t.jsx)(a.Check,{className:"size-3"}):(0,t.jsx)(o.Copy,{className:"size-3"})})}function eo({lines:e}){return(0,t.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,t.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-[12.5px] leading-relaxed outline-none [&::-webkit-details-marker]:hidden",children:[(0,t.jsx)(c.RotateCw,{className:"size-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:el(e[0].text)}),e.length>1&&(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",e.length]}),(0,t.jsx)(s.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,t.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:e.map(e=>(0,t.jsxs)("p",{className:"flex gap-2 break-keep",children:[e.at&&(0,t.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,n.format)((0,S.toDate)(e.at),"HH:mm:ss")}),(0,t.jsx)("span",{className:"min-w-0",children:e.text})]},e.id))})]})}let el=e=>e.split(" (")[0].replace(/\.$/,"");function ed(e){let t=[];for(let n of e){let e="tool"===n.kind&&n.tool?"tools":"stop"===n.kind?"stops":"said",a=t.at(-1),s=a?.kind===e&&("stops"!==e||el(a.lines[0].text)===el(n.text));a&&s?a.lines.push(n):t.push({kind:e,key:n.id,lines:[n]})}return t}e.s(["Conversation",0,function({thread:e,tab:n=null,onTab:a,className:s,tabsClassName:r}){let i,o=(0,m.useRef)(null),l=(0,m.useRef)(!0),d=(0,_.rosterOf)(e),c=a&&n!==e.bot.name&&d.some(e=>e.name===n)?n:null,u=c??e.bot.name,x=d.filter(t=>(!c||t.name===c)&&q(e,t.name)),p=(0,_.threadItems)((i=new Set(e.room.questions.map(e=>`${e.bot}
2
2
  ${e.text.trim()}`))).size?{...e,lines:e.lines.filter(e=>!("ask"===e.kind&&e.question&&e.to?.name===Q.name&&i.has(`${e.bot.name}
3
- ${e.text.trim()}`)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,C.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",s),children:[!c&&(0,t.jsx)(V,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(W,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,B,"TAB",0,L,"THURSDAY",0,Q,"ThreadFacts",0,$,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[e.label,(0,t.jsx)("span",{title:e.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:e.id.slice(0,8)})]}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(B,{onClick:a})]})},"leadOf",0,el,"stepOf",0,G],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),h=e.i(496336),f=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(904703),v=e.i(729332),w=e.i(95187);let y=(0,w.createServerReference)("7f602f8df658c6da8793cc42bb16430f601e506677",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),C=e.i(609856),T=e.i(283653),_=e.i(984837);function M({bot:e,onAllowed:n}){let{data:a}=(0,T.useServerRoute)(x.queryKey.signIns),[s,r]=(0,C.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,T.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var B=e.i(6799),$=e.i(41533),A=e.i(83928);let R=(0,w.createServerReference)("7f3a23a9c29546de657b8c739534fd79f8e75f6d47",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,C.useServerAction)(R),r=(0,m.useCallback)(async e=>{let r=$.GIVEN_FILES.perMessage-n.length;e.length>r&&B.toast.add({type:"error",title:`At most ${$.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function F({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[e.path?(0,t.jsx)(A.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[E(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let L=null,q={claim:e=>(L=e,()=>{L===e&&(L=null)}),offer:(e,t)=>!!L&&!!e?.closest?.("[data-room]")&&(L(t),!0)},E=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function O({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function K({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(G,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:h,className:f}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:C}=N;(0,m.useEffect)(()=>q.claim(e=>void C(e)),[C]);let T=!!g.trim()&&!i&&!N.arriving,_=async()=>{T&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",f),children:[N.files.length>0&&(0,t.jsx)(F,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),C(t))},onKeyDown:e=>{"Escape"===e.key&&x?x():"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.keyCode||(e.preventDefault(),_())},placeholder:o,"aria-label":c,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{C([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),h,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:T?"default":"ghost",disabled:!T,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function H({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,t.jsx)(G,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(G,{bot:e,size:16}),e.name]},e.name))})})]})}function G({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function V(){let[e,t]=(0,C.useServerAction)(j.answerThreadAction,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["GivenFiles",0,F,"roomDrop",0,q,"useGivenFiles",0,I],709190),e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[B,$]=(0,m.useState)(null);(0,m.useEffect)(()=>{w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)},[e.id,e.bot]),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let A=e.room.participants,R=e.room.questions,I=Math.max(0,R.findIndex(e=>e.id===b)),F=R[I],L="waiting"===n?e.ask:null,q=(0,N.isAppStop)(L),E=F?.bot??(A.some(e=>e.bot===j)?j:e.bot),G=F?.id,[Q,W]=V(),[X,Y]=(0,C.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,T.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),J=W||Y,Z=e.room.deliveries.filter(e=>!e.delivered),[ee,et]=(0,C.useServerAction)(y,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)}),en=Z.map(e=>`${e.bot}: ${e.text}`).join(" · "),ea=A.filter(e=>"running"===e.state).map(e=>e.bot).join(", ")||e.bot,es=e=>a.find(t=>t.name===e)??{name:e},er=async t=>{if(J)return!1;let a=await Q(e,t,E,G);return a&&"running"===n&&_(!1),a},ei=async e=>{$(e),await er(e),$(null)},eo="running"===n||"waiting"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>X(e.id),"aria-label":"Stop this thread",title:"Stop this thread",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:Y?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(c.Square,{className:"size-3"})}):null;if(F){let n=F.options??[],a=F.text;return(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(E),word:"Question",children:R.length>1&&(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:J||0===I,onClick:()=>k(R[I-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[I+1," / ",R.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:J||I===R.length-1,onClick:()=>k(R[I+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(f.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:B,busy:J,onChoose:ei}),(0,t.jsx)(M,{bot:E,onAllowed:er}),(0,t.jsx)(U,{threadId:e.id,recipient:E,draftKey:F.id,send:er,busy:J,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${E}`,trailing:eo},JSON.stringify([e.id,E,F.id]))]})}return q?(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(e.bot),word:"Paused"}),L?.question&&(0,t.jsx)(h.FoldedText,{text:L.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:L?.options.length?L.options:[N.THREAD_CONTINUE],picked:B,busy:J,onChoose:ei}),(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,placeholder:"Or put it another way…",label:`Message for ${E}`,trailing:eo},JSON.stringify([e.id,E,"paused"]))]}):"running"!==n||S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,autoFocus:"running"===n,onEscape:"running"===n?()=>_(!1):void 0,placeholder:"running"===n?`What's off? ${E} reads this before its next step`:"Anything more? It picks up where it left off",label:`Message for ${E}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:A.length>1?(0,t.jsx)(H,{current:es(E),bots:A.map(e=>es(e.bot)),disabled:J,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:"running"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,E])),!!en&&"running"!==n&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",en]})]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[Z.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:et,onClick:()=>ee(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ea} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:J,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),eo]})]})},"useAnswerThread",0,V],399512)},904703,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f739178d6588f6d545722472bf51e3c2df3138fb8",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},729332,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f79944ad9ee07a58b4b5d000d35c8c560c7a10a19",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,o.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);
3
+ ${e.text.trim()}`)))}:e,u,x);return(0,m.useEffect)(()=>{l.current=!0},[e.id,c]),(0,m.useEffect)(()=>{let e=o.current;e&&l.current&&(e.scrollTop=e.scrollHeight)},[e.lines,e.status,c]),(0,t.jsxs)(N.FileViewer,{children:[a&&(0,t.jsx)(F,{thread:e,roster:d,side:c,onPick:a,className:r}),(0,t.jsxs)("div",{ref:o,onScroll:e=>{let t=e.currentTarget;l.current=t.scrollHeight-t.scrollTop-t.clientHeight<24},className:(0,C.cn)("min-w-0 max-h-[64vh] space-y-3 overflow-y-auto px-4 pt-6 pb-4 mask-[linear-gradient(to_bottom,transparent,black_2rem)] scrollbar-none",s),children:[!c&&(0,t.jsx)(V,{thread:e}),p.map(n=>"invite"===n.kind?(0,t.jsx)(W,{from:n.from,to:n.to},n.key):(0,t.jsx)(E,{turn:n,thread:e,self:u},n.key))]})]})},"FoldButton",0,B,"TAB",0,L,"THURSDAY",0,Q,"ThreadFacts",0,$,"ThreadHeader",0,function({thread:e,onBack:n,onClose:a}){return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(r.ChevronLeft,{className:"size-4"})}),(0,t.jsx)(w.BotMark,{size:22,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,notify:!1}),(0,t.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[e.label,(0,t.jsx)("span",{title:e.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:e.id.slice(0,8)})]}),(0,t.jsx)($,{thread:e}),(0,t.jsx)(B,{onClick:a})]})},"leadOf",0,el,"stepOf",0,G],351866)},399512,709190,e=>{"use strict";var t=e.i(843476),n=e.i(96892),a=e.i(716327),s=e.i(24071),r=e.i(867927),i=e.i(931619),o=e.i(919191),l=e.i(632781),d=e.i(64801),c=e.i(929272),u=e.i(263676),m=e.i(271645),x=e.i(798120),p=e.i(167881),b=e.i(463415),f=e.i(496336),h=e.i(683408),g=e.i(660302),k=e.i(184762),j=e.i(257705),v=e.i(941051),w=e.i(95187);let y=(0,w.createServerReference)("7fafffef7f5ddff042f88ebc845340a5c6cac7bbba",w.callServer,void 0,w.findSourceMapURL,"withdrawStepInAction");var N=e.i(451888),S=e.i(635963),z=e.i(978411),C=e.i(609856),T=e.i(283653),_=e.i(446558);function M({bot:e,onAllowed:n}){let{data:a}=(0,T.useServerRoute)(x.queryKey.signIns),[s,r]=(0,C.useServerAction)(_.setSignInBotAction,{onOk:()=>(0,T.revalidate)(x.queryKey.signIns)}),i=(a??[]).filter(t=>t.asking.includes(e));return i.length?(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.map(a=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",loading:r,onClick:()=>void s(a.site,e,!0).then(()=>n(`Yes — you may use my ${a.site} sign-in.`)).catch(()=>{}),children:["Let ",e," use ",a.site," (",a.account,")"]},a.site))}):null}var B=e.i(6799),$=e.i(41533),A=e.i(83928);let R=(0,w.createServerReference)("7fe2d70a70024f0fa498ebfe3c0e167bd1c00b608e",w.callServer,void 0,w.findSourceMapURL,"giveFilesAction");var D=e.i(647163);function I(e){let t=(0,m.useRef)(e?.onKept);t.current=e?.onKept;let[n,a]=(0,m.useState)([]),[s]=(0,C.useServerAction)(R),r=(0,m.useCallback)(async e=>{let r=$.GIVEN_FILES.perMessage-n.length;e.length>r&&B.toast.add({type:"error",title:`At most ${$.GIVEN_FILES.perMessage} files at a time.`});let i=e.slice(0,Math.max(0,r));if(!i.length)return;let o=i.map(e=>({key:crypto.randomUUID(),name:e.name,bytes:e.size,path:null}));a(e=>[...e,...o]);let l=new FormData;for(let e of i)l.append("file",e);try{let e=await s(l),n=t.current?.(e);a(t=>t.map(t=>{let a=o.findIndex(e=>e.key===t.key);return a<0?t:{...t,path:e[a]??null,note:n}}))}catch{a(e=>e.filter(e=>!o.some(t=>t.key===e.key)))}},[n.length,s]);return{files:n,take:r,remove:e=>a(t=>t.filter(t=>t.key!==e)),clear:()=>a([]),arriving:n.some(e=>null===e.path),withPaths:e=>[e.trim(),...n.flatMap(e=>e.path??[])].filter(Boolean).join("\n")}}function F({files:e,onRemove:n,dense:a=!1,children:s,className:r}){let i=a?"size-8 rounded-lg":"size-10 rounded-[9px]";return(0,t.jsxs)("div",{className:(0,D.cn)("flex flex-wrap gap-1.5",r),children:[e.map(e=>(0,t.jsxs)("span",{className:(0,D.cn)("flex max-w-64 items-center bg-muted/70",a?"h-10.5 gap-2 rounded-xl py-1 pr-1.5 pl-1":"h-13 gap-2.5 rounded-[14px] py-1.5 pr-2 pl-1.5"),children:[e.path?(0,t.jsx)(A.FileThumb,{path:e.path,bytes:e.bytes,className:(0,D.cn)("shrink-0 overflow-hidden ring-1 ring-foreground/6",i)}):(0,t.jsx)("span",{className:(0,D.cn)("grid shrink-0 place-items-center bg-background text-muted-foreground ring-1 ring-foreground/6",i),children:(0,t.jsx)(l.Loader2,{className:"size-3.5 animate-spin"})}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,t.jsx)("span",{className:(0,D.cn)("truncate",a?"text-xs leading-4":"text-[12.5px] leading-4.5"),children:e.name}),(0,t.jsxs)("span",{className:"font-mono text-[10px] leading-3.5 text-muted-foreground",children:[E(e.bytes),e.note&&` \xb7 ${e.note}`]})]}),(0,t.jsx)("button",{type:"button","aria-label":`Take ${e.name} out`,onClick:()=>n(e.key),className:"grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,t.jsx)(u.X,{className:"size-3.5"})})]},e.key)),s]})}let L=null,q={claim:e=>(L=e,()=>{L===e&&(L=null)}),offer:(e,t)=>!!L&&!!e?.closest?.("[data-room]")&&(L(t),!0)},E=e=>e<1048576?`${Math.max(1,Math.round(e/1024))} KB`:`${(e/1024/1024).toFixed(1)} MB`;function O({className:e,children:n}){return(0,t.jsx)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-2.5 rounded-[18px] bg-muted py-2 pr-2 pl-3.5",e),children:n})}function K({bot:e,word:n,children:a}){return(0,t.jsxs)("div",{className:"flex min-h-7 min-w-0 items-center gap-1.5",children:[(0,t.jsx)("span",{title:e.name,className:"shrink-0 leading-none",children:(0,t.jsx)(G,{bot:e,size:16})}),(0,t.jsx)("span",{className:(0,D.cn)("truncate text-[12px] leading-4 font-medium",D.WAITING_INK),children:n}),a]})}function P({options:e,picked:n,busy:a,onChoose:s}){return(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.map(e=>(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",loading:n===e,disabled:a,onClick:()=>s(e),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12.5px] hover:bg-background/60 dark:hover:bg-background/60",children:[e===N.THREAD_CONTINUE&&n!==e&&(0,t.jsx)(i.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),e]},e))})}function U({threadId:e,recipient:a,draftKey:s,send:r,busy:i,placeholder:o,label:c,autoFocus:u=!1,onEscape:x,leading:b,trailing:f,className:h}){let[g,j]=(0,m.useState)(()=>z.threadDrafts.get(e,a,s)),[v,w]=(0,m.useState)(!1),y=t=>{j(t),z.threadDrafts.set(e,a,t,s)},N=I(),S=(0,m.useRef)(null),{take:C}=N;(0,m.useEffect)(()=>q.claim(e=>void C(e)),[C]);let T=!!g.trim()&&!i&&!N.arriving,_=async()=>{T&&(w(!0),await r(N.withPaths(g))&&(y(""),N.clear()),w(!1))};return(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),_()},className:(0,D.cn)("flex min-w-0 flex-wrap items-end gap-1",h),children:[N.files.length>0&&(0,t.jsx)(F,{dense:!0,files:N.files,onRemove:N.remove,className:"w-full pb-1"}),b,(0,t.jsx)(k.Textarea,{value:g,rows:1,disabled:i,autoFocus:u,onChange:e=>y(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),C(t))},onKeyDown:e=>{"Escape"===e.key&&x?x():"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||229===e.keyCode||(e.preventDefault(),_())},placeholder:o,"aria-label":c,className:"max-h-32 min-h-0 min-w-0 flex-1 resize-none border-0 bg-transparent px-0 py-1 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,t.jsx)("input",{ref:S,type:"file",multiple:!0,hidden:!0,onChange:e=>{C([...e.target.files??[]]),e.target.value=""}}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:i,"aria-label":"Add files",onClick:()=>S.current?.click(),className:"rounded-full text-muted-foreground",children:(0,t.jsx)(d.Paperclip,{})}),f,(0,t.jsx)(p.Button,{type:"submit",size:"icon-sm",variant:T?"default":"ghost",disabled:!T,"aria-label":"Send",className:"rounded-full",children:v?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(n.ArrowUp,{})})]})}function H({current:e,bots:n,disabled:s,onPick:r}){return(0,t.jsxs)(b.DropdownMenu,{children:[(0,t.jsxs)(b.DropdownMenuTrigger,{render:(0,t.jsx)("button",{type:"button",disabled:s,"aria-label":`Message ${e.name}; choose another bot`,className:"mt-1 inline-flex h-5 shrink-0 items-center gap-1 self-start rounded-full bg-muted pr-1.5 pl-[3px] text-[12px] leading-none font-medium outline-none transition-colors hover:bg-muted-foreground/15 focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50"}),children:[(0,t.jsx)(G,{bot:e,size:14}),(0,t.jsx)("span",{className:"max-w-32 truncate",children:e.name}),(0,t.jsx)(a.ChevronDown,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,t.jsx)(b.DropdownMenuContent,{align:"start",children:(0,t.jsx)(b.DropdownMenuGroup,{children:n.map(e=>(0,t.jsxs)(b.DropdownMenuItem,{onClick:()=>r(e.name),children:[(0,t.jsx)(G,{bot:e,size:16}),e.name]},e.name))})})]})}function G({bot:e,size:n}){return(0,t.jsx)(S.BotMark,{size:n,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function V(){let[e,t]=(0,C.useServerAction)(j.answerThreadAction,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)});return[async(t,n,a,s)=>{let r=n.trim();if(!r)return!1;try{let n=await e(t.id,r,a,s);return z.screenActs.announce({kind:"answered",id:n.id,label:n.label,answer:r,recipient:a,replyTo:s}),!0}catch{return!1}},t]}e.s(["GivenFiles",0,F,"roomDrop",0,q,"useGivenFiles",0,I],709190),e.s(["ThreadReply",0,function({thread:e,status:n,faces:a=[],to:i=null,className:d}){let[b,k]=(0,m.useState)(),[j,w]=(0,m.useState)(()=>z.threadDrafts.recipient(e.id)??e.bot),[S,_]=(0,m.useState)(!1),[B,$]=(0,m.useState)(null);(0,m.useEffect)(()=>{w(z.threadDrafts.recipient(e.id)??e.bot),k(void 0),_(!1)},[e.id,e.bot]),(0,m.useEffect)(()=>{i&&(z.threadDrafts.select(e.id,i),w(i))},[e.id,i]);let A=e.room.participants,R=e.room.questions,I=Math.max(0,R.findIndex(e=>e.id===b)),F=R[I],L="waiting"===n?e.ask:null,q=(0,N.isAppStop)(L),E=F?.bot??(A.some(e=>e.bot===j)?j:e.bot),G=F?.id,[Q,W]=V(),[X,Y]=(0,C.useServerAction)(v.cancelThreadAction,{onOk:e=>{(0,T.revalidate)(x.queryKey.threads),z.screenActs.announce({kind:"stopped",id:e.id,label:e.label})}}),J=W||Y,Z=e.room.deliveries.filter(e=>!e.delivered),[ee,et]=(0,C.useServerAction)(y,{onOk:()=>(0,T.revalidate)(x.queryKey.threads)}),en=Z.map(e=>`${e.bot}: ${e.text}`).join(" · "),ea=A.filter(e=>"running"===e.state).map(e=>e.bot).join(", ")||e.bot,es=e=>a.find(t=>t.name===e)??{name:e},er=async t=>{if(J)return!1;let a=await Q(e,t,E,G);return a&&"running"===n&&_(!1),a},ei=async e=>{$(e),await er(e),$(null)},eo="running"===n||"waiting"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>X(e.id),"aria-label":"Stop this thread",title:"Stop this thread",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:Y?(0,t.jsx)(l.Loader2,{className:"animate-spin"}):(0,t.jsx)(c.Square,{className:"size-3"})}):null;if(F){let n=F.options??[],a=F.text;return(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(E),word:"Question",children:R.length>1&&(0,t.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Previous question",disabled:J||0===I,onClick:()=>k(R[I-1].id),children:(0,t.jsx)(s.ChevronLeft,{})}),(0,t.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums","aria-live":"polite",children:[I+1," / ",R.length]}),(0,t.jsx)(p.Button,{type:"button",variant:"ghost",size:"icon-sm","aria-label":"Next question",disabled:J||I===R.length-1,onClick:()=>k(R[I+1].id),children:(0,t.jsx)(r.ChevronRight,{})})]})}),a&&(0,t.jsx)("div",{className:"max-h-[min(14rem,30vh)] min-w-0 overflow-y-auto overscroll-contain pr-1.5",children:(0,t.jsx)(h.Markdown,{className:"min-w-0 text-[13px] leading-snug wrap-anywhere break-keep [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",children:a})}),n.length>0&&(0,t.jsx)(P,{options:n,picked:B,busy:J,onChoose:ei}),(0,t.jsx)(M,{bot:E,onAllowed:er}),(0,t.jsx)(U,{threadId:e.id,recipient:E,draftKey:F.id,send:er,busy:J,placeholder:n.length?"Or write your own answer…":"Your answer…",label:`Answer for ${E}`,trailing:eo},JSON.stringify([e.id,E,F.id]))]})}return q?(0,t.jsxs)(O,{className:d,children:[(0,t.jsx)(K,{bot:es(e.bot),word:"Paused"}),L?.question&&(0,t.jsx)(f.FoldedText,{text:L.question,subject:"message",clamp:"line-clamp-3",tall:"max-h-40"}),(0,t.jsx)(P,{options:L?.options.length?L.options:[N.THREAD_CONTINUE],picked:B,busy:J,onChoose:ei}),(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,placeholder:"Or put it another way…",label:`Message for ${E}`,trailing:eo},JSON.stringify([e.id,E,"paused"]))]}):"running"!==n||S?(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col gap-1.5",d),children:[(0,t.jsx)(U,{threadId:e.id,recipient:E,send:er,busy:J,autoFocus:"running"===n,onEscape:"running"===n?()=>_(!1):void 0,placeholder:"running"===n?`What's off? ${E} reads this before its next step`:"Anything more? It picks up where it left off",label:`Message for ${E}`,className:"rounded-2xl bg-background py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",leading:A.length>1?(0,t.jsx)(H,{current:es(E),bots:A.map(e=>es(e.bot)),disabled:J,onPick:t=>{z.threadDrafts.select(e.id,t),w(t)}}):null,trailing:"running"===n?(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:J,onClick:()=>_(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,t.jsx)(u.X,{})}):null},JSON.stringify([e.id,E])),!!en&&"running"!==n&&(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-2 px-1 text-xs text-muted-foreground",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,t.jsxs)("span",{className:"truncate",children:["Sending to ",en]})]})]}):(0,t.jsxs)("div",{className:(0,D.cn)("flex min-w-0 flex-col rounded-2xl bg-muted/40 ring-1 ring-border/50",d),children:[Z.map(n=>(0,t.jsxs)("div",{className:"flex items-start gap-2 border-border/60 border-b py-2.5 pr-1.5 pl-3.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1.5 font-mono text-[10px] leading-4",children:[(0,t.jsx)(l.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground"}),(0,t.jsx)(g.ShinyText,{text:`Step-in \xb7 waits for ${n.bot}'s next step`,speed:2.2,className:"min-w-0 truncate"})]}),(0,t.jsx)("p",{className:"whitespace-pre-wrap break-keep text-[13px] leading-snug",children:n.text})]}),(0,t.jsx)(p.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:et,onClick:()=>ee(e.id,n.id),"aria-label":"Take it back",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:(0,t.jsx)(u.X,{})})]},n.id)),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2 py-1.5 pr-1.5 pl-3.5",children:[(0,t.jsx)(g.ShinyText,{text:`${ea} \xb7 Working`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,t.jsxs)(p.Button,{type:"button",size:"sm",variant:"ghost",disabled:J,onClick:()=>_(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,t.jsx)(o.CornerDownLeft,{className:"size-3.5"}),"Step in"]}),(0,t.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),eo]})]})},"useAnswerThread",0,V],399512)},257705,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f528f2137f59470c5f0ef1a3a8db7a60163b5cd11",t.callServer,void 0,t.findSourceMapURL,"answerThreadAction");e.s(["answerThreadAction",0,n])},941051,e=>{"use strict";var t=e.i(95187);let n=(0,t.createServerReference)("7f03a72fd8ed1d45bbf0b7f8f4469d10023619ae6f",t.callServer,void 0,t.findSourceMapURL,"cancelThreadAction");e.s(["cancelThreadAction",0,n])},931619,e=>{"use strict";var t=e.i(456420);let n={name:"chevrons-right",size:24,node:[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]};n.node;let a=(0,t.default)(n);e.s(["ChevronsRight",0,a],931619)},51481,e=>{"use strict";var t=e.i(456420);let n={name:"circle-question-mark",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["help-circle","circle-help"]};n.node;let a=(0,t.default)(n);e.s(["CircleQuestionMark",0,a],51481)},919191,e=>{"use strict";var t=e.i(456420);let n={name:"corner-down-left",size:24,node:[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]]};n.node;let a=(0,t.default)(n);e.s(["CornerDownLeft",0,a],919191)},64801,e=>{"use strict";var t=e.i(456420);let n={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};n.node;let a=(0,t.default)(n);e.s(["Paperclip",0,a],64801)},825398,815731,e=>{"use strict";var t=e.i(456420);let n={name:"rotate-cw",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]};n.node;let a=(0,t.default)(n);e.s(["RotateCw",0,a],825398);var s=e.i(843476),r=e.i(176782),i=e.i(552245),o=e.i(225913),l=e.i(647163);let d=(0,o.cva)("group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",{variants:{variant:{default:"*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",secondary:"*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",muted:"*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",tinted:"*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",outline:"*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",ghost:"border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",destructive:"*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30"}},defaultVariants:{variant:"default"}});(0,o.cva)("absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",{variants:{side:{top:"top-0 -translate-y-3/4",bottom:"bottom-0 translate-y-3/4"},align:{start:"left-3",end:"right-3"}},defaultVariants:{side:"bottom",align:"end"}}),e.s(["Bubble",0,function({variant:e="default",align:t="start",className:n,...a}){return(0,s.jsx)("div",{"data-slot":"bubble","data-variant":e,"data-align":t,className:(0,l.cn)(d({variant:e}),n),...a})},"BubbleContent",0,function({className:e,render:t,...n}){var a;return a={defaultTagName:"div",props:(0,r.mergeProps)({className:(0,l.cn)("w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",e)},n),render:t,state:{slot:"bubble-content"}},(0,i.useRenderElement)(a.defaultTagName??"div",a,a)}],815731)},929272,e=>{"use strict";var t=e.i(456420);let n={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};n.node;let a=(0,t.default)(n);e.s(["Square",0,a],929272)}]);