thursday-agent 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (541) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -2
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +5 -5
  5. package/.next/routes-manifest.json +24 -6
  6. package/.next/server/app/_global-error/page.js +2 -2
  7. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +2 -2
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page.js +2 -2
  15. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/_not-found.html +1 -1
  18. package/.next/server/app/_not-found.rsc +14 -14
  19. package/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +12 -12
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  22. package/.next/server/app/api/artifact/route.js +3 -3
  23. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  24. package/.next/server/app/api/bot/memory/files/route/app-paths-manifest.json +3 -0
  25. package/.next/server/app/api/bot/memory/files/route.js +10 -0
  26. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -0
  27. package/.next/server/app/api/bot/memory/files/route_client-reference-manifest.js +3 -0
  28. package/.next/server/app/api/bot/memory/route/app-paths-manifest.json +3 -0
  29. package/.next/server/app/api/bot/memory/route.js +14 -0
  30. package/.next/server/app/api/bot/{notes → memory}/route.js.nft.json +1 -1
  31. package/.next/server/app/api/bot/memory/route_client-reference-manifest.js +3 -0
  32. package/.next/server/app/api/bot/route.js +6 -6
  33. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  34. package/.next/server/app/api/bot/task/[id]/route.js +8 -8
  35. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
  36. package/.next/server/app/api/bot/task/route.js +8 -8
  37. package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
  38. package/.next/server/app/api/config/route.js +5 -5
  39. package/.next/server/app/api/config/route.js.nft.json +1 -1
  40. package/.next/server/app/api/events/route.js +4 -5
  41. package/.next/server/app/api/events/route.js.nft.json +1 -1
  42. package/.next/server/app/api/file/[...path]/route.js +3 -3
  43. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  44. package/.next/server/app/api/llm-model/catalog/route.js +9 -8
  45. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  46. package/.next/server/app/api/llm-model/credits/route/app-paths-manifest.json +3 -0
  47. package/.next/server/app/api/llm-model/credits/route/build-manifest.json +12 -0
  48. package/.next/server/app/api/llm-model/credits/route/server-reference-manifest.json +4 -0
  49. package/.next/server/app/api/llm-model/credits/route.js +16 -0
  50. package/.next/server/app/api/llm-model/credits/route.js.map +5 -0
  51. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -0
  52. package/.next/server/app/api/llm-model/credits/route_client-reference-manifest.js +3 -0
  53. package/.next/server/app/api/llm-model/route.js +10 -8
  54. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  55. package/.next/server/app/api/llm-model/subscription/route/app-paths-manifest.json +3 -0
  56. package/.next/server/app/api/llm-model/subscription/route/build-manifest.json +12 -0
  57. package/.next/server/app/api/llm-model/subscription/route/server-reference-manifest.json +4 -0
  58. package/.next/server/app/api/llm-model/subscription/route.js +15 -0
  59. package/.next/server/app/api/llm-model/subscription/route.js.map +5 -0
  60. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -0
  61. package/.next/server/app/api/llm-model/subscription/route_client-reference-manifest.js +3 -0
  62. package/.next/server/app/api/mcp/[name]/route.js +4 -4
  63. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/mcp/oauth/callback/route.js +5 -5
  65. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  66. package/.next/server/app/api/mcp/route.js +4 -4
  67. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  68. package/.next/server/app/api/mcp/tools/route.js +4 -4
  69. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  70. package/.next/server/app/api/memory/edit/route/app-paths-manifest.json +3 -0
  71. package/.next/server/app/api/memory/edit/route/build-manifest.json +12 -0
  72. package/.next/server/app/api/memory/edit/route/server-reference-manifest.json +4 -0
  73. package/.next/server/app/api/memory/edit/route.js +24 -0
  74. package/.next/server/app/api/memory/edit/route.js.map +5 -0
  75. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -0
  76. package/.next/server/app/api/memory/{tidy → edit}/route_client-reference-manifest.js +1 -1
  77. package/.next/server/app/api/memory/route.js +6 -7
  78. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  79. package/.next/server/app/api/skills/[source]/[name]/route.js +3 -3
  80. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  81. package/.next/server/app/api/skills/route.js +3 -3
  82. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  83. package/.next/server/app/api/thursday/call/route.js +9 -7
  84. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  85. package/.next/server/app/api/thursday/skills/route.js +9 -7
  86. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  87. package/.next/server/app/api/thursday/tool-call/route.js +17 -15
  88. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  89. package/.next/server/app/api/workspace/route.js +4 -5
  90. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  91. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  92. package/.next/server/app/artifact/[...path]/page.js +5 -6
  93. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  94. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  95. package/.next/server/app/favicon.ico/route.js +3 -4
  96. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  97. package/.next/server/app/favicon.ico.body +0 -0
  98. package/.next/server/app/page/server-reference-manifest.json +57 -90
  99. package/.next/server/app/page.js +10 -10
  100. package/.next/server/app/page.js.nft.json +1 -1
  101. package/.next/server/app/page_client-reference-manifest.js +1 -1
  102. package/.next/server/app-paths-manifest.json +5 -2
  103. package/.next/server/chunks/[externals]__0dzuk6_._.js +3 -0
  104. package/.next/server/chunks/[root-of-the-server]__01dkp4a._.js +3 -0
  105. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__02xjoto._.js +3 -0
  107. package/.next/server/chunks/[root-of-the-server]__04q--0f._.js +8 -0
  108. package/.next/server/chunks/[root-of-the-server]__0bl-e63._.js +3 -0
  109. package/.next/server/chunks/[root-of-the-server]__0ce8nf8._.js +5 -0
  110. package/.next/server/chunks/[root-of-the-server]__0ffbg85._.js +3 -0
  111. package/.next/server/chunks/[root-of-the-server]__0j7z0r3._.js +12 -0
  112. package/.next/server/chunks/[root-of-the-server]__0jq4ohy._.js +8 -0
  113. package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +8 -0
  114. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +3 -0
  115. package/.next/server/chunks/[root-of-the-server]__0pa2n68._.js +3 -0
  116. package/.next/server/chunks/[root-of-the-server]__0q0vvt2._.js +5 -0
  117. package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +5 -0
  118. package/.next/server/chunks/[root-of-the-server]__11n256_._.js +5 -0
  119. package/.next/server/chunks/[root-of-the-server]__12cabg9._.js +3 -0
  120. package/.next/server/chunks/[root-of-the-server]__1339jnv._.js +8 -0
  121. package/.next/server/chunks/[root-of-the-server]__15bjnu5._.js +5 -0
  122. package/.next/server/chunks/[root-of-the-server]__18_teo8._.js +8 -0
  123. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +5 -0
  124. package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +3 -0
  125. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +5 -5
  126. package/.next/server/chunks/[root-of-the-server]__1fizn31._.js +3 -0
  127. package/.next/server/chunks/[root-of-the-server]__1llj3-b._.js +3 -0
  128. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +12 -0
  129. package/.next/server/chunks/[root-of-the-server]__1p8m3f4._.js +3 -0
  130. package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +8 -0
  131. package/.next/server/chunks/_0-73of8._.js +5 -5
  132. package/.next/server/chunks/_0-fjql4._.js +26 -0
  133. package/.next/server/chunks/_00xh_q0._.js +25 -0
  134. package/.next/server/chunks/_051qh8u._.js +3 -0
  135. package/.next/server/chunks/{node_modules_next_04q-o58._.js → _05dla15._.js} +2 -2
  136. package/.next/server/chunks/_05h2cii._.js +1 -1
  137. package/.next/server/chunks/_0c9j6rb._.js +49 -0
  138. package/.next/server/chunks/_0fzqt2y._.js +134 -0
  139. package/.next/server/chunks/{_0vnutv9._.js → _0ioz3nd._.js} +1 -1
  140. package/.next/server/chunks/_0iwfby5._.js +3 -0
  141. package/.next/server/chunks/_0mecv0f._.js +26 -0
  142. package/.next/server/chunks/_0mh8j4m._.js +3 -0
  143. package/.next/server/chunks/_0n74zsf._.js +4 -4
  144. package/.next/server/chunks/_0obojvv._.js +3 -0
  145. package/.next/server/chunks/_0recufk._.js +49 -0
  146. package/.next/server/chunks/_0rnf-6n._.js +4 -4
  147. package/.next/server/chunks/_0sb7tlz._.js +3 -0
  148. package/.next/server/chunks/_0u10wmw._.js +5 -5
  149. package/.next/server/chunks/_0u4aiy2._.js +3 -0
  150. package/.next/server/chunks/_0wp4le3._.js +1 -1
  151. package/.next/server/chunks/_0y5fg-x._.js +1 -1
  152. package/.next/server/chunks/_1230wbx._.js +10 -0
  153. package/.next/server/chunks/_12nheja._.js +3 -0
  154. package/.next/server/chunks/_13510xh._.js +3 -0
  155. package/.next/server/chunks/_15hq89o._.js +1 -1
  156. package/.next/server/chunks/_17l5ygt._.js +49 -0
  157. package/.next/server/chunks/_18-1wcc._.js +5 -5
  158. package/.next/server/chunks/_1_5mnq4._.js +4 -4
  159. package/.next/server/chunks/_1_9mjx-._.js +3 -0
  160. package/.next/server/chunks/{_0pppbb5._.js → _1c78vw5._.js} +166 -37
  161. package/.next/server/chunks/_1d0j961._.js +6 -0
  162. package/.next/server/chunks/_1d5zmy8._.js +1 -1
  163. package/.next/server/chunks/_1drgfx4._.js +4 -4
  164. package/.next/server/chunks/_1f46eie._.js +3 -0
  165. package/.next/server/chunks/_1h5_8sk._.js +3 -0
  166. package/.next/server/chunks/_1hdnxb7._.js +3 -0
  167. package/.next/server/chunks/_1j8k_j5._.js +3 -0
  168. package/.next/server/chunks/_1krd9rf._.js +3 -0
  169. package/.next/server/chunks/_1nc0eui._.js +11 -0
  170. package/.next/server/chunks/_1nula3v._.js +3 -0
  171. package/.next/server/chunks/_1pf4qe-._.js +3 -0
  172. package/.next/server/chunks/_1php4eq._.js +1 -1
  173. package/.next/server/chunks/_1qxheoa._.js +3 -0
  174. package/.next/server/chunks/_1x6kd1r._.js +3 -0
  175. package/.next/server/chunks/_1yuv4vp._.js +1 -1
  176. package/.next/server/chunks/_1zjrdag._.js +3 -0
  177. package/.next/server/chunks/_next-internal_server_app_api_bot_memory_files_route_actions_1_xd_8f.js +3 -0
  178. package/.next/server/chunks/_next-internal_server_app_api_bot_memory_route_actions_1a8xfr7.js +3 -0
  179. package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_route_actions_0v424pb.js +3 -0
  180. package/.next/server/chunks/_next-internal_server_app_api_llm-model_subscription_route_actions_0-udcm5.js +3 -0
  181. package/.next/server/chunks/_next-internal_server_app_api_memory_edit_route_actions_02sfnmr.js +3 -0
  182. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  183. package/.next/server/chunks/features_0rpfxbk._.js +3 -0
  184. package/.next/server/chunks/features_1qf3cei._.js +3 -0
  185. package/.next/server/chunks/features_bot_0zt92oh._.js +3 -0
  186. package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +3 -0
  187. package/.next/server/chunks/features_memory_1uqvksn._.js +6 -0
  188. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0a1rd09._.js → node_modules_consola_dist_chunks_prompt_mjs_0i7cvml._.js} +1 -1
  189. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_06067w6._.js → node_modules_consola_dist_chunks_prompt_mjs_0icqaqw._.js} +1 -1
  190. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_096ais_._.js → node_modules_consola_dist_chunks_prompt_mjs_0r28-sm._.js} +1 -1
  191. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_02s3hjt._.js → node_modules_consola_dist_chunks_prompt_mjs_0v_7drq._.js} +1 -1
  192. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1xoq2rl._.js +3 -0
  193. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0tvkfgh._.js → node_modules_consola_dist_chunks_prompt_mjs_1y49572._.js} +1 -1
  194. package/.next/server/chunks/ssr/[root-of-the-server]__092knlj._.js +3 -0
  195. package/.next/server/chunks/ssr/[root-of-the-server]__09q9med._.js +1 -1
  196. package/.next/server/chunks/ssr/[root-of-the-server]__0hg5gib._.js +1 -1
  197. package/.next/server/chunks/ssr/[root-of-the-server]__0i8ie7f._.js +3 -0
  198. package/.next/server/chunks/ssr/{[root-of-the-server]__0jsmmb-._.js → [root-of-the-server]__0mz33a7._.js} +1 -1
  199. package/.next/server/chunks/ssr/[root-of-the-server]__0s9dq5u._.js +3 -0
  200. package/.next/server/chunks/ssr/{[root-of-the-server]__0m1b5ky._.js → [root-of-the-server]__0s9l2sv._.js} +1 -1
  201. package/.next/server/chunks/ssr/[root-of-the-server]__0tbkdlx._.js +3 -0
  202. package/.next/server/chunks/ssr/[root-of-the-server]__0vnmv-s._.js +3 -0
  203. package/.next/server/chunks/ssr/{[root-of-the-server]__0f6s48x._.js → [root-of-the-server]__0xpcv9w._.js} +3 -3
  204. package/.next/server/chunks/ssr/[root-of-the-server]__0xsog8n._.js +3 -0
  205. package/.next/server/chunks/ssr/[root-of-the-server]__0xtssj3._.js +1 -1
  206. package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +61 -0
  207. package/.next/server/chunks/ssr/[root-of-the-server]__15_uhip._.js +3 -0
  208. package/.next/server/chunks/ssr/[root-of-the-server]__16jc196._.js +1 -1
  209. package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +43 -0
  210. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  211. package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +4 -0
  212. package/.next/server/chunks/ssr/{[root-of-the-server]__1qfqvmg._.js → [root-of-the-server]__202p40z._.js} +2 -2
  213. package/.next/server/chunks/ssr/{_1mznrxk._.js → _001_ms1._.js} +3 -3
  214. package/.next/server/chunks/ssr/_01n3o0m._.js +3 -0
  215. package/.next/server/chunks/ssr/_0ap2fzn._.js +3 -0
  216. package/.next/server/chunks/ssr/_0fz4mf_._.js +3 -0
  217. package/.next/server/chunks/ssr/_0gb4gmf._.js +3 -0
  218. package/.next/server/chunks/ssr/_0h42fze._.js +3 -0
  219. package/.next/server/chunks/ssr/_0h7zdni._.js +1 -1
  220. package/.next/server/chunks/ssr/_0i_6q1w._.js +41 -0
  221. package/.next/server/chunks/ssr/_0ilna52._.js +42 -0
  222. package/.next/server/chunks/ssr/_0n3toaw._.js +3 -0
  223. package/.next/server/chunks/ssr/{_13punpm._.js → _0q0zan6._.js} +2 -2
  224. package/.next/server/chunks/ssr/{_077-g6s._.js → _0s99bgb._.js} +3 -3
  225. package/.next/server/chunks/ssr/_0zcjrbg._.js +3 -0
  226. package/.next/server/chunks/ssr/_0zhoc3r._.js +3 -0
  227. package/.next/server/chunks/ssr/{_1lip4th._.js → _1-_etts._.js} +2 -2
  228. package/.next/server/chunks/ssr/_1-teee5._.js +3 -3
  229. package/.next/server/chunks/ssr/_13fke0x._.js +3 -0
  230. package/.next/server/chunks/ssr/_15j2_8f._.js +3 -0
  231. package/.next/server/chunks/ssr/_1b2mjwr._.js +3 -0
  232. package/.next/server/chunks/ssr/{_09ja_w1._.js → _1f-dg-6._.js} +2 -2
  233. package/.next/server/chunks/ssr/_1fojd41._.js +4 -0
  234. package/.next/server/chunks/ssr/_1gd8q8l._.js +3 -0
  235. package/.next/server/chunks/ssr/{_1m3bsfr._.js → _1h0rw11._.js} +2 -2
  236. package/.next/server/chunks/ssr/_1jhd09t._.js +3 -0
  237. package/.next/server/chunks/ssr/{_040sk32._.js → _1lz_cq2._.js} +84 -88
  238. package/.next/server/chunks/ssr/_1nnsk7z._.js +3 -0
  239. package/.next/server/chunks/ssr/_1sji22n._.js +3 -0
  240. package/.next/server/chunks/ssr/{_0x_nu5e._.js → _1vi_uo7._.js} +2 -2
  241. package/.next/server/chunks/ssr/_1vyd1ji._.js +1 -1
  242. package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +3 -0
  243. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  244. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  245. package/.next/server/chunks/ssr/{node_modules_0kxz4gt._.js → node_modules_00etblx._.js} +1 -1
  246. package/.next/server/chunks/ssr/{node_modules_18_dk7_._.js → node_modules_04jf_m8._.js} +1 -1
  247. package/.next/server/chunks/ssr/{node_modules_0_n241r._.js → node_modules_08dhkiq._.js} +1 -1
  248. package/.next/server/chunks/ssr/{node_modules_0n1kj4p._.js → node_modules_0940ns5._.js} +1 -1
  249. package/.next/server/chunks/ssr/{node_modules_17lrt3y._.js → node_modules_09q35v_._.js} +1 -1
  250. package/.next/server/chunks/ssr/{node_modules_1toafc-._.js → node_modules_0_-_a--._.js} +1 -1
  251. package/.next/server/chunks/ssr/{node_modules_0lrjk5t._.js → node_modules_0arus10._.js} +1 -1
  252. package/.next/server/chunks/ssr/{node_modules_04n7mjs._.js → node_modules_0b__sgl._.js} +1 -1
  253. package/.next/server/chunks/ssr/{node_modules_0iz1rzd._.js → node_modules_0cxaxk9._.js} +1 -1
  254. package/.next/server/chunks/ssr/{node_modules_0ndvxub._.js → node_modules_0g7fzk3._.js} +1 -1
  255. package/.next/server/chunks/ssr/{node_modules_0kl7-tn._.js → node_modules_0had7xd._.js} +1 -1
  256. package/.next/server/chunks/ssr/{node_modules_19dp7ko._.js → node_modules_0pvd7q-._.js} +1 -1
  257. package/.next/server/chunks/ssr/node_modules_0x3-ply._.js +3 -0
  258. package/.next/server/chunks/ssr/{node_modules_1dwguw_._.js → node_modules_0yugy6m._.js} +1 -1
  259. package/.next/server/chunks/ssr/{node_modules_004qlr4._.js → node_modules_14om4ar._.js} +1 -1
  260. package/.next/server/chunks/ssr/{node_modules_1q0p85z._.js → node_modules_14q6g4n._.js} +1 -1
  261. package/.next/server/chunks/ssr/node_modules_17bwo43._.js +55 -0
  262. package/.next/server/chunks/ssr/{node_modules_1hd-5tv._.js → node_modules_198nmll._.js} +1 -1
  263. package/.next/server/chunks/ssr/{node_modules_0m93zeg._.js → node_modules_1_pc9kq._.js} +1 -1
  264. package/.next/server/chunks/ssr/{node_modules_1n5ygqe._.js → node_modules_1aaxuef._.js} +1 -1
  265. package/.next/server/chunks/ssr/{node_modules_01qnv-a._.js → node_modules_1cx_ql6._.js} +1 -1
  266. package/.next/server/chunks/ssr/{node_modules_1zu988w._.js → node_modules_1cz2hle._.js} +1 -1
  267. package/.next/server/chunks/ssr/{node_modules_1xyd7ov._.js → node_modules_1efrqxi._.js} +1 -1
  268. package/.next/server/chunks/ssr/{node_modules_13r44jq._.js → node_modules_1eg7m6c._.js} +1 -1
  269. package/.next/server/chunks/ssr/{node_modules_08d8bke._.js → node_modules_1gdh31p._.js} +1 -1
  270. package/.next/server/chunks/ssr/{node_modules_1hn8z1f._.js → node_modules_1hpopmo._.js} +1 -1
  271. package/.next/server/chunks/ssr/{node_modules_20yebtj._.js → node_modules_1qpjvy5._.js} +1 -1
  272. package/.next/server/chunks/ssr/{node_modules_09xhur7._.js → node_modules_1vh5ntv._.js} +1 -1
  273. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0m9a4y0._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1b748ic._.js} +1 -1
  274. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_13w_wy9._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1z4hm5e._.js} +1 -1
  275. package/.next/server/chunks/ssr/node_modules_@vercel_oidc_dist_06mk8id._.js +3 -0
  276. package/.next/server/chunks/ssr/{node_modules_next_dist_0w6mzq5._.js → node_modules_next_dist_0drixxt._.js} +4 -4
  277. package/.next/server/chunks/ssr/node_modules_next_dist_1n3w9lb._.js +2 -2
  278. package/.next/server/instrumentation.js +1 -1
  279. package/.next/server/middleware-build-manifest.js +3 -3
  280. package/.next/server/pages/404.html +1 -1
  281. package/.next/server/pages/500.html +1 -1
  282. package/.next/server/server-reference-manifest.js +1 -1
  283. package/.next/server/server-reference-manifest.json +58 -91
  284. package/.next/static/chunks/00rd4-v8r7axp.js +1 -0
  285. package/.next/static/chunks/08qe4as2q428z.js +3 -0
  286. package/.next/static/chunks/{31ttnjt6g35a0.js → 0ev4hyghq0mbb.js} +1 -1
  287. package/.next/static/chunks/0fl3gwe4-l6tz.js +1 -0
  288. package/.next/static/chunks/0gnqdjn2lvdad.js +2 -0
  289. package/.next/static/chunks/0hwap1-p0m5sa.js +1 -0
  290. package/.next/static/chunks/0r5qcctujhxli.js +1 -0
  291. package/.next/static/chunks/0w52rrrmuj9r9.js +1 -0
  292. package/.next/static/chunks/{07kl352c-lvcz.js → 0wcprt5ot5she.js} +1 -1
  293. package/.next/static/chunks/10teww7wt-f6h.js +1 -0
  294. package/.next/static/chunks/15m575979un5f.js +38 -0
  295. package/.next/static/chunks/17p6tk6k88dq6.js +1 -0
  296. package/.next/static/chunks/{3_h9txt3tq8t8.js → 1dkjg87pxk0n9.js} +1 -1
  297. package/.next/static/chunks/1jd09sxcjddu1.js +1 -0
  298. package/.next/static/chunks/1kq8h8wi_e0bc.js +53 -0
  299. package/.next/static/chunks/{18vhba44l1fc9.js → 1w73ece_6bheu.js} +1 -1
  300. package/.next/static/chunks/{3ard_noqapnw1.js → 214ya3n5gxeih.js} +1 -1
  301. package/.next/static/chunks/22_zkas21rpna.js +1 -0
  302. package/.next/static/chunks/2h0sd2vumhb15.js +1 -0
  303. package/.next/static/chunks/2t4vhi3m8ahya.js +1 -0
  304. package/.next/static/chunks/2tigdtz3dpcy8.js +1 -0
  305. package/.next/static/chunks/2u7xt6mxg44lf.js +1 -0
  306. package/.next/static/chunks/39j0fvpybzabl.js +40 -0
  307. package/.next/static/chunks/3akmqm77muj4-.js +1 -0
  308. package/.next/static/chunks/3cq5g494yuke8.css +1 -0
  309. package/.next/static/chunks/3woj-xd7ki5_i.js +1 -0
  310. package/.next/static/chunks/3xk7yqgomx7yq.js +1 -0
  311. package/.next/static/chunks/3zmcsnuo25zvq.js +1 -0
  312. package/.next/static/media/favicon.37o1pjldwi2uc.ico +0 -0
  313. package/README.md +47 -22
  314. package/app/api/bot/memory/files/route.ts +14 -0
  315. package/app/api/bot/memory/route.ts +5 -0
  316. package/app/api/events/app-event.ts +3 -7
  317. package/app/api/llm-model/credits/route.ts +11 -0
  318. package/app/api/llm-model/route.ts +6 -1
  319. package/app/api/llm-model/subscription/route.ts +11 -0
  320. package/app/api/memory/edit/route.ts +7 -0
  321. package/app/api/memory/route.ts +21 -0
  322. package/app/api/query-key.ts +19 -4
  323. package/bin/port.mjs +65 -0
  324. package/bin/thursday.mjs +5 -33
  325. package/components/ui/shiny-text.tsx +48 -134
  326. package/database/migrations/{20260909060813_optimal_sabretooth → 20260910173049_numerous_spirit}/migration.sql +24 -34
  327. package/database/migrations/{20260909060813_optimal_sabretooth → 20260910173049_numerous_spirit}/snapshot.json +71 -145
  328. package/database/migrations/20260911030320_opposite_jack_power/migration.sql +1 -0
  329. package/database/migrations/{20260909063821_bitter_tenebrous → 20260911030320_opposite_jack_power}/snapshot.json +57 -184
  330. package/docs/how-it-works.md +11 -7
  331. package/docs/images/face-dark.png +0 -0
  332. package/docs/images/face-light.png +0 -0
  333. package/docs/images/keeps-going.png +0 -0
  334. package/features/ai/chatgpt.ts +639 -0
  335. package/features/ai/components/chatgpt-sign-in.tsx +66 -0
  336. package/features/ai/components/model-picker.tsx +17 -1
  337. package/features/ai/components/provider-icon.tsx +1 -0
  338. package/features/ai/load-tools.ts +78 -56
  339. package/features/ai/model.schema.ts +232 -34
  340. package/features/ai/model.ts +169 -24
  341. package/features/ai/prompts/bot.prompt.ts +207 -114
  342. package/features/ai/prompts/memory-edit.prompt.ts +33 -0
  343. package/features/ai/prompts/prompt-helper.ts +45 -26
  344. package/features/ai/prompts/thursday.prompt.ts +57 -27
  345. package/features/ai/tools/bot.tool.ts +35 -52
  346. package/features/ai/tools/connected.ts +17 -4
  347. package/features/ai/tools/memory.tool.ts +181 -117
  348. package/features/ai/tools/search.tool.ts +136 -47
  349. package/features/ai/tools/tool-name.ts +2 -6
  350. package/features/ai/tools/workspace.tool.ts +5 -1
  351. package/features/bot/bot.action.ts +14 -19
  352. package/features/bot/bot.memory.ts +89 -0
  353. package/features/bot/bot.query.ts +37 -57
  354. package/features/bot/bot.run.ts +512 -242
  355. package/features/bot/bot.runner.ts +434 -120
  356. package/features/bot/bot.schema.ts +104 -19
  357. package/features/bot/bot.seed.ts +89 -16
  358. package/features/bot/components/bot-mark.tsx +122 -20
  359. package/features/bot/components/bot-room.tsx +214 -132
  360. package/features/bot/components/bot-setting.tsx +790 -402
  361. package/features/bot/components/bot-tool.tsx +2 -7
  362. package/features/bot/components/mark-palette.tsx +54 -0
  363. package/features/bot/components/path-chips.tsx +1 -1
  364. package/features/bot/components/task-badge.tsx +26 -6
  365. package/features/bot/components/task-reply.tsx +22 -33
  366. package/features/bot/components/task-setting.tsx +20 -17
  367. package/features/bot/task.query.ts +240 -34
  368. package/features/bot/task.store.ts +76 -13
  369. package/features/config/components/config-setting.tsx +265 -34
  370. package/features/config/components/models-badge.tsx +42 -0
  371. package/features/config/config.action.ts +12 -0
  372. package/features/config/config.const.ts +38 -2
  373. package/features/connectors/mcp.manager.ts +10 -2
  374. package/features/intro/components/intro.tsx +47 -46
  375. package/features/memory/components/memory-edit.tsx +340 -0
  376. package/features/memory/components/memory-setting.tsx +75 -77
  377. package/features/memory/memory.action.ts +3 -43
  378. package/features/memory/memory.edit.ts +87 -0
  379. package/features/memory/memory.query.ts +24 -42
  380. package/features/memory/memory.schema.ts +29 -106
  381. package/features/settings/components/settings.tsx +2 -0
  382. package/features/settings/settings.alert.ts +3 -1
  383. package/features/thursday/components/ascii-orb.tsx +106 -90
  384. package/features/thursday/components/boot.tsx +7 -0
  385. package/features/thursday/components/call-log.tsx +219 -92
  386. package/features/thursday/components/face.tsx +6 -4
  387. package/features/thursday/components/tab-state.tsx +97 -0
  388. package/features/thursday/components/thursday-mark.tsx +4 -1
  389. package/features/thursday/components/thursday-setting.tsx +17 -47
  390. package/features/thursday/components/thursday.tsx +208 -98
  391. package/features/thursday/thursday.action.ts +12 -17
  392. package/features/thursday/thursday.query.ts +61 -70
  393. package/features/thursday/thursday.schema.ts +20 -7
  394. package/features/thursday/tool-line.ts +85 -12
  395. package/features/thursday/use-thursday.ts +87 -60
  396. package/features/workspace/components/file-view.tsx +4 -2
  397. package/features/workspace/workspace.ts +110 -26
  398. package/lib/limits.ts +1 -1
  399. package/lib/oauth-page.ts +27 -0
  400. package/lib/realtime/openai.ts +2 -2
  401. package/lib/realtime/realtime.protocol.ts +1 -1
  402. package/lib/realtime/realtime.tap.ts +122 -0
  403. package/lib/sandbox.ts +59 -36
  404. package/package.json +1 -1
  405. package/skills/browser/SKILL.md +55 -34
  406. package/.next/server/app/api/bot/notes/route/app-paths-manifest.json +0 -3
  407. package/.next/server/app/api/bot/notes/route.js +0 -14
  408. package/.next/server/app/api/bot/notes/route_client-reference-manifest.js +0 -3
  409. package/.next/server/app/api/memory/tidy/route/app-paths-manifest.json +0 -3
  410. package/.next/server/app/api/memory/tidy/route.js +0 -22
  411. package/.next/server/app/api/memory/tidy/route.js.nft.json +0 -1
  412. package/.next/server/chunks/0d-b_next_dist_server_app-render_after-task-async-storage_external_0-exn7p.js +0 -3
  413. package/.next/server/chunks/[root-of-the-server]__0-npkh_._.js +0 -3
  414. package/.next/server/chunks/[root-of-the-server]__005var5._.js +0 -3
  415. package/.next/server/chunks/[root-of-the-server]__019dx9f._.js +0 -5
  416. package/.next/server/chunks/[root-of-the-server]__02_2sm-._.js +0 -5
  417. package/.next/server/chunks/[root-of-the-server]__04_8spk._.js +0 -3
  418. package/.next/server/chunks/[root-of-the-server]__05luceg._.js +0 -3
  419. package/.next/server/chunks/[root-of-the-server]__06t77t4._.js +0 -11
  420. package/.next/server/chunks/[root-of-the-server]__0bed6hu._.js +0 -8
  421. package/.next/server/chunks/[root-of-the-server]__0cro2dz._.js +0 -5
  422. package/.next/server/chunks/[root-of-the-server]__0dupqt7._.js +0 -5
  423. package/.next/server/chunks/[root-of-the-server]__0emr6go._.js +0 -3
  424. package/.next/server/chunks/[root-of-the-server]__0le4d-p._.js +0 -3
  425. package/.next/server/chunks/[root-of-the-server]__0m8ywyo._.js +0 -10
  426. package/.next/server/chunks/[root-of-the-server]__0nfuugi._.js +0 -5
  427. package/.next/server/chunks/[root-of-the-server]__0p32jfz._.js +0 -12
  428. package/.next/server/chunks/[root-of-the-server]__0phdgco._.js +0 -8
  429. package/.next/server/chunks/[root-of-the-server]__0wvgrsl._.js +0 -3
  430. package/.next/server/chunks/[root-of-the-server]__10qshki._.js +0 -3
  431. package/.next/server/chunks/[root-of-the-server]__11j52t0._.js +0 -5
  432. package/.next/server/chunks/[root-of-the-server]__1692zrv._.js +0 -3
  433. package/.next/server/chunks/[root-of-the-server]__16thabu._.js +0 -3
  434. package/.next/server/chunks/[root-of-the-server]__173nhwf._.js +0 -8
  435. package/.next/server/chunks/[root-of-the-server]__1_aoyr9._.js +0 -3
  436. package/.next/server/chunks/[root-of-the-server]__1bn73ih._.js +0 -10
  437. package/.next/server/chunks/[root-of-the-server]__1bqhuh9._.js +0 -8
  438. package/.next/server/chunks/[root-of-the-server]__1cqizfq._.js +0 -5
  439. package/.next/server/chunks/[root-of-the-server]__1e-ci13._.js +0 -3
  440. package/.next/server/chunks/[root-of-the-server]__1fboj2j._.js +0 -3
  441. package/.next/server/chunks/[root-of-the-server]__1lr7j9t._.js +0 -5
  442. package/.next/server/chunks/[root-of-the-server]__1oli73c._.js +0 -3
  443. package/.next/server/chunks/[root-of-the-server]__1txedx6._.js +0 -8
  444. package/.next/server/chunks/[root-of-the-server]__1untqv8._.js +0 -5
  445. package/.next/server/chunks/[root-of-the-server]__1zgpz1w._.js +0 -3
  446. package/.next/server/chunks/_00_584r._.js +0 -293
  447. package/.next/server/chunks/_012yhfm._.js +0 -39
  448. package/.next/server/chunks/_06mxlgn._.js +0 -3
  449. package/.next/server/chunks/_07rtlxv._.js +0 -3
  450. package/.next/server/chunks/_0a351g7._.js +0 -6
  451. package/.next/server/chunks/_0kjjmag._.js +0 -3
  452. package/.next/server/chunks/_0nn99o2._.js +0 -3
  453. package/.next/server/chunks/_0zuzmt_._.js +0 -39
  454. package/.next/server/chunks/_106co2o._.js +0 -3
  455. package/.next/server/chunks/_12bbv5i._.js +0 -100
  456. package/.next/server/chunks/_15q1pig._.js +0 -3
  457. package/.next/server/chunks/_19wg5yn._.js +0 -138
  458. package/.next/server/chunks/_1bt95p9._.js +0 -55
  459. package/.next/server/chunks/_1cbk7ms._.js +0 -26
  460. package/.next/server/chunks/_1drv2et._.js +0 -40
  461. package/.next/server/chunks/_1ic3bew._.js +0 -5
  462. package/.next/server/chunks/_1mxn_lb._.js +0 -3
  463. package/.next/server/chunks/_1rysr-r._.js +0 -10
  464. package/.next/server/chunks/_1u3rwbr._.js +0 -3
  465. package/.next/server/chunks/_1x7p319._.js +0 -6
  466. package/.next/server/chunks/_next-internal_server_app_api_bot_notes_route_actions_0qcsyu7.js +0 -3
  467. package/.next/server/chunks/_next-internal_server_app_api_memory_tidy_route_actions_0_cfuom.js +0 -3
  468. package/.next/server/chunks/features_bot_task_query_ts_11xuzl3._.js +0 -3
  469. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0gzvgfv._.js +0 -3
  470. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0vorg6w._.js +0 -3
  471. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1tpvamf._.js +0 -3
  472. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1vmaq9f._.js +0 -3
  473. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1y9-wcr._.js +0 -3
  474. package/.next/server/chunks/ssr/[externals]_node_crypto_1kn79-7._.js +0 -3
  475. package/.next/server/chunks/ssr/[root-of-the-server]__0iuoa-r._.js +0 -3
  476. package/.next/server/chunks/ssr/[root-of-the-server]__0un-erv._.js +0 -4
  477. package/.next/server/chunks/ssr/[root-of-the-server]__1-mnhyd._.js +0 -92
  478. package/.next/server/chunks/ssr/[root-of-the-server]__1bww500._.js +0 -3
  479. package/.next/server/chunks/ssr/[root-of-the-server]__1vcdast._.js +0 -3
  480. package/.next/server/chunks/ssr/[root-of-the-server]__1xwnu-h._.js +0 -3
  481. package/.next/server/chunks/ssr/_0-mc7ro._.js +0 -3
  482. package/.next/server/chunks/ssr/_01p5r6-._.js +0 -3
  483. package/.next/server/chunks/ssr/_03webdr._.js +0 -3
  484. package/.next/server/chunks/ssr/_09-0k3z._.js +0 -3
  485. package/.next/server/chunks/ssr/_0f_b_9s._.js +0 -3
  486. package/.next/server/chunks/ssr/_0fafgvl._.js +0 -3
  487. package/.next/server/chunks/ssr/_0sf1isi._.js +0 -3
  488. package/.next/server/chunks/ssr/_0su6_08._.js +0 -3
  489. package/.next/server/chunks/ssr/_0ti51xc._.js +0 -3
  490. package/.next/server/chunks/ssr/_0w5bgak._.js +0 -3
  491. package/.next/server/chunks/ssr/_0y84qo6._.js +0 -3
  492. package/.next/server/chunks/ssr/_1ciyoo3._.js +0 -3
  493. package/.next/server/chunks/ssr/_1e-dgz0._.js +0 -4
  494. package/.next/server/chunks/ssr/_1fq7zgb._.js +0 -3
  495. package/.next/server/chunks/ssr/_1g6l4uj._.js +0 -3
  496. package/.next/server/chunks/ssr/_1ruzehw._.js +0 -3
  497. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +0 -4
  498. package/.next/server/chunks/ssr/features_config_components_14jqgy4._.js +0 -3
  499. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +0 -4
  500. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_15fmmz3.js +0 -55
  501. package/.next/static/chunks/05b6nx_o3_f_n.js +0 -1
  502. package/.next/static/chunks/0dmns-gi0raa4.js +0 -1
  503. package/.next/static/chunks/0f9sq-7q_yxyl.js +0 -1
  504. package/.next/static/chunks/0oc4_xoia77dg.css +0 -1
  505. package/.next/static/chunks/0pheo8m3a-rzi.js +0 -1
  506. package/.next/static/chunks/19i8h2t-5evjx.js +0 -1
  507. package/.next/static/chunks/1c5fcj473025q.js +0 -1
  508. package/.next/static/chunks/1pi_hbmjw-f-z.js +0 -1
  509. package/.next/static/chunks/1twt6k09vg4np.js +0 -1
  510. package/.next/static/chunks/1ytnip8wdng93.js +0 -1
  511. package/.next/static/chunks/28gotuisldmom.js +0 -1
  512. package/.next/static/chunks/2998p0y7k1c8z.js +0 -3
  513. package/.next/static/chunks/29gyb3nubj51j.js +0 -53
  514. package/.next/static/chunks/2l233xfycjpd8.js +0 -1
  515. package/.next/static/chunks/2p5n7pa3c40t-.js +0 -2
  516. package/.next/static/chunks/2ru1q132af7h7.js +0 -1
  517. package/.next/static/chunks/2t8wqycwg3y04.js +0 -2
  518. package/.next/static/chunks/2uxum7qbyeyxd.js +0 -1
  519. package/.next/static/chunks/32z_ypgtchw48.js +0 -1
  520. package/.next/static/chunks/33pyjb3xd1iez.js +0 -1
  521. package/.next/static/chunks/3omud5xunrk1f.js +0 -1
  522. package/.next/static/chunks/42dnrkbph9e-1.js +0 -1
  523. package/.next/static/media/favicon.2vob68tjqpejf.ico +0 -0
  524. package/database/migrations/20260909063821_bitter_tenebrous/migration.sql +0 -1
  525. package/features/ai/prompts/memory-tidy.prompt.ts +0 -129
  526. package/features/ai/tools/tidy.tool.ts +0 -22
  527. package/features/bot/bot.notes.ts +0 -120
  528. package/features/memory/components/memory-tidy.tsx +0 -395
  529. package/features/memory/components/memory-view.tsx +0 -84
  530. package/features/memory/memory.tidy.ts +0 -332
  531. package/features/memory/tidy.query.ts +0 -135
  532. package/features/thursday/use-call-title.ts +0 -31
  533. /package/.next/server/app/api/bot/{notes → memory/files}/route/build-manifest.json +0 -0
  534. /package/.next/server/app/api/bot/{notes → memory/files}/route/server-reference-manifest.json +0 -0
  535. /package/.next/server/app/api/bot/{notes → memory/files}/route.js.map +0 -0
  536. /package/.next/server/app/api/{memory/tidy → bot/memory}/route/build-manifest.json +0 -0
  537. /package/.next/server/app/api/{memory/tidy → bot/memory}/route/server-reference-manifest.json +0 -0
  538. /package/.next/server/app/api/{memory/tidy → bot/memory}/route.js.map +0 -0
  539. /package/.next/static/{YR4NWcDDuzwLbTTU7U7Vr → kaTO0UHqF1bMnWgCDik2f}/_buildManifest.js +0 -0
  540. /package/.next/static/{YR4NWcDDuzwLbTTU7U7Vr → kaTO0UHqF1bMnWgCDik2f}/_clientMiddlewareManifest.js +0 -0
  541. /package/.next/static/{YR4NWcDDuzwLbTTU7U7Vr → kaTO0UHqF1bMnWgCDik2f}/_ssgManifest.js +0 -0
@@ -0,0 +1,4 @@
1
+ module.exports=[262276,a=>{"use strict";var b=a.i(187924),c=a.i(400187);a.i(340695);var d=a.i(205522);a.i(546893);var e=a.i(497895);let f=(0,c.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});(0,c.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}}),a.s(["InputGroup",0,function({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,e.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",a),...c})},"InputGroupAddon",0,function({className:a,align:c="inline-start",...d}){return(0,b.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":c,className:(0,e.cn)(f({align:c}),a),onClick:a=>{a.target.closest("button")||a.currentTarget.parentElement?.querySelector("input")?.focus()},...d})},"InputGroupInput",0,function({className:a,...c}){return(0,b.jsx)(d.Input,{"data-slot":"input-group-control",className:(0,e.cn)("flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",a),...c})},"InputGroupText",0,function({className:a,...c}){return(0,b.jsx)("span",{className:(0,e.cn)("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",a),...c})}])},329154,a=>{"use strict";var b,c,d,e,f,g,h,i,j=a.i(187924),k=/[\\\/_+.#"@\[\(\{&]/,l=/[\\\/_+.#"@\[\(\{&]/g,m=/[\s-]/,n=/[\s-]/g;function o(a){return a.toLowerCase().replace(n," ")}var p=a.i(572131),q=Object.defineProperty,r=(a,b)=>q(a,"name",{value:b,configurable:!0});function s(a,b,{checkForDefaultPrevented:c=!0}={}){return r(function(d){if(a?.(d),!1===c||!d||!d.defaultPrevented)return b?.(d)},"handleEvent")}function t(a){throw Error("Cannot access document outside of the DOM")}function u(a){return"IFRAME"===a.tagName}r(s,"composeEventHandlers"),r(function(a){throw Error("Cannot access window outside of the DOM")},"getOwnerWindow"),r(t,"getOwnerDocument"),r(function a(b,c=!1){let{activeElement:d}=t(b);if(!d?.nodeName)return null;if(u(d)&&d.contentDocument)return a(d.contentDocument.body,c);if(c){let a=d.getAttribute("aria-activedescendant");if(a){let b=t(d).getElementById(a);if(b)return b}}return d},"getActiveElement"),r(u,"isFrame");var v=Object.defineProperty,w=(a,b)=>v(a,"name",{value:b,configurable:!0});function x(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}function y(...a){return b=>{let c=!1,d=a.map(a=>{let d=x(a,b);return c||"function"!=typeof d||(c=!0),d});if(c)return()=>{for(let b=0;b<d.length;b++){let c=d[b];"function"==typeof c?c():x(a[b],null)}}}}function z(...a){return p.useCallback(y(...a),a)}w(x,"setRef"),w(y,"composeRefs"),w(z,"useComposedRefs");var A=Object.defineProperty,B=(a,b)=>A(a,"name",{value:b,configurable:!0});function C(a,b=[]){let c=[];function d(b,d){let e=p.createContext(d);e.displayName=b+"Context";let f=c.length;c=[...c,d];let g=B(b=>{let{scope:c,children:d,...g}=b,h=c?.[a]?.[f]||e,i=p.useMemo(()=>g,Object.values(g));return(0,j.jsx)(h.Provider,{value:i,children:d})},"Provider");function h(c,g,i={}){let{optional:j=!1}=i,k=g?.[a]?.[f]||e,l=p.useContext(k);if(l)return l;if(void 0!==d)return d;if(!j)throw Error(`\`${c}\` must be used within \`${b}\``)}return g.displayName=b+"Provider",B(h,"useContext"),[g,h]}B(d,"createContext");let e=B(()=>{let b=c.map(a=>p.createContext(a));return B(function(c){let d=c?.[a]||b;return p.useMemo(()=>({[`__scope${a}`]:{...c,[a]:d}}),[c,d])},"useScope")},"createScope");return e.scopeName=a,[d,D(e,...b)]}function D(...a){let b=a[0];if(1===a.length)return b;let c=B(()=>{let c=a.map(a=>({useScope:a(),scopeName:a.scopeName}));return B(function(a){let d=c.reduce((b,{useScope:c,scopeName:d})=>{let e=c(a)[`__scope${d}`];return{...b,...e}},{});return p.useMemo(()=>({[`__scope${b.scopeName}`]:d}),[d])},"useComposedScopes")},"createScope");return c.scopeName=b.scopeName,c}B(function(a,b){let c=p.createContext(b);c.displayName=a+"Context";let d=B(a=>{let{children:b,...d}=a,e=p.useMemo(()=>d,Object.values(d));return(0,j.jsx)(c.Provider,{value:e,children:b})},"Provider");function e(d,f={}){let{optional:g=!1}=f,h=p.useContext(c);if(h)return h;if(void 0!==b)return b;if(!g)throw Error(`\`${d}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",B(e,"useContext"),[d,e]},"createContext"),B(C,"createContextScope"),B(D,"composeContextScopes");var E=globalThis?.document?p.useLayoutEffect:()=>{},F=Object.defineProperty,G=p[" useId ".trim().toString()]||(()=>void 0),H=0;function I(a){let[b,c]=p.useState(G());return E(()=>{a||c(a=>a??String(H++))},[a]),a||(b?`radix-${b}`:"")}F(I,"name",{value:"useId",configurable:!0});var J=Object.defineProperty,K=p[" useEffectEvent ".trim().toString()],L=p[" useInsertionEffect ".trim().toString()];function M(a){if("function"==typeof K)return K(a);let b=p.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof L?L(()=>{b.current=a}):E(()=>{b.current=a}),p.useMemo(()=>(...a)=>b.current?.(...a),[])}J(M,"name",{value:"useEffectEvent",configurable:!0});var N=Object.defineProperty,O=(a,b)=>N(a,"name",{value:b,configurable:!0}),P=p[" useInsertionEffect ".trim().toString()]||E;function Q({prop:a,defaultProp:b,onChange:c=O(()=>{},"onChange"),caller:d}){let[e,f,g]=R({defaultProp:b,onChange:c}),h=void 0!==a,i=h?a:e;return[i,p.useCallback(b=>{if(h){let c=S(b)?b(a):b;c!==a&&g.current?.(c)}else f(b)},[h,a,f,g])]}function R({defaultProp:a,onChange:b}){let[c,d]=p.useState(a),e=p.useRef(c),f=p.useRef(b);return P(()=>{f.current=b},[b]),p.useEffect(()=>{e.current!==c&&(f.current?.(c),e.current=c)},[c,e]),[c,d,f]}function S(a){return"function"==typeof a}O(Q,"useControllableState"),O(R,"useUncontrolledState"),O(S,"isFunction");var T=Symbol("RADIX:SYNC_STATE");O(function(a,b,c,d){let{prop:e,defaultProp:f,onChange:g,caller:h}=b,i=void 0!==e,j=M(g),k=[{...c,state:f}];d&&k.push(d);let[l,m]=p.useReducer((b,c)=>{if(c.type===T)return{...b,state:c.state};let d=a(b,c);return i&&!Object.is(d.state,b.state)&&j(d.state),d},...k),n=l.state,o=p.useRef(n);p.useEffect(()=>{o.current!==n&&(o.current=n,i||j(n))},[n,o,i]);let q=p.useMemo(()=>void 0!==e?{...l,state:e}:l,[l,e]);return p.useEffect(()=>{i&&!Object.is(e,l.state)&&m({type:T,state:e})},[e,l.state,i]),[q,m]},"useControllableStateReducer");var U=a.i(935112),V=Object.defineProperty,W=(a,b)=>V(a,"name",{value:b,configurable:!0});function X(a){let b=p.forwardRef((b,c)=>{let{children:d,...e}=b,f=null,g=!1,h=[];ac(d)&&"function"==typeof ag&&(d=ag(d._payload)),p.Children.forEach(d,a=>{if(aa(a)){g=!0;let b="child"in a.props?a.props.child:a.props.children;ac(b)&&"function"==typeof ag&&(b=ag(b._payload)),f=Z(a,b),h.push(f?.props?.children)}else h.push(a)}),f?f=p.cloneElement(f,void 0,h):!g&&1===p.Children.count(d)&&p.isValidElement(d)&&(f=d);let i=f?_(f):void 0,j=z(c,i);if(!f){if(d||0===d)throw Error(g?af(a):ae(a));return d}let k=$(e,f.props??{});return f.type!==p.Fragment&&(k.ref=c?j:i),p.cloneElement(f,k)});return b.displayName=`${a}.Slot`,b}W(X,"createSlot");var Y=Symbol.for("radix.slottable");W(function(a){let b=W(a=>"child"in a?a.children(a.child):a.children,"Slottable");return b.displayName=`${a}.Slottable`,b.__radixId=Y,b},"createSlottable");var Z=W((a,b)=>{if("child"in a.props){let b=a.props.child;return p.isValidElement(b)?p.cloneElement(b,void 0,a.props.children(b.props.children)):null}return p.isValidElement(b)?b:null},"getSlottableElementFromSlottable");function $(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}function _(a){let b=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,c=b&&"isReactWarning"in b&&b.isReactWarning;return c?a.ref:(c=(b=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in b&&b.isReactWarning)?a.props.ref:a.props.ref||a.ref}function aa(a){return p.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===Y}W($,"mergeProps"),W(_,"getElementRef"),W(aa,"isSlottable");var ab=Symbol.for("react.lazy");function ac(a){return null!=a&&"object"==typeof a&&"$$typeof"in a&&a.$$typeof===ab&&"_payload"in a&&ad(a._payload)}function ad(a){return"object"==typeof a&&null!==a&&"then"in a}W(ac,"isLazyComponent"),W(ad,"isPromiseLike");var ae=W(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),af=W(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),ag=p[" use ".trim().toString()],ah=Object.defineProperty,ai=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,b)=>{let c=X(`Primitive.${b}`),d=p.forwardRef((a,d)=>{let{asChild:e,...f}=a;return(0,j.jsx)(e?c:b,{...f,ref:d})});return d.displayName=`Primitive.${b}`,{...a,[b]:d}},{});function aj(a,b){a&&U.flushSync(()=>a.dispatchEvent(b))}function ak(a){let b=p.useRef(a);return p.useEffect(()=>{b.current=a}),p.useMemo(()=>(...a)=>b.current?.(...a),[])}ah(aj,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)(ak,"name",{value:"useCallbackRef",configurable:!0});var al=Object.defineProperty,am=(a,b)=>al(a,"name",{value:b,configurable:!0}),an="dismissableLayer.update",ao=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ap=p.forwardRef(am(function(a,b){let{disableOutsidePointerEvents:c=!1,deferPointerDownOutside:d=!1,onEscapeKeyDown:e,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:i,onDismiss:k,...l}=a,m=p.useContext(ao),[n,o]=p.useState(null),q=n?.ownerDocument??globalThis?.document,[,r]=p.useState({}),t=z(b,o),u=Array.from(m.layers),[v]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),w=v?u.indexOf(v):-1,x=n?u.indexOf(n):-1,y=m.layersWithOutsidePointerEventsDisabled.size>0,A=x>=w,B=p.useRef(!1),C=as(a=>{f?.(a),i?.(a),a.defaultPrevented||k?.()},{ownerDocument:q,deferPointerDownOutside:d,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(a=>{if(!(a instanceof Node))return!1;let b=[...m.branches].some(b=>b.contains(a));return A&&!b},[m.branches,A])}),D=at(a=>{if(d&&B.current)return;let b=a.target;![...m.branches].some(a=>a.contains(b))&&(g?.(a),i?.(a),a.defaultPrevented||k?.())},q),E=!!n&&x===u.length-1,F=ak(a=>{"Escape"===a.key&&(e?.(a),!a.defaultPrevented&&k&&(a.preventDefault(),k()))});return p.useEffect(()=>{if(E)return q.addEventListener("keydown",F,{capture:!0}),()=>q.removeEventListener("keydown",F,{capture:!0})},[q,E,F]),p.useEffect(()=>{if(n)return c&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(h=q.body.style.pointerEvents,q.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(n)),m.layers.add(n),au(),()=>{c&&(m.layersWithOutsidePointerEventsDisabled.delete(n),0===m.layersWithOutsidePointerEventsDisabled.size&&(q.body.style.pointerEvents=h))}},[n,q,c,m]),p.useEffect(()=>()=>{n&&(m.layers.delete(n),m.layersWithOutsidePointerEventsDisabled.delete(n),au())},[n,m]),p.useEffect(()=>{let a=am(()=>r({}),"handleUpdate");return document.addEventListener(an,a),()=>document.removeEventListener(an,a)},[]),(0,j.jsx)(ai.div,{...l,ref:t,style:{pointerEvents:y?A?"auto":"none":void 0,...a.style},onFocusCapture:s(a.onFocusCapture,D.onFocusCapture),onBlurCapture:s(a.onBlurCapture,D.onBlurCapture),onPointerDownCapture:s(a.onPointerDownCapture,C.onPointerDownCapture)})},"DismissableLayer"));function aq(){let a=p.useContext(ao),[b,c]=p.useState(null);return p.useEffect(()=>{if(b)return a.dismissableSurfaces.add(b),()=>{a.dismissableSurfaces.delete(b)}},[b,a.dismissableSurfaces]),c}am(aq,"useDismissableLayerSurface");var ar=am(()=>!0,"IS_TRUE");function as(a,b){let{ownerDocument:c=globalThis?.document,deferPointerDownOutside:d=!1,isDeferredPointerDownOutsideRef:e,dismissableSurfaces:f,shouldHandlePointerDownOutside:g=ar}=b,h=ak(a),i=p.useRef(!1),j=p.useRef(!1),k=p.useRef(new Map),l=p.useRef(()=>{});return p.useEffect(()=>{function a(){j.current=!1,e.current=!1,k.current.clear()}function b(){return Array.from(k.current.values()).some(Boolean)}function m(a){if(!j.current)return;let b=a.target;b instanceof Node&&[...f].some(a=>a.contains(b))||k.current.set(a.type,!0),"click"===a.type&&window.setTimeout(()=>{j.current&&l.current()},0)}function n(a){j.current&&k.current.set(a.type,!1)}am(a,"resetOutsideInteraction"),am(b,"isOutsideInteractionIntercepted"),am(m,"handleInteractionCapture"),am(n,"handleInteractionBubble");let o=am(f=>{if(f.target&&!i.current){let m=function(){c.removeEventListener("click",l.current);let d=b();a(),d||av("dismissableLayer.pointerDownOutside",h,n,{discrete:!0})};if(am(m,"handleAndDispatchPointerDownOutsideEvent"),!g(f.target)){c.removeEventListener("click",l.current),a(),i.current=!1;return}let n={originalEvent:f};j.current=!0,e.current=d&&0===f.button,k.current.clear(),d&&0===f.button?(c.removeEventListener("click",l.current),l.current=m,c.addEventListener("click",l.current,{once:!0})):m()}else c.removeEventListener("click",l.current),a();i.current=!1},"handlePointerDown"),p=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let a of p)c.addEventListener(a,m,!0),c.addEventListener(a,n);let q=window.setTimeout(()=>{c.addEventListener("pointerdown",o)},0);return()=>{for(let a of(window.clearTimeout(q),c.removeEventListener("pointerdown",o),c.removeEventListener("click",l.current),p))c.removeEventListener(a,m,!0),c.removeEventListener(a,n)}},[c,h,d,e,f,g]),{onPointerDownCapture:am(()=>i.current=!0,"onPointerDownCapture")}}function at(a,b=globalThis?.document){let c=ak(a),d=p.useRef(!1);return p.useEffect(()=>{let a=am(a=>{a.target&&!d.current&&av("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})},"handleFocus");return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:am(()=>d.current=!0,"onFocusCapture"),onBlurCapture:am(()=>d.current=!1,"onBlurCapture")}}function au(){let a=new CustomEvent(an);document.dispatchEvent(a)}function av(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});b&&e.addEventListener(a,b,{once:!0}),d?aj(e,f):e.dispatchEvent(f)}am(as,"usePointerDownOutside"),am(at,"useFocusOutside"),am(au,"dispatchUpdate"),am(av,"handleAndDispatchCustomEvent");var aw=Object.defineProperty,ax=(a,b)=>aw(a,"name",{value:b,configurable:!0}),ay="focusScope.autoFocusOnMount",az="focusScope.autoFocusOnUnmount",aA={bubbles:!1,cancelable:!0},aB=p.forwardRef(ax(function(a,b){let{loop:c=!1,trapped:d=!1,onMountAutoFocus:e,onUnmountAutoFocus:f,...g}=a,[h,i]=p.useState(null),k=ak(e),l=ak(f),m=p.useRef(null),n=z(b,i),o=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(d){let a=function(a){if(o.paused||!h)return;let b=a.target;h.contains(b)?m.current=b:aI(m.current,{select:!0})},b=function(a){if(o.paused||!h)return;let b=a.relatedTarget;null!==b&&(h.contains(b)||aI(m.current,{select:!0}))},c=function(a){if(document.activeElement===document.body)for(let b of a)b.removedNodes.length>0&&aI(h)};ax(a,"handleFocusIn"),ax(b,"handleFocusOut"),ax(c,"handleMutations"),document.addEventListener("focusin",a),document.addEventListener("focusout",b);let d=new MutationObserver(c);return h&&d.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",a),document.removeEventListener("focusout",b),d.disconnect()}}},[d,h,o.paused]),p.useEffect(()=>{if(h){aJ.add(o);let a=document.activeElement;if(!h.contains(a)){let b=new CustomEvent(ay,aA);h.addEventListener(ay,k),h.dispatchEvent(b),b.defaultPrevented||(aC(aM(aE(h)),{select:!0}),document.activeElement===a&&aI(h))}return()=>{h.removeEventListener(ay,k),setTimeout(()=>{let b=new CustomEvent(az,aA);h.addEventListener(az,l),h.dispatchEvent(b),b.defaultPrevented||aI(a??document.body,{select:!0}),h.removeEventListener(az,l),aJ.remove(o)},0)}}},[h,k,l,o]);let q=p.useCallback(a=>{if(!c&&!d||o.paused)return;let b="Tab"===a.key&&!a.altKey&&!a.ctrlKey&&!a.metaKey,e=document.activeElement;if(b&&e){let b=a.currentTarget,[d,f]=aD(b);d&&f?a.shiftKey||e!==f?a.shiftKey&&e===d&&(a.preventDefault(),c&&aI(f,{select:!0})):(a.preventDefault(),c&&aI(d,{select:!0})):e===b&&a.preventDefault()}},[c,d,o.paused]);return(0,j.jsx)(ai.div,{tabIndex:-1,...g,ref:n,onKeyDown:q})},"FocusScope"));function aC(a,{select:b=!1}={}){let c=document.activeElement;for(let d of a)if(aI(d,{select:b}),document.activeElement!==c)return}function aD(a){let b=aE(a);return[aF(b,a),aF(b.reverse(),a)]}function aE(a){let b=[],c=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:ax(a=>{let b="INPUT"===a.tagName&&"hidden"===a.type;return a.disabled||a.hidden||b?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;c.nextNode();)b.push(c.currentNode);return b}function aF(a,b){let c="function"==typeof b.checkVisibility&&b.checkVisibility({checkVisibilityCSS:!0});for(let d of a)if(!(c?!d.checkVisibility({checkVisibilityCSS:!0}):aG(d,{upTo:b})))return d}function aG(a,{upTo:b}){if("hidden"===getComputedStyle(a).visibility)return!0;for(;a&&(void 0===b||a!==b);){if("none"===getComputedStyle(a).display)return!0;a=a.parentElement}return!1}function aH(a){return a instanceof HTMLInputElement&&"select"in a}function aI(a,{select:b=!1}={}){if(a&&a.focus){let c=document.activeElement;a.focus({preventScroll:!0}),a!==c&&aH(a)&&b&&a.select()}}ax(aC,"focusFirst"),ax(aD,"getTabbableEdges"),ax(aE,"getTabbableCandidates"),ax(aF,"findVisible"),ax(aG,"isHidden"),ax(aH,"isSelectableInput"),ax(aI,"focus");var aJ=aK();function aK(){let a=[];return{add(b){let c=a[0];b!==c&&c?.pause(),(a=aL(a,b)).unshift(b)},remove(b){a=aL(a,b),a[0]?.resume()}}}function aL(a,b){let c=[...a],d=c.indexOf(b);return -1!==d&&c.splice(d,1),c}function aM(a){return a.filter(a=>"A"!==a.tagName)}ax(aK,"createFocusScopesStack"),ax(aL,"arrayRemove"),ax(aM,"removeLinks");var aN=Object.defineProperty,aO=p.forwardRef(aN(function(a,b){let{container:c,...d}=a,[e,f]=p.useState(!1);E(()=>f(!0),[]);let g=c||e&&globalThis?.document?.body;return g?U.createPortal((0,j.jsx)(ai.div,{...d,ref:b}),g):null},"name",{value:"Portal",configurable:!0})),aP=Object.defineProperty,aQ=(a,b)=>aP(a,"name",{value:b,configurable:!0});function aR(a,b){return p.useReducer((a,c)=>b[a][c]??a,a)}aQ(aR,"useStateMachine");var aS=aQ(a=>{let{present:b,children:c}=a,d=aT(b),e="function"==typeof c?c({present:d.isPresent}):p.Children.only(c),f=aV(d.ref,aX(e));return"function"==typeof c||d.isPresent?p.cloneElement(e,{ref:f}):null},"Presence");function aT(a){let[b,c]=p.useState(),d=p.useRef(null),e=p.useRef(a),f=p.useRef("none"),g=p.useRef(void 0),[h,i]=aR(a?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{"mounted"===h?(f.current=g.current??aW(d.current),g.current=void 0):f.current="none"},[h]),E(()=>{let b=d.current,c=e.current;if(c!==a){let d=f.current,h=aW(b);a?(g.current=h,i("MOUNT")):"none"===h||b?.display==="none"?i("UNMOUNT"):c&&d!==h?i("ANIMATION_OUT"):i("UNMOUNT"),e.current=a}},[a,i]),E(()=>{if(b){let a,c=b.ownerDocument.defaultView??window,g=aQ(f=>{let g=aW(d.current).includes(CSS.escape(f.animationName));if(f.target===b&&g&&(i("ANIMATION_END"),!e.current)){let d=b.style.animationFillMode;b.style.animationFillMode="forwards",a=c.setTimeout(()=>{"forwards"===b.style.animationFillMode&&(b.style.animationFillMode=d)})}},"handleAnimationEnd"),h=aQ(a=>{a.target===b&&(f.current=aW(d.current))},"handleAnimationStart");return b.addEventListener("animationstart",h),b.addEventListener("animationcancel",g),b.addEventListener("animationend",g),()=>{c.clearTimeout(a),b.removeEventListener("animationstart",h),b.removeEventListener("animationcancel",g),b.removeEventListener("animationend",g)}}i("ANIMATION_END")},[b,i]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:p.useCallback(a=>{if(a){let b=getComputedStyle(a);d.current=b,g.current=aW(b)}else d.current=null;c(a)},[])}}function aU(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}function aV(...a){let b=p.useRef(a);return b.current=a,p.useCallback(a=>{let c=b.current,d=!1,e=c.map(b=>{let c=aU(b,a);return d||"function"!=typeof c||(d=!0),c});if(d)return()=>{for(let a=0;a<e.length;a++){let b=e[a];"function"==typeof b?b():aU(c[a],null)}}},[])}function aW(a){return a?.animationName||"none"}function aX(a){let b=Object.getOwnPropertyDescriptor(a.props,"ref")?.get,c=b&&"isReactWarning"in b&&b.isReactWarning;return c?a.ref:(c=(b=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in b&&b.isReactWarning)?a.props.ref:a.props.ref||a.ref}aQ(aT,"usePresence"),aQ(aU,"setRef"),aQ(aV,"useStableComposedRefs"),aQ(aW,"getAnimationName"),aQ(aX,"getElementRef");var aY=Object.defineProperty,aZ=(a,b)=>aY(a,"name",{value:b,configurable:!0}),a$=0,a_=null;function a0(){p.useEffect(()=>{a_||(a_={start:a1(),end:a1()});let{start:a,end:b}=a_;return document.body.firstElementChild!==a&&document.body.insertAdjacentElement("afterbegin",a),document.body.lastElementChild!==b&&document.body.insertAdjacentElement("beforeend",b),a$++,()=>{1===a$&&(a_?.start.remove(),a_?.end.remove(),a_=null),a$=Math.max(0,a$-1)}},[])}function a1(){let a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}aZ(function(a){return a0(),a.children},"FocusGuards"),aZ(a0,"useFocusGuards"),aZ(a1,"createFocusGuard");var a2=function(){return(a2=Object.assign||function(a){for(var b,c=1,d=arguments.length;c<d;c++)for(var e in b=arguments[c])Object.prototype.hasOwnProperty.call(b,e)&&(a[e]=b[e]);return a}).apply(this,arguments)};function a3(a,b){var c={};for(var d in a)Object.prototype.hasOwnProperty.call(a,d)&&0>b.indexOf(d)&&(c[d]=a[d]);if(null!=a&&"function"==typeof Object.getOwnPropertySymbols)for(var e=0,d=Object.getOwnPropertySymbols(a);e<d.length;e++)0>b.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(a,d[e])&&(c[d[e]]=a[d[e]]);return c}var a4=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),a5="width-before-scroll-bar";function a6(a,b){return"function"==typeof a?a(b):a&&(a.current=b),a}var a7=p.useEffect,a8=new WeakMap,a9=(void 0===b&&(b={}),(void 0===c&&(c=function(a){return a}),d=[],e=!1,f={read:function(){if(e)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return d.length?d[d.length-1]:null},useMedium:function(a){var b=c(a,e);return d.push(b),function(){d=d.filter(function(a){return a!==b})}},assignSyncMedium:function(a){for(e=!0;d.length;){var b=d;d=[],b.forEach(a)}d={push:function(b){return a(b)},filter:function(){return d}}},assignMedium:function(a){e=!0;var b=[];if(d.length){var c=d;d=[],c.forEach(a),b=d}var f=function(){var c=b;b=[],c.forEach(a)},g=function(){return Promise.resolve().then(f)};g(),d={push:function(a){b.push(a),g()},filter:function(a){return b=b.filter(a),d}}}}).options=a2({async:!0,ssr:!1},b),f),ba=function(){},bb=p.forwardRef(function(a,b){var c,d,e,f,g=p.useRef(null),h=p.useState({onScrollCapture:ba,onWheelCapture:ba,onTouchMoveCapture:ba}),i=h[0],j=h[1],k=a.forwardProps,l=a.children,m=a.className,n=a.removeScrollBar,o=a.enabled,q=a.shards,r=a.sideCar,s=a.noRelative,t=a.noIsolation,u=a.inert,v=a.allowPinchZoom,w=a.as,x=a.gapMode,y=a3(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=(c=[g,b],d=function(a){return c.forEach(function(b){return a6(b,a)})},(e=(0,p.useState)(function(){return{value:null,callback:d,facade:{get current(){return e.value},set current(value){var a=e.value;a!==value&&(e.value=value,e.callback(value,a))}}}})[0]).callback=d,f=e.facade,a7(function(){var a=a8.get(f);if(a){var b=new Set(a),d=new Set(c),e=f.current;b.forEach(function(a){d.has(a)||a6(a,null)}),d.forEach(function(a){b.has(a)||a6(a,e)})}a8.set(f,c)},[c]),f),A=a2(a2({},y),i);return p.createElement(p.Fragment,null,o&&p.createElement(r,{sideCar:a9,removeScrollBar:n,shards:q,noRelative:s,noIsolation:t,inert:u,setCallbacks:j,allowPinchZoom:!!v,lockRef:g,gapMode:x}),k?p.cloneElement(p.Children.only(l),a2(a2({},A),{ref:z})):p.createElement(void 0===w?"div":w,a2({},A,{className:m,ref:z}),l))});bb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},bb.classNames={fullWidth:a5,zeroRight:a4};var bc=function(a){var b=a.sideCar,c=a3(a,["sideCar"]);if(!b)throw Error("Sidecar: please provide `sideCar` property to import the right car");var d=b.read();if(!d)throw Error("Sidecar medium not found");return p.createElement(d,a2({},c))};bc.isSideCarExport=!0;var bd=function(){var a=0,b=null;return{add:function(c){if(0==a&&(b=function(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var b=i||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return b&&a.setAttribute("nonce",b),a}())){var d,e;(d=b).styleSheet?d.styleSheet.cssText=c:d.appendChild(document.createTextNode(c)),e=b,(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}a++},remove:function(){--a||!b||(b.parentNode&&b.parentNode.removeChild(b),b=null)}}},be=function(){var a=bd();return function(b,c){p.useEffect(function(){return a.add(b),function(){a.remove()}},[b&&c])}},bf=function(){var a=be();return function(b){return a(b.styles,b.dynamic),null}},bg={left:0,top:0,right:0,gap:0},bh=bf(),bi="data-scroll-locked",bj=function(a,b,c,d){var e=a.left,f=a.top,g=a.right,h=a.gap;return void 0===c&&(c="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(d,";\n padding-right: ").concat(h,"px ").concat(d,";\n }\n body[").concat(bi,"] {\n overflow: hidden ").concat(d,";\n overscroll-behavior: contain;\n ").concat([b&&"position: relative ".concat(d,";"),"margin"===c&&"\n padding-left: ".concat(e,"px;\n padding-top: ").concat(f,"px;\n padding-right: ").concat(g,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(h,"px ").concat(d,";\n "),"padding"===c&&"padding-right: ".concat(h,"px ").concat(d,";")].filter(Boolean).join(""),"\n }\n \n .").concat(a4," {\n right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(a5," {\n margin-right: ").concat(h,"px ").concat(d,";\n }\n \n .").concat(a4," .").concat(a4," {\n right: 0 ").concat(d,";\n }\n \n .").concat(a5," .").concat(a5," {\n margin-right: 0 ").concat(d,";\n }\n \n body[").concat(bi,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(h,"px;\n }\n")},bk=function(){var a=parseInt(document.body.getAttribute(bi)||"0",10);return isFinite(a)?a:0},bl=function(){p.useEffect(function(){return document.body.setAttribute(bi,(bk()+1).toString()),function(){var a=bk()-1;a<=0?document.body.removeAttribute(bi):document.body.setAttribute(bi,a.toString())}},[])},bm=function(a){var b=a.noRelative,c=a.noImportant,d=a.gapMode,e=void 0===d?"margin":d;bl();var f=p.useMemo(function(){return void 0===e,bg},[e]);return p.createElement(bh,{styles:bj(f,!b,e,c?"":"!important")})},bn=function(a,b){if(!(a instanceof Element))return!1;var c=window.getComputedStyle(a);return"hidden"!==c[b]&&(c.overflowY!==c.overflowX||"TEXTAREA"===a.tagName||"visible"!==c[b])},bo=function(a,b){var c=b.ownerDocument,d=b;do{if("u">typeof ShadowRoot&&d instanceof ShadowRoot&&(d=d.host),bp(a,d)){var e=bq(a,d);if(e[1]>e[2])return!0}d=d.parentNode}while(d&&d!==c.body)return!1},bp=function(a,b){return"v"===a?bn(b,"overflowY"):bn(b,"overflowX")},bq=function(a,b){return"v"===a?[b.scrollTop,b.scrollHeight,b.clientHeight]:[b.scrollLeft,b.scrollWidth,b.clientWidth]},br=function(a,b,c,d,e){var f,g=(f=window.getComputedStyle(b).direction,"h"===a&&"rtl"===f?-1:1),h=g*d,i=c.target,j=b.contains(i),k=!1,l=h>0,m=0,n=0;do{if(!i)break;var o=bq(a,i),p=o[0],q=o[1]-o[2]-g*p;(p||q)&&bp(a,i)&&(m+=q,n+=p);var r=i.parentNode;i=r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE?r.host:r}while(!j&&i!==document.body||j&&(b.contains(i)||b===i))return l&&(e&&1>Math.abs(m)||!e&&h>m)?k=!0:!l&&(e&&1>Math.abs(n)||!e&&-h>n)&&(k=!0),k},bs=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},bt=function(a){return[a.deltaX,a.deltaY]},bu=function(a){return a&&"current"in a?a.current:a},bv=0,bw=[];let bx=(g=function(a){var b=p.useRef([]),c=p.useRef([0,0]),d=p.useRef(),e=p.useState(bv++)[0],f=p.useState(bf)[0],g=p.useRef(a);p.useEffect(function(){g.current=a},[a]),p.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(e));var b=(function(a,b,c){if(c||2==arguments.length)for(var d,e=0,f=b.length;e<f;e++)!d&&e in b||(d||(d=Array.prototype.slice.call(b,0,e)),d[e]=b[e]);return a.concat(d||Array.prototype.slice.call(b))})([a.lockRef.current],(a.shards||[]).map(bu),!0).filter(Boolean);return b.forEach(function(a){return a.classList.add("allow-interactivity-".concat(e))}),function(){document.body.classList.remove("block-interactivity-".concat(e)),b.forEach(function(a){return a.classList.remove("allow-interactivity-".concat(e))})}}},[a.inert,a.lockRef.current,a.shards]);var h=p.useCallback(function(a,b){if("touches"in a&&2===a.touches.length||"wheel"===a.type&&a.ctrlKey)return!g.current.allowPinchZoom;var e,f=bs(a),h=c.current,i="deltaX"in a?a.deltaX:h[0]-f[0],j="deltaY"in a?a.deltaY:h[1]-f[1],k=a.target,l=Math.abs(i)>Math.abs(j)?"h":"v";if("touches"in a&&"h"===l&&"range"===k.type)return!1;var m=window.getSelection(),n=m&&m.anchorNode;if(n&&(n===k||n.contains(k)))return!1;var o=bo(l,k);if(!o)return!0;if(o?e=l:(e="v"===l?"h":"v",o=bo(l,k)),!o)return!1;if(!d.current&&"changedTouches"in a&&(i||j)&&(d.current=e),!e)return!0;var p=d.current||e;return br(p,b,a,"h"===p?i:j,!0)},[]),i=p.useCallback(function(a){if(bw.length&&bw[bw.length-1]===f){var c="deltaY"in a?bt(a):bs(a),d=b.current.filter(function(b){var d;return b.name===a.type&&(b.target===a.target||a.target===b.shadowParent)&&(d=b.delta,d[0]===c[0]&&d[1]===c[1])})[0];if(d&&d.should){a.cancelable&&a.preventDefault();return}if(!d){var e=(g.current.shards||[]).map(bu).filter(Boolean).filter(function(b){return b.contains(a.target)});(e.length>0?h(a,e[0]):!g.current.noIsolation)&&a.cancelable&&a.preventDefault()}}},[]),j=p.useCallback(function(a,c,d,e){var f={name:a,delta:c,target:d,should:e,shadowParent:function(a){for(var b=null;null!==a;)a instanceof ShadowRoot&&(b=a.host,a=a.host),a=a.parentNode;return b}(d)};b.current.push(f),setTimeout(function(){b.current=b.current.filter(function(a){return a!==f})},1)},[]),k=p.useCallback(function(a){c.current=bs(a),d.current=void 0},[]),l=p.useCallback(function(b){j(b.type,bt(b),b.target,h(b,a.lockRef.current))},[]),m=p.useCallback(function(b){j(b.type,bs(b),b.target,h(b,a.lockRef.current))},[]);p.useEffect(function(){return bw.push(f),a.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:m}),document.addEventListener("wheel",i,!1),document.addEventListener("touchmove",i,!1),document.addEventListener("touchstart",k,!1),function(){bw=bw.filter(function(a){return a!==f}),document.removeEventListener("wheel",i,!1),document.removeEventListener("touchmove",i,!1),document.removeEventListener("touchstart",k,!1)}},[]);var n=a.removeScrollBar,o=a.inert;return p.createElement(p.Fragment,null,o?p.createElement(f,{styles:"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")}):null,n?p.createElement(bm,{noRelative:a.noRelative,gapMode:a.gapMode}):null)},a9.useMedium(g),bc);var by=p.forwardRef(function(a,b){return p.createElement(bb,a2({},a,{ref:b,sideCar:bx}))});by.classNames=bb.classNames;var bz=new WeakMap,bA=new WeakMap,bB={},bC=0,bD=function(a){return a&&(a.host||bD(a.parentNode))},bE=function(a,b,c,d){var e=(Array.isArray(a)?a:[a]).map(function(a){if(b.contains(a))return a;var c=bD(a);return c&&b.contains(c)?c:(console.error("aria-hidden",a,"in not contained inside",b,". Doing nothing"),null)}).filter(function(a){return!!a});bB[c]||(bB[c]=new WeakMap);var f=bB[c],g=[],h=new Set,i=new Set(e),j=function(a){!a||h.has(a)||(h.add(a),j(a.parentNode))};e.forEach(j);var k=function(a){!a||i.has(a)||Array.prototype.forEach.call(a.children,function(a){if(h.has(a))k(a);else try{var b=a.getAttribute(d),e=null!==b&&"false"!==b,i=(bz.get(a)||0)+1,j=(f.get(a)||0)+1;bz.set(a,i),f.set(a,j),g.push(a),1===i&&e&&bA.set(a,!0),1===j&&a.setAttribute(c,"true"),e||a.setAttribute(d,"true")}catch(b){console.error("aria-hidden: cannot operate on ",a,b)}})};return k(b),h.clear(),bC++,function(){g.forEach(function(a){var b=bz.get(a)-1,e=f.get(a)-1;bz.set(a,b),f.set(a,e),b||(bA.has(a)||a.removeAttribute(d),bA.delete(a)),e||a.removeAttribute(c)}),--bC||(bz=new WeakMap,bz=new WeakMap,bA=new WeakMap,bB={})}},bF=function(a,b,c){void 0===c&&(c="data-aria-hidden");var d=Array.from(Array.isArray(a)?a:[a]),e=b||("u"<typeof document?null:(Array.isArray(a)?a[0]:a).ownerDocument.body);return e?(d.push.apply(d,Array.from(e.querySelectorAll("[aria-live], script"))),bE(d,e,c,"aria-hidden")):function(){return null}},bG=Object.defineProperty,bH=(a,b)=>bG(a,"name",{value:b,configurable:!0}),bI="Dialog",[bJ,bK]=C(bI),[bL,bM]=bJ(bI),bN=bH(a=>{let{__scopeDialog:b,children:c,open:d,defaultOpen:e,onOpenChange:f,modal:g=!0}=a,h=p.useRef(null),i=p.useRef(null),[k,l]=Q({prop:d,defaultProp:e??!1,onChange:f,caller:bI}),[m,n]=p.useState(0),[o,q]=p.useState(0);return(0,j.jsx)(bL,{scope:b,triggerRef:h,contentRef:i,contentId:I(),titleId:I(),descriptionId:I(),titlePresent:m>0,descriptionPresent:o>0,setTitleCount:n,setDescriptionCount:q,open:k,onOpenChange:l,onOpenToggle:p.useCallback(()=>l(a=>!a),[l]),modal:g,children:c})},"Dialog"),bO="DialogPortal",[bP,bQ]=bJ(bO,{forceMount:void 0}),bR=bH(a=>{let{__scopeDialog:b,forceMount:c,children:d,container:e}=a,f=bM(bO,b);return(0,j.jsx)(bP,{scope:b,forceMount:c,children:p.Children.map(d,a=>(0,j.jsx)(aS,{present:c||f.open,children:(0,j.jsx)(aO,{asChild:!0,container:e,children:a})}))})},"DialogPortal"),bS="DialogOverlay",bT=p.forwardRef(bH(function(a,b){let c=bQ(bS,a.__scopeDialog),{forceMount:d=c.forceMount,...e}=a,f=bM(bS,a.__scopeDialog);return f.modal?(0,j.jsx)(aS,{present:d||f.open,children:(0,j.jsx)(bV,{...e,ref:b})}):null},"DialogOverlay")),bU=X("DialogOverlay.RemoveScroll"),bV=p.forwardRef(bH(function(a,b){let{__scopeDialog:c,...d}=a,e=bM(bS,c),f=z(b,aq());return(0,j.jsx)(by,{as:bU,allowPinchZoom:!0,shards:[e.contentRef],children:(0,j.jsx)(ai.div,{"data-state":b_(e.open),...d,ref:f,style:{pointerEvents:"auto",...d.style}})})},"DialogOverlayImpl")),bW="DialogContent",bX=p.forwardRef(bH(function(a,b){let c=bQ(bW,a.__scopeDialog),{forceMount:d=c.forceMount,...e}=a,f=bM(bW,a.__scopeDialog);return(0,j.jsx)(aS,{present:d||f.open,children:f.modal?(0,j.jsx)(bY,{...e,ref:b}):(0,j.jsx)(bZ,{...e,ref:b})})},"DialogContent")),bY=p.forwardRef(bH(function(a,b){let c=bM(bW,a.__scopeDialog),d=p.useRef(null),e=z(b,c.contentRef,d);return p.useEffect(()=>{let a=d.current;if(a)return bF(a)},[]),(0,j.jsx)(b$,{...a,ref:e,trapFocus:c.open,disableOutsidePointerEvents:c.open,onCloseAutoFocus:s(a.onCloseAutoFocus,a=>{a.preventDefault(),c.triggerRef.current?.focus()}),onPointerDownOutside:s(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;(2===b.button||c)&&a.preventDefault()}),onFocusOutside:s(a.onFocusOutside,a=>a.preventDefault())})},"DialogContentModal")),bZ=p.forwardRef(bH(function(a,b){let c=bM(bW,a.__scopeDialog),d=p.useRef(!1),e=p.useRef(!1);return(0,j.jsx)(b$,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(d.current||c.triggerRef.current?.focus(),b.preventDefault()),d.current=!1,e.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(d.current=!0,"pointerdown"===b.detail.originalEvent.type&&(e.current=!0));let f=b.target;c.triggerRef.current?.contains(f)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&e.current&&b.preventDefault()}})},"DialogContentNonModal")),b$=p.forwardRef(bH(function(a,b){let{__scopeDialog:c,trapFocus:d,onOpenAutoFocus:e,onCloseAutoFocus:f,...g}=a,h=bM(bW,c);return a0(),(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(aB,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:e,onUnmountAutoFocus:f,children:(0,j.jsx)(ap,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionPresent?h.descriptionId:void 0,"aria-labelledby":h.titlePresent?h.titleId:void 0,"data-state":b_(h.open),...g,ref:b,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})},"DialogContentImpl"));function b_(a){return a?"open":"closed"}bH(b_,"getState");var b0='[cmdk-group=""]',b1='[cmdk-group-items=""]',b2='[cmdk-item=""]',b3=`${b2}:not([aria-disabled="true"])`,b4="cmdk-item-select",b5="data-value",b6=(a,b,c)=>{var d;return d=a,function a(b,c,d,e,f,g,h){if(g===c.length)return f===b.length?1:.99;var i=`${f},${g}`;if(void 0!==h[i])return h[i];for(var j,o,p,q,r=e.charAt(g),s=d.indexOf(r,f),t=0;s>=0;)(j=a(b,c,d,e,s+1,g+1,h))>t&&(s===f?j*=1:k.test(b.charAt(s-1))?(j*=.8,(p=b.slice(f,s-1).match(l))&&f>0&&(j*=Math.pow(.999,p.length))):m.test(b.charAt(s-1))?(j*=.9,(q=b.slice(f,s-1).match(n))&&f>0&&(j*=Math.pow(.999,q.length))):(j*=.17,f>0&&(j*=Math.pow(.999,s-f))),b.charAt(s)!==c.charAt(g)&&(j*=.9999)),(j<.1&&d.charAt(s-1)===e.charAt(g+1)||e.charAt(g+1)===e.charAt(g)&&d.charAt(s-1)!==e.charAt(g))&&.1*(o=a(b,c,d,e,s+1,g+2,h))>j&&(j=.1*o),j>t&&(t=j),s=d.indexOf(r,s+1);return h[i]=t,t}(d=c&&c.length>0?`${d+" "+c.join(" ")}`:d,b,o(d),o(b),0,0,{})},b7=p.createContext(void 0),b8=p.createContext(void 0),b9=p.createContext(void 0),ca=p.forwardRef((a,b)=>{let c=ck(()=>{var b,c;return{search:"",value:null!=(c=null!=(b=a.value)?b:a.defaultValue)?c:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),d=ck(()=>new Set),e=ck(()=>new Map),f=ck(()=>new Map),g=ck(()=>new Set),h=ci(a),{label:i,children:j,value:k,onValueChange:l,filter:m,shouldFilter:n,loop:o,disablePointerSelection:q=!1,vimBindings:r=!0,...s}=a,t=I(),u=I(),v=I(),w=p.useRef(null),x=cn();cj(()=>{if(void 0!==k){let a=k.trim();c.current.value=a,y.emit()}},[k]),cj(()=>{x(6,E)},[]);let y=p.useMemo(()=>({subscribe:a=>(g.current.add(a),()=>g.current.delete(a)),snapshot:()=>c.current,setState:(a,b,d)=>{var e,f,g,i;if(!Object.is(c.current[a],b)){if(c.current[a]=b,"search"===a)D(),B(),x(1,C);else if("value"===a){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let a=document.getElementById(v);a?a.focus():null==(e=document.getElementById(t))||e.focus()}if(x(7,()=>{var a;c.current.selectedItemId=null==(a=F())?void 0:a.id,y.emit()}),d||x(5,E),(null==(f=h.current)?void 0:f.value)!==void 0){null==(i=(g=h.current).onValueChange)||i.call(g,null!=b?b:"");return}}y.emit()}},emit:()=>{g.current.forEach(a=>a())}}),[]),z=p.useMemo(()=>({value:(a,b,d)=>{var e;b!==(null==(e=f.current.get(a))?void 0:e.value)&&(f.current.set(a,{value:b,keywords:d}),c.current.filtered.items.set(a,A(b,d)),x(2,()=>{B(),y.emit()}))},item:(a,b)=>(d.current.add(a),b&&(e.current.has(b)?e.current.get(b).add(a):e.current.set(b,new Set([a]))),x(3,()=>{D(),B(),c.current.value||C(),y.emit()}),()=>{f.current.delete(a),d.current.delete(a),c.current.filtered.items.delete(a);let b=F();x(4,()=>{D(),(null==b?void 0:b.getAttribute("id"))===a&&C(),y.emit()})}),group:a=>(e.current.has(a)||e.current.set(a,new Set),()=>{f.current.delete(a),e.current.delete(a)}),filter:()=>h.current.shouldFilter,label:i||a["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:t,inputId:v,labelId:u,listInnerRef:w}),[]);function A(a,b){var d,e;let f=null!=(e=null==(d=h.current)?void 0:d.filter)?e:b6;return a?f(a,c.current.search,b):0}function B(){if(!c.current.search||!1===h.current.shouldFilter)return;let a=c.current.filtered.items,b=[];c.current.filtered.groups.forEach(c=>{let d=e.current.get(c),f=0;d.forEach(b=>{f=Math.max(a.get(b),f)}),b.push([c,f])});let d=w.current;G().sort((b,c)=>{var d,e;let f=b.getAttribute("id"),g=c.getAttribute("id");return(null!=(d=a.get(g))?d:0)-(null!=(e=a.get(f))?e:0)}).forEach(a=>{let b=a.closest(b1);b?b.appendChild(a.parentElement===b?a:a.closest(`${b1} > *`)):d.appendChild(a.parentElement===d?a:a.closest(`${b1} > *`))}),b.sort((a,b)=>b[1]-a[1]).forEach(a=>{var b;let c=null==(b=w.current)?void 0:b.querySelector(`${b0}[${b5}="${encodeURIComponent(a[0])}"]`);null==c||c.parentElement.appendChild(c)})}function C(){let a=G().find(a=>"true"!==a.getAttribute("aria-disabled")),b=null==a?void 0:a.getAttribute(b5);y.setState("value",b||void 0)}function D(){var a,b,g,i;if(!c.current.search||!1===h.current.shouldFilter){c.current.filtered.count=d.current.size;return}c.current.filtered.groups=new Set;let j=0;for(let e of d.current){let d=A(null!=(b=null==(a=f.current.get(e))?void 0:a.value)?b:"",null!=(i=null==(g=f.current.get(e))?void 0:g.keywords)?i:[]);c.current.filtered.items.set(e,d),d>0&&j++}for(let[a,b]of e.current)for(let d of b)if(c.current.filtered.items.get(d)>0){c.current.filtered.groups.add(a);break}c.current.filtered.count=j}function E(){var a,b,c;let d=F();d&&((null==(a=d.parentElement)?void 0:a.firstChild)===d&&(null==(c=null==(b=d.closest(b0))?void 0:b.querySelector('[cmdk-group-heading=""]'))||c.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function F(){var a;return null==(a=w.current)?void 0:a.querySelector(`${b2}[aria-selected="true"]`)}function G(){var a;return Array.from((null==(a=w.current)?void 0:a.querySelectorAll(b3))||[])}function H(a){let b=G()[a];b&&y.setState("value",b.getAttribute(b5))}function J(a){var b;let c=F(),d=G(),e=d.findIndex(a=>a===c),f=d[e+a];null!=(b=h.current)&&b.loop&&(f=e+a<0?d[d.length-1]:e+a===d.length?d[0]:d[e+a]),f&&y.setState("value",f.getAttribute(b5))}function K(a){let b=F(),c=null==b?void 0:b.closest(b0),d;for(;c&&!d;)d=null==(c=a>0?function(a,b){let c=a.nextElementSibling;for(;c;){if(c.matches(b))return c;c=c.nextElementSibling}}(c,b0):function(a,b){let c=a.previousElementSibling;for(;c;){if(c.matches(b))return c;c=c.previousElementSibling}}(c,b0))?void 0:c.querySelector(b3);d?y.setState("value",d.getAttribute(b5)):J(a)}let L=()=>H(G().length-1),M=a=>{a.preventDefault(),a.metaKey?L():a.altKey?K(1):J(1)},N=a=>{a.preventDefault(),a.metaKey?H(0):a.altKey?K(-1):J(-1)};return p.createElement(ai.div,{ref:b,tabIndex:-1,...s,"cmdk-root":"",onKeyDown:a=>{var b;null==(b=s.onKeyDown)||b.call(s,a);let c=a.nativeEvent.isComposing||229===a.keyCode;if(!(a.defaultPrevented||c))switch(a.key){case"n":case"j":r&&a.ctrlKey&&M(a);break;case"ArrowDown":M(a);break;case"p":case"k":r&&a.ctrlKey&&N(a);break;case"ArrowUp":N(a);break;case"Home":a.preventDefault(),H(0);break;case"End":a.preventDefault(),L();break;case"Enter":{a.preventDefault();let b=F();if(b){let a=new Event(b4);b.dispatchEvent(a)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:cp},i),co(a,a=>p.createElement(b8.Provider,{value:y},p.createElement(b7.Provider,{value:z},a))))}),cb=p.forwardRef((a,b)=>{var c,d;let e=I(),f=p.useRef(null),g=p.useContext(b9),h=p.useContext(b7),i=ci(a),j=null!=(d=null==(c=i.current)?void 0:c.forceMount)?d:null==g?void 0:g.forceMount;cj(()=>{if(!j)return h.item(e,null==g?void 0:g.id)},[j]);let k=cm(e,f,[a.value,a.children,f],a.keywords),l=p.useContext(b8),m=cl(a=>a.value&&a.value===k.current),n=cl(a=>!!j||!1===h.filter()||!a.search||a.filtered.items.get(e)>0);function o(){var a,b;q(),null==(b=(a=i.current).onSelect)||b.call(a,k.current)}function q(){l.setState("value",k.current,!0)}if(p.useEffect(()=>{let b=f.current;if(!(!b||a.disabled))return b.addEventListener(b4,o),()=>b.removeEventListener(b4,o)},[n,a.onSelect,a.disabled]),!n)return null;let{disabled:r,value:s,onSelect:t,forceMount:u,keywords:v,...w}=a;return p.createElement(ai.div,{ref:y(f,b),...w,id:e,"cmdk-item":"",role:"option","aria-disabled":!!r,"aria-selected":!!m,"data-disabled":!!r,"data-selected":!!m,onPointerMove:r||h.getDisablePointerSelection()?void 0:q,onClick:r?void 0:o},a.children)}),cc=p.forwardRef((a,b)=>{let{heading:c,children:d,forceMount:e,...f}=a,g=I(),h=p.useRef(null),i=p.useRef(null),j=I(),k=p.useContext(b7),l=cl(a=>!!e||!1===k.filter()||!a.search||a.filtered.groups.has(g));cj(()=>k.group(g),[]),cm(g,h,[a.value,a.heading,i]);let m=p.useMemo(()=>({id:g,forceMount:e}),[e]);return p.createElement(ai.div,{ref:y(h,b),...f,"cmdk-group":"",role:"presentation",hidden:!l||void 0},c&&p.createElement("div",{ref:i,"cmdk-group-heading":"","aria-hidden":!0,id:j},c),co(a,a=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":c?j:void 0},p.createElement(b9.Provider,{value:m},a))))}),cd=p.forwardRef((a,b)=>{let{alwaysRender:c,...d}=a,e=p.useRef(null),f=cl(a=>!a.search);return c||f?p.createElement(ai.div,{ref:y(e,b),...d,"cmdk-separator":"",role:"separator"}):null}),ce=p.forwardRef((a,b)=>{let{onValueChange:c,...d}=a,e=null!=a.value,f=p.useContext(b8),g=cl(a=>a.search),h=cl(a=>a.selectedItemId),i=p.useContext(b7);return p.useEffect(()=>{null!=a.value&&f.setState("search",a.value)},[a.value]),p.createElement(ai.input,{ref:b,...d,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":i.listId,"aria-labelledby":i.labelId,"aria-activedescendant":h,id:i.inputId,type:"text",value:e?a.value:g,onChange:a=>{e||f.setState("search",a.target.value),null==c||c(a.target.value)}})}),cf=p.forwardRef((a,b)=>{let{children:c,label:d="Suggestions",...e}=a,f=p.useRef(null),g=p.useRef(null),h=cl(a=>a.selectedItemId),i=p.useContext(b7);return p.useEffect(()=>{if(g.current&&f.current){let a=g.current,b=f.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let c=a.offsetHeight;b.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),p.createElement(ai.div,{ref:y(f,b),...e,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":d,id:i.listId},co(a,a=>p.createElement("div",{ref:y(g,i.listInnerRef),"cmdk-list-sizer":""},a)))}),cg=p.forwardRef((a,b)=>{let{open:c,onOpenChange:d,overlayClassName:e,contentClassName:f,container:g,...h}=a;return p.createElement(bN,{open:c,onOpenChange:d},p.createElement(bR,{container:g},p.createElement(bT,{"cmdk-overlay":"",className:e}),p.createElement(bX,{"aria-label":a.label,"cmdk-dialog":"",className:f},p.createElement(ca,{ref:b,...h}))))}),ch=Object.assign(ca,{List:cf,Item:cb,Input:ce,Group:cc,Separator:cd,Dialog:cg,Empty:p.forwardRef((a,b)=>cl(a=>0===a.filtered.count)?p.createElement(ai.div,{ref:b,...a,"cmdk-empty":"",role:"presentation"}):null),Loading:p.forwardRef((a,b)=>{let{progress:c,children:d,label:e="Loading...",...f}=a;return p.createElement(ai.div,{ref:b,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":e},co(a,a=>p.createElement("div",{"aria-hidden":!0},a)))})});function ci(a){let b=p.useRef(a);return cj(()=>{b.current=a}),b}var cj=p.useEffect;function ck(a){let b=p.useRef();return void 0===b.current&&(b.current=a()),b}function cl(a){let b=p.useContext(b8),c=()=>a(b.snapshot());return p.useSyncExternalStore(b.subscribe,c,c)}function cm(a,b,c,d=[]){let e=p.useRef(),f=p.useContext(b7);return cj(()=>{var g;let h=(()=>{var a;for(let b of c){if("string"==typeof b)return b.trim();if("object"==typeof b&&"current"in b)return b.current?null==(a=b.current.textContent)?void 0:a.trim():e.current}})(),i=d.map(a=>a.trim());f.value(a,h,i),null==(g=b.current)||g.setAttribute(b5,h),e.current=h}),e}var cn=()=>{let[a,b]=p.useState(),c=ck(()=>new Map);return cj(()=>{c.current.forEach(a=>a()),c.current=new Map},[a]),(a,d)=>{c.current.set(a,d),b({})}};function co({asChild:a,children:b},c){let d;return a&&p.isValidElement(b)?p.cloneElement("function"==typeof(d=b.type)?d(b.props):"render"in d?d.render(b.props):b,{ref:b.ref},c(b.props.children)):c(b)}var cp={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},cq=a.i(763802),cr=a.i(645766),cr=cr;a.i(965733);var cs=a.i(262276),ct=a.i(497895);a.s(["Command",0,function({className:a,...b}){return(0,j.jsx)(ch,{"data-slot":"command",className:(0,ct.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",a),...b})},"CommandEmpty",0,function({className:a,...b}){return(0,j.jsx)(ch.Empty,{"data-slot":"command-empty",className:(0,ct.cn)("py-6 text-center text-sm",a),...b})},"CommandGroup",0,function({className:a,...b}){return(0,j.jsx)(ch.Group,{"data-slot":"command-group",className:(0,ct.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",a),...b})},"CommandInput",0,function({className:a,...b}){return(0,j.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,j.jsxs)(cs.InputGroup,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,j.jsx)(ch.Input,{"data-slot":"command-input",className:(0,ct.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",a),...b}),(0,j.jsx)(cs.InputGroupAddon,{children:(0,j.jsx)(cr.default,{className:"size-4 shrink-0 opacity-50"})})]})})},"CommandItem",0,function({className:a,children:b,...c}){return(0,j.jsxs)(ch.Item,{"data-slot":"command-item",className:(0,ct.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",a),...c,children:[b,(0,j.jsx)(cq.CheckIcon,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})},"CommandList",0,function({className:a,...b}){return(0,j.jsx)(ch.List,{"data-slot":"command-list",className:(0,ct.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",a),...b})}],329154)},581662,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(752562),f=a.i(141146),g=a.i(793817),h=a.i(844561),i=a.i(425256),j=a.i(403512),k=a.i(951675),l=a.i(924613),m=a.i(474215),n=a.i(572131),o=a.i(767561),p=a.i(340695),q=a.i(329154),r=a.i(205522),s=a.i(262276),t=a.i(446181),u=a.i(545097),v=a.i(950463),w=a.i(280281),x=a.i(546893),y=a.i(287702),z=a.i(608902),A=a.i(61876),B=a.i(44358),C=a.i(754257),D=a.i(652006),E=a.i(310305),F=a.i(522618),G=a.i(411509),H=a.i(398026),I=a.i(913834),J=a.i(626280),K=a.i(478978),L=a.i(619477),M=a.i(28996),N=a.i(369768),O=a.i(559553),P=a.i(246812),Q=a.i(337967),R=a.i(30681),S=a.i(199169),T=a.i(616682),U=a.i(313237),V=a.i(759497),W=a.i(497895),X=a.i(324835),Y=b([N]);[N]=Y.then?(await Y)():Y;let ap=" new";function Z({bot:a,job:b,active:c,onPick:e}){var f,g,h;let i=(f=b,g=a.lastJobAt,h=a.disabled,f?.status==="waiting"?{text:"waiting on you",shine:!0,amber:!0}:f?.status==="running"?{text:`working \xb7 ${f.label}`,shine:!0}:h?{text:"off"}:f?{text:`idle \xb7 last job ${$(f.updatedAt)}`}:g?{text:`idle \xb7 last job ${$(g)}`}:{text:"idle · no jobs yet"});return(0,d.jsxs)("button",{type:"button",onClick:e,className:(0,W.cn)("mx-2 flex items-center gap-2.5 rounded-md px-2 py-2 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",c?"bg-secondary":"hover:bg-muted/60"),children:[(0,d.jsx)(I.BotMark,{size:32,...af(a.name,a.icon),state:b?.status==="running"?"thinking":"idle",notify:b?.status==="waiting",className:(0,W.cn)("shrink-0",a.disabled&&"opacity-45")}),(0,d.jsxs)("span",{className:(0,W.cn)("min-w-0 flex-1 space-y-0.5",a.disabled&&"opacity-45"),children:[(0,d.jsx)("span",{className:(0,W.cn)("block truncate text-[13px]",c?"font-medium":"text-foreground/90"),children:a.name}),i.shine?(0,d.jsx)(u.ShinyText,{text:i.text,tone:i.amber?"waiting":"muted",className:"block truncate font-mono text-[11px] leading-4"}):(0,d.jsx)("span",{className:"block truncate font-mono text-[11px] leading-4 text-muted-foreground",children:i.text})]})]})}function $(a){let b=(0,S.shortAgo)(a);return"now"===b?"just now":`${b} ago`}function _(a,b,c){let[d,e]=(0,n.useState)(new Set),[f,g]=(0,U.useServerAction)(C.createSeedBotsAction,{onOk:a=>{(0,V.revalidate)(o.queryKey.bot),c(a.created[0]??null)}}),{data:h}=(0,V.useServerRoute)(o.queryKey.config),i=H.BOT_SEEDS.filter(b=>!a.has(b.name)),j=i.filter(a=>!d.has(a.name));return{isSet:a=>(0,K.isConfigSet)(h,a),adding:g,addable:i,wanted:j,ticked:b=>a.has(b.name)||!d.has(b.name),toggle:a=>e(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c}),submit:()=>f(j.map(a=>({name:a.name,color:b[H.BOT_SEEDS.indexOf(a)]})))}}function aa({have:a,inks:b,picks:c}){return(0,d.jsx)("div",{className:"flex flex-col gap-2",children:H.BOT_SEEDS.map((f,h)=>{var i;let j,k=a.has(f.name),l=c.ticked(f),m=(i=c.isSet,(j=(f.requires??[]).filter(a=>!i(K.MEDIA_MODEL_KEYS[a]))).length?`needs ${j.map(K.mediaModelWords).join(" and ")}`:null);return(0,d.jsx)("div",{className:(0,W.cn)("rounded-xl ring-1 transition-colors",k?"opacity-45 ring-border/60":l?"ring-foreground":"ring-border/60"),children:(0,d.jsxs)("button",{type:"button",disabled:k||c.adding,"aria-pressed":l,onClick:()=>c.toggle(f.name),className:"flex w-full items-center gap-3 rounded-xl px-3.5 py-2.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-default",children:[(0,d.jsx)(I.BotMark,{size:28,...af(f.name,f.icon),color:b[h],className:(0,W.cn)("shrink-0 transition-opacity",!l&&"opacity-35")}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 space-y-px",children:[(0,d.jsx)("span",{className:"block text-[14px] leading-[18px] font-medium",children:f.name}),(0,d.jsx)("span",{className:"block truncate text-[12px] leading-[17px] text-muted-foreground",children:f.hint})]}),k?(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:"already added"}):m?(0,d.jsxs)("span",{className:(0,W.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[11px]",W.WAITING_INK),children:[(0,d.jsx)(g.CircleAlert,{className:"size-3"}),m]}):null,(0,d.jsx)("span",{className:(0,W.cn)("grid size-5 shrink-0 place-items-center rounded-full transition-colors",l?"bg-foreground text-background":"ring-1 ring-border/60 ring-inset"),children:l&&(0,d.jsx)(e.Check,{className:"size-3"})})]})},f.name)})})}function ab({picks:a,onCancel:b}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(p.Button,{variant:"ghost",onClick:b,children:"Cancel"}),(0,d.jsxs)(p.Button,{loading:a.adding,disabled:0===a.wanted.length,onClick:a.submit,children:[(0,d.jsx)(j.Plus,{}),1===a.wanted.length?`Add ${a.wanted[0].name}`:`Add ${a.wanted.length} bots`]})]})}function ac({have:a,inks:b,onDone:c}){let e=_(a,b,c);return(0,d.jsxs)("div",{className:"flex min-h-full flex-col",children:[(0,d.jsx)("div",{className:"flex h-11 shrink-0 items-center border-b border-border/60 px-4 font-mono text-[11px] text-muted-foreground",children:"Ready-made"}),(0,d.jsxs)("div",{className:"px-8 pt-7 pb-1",children:[(0,d.jsx)("h3",{className:"text-[17px] font-medium tracking-tight",children:"Bots you can add"}),(0,d.jsx)("p",{className:"mt-1.5 max-w-lg text-[13px] leading-relaxed text-muted-foreground break-keep",children:"Each one is a starting point — rename it, re-prompt it, give it a model of its own. What a bot needs before it can work stands on its row; until then it runs on the app default model."})]}),(0,d.jsx)("div",{className:"px-8 pt-4",children:(0,d.jsx)(aa,{have:a,inks:b,picks:e})}),(0,d.jsxs)("div",{className:"mt-auto flex items-center gap-3 border-t border-border/60 px-8 py-4",children:[(0,d.jsx)("span",{className:"flex-1 font-mono text-[11px] text-muted-foreground",children:0===e.wanted.length?"nothing ticked":`${e.wanted.length} of ${e.addable.length} ticked`}),(0,d.jsx)(ab,{picks:e,onCancel:()=>c(null)})]})]})}function ad({have:a,inks:b,onDone:c}){let e=_(a,b,c);return(0,d.jsx)(L.SettingDialogContent,{title:"Bots you can add",description:"Each one is a starting point — rename it, re-prompt it, give it a model of its own. What a bot needs before it can work stands on its row.",footer:(0,d.jsx)(ab,{picks:e,onCancel:()=>c(null)}),children:(0,d.jsx)(aa,{have:a,inks:b,picks:e})})}function ae({missing:a,inks:b,have:c,onDone:e}){return(0,d.jsxs)("button",{type:"button",title:"Ready-made bots","aria-label":`Ready-made bots, ${a.length} on offer`,onClick:()=>t.notify.component({className:"sm:max-w-xl",renderer:({close:a})=>(0,d.jsx)(ad,{have:c,inks:b,onDone:b=>{a(),e(b)}})}),className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-muted-foreground outline-none transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)(j.Plus,{className:"size-3 shrink-0"}),a.map((c,e)=>(0,d.jsx)("span",{className:(0,W.cn)("block",e>0&&"-ml-1.5"),style:{zIndex:a.length-e},children:(0,d.jsx)(I.BotMark,{size:20,...af(c.name,c.icon),color:b[H.BOT_SEEDS.indexOf(c)],notify:!1})},c.name))]})}function af(a,b){return{seed:a||"bot",color:b?.color,shape:b?.shape,outline:b?.outline}}function ag({bot:a,jobs:b,onDone:c,onCancel:e}){let[f,g]=(0,R.useObjectState)(()=>({name:a?.name??"",description:a?.description??"",systemPrompt:a?.systemPrompt??"",icon:a?.icon??(0,G.randomBotIcon)(),provider:a?.provider??null,model:a?.model??"",compactAt:a?.compactAt?String(a.compactAt/1e3):"",toolIds:a?.tools.map(a=>a.id)??[]})),{name:h,description:i,systemPrompt:j,icon:l,provider:m,model:q,compactAt:u,toolIds:v}=f,[C,E]=(0,n.useState)(!!a?.compactAt),H=(0,V.useServerRoute)(o.queryKey.modelCatalog),I=(a,b)=>a&&b.trim()?(0,A.contextWindowOf)(a,b.trim(),H.data):null,J=I(m,q),K=m&&q.trim()?ar(J)/1e3:null,L=C?u:null===K?"":String(K),[M]=(0,U.useServerAction)(F.updateBotAction,{onOk:()=>(0,V.revalidate)(o.queryKey.bot)}),N=b=>{a&&M(a.name,b)},[O,P,,Q]=(0,U.useServerAction)(B.createBotAction,{errorMessage:!1,okMessage:"Bot created",onOk:a=>{(0,V.revalidate)(o.queryKey.bot),c(a.name)}}),[S,W]=(0,U.useServerAction)(D.deleteBotAction,{okMessage:"Bot deleted",onOk:()=>{(0,V.revalidate)(o.queryKey.bot),c(null)}}),X=h.trim()&&i.trim()&&m&&q.trim()&&!P,Y=async()=>{!a||await t.notify.confirm({title:`Delete ${a.name}?`,description:"The agent can no longer hand work to it.",okText:"Delete",destructive:!0})&&S(a.name)};return(0,d.jsxs)("div",{className:"flex min-h-full flex-col",children:[(0,d.jsxs)("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border/60 px-4",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",children:a?a.name:"New bot"}),a&&(0,d.jsxs)(d.Fragment,{children:[a.disabled&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:"off"}),(0,d.jsx)(w.Switch,{checked:!a.disabled,onCheckedChange:a=>N({disabled:!a}),"aria-label":`${a.name} on or off`,className:"mr-1 shrink-0"}),(0,d.jsx)(p.Button,{size:"icon-sm",variant:"ghost",loading:W,"aria-label":"Delete this bot",onClick:Y,className:"text-muted-foreground hover:text-destructive",children:(0,d.jsx)(k.Trash2,{})})]})]}),(0,d.jsxs)("div",{className:"flex-1 space-y-5 p-6",children:[(0,d.jsx)(an,{name:h,icon:l,onChange:a=>{g({icon:a}),N({icon:a})}}),(0,d.jsxs)(al,{label:"Name",children:[a?(0,d.jsx)("p",{className:"truncate text-sm leading-8 font-medium",children:a.name}):(0,d.jsx)(r.Input,{value:h,onChange:a=>g({name:a.target.value}),placeholder:"researcher",spellCheck:!1,maxLength:T.COMMON_VALIDATE.name.max,autoFocus:!0}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a?`What ${y.APP_NAME} calls it when she hands it work. Fixed once the bot is made.`:`What ${y.APP_NAME} calls it when she hands it work. Up to ${T.COMMON_VALIDATE.name.max} characters, and it can’t be renamed later.`})]}),(0,d.jsxs)(al,{label:"Description",children:[(0,d.jsx)(r.Input,{value:i,onChange:a=>g({description:a.target.value}),onBlur:()=>{let b=i.trim();a&&b&&b!==a.description&&N({description:b})},placeholder:"Searches the web and answers",maxLength:T.COMMON_VALIDATE.description.max}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground",children:["The one line ",y.APP_NAME," and the other bots read when they decide who gets a job."]})]}),(0,d.jsx)(al,{label:"Runs on",children:(0,d.jsx)(z.ModelPicker,{provider:m,model:q,onChange:a=>{g({provider:a.provider,model:a.model}),E(!1),a.model&&N({...a,compactAt:ar(I(a.provider,a.model))})}})}),(0,d.jsxs)(al,{label:"Compacts at",children:[(0,d.jsxs)(s.InputGroup,{children:[(0,d.jsx)(s.InputGroupInput,{inputMode:"decimal",value:L,placeholder:q.trim()?"":"Pick a model first",onChange:a=>{E(!0),g({compactAt:a.target.value})},onBlur:()=>{if(!C)return;let a=ak(u);null===a?E(!1):g({compactAt:String(a/1e3)}),N({compactAt:a??(q.trim()?ar(J):null)})}}),(0,d.jsx)(s.InputGroupAddon,{align:"inline-end",children:(0,d.jsx)(s.InputGroupText,{children:"k tokens"})})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:function(a){if(!a.model)return"Filled in from the model once one is picked.";let b=ar(a.window),c="A job summarizes itself here and carries on.";return null!==a.shown&&a.shown!==b?`Set by hand. Picking a model fills in its own again. ${c}`:a.window?`${Math.round(100*y.BOT_RUN.compactHeadroom)}% of this model's ${(a.window/1e3).toLocaleString()}k context window. ${c}`:`This model's context window is unknown, so the default is filled in. ${c}`}({model:q.trim(),window:J,shown:ak(L)})})]}),(0,d.jsx)(al,{label:"Tools",children:(0,d.jsx)(ao,{selected:v,onChange:a=>{g({toolIds:a}),N({toolIds:a})}})}),(0,d.jsxs)(al,{label:"Prompt",children:[(0,d.jsx)(x.Textarea,{value:j,onChange:a=>g({systemPrompt:a.target.value}),onBlur:()=>{let b=j.trim();a&&b!==(a.systemPrompt??"")&&N({systemPrompt:b})},placeholder:`How it should work (optional). e.g.
2
+ Search the web, answer with a short summary and links.`,maxLength:T.COMMON_VALIDATE.prompt.max,className:"max-h-48 min-h-24 resize-none overflow-y-auto text-sm"}),j.length>0&&(0,d.jsxs)("p",{className:"text-right font-mono text-[10px] text-muted-foreground",children:[j.length,"/",T.COMMON_VALIDATE.prompt.max]})]}),a&&(0,d.jsx)(ah,{bot:a.name}),a&&(0,d.jsx)(am,{jobs:b}),!a&&(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2 pt-1",children:[(0,d.jsx)(p.Button,{variant:"ghost",onClick:e,children:"Cancel"}),(0,d.jsx)(p.Button,{loading:P,disabled:!X,onClick:()=>{X&&m&&O({name:h.trim(),description:i.trim(),systemPrompt:j.trim()||void 0,icon:l,provider:m,model:q.trim(),compactAt:C?ak(u):ar(J),toolIds:v})},children:"Create"})]}),Q&&(0,d.jsx)("p",{className:"font-mono text-xs text-destructive",children:Q})]})]})}function ah({bot:a}){let b=o.queryKey.botMemoryFiles(a),{data:c,isLoading:e}=(0,V.useServerRoute)(b),[g,i]=(0,n.useState)(null),[j]=(0,U.useServerAction)(Q.openFileAction),[l,m]=(0,U.useServerAction)(P.deleteWorkspaceFileAction,{okMessage:"File deleted",onOk:()=>{i(null),(0,V.revalidate)(b),(0,V.revalidate)(o.queryKey.workspace)}}),q=async b=>{await t.notify.confirm({title:`Delete ${b.file}?`,description:`It is deleted from disk for good, and ${a}'s next job starts without it.`,okText:"Delete",destructive:!0})&&l(b.path)};return(0,d.jsxs)("div",{className:"pt-1",children:[(0,d.jsxs)("div",{className:"flex h-6 items-center",children:[(0,d.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Memory"}),(0,d.jsx)("span",{className:"flex-1"}),c&&c.total>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"pr-1 font-mono text-[11px] text-muted-foreground tabular-nums",children:1===c.total?"1 file":`${c.total} files`}),(0,d.jsxs)("button",{type:"button",title:"Show in the file manager",onClick:()=>j(c.folder),className:"flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(h.FolderOpen,{className:"size-3"}),"Folder"]})]})]}),e?(0,d.jsx)("div",{className:"flex h-9 items-center border-t border-border/60",children:(0,d.jsx)(v.Skeleton,{className:"h-3 w-56"})}):c?.entries.length?c.entries.map(a=>{let b=g===a.path;return(0,d.jsxs)("div",{className:"border-t border-border/60",children:[(0,d.jsxs)("button",{type:"button","aria-expanded":b,onClick:()=>i(b?null:a.path),className:"flex h-9 w-full items-center gap-3 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:(0,W.cn)("min-w-0 flex-1 truncate",b&&"font-medium"),children:a.line||a.file}),(0,d.jsx)("span",{className:"w-36 shrink-0 truncate font-mono text-[11px] text-muted-foreground",children:a.file}),(0,d.jsx)("span",{className:"w-28 shrink-0 text-right font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,S.whenOf)(a.at)}),(0,d.jsx)(f.ChevronRight,{className:(0,W.cn)("size-3 shrink-0 text-muted-foreground transition-transform",b&&"rotate-90")})]}),b&&(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"max-h-96 min-w-0 flex-1 overflow-y-auto",children:(0,d.jsx)(ai,{path:a.path})}),(0,d.jsx)(p.Button,{size:"icon-sm",variant:"ghost","aria-label":`Delete ${a.file}`,loading:m,onClick:()=>q(a),className:"text-muted-foreground hover:text-destructive",children:(0,d.jsx)(k.Trash2,{})})]})]},a.path)}):(0,d.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Nothing kept yet."})]})}function ai({path:a}){let{content:b,failure:c,truncated:e}=(0,N.useFileText)(a);if(c)return(0,d.jsx)("p",{className:"pb-3 font-mono text-xs text-destructive",children:c});if(null===b)return(0,d.jsxs)("div",{className:"space-y-2 pb-3",children:[(0,d.jsx)(v.Skeleton,{className:"h-4 w-5/6"}),(0,d.jsx)(v.Skeleton,{className:"h-4 w-2/3"})]});let f=(0,O.viewKindOf)(a);return(0,d.jsx)(N.FileBody,{kind:f,content:"markdown"===f?aq(b):b,truncated:e,where:"inline"})}let aq=a=>a.replace(/^---\n[\s\S]*?\n---\n/,"").replace(/^\s*#[^\n]*\n?/,"");function aj({bot:a}){let{data:b,mutate:c}=(0,V.useServerRoute)(o.queryKey.botMemory),[e]=(0,U.useServerAction)(E.setBotMemoryOnAction,{onOk:()=>(0,V.revalidate)(o.queryKey.botMemory)}),f=a?a.tokens.input+a.tokens.output:0;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(L.SettingRailNote,{children:a?(0,d.jsxs)("span",{className:"font-mono text-[11px]",children:[a.name,a.disabled&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"px-1.5 opacity-50",children:"·"}),"off"]}),(0,d.jsx)("span",{className:"px-1.5 opacity-50",children:"·"}),(0,d.jsx)("span",{title:`in ${(0,W.formatCount)(a.tokens.input)} \xb7 out ${(0,W.formatCount)(a.tokens.output)}`,children:f>0?`${(0,W.formatCount)(f)} tokens`:"no tokens yet"}),(0,d.jsx)("span",{className:"px-1.5 opacity-50",children:"·"}),"since ",(0,S.whenOf)(a.createdAt)]}):"Becomes a bot once it has a name and a model"}),(0,d.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:"Bots keep their own memory"}),(0,d.jsx)(w.Switch,{checked:b??!0,disabled:void 0===b,onCheckedChange:a=>{c(a,!1),e(a)},"aria-label":"Bots keep their own memory"})]})}function ak(a){let b=Number(a.replace(/[^0-9.]/g,""));return Number.isFinite(b)&&b>0?Math.round(1e3*b):null}let ar=a=>1e3*Math.round((0,A.compactAtFor)(a)/1e3);function al({label:a,children:b}){return(0,d.jsxs)("div",{className:"flex gap-3",children:[(0,d.jsx)("span",{className:"w-20 shrink-0 pt-2 font-mono text-xs text-muted-foreground",children:a}),(0,d.jsx)("div",{className:"min-w-0 flex-1 space-y-1.5",children:b})]})}function am({jobs:a}){return(0,d.jsxs)("div",{className:"pt-1",children:[(0,d.jsxs)("div",{className:"flex h-6 items-center",children:[(0,d.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"Recent"}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsxs)("button",{type:"button",onClick:()=>(0,M.openSettings)("tasks"),className:"flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(i.History,{className:"size-3"}),"History"]})]}),0===a.length?(0,d.jsx)("p",{className:"py-2 text-[13px] text-muted-foreground",children:"Nothing handed over yet."}):a.map(a=>{let b=function(a){switch(a.status){case"waiting":return{text:"waiting on you",tone:W.WAITING_INK};case"running":return{text:"working",tone:"text-muted-foreground"};case"failed":return{text:"failed",tone:"text-destructive"};default:return{text:"done",tone:"text-muted-foreground"}}}(a);return(0,d.jsxs)("div",{className:"flex h-9 items-center gap-3 border-t border-border/60 text-[13px]",children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a.label}),"running"===a.status?(0,d.jsx)(u.ShinyText,{text:b.text,className:"shrink-0 font-mono text-[11px]"}):(0,d.jsx)("span",{className:(0,W.cn)("shrink-0 font-mono text-[11px]",b.tone),children:b.text}),(0,d.jsx)("span",{className:"w-28 shrink-0 text-right font-mono text-[11px] text-muted-foreground tabular-nums",children:(0,S.whenOf)(a.updatedAt)})]},a.id)})]})}function an({name:a,icon:b,onChange:c}){return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-4 pt-3 pb-2",children:[(0,d.jsx)(I.BotMark,{size:112,...af(a,b),className:"shrink-0"}),(0,d.jsx)(J.MarkPalette,{color:b.color,themePicked:b.color===X.MARK_SYSTEM,onTheme:()=>c({...b,color:X.MARK_SYSTEM}),onPick:a=>c({...b,color:b.color===a?void 0:a})}),(0,d.jsxs)("div",{className:"flex gap-1",children:[X.MARK_SHAPES.map(a=>(0,d.jsx)("button",{type:"button",onClick:()=>c({...b,shape:b.shape===a?void 0:a}),className:(0,W.cn)("rounded-md px-2 py-1 font-mono text-[11px] capitalize transition-colors",b.shape===a?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:a},a)),(0,d.jsx)("span",{className:"mx-1 w-px self-stretch bg-border/60"}),(0,d.jsx)("button",{type:"button",onClick:()=>c({...b,outline:!b.outline||void 0}),className:(0,W.cn)("rounded-md px-2 py-1 font-mono text-[11px] transition-colors",b.outline?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:"outline"})]})]})}function ao({selected:a,onChange:b}){let{data:c=[]}=(0,V.useServerRoute)(o.queryKey.mcpTools),[f,g]=(0,n.useState)(!1),h=a.length>=G.MAX_PINNED_TOOLS,i=[...new Set(c.map(a=>a.serverName))],j=a.map(a=>c.find(b=>b.id===a)).filter(a=>!!a),k=f?j:j.slice(0,4),r=j.length-k.length,s=c=>b(a.includes(c)?a.filter(a=>a!==c):[...a,c]);return 0===c.length?(0,d.jsx)("p",{className:"pt-1.5 text-xs text-muted-foreground",children:"Nothing to pin — connect an MCP server first (Settings › Connectors)."}):(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)(p.Button,{size:"icon-sm",variant:f?"secondary":"outline",onClick:()=>g(!f),"aria-label":"Pick tools",className:"border-dashed",children:(0,d.jsx)(l.Wrench,{})}),k.map(a=>(0,d.jsxs)("span",{className:"flex items-center gap-1 rounded-full bg-muted py-1 pr-1.5 pl-2.5 font-mono text-[11px]",children:[a.name,(0,d.jsx)("button",{type:"button","aria-label":`Unpin ${a.name}`,onClick:()=>s(a.id),className:"rounded-full p-0.5 text-muted-foreground transition-colors hover:bg-foreground/10 hover:text-foreground",children:(0,d.jsx)(m.X,{className:"size-3"})})]},a.id)),r>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>g(!0),className:"rounded-full bg-muted px-2.5 py-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["+",r]}),0===j.length&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:"Loaded from the start — everything else stays searchable"}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsxs)("span",{className:(0,W.cn)("font-mono text-[11px] text-muted-foreground",h&&"text-foreground"),children:[a.length,"/",G.MAX_PINNED_TOOLS]})]}),f&&(0,d.jsxs)(q.Command,{className:"rounded-lg border border-input",children:[(0,d.jsx)(q.CommandInput,{placeholder:"Search tools"}),(0,d.jsxs)(q.CommandList,{className:"max-h-44",children:[(0,d.jsx)(q.CommandEmpty,{children:"Nothing matches"}),i.map(b=>(0,d.jsx)(q.CommandGroup,{heading:b,children:c.filter(a=>a.serverName===b).map(b=>{let c=a.includes(b.id);return(0,d.jsxs)(q.CommandItem,{value:`${b.serverName}/${b.name}`,disabled:!c&&h,onSelect:()=>s(b.id),children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:b.name}),c&&(0,d.jsx)(e.Check,{className:"size-3.5 shrink-0"})]},b.id)})},b))]})]})]})}a.s(["BotSetting",0,function(){let{data:a,isLoading:b,error:c}=(0,V.useServerRoute)(o.queryKey.bot),e=a??[],{data:f}=(0,V.useServerRoute)(o.queryKey.taskHistory(null)),g=f??[],[h,i]=(0,n.useState)(null),[k]=(0,n.useState)(H.rollSeedColors);if(b)return(0,d.jsx)(L.SettingPanesSkeleton,{});if(c)return(0,d.jsx)(L.SettingError,{message:c.message});let l=h===ap,m=e.filter(a=>!a.disabled).length,q=new Set(e.map(a=>a.name)),r=H.BOT_SEEDS.filter(a=>!q.has(a.name)),s=l?null:e.find(a=>a.name===h)??e[0]??null;return(0,d.jsx)(L.SettingPanes,{footer:0===e.length?null:(0,d.jsx)(aj,{bot:s}),left:(0,d.jsxs)("div",{className:"flex flex-col py-2",children:[(0,d.jsxs)("div",{className:"mx-2 mb-1 flex items-center gap-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>i(ap),className:(0,W.cn)("flex flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-left text-[13px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",l?"bg-secondary text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[(0,d.jsx)(j.Plus,{className:"size-3.5 shrink-0"}),"New bot"]}),e.length>0&&r.length>0&&(0,d.jsx)(ae,{missing:r,inks:k,have:q,onDone:a=>i(a)})]}),e.map(a=>(0,d.jsx)(Z,{bot:a,job:g.find(b=>b.bot===a.name)??null,active:!l&&a.name===s?.name,onPick:()=>i(a.name)},a.name)),m>y.PROMPT_CROWDED.bots&&(0,d.jsxs)(L.SettingNote,{className:"mx-3 mt-2 leading-relaxed",children:[m," bots are on. Each is a line in every prompt, and one more for Thursday to choose between."]})]}),right:l?(0,d.jsx)(ag,{jobs:[],onDone:a=>i(a),onCancel:()=>i(null)},"new"):s?(0,d.jsx)(ag,{bot:s,jobs:g.filter(a=>a.bot===s.name).slice(0,3),onDone:()=>i(null)},s.name):r.length>0?(0,d.jsx)(ac,{have:q,inks:k,onDone:a=>i(a)}):(0,d.jsxs)("div",{className:"space-y-4 p-8",children:[(0,d.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"The agent talks; bots do the rest — search the web, draft a reply, check a schedule. Give one a job and a model, and work gets handed over mid-call while the conversation keeps going."}),(0,d.jsxs)(p.Button,{variant:"outline",onClick:()=>i(ap),children:[(0,d.jsx)(j.Plus,{}),"New bot"]})]})})}]),c()}catch(a){c(a)}},!1),652006,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7ffed7b5e60bbcaf20bf9d4e80219a52cbf8e96ebb",b.callServer,void 0,b.findSourceMapURL,"deleteBotAction");a.s(["deleteBotAction",0,c])},310305,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f50fd90d67f93e3cc1ef2f4549305a687fdfd71e1",b.callServer,void 0,b.findSourceMapURL,"setBotMemoryOnAction");a.s(["setBotMemoryOnAction",0,c])},522618,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fb76f58c3bde6fe281cdcec4c154f5f9ba480cb29",b.callServer,void 0,b.findSourceMapURL,"updateBotAction");a.s(["updateBotAction",0,c])},44358,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f92929bc39d14cb18c0edd6f885396687b8da365f",b.callServer,void 0,b.findSourceMapURL,"createBotAction");a.s(["createBotAction",0,c])},793817,a=>{"use strict";var b=a.i(164831);let c={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};c.node;let d=(0,b.default)(c);a.s(["CircleAlert",0,d],793817)}];
3
+
4
+ //# sourceMappingURL=_1fojd41._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[608902,852307,a=>{"use strict";var b=a.i(187924),c=a.i(752562),d=a.i(589027),e=a.i(126766),f=a.i(572131),g=a.i(767561),h=a.i(340695),i=a.i(825715),j=a.i(676504),k=a.i(205522),l=a.i(477804),m=a.i(313237),n=a.i(759497),o=a.i(61876),p=a.i(864037),q=a.i(405050);let r=(0,q.createServerReference)("7fa2cf26e961795098f276046405e7c1f2ee1764a0",q.callServer,void 0,q.findSourceMapURL,"startChatGptSignInAction");function s({variant:a}){let[c,d]=(0,f.useState)(!1),e=(0,f.useRef)(null),g=()=>{e.current&&clearInterval(e.current),e.current=null};(0,f.useEffect)(()=>g,[]);let[i,j]=(0,m.useServerAction)(r,{onOk:a=>{let b=window.open(a,"thursday-chatgpt","popup,width=520,height=720");if(!b)return void p.toast.add({type:"error",title:"The sign-in window was blocked",description:"Allow pop-ups for this page, then try again"});d(!0),g();let c=Date.now()+6e5;e.current=setInterval(()=>{!b.closed&&Date.now()<c||(g(),d(!1))},700)}});return(0,b.jsx)(h.Button,{variant:a,loading:j||c,onClick:()=>i(),children:"Sign in with ChatGPT"})}a.s(["ChatGptSignIn",0,s],852307);var t=a.i(158983),u=a.i(233540),v=a.i(270390),w=a.i(965733),x=a.i(777794),y=a.i(497895),z=a.i(379630);let A={anthropic:"anthropic",openai:"openai",google:"google",spacexai:"xai"},B={alibaba:[{d:"M12.604 1.34c.393.69.784 1.382 1.174 2.075a.18.18 0 00.157.091h5.552c.174 0 .322.11.446.327l1.454 2.57c.19.337.24.478.024.837-.26.43-.513.864-.76 1.3l-.367.658c-.106.196-.223.28-.04.512l2.652 4.637c.172.301.111.494-.043.77-.437.785-.882 1.564-1.335 2.34-.159.272-.352.375-.68.37-.777-.016-1.552-.01-2.327.016a.099.099 0 00-.081.05 575.097 575.097 0 01-2.705 4.74c-.169.293-.38.363-.725.364-.997.003-2.002.004-3.017.002a.537.537 0 01-.465-.271l-1.335-2.323a.09.09 0 00-.083-.049H4.982c-.285.03-.553-.001-.805-.092l-1.603-2.77a.543.543 0 01-.002-.54l1.207-2.12a.198.198 0 000-.197 550.951 550.951 0 01-1.875-3.272l-.79-1.395c-.16-.31-.173-.496.095-.965.465-.813.927-1.625 1.387-2.436.132-.234.304-.334.584-.335a338.3 338.3 0 012.589-.001.124.124 0 00.107-.063l2.806-4.895a.488.488 0 01.422-.246c.524-.001 1.053 0 1.583-.006L11.704 1c.341-.003.724.032.9.34zm-3.432.403a.06.06 0 00-.052.03L6.254 6.788a.157.157 0 01-.135.078H3.253c-.056 0-.07.025-.041.074l5.81 10.156c.025.042.013.062-.034.063l-2.795.015a.218.218 0 00-.2.116l-1.32 2.31c-.044.078-.021.118.068.118l5.716.008c.046 0 .08.02.104.061l1.403 2.454c.046.081.092.082.139 0l5.006-8.76.783-1.382a.055.055 0 01.096 0l1.424 2.53a.122.122 0 00.107.062l2.763-.02a.04.04 0 00.035-.02.041.041 0 000-.04l-2.9-5.086a.108.108 0 010-.113l.293-.507 1.12-1.977c.024-.041.012-.062-.035-.062H9.2c-.059 0-.073-.026-.043-.077l1.434-2.505a.107.107 0 000-.114L9.225 1.774a.06.06 0 00-.053-.031zm6.29 8.02c.046 0 .058.02.034.06l-.832 1.465-2.613 4.585a.056.056 0 01-.05.029.058.058 0 01-.05-.029L8.498 9.841c-.02-.034-.01-.052.028-.054l.216-.012 6.722-.012z"}],amazon:[{d:"M13.05 15.513h3.08c.214 0 .389.177.389.394v1.82a1.704 1.704 0 011.296 1.661c0 .943-.755 1.708-1.685 1.708-.931 0-1.686-.765-1.686-1.708 0-.807.554-1.484 1.297-1.662v-1.425h-2.69v4.663a.395.395 0 01-.188.338l-2.69 1.641a.385.385 0 01-.405-.002l-4.926-3.086a.395.395 0 01-.185-.336V16.3L2.196 14.87A.395.395 0 012 14.555L2 14.528V9.406c0-.14.073-.27.192-.34l2.465-1.462V4.448c0-.129.062-.249.165-.322l.021-.014L9.77 1.058a.385.385 0 01.407 0l2.69 1.675a.395.395 0 01.185.336V7.6h3.856V5.683a1.704 1.704 0 01-1.296-1.662c0-.943.755-1.708 1.685-1.708.931 0 1.685.765 1.685 1.708 0 .807-.553 1.484-1.296 1.662v2.311a.391.391 0 01-.389.394h-4.245v1.806h6.624a1.69 1.69 0 011.64-1.313c.93 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708a1.69 1.69 0 01-1.64-1.314H13.05v1.937h4.953l.915 1.18a1.66 1.66 0 01.84-.227c.931 0 1.685.764 1.685 1.707 0 .943-.754 1.708-1.685 1.708-.93 0-1.685-.765-1.685-1.708 0-.346.102-.668.276-.937l-.724-.935H13.05v1.806zM9.973 1.856L7.93 3.122V6.09h-.778V3.604L5.435 4.669v2.945l2.11 1.36L9.712 7.61V5.334h.778V7.83c0 .136-.07.263-.184.335L7.963 9.638v2.081l1.422 1.009-.446.646-1.406-.998-1.53 1.005-.423-.66 1.605-1.055v-1.99L5.038 8.29l-2.26 1.34v1.676l1.972-1.189.398.677-2.37 1.429V14.3l2.166 1.258 2.27-1.368.397.677-2.176 1.311V19.3l1.876 1.175 2.365-1.426.398.678-2.017 1.216 1.918 1.201 2.298-1.403v-5.78l-4.758 2.893-.4-.675 5.158-3.136V3.289L9.972 1.856zM16.13 18.47a.913.913 0 00-.908.92c0 .507.406.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zm3.63-3.81a.913.913 0 00-.908.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92zm1.555-4.99a.913.913 0 00-.908.92c0 .507.407.918.908.918a.913.913 0 00.907-.919.913.913 0 00-.907-.92zM17.296 3.1a.913.913 0 00-.907.92c0 .508.406.92.907.92a.913.913 0 00.908-.92.913.913 0 00-.908-.92z"}],"arcee-ai":[{d:"M13.236 2.377L2.751 20.493H0L11.863 0l1.373 2.377zm3.554 6.156l-9.606 11.96H4.13L15.511 6.32l1.279 2.212zm6.908 11.96H14.05l8.406-2.151 1.242 2.15zm-3.42-5.922l-7.843 5.92H8.482l10.597-7.997 1.2 2.077z"}],bfl:[{d:"M0 20.683L12.01 2.5 24 20.683h-2.233L12.009 5.878 3.471 18.806h12.122l1.239 1.877H0z"},{d:"M8.069 16.724l2.073-3.115 2.074 3.115H8.069zM18.24 20.683l-5.668-8.707h2.177l5.686 8.707h-2.196zM19.74 11.676l2.13-3.19 2.13 3.19h-4.26z"}],bytedance:[{d:"M14.944 18.587l-1.704-.445V10.01l1.824-.462c1-.254 1.84-.461 1.88-.453.032 0 .056 2.235.056 4.972v4.973l-.176-.008c-.104 0-.952-.207-1.88-.446z"},{d:"M7 16.542c0-2.736.024-4.98.064-4.98.032-.008.872.2 1.88.454l1.816.461-.016 4.05-.024 4.049-1.632.422c-.896.23-1.736.445-1.856.469L7 21.523v-4.98z"},{d:"M19.24 12.477c0-9.03.008-9.515.144-9.475.072.024.784.207 1.576.406.792.207 1.576.405 1.744.445l.296.08-.016 8.56-.024 8.568-1.624.414c-.888.23-1.728.437-1.856.47l-.24.055v-9.523z"},{d:"M1 12.509c0-4.678.024-8.505.064-8.505.032 0 .872.207 1.872.454l1.824.461v7.582c0 4.16-.016 7.574-.032 7.574-.024 0-.872.215-1.88.47L1 21.013v-8.505z"}],cohere:[{d:"M8.128 14.099c.592 0 1.77-.033 3.398-.703 1.897-.781 5.672-2.2 8.395-3.656 1.905-1.018 2.74-2.366 2.74-4.18A4.56 4.56 0 0018.1 1H7.549A6.55 6.55 0 001 7.55c0 3.617 2.745 6.549 7.128 6.549z"},{d:"M9.912 18.61a4.387 4.387 0 012.705-4.052l3.323-1.38c3.361-1.394 7.06 1.076 7.06 4.715a5.104 5.104 0 01-5.105 5.104l-3.597-.001a4.386 4.386 0 01-4.386-4.387z"},{d:"M4.776 14.962A3.775 3.775 0 001 18.738v.489a3.776 3.776 0 007.551 0v-.49a3.775 3.775 0 00-3.775-3.775z"}],deepseek:[{d:"M23.748 4.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434 1.202-.422 1.84.027 1.436.633 2.58 1.838 3.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526 5.526 0 01-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365 11.365 0 00-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055 3.055 0 01-.465.137 9.597 9.597 0 00-2.883-.102c-1.885.21-3.39 1.102-4.497 2.623C.082 8.606-.231 10.684.152 12.85c.403 2.284 1.569 4.175 3.36 5.653 1.858 1.533 3.997 2.284 6.438 2.14 1.482-.085 3.133-.284 4.994-1.86.47.234.962.327 1.78.397.63.059 1.236-.03 1.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926 1.096-1.296 2.746-2.642 3.392-7.003.05-.347.007-.565 0-.845-.004-.17.035-.237.23-.256a4.173 4.173 0 001.545-.475c1.396-.763 1.96-2.015 2.093-3.517.02-.23-.004-.467-.247-.588zM11.581 18c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696 4.696 0 011.529-.039c2.132.312 3.946 1.265 5.468 2.774.868.86 1.525 1.887 2.202 2.891.72 1.066 1.494 2.082 2.48 2.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306 0 01.415-.287.302.302 0 01.2.288.306.306 0 01-.31.307.303.303 0 01-.304-.308zm3.11 1.596c-.2.081-.399.151-.59.16a1.245 1.245 0 01-.798-.254c-.274-.23-.47-.358-.552-.758a1.73 1.73 0 01.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559 0 01-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136 1.146.016.352.144.618.408 1.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z"}],"fish-audio":[{d:"M23.12 12.13v.62c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.62c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.37v1.74c0 .24.2.44.44.44.25 0 .44-.2.44-.44V12.5c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76.43v1.99q0 .09.03.17.04.08.1.14.07.07.15.1t.17.03c.24 0 .44-.19.44-.44v-1.99c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17m-1.76.35v1.97c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-1.97c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m-1.77.32v1.65c0 .25.2.45.44.45s.44-.2.44-.45V13.6c0-.25-.2-.45-.44-.45s-.44.2-.44.45m-1.76 1.26v.3q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-.3q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M0 9.38v.19c0 .24.2.44.44.44.25 0 .44-.2.44-.44v-.19c0-.25-.19-.44-.44-.44-.24 0-.44.19-.44.44m1.82.15v.81c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.81q0-.18-.13-.31t-.31-.13-.31.13-.13.31m1.81-.24v3.39q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V9.29q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3m1.83-.35v.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-.22q0-.18-.13-.31T5.9 8.5t-.31.13-.13.31m0 2.94v2.34c0 .25.19.44.44.44.24 0 .44-.19.44-.44v-2.34c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44m15.89-3.32V11c0 .25.2.44.44.44.25 0 .44-.19.44-.44V8.56c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.76-.39v3.28q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.17c0-.25-.2-.44-.44-.44q-.09 0-.17.03t-.15.1q-.06.06-.1.14-.03.08-.03.17M17.83 8v3.9c0 .24.19.44.44.44.24 0 .44-.2.44-.44V8c0-.25-.2-.44-.44-.44-.25 0-.44.19-.44.44m-1.77.11v3.96c0 .25.2.44.44.44s.44-.19.44-.44V8.11c0-.25-.2-.44-.44-.44s-.44.19-.44.44m-1.76.27v5.03q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.38c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.8.46v5.75q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3V8.84c0-.25-.2-.44-.45-.44-.24 0-.44.19-.44.44m-1.76.76v5.52c0 .24.2.44.44.44.25 0 .44-.2.44-.44V9.6c0-.24-.19-.44-.44-.44-.24 0-.44.2-.44.44m-1.77 1.01v4.77q.01.17.14.3.13.11.3.12.18-.01.31-.12.13-.13.14-.3v-4.77q-.01-.17-.14-.3-.13-.11-.31-.12-.17.01-.3.12-.13.13-.14.3M23.12 9.6v1.22c0 .24.19.44.44.44.24 0 .44-.2.44-.44V9.6c0-.24-.2-.44-.44-.44-.25 0-.44.2-.44.44M7.21 11.32V16c0 .24.19.44.44.44.24 0 .44-.2.44-.44v-4.68q0-.18-.13-.31t-.31-.13-.31.13-.13.31"}],inception:[{d:"M14.767 1H7.884L1 7.883v6.884h6.884V7.883h6.883V1zM9.234 23h6.882L23 16.116V9.233h-6.884v6.883H9.234V23z"}],klingai:[{d:"M5.493 21.234c-1.112-1.451-1.109-4.263-.081-7.459l-4.557-2.63a1.683 1.683 0 01-.85-1.304 1.505 1.505 0 01.08-.622 13.18 13.18 0 011.037-2.255c3.476-6.02 10.916-8.23 16.619-4.938.46.266.82.67 1.081 1.184.785 1.545.685 4.096-.234 6.954l4.557 2.631c.339.196.596.492.736.832a1.53 1.53 0 01.034 1.093 13.146 13.146 0 01-1.037 2.255c-3.476 6.02-10.916 8.23-16.619 4.938a2.6 2.6 0 01-.766-.68zm11.096-6.615c-2.073 3.591-5.808 5.316-8.343 3.852-1.267-.731-1.994-2.122-2.145-3.778-.095-1.035.036-2.173.4-3.32.217-.684.517-1.37.902-2.039l.008-.014c2.073-3.59 5.808-5.315 8.343-3.852.633.366 1.13.895 1.49 1.54.986 1.772.922 4.415-.285 6.914-.111.23-.232.457-.362.683l-.008.014z"}],kwaipilot:[{d:"M11.765.03C5.327.03.108 5.25.108 11.686c0 3.514 1.556 6.665 4.015 8.804L9.89 8.665h6.451L9.31 23.083c.807.173 1.63.26 2.455.26 6.438 0 11.657-5.22 11.657-11.658S18.202.028 11.765.028V.03z"}],meta:[{d:"M6.897 4c1.915 0 3.516.932 5.43 3.376l.282-.373c.19-.246.383-.484.58-.71l.313-.35C14.588 4.788 15.792 4 17.225 4c1.273 0 2.469.557 3.491 1.516l.218.213c1.73 1.765 2.917 4.71 3.053 8.026l.011.392.002.25c0 1.501-.28 2.759-.818 3.7l-.14.23-.108.153c-.301.42-.664.758-1.086 1.009l-.265.142-.087.04a3.493 3.493 0 01-.302.118 4.117 4.117 0 01-1.33.208c-.524 0-.996-.067-1.438-.215-.614-.204-1.163-.56-1.726-1.116l-.227-.235c-.753-.812-1.534-1.976-2.493-3.586l-1.43-2.41-.544-.895-1.766 3.13-.343.592C7.597 19.156 6.227 20 4.356 20c-1.21 0-2.205-.42-2.936-1.182l-.168-.184c-.484-.573-.837-1.311-1.043-2.189l-.067-.32a8.69 8.69 0 01-.136-1.288L0 14.468c.002-.745.06-1.49.174-2.23l.1-.573c.298-1.53.828-2.958 1.536-4.157l.209-.34c1.177-1.83 2.789-3.053 4.615-3.16L6.897 4zm-.033 2.615l-.201.01c-.83.083-1.606.673-2.252 1.577l-.138.199-.01.018c-.67 1.017-1.185 2.378-1.456 3.845l-.004.022a12.591 12.591 0 00-.207 2.254l.002.188c.004.18.017.36.04.54l.043.291c.092.503.257.908.486 1.208l.117.137c.303.323.698.492 1.17.492 1.1 0 1.796-.676 3.696-3.641l2.175-3.4.454-.701-.139-.198C9.11 7.3 8.084 6.616 6.864 6.616zm10.196-.552l-.176.007c-.635.048-1.223.359-1.82.933l-.196.198c-.439.462-.887 1.064-1.367 1.807l.266.398c.18.274.362.56.55.858l.293.475 1.396 2.335.695 1.114c.583.926 1.03 1.6 1.408 2.082l.213.262c.282.326.529.54.777.673l.102.05c.227.1.457.138.718.138.176.002.35-.023.518-.073.338-.104.61-.32.813-.637l.095-.163.077-.162c.194-.459.29-1.06.29-1.785l-.006-.449c-.08-2.871-.938-5.372-2.2-6.798l-.176-.189c-.67-.683-1.444-1.074-2.27-1.074z"}],minimax:[{d:"M16.278 2c1.156 0 2.093.927 2.093 2.07v12.501a.74.74 0 00.744.709.74.74 0 00.743-.709V9.099a2.06 2.06 0 012.071-2.049A2.06 2.06 0 0124 9.1v6.561a.649.649 0 01-.652.645.649.649 0 01-.653-.645V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v7.472a2.037 2.037 0 01-2.048 2.026 2.037 2.037 0 01-2.048-2.026v-12.5a.785.785 0 00-.788-.753.785.785 0 00-.789.752l-.001 15.904A2.037 2.037 0 0113.441 22a2.037 2.037 0 01-2.048-2.026V18.04c0-.356.292-.645.652-.645.36 0 .652.289.652.645v1.934c0 .263.142.506.372.638.23.131.514.131.744 0a.734.734 0 00.372-.638V4.07c0-1.143.937-2.07 2.093-2.07zm-5.674 0c1.156 0 2.093.927 2.093 2.07v11.523a.648.648 0 01-.652.645.648.648 0 01-.652-.645V4.07a.785.785 0 00-.789-.78.785.785 0 00-.789.78v14.013a2.06 2.06 0 01-2.07 2.048 2.06 2.06 0 01-2.071-2.048V9.1a.762.762 0 00-.766-.758.762.762 0 00-.766.758v3.8a2.06 2.06 0 01-2.071 2.049A2.06 2.06 0 010 12.9v-1.378c0-.357.292-.646.652-.646.36 0 .653.29.653.646V12.9c0 .418.343.757.766.757s.766-.339.766-.757V9.099a2.06 2.06 0 012.07-2.048 2.06 2.06 0 012.071 2.048v8.984c0 .419.343.758.767.758.423 0 .766-.339.766-.758V4.07c0-1.143.937-2.07 2.093-2.07z"}],mistral:[{d:"M3.428 3.4h3.429v3.428h3.429v3.429h-.002 3.431V6.828h3.427V3.4h3.43v13.714H24v3.429H13.714v-3.428h-3.428v-3.429h-3.43v3.428h3.43v3.429H0v-3.429h3.428V3.4zm10.286 13.715h3.428v-3.429h-3.427v3.429z"}],moonshotai:[{d:"M1.052 16.916l9.539 2.552a21.007 21.007 0 00.06 2.033l5.956 1.593a11.997 11.997 0 01-5.586.865l-.18-.016-.044-.004-.084-.009-.094-.01a11.605 11.605 0 01-.157-.02l-.107-.014-.11-.016a11.962 11.962 0 01-.32-.051l-.042-.008-.075-.013-.107-.02-.07-.015-.093-.019-.075-.016-.095-.02-.097-.023-.094-.022-.068-.017-.088-.022-.09-.024-.095-.025-.082-.023-.109-.03-.062-.02-.084-.025-.093-.028-.105-.034-.058-.019-.08-.026-.09-.031-.066-.024a6.293 6.293 0 01-.044-.015l-.068-.025-.101-.037-.057-.022-.08-.03-.087-.035-.088-.035-.079-.032-.095-.04-.063-.028-.063-.027a5.655 5.655 0 01-.041-.018l-.066-.03-.103-.047-.052-.024-.096-.046-.062-.03-.084-.04-.086-.044-.093-.047-.052-.027-.103-.055-.057-.03-.058-.032a6.49 6.49 0 01-.046-.026l-.094-.053-.06-.034-.051-.03-.072-.041-.082-.05-.093-.056-.052-.032-.084-.053-.061-.039-.079-.05-.07-.047-.053-.035a7.785 7.785 0 01-.054-.036l-.044-.03-.044-.03a6.066 6.066 0 01-.04-.028l-.057-.04-.076-.054-.069-.05-.074-.054-.056-.042-.076-.057-.076-.059-.086-.067-.045-.035-.064-.052-.074-.06-.089-.073-.046-.039-.046-.039a7.516 7.516 0 01-.043-.037l-.045-.04-.061-.053-.07-.062-.068-.06-.062-.058-.067-.062-.053-.05-.088-.084a13.28 13.28 0 01-.099-.097l-.029-.028-.041-.042-.069-.07-.05-.051-.05-.053a6.457 6.457 0 01-.168-.179l-.08-.088-.062-.07-.071-.08-.042-.049-.053-.062-.058-.068-.046-.056a7.175 7.175 0 01-.027-.033l-.045-.055-.066-.082-.041-.052-.05-.064-.02-.025a11.99 11.99 0 01-1.44-2.402zm-1.02-5.794l11.353 3.037a20.468 20.468 0 00-.469 2.011l10.817 2.894a12.076 12.076 0 01-1.845 2.005L.657 15.923l-.016-.046-.035-.104a11.965 11.965 0 01-.05-.153l-.007-.023a11.896 11.896 0 01-.207-.741l-.03-.126-.018-.08-.021-.097-.018-.081-.018-.09-.017-.084-.018-.094c-.026-.141-.05-.283-.071-.426l-.017-.118-.011-.083-.013-.102a12.01 12.01 0 01-.019-.161l-.005-.047a12.12 12.12 0 01-.034-2.145zm1.593-5.15l11.948 3.196c-.368.605-.705 1.231-1.01 1.875l11.295 3.022c-.142.82-.368 1.612-.668 2.365l-11.55-3.09L.124 10.26l.015-.1.008-.049.01-.067.015-.087.018-.098c.026-.148.056-.295.088-.442l.028-.124.02-.085.024-.097c.022-.09.045-.18.07-.268l.028-.102.023-.083.03-.1.025-.082.03-.096.026-.082.031-.095a11.896 11.896 0 011.01-2.232zm4.442-4.4L17.352 4.59a20.77 20.77 0 00-1.688 1.721l7.823 2.093c.267.852.442 1.744.513 2.665L2.106 5.213l.045-.065.027-.04.04-.055.046-.065.055-.076.054-.072.064-.086.05-.065.057-.073.055-.07.06-.074.055-.069.065-.077.054-.066.066-.077.053-.06.072-.082.053-.06.067-.074.054-.058.073-.078.058-.06.063-.067.168-.17.1-.098.059-.056.076-.071a12.084 12.084 0 012.272-1.677zM12.017 0h.097l.082.001.069.001.054.002.068.002.046.001.076.003.047.002.06.003.054.002.087.005.105.007.144.011.088.007.044.004.077.008.082.008.047.005.102.012.05.006.108.014.081.01.042.006.065.01.207.032.07.012.065.011.14.026.092.018.11.022.046.01.075.016.041.01L14.7.3l.042.01.065.015.049.012.071.017.096.024.112.03.113.03.113.032.05.015.07.02.078.024.073.023.05.016.05.016.076.025.099.033.102.036.048.017.064.023.093.034.11.041.116.045.1.04.047.02.06.024.041.018.063.026.04.018.057.025.11.048.1.046.074.035.075.036.06.028.092.046.091.045.102.052.053.028.049.026.046.024.06.033.041.022.052.029.088.05.106.06.087.051.057.034.053.032.096.059.088.055.098.062.036.024.064.041.084.056.04.027.062.042.062.043.023.017c.054.037.108.075.161.114l.083.06.065.048.056.043.086.065.082.064.04.03.05.041.086.069.079.065.085.071c.712.6 1.353 1.283 1.909 2.031L7.222.994l.062-.027.065-.028.081-.034.086-.035c.113-.045.227-.09.341-.131l.096-.035.093-.033.084-.03.096-.031c.087-.03.176-.058.264-.085l.091-.027.086-.025.102-.03.085-.023.1-.026L9.04.37l.09-.023.091-.022.095-.022.09-.02.098-.021.091-.02.095-.018.092-.018.1-.018.091-.016.098-.017.092-.014.097-.015.092-.013.102-.013.091-.012.105-.012.09-.01.105-.01c.093-.01.186-.018.28-.024l.106-.008.09-.005.11-.006.093-.004.1-.004.097-.002.099-.002.197-.002z"}],morph:[{d:"M7.941 2c.23 0 .452.073.638.21.186.136.325.328.397.55l.593 1.814c.073.221.212.413.397.55.186.136.409.21.638.21h2.791c.23 0 .452-.074.638-.21a1.11 1.11 0 00.397-.55l.594-1.815a1.11 1.11 0 01.397-.55c.185-.136.408-.209.637-.209h1.7c.23 0 .453.073.639.21.185.136.324.328.397.55l.652 1.994c.118.361.41.635.77.728l2.957.752c.236.06.446.199.596.394.15.195.23.436.231.684v9.376c0 .248-.081.488-.231.684a1.09 1.09 0 01-.595.394l-2.957.752a1.086 1.086 0 00-.477.263 1.114 1.114 0 00-.293.465l-.653 1.994a1.11 1.11 0 01-.396.55c-.186.136-.41.21-.638.21h-1.702c-.229 0-.452-.073-.637-.21a1.11 1.11 0 01-.397-.55l-.364-1.11a1.131 1.131 0 01.15-1.002 1.074 1.074 0 01.885-.462h2.85c.29 0 .567-.116.772-.325.204-.208.32-.49.32-.785V6.444c0-.294-.116-.577-.32-.785a1.08 1.08 0 00-.771-.326h-3.273c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v7.778c0 .295-.114.578-.319.786a1.08 1.08 0 01-.771.325h-2.182a1.08 1.08 0 01-.771-.325 1.122 1.122 0 01-.32-.786V6.444c0-.294-.115-.577-.32-.785a1.081 1.081 0 00-.77-.326H5.454c-.29 0-.567.117-.772.326-.204.208-.32.49-.32.785v11.112c0 .294.116.577.32.785.205.209.482.326.772.326h2.85a1.075 1.075 0 01.885.461 1.122 1.122 0 01.15 1.001l-.364 1.112a1.11 1.11 0 01-.397.55c-.185.136-.408.209-.637.209H6.24c-.229 0-.452-.073-.638-.21a1.11 1.11 0 01-.397-.55l-.652-1.994a1.114 1.114 0 00-.294-.465 1.086 1.086 0 00-.477-.263l-2.956-.752a1.09 1.09 0 01-.595-.394A1.124 1.124 0 010 16.688V7.312c0-.248.081-.489.231-.684.15-.195.36-.334.595-.394l2.957-.753c.178-.045.342-.136.477-.263.134-.127.235-.287.293-.464l.653-1.995a1.11 1.11 0 01.397-.55C5.788 2.075 6.01 2 6.24 2h1.701z"}],nvidia:[{d:"M10.212 8.976V7.62c.127-.01.256-.017.388-.021 3.596-.117 5.957 3.184 5.957 3.184s-2.548 3.647-5.282 3.647a3.227 3.227 0 01-1.063-.175v-4.109c1.4.174 1.681.812 2.523 2.258l1.873-1.627a4.905 4.905 0 00-3.67-1.846 6.594 6.594 0 00-.729.044m0-4.476v2.025c.13-.01.259-.019.388-.024 5.002-.174 8.261 4.226 8.261 4.226s-3.743 4.69-7.643 4.69c-.338 0-.675-.031-1.007-.092v1.25c.278.038.558.057.838.057 3.629 0 6.253-1.91 8.794-4.169.421.347 2.146 1.193 2.501 1.564-2.416 2.083-8.048 3.763-11.24 3.763-.308 0-.603-.02-.894-.048V19.5H24v-15H10.21zm0 9.756v1.068c-3.356-.616-4.287-4.21-4.287-4.21a7.173 7.173 0 014.287-2.138v1.172h-.005a3.182 3.182 0 00-2.502 1.178s.615 2.276 2.507 2.931m-5.961-3.3c1.436-1.935 3.604-3.148 5.961-3.336V6.523C5.81 6.887 2 10.723 2 10.723s2.158 6.427 8.21 7.015v-1.166C5.77 16 4.25 10.958 4.25 10.958h-.002z"}],perplexity:[{d:"M19.785 0v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392 24v-6.465H1.5V7.188h2.884V0l7.053 6.494V.19h1.09v6.49L19.786 0zm-7.257 9.044v7.319l5.946 5.234V14.44l-5.946-5.397zm-1.099-.08l-5.946 5.398v7.235l5.946-5.234V8.965zm8.136 7.58h1.844V8.349H13.46l6.105 5.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475 2.476v4.71h5.115l-5.115-4.71zm13.219 0l-5.115 4.71h5.115v-4.71z"}],recraft:[{d:"M19.667 8.275c0-4.57-4.15-8.275-9.27-8.275-1.774 0-3.213 3.705-3.213 8.275 0 1.143.09 2.233.253 3.224H4.29L1 23h9.4v-6.447c5.117 0 9.266-3.707 9.266-8.275l.001-.002zm-9.27-6.76c.93 0 1.682 3.028 1.682 6.76 0 3.733-.752 6.76-1.681 6.76-.93 0-1.681-3.027-1.681-6.76 0-3.732.752-6.76 1.68-6.76z"},{d:"M19.848 16.552h-9.44L14.028 23h9.438l-3.618-6.448z"}],stepfun:[{d:"M12 0C5.372 0 0 5.372 0 12s5.372 12 12 12 12-5.372 12-12S18.628 0 12 0zM8.762 19.614H4.376v-4.386h4.386v4.386zm5.423 0H9.798v-4.386h4.387v4.386zm0-5.42H9.798V9.81h4.387v4.386zm0-5.418H9.798V4.39h4.387v4.386zm5.422-.004h-4.386V4.386h4.386v4.386z"}],tencent:[{d:"M12 0c6.627 0 12 5.373 12 12s-5.373 12-12 12S0 18.627 0 12 5.373 0 12 0zm1.652 1.123l-.01-.001c.533.097 1.023.233 1.41.404 6.084 2.683 7.396 9.214 1.601 14.338a3.781 3.781 0 01-5.337-.328 3.654 3.654 0 01-.884-3.044c-1.934.6-3.295 2.305-3.524 4.45-.204 1.912.324 4.044 2.056 5.634l.245.067C10.1 22.876 11.036 23 12 23c6.075 0 11-4.925 11-11 0-5.513-4.056-10.08-9.348-10.877zM2.748 6.21c-.178.269-.348.536-.51.803l-.235.394.078-.167A10.957 10.957 0 001 12c0 4.919 3.228 9.083 7.682 10.49l.214.065C3.523 18.528 2.84 14.149 6.47 8.68A2.234 2.234 0 102.748 6.21zm10.157-5.172c4.408 1.33 3.61 5.41 2.447 6.924-.86 1.117-2.922 1.46-3.708 2.238-.666.657-1.077 1.462-1.212 2.291A5.303 5.303 0 0112 12.258a5.672 5.672 0 001.404-11.169 10.51 10.51 0 00-.5-.052z"}],voyage:[{d:"M5.407 0v.066a.974.974 0 00-.048.245c-.011.11-.016.208-.016.295 0 .339.043.715.128 1.13.097.405.274.912.531 1.524l7.125 16.366L20.011 3.39c.161-.404.333-.846.515-1.327.182-.48.273-.966.273-1.458a1.406 1.406 0 00-.096-.54V0H24v.066c-.204.207-.45.578-.74 1.114-.29.535-.606 1.195-.949 1.982L13.095 24h-1.287L3.075 3.965c-.204-.47-.418-.923-.644-1.36-.214-.437-.418-.83-.61-1.18-.194-.36-.365-.66-.515-.9A5.666 5.666 0 001 .064V0h4.407z"}],xiaomi:[{d:"M12 0C8.016 0 4.756.255 2.493 2.516.23 4.776 0 8.033 0 12.012c0 3.98.23 7.235 2.494 9.497C4.757 23.77 8.017 24 12 24c3.983 0 7.243-.23 9.506-2.491C23.77 19.247 24 15.99 24 12.012c0-3.984-.233-7.243-2.502-9.504C19.234.252 15.978 0 12 0zM4.906 7.405h5.624c1.47 0 3.007.068 3.764.827.746.746.827 2.233.83 3.676v4.54a.15.15 0 0 1-.152.147h-1.947a.15.15 0 0 1-.152-.148V11.83c-.002-.806-.048-1.634-.464-2.051-.358-.36-1.026-.441-1.72-.458H7.158a.15.15 0 0 0-.151.147v6.98a.15.15 0 0 1-.152.148H4.906a.15.15 0 0 1-.15-.148V7.554a.15.15 0 0 1 .15-.149zm12.131 0h1.949a.15.15 0 0 1 .15.15v8.892a.15.15 0 0 1-.15.148h-1.949a.15.15 0 0 1-.151-.148V7.554a.15.15 0 0 1 .151-.149zM8.92 10.948h2.046c.083 0 .15.066.15.147v5.352a.15.15 0 0 1-.15.148H8.92a.15.15 0 0 1-.152-.148v-5.352a.15.15 0 0 1 .152-.147Z"}],zai:[{d:"M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"}]};function C({owner:a,className:c}){let d=A[a];if(d)return(0,b.jsx)(z.ProviderIcon,{provider:d,className:c});let e=B[a];return e?(0,b.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",fillRule:"evenodd",className:c,"aria-hidden":"true",children:e.map(a=>(0,b.jsx)("path",{d:a.d,opacity:a.opacity},a.d))}):null}function D({models:a,kind:c,value:d,loading:e,onPick:g}){let[i,j]=(0,f.useState)(!1),[l,m]=(0,f.useState)(""),[n,p]=(0,f.useState)("cheap"),[q,r]=(0,f.useState)(d),s=a.filter(a=>a.type===(c??o.GATEWAY_TEXT)),z=c?s:s.filter(a=>a.tags.includes(o.GATEWAY_TOOL_USE)),A=l.trim().toLowerCase(),B=(A?z.filter(a=>`${a.id} ${a.label}`.toLowerCase().includes(A)):z).slice().sort(F[n].compare);return(0,b.jsxs)(w.Dialog,{open:i,onOpenChange:a=>{j(a),a?r(d):m("")},children:[(0,b.jsxs)(w.DialogTrigger,{render:(0,b.jsx)("button",{type:"button","aria-label":"Model",className:(0,y.cn)(k.inputClassName,"relative flex items-center pr-8 text-left font-mono text-sm")}),children:[(0,b.jsx)("span",{className:(0,y.cn)("min-w-0 flex-1 truncate",!d&&"font-sans text-muted-foreground"),children:d||"Pick a model"}),(0,b.jsx)("span",{className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center text-muted-foreground",children:e&&0===z.length?(0,b.jsx)(t.LoaderCircle,{className:"size-3.5 animate-spin"}):(0,b.jsx)(u.Search,{className:"size-3.5"})})]}),(0,b.jsx)(w.DialogContent,{className:"h-[min(40rem,calc(100vh-3rem))] gap-0 overflow-hidden p-0 sm:max-w-2xl",children:(0,b.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[(0,b.jsxs)("div",{className:"shrink-0 space-y-1 px-6 pt-5 pb-4",children:[(0,b.jsxs)(w.DialogTitle,{className:"flex items-center gap-2.5 text-xl font-semibold",children:[(0,b.jsx)(v.VercelIcon,{className:"size-3.5"}),c?E[c]:"Text"," models"]}),(0,b.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:A?`${B.length} matching “${l.trim()}”`:c?`${z.length} on the gateway`:`${z.length} of ${s.length} on the gateway can call tools`})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-3 border-t border-border/60 px-6 py-3",children:[(0,b.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,b.jsx)(u.Search,{className:"pointer-events-none absolute top-1/2 left-2.5 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(k.Input,{autoFocus:!0,"aria-label":"Search models",placeholder:"name, id or provider",spellCheck:!1,value:l,onChange:a=>m(a.target.value),className:"h-8 pl-8 font-mono text-xs"})]}),(0,b.jsx)(x.Segmented,{"aria-label":"Sort",options:G,value:n,onChange:p})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-4 px-6 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground/60",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1",children:"model"}),(0,b.jsx)("span",{className:"w-28 text-right",children:"per 1M in / out"})]}),(0,b.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto border-t border-border/60",children:[B.map(a=>(0,b.jsx)(I,{model:a,picked:a.id===q,onPick:()=>r(a.id)},a.id)),0===B.length&&(0,b.jsxs)("div",{className:"flex flex-col items-start gap-2.5 p-10",children:[(0,b.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:A?`Nothing matches “${l.trim()}”.`:"Nothing on the shelf — search for an id."}),A&&(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(h.Button,{size:"sm",onClick:()=>r(l.trim()),children:["Use “",l.trim(),"” as the id"]}),(0,b.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>m(""),children:"Clear search"})]})]})]}),(0,b.jsxs)("div",{className:"flex h-14 shrink-0 items-center gap-3 border-t border-border/60 px-6",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:q||"Nothing picked — the field keeps what it has"}),(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),(0,b.jsx)(h.Button,{disabled:!q,onClick:()=>{g(q),j(!1)},children:"Use this model"})]})]})})]})}let E={image:"Image",video:"Video",speech:"Speech",transcription:"Transcription"},F={cheap:{label:"$↑",title:"Cheapest first",compare:(a,b)=>(a.price.in??1/0)-(b.price.in??1/0)},dear:{label:"$↓",title:"Dearest first",compare:(a,b)=>(b.price.in??-1)-(a.price.in??-1)},name:{label:"a–z",title:"By name",compare:(a,b)=>a.label.localeCompare(b.label)}},G=Object.keys(F).map(a=>({value:a,label:F[a].label,title:F[a].title})),H=a=>a>=1?a.toFixed(2):String(Number(a.toFixed(4)));function I({model:a,picked:d,onPick:e}){let{price:f}=a,g=null!==f.in||null!==f.out;return(0,b.jsxs)("button",{type:"button",onClick:e,className:(0,y.cn)("flex w-full items-center gap-4 border-b border-border/60 px-6 py-2.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",d?"bg-muted/40":"hover:bg-muted/50"),children:[(0,b.jsx)("span",{className:"grid size-[18px] shrink-0 place-items-center",children:(0,b.jsx)(C,{owner:a.owner,className:"size-[15px]"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:(0,y.cn)("truncate text-[13px]",d&&"font-medium"),children:a.label}),d&&(0,b.jsx)(c.Check,{className:"size-3.5 shrink-0"}),a.retiring&&(0,b.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:"retiring"})]}),(0,b.jsx)("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:a.id})]}),(0,b.jsxs)("span",{className:"flex w-28 shrink-0 flex-col items-end",children:[(0,b.jsx)("span",{className:(0,y.cn)("font-mono text-xs",g||f.free?"text-foreground":"text-muted-foreground"),children:f.free?"free":null===f.in&&null===f.out?f.note??"—":`${null===f.in?"—":H(f.in)} / ${null===f.out?"—":H(f.out)}`}),g&&f.note&&(0,b.jsx)("span",{className:"font-mono text-[9px] text-muted-foreground/70",children:f.note})]})]})}function J({provider:a,onSaved:c}){let[d,e]=(0,f.useState)(""),[i,j]=(0,m.useServerAction)(l.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{(0,n.revalidate)(g.queryKey.llmModel),(0,n.revalidate)(g.queryKey.config),c()}});return a.signIn?(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("p",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:"Runs on your plan once you sign in"}),(0,b.jsx)(s,{variant:"outline"})]}):(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(k.Input,{value:d,onChange:a=>e(a.target.value),placeholder:a.apiKeyName,spellCheck:!1,type:"password"}),(0,b.jsx)(h.Button,{variant:"outline",loading:j,disabled:d.trim().length<8,onClick:()=>i(a.apiKeyName,d),children:"Save key"})]})}a.s(["ModelPicker",0,function({provider:a,model:f,kind:k,unset:l,onChange:m}){let{data:p=[],mutate:q}=(0,n.useServerRoute)(g.queryKey.llmModel),r=k?p.filter(a=>(0,o.canMakeKind)(a.id,k)):p,s=r.find(b=>b.id===a),t="vercel-ai-gateway"===a,u=(0,n.useServerRoute)(t&&g.queryKey.modelCatalog),v=(k&&s?o.MEDIA_MODEL_PROVIDERS[s.id]?.models[k]??[]:s?.suggestModels??[]).map(a=>({value:a.id,label:a.label,badge:a.tier,hint:a.id}));return(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsxs)(j.DropdownMenu,{children:[(0,b.jsxs)(j.DropdownMenuTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",className:"shrink-0"}),children:[s?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.ProviderIcon,{provider:s.id,className:"size-4"}),s.label]}):(0,b.jsx)("span",{className:"text-muted-foreground",children:l??(k?"Not picked":"App default")}),(0,b.jsx)(d.ChevronDown,{className:"size-3.5 text-muted-foreground"})]}),(0,b.jsx)(j.DropdownMenuContent,{align:"start",children:r.map(d=>(0,b.jsxs)(j.DropdownMenuItem,{onClick:()=>m({provider:d.id,model:""}),children:[(0,b.jsx)(z.ProviderIcon,{provider:d.id,className:"size-4"}),d.label,d.hasKey?d.id===a&&(0,b.jsx)(c.Check,{className:"ml-auto size-3.5"}):(0,b.jsx)(e.KeyRound,{className:"ml-auto size-3 text-muted-foreground"})]},d.id))})]}),t&&s&&!u.error?(0,b.jsx)(D,{models:u.data??[],kind:k,value:f,loading:u.isLoading,onPick:a=>m({provider:s.id,model:a})}):(0,b.jsx)(i.Combobox,{value:f,onChange:a=>s&&m({provider:s.id,model:a}),options:v,disabled:!s?.hasKey,"aria-label":"Model",placeholder:s?"Type a model id":"Pick a provider",empty:u.error?"Could not read the catalog — type an id":"Not on the list — it still runs",className:"flex-1"})]}),s&&!s.hasKey&&(0,b.jsx)(J,{provider:s,onSaved:()=>q()}),t&&u.error&&(0,b.jsx)("p",{className:"px-1 font-mono text-[11px] text-destructive",children:u.error.message})]})}],608902)},477804,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fde39230efc27b270e4135e1dbc5c3f5c21149804",b.callServer,void 0,b.findSourceMapURL,"setConfigAction");a.s(["setConfigAction",0,c])},126766,a=>{"use strict";var b=a.i(164831);let c={name:"key-round",size:24,node:[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]};c.node;let d=(0,b.default)(c);a.s(["KeyRound",0,d],126766)}];
2
+
3
+ //# sourceMappingURL=_1gd8q8l._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[703228,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(263359),f=a.i(689594),g=a.i(707963),h=a.i(141146),i=a.i(998697),j=a.i(483138),k=a.i(69095),l=a.i(696732),m=a.i(567826),n=a.i(403512),o=a.i(233540),p=a.i(917256),q=a.i(951675),r=a.i(201661),s=a.i(572131),t=a.i(767561),u=a.i(340695),v=a.i(316474),w=a.i(205522),x=a.i(846991),y=a.i(446181),z=a.i(950463),A=a.i(280281),B=a.i(621958),C=a.i(546893),D=a.i(287702),E=a.i(619477),F=a.i(838682),G=a.i(601219),H=a.i(359633),I=a.i(777525),J=a.i(313237),K=a.i(759497),L=a.i(497895),M=b([x]);[x]=M.then?(await M)():M;let W={browser:l.Globe,computer:e.AppWindow,"find-skills":o.Search,"interactive-page":m.MousePointer2,"skill-creator":p.SquarePen};function N({skill:a}){let[b,c]=(0,J.useServerAction)(G.deleteSkillAction,{onOk:()=>(0,K.revalidate)(t.queryKey.skills)}),[e]=(0,J.useServerAction)(H.setSkillDisabledAction,{onOk:()=>(0,K.revalidate)(t.queryKey.skills)}),g=async()=>{await y.notify.confirm({title:`Delete ${a.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&b(a.dir)},i="default"===a.source&&W[a.dir]||f.BookMarked;return(0,d.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{var b;return b=a,y.notify.component({className:"sm:max-w-4xl",renderer:()=>(0,d.jsx)(O,{skill:b})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)("span",{className:(0,L.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",a.disabled&&"opacity-45"),children:(0,d.jsx)(i,{className:"size-4"})}),(0,d.jsxs)("span",{className:(0,L.cn)("min-w-0 flex-1 space-y-0.5",a.disabled&&"opacity-45"),children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium",children:a.name}),(0,d.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description})]}),(0,d.jsx)(h.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,d.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,d.jsx)(A.Switch,{checked:!a.disabled,onCheckedChange:b=>e(a.source,a.dir,!b),"aria-label":`${a.name} on or off`,className:"shrink-0"}),"custom"===a.source?(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost",loading:c,onClick:g,className:"shrink-0 text-muted-foreground",children:(0,d.jsx)(q.Trash2,{})}):(0,d.jsx)("span",{className:"size-7 shrink-0"})]})]})}function O({skill:a}){let[b,c]=(0,s.useState)(""),[e,f]=(0,s.useState)("SKILL.md");return(0,d.jsx)(E.SettingDialogContent,{title:a.name,description:(0,d.jsx)(P,{skill:a,path:e??b}),children:(0,d.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,d.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[b&&(0,d.jsxs)("button",{type:"button",onClick:()=>c(b.split("/").slice(0,-1).join("/")),className:"mx-1 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)(g.ChevronLeft,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:b.split("/").pop()})]}),(0,d.jsx)(R,{source:a.source,dir:a.dir,path:b,current:e,onPick:a=>{let d=b?`${b}/${a.name}`:a.name;"dir"===a.kind?c(d):f(d)}})]}),(0,d.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e?(0,d.jsx)(T,{source:a.source,dir:a.dir,path:e}):(0,d.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function P({skill:a,path:b}){if(!a)return(0,d.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let c=[a.name,...b.split("/").filter(Boolean)];return(0,d.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:c.map((a,b)=>(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[b>0&&(0,d.jsx)(h.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,d.jsx)("span",{className:(0,L.cn)("truncate",b===c.length-1&&"text-foreground"),children:a})]},`${b}-${a}`))})}function Q({icon:a,label:b,active:c,hasChildren:e,onClick:f}){return(0,d.jsxs)("button",{type:"button",onClick:f,className:(0,L.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",c?"bg-secondary text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:a}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:b}),e&&(0,d.jsx)(h.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function R({source:a,dir:b,path:c,current:e,onPick:f}){let{data:g,isLoading:h,error:l}=(0,K.useServerRoute)(t.queryKey.skillNode(a,b,c));return l?(0,d.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:l.message}):h||!g?(0,d.jsxs)("div",{className:"space-y-2 p-2",children:[(0,d.jsx)(z.Skeleton,{className:"h-5 w-full"}),(0,d.jsx)(z.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==g.kind?null:(0,d.jsxs)(d.Fragment,{children:[g.entries.map(a=>(0,d.jsx)(Q,{icon:"dir"===a.kind?(0,d.jsx)(k.Folder,{}):a.name.endsWith(".md")?(0,d.jsx)(j.FileText,{}):(0,d.jsx)(i.File,{}),label:a.name,hasChildren:"dir"===a.kind,active:(c?`${c}/${a.name}`:a.name)===e,onClick:()=>f(a)},a.name)),0===g.entries.length&&(0,d.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function S({content:a}){let b=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(a),c=b?.[1].trim(),e=b?a.slice(b[0].length):a;return(0,d.jsxs)("div",{className:"min-w-0",children:[c&&(0,d.jsx)("pre",{className:"border-b border-border/60 bg-muted/20 px-5 py-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground",children:c}),(0,d.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,d.jsx)(x.Markdown,{children:e})})]})}function T({source:a,dir:b,path:c}){let{data:e,isLoading:f,error:g}=(0,K.useServerRoute)(t.queryKey.skillNode(a,b,c));if(g)return(0,d.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:g.message});if(f||!e)return(0,d.jsxs)("div",{className:"space-y-3 p-5",children:[(0,d.jsx)(z.Skeleton,{className:"h-5 w-2/3"}),(0,d.jsx)(z.Skeleton,{className:"h-4 w-full"}),(0,d.jsx)(z.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==e.kind)return null;let h=c.split("/").pop()??"";return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,d.jsx)("span",{className:"truncate",children:h}),(0,d.jsx)("span",{className:"shrink-0",children:(0,L.formatBytes)(e.size)})]}),null===e.content?(0,d.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:"Not a text file — the agent can still read it from disk."}):h.toLowerCase().endsWith(".md")?(0,d.jsx)(S,{content:e.content}):(0,d.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:e.content})]})}function U(){return y.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,d.jsx)(V,{onDone:a})})}function V({onDone:a}){let[b,c]=(0,s.useState)("write"),[e,f]=(0,s.useState)(""),[g,h]=(0,s.useState)(""),[i,j]=(0,s.useState)(""),[k,l]=(0,s.useState)(null),[m,o]=(0,s.useState)(!1),p=(0,s.useRef)(null),q={errorMessage:!1,onOk:()=>{(0,K.revalidate)(t.queryKey.skills),a()}},[x,y,,z]=(0,J.useServerAction)(F.createSkillAction,q),[A,G,,H]=(0,J.useServerAction)(I.uploadSkillAction,q),M=y||G,N="write"===b?z:H,O=!M&&("write"===b?e.trim()&&g.trim()&&i.trim():null!==k),P=async()=>{var a;!O||("write"===b?x({name:e.trim(),description:g.trim(),content:i}):k&&A({fileName:k.name,base64:await (a=k,new Promise((b,c)=>{let d=new FileReader;d.onload=()=>{let a=d.result;b(a.slice(a.indexOf(",")+1))},d.onerror=()=>c(d.error),d.readAsDataURL(a)}))}))},Q=a=>{let b=a?.[0]??null;b&&l(b)};return(0,d.jsxs)(E.SettingDialogContent,{title:"New skill",description:"Instructions the agent loads by name when a task calls for them.",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u.Button,{variant:"ghost",onClick:a,children:"Cancel"}),(0,d.jsxs)(u.Button,{disabled:!O,loading:M,onClick:P,children:[!M&&("write"===b?(0,d.jsx)(n.Plus,{}):(0,d.jsx)(r.Upload,{})),"write"===b?"Create":"Upload"]})]}),children:[(0,d.jsxs)(B.Tabs,{value:b,onValueChange:a=>c(a),children:[(0,d.jsxs)(B.TabsList,{className:"w-full",children:[(0,d.jsx)(B.TabsTrigger,{value:"write",children:"Write"}),(0,d.jsx)(B.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,d.jsxs)(B.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,d.jsxs)(v.FieldContent,{children:[(0,d.jsx)(w.Input,{id:"skill-name",value:e,onChange:a=>f(a.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,d.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[D.PATHS.skills.custom,"/",e.trim()||"…","/SKILL.md"]})]})]}),(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,d.jsx)(v.FieldContent,{children:(0,d.jsx)(w.Input,{id:"skill-description",value:g,onChange:a=>h(a.target.value),placeholder:"When to use it — this is how the agent decides to load it"})})]}),(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,d.jsx)(C.Textarea,{id:"skill-content",value:i,onChange:a=>j(a.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,d.jsxs)(B.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:a=>{a.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:a=>{a.preventDefault(),o(!1),Q(a.dataTransfer.files)},className:(0,L.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",m?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,d.jsx)(r.Upload,{className:"size-5 text-muted-foreground"}),k?(0,d.jsxs)("span",{className:"text-sm",children:[k.name,(0,d.jsx)("span",{className:"ml-2 font-mono text-[11px] text-muted-foreground",children:(0,L.formatBytes)(k.size)})]}):(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,d.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:a=>Q(a.target.files)}),(0,d.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,d.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,d.jsxs)("p",{children:["A ",(0,d.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,d.jsxs)("p",{children:["A ",(0,d.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,d.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]})]})]})]}),N&&(0,d.jsx)("p",{className:"font-mono text-xs text-destructive",children:N})]})}a.s(["SkillsSetting",0,function(){let[a,b]=(0,s.useState)(""),{data:c,isLoading:e,error:f}=(0,K.useServerRoute)(t.queryKey.skills),g=c??[];if(e)return(0,d.jsx)(E.SettingSkeleton,{rows:4});if(f)return(0,d.jsx)(E.SettingError,{message:f.message});let h=a.trim().toLowerCase(),i=g.filter(a=>!h||`${a.name} ${a.description}`.toLowerCase().includes(h)),j=g.filter(a=>!a.disabled).length;return(0,d.jsxs)(E.SettingScreen,{footer:(0,d.jsxs)(E.SettingRailNote,{children:[g.filter(a=>"default"===a.source).length," shipped · ",g.filter(a=>"custom"===a.source).length," ","installed"]}),children:[(0,d.jsx)(E.SettingToolbar,{count:`${j} on \xb7 ${g.length-j} off`,children:(0,d.jsx)(E.SettingFilter,{value:a,onChange:b,placeholder:"Filter skills"})}),(0,d.jsx)(E.SettingGroup,{label:"Custom",hint:"yours — added here · wins a name clash",children:(0,d.jsx)(E.SettingItems,{addRow:{label:"Add skill",onClick:U},children:i.filter(a=>"custom"===a.source).map(a=>(0,d.jsx)(N,{skill:a},`custom/${a.dir}`))})}),(0,d.jsx)(E.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,d.jsx)(E.SettingItems,{children:i.filter(a=>"default"===a.source).map(a=>(0,d.jsx)(N,{skill:a},`default/${a.dir}`))})}),j>D.PROMPT_CROWDED.skills&&(0,d.jsxs)(E.SettingNote,{children:[j," skills are on. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})},"openSkillCreate",0,U]),c()}catch(a){c(a)}},!1),838682,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f4c8e0df06465e086f180ebe8fbf4a998603ad4a9",b.callServer,void 0,b.findSourceMapURL,"createSkillAction");a.s(["createSkillAction",0,c])},601219,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f354f08dd6a308f78069ff1a519a6718a4b47f2c2",b.callServer,void 0,b.findSourceMapURL,"deleteSkillAction");a.s(["deleteSkillAction",0,c])},359633,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f74e6d1aa460ff57d58d6f80d820fb3e3ce696d9c",b.callServer,void 0,b.findSourceMapURL,"setSkillDisabledAction");a.s(["setSkillDisabledAction",0,c])},777525,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f909a59045a8bbce06ccfddff2f1d96dedb7eb96f",b.callServer,void 0,b.findSourceMapURL,"uploadSkillAction");a.s(["uploadSkillAction",0,c])},263359,a=>{"use strict";var b=a.i(164831);let c={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};c.node;let d=(0,b.default)(c);a.s(["AppWindow",0,d],263359)},567826,a=>{"use strict";var b=a.i(164831);let c={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};c.node;let d=(0,b.default)(c);a.s(["MousePointer2",0,d],567826)},917256,a=>{"use strict";var b=a.i(164831);let c={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};c.node;let d=(0,b.default)(c);a.s(["SquarePen",0,d],917256)},201661,a=>{"use strict";var b=a.i(164831);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let d=(0,b.default)(c);a.s(["Upload",0,d],201661)}];
1
+ module.exports=[703228,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(263359),f=a.i(689594),g=a.i(707963),h=a.i(141146),i=a.i(998697),j=a.i(483138),k=a.i(69095),l=a.i(696732),m=a.i(567826),n=a.i(403512),o=a.i(233540),p=a.i(917256),q=a.i(951675),r=a.i(201661),s=a.i(572131),t=a.i(767561),u=a.i(340695),v=a.i(316474),w=a.i(205522),x=a.i(846991),y=a.i(446181),z=a.i(950463),A=a.i(280281),B=a.i(621958),C=a.i(546893),D=a.i(287702),E=a.i(619477),F=a.i(210465),G=a.i(991381),H=a.i(145291),I=a.i(807169),J=a.i(313237),K=a.i(759497),L=a.i(497895),M=b([x]);[x]=M.then?(await M)():M;let W={browser:l.Globe,computer:e.AppWindow,"find-skills":o.Search,"interactive-page":m.MousePointer2,"skill-creator":p.SquarePen};function N({skill:a}){let[b,c]=(0,J.useServerAction)(G.deleteSkillAction,{onOk:()=>(0,K.revalidate)(t.queryKey.skills)}),[e]=(0,J.useServerAction)(H.setSkillDisabledAction,{onOk:()=>(0,K.revalidate)(t.queryKey.skills)}),g=async()=>{await y.notify.confirm({title:`Delete ${a.name}?`,description:"Every file in this skill is deleted for good.",okText:"Delete",destructive:!0})&&b(a.dir)},i="default"===a.source&&W[a.dir]||f.BookMarked;return(0,d.jsxs)("div",{className:"group flex items-center transition-colors hover:bg-muted/50",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{var b;return b=a,y.notify.component({className:"sm:max-w-4xl",renderer:()=>(0,d.jsx)(O,{skill:b})})},className:"flex min-w-0 flex-1 items-center gap-3 py-4 pl-4 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)("span",{className:(0,L.cn)("grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",a.disabled&&"opacity-45"),children:(0,d.jsx)(i,{className:"size-4"})}),(0,d.jsxs)("span",{className:(0,L.cn)("min-w-0 flex-1 space-y-0.5",a.disabled&&"opacity-45"),children:[(0,d.jsx)("span",{className:"block truncate text-sm font-medium",children:a.name}),(0,d.jsx)("span",{className:"line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description})]}),(0,d.jsx)(h.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 group-hover:text-foreground"})]}),(0,d.jsxs)("div",{className:"mr-4 ml-5 flex w-18 shrink-0 items-center justify-end gap-3",children:[(0,d.jsx)(A.Switch,{checked:!a.disabled,onCheckedChange:b=>e(a.source,a.dir,!b),"aria-label":`${a.name} on or off`,className:"shrink-0"}),"custom"===a.source?(0,d.jsx)(u.Button,{size:"icon-sm",variant:"ghost",loading:c,onClick:g,className:"shrink-0 text-muted-foreground",children:(0,d.jsx)(q.Trash2,{})}):(0,d.jsx)("span",{className:"size-7 shrink-0"})]})]})}function O({skill:a}){let[b,c]=(0,s.useState)(""),[e,f]=(0,s.useState)("SKILL.md");return(0,d.jsx)(E.SettingDialogContent,{title:a.name,description:(0,d.jsx)(P,{skill:a,path:e??b}),children:(0,d.jsxs)("div",{className:"flex h-[36rem] divide-x divide-border/60 overflow-hidden rounded-xl border border-border/60 bg-background",children:[(0,d.jsxs)("div",{className:"flex w-44 shrink-0 flex-col overflow-y-auto bg-muted/20 py-1",children:[b&&(0,d.jsxs)("button",{type:"button",onClick:()=>c(b.split("/").slice(0,-1).join("/")),className:"mx-1 mb-1 flex items-center gap-1 rounded-md px-2 py-1 text-left font-mono text-[11px] text-muted-foreground outline-none hover:bg-muted/50 hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,d.jsx)(g.ChevronLeft,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:b.split("/").pop()})]}),(0,d.jsx)(R,{source:a.source,dir:a.dir,path:b,current:e,onPick:a=>{let d=b?`${b}/${a.name}`:a.name;"dir"===a.kind?c(d):f(d)}})]}),(0,d.jsx)("div",{className:"min-w-0 flex-1 overflow-y-auto",children:e?(0,d.jsx)(T,{source:a.source,dir:a.dir,path:e}):(0,d.jsx)("p",{className:"p-6 text-sm text-muted-foreground/60",children:"Pick a file"})})]})})}function P({skill:a,path:b}){if(!a)return(0,d.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/60",children:"Pick a skill"});let c=[a.name,...b.split("/").filter(Boolean)];return(0,d.jsx)("span",{className:"flex min-w-0 items-center gap-1 font-mono text-[11px] text-muted-foreground",children:c.map((a,b)=>(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[b>0&&(0,d.jsx)(h.ChevronRight,{className:"size-3 shrink-0 opacity-50"}),(0,d.jsx)("span",{className:(0,L.cn)("truncate",b===c.length-1&&"text-foreground"),children:a})]},`${b}-${a}`))})}function Q({icon:a,label:b,active:c,hasChildren:e,onClick:f}){return(0,d.jsxs)("button",{type:"button",onClick:f,className:(0,L.cn)("mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-left text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",c?"bg-secondary text-foreground":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70 [&>svg]:size-3",children:a}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:b}),e&&(0,d.jsx)(h.ChevronRight,{className:"size-3 shrink-0 text-muted-foreground/50"})]})}function R({source:a,dir:b,path:c,current:e,onPick:f}){let{data:g,isLoading:h,error:l}=(0,K.useServerRoute)(t.queryKey.skillNode(a,b,c));return l?(0,d.jsx)("p",{className:"p-3 font-mono text-xs text-destructive",children:l.message}):h||!g?(0,d.jsxs)("div",{className:"space-y-2 p-2",children:[(0,d.jsx)(z.Skeleton,{className:"h-5 w-full"}),(0,d.jsx)(z.Skeleton,{className:"h-5 w-4/5"})]}):"dir"!==g.kind?null:(0,d.jsxs)(d.Fragment,{children:[g.entries.map(a=>(0,d.jsx)(Q,{icon:"dir"===a.kind?(0,d.jsx)(k.Folder,{}):a.name.endsWith(".md")?(0,d.jsx)(j.FileText,{}):(0,d.jsx)(i.File,{}),label:a.name,hasChildren:"dir"===a.kind,active:(c?`${c}/${a.name}`:a.name)===e,onClick:()=>f(a)},a.name)),0===g.entries.length&&(0,d.jsx)("p",{className:"p-3 text-xs text-muted-foreground/60",children:"Empty folder"})]})}function S({content:a}){let b=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(a),c=b?.[1].trim(),e=b?a.slice(b[0].length):a;return(0,d.jsxs)("div",{className:"min-w-0",children:[c&&(0,d.jsx)("pre",{className:"border-b border-border/60 bg-muted/20 px-5 py-3 font-mono text-[11px] leading-relaxed whitespace-pre-wrap text-muted-foreground",children:c}),(0,d.jsx)("div",{className:"px-5 py-4 text-sm leading-relaxed",children:(0,d.jsx)(x.Markdown,{children:e})})]})}function T({source:a,dir:b,path:c}){let{data:e,isLoading:f,error:g}=(0,K.useServerRoute)(t.queryKey.skillNode(a,b,c));if(g)return(0,d.jsx)("p",{className:"p-4 font-mono text-xs text-destructive",children:g.message});if(f||!e)return(0,d.jsxs)("div",{className:"space-y-3 p-5",children:[(0,d.jsx)(z.Skeleton,{className:"h-5 w-2/3"}),(0,d.jsx)(z.Skeleton,{className:"h-4 w-full"}),(0,d.jsx)(z.Skeleton,{className:"h-4 w-5/6"})]});if("file"!==e.kind)return null;let h=c.split("/").pop()??"";return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between gap-2 border-b border-border/60 bg-background/90 px-5 py-2 font-mono text-[11px] text-muted-foreground backdrop-blur",children:[(0,d.jsx)("span",{className:"truncate",children:h}),(0,d.jsx)("span",{className:"shrink-0",children:(0,L.formatBytes)(e.size)})]}),null===e.content?(0,d.jsx)("p",{className:"px-5 py-4 text-sm text-muted-foreground/60",children:"Not a text file — the agent can still read it from disk."}):h.toLowerCase().endsWith(".md")?(0,d.jsx)(S,{content:e.content}):(0,d.jsx)("pre",{className:"overflow-x-auto px-5 py-4 font-mono text-[13px] leading-relaxed whitespace-pre text-foreground/90",children:e.content})]})}function U(){return y.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,d.jsx)(V,{onDone:a})})}function V({onDone:a}){let[b,c]=(0,s.useState)("write"),[e,f]=(0,s.useState)(""),[g,h]=(0,s.useState)(""),[i,j]=(0,s.useState)(""),[k,l]=(0,s.useState)(null),[m,o]=(0,s.useState)(!1),p=(0,s.useRef)(null),q={errorMessage:!1,onOk:()=>{(0,K.revalidate)(t.queryKey.skills),a()}},[x,y,,z]=(0,J.useServerAction)(F.createSkillAction,q),[A,G,,H]=(0,J.useServerAction)(I.uploadSkillAction,q),M=y||G,N="write"===b?z:H,O=!M&&("write"===b?e.trim()&&g.trim()&&i.trim():null!==k),P=async()=>{var a;!O||("write"===b?x({name:e.trim(),description:g.trim(),content:i}):k&&A({fileName:k.name,base64:await (a=k,new Promise((b,c)=>{let d=new FileReader;d.onload=()=>{let a=d.result;b(a.slice(a.indexOf(",")+1))},d.onerror=()=>c(d.error),d.readAsDataURL(a)}))}))},Q=a=>{let b=a?.[0]??null;b&&l(b)};return(0,d.jsxs)(E.SettingDialogContent,{title:"New skill",description:"Instructions the agent loads by name when a task calls for them.",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u.Button,{variant:"ghost",onClick:a,children:"Cancel"}),(0,d.jsxs)(u.Button,{disabled:!O,loading:M,onClick:P,children:[!M&&("write"===b?(0,d.jsx)(n.Plus,{}):(0,d.jsx)(r.Upload,{})),"write"===b?"Create":"Upload"]})]}),children:[(0,d.jsxs)(B.Tabs,{value:b,onValueChange:a=>c(a),children:[(0,d.jsxs)(B.TabsList,{className:"w-full",children:[(0,d.jsx)(B.TabsTrigger,{value:"write",children:"Write"}),(0,d.jsx)(B.TabsTrigger,{value:"upload",children:"Upload"})]}),(0,d.jsxs)(B.TabsContent,{value:"write",className:"space-y-5 pt-4",children:[(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-name",children:"Name"}),(0,d.jsxs)(v.FieldContent,{children:[(0,d.jsx)(w.Input,{id:"skill-name",value:e,onChange:a=>f(a.target.value),placeholder:"deploy-checklist",spellCheck:!1,autoFocus:!0}),(0,d.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[D.PATHS.skills.custom,"/",e.trim()||"…","/SKILL.md"]})]})]}),(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-description",children:"Description"}),(0,d.jsx)(v.FieldContent,{children:(0,d.jsx)(w.Input,{id:"skill-description",value:g,onChange:a=>h(a.target.value),placeholder:"When to use it — this is how the agent decides to load it"})})]}),(0,d.jsxs)(v.Field,{children:[(0,d.jsx)(v.FieldLabel,{htmlFor:"skill-content",children:"Content"}),(0,d.jsx)(C.Textarea,{id:"skill-content",value:i,onChange:a=>j(a.target.value),placeholder:"Markdown. The steps, the rules, the examples.",className:"min-h-40 resize-none font-mono text-xs"})]})]}),(0,d.jsxs)(B.TabsContent,{value:"upload",className:"space-y-4 pt-4",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>p.current?.click(),onDragOver:a=>{a.preventDefault(),o(!0)},onDragLeave:()=>o(!1),onDrop:a=>{a.preventDefault(),o(!1),Q(a.dataTransfer.files)},className:(0,L.cn)("flex w-full flex-col items-center gap-2 rounded-xl border border-dashed px-6 py-10 text-center outline-none transition-colors focus-visible:ring-3 focus-visible:ring-ring/50",m?"border-foreground/60 bg-muted/60":"border-border hover:bg-muted/40"),children:[(0,d.jsx)(r.Upload,{className:"size-5 text-muted-foreground"}),k?(0,d.jsxs)("span",{className:"text-sm",children:[k.name,(0,d.jsx)("span",{className:"ml-2 font-mono text-[11px] text-muted-foreground",children:(0,L.formatBytes)(k.size)})]}):(0,d.jsx)("span",{className:"text-sm text-muted-foreground",children:"Drop a file here, or click to choose"})]}),(0,d.jsx)("input",{ref:p,type:"file",accept:".md,.zip,.skill",className:"hidden",onChange:a=>Q(a.target.files)}),(0,d.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,d.jsx)("p",{className:"font-medium text-foreground/80",children:"File requirements"}),(0,d.jsxs)("p",{children:["A ",(0,d.jsx)("span",{className:"font-mono",children:".md"})," file needs a YAML block with the skill's name and description."]}),(0,d.jsxs)("p",{children:["A ",(0,d.jsx)("span",{className:"font-mono",children:".zip"})," or"," ",(0,d.jsx)("span",{className:"font-mono",children:".skill"})," archive needs a SKILL.md inside — the rest of its folder comes along."]})]})]})]}),N&&(0,d.jsx)("p",{className:"font-mono text-xs text-destructive",children:N})]})}a.s(["SkillsSetting",0,function(){let[a,b]=(0,s.useState)(""),{data:c,isLoading:e,error:f}=(0,K.useServerRoute)(t.queryKey.skills),g=c??[];if(e)return(0,d.jsx)(E.SettingSkeleton,{rows:4});if(f)return(0,d.jsx)(E.SettingError,{message:f.message});let h=a.trim().toLowerCase(),i=g.filter(a=>!h||`${a.name} ${a.description}`.toLowerCase().includes(h)),j=g.filter(a=>!a.disabled).length;return(0,d.jsxs)(E.SettingScreen,{footer:(0,d.jsxs)(E.SettingRailNote,{children:[g.filter(a=>"default"===a.source).length," shipped · ",g.filter(a=>"custom"===a.source).length," ","installed"]}),children:[(0,d.jsx)(E.SettingToolbar,{count:`${j} on \xb7 ${g.length-j} off`,children:(0,d.jsx)(E.SettingFilter,{value:a,onChange:b,placeholder:"Filter skills"})}),(0,d.jsx)(E.SettingGroup,{label:"Custom",hint:"yours — added here · wins a name clash",children:(0,d.jsx)(E.SettingItems,{addRow:{label:"Add skill",onClick:U},children:i.filter(a=>"custom"===a.source).map(a=>(0,d.jsx)(N,{skill:a},`custom/${a.dir}`))})}),(0,d.jsx)(E.SettingGroup,{label:"Default",hint:"ships with the app · switch off, can't edit or delete",children:(0,d.jsx)(E.SettingItems,{children:i.filter(a=>"default"===a.source).map(a=>(0,d.jsx)(N,{skill:a},`default/${a.dir}`))})}),j>D.PROMPT_CROWDED.skills&&(0,d.jsxs)(E.SettingNote,{children:[j," skills are on. Each is a line in every prompt a bot reads, and one more to look past when it picks."]})]})},"openSkillCreate",0,U]),c()}catch(a){c(a)}},!1),210465,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f6ea0b94fed342484ac46cbadf1b8c4a65574103d",b.callServer,void 0,b.findSourceMapURL,"createSkillAction");a.s(["createSkillAction",0,c])},991381,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f5d8a58afc993b28e0d65ceb273bbc1563a5a0f96",b.callServer,void 0,b.findSourceMapURL,"deleteSkillAction");a.s(["deleteSkillAction",0,c])},145291,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7ff3e5663097e128448f141172ac1d19851ee8456b",b.callServer,void 0,b.findSourceMapURL,"setSkillDisabledAction");a.s(["setSkillDisabledAction",0,c])},807169,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fee438d730e3bae9a984816f037af1ba292df2e98",b.callServer,void 0,b.findSourceMapURL,"uploadSkillAction");a.s(["uploadSkillAction",0,c])},263359,a=>{"use strict";var b=a.i(164831);let c={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};c.node;let d=(0,b.default)(c);a.s(["AppWindow",0,d],263359)},567826,a=>{"use strict";var b=a.i(164831);let c={name:"mouse-pointer-2",size:24,node:[["path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",key:"edeuup"}]]};c.node;let d=(0,b.default)(c);a.s(["MousePointer2",0,d],567826)},917256,a=>{"use strict";var b=a.i(164831);let c={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};c.node;let d=(0,b.default)(c);a.s(["SquarePen",0,d],917256)},201661,a=>{"use strict";var b=a.i(164831);let c={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};c.node;let d=(0,b.default)(c);a.s(["Upload",0,d],201661)}];
2
2
 
3
- //# sourceMappingURL=_1m3bsfr._.js.map
3
+ //# sourceMappingURL=_1h0rw11._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[673701,a=>{"use strict";var b=a.i(187924),c=a.i(676459),d=a.i(926184),e=a.i(400187),f=a.i(497895);let g=(0,e.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,e.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"}}),a.s(["Bubble",0,function({variant:a="default",align:c="start",className:d,...e}){return(0,b.jsx)("div",{"data-slot":"bubble","data-variant":a,"data-align":c,className:(0,f.cn)(g({variant:a}),d),...e})},"BubbleContent",0,function({className:a,render:b,...e}){var g;return g={defaultTagName:"div",props:(0,c.mergeProps)({className:(0,f.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",a)},e),render:b,state:{slot:"bubble-content"}},(0,d.useRenderElement)(g.defaultTagName??"div",g,g)}],673701)},613350,a=>{"use strict";var b=a.i(187924),c=a.i(589027),d=a.i(572131),e=a.i(497895);a.s(["FoldedText",0,function({text:a,subject:f,clamp:g="line-clamp-3",tall:h="max-h-40",className:i}){let[j,k]=(0,d.useState)(!1),[l,m]=(0,d.useState)(!1),n=(0,d.useRef)(null);return(0,d.useEffect)(()=>k(!1),[a]),(0,d.useEffect)(()=>{let a=n.current;a&&!j&&m(a.scrollHeight>a.clientHeight+1)},[j,a]),(0,b.jsxs)("div",{className:(0,e.cn)("flex items-start gap-1",i),children:[(0,b.jsx)("p",{ref:n,className:(0,e.cn)("min-w-0 flex-1 text-[13px] leading-snug break-keep",j?(0,e.cn)(h,"overflow-y-auto scrollbar-none"):g),children:a}),(l||j)&&(0,b.jsx)("button",{type:"button",onClick:()=>k(a=>!a),"aria-label":j?`Fold the ${f}`:`Read the whole ${f}`,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,b.jsx)(c.ChevronDown,{className:(0,e.cn)("size-3.5",j&&"rotate-180")})})]})}])},467268,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(256711),f=a.i(327598),g=a.i(752562),h=a.i(589027),i=a.i(707963),j=a.i(141146),k=a.i(231500),l=a.i(585650),m=a.i(425256),n=a.i(875160),o=a.i(403512),p=a.i(748819),q=a.i(474215),r=a.i(572131),s=a.i(767561),t=a.i(673701),u=a.i(340695),v=a.i(613350),w=a.i(846991),x=a.i(545097),y=a.i(546893),z=a.i(864037),A=a.i(647812),B=a.i(411509),C=a.i(913834),D=a.i(42380),E=a.i(16716),F=a.i(394440),G=a.i(28996),H=a.i(346075),I=a.i(369768),J=a.i(199169),K=a.i(313237),L=a.i(759497),M=a.i(497895),N=a.i(324835),O=a.i(777279),P=a.i(8468),Q=b([w,E,I,P]);[w,E,I,P]=Q.then?(await Q)():Q;let at=(0,r.memo)(function(){let a=(0,O.useBotTasks)(),{data:b}=(0,L.useServerRoute)(s.queryKey.bot),[c,e]=(0,r.useState)(!1),[f,g]=(0,r.useState)(null),[h,i]=(0,r.useState)(!1),j=[...a].reverse(),k=f?j.find(a=>a.id===f)??null:null,[l,m]=function(){let[a,b]=(0,r.useState)(new Map),c=(0,r.useRef)(new Map);(0,r.useEffect)(()=>()=>{for(let a of c.current.values())clearTimeout(a)},[]);let d=(0,r.useCallback)(a=>{b(b=>new Map(b).set(a.at,a));let d=c.current.get(a.at);d&&clearTimeout(d),c.current.set(a.at,setTimeout(()=>{c.current.delete(a.at),b(b=>{let c=new Map(b);return c.delete(a.at),c})},3400))},[]);return[a,d]}(),{crew:n,more:o}=(0,r.useMemo)(()=>R(b,a),[b,a]),p=(0,r.useRef)(null),q=(0,r.useRef)(new Set);(0,r.useEffect)(()=>{if(!O.botTasks.primed())return;let b=new Map(j.map(a=>[a.id,a.status])),c=p.current;p.current=b;let d=new Set;for(let b of a)for(let a of b.lines)"ask"===a.kind&&a.to&&d.add(a.id);let e=q.current;if(q.current=d,!c)return;let f=new Map;for(let b of a)for(let a of b.lines){if("ask"!==a.kind||!a.to||e.has(a.id))continue;let b=f.get(a.bot.name)??[];b.push({from:a.bot,to:a.to,text:a.text}),f.set(a.bot.name,b)}for(let[a,b]of f){if(1===b.length){m({at:b[0].to.name,from:b[0].from,text:av(b[0].text)});continue}m({at:a,from:b[0].from,text:`sent ${b.length} parts out`})}for(let a of j)c.get(a.id)!==a.status&&"working"===a.status&&m(c.has(a.id)?{at:a.bot.name,from:null,text:"picked it back up"}:{at:a.bot.name,from:aC,text:`took on \u201c${av(a.label)}\u201d`})},[a,m]),(0,O.useSeenOnDetail)(c?k:null);let t=a.filter(a=>"working"===a.status).length,u=j.filter(aw),v=u.length,w=j.filter(ax),x=w.filter(a=>"failed"===a.status).length,y=(0,r.useCallback)(()=>i(!1),[]);return(0,d.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-[min(80vw,calc(100vw-2.5rem))] flex-col items-end gap-2",children:c?(0,d.jsx)("div",{className:"pointer-events-auto flex max-h-[min(44rem,78vh)] w-132 max-w-full animate-in flex-col overflow-hidden rounded-3xl bg-background/75 shadow-2xl shadow-black/6 ring-1 ring-border/50 backdrop-blur-xl fade-in slide-in-from-bottom-1 duration-200",children:k?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(_,{task:k,onBack:()=>g(null),onClose:()=>e(!1)}),(0,d.jsx)(ah,{task:k,className:"min-h-0 flex-1"}),(0,d.jsx)(F.TaskReply,{task:{id:k.id,label:k.label,bot:k.bot.name,ask:function(a){if(!a.ask?.question)return a.ask;let b=a.lines.at(-1);return b&&(0,O.isOutcome)(b)&&b.text===a.ask.question?{...a.ask,question:""}:a.ask}(k)},status:"working"===k.status?"running":k.status,lines:k.lines,className:"mx-3 mb-2 shrink-0"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)($,{count:a.length,pending:v,composing:h,onCompose:()=>i(!0),onClose:()=>h?i(!1):e(!1)}),h?(0,d.jsx)(V,{bots:b,onDone:y}):j.length?(0,d.jsx)(af,{tasks:j,onPick:g}):(0,d.jsx)(ad,{bots:b}),!h&&(0,d.jsx)(ae,{})]})}):(0,d.jsx)(S,{crew:n,more:o,bubbles:l,bots:b,rows:u,count:a.length,busy:t,pending:v,unread:w.length,failed:x,composing:h,onCompose:()=>i(!0),onCloseCompose:y,onPick:a=>{g(a),e(!0)},onOpen:()=>{let a=u.length?u:w;f||1!==a.length||g(a[0].id),e(!0)}})})}),au=new Map,av=a=>{let b=(0,M.plainText)(a).replace(/\s+/g," ").trim();return b.length>28?`${b.slice(0,27)}…`:b};function R(a,b){let c=new Map;for(let a of(0,O.latestPerBot)(b)){let{task:b,bot:d,line:e}=a;if("waiting"===b.status&&b.bot.name===d.name){c.set(d.name,{waiting:!0,word:null});continue}!("working"!==b.status||c.get(d.name)?.waiting)&&c.set(d.name,{waiting:!1,word:e?"tool"===e.kind&&e.tool?av(e.tool.note??`${e.tool.name} \xb7 ${e.tool.input}`):"say"===e.kind?av(e.text):null:null})}let d=new Map;for(let b of a??[])d.set(b.name,{name:b.name,icon:b.icon,awake:c.has(b.name),waiting:c.get(b.name)?.waiting??!1,word:c.get(b.name)?.word??null});for(let[a,b]of c)d.has(a)||d.set(a,{name:a,icon:null,awake:!0,waiting:b.waiting,word:b.word});let e=[...d.values()];if(!e.length)return{crew:ay.slice(0,az),more:0};for(let a of ay){if(e.length>=az)break;d.has(a.name)||e.push(a)}let f=a=>a.waiting?0:a.awake?1:a.standIn?3:2,g=e.map((a,b)=>({face:a,at:b})).sort((a,b)=>f(a.face)-f(b.face)||a.at-b.at).map(a=>a.face);return{crew:g.slice(0,10),more:Math.max(0,g.length-10)}}let aw=a=>"waiting"===a.status,ax=a=>("done"===a.status||"failed"===a.status)&&!a.seen;function S({crew:a,more:b,bubbles:c,bots:e,rows:f,count:h,busy:i,pending:j,unread:k,failed:l,composing:m,onCompose:o,onCloseCompose:p,onPick:r,onOpen:s}){let t=function({count:a,busy:b,pending:c,unread:d,failed:e}){return c>0?{text:1===c?"waiting on you":`${c} waiting on you`,tone:M.WAITING_INK,shine:"waiting"}:e>0?{text:1===e?"1 failed":`${e} failed`,tone:"text-destructive",shine:null}:d>0?{text:1===d?"1 new answer":`${d} new answers`,tone:M.WAITING_INK,shine:null}:b>0?{text:1===b?"working":`${b} running`,tone:"text-muted-foreground",shine:"muted"}:a>0?{text:"all done",tone:"text-muted-foreground",shine:null}:{text:"no jobs yet",tone:"text-muted-foreground",shine:null}}({count:h,busy:i,pending:j,unread:k,failed:l}),u=m||j>0;return(0,d.jsxs)("div",{className:(0,M.cn)("pointer-events-auto w-fit max-w-full bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",u?"max-w-[min(33rem,100%)] min-w-96 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,d.jsx)("div",{className:(0,M.cn)("grid overflow-hidden transition-[grid-template-rows] duration-300 ease-out",u?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,d.jsx)("div",{className:"min-h-0 overflow-hidden",inert:!u,children:m?(0,d.jsx)(V,{bots:e,onDone:p}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"flex items-center gap-2 px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:[(0,d.jsxs)("span",{className:"flex-1",children:["needs you · ",j]}),(0,d.jsx)(T,{onClick:o})]}),(0,d.jsx)("div",{className:"px-1.5 pb-2",children:f.map(a=>(0,d.jsx)(ag,{task:a,onPick:()=>r(a.id)},a.id))}),(0,d.jsx)("span",{className:"block h-1.5"})]})})}),(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:s,"aria-label":h?`Tasks (${h})`:"Bots",className:"flex min-w-0 flex-1 items-center gap-2 rounded-full text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(W,{crew:a,more:b,bubbles:c}),(0,d.jsxs)("span",{className:"ml-auto flex h-7 shrink-0 items-center gap-1.5",children:[t.shine?(0,d.jsx)(x.ShinyText,{text:t.text,tone:t.shine,speed:2.6,className:"block truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,d.jsx)("span",{className:(0,M.cn)("block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] fade-in duration-300",t.tone),children:t.text},t.text),(0,d.jsxs)("span",{className:"grid size-4 shrink-0 place-items-center",children:[0===j&&0===k&&i>0&&(0,d.jsx)(n.Loader2,{className:"size-4 animate-spin text-muted-foreground/70"}),0===j&&0===l&&(k>0||0===i&&h>0)&&(0,d.jsx)(g.Check,{className:"size-4 text-muted-foreground/60"})]})]})]}),m&&(0,d.jsx)(U,{onClick:p,label:"Cancel the message",children:(0,d.jsx)(q.X,{className:"size-3.5"})})]})]})}function T({onClick:a}){return(0,d.jsx)(U,{onClick:a,label:"Message a bot",children:(0,d.jsx)(o.Plus,{className:"size-4"})})}function U({onClick:a,label:b,children:c}){return(0,d.jsx)("button",{type:"button",onClick:a,"aria-label":b,className:"grid size-7 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:c})}function V({bots:a,onDone:b}){let[c,e]=(0,r.useState)(null),[g,h]=(0,r.useState)(""),[k,l]=(0,K.useServerAction)(A.startTaskAction,{onOk:()=>{(0,L.revalidate)(s.queryKey.tasks),b()}}),m=a?.length?a.filter(a=>!a.disabled).map(a=>({name:a.name,icon:a.icon})):[{name:B.DEFAULT_BOT.name,icon:B.DEFAULT_BOT.icon}],o=()=>{c&&g.trim()&&!l&&k(c.name,g.trim())};return c?(0,d.jsxs)("div",{className:"flex min-h-32 flex-col pb-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-2",children:[(0,d.jsx)("button",{type:"button",onClick:()=>e(null),"aria-label":"Choose a different bot",className:"grid size-6 shrink-0 place-items-center rounded-lg text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,d.jsx)(i.ChevronLeft,{className:"size-3.5"})}),(0,d.jsx)(C.BotMark,{size:22,seed:c.name,vary:c.name,color:c.icon?.color,shape:c.icon?.shape,outline:c.icon?.outline,className:"shrink-0"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[12.5px] font-medium",children:["To ",c.name]})]}),(0,d.jsxs)("form",{onSubmit:a=>{a.preventDefault(),o()},className:"mx-3 mt-auto flex items-end gap-1 rounded-2xl bg-background py-2 pr-2 pl-3 ring-1 ring-border/80 transition-shadow focus-within:ring-ring/60",children:[(0,d.jsx)(y.Textarea,{value:g,rows:1,autoFocus:!0,disabled:l,onChange:a=>h(a.target.value),onKeyDown:a=>{"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),o())},placeholder:`What should ${c.name} do? It cannot hear the call, so say the whole job.`,"aria-label":`Message for ${c.name}`,className:"max-h-32 min-h-15 flex-1 resize-none border-0 bg-transparent px-0 py-0 text-[13px] leading-5 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,d.jsx)(u.Button,{type:"submit",size:"icon-sm",variant:g.trim()?"default":"ghost",disabled:!g.trim()||l,"aria-label":"Send",className:"rounded-full",children:l?(0,d.jsx)(n.Loader2,{className:"animate-spin"}):(0,d.jsx)(f.ArrowUp,{})})]})]}):(0,d.jsxs)("div",{className:"min-h-32 pb-3",children:[(0,d.jsx)("p",{className:"px-3 pt-3 pb-1.5 font-mono text-[10px] tracking-wide text-muted-foreground",children:"message a bot"}),(0,d.jsx)("div",{className:"px-1",children:m.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a),className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none transition-colors hover:bg-muted/60 focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(C.BotMark,{size:22,seed:a.name,vary:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,className:"shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px]",children:a.name}),(0,d.jsx)(j.ChevronRight,{className:"size-3.5 shrink-0 text-muted-foreground/50"})]},a.name))})]})}let ay=["alto","brio","cinder","delta"].map((a,b)=>({name:a,icon:{color:N.MARK_PALETTE[Math.floor(b*N.MARK_PALETTE.length/4)],shape:N.MARK_SHAPES[b%N.MARK_SHAPES.length]},awake:!1,waiting:!1,word:null,standIn:!0})),az=3;function W({crew:a,more:b,bubbles:c}){return(0,d.jsxs)("span",{className:"flex min-w-0 shrink items-center",children:[a.map((b,e)=>{let f=c.get(b.name)??null;return(0,d.jsxs)(r.Fragment,{children:[(0,d.jsxs)("span",{className:(0,M.cn)("relative shrink-0 transition-[margin,transform] duration-500 ease-out",e>0&&!a[e-1].word&&"-ml-2",b.standIn&&"opacity-35",b.awake&&"-translate-y-0.5 scale-110"),style:{zIndex:a.length-e},children:[(0,d.jsx)(X,{face:b}),f&&(0,d.jsx)(Y,{handoff:f})]}),b.word&&(0,d.jsx)("span",{className:"mx-2.5 min-w-0 shrink truncate",children:(0,d.jsx)(x.ShinyText,{text:b.word,speed:2.6,className:"truncate text-[13px] leading-5 tracking-[-0.1px]"})})]},b.name)}),b>0&&(0,d.jsxs)("span",{className:(0,M.cn)("grid size-7 shrink-0 place-items-center rounded-[9px] bg-muted font-mono text-[10px] text-muted-foreground ring-1 ring-border/50",!a.at(-1)?.word&&"-ml-2"),title:`${b} more`,children:["+",b]})]})}function X({face:a}){let b=(0,r.useMemo)(()=>a.awake?{glow:20}:void 0,[a.awake]);return(0,d.jsx)(C.BotMark,{size:28,seed:a.name,vary:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:a.waiting,options:b})}function Y({handoff:a}){return(0,d.jsxs)("span",{className:"pointer-events-none absolute bottom-[calc(100%+9px)] left-1/2 flex -translate-x-1/2 animate-in flex-col items-center whitespace-nowrap fade-in zoom-in-95 duration-200",children:[(0,d.jsxs)("span",{className:"flex items-center gap-1.5 rounded-full bg-background px-2.5 py-1 text-[12.5px] leading-4 tracking-[-0.1px] shadow-lg shadow-black/10 ring-1 ring-border",children:[a.from?.name===aC.name?(0,d.jsx)(H.ThursdayMark,{size:14,className:"shrink-0 opacity-75"}):a.from&&(0,d.jsx)(C.BotMark,{size:14,seed:a.from.name,vary:a.from.name,color:a.from.icon?.color,shape:a.from.icon?.shape,outline:a.from.icon?.outline,className:"shrink-0 opacity-75"}),a.text]}),(0,d.jsx)("span",{className:"-mt-px size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-border"}),(0,d.jsx)("span",{className:"-mt-[6.5px] size-0 border-x-[5px] border-t-[6px] border-x-transparent border-t-background"})]})}function Z({onClick:a}){return(0,d.jsx)("button",{type:"button",onClick:a,"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,d.jsx)(q.X,{className:"size-3.5"})})}function $({count:a,pending:b,composing:c,onCompose:e,onClose:f}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3.5 pt-3 pb-1.5",children:[(0,d.jsx)("span",{className:"text-[13px] font-medium",children:"Tasks"}),a>0&&!c&&(0,d.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground tabular-nums",children:b>0?`${b} for you \xb7 ${a}`:a}),(0,d.jsx)("span",{className:"flex-1"}),!c&&(0,d.jsx)(T,{onClick:e}),(0,d.jsx)(Z,{onClick:f})]})}function _({task:a,onBack:b,onClose:c}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,d.jsx)("button",{type:"button",onClick:b,"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,d.jsx)(i.ChevronLeft,{className:"size-4"})}),(0,d.jsx)(C.BotMark,{size:22,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1}),(0,d.jsxs)("span",{className:"min-w-0 flex-1 truncate text-[13px] font-medium",children:[a.label,(0,d.jsx)("span",{title:a.id,className:"ml-1.5 font-mono text-[10px] font-normal text-muted-foreground/60",children:a.id.slice(0,8)})]}),(0,d.jsx)(aa,{usage:a.tokens}),(0,d.jsx)(ab,{task:a}),(0,d.jsx)(ac,{task:a}),(0,d.jsx)(Z,{onClick:c})]})}function aa({usage:a}){let b=a.input+a.output;return b?(0,d.jsx)("span",{title:`in ${(0,M.formatCount)(a.input)} \xb7 out ${(0,M.formatCount)(a.output)}`,className:"shrink-0 font-mono text-[10px] text-muted-foreground/70 tabular-nums",children:(0,M.formatCount)(b)}):null}function ab({task:a}){let{contextTokens:b,contextBudget:c}=a;if(!b||!c)return null;let e=Math.min(1,b/c);return(0,d.jsx)("span",{title:`Context ${(0,M.formatCount)(b)} of ${(0,M.formatCount)(c)} — it summarizes itself here`,className:"block h-[3px] w-9 shrink-0 overflow-hidden rounded-full bg-muted",children:(0,d.jsx)("span",{className:(0,M.cn)("block h-full rounded-full",e>.9?"bg-amber-500/80":"bg-muted-foreground/70"),style:{width:`${Math.max(4,Math.round(100*e))}%`}})})}let aA={working:"text-muted-foreground",waiting:M.WAITING_INK,done:"text-foreground",failed:"text-destructive"};function ac({task:a}){let b="done"===a.status&&a.seen?"text-muted-foreground":aA[a.status];return"working"===a.status?(0,d.jsx)(x.ShinyText,{text:"working",speed:2.2,className:"shrink-0 font-mono text-[10px]"}):(0,d.jsx)("span",{className:(0,M.cn)("flex shrink-0 items-center gap-1.5 font-mono text-[10px]",b),children:a.status})}function ad({bots:a}){let{crew:b,more:c}=R(a,[]);return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-3 px-6 pt-3 pb-4 text-center",children:[(0,d.jsx)(W,{crew:b,more:c,bubbles:au}),a?.length?(0,d.jsx)("p",{className:"text-[12px] text-muted-foreground",children:"Nothing handed over yet — ask for something that takes a while."}):(0,d.jsxs)("p",{className:"text-[12px] text-muted-foreground",children:["Thursday hands work to ",B.DEFAULT_BOT.name," until you make bots of your own in Settings › Bots."]})]})}function ae(){return(0,d.jsx)("div",{className:"flex shrink-0 justify-end px-3 pb-2.5",children:(0,d.jsxs)("button",{type:"button",onClick:()=>(0,G.openSettings)("tasks"),className:"flex items-center gap-1 rounded-md px-1.5 py-1 font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(m.History,{className:"size-3"}),"History"]})})}let aB=[{id:"you",label:"needs you",holds:aw},{id:"working",label:"working",holds:a=>"working"===a.status},{id:"done",label:"done",holds:()=>!0}];function af({tasks:a,onPick:b}){let c=new Map;for(let b of a){let a=aB.find(a=>a.holds(b))??aB[2],d=c.get(a.id);d?d.push(b):c.set(a.id,[b])}return(0,d.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-1 scrollbar-none",children:aB.map((a,e)=>{let f=c.get(a.id)??[];return f.length?(0,d.jsxs)(r.Fragment,{children:[(0,d.jsxs)("p",{className:(0,M.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===e?"pt-1":"pt-3"),children:[a.label," · ",f.length]}),f.map(a=>(0,d.jsx)(ag,{task:a,onPick:()=>b(a.id)},a.id))]},a.id):null})})}function ag({task:a,onPick:b}){let c=aw(a),e=a.lines.at(-1),f=(0,r.useMemo)(()=>(function(a){if("waiting"===a.status&&a.ask)return{text:(0,B.isAppStop)(a.ask)?(0,M.plainText)(a.outcome??a.ask.question):a.ask.question,tone:M.WAITING_INK};let b=a.seen;if("failed"===a.status)return{text:(0,M.plainText)(a.outcome??"Failed"),tone:b?"text-destructive/70":"text-destructive"};if("done"===a.status)return{text:(0,M.plainText)(a.outcome??"Done"),tone:b?"text-muted-foreground":"text-foreground"};let c=(0,O.lastSaid)(a);return c?{text:"tool"===c.kind&&c.tool?c.tool.note??`${c.tool.name} \xb7 ${c.tool.input}`:c.text,tone:"text-muted-foreground"}:{text:`${a.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}})(a),[a.status,a.outcome,a.seen,a.ask,e?.id]),[g,h]=(0,F.useAnswerTask)(),[i,j]=(0,r.useState)(null),l="waiting"===a.status?a.ask?.options??[]:[];return(0,d.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,d.jsxs)("button",{type:"button",onClick:b,className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:a.bot.name,children:(0,d.jsx)(C.BotMark,{size:32,seed:a.bot.name,vary:a.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,state:"working"===a.status?"thinking":"idle",notify:c})}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:(0,M.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",c?"text-foreground":"text-foreground/80"),children:a.label}),(0,d.jsx)(D.BotRoster,{bots:(0,O.rosterOf)(a),taskId:a.id}),(0,d.jsx)("span",{className:"flex-1"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,J.shortAgo)(a.updatedAt)})]}),(0,d.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===a.status&&(0,d.jsx)(n.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"===a.status?(0,d.jsx)(x.ShinyText,{text:f.text,speed:2.2,className:(0,M.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone)}):(0,d.jsx)("span",{className:(0,M.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",f.tone),children:f.text})]})]})]}),l.length>0&&(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:l.map(b=>(0,d.jsxs)(u.Button,{size:"sm",variant:"outline",loading:i===b,disabled:h,onClick:async()=>{j(b),await g(a,b),j(null)},className:"h-7 gap-1.5 rounded-full border-amber-500/35 bg-background px-3 text-[12px]",children:[b===B.TASK_CONTINUE&&(0,d.jsx)(k.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),b]},b))})]})}function ah({task:a,className:b}){let c=(0,r.useRef)(null),e=(0,r.useRef)(!0);return(0,r.useEffect)(()=>{e.current=!0},[a.id]),(0,r.useEffect)(()=>{let a=c.current;a&&e.current&&(a.scrollTop=a.scrollHeight)},[a.lines,a.status]),(0,d.jsx)(I.FileViewer,{children:(0,d.jsxs)("div",{ref:c,onScroll:a=>{let b=a.currentTarget;e.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:(0,M.cn)("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",b),children:[(0,d.jsx)(aj,{task:a}),(0,O.threadItems)(a).map(b=>"invite"===b.kind?(0,d.jsx)(ak,{from:b.from,to:b.to},b.key):(0,d.jsx)(ao,{group:b.group,task:a},b.key)),"working"===a.status&&(0,d.jsx)(ai,{task:a})]})})}function ai({task:a}){if(a.lines.some(a=>a.tool&&void 0===a.tool.results))return null;let b=a.lines.at(-1),c=b?.kind==="ask"&&b.to?b.to:b?.bot;return(0,d.jsx)(x.ShinyText,{text:c?`${c.name} is on the next step…`:`${a.bot.name} is taking it on…`,speed:2.2,className:"block px-1 font-mono text-[10px]"})}function aj({task:a}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ak,{from:aC,to:a.bot}),(0,d.jsx)(am,{children:(0,d.jsx)(t.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(t.BubbleContent,{className:"rounded-tr-md py-2 pr-2 pl-3.5",children:(0,d.jsx)(v.FoldedText,{text:a.request,subject:"request"})})})})]})}let aC={name:"Thursday"};function ak({from:a,to:b}){return(0,d.jsx)("div",{className:"flex animate-in justify-center fade-in duration-300",children:(0,d.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,d.jsx)(al,{bot:a}),(0,d.jsx)("span",{className:"shrink-0 text-muted-foreground/70",children:"invited"}),(0,d.jsx)(al,{bot:b})]})})}function al({bot:a}){return(0,d.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsx)(C.BotMark,{size:15,seed:a.name,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"shrink-0"}),(0,d.jsx)("span",{className:"truncate",children:a.name})]})}function am({children:a}){return(0,d.jsx)(an,{side:"end",name:"Thursday",mark:(0,d.jsx)(C.BotMark,{size:26,seed:"thursday",notify:!1,className:"mt-1 shrink-0"}),children:a})}function an({side:a,mark:b,name:c,children:e}){return(0,d.jsxs)("div",{className:(0,M.cn)("flex gap-2.5","end"===a&&"flex-row-reverse"),children:[b,(0,d.jsxs)("div",{className:(0,M.cn)("flex min-w-0 flex-1 flex-col gap-1.5 [&>*+*]:max-w-[80%]","end"===a&&"items-end"),children:[(0,d.jsx)("p",{className:"max-w-[80%] truncate px-1 font-mono text-[10px] text-muted-foreground",children:c}),e]})]})}function ao({group:a,task:b}){return a.lines[0]?.kind==="user"?(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(am,{children:a.lines.map(a=>(0,d.jsx)(t.Bubble,{align:"end",className:"max-w-full",children:(0,d.jsx)(t.BubbleContent,{className:"rounded-tr-md px-3.5 text-[13px] leading-snug break-keep",children:a.text})},a.id))})}):(0,d.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-300",children:(0,d.jsx)(an,{side:a.bot.name===b.bot.name?"start":"end",name:a.bot.name,mark:(0,d.jsx)(C.BotMark,{size:26,seed:a.bot.name,vary:b.id,color:a.bot.icon?.color,shape:a.bot.icon?.shape,outline:a.bot.icon?.outline,notify:!1,className:"mt-1 shrink-0"}),children:(function(a){let b=[];for(let c of a){let a="tool"===c.kind&&c.tool?"tools":"stop"===c.kind?"stops":"said",d=b.at(-1),e=d?.kind===a&&("stops"!==a||aD(d.lines[0].text)===aD(c.text));d&&e?d.lines.push(c):b.push({kind:a,key:c.id,lines:[c]})}return b})(a.lines).map(a=>"tools"===a.kind?(0,d.jsx)(ar,{lines:a.lines,taskId:b.id},a.key):"stops"===a.kind?(0,d.jsx)(as,{lines:a.lines},a.key):a.lines.map(a=>(0,d.jsx)(ap,{line:a,taskId:b.id},a.id)))})})}function ap({line:a,taskId:b}){if("tool"===a.kind&&a.tool)return(0,d.jsx)(P.BotTool,{tool:a.tool,taskId:b});if("note"===a.kind)return(0,d.jsxs)("details",{className:"w-full py-1 text-muted-foreground",children:[(0,d.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2.5 outline-none [&::-webkit-details-marker]:hidden",children:[(0,d.jsx)("span",{className:"h-px flex-1 bg-border"}),(0,d.jsx)("span",{className:"shrink-0 font-mono text-[10px]",children:"Compacted — it goes on from its summary"}),(0,d.jsx)("span",{className:"h-px flex-1 bg-border"})]}),(0,d.jsx)("p",{className:"mt-2 rounded-xl bg-muted/40 px-3 py-2 text-[11px] leading-relaxed whitespace-pre-wrap break-keep",children:a.text})]});if(!(0,O.isOutcome)(a))return(0,d.jsx)("p",{className:"px-1 text-[12.5px] leading-relaxed break-keep text-muted-foreground",children:a.text});if(a.options)return(0,d.jsxs)("div",{className:"w-fit max-w-full space-y-1.5 rounded-2xl bg-amber-500/8 px-3 py-2 ring-1 ring-amber-500/25",children:[(0,d.jsx)("p",{className:"text-[13px] leading-snug break-keep",children:a.text}),a.options.length>0&&(0,d.jsx)("p",{className:"flex flex-wrap gap-1",children:a.options.map(a=>(0,d.jsx)("span",{className:"rounded-full bg-background/70 px-2 py-0.5 font-mono text-[10px] text-muted-foreground",children:a},a))})]});let c="error"===a.kind;return(0,d.jsxs)("div",{className:"min-w-0 px-1",children:[c&&(0,d.jsxs)("p",{className:"mb-1.5 flex items-center gap-1.5 font-mono text-[10px] text-destructive",children:[(0,d.jsx)(q.X,{className:"size-3 shrink-0"}),"Could not finish"]}),(0,d.jsx)(w.Markdown,{className:(0,M.cn)("overflow-x-auto text-[13px] leading-relaxed break-keep [&_h1]:text-[15px] [&_h2]:text-[14px] [&_h3]:text-[13px] [&_h3]:font-semibold [&_li]:my-0.5 [&_table]:text-[12px] [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",c&&"text-destructive"),children:a.text}),(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,d.jsx)(E.PathChips,{text:a.text,className:"min-w-0"}),!c&&(0,d.jsx)("span",{className:"ml-auto shrink-0",children:(0,d.jsx)(aq,{text:a.text})})]})]})}function aq({text:a}){let[b,c]=(0,r.useState)(!1),e=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{e.current&&clearTimeout(e.current)},[]),(0,d.jsx)("button",{type:"button","aria-label":"Copy the answer",onClick:async()=>{try{await navigator.clipboard.writeText(a),c(!0),e.current&&clearTimeout(e.current),e.current=setTimeout(()=>c(!1),1400)}catch(a){z.toast.add({type:"error",title:"Could not copy the answer",description:(0,M.errorToString)(a)})}},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:b?(0,d.jsx)(g.Check,{className:"size-3"}):(0,d.jsx)(l.Copy,{className:"size-3"})})}function ar({lines:a,taskId:b}){return(0,d.jsxs)("div",{className:"flex w-full flex-col gap-0.5 rounded-2xl bg-muted/40 p-1",children:[a.length>1&&(0,d.jsxs)("p",{className:"px-2 py-1 font-mono text-[10px] text-muted-foreground",children:[a.length," steps"]}),a.map(a=>a.tool?(0,d.jsx)(P.BotTool,{tool:a.tool,taskId:b,collapsed:!0},a.id):null)]})}function as({lines:a}){return(0,d.jsxs)("details",{className:"group min-w-0 px-1 text-muted-foreground",children:[(0,d.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,d.jsx)(p.RotateCw,{className:"size-3 shrink-0"}),(0,d.jsx)("span",{className:"min-w-0 truncate",children:aD(a[0].text)}),a.length>1&&(0,d.jsxs)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:["×",a.length]}),(0,d.jsx)(h.ChevronDown,{className:"size-2.5 shrink-0 text-muted-foreground/70 transition-transform group-open:rotate-180"})]}),(0,d.jsx)("div",{className:"mt-1 space-y-1 pl-4.5 text-[11px] leading-relaxed",children:a.map(a=>(0,d.jsxs)("p",{className:"flex gap-2 break-keep",children:[a.at&&(0,d.jsx)("span",{className:"shrink-0 font-mono text-muted-foreground/70 tabular-nums",children:(0,e.format)((0,J.toDate)(a.at),"HH:mm:ss")}),(0,d.jsx)("span",{className:"min-w-0",children:a.text})]},a.id))})]})}let aD=a=>a.split(" (")[0].replace(/\.$/,"");a.s(["BotRoom",0,at,"Conversation",0,ah]),c()}catch(a){c(a)}},!1),42380,a=>{"use strict";var b=a.i(187924),c=a.i(913834);a.s(["BotRoster",0,function({bots:a,taskId:d}){return a.length<2?null:(0,b.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",title:a.map(a=>a.name).join(", "),children:[(0,b.jsx)("span",{className:"flex items-center",children:a.slice(0,3).map(a=>(0,b.jsx)(c.BotMark,{size:18,seed:a.name,vary:d,color:a.icon?.color,shape:a.icon?.shape,outline:a.icon?.outline,notify:!1,className:"-ml-[3px] rounded-[7px] ring-2 ring-background first:ml-0"},a.name))}),(0,b.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[a.length," bots"]})]})}])},16716,a=>a.a(async(b,c)=>{try{var d=a.i(187924),e=a.i(998697),f=a.i(840260),g=a.i(930345),h=a.i(707938),i=a.i(576509),j=a.i(483138),k=a.i(904340),l=a.i(572131),m=a.i(369768),n=a.i(559553),o=a.i(497895),p=b([m]);[m]=p.then?(await p)():p;let q={markdown:j.FileText,csv:i.FileSpreadsheet,json:h.FileJson,text:k.FileType,image:g.FileImage};a.s(["PathChips",0,function({text:a,className:b}){let c=(0,l.useMemo)(()=>(0,n.pathsIn)(a),[a]);return c.length?(0,d.jsx)("div",{className:(0,o.cn)("flex flex-wrap gap-1.5",b),children:c.map(a=>{let b,c=a.split("/").pop()??a,g=(b=(0,n.viewKindOf)(a),"frame"===b?a.toLowerCase().endsWith(".pdf")?j.FileText:f.FileCode:q[b]??e.File);return(0,d.jsxs)(m.FileLink,{path:a,className:"flex max-w-full items-center gap-1.5 rounded-full bg-muted/70 py-1 pr-2.5 pl-2 font-mono text-[11px] text-foreground/80 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,d.jsx)(g,{className:"size-3 shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"truncate",children:c})]},a)})}):null}]),c()}catch(a){c(a)}},!1),394440,a=>{"use strict";var b=a.i(187924),c=a.i(327598),d=a.i(231500),e=a.i(164831);let f={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"}]]};f.node;let g=(0,e.default)(f);var h=a.i(875160),i=a.i(19895),j=a.i(474215),k=a.i(572131),l=a.i(767561),m=a.i(340695),n=a.i(613350),o=a.i(545097),p=a.i(546893),q=a.i(405050);let r=(0,q.createServerReference)("7fbdb2e36edae956fa954eada93a8b20c8642c1530",q.callServer,void 0,q.findSourceMapURL,"answerTaskAction");var s=a.i(137010),t=a.i(411509),u=a.i(777279),v=a.i(313237),w=a.i(759497),x=a.i(497895);function y(){let[a,b]=(0,v.useServerAction)(r,{onOk:()=>(0,w.revalidate)(l.queryKey.tasks)});return[async(b,c)=>{let d=c.trim();if(!d)return!1;try{let c=await a(b.id,d);return u.screenActs.announce({kind:"answered",id:c.id,label:c.label,answer:d}),!0}catch{return!1}},b]}a.s(["TaskReply",0,function({task:a,status:e,lines:f=[],className:q}){let[r,z]=(0,k.useState)(()=>u.taskDrafts.get(a.id));(0,k.useEffect)(()=>z(u.taskDrafts.get(a.id)),[a.id]);let A=b=>{z(b),u.taskDrafts.set(a.id,b)},[B,C]=y(),[D,E]=(0,v.useServerAction)(s.cancelTaskAction,{onOk:a=>{(0,w.revalidate)(l.queryKey.tasks),u.screenActs.announce({kind:"stopped",id:a.id,label:a.label})}}),F=C||E,[G,H]=(0,k.useState)(!1),[I,J]=(0,k.useState)(null);(0,k.useEffect)(()=>{H(!1),J(null)},[a.id]),(0,k.useEffect)(()=>{"running"!==e&&J(null)},[e]),(0,k.useEffect)(()=>{I&&f.some(a=>"user"===a.kind&&a.text===I)&&J(null)},[f,I]);let K=async b=>{!F&&await B(a,b)&&(A(""),"running"===e&&(J(b.trim()),H(!1)))},L="waiting"===e?a.ask:null,M=(0,t.isAppStop)(L),N=L?L.options.length?"Or put it another way…":"Your answer":"running"===e?`What's off? ${a.bot} reads this before its next step`:"Anything more? It picks up where it left off",O=(0,b.jsxs)("form",{onSubmit:a=>{a.preventDefault(),K(r)},className:"flex items-end gap-1 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",children:[(0,b.jsx)(p.Textarea,{value:r,rows:1,disabled:F,autoFocus:"running"===e,onChange:a=>A(a.target.value),onKeyDown:a=>{"Escape"===a.key&&"running"===e?H(!1):"Enter"!==a.key||a.shiftKey||a.nativeEvent.isComposing||229===a.keyCode||(a.preventDefault(),K(r))},placeholder:N,"aria-label":`Message for ${a.label}`,className:"max-h-32 min-h-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"}),"running"===e&&(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:F,onClick:()=>H(!1),"aria-label":"Never mind",className:"text-muted-foreground",children:(0,b.jsx)(j.X,{})}),(0,b.jsx)(m.Button,{type:"submit",size:"icon-sm",variant:r.trim()?"default":"ghost",disabled:!r.trim()||F,"aria-label":"Send",className:"rounded-full",children:C?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(c.ArrowUp,{})})]});return"running"!==e||G?L?(0,b.jsxs)("div",{className:(0,x.cn)("space-y-2.5 rounded-2xl bg-amber-500/8 px-3.5 py-3 ring-1 ring-amber-500/25",q),children:[(0,b.jsxs)("p",{className:"flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,b.jsx)("span",{className:"shrink-0",children:"To"}),(0,b.jsx)("span",{className:"truncate text-foreground",children:a.bot}),(0,b.jsx)("span",{className:"shrink-0 text-muted-foreground/50",children:"·"}),(0,b.jsx)("span",{className:"truncate",children:a.label})]}),L.question&&(0,b.jsx)(n.FoldedText,{text:L.question,subject:"message",clamp:"line-clamp-6",tall:"max-h-56"}),L.options.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:L.options.map(a=>(0,b.jsxs)(m.Button,{size:"sm",variant:"outline",disabled:F,onClick:()=>K(a),className:"h-7 gap-1.5 rounded-full bg-background px-3 text-[12px]",children:[M&&a===t.TASK_CONTINUE&&(0,b.jsx)(d.ChevronsRight,{className:"size-3.5 text-muted-foreground"}),a]},a))}),O,"waiting"===e&&(0,b.jsx)("button",{type:"button",disabled:F,onClick:()=>D(a.id),className:"font-mono text-[10px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",children:"Stop this task instead"})]}):(0,b.jsx)("div",{className:q,children:O}):(0,b.jsxs)("div",{className:(0,x.cn)("flex items-center gap-2 rounded-2xl bg-muted/40 py-1.5 pr-1.5 pl-3.5 ring-1 ring-border/50",q),children:[I?(0,b.jsxs)("p",{className:"flex min-w-0 flex-1 items-center gap-2 text-[12.5px] leading-5 text-muted-foreground",children:[(0,b.jsx)(h.Loader2,{className:"size-3 shrink-0 animate-spin"}),(0,b.jsx)("span",{className:"shrink-0",children:"Before its next step:"}),(0,b.jsx)(o.ShinyText,{text:I,speed:2.2,className:"min-w-0 truncate"})]}):(0,b.jsx)(o.ShinyText,{text:`${a.bot} is on it — Thursday steers it by voice.`,speed:2.4,className:"min-w-0 flex-1 truncate text-[12.5px] leading-5 break-keep"}),(0,b.jsxs)(m.Button,{type:"button",size:"sm",variant:"ghost",disabled:F,onClick:()=>H(!0),className:"h-7 shrink-0 gap-1.5 rounded-full px-2.5 text-[12px]",children:[(0,b.jsx)(g,{className:"size-3.5"}),"Step in"]}),(0,b.jsx)("span",{className:"h-4 w-px shrink-0 bg-border"}),(0,b.jsx)(m.Button,{type:"button",size:"icon-sm",variant:"ghost",disabled:F,onClick:()=>D(a.id),"aria-label":"Stop this task",className:"shrink-0 text-muted-foreground/60 hover:text-foreground",children:E?(0,b.jsx)(h.Loader2,{className:"animate-spin"}):(0,b.jsx)(i.Square,{className:"size-3"})})]})},"useAnswerTask",0,y],394440)},137010,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7f681b8be32fbd5eb73f156ad88e53db719f14f304",b.callServer,void 0,b.findSourceMapURL,"cancelTaskAction");a.s(["cancelTaskAction",0,c])},647812,a=>{"use strict";var b=a.i(405050);let c=(0,b.createServerReference)("7fae185d4377430250e73f5e97e7ff9acbced3c8c3",b.callServer,void 0,b.findSourceMapURL,"startTaskAction");a.s(["startTaskAction",0,c])},777279,a=>{"use strict";var b=a.i(572131),c=a.i(767561),d=a.i(864037),e=a.i(405050);let f=(0,e.createServerReference)("7f09de16ce79bb580b8077f0d6657eecbbc875bc73",e.callServer,void 0,e.findSourceMapURL,"markSeenAction");var g=a.i(199169),h=a.i(576271),i=a.i(759497),j=a.i(497895);let k=[],l=!1,m=new Set;function n(a,b){let c=a=>({name:a,icon:b?.find(b=>b.name===a)?.icon??null}),d=c(a.bot),e=[],f=new Map,g=new Map;for(let b of a.lines){let a=b.bot?c(b.bot):d,h=b.parent&&g.get(b.parent)?.name?d:null;switch(b.kind){case"user":e.push({id:b.id,bot:d,to:null,text:b.text,kind:"user"});break;case"text":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"say"});break;case"note":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"note"});break;case"stop":e.push({id:b.id,bot:a,to:h,text:b.text,kind:"stop",at:b.at});break;case"tool":f.set(b.callId,e.length),e.push({id:b.id,bot:a,to:h,text:b.note??b.input,kind:"tool",tool:{name:b.name,input:b.input,note:b.note,path:b.path,callId:b.callId}});break;case"tool-result":{let a=f.get(b.callId),c=void 0===a?void 0:e[a];c?.tool&&void 0!==a&&(e[a]={...c,tool:{...c.tool,results:b.results,more:b.more}});break}case"ask":{let d=c(b.to);g.set(b.callId,d),e.push({id:b.id,bot:a,to:d,text:b.text,kind:"ask"});break}case"ask-result":{let c=g.get(b.callId);c&&b.text&&e.push({id:b.id,bot:c,to:a,text:b.text,kind:"ask"});break}case"waiting":e.push({id:b.id,bot:a,to:null,text:b.question,kind:"result",options:b.options})}}if("failed"===a.status&&a.outcome)e.push({id:`${a.id}-end`,bot:d,to:null,text:a.outcome,kind:"error"});else if("done"===a.status||"waiting"===a.status){let b=e.at(-1);b&&"say"===b.kind&&b.text===a.outcome&&(e[e.length-1]={...b,kind:"result"})}return{id:a.id,request:a.request,label:a.label,bot:d,lines:e,status:"running"===a.status?"working":a.status,outcome:a.outcome,ask:a.ask,seen:a.seen,tokens:a.tokens,contextTokens:a.contextTokens,contextBudget:a.contextBudget,updatedAt:a.updatedAt}}let o=new Map,p=new Set,q=[];a.s(["botTasks",0,{sync(a,b){for(let c of(l=!0,k=[...a].reverse().map(a=>n(a,b)).slice(-30),m))c()},primed:()=>l},"isOutcome",0,a=>"result"===a.kind||"error"===a.kind,"lastSaid",0,function(a){for(let b=a.lines.length-1;b>=0;b--){let c=a.lines[b];if("user"!==c.kind&&"note"!==c.kind&&"stop"!==c.kind)return c}return null},"latestPerBot",0,function(a){let b=new Map;for(let c of a)for(let a of(b.has(c.bot.name)||b.set(c.bot.name,{bot:c.bot,task:c,line:null,open:0}),c.lines))"user"!==a.kind&&"note"!==a.kind&&"stop"!==a.kind&&b.set(a.bot.name,{bot:a.bot,task:c,line:a,open:b.get(a.bot.name)?.open??0});for(let c of a){if("working"!==c.status)continue;let a=b.get(c.bot.name);a&&(a.open+=1)}return[...b.values()]},"rosterOf",0,function(a){let b=[a.bot];for(let c of a.lines)b.some(a=>a.name===c.bot.name)||b.push(c.bot);return b},"screenActs",0,{announce(a){for(let b of p)b(a)},subscribe:a=>(p.add(a),()=>{p.delete(a)})},"taskDrafts",0,{get:a=>o.get(a)??"",set(a,b){b?o.set(a,b):o.delete(a)},typing:a=>(o.get(a)?.trim().length??0)>0},"taskFromRow",0,n,"threadItems",0,function(a){let b=new Set([a.bot.name]),c=[];for(let d of function(a){let b=[];for(let c of a){let a=b.at(-1);if(a&&a.bot.name===c.bot.name&&a.to?.name===c.to?.name&&"user"===a.lines[0].kind==("user"===c.kind)){a.lines.push(c);continue}b.push({key:c.id,bot:c.bot,to:c.to,lines:[c]})}return b}(a.lines))d.to&&!b.has(d.to.name)&&(b.add(d.to.name),c.push({kind:"invite",key:`${d.key}-joins`,from:d.bot,to:d.to})),b.add(d.bot.name),c.push({kind:"group",key:d.key,group:d});return c},"useBotTasks",0,function(){return(0,b.useSyncExternalStore)(a=>(m.add(a),()=>m.delete(a)),()=>k,()=>q)},"useSeenOnDetail",0,function(a){let e=(0,b.useRef)(new Set),k=a?.id??null,l=a?`${a.id}@${(0,g.toDate)(a.updatedAt).getTime()}`:null,m=!!a&&("done"===a.status||"failed"===a.status)&&!a.seen;(0,b.useEffect)(()=>{!k||!l||!m||e.current.has(l)||(e.current.add(l),f([k]).then(h.unwrapResult).then(()=>(0,i.revalidate)(c.queryKey.tasks)).catch(a=>{e.current.delete(l),d.toast.add({type:"error",title:"Could not mark the task as read",description:(0,j.errorToString)(a)})}))},[k,l,m])}],777279)},231500,a=>{"use strict";var b=a.i(164831);let c={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"}]]};c.node;let d=(0,b.default)(c);a.s(["ChevronsRight",0,d],231500)},585650,a=>{"use strict";var b=a.i(164831);let c={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};c.node;let d=(0,b.default)(c);a.s(["Copy",0,d],585650)},840260,a=>{"use strict";var b=a.i(164831);let c={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};c.node;let d=(0,b.default)(c);a.s(["FileCode",0,d],840260)},930345,a=>{"use strict";var b=a.i(164831);let c={name:"file-image",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]};c.node;let d=(0,b.default)(c);a.s(["FileImage",0,d],930345)},576509,a=>{"use strict";var b=a.i(164831);let c={name:"file-spreadsheet",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]};c.node;let d=(0,b.default)(c);a.s(["FileSpreadsheet",0,d],576509)},904340,a=>{"use strict";var b=a.i(164831);let c={name:"file-type",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]]};c.node;let d=(0,b.default)(c);a.s(["FileType",0,d],904340)},748819,a=>{"use strict";var b=a.i(164831);let c={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"}]]};c.node;let d=(0,b.default)(c);a.s(["RotateCw",0,d],748819)},19895,a=>{"use strict";var b=a.i(164831);let c={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};c.node;let d=(0,b.default)(c);a.s(["Square",0,d],19895)}];
2
+
3
+ //# sourceMappingURL=_1jhd09t._.js.map