thursday-agent 0.1.2 → 0.3.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 (573) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -1
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +5 -5
  5. package/.next/routes-manifest.json +27 -3
  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.html +1 -1
  9. package/.next/server/app/_global-error.rsc +2 -2
  10. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_full.segment.rsc +2 -2
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page.js +2 -2
  14. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/server/app/_not-found.html +1 -1
  17. package/.next/server/app/_not-found.rsc +14 -14
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  19. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +12 -12
  20. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  21. package/.next/server/app/api/artifact/route.js +3 -3
  22. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/memory/files/route/app-paths-manifest.json +3 -0
  24. package/.next/server/app/api/bot/memory/files/route.js +10 -0
  25. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -0
  26. package/.next/server/app/api/bot/memory/files/route_client-reference-manifest.js +3 -0
  27. package/.next/server/app/api/bot/memory/route/app-paths-manifest.json +3 -0
  28. package/.next/server/app/api/bot/memory/route/build-manifest.json +12 -0
  29. package/.next/server/app/api/bot/memory/route/server-reference-manifest.json +4 -0
  30. package/.next/server/app/api/bot/memory/route.js +14 -0
  31. package/.next/server/app/api/bot/memory/route.js.map +5 -0
  32. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -0
  33. package/.next/server/app/api/bot/memory/route_client-reference-manifest.js +3 -0
  34. package/.next/server/app/api/bot/route.js +7 -7
  35. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  36. package/.next/server/app/api/bot/task/[id]/route.js +9 -9
  37. package/.next/server/app/api/bot/task/[id]/route.js.nft.json +1 -1
  38. package/.next/server/app/api/bot/task/route.js +8 -8
  39. package/.next/server/app/api/bot/task/route.js.nft.json +1 -1
  40. package/.next/server/app/api/config/route.js +6 -6
  41. package/.next/server/app/api/config/route.js.nft.json +1 -1
  42. package/.next/server/app/api/events/route.js +4 -5
  43. package/.next/server/app/api/events/route.js.nft.json +1 -1
  44. package/.next/server/app/api/file/[...path]/route.js +3 -3
  45. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  46. package/.next/server/app/api/llm-model/catalog/route.js +10 -9
  47. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  48. package/.next/server/app/api/llm-model/credits/route/app-paths-manifest.json +3 -0
  49. package/.next/server/app/api/llm-model/credits/route/build-manifest.json +12 -0
  50. package/.next/server/app/api/llm-model/credits/route/server-reference-manifest.json +4 -0
  51. package/.next/server/app/api/llm-model/credits/route.js +16 -0
  52. package/.next/server/app/api/llm-model/credits/route.js.map +5 -0
  53. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -0
  54. package/.next/server/app/api/llm-model/credits/route_client-reference-manifest.js +3 -0
  55. package/.next/server/app/api/llm-model/route.js +10 -8
  56. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  57. package/.next/server/app/api/llm-model/subscription/route/app-paths-manifest.json +3 -0
  58. package/.next/server/app/api/llm-model/subscription/route/build-manifest.json +12 -0
  59. package/.next/server/app/api/llm-model/subscription/route/server-reference-manifest.json +4 -0
  60. package/.next/server/app/api/llm-model/subscription/route.js +15 -0
  61. package/.next/server/app/api/llm-model/subscription/route.js.map +5 -0
  62. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -0
  63. package/.next/server/app/api/llm-model/subscription/route_client-reference-manifest.js +3 -0
  64. package/.next/server/app/api/mcp/[name]/route.js +5 -5
  65. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  66. package/.next/server/app/api/mcp/oauth/callback/route.js +6 -6
  67. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  68. package/.next/server/app/api/mcp/route.js +5 -5
  69. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  70. package/.next/server/app/api/mcp/tools/route.js +5 -5
  71. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  72. package/.next/server/app/api/memory/edit/route/app-paths-manifest.json +3 -0
  73. package/.next/server/app/api/memory/edit/route/build-manifest.json +12 -0
  74. package/.next/server/app/api/memory/edit/route/server-reference-manifest.json +4 -0
  75. package/.next/server/app/api/memory/edit/route.js +24 -0
  76. package/.next/server/app/api/memory/edit/route.js.map +5 -0
  77. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -0
  78. package/.next/server/app/api/memory/{tidy → edit}/route_client-reference-manifest.js +1 -1
  79. package/.next/server/app/api/memory/route.js +7 -8
  80. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  81. package/.next/server/app/api/skills/[source]/[name]/route.js +3 -3
  82. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  83. package/.next/server/app/api/skills/route.js +3 -3
  84. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  85. package/.next/server/app/api/thursday/call/route.js +9 -7
  86. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  87. package/.next/server/app/api/thursday/skills/route.js +9 -7
  88. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  89. package/.next/server/app/api/thursday/tool-call/route.js +16 -15
  90. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  91. package/.next/server/app/api/workspace/route.js +4 -5
  92. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  93. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +1 -1
  94. package/.next/server/app/artifact/[...path]/page.js +5 -6
  95. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  96. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  97. package/.next/server/app/favicon.ico/route.js +3 -4
  98. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  99. package/.next/server/app/favicon.ico.body +0 -0
  100. package/.next/server/app/page/server-reference-manifest.json +66 -77
  101. package/.next/server/app/page.js +11 -11
  102. package/.next/server/app/page.js.nft.json +1 -1
  103. package/.next/server/app/page_client-reference-manifest.js +1 -1
  104. package/.next/server/app-paths-manifest.json +5 -1
  105. package/.next/server/chunks/[externals]__0dzuk6_._.js +3 -0
  106. package/.next/server/chunks/[root-of-the-server]__01dkp4a._.js +3 -0
  107. package/.next/server/chunks/[root-of-the-server]__02va5wz._.js +3 -0
  108. package/.next/server/chunks/[root-of-the-server]__02xjoto._.js +3 -0
  109. package/.next/server/chunks/[root-of-the-server]__04q--0f._.js +8 -0
  110. package/.next/server/chunks/[root-of-the-server]__0bl-e63._.js +3 -0
  111. package/.next/server/chunks/[root-of-the-server]__0ce8nf8._.js +5 -0
  112. package/.next/server/chunks/[root-of-the-server]__0ffbg85._.js +3 -0
  113. package/.next/server/chunks/[root-of-the-server]__0j7z0r3._.js +12 -0
  114. package/.next/server/chunks/[root-of-the-server]__0jq4ohy._.js +8 -0
  115. package/.next/server/chunks/[root-of-the-server]__0ls6_8y._.js +8 -0
  116. package/.next/server/chunks/[root-of-the-server]__0ncs9uu._.js +3 -0
  117. package/.next/server/chunks/[root-of-the-server]__0pa2n68._.js +3 -0
  118. package/.next/server/chunks/[root-of-the-server]__0q0vvt2._.js +5 -0
  119. package/.next/server/chunks/[root-of-the-server]__1-ga0kh._.js +5 -0
  120. package/.next/server/chunks/[root-of-the-server]__11n256_._.js +5 -0
  121. package/.next/server/chunks/[root-of-the-server]__12cabg9._.js +3 -0
  122. package/.next/server/chunks/[root-of-the-server]__1339jnv._.js +8 -0
  123. package/.next/server/chunks/[root-of-the-server]__15bjnu5._.js +5 -0
  124. package/.next/server/chunks/[root-of-the-server]__18_teo8._.js +8 -0
  125. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +5 -0
  126. package/.next/server/chunks/[root-of-the-server]__1anc1p9._.js +3 -0
  127. package/.next/server/chunks/[root-of-the-server]__1ccon1w._.js +10 -0
  128. package/.next/server/chunks/[root-of-the-server]__1fizn31._.js +3 -0
  129. package/.next/server/chunks/[root-of-the-server]__1llj3-b._.js +3 -0
  130. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +11 -0
  131. package/.next/server/chunks/[root-of-the-server]__1p8m3f4._.js +3 -0
  132. package/.next/server/chunks/[root-of-the-server]__1wa1k7r._.js +8 -0
  133. package/.next/server/chunks/{_1hzrsvg._.js → _0-73of8._.js} +6 -6
  134. package/.next/server/chunks/{_1cbk7ms._.js → _0-fjql4._.js} +10 -10
  135. package/.next/server/chunks/_00xh_q0._.js +27 -0
  136. package/.next/server/chunks/{_0y8is-s._.js → _03a0897._.js} +1 -1
  137. package/.next/server/chunks/{_0pppbb5._.js → _03kp0jp._.js} +166 -35
  138. package/.next/server/chunks/_051qh8u._.js +3 -0
  139. package/.next/server/chunks/{node_modules_next_04q-o58._.js → _05dla15._.js} +2 -2
  140. package/.next/server/chunks/_05h2cii._.js +1 -1
  141. package/.next/server/chunks/_0c9j6rb._.js +49 -0
  142. package/.next/server/chunks/_0fzqt2y._.js +74 -44
  143. package/.next/server/chunks/{_0kl37zl._.js → _0ioz3nd._.js} +1 -1
  144. package/.next/server/chunks/_0iwfby5._.js +3 -0
  145. package/.next/server/chunks/{_0hin38_._.js → _0khihjk._.js} +5 -5
  146. package/.next/server/chunks/_0mecv0f._.js +26 -0
  147. package/.next/server/chunks/_0mh8j4m._.js +3 -0
  148. package/.next/server/chunks/{_1icgbi8._.js → _0n74zsf._.js} +2 -2
  149. package/.next/server/chunks/_0obojvv._.js +3 -0
  150. package/.next/server/chunks/_0recufk._.js +49 -0
  151. package/.next/server/chunks/{_1t8fv7b._.js → _0rnf-6n._.js} +2 -2
  152. package/.next/server/chunks/_0sb7tlz._.js +3 -0
  153. package/.next/server/chunks/{_0jgm3b8._.js → _0u10wmw._.js} +6 -6
  154. package/.next/server/chunks/{_12nr4xc._.js → _0u4aiy2._.js} +2 -2
  155. package/.next/server/chunks/_0wp4le3._.js +1 -1
  156. package/.next/server/chunks/_0y5fg-x._.js +1 -1
  157. package/.next/server/chunks/_1230wbx._.js +10 -0
  158. package/.next/server/chunks/_12nheja._.js +3 -0
  159. package/.next/server/chunks/_13510xh._.js +3 -0
  160. package/.next/server/chunks/_15hq89o._.js +1 -1
  161. package/.next/server/chunks/_17l5ygt._.js +49 -0
  162. package/.next/server/chunks/{_0ks6_sg._.js → _18-1wcc._.js} +6 -6
  163. package/.next/server/chunks/_1_5mnq4._.js +18 -0
  164. package/.next/server/chunks/{_0tzfesa._.js → _1_9mjx-._.js} +1 -1
  165. package/.next/server/chunks/_1d0j961._.js +6 -0
  166. package/.next/server/chunks/_1d5zmy8._.js +1 -1
  167. package/.next/server/chunks/_1drgfx4._.js +18 -0
  168. package/.next/server/chunks/{_1skgy7b._.js → _1e48czp._.js} +5 -5
  169. package/.next/server/chunks/_1f46eie._.js +3 -0
  170. package/.next/server/chunks/_1h5_8sk._.js +3 -0
  171. package/.next/server/chunks/_1hdnxb7._.js +3 -0
  172. package/.next/server/chunks/_1j8k_j5._.js +3 -0
  173. package/.next/server/chunks/{_10qam6o._.js → _1kg70wc._.js} +5 -5
  174. package/.next/server/chunks/_1krd9rf._.js +3 -0
  175. package/.next/server/chunks/_1nc0eui._.js +11 -0
  176. package/.next/server/chunks/_1nula3v._.js +3 -0
  177. package/.next/server/chunks/_1pf4qe-._.js +3 -0
  178. package/.next/server/chunks/_1php4eq._.js +1 -1
  179. package/.next/server/chunks/_1qxheoa._.js +3 -0
  180. package/.next/server/chunks/_1x6kd1r._.js +3 -0
  181. package/.next/server/chunks/_1yuv4vp._.js +1 -1
  182. package/.next/server/chunks/_1zjrdag._.js +3 -0
  183. package/.next/server/chunks/_next-internal_server_app_api_bot_memory_files_route_actions_1_xd_8f.js +3 -0
  184. package/.next/server/chunks/_next-internal_server_app_api_bot_memory_route_actions_1a8xfr7.js +3 -0
  185. package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_route_actions_0v424pb.js +3 -0
  186. package/.next/server/chunks/_next-internal_server_app_api_llm-model_subscription_route_actions_0-udcm5.js +3 -0
  187. package/.next/server/chunks/_next-internal_server_app_api_memory_edit_route_actions_02sfnmr.js +3 -0
  188. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  189. package/.next/server/chunks/features_0rpfxbk._.js +3 -0
  190. package/.next/server/chunks/features_1qf3cei._.js +3 -0
  191. package/.next/server/chunks/features_bot_0zt92oh._.js +3 -0
  192. package/.next/server/chunks/features_bot_bot_query_ts_12mgkl2._.js +1 -1
  193. package/.next/server/chunks/features_memory_1uqvksn._.js +6 -0
  194. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0tf290y._.js → node_modules_consola_dist_chunks_prompt_mjs_0i7cvml._.js} +1 -1
  195. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0228f43._.js → node_modules_consola_dist_chunks_prompt_mjs_0icqaqw._.js} +1 -1
  196. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0ir-vo2._.js → node_modules_consola_dist_chunks_prompt_mjs_0j61-ma._.js} +1 -1
  197. package/.next/server/chunks/{node_modules_consola_dist_chunks_prompt_mjs_0otw8ef._.js → node_modules_consola_dist_chunks_prompt_mjs_0r28-sm._.js} +1 -1
  198. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0v_7drq._.js +3 -0
  199. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_11zjo-1._.js +3 -0
  200. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1pycqsq._.js +3 -0
  201. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1xoq2rl._.js +3 -0
  202. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1y49572._.js +3 -0
  203. package/.next/server/chunks/ssr/[externals]__0dizgek._.js +3 -0
  204. package/.next/server/chunks/ssr/[root-of-the-server]__09q9med._.js +1 -1
  205. package/.next/server/chunks/ssr/[root-of-the-server]__0_69wqr._.js +3 -0
  206. package/.next/server/chunks/ssr/[root-of-the-server]__0hg5gib._.js +1 -1
  207. package/.next/server/chunks/ssr/[root-of-the-server]__0i8ie7f._.js +3 -0
  208. package/.next/server/chunks/ssr/{[root-of-the-server]__0jsmmb-._.js → [root-of-the-server]__0mz33a7._.js} +1 -1
  209. package/.next/server/chunks/ssr/[root-of-the-server]__0tbkdlx._.js +3 -0
  210. package/.next/server/chunks/ssr/[root-of-the-server]__0vnmv-s._.js +3 -0
  211. package/.next/server/chunks/ssr/{[root-of-the-server]__0f6s48x._.js → [root-of-the-server]__0xpcv9w._.js} +3 -3
  212. package/.next/server/chunks/ssr/[root-of-the-server]__0xtssj3._.js +1 -1
  213. package/.next/server/chunks/ssr/[root-of-the-server]__0zkv7z_._.js +3 -0
  214. package/.next/server/chunks/ssr/[root-of-the-server]__10-dz5o._.js +57 -0
  215. package/.next/server/chunks/ssr/[root-of-the-server]__15_uhip._.js +3 -0
  216. package/.next/server/chunks/ssr/[root-of-the-server]__16jc196._.js +1 -1
  217. package/.next/server/chunks/ssr/[root-of-the-server]__1cyjywu._.js +3 -0
  218. package/.next/server/chunks/ssr/[root-of-the-server]__1eh7hid._.js +3 -0
  219. package/.next/server/chunks/ssr/[root-of-the-server]__1gtlw6v._.js +43 -0
  220. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +1 -1
  221. package/.next/server/chunks/ssr/[root-of-the-server]__1ox7hbk._.js +4 -0
  222. package/.next/server/chunks/ssr/[root-of-the-server]__1pduf5n._.js +3 -0
  223. package/.next/server/chunks/ssr/{_1mznrxk._.js → _001_ms1._.js} +3 -3
  224. package/.next/server/chunks/ssr/_01_6m32._.js +3 -0
  225. package/.next/server/chunks/ssr/_01n3o0m._.js +3 -0
  226. package/.next/server/chunks/ssr/_07uchnc._.js +3 -0
  227. package/.next/server/chunks/ssr/_0ap2fzn._.js +3 -0
  228. package/.next/server/chunks/ssr/_0c-ql2m._.js +3 -0
  229. package/.next/server/chunks/ssr/_0h42fze._.js +3 -0
  230. package/.next/server/chunks/ssr/_0h7zdni._.js +1 -1
  231. package/.next/server/chunks/ssr/_0i_6q1w._.js +41 -0
  232. package/.next/server/chunks/ssr/_0kbkmar._.js +3 -0
  233. package/.next/server/chunks/ssr/_0lu1n_x._.js +3 -0
  234. package/.next/server/chunks/ssr/{_077-g6s._.js → _0mb8zc8._.js} +3 -3
  235. package/.next/server/chunks/ssr/_0mo2w06._.js +3 -0
  236. package/.next/server/chunks/ssr/{_13punpm._.js → _0q0zan6._.js} +2 -2
  237. package/.next/server/chunks/ssr/{_0gd4vaa._.js → _0u2jv_x._.js} +94 -58
  238. package/.next/server/chunks/ssr/_0y0tiht._.js +4 -0
  239. package/.next/server/chunks/ssr/_0zhoc3r._.js +3 -0
  240. package/.next/server/chunks/ssr/_1-teee5._.js +3 -3
  241. package/.next/server/chunks/ssr/_13fke0x._.js +3 -0
  242. package/.next/server/chunks/ssr/{_0q_2f2x._.js → _13z3f85._.js} +2 -2
  243. package/.next/server/chunks/ssr/_14_lw10._.js +3 -0
  244. package/.next/server/chunks/ssr/_15j2_8f._.js +3 -0
  245. package/.next/server/chunks/ssr/{_0lc_7c8._.js → _1eoqg_g._.js} +2 -2
  246. package/.next/server/chunks/ssr/_1sji22n._.js +3 -0
  247. package/.next/server/chunks/ssr/_1spzm8z._.js +3 -0
  248. package/.next/server/chunks/ssr/{_19_o9d-._.js → _1vi_uo7._.js} +2 -2
  249. package/.next/server/chunks/ssr/_1vyd1ji._.js +3 -0
  250. package/.next/server/chunks/ssr/_1xvgn77._.js +3 -0
  251. package/.next/server/chunks/ssr/_20kd_n0._.js +42 -0
  252. package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +3 -0
  253. package/.next/server/chunks/ssr/features_config_components_config-setting_tsx_0xfwqdg._.js +1 -1
  254. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  255. package/.next/server/chunks/ssr/lib_date-like_ts_02is0pw._.js +3 -0
  256. package/.next/server/chunks/ssr/lib_realtime_12wg_dd._.js +27 -0
  257. package/.next/server/chunks/ssr/lib_realtime_15h_v1v._.js +27 -0
  258. package/.next/server/chunks/ssr/{node_modules_1d-is1o._.js → node_modules_063xwpp._.js} +1 -1
  259. package/.next/server/chunks/ssr/{node_modules_1ub40gk._.js → node_modules_0bvraul._.js} +1 -1
  260. package/.next/server/chunks/ssr/{node_modules_1nhw9qg._.js → node_modules_0eu1va6._.js} +1 -1
  261. package/.next/server/chunks/ssr/{node_modules_0xwx4u-._.js → node_modules_0h50b8n._.js} +1 -1
  262. package/.next/server/chunks/ssr/{node_modules_043-236._.js → node_modules_0h5hnr1._.js} +1 -1
  263. package/.next/server/chunks/ssr/{node_modules_1t0y5jt._.js → node_modules_0h7u60n._.js} +1 -1
  264. package/.next/server/chunks/ssr/{node_modules_1k29j1j._.js → node_modules_0lm7_vm._.js} +1 -1
  265. package/.next/server/chunks/ssr/{node_modules_16i4o_3._.js → node_modules_0mwym0g._.js} +1 -1
  266. package/.next/server/chunks/ssr/{node_modules_1y8_3vg._.js → node_modules_0rjg6t1._.js} +1 -1
  267. package/.next/server/chunks/ssr/node_modules_0x3-ply._.js +3 -0
  268. package/.next/server/chunks/ssr/{node_modules_108wd2o._.js → node_modules_0y_cded._.js} +1 -1
  269. package/.next/server/chunks/ssr/{node_modules_1jatz7w._.js → node_modules_0z5tsu8._.js} +1 -1
  270. package/.next/server/chunks/ssr/{node_modules_0ls96je._.js → node_modules_0zp9r92._.js} +1 -1
  271. package/.next/server/chunks/ssr/{node_modules_06kvvuo._.js → node_modules_1-hc6uv._.js} +1 -1
  272. package/.next/server/chunks/ssr/{node_modules_1_588_4._.js → node_modules_113tz0l._.js} +1 -1
  273. package/.next/server/chunks/ssr/{node_modules_0ipn1ho._.js → node_modules_124bue5._.js} +1 -1
  274. package/.next/server/chunks/ssr/node_modules_17bwo43._.js +55 -0
  275. package/.next/server/chunks/ssr/{node_modules_0_j7-g4._.js → node_modules_1_n3ztw._.js} +1 -1
  276. package/.next/server/chunks/ssr/{node_modules_20ynonm._.js → node_modules_1bc7gu8._.js} +1 -1
  277. package/.next/server/chunks/ssr/{node_modules_1hn_sd5._.js → node_modules_1bgb6-f._.js} +1 -1
  278. package/.next/server/chunks/ssr/{node_modules_0bue6gy._.js → node_modules_1h4a4pp._.js} +1 -1
  279. package/.next/server/chunks/ssr/{node_modules_0fbw5-u._.js → node_modules_1i7u1ia._.js} +1 -1
  280. package/.next/server/chunks/ssr/{node_modules_1ee8gav._.js → node_modules_1juq3hs._.js} +1 -1
  281. package/.next/server/chunks/ssr/{node_modules_0_fvxnt._.js → node_modules_1l0qtdu._.js} +1 -1
  282. package/.next/server/chunks/ssr/{node_modules_13f2md6._.js → node_modules_1t9cyee._.js} +1 -1
  283. package/.next/server/chunks/ssr/{node_modules_0y2-av4._.js → node_modules_1uuj9x1._.js} +1 -1
  284. package/.next/server/chunks/ssr/{node_modules_00d6675._.js → node_modules_1vqb6po._.js} +1 -1
  285. package/.next/server/chunks/ssr/{node_modules_1v0077l._.js → node_modules_1xx28h1._.js} +1 -1
  286. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_092s8nx._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0d3skpl._.js} +1 -1
  287. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1nvexgu._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0i44kk5._.js} +1 -1
  288. package/.next/server/chunks/ssr/node_modules_@vercel_oidc_dist_0qe30a_._.js +3 -0
  289. package/.next/server/chunks/ssr/node_modules_consola_dist_chunks_prompt_mjs_05cwqv2._.js +47 -0
  290. package/.next/server/chunks/ssr/{node_modules_next_dist_0w6mzq5._.js → node_modules_next_dist_0drixxt._.js} +4 -4
  291. package/.next/server/chunks/ssr/node_modules_next_dist_1n3w9lb._.js +2 -2
  292. package/.next/server/instrumentation.js +1 -1
  293. package/.next/server/middleware-build-manifest.js +3 -3
  294. package/.next/server/pages/404.html +1 -1
  295. package/.next/server/pages/500.html +1 -1
  296. package/.next/server/server-reference-manifest.js +1 -1
  297. package/.next/server/server-reference-manifest.json +67 -78
  298. package/.next/static/chunks/{31ttnjt6g35a0.js → 0ev4hyghq0mbb.js} +1 -1
  299. package/.next/static/chunks/0r5qcctujhxli.js +1 -0
  300. package/.next/static/chunks/0tmgrnlje14-s.js +3 -0
  301. package/.next/static/chunks/0x79tx04dxbpp.js +1 -0
  302. package/.next/static/chunks/0xzgvc0fkdb6t.js +1 -0
  303. package/.next/static/chunks/10teww7wt-f6h.js +1 -0
  304. package/.next/static/chunks/14hgtsjg-kael.css +1 -0
  305. package/.next/static/chunks/17donp69y4do7.js +40 -0
  306. package/.next/static/chunks/1dkjg87pxk0n9.js +28 -0
  307. package/.next/static/chunks/1ekc7ul556kbl.js +1 -0
  308. package/.next/static/chunks/{1khakdu_iuedc.js → 1grhjo7a5a0_-.js} +1 -1
  309. package/.next/static/chunks/1kq8h8wi_e0bc.js +53 -0
  310. package/.next/static/chunks/1okqiww3pnwka.js +1 -0
  311. package/.next/static/chunks/26-pr2c9ro222.js +1 -0
  312. package/.next/static/chunks/{2ihkf6l2jowo9.js → 280t0_e99i276.js} +3 -3
  313. package/.next/static/chunks/28cizcdaabd4h.js +1 -0
  314. package/.next/static/chunks/2a0k6jlq0_v1u.js +2 -0
  315. package/.next/static/chunks/2fzs9fm8yarvq.js +1 -0
  316. package/.next/static/chunks/2h0sd2vumhb15.js +1 -0
  317. package/.next/static/chunks/2hw2f6zmt7fmt.js +1 -0
  318. package/.next/static/chunks/2t4vhi3m8ahya.js +1 -0
  319. package/.next/static/chunks/2tigdtz3dpcy8.js +1 -0
  320. package/.next/static/chunks/3111pj5wnjgos.js +1 -0
  321. package/.next/static/chunks/3786h5vayt80-.js +28 -0
  322. package/.next/static/chunks/{3aquirz5h71da.js → 3agpgkwaa321p.js} +1 -1
  323. package/.next/static/chunks/3cfi_q6d_wtci.js +1 -0
  324. package/.next/static/chunks/3ok9_x74rip3v.js +1 -0
  325. package/.next/static/chunks/3xk7yqgomx7yq.js +1 -0
  326. package/.next/static/chunks/3xpbkl66ssib5.js +38 -0
  327. package/.next/static/media/favicon.37o1pjldwi2uc.ico +0 -0
  328. package/README.md +6 -4
  329. package/app/api/bot/memory/files/route.ts +14 -0
  330. package/app/api/bot/memory/route.ts +5 -0
  331. package/app/api/events/app-event.client.ts +24 -0
  332. package/app/api/events/app-event.server.ts +45 -0
  333. package/app/api/events/app-event.ts +42 -0
  334. package/app/api/llm-model/catalog/route.ts +12 -0
  335. package/app/api/llm-model/credits/route.ts +11 -0
  336. package/app/api/llm-model/route.ts +26 -0
  337. package/app/api/llm-model/subscription/route.ts +11 -0
  338. package/app/api/memory/edit/route.ts +7 -0
  339. package/app/api/memory/route.ts +21 -0
  340. package/app/api/query-key.ts +159 -0
  341. package/app/api/thursday/tool-call/route.ts +67 -0
  342. package/bin/thursday.mjs +3 -0
  343. package/components/ui/button-group.tsx +45 -0
  344. package/components/ui/custom-icon.tsx +259 -0
  345. package/components/ui/dropdown-menu.tsx +271 -0
  346. package/components/ui/folded-text.tsx +68 -0
  347. package/components/ui/input-group.tsx +157 -0
  348. package/components/ui/json-view.tsx +240 -0
  349. package/components/ui/shiny-text.tsx +55 -0
  350. package/components/ui/text-type.tsx +213 -0
  351. package/components/ui/theme-sync.tsx +9 -0
  352. package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260910173049_numerous_spirit}/migration.sql +30 -33
  353. package/database/migrations/{20260908030742_rainy_marvel_zombies → 20260910173049_numerous_spirit}/snapshot.json +124 -145
  354. package/database/migrations/20260911030320_opposite_jack_power/migration.sql +1 -0
  355. package/database/migrations/20260911030320_opposite_jack_power/snapshot.json +1158 -0
  356. package/docs/how-it-works.md +59 -0
  357. package/docs/images/keeps-going.png +0 -0
  358. package/docs/images/task-thread.png +0 -0
  359. package/docs/images/two-minds.png +0 -0
  360. package/features/ai/chatgpt.ts +617 -0
  361. package/features/ai/components/chatgpt-sign-in.tsx +66 -0
  362. package/features/ai/components/model-picker.tsx +17 -1
  363. package/features/ai/components/provider-icon.tsx +1 -0
  364. package/features/ai/load-tools.ts +105 -39
  365. package/features/ai/model.schema.ts +232 -34
  366. package/features/ai/model.ts +169 -24
  367. package/features/ai/prompts/bot.prompt.ts +245 -59
  368. package/features/ai/prompts/memory-edit.prompt.ts +33 -0
  369. package/features/ai/prompts/prompt-helper.ts +75 -30
  370. package/features/ai/prompts/thursday.prompt.ts +42 -17
  371. package/features/ai/tools/bot.tool.ts +32 -30
  372. package/features/ai/tools/connected.ts +17 -4
  373. package/features/ai/tools/mcp.tool.ts +5 -5
  374. package/features/ai/tools/memory.tool.ts +142 -74
  375. package/features/ai/tools/search.tool.ts +136 -47
  376. package/features/ai/tools/studio.tool.ts +5 -5
  377. package/features/ai/tools/tool-name.ts +2 -3
  378. package/features/ai/tools/workspace.tool.ts +33 -4
  379. package/features/bot/bot.action.ts +24 -7
  380. package/features/bot/bot.memory.ts +89 -0
  381. package/features/bot/bot.query.ts +41 -6
  382. package/features/bot/bot.run.ts +516 -210
  383. package/features/bot/bot.runner.ts +463 -93
  384. package/features/bot/bot.schema.ts +84 -7
  385. package/features/bot/bot.seed.ts +89 -16
  386. package/features/bot/components/bot-mark.tsx +122 -20
  387. package/features/bot/components/bot-room.tsx +519 -391
  388. package/features/bot/components/bot-setting.tsx +832 -341
  389. package/features/bot/components/bot-tool.tsx +2 -6
  390. package/features/bot/components/mark-palette.tsx +54 -0
  391. package/features/bot/components/path-chips.tsx +1 -1
  392. package/features/bot/components/task-badge.tsx +26 -6
  393. package/features/bot/components/task-reply.tsx +22 -33
  394. package/features/bot/components/task-setting.tsx +20 -17
  395. package/features/bot/task.query.ts +233 -33
  396. package/features/bot/task.store.ts +53 -9
  397. package/features/config/components/config-setting.tsx +265 -34
  398. package/features/config/components/models-badge.tsx +42 -0
  399. package/features/config/config.action.ts +12 -0
  400. package/features/config/config.const.ts +38 -2
  401. package/features/connectors/mcp.manager.ts +10 -2
  402. package/features/intro/components/intro.tsx +47 -46
  403. package/features/memory/components/memory-edit.tsx +338 -0
  404. package/features/memory/components/memory-setting.tsx +86 -79
  405. package/features/memory/memory.action.ts +3 -43
  406. package/features/memory/memory.edit.ts +87 -0
  407. package/features/memory/memory.query.ts +33 -44
  408. package/features/memory/memory.schema.ts +50 -97
  409. package/features/settings/components/settings.tsx +2 -0
  410. package/features/settings/settings.alert.ts +3 -1
  411. package/features/skills/components/skills-setting.tsx +9 -1
  412. package/features/thursday/components/ascii-orb.tsx +106 -90
  413. package/features/thursday/components/boot.tsx +7 -0
  414. package/features/thursday/components/call-log.tsx +219 -92
  415. package/features/thursday/components/face.tsx +6 -4
  416. package/features/thursday/components/tab-state.tsx +97 -0
  417. package/features/thursday/components/thursday-mark.tsx +4 -1
  418. package/features/thursday/components/thursday-setting.tsx +17 -47
  419. package/features/thursday/components/thursday.tsx +208 -95
  420. package/features/thursday/thursday.action.ts +12 -17
  421. package/features/thursday/thursday.query.ts +61 -70
  422. package/features/thursday/thursday.schema.ts +20 -7
  423. package/features/thursday/tool-line.ts +85 -11
  424. package/features/thursday/use-thursday.ts +86 -59
  425. package/features/workspace/components/file-view.tsx +4 -2
  426. package/features/workspace/workspace.ts +230 -13
  427. package/hooks/use-draft.ts +37 -0
  428. package/hooks/use-hotkey.ts +105 -0
  429. package/hooks/use-object-state.ts +51 -0
  430. package/hooks/use-on-visible.ts +72 -0
  431. package/hooks/use-theme.ts +106 -0
  432. package/hooks/use-wake-word.ts +262 -0
  433. package/lib/limits.ts +1 -1
  434. package/lib/oauth-page.ts +27 -0
  435. package/lib/realtime/openai.ts +2 -2
  436. package/lib/realtime/realtime.driver.ts +34 -1
  437. package/lib/realtime/realtime.protocol.ts +7 -1
  438. package/lib/realtime/realtime.tap.ts +122 -0
  439. package/lib/sandbox.ts +60 -29
  440. package/lib/tokens.ts +19 -0
  441. package/package.json +1 -1
  442. package/skills/browser/SKILL.md +55 -34
  443. package/.next/server/app/api/memory/tidy/route/app-paths-manifest.json +0 -3
  444. package/.next/server/app/api/memory/tidy/route.js +0 -23
  445. package/.next/server/app/api/memory/tidy/route.js.nft.json +0 -1
  446. package/.next/server/chunks/[root-of-the-server]__019dx9f._.js +0 -5
  447. package/.next/server/chunks/[root-of-the-server]__02_2sm-._.js +0 -5
  448. package/.next/server/chunks/[root-of-the-server]__02kt8yn._.js +0 -10
  449. package/.next/server/chunks/[root-of-the-server]__05luceg._.js +0 -3
  450. package/.next/server/chunks/[root-of-the-server]__06t77t4._.js +0 -11
  451. package/.next/server/chunks/[root-of-the-server]__0bed6hu._.js +0 -8
  452. package/.next/server/chunks/[root-of-the-server]__0dupqt7._.js +0 -5
  453. package/.next/server/chunks/[root-of-the-server]__0h59di-._.js +0 -5
  454. package/.next/server/chunks/[root-of-the-server]__0j_n5l3._.js +0 -3
  455. package/.next/server/chunks/[root-of-the-server]__0le4d-p._.js +0 -3
  456. package/.next/server/chunks/[root-of-the-server]__0m8ywyo._.js +0 -10
  457. package/.next/server/chunks/[root-of-the-server]__0nfuugi._.js +0 -5
  458. package/.next/server/chunks/[root-of-the-server]__0phdgco._.js +0 -8
  459. package/.next/server/chunks/[root-of-the-server]__0qjqtwo._.js +0 -5
  460. package/.next/server/chunks/[root-of-the-server]__0t_dqaj._.js +0 -3
  461. package/.next/server/chunks/[root-of-the-server]__0wvgrsl._.js +0 -3
  462. package/.next/server/chunks/[root-of-the-server]__0yk6s3w._.js +0 -5
  463. package/.next/server/chunks/[root-of-the-server]__0z3gelv._.js +0 -3
  464. package/.next/server/chunks/[root-of-the-server]__10qshki._.js +0 -3
  465. package/.next/server/chunks/[root-of-the-server]__113fqg5._.js +0 -12
  466. package/.next/server/chunks/[root-of-the-server]__11w_7_3._.js +0 -3
  467. package/.next/server/chunks/[root-of-the-server]__16thabu._.js +0 -3
  468. package/.next/server/chunks/[root-of-the-server]__173nhwf._.js +0 -8
  469. package/.next/server/chunks/[root-of-the-server]__1_0q_9w._.js +0 -3
  470. package/.next/server/chunks/[root-of-the-server]__1_aoyr9._.js +0 -3
  471. package/.next/server/chunks/[root-of-the-server]__1bqhuh9._.js +0 -8
  472. package/.next/server/chunks/[root-of-the-server]__1cqizfq._.js +0 -5
  473. package/.next/server/chunks/[root-of-the-server]__1dow0bz._.js +0 -3
  474. package/.next/server/chunks/[root-of-the-server]__1e-ci13._.js +0 -3
  475. package/.next/server/chunks/[root-of-the-server]__1gmn1cs._.js +0 -10
  476. package/.next/server/chunks/[root-of-the-server]__1lr7j9t._.js +0 -5
  477. package/.next/server/chunks/[root-of-the-server]__1mzp_el._.js +0 -3
  478. package/.next/server/chunks/[root-of-the-server]__1txedx6._.js +0 -8
  479. package/.next/server/chunks/[root-of-the-server]__1u_qvc7._.js +0 -3
  480. package/.next/server/chunks/[root-of-the-server]__1zgpz1w._.js +0 -3
  481. package/.next/server/chunks/_012yhfm._.js +0 -39
  482. package/.next/server/chunks/_06mxlgn._.js +0 -3
  483. package/.next/server/chunks/_07rtlxv._.js +0 -3
  484. package/.next/server/chunks/_0a351g7._.js +0 -6
  485. package/.next/server/chunks/_0kjjmag._.js +0 -3
  486. package/.next/server/chunks/_0zmestz._.js +0 -55
  487. package/.next/server/chunks/_0zuzmt_._.js +0 -39
  488. package/.next/server/chunks/_12bbv5i._.js +0 -96
  489. package/.next/server/chunks/_15q1pig._.js +0 -3
  490. package/.next/server/chunks/_1drv2et._.js +0 -36
  491. package/.next/server/chunks/_1ic3bew._.js +0 -5
  492. package/.next/server/chunks/_1mxn_lb._.js +0 -3
  493. package/.next/server/chunks/_1uj4_io._.js +0 -10
  494. package/.next/server/chunks/_1x7p319._.js +0 -6
  495. package/.next/server/chunks/_1yldgo4._.js +0 -55
  496. package/.next/server/chunks/_2050gwn._.js +0 -255
  497. package/.next/server/chunks/_next-internal_server_app_api_memory_tidy_route_actions_0_cfuom.js +0 -3
  498. package/.next/server/chunks/features_0scmr4i._.js +0 -3
  499. package/.next/server/chunks/features_bot_task_query_ts_11xuzl3._.js +0 -3
  500. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0vorg6w._.js +0 -3
  501. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0ykklj0._.js +0 -3
  502. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1ryg3wh._.js +0 -3
  503. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1vmaq9f._.js +0 -3
  504. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1vwbnq_._.js +0 -3
  505. package/.next/server/chunks/ssr/[externals]_node_crypto_1kn79-7._.js +0 -3
  506. package/.next/server/chunks/ssr/[root-of-the-server]__01id-v3._.js +0 -3
  507. package/.next/server/chunks/ssr/[root-of-the-server]__0b-0i32._.js +0 -3
  508. package/.next/server/chunks/ssr/[root-of-the-server]__0dfwvr4._.js +0 -4
  509. package/.next/server/chunks/ssr/[root-of-the-server]__0iuoa-r._.js +0 -3
  510. package/.next/server/chunks/ssr/[root-of-the-server]__1-mnhyd._.js +0 -90
  511. package/.next/server/chunks/ssr/[root-of-the-server]__185grso._.js +0 -3
  512. package/.next/server/chunks/ssr/[root-of-the-server]__1minz8_._.js +0 -3
  513. package/.next/server/chunks/ssr/_0-mc7ro._.js +0 -3
  514. package/.next/server/chunks/ssr/_01p5r6-._.js +0 -3
  515. package/.next/server/chunks/ssr/_09-0k3z._.js +0 -3
  516. package/.next/server/chunks/ssr/_0ay6b01._.js +0 -3
  517. package/.next/server/chunks/ssr/_0cvjbuz._.js +0 -3
  518. package/.next/server/chunks/ssr/_0fafgvl._.js +0 -3
  519. package/.next/server/chunks/ssr/_0j4v8of._.js +0 -3
  520. package/.next/server/chunks/ssr/_0l81bzy._.js +0 -3
  521. package/.next/server/chunks/ssr/_0nso8tp._.js +0 -3
  522. package/.next/server/chunks/ssr/_0sf1isi._.js +0 -3
  523. package/.next/server/chunks/ssr/_0ti51xc._.js +0 -3
  524. package/.next/server/chunks/ssr/_0y84qo6._.js +0 -3
  525. package/.next/server/chunks/ssr/_10uvw3l._.js +0 -3
  526. package/.next/server/chunks/ssr/_1dcxzqe._.js +0 -3
  527. package/.next/server/chunks/ssr/_1e-dgz0._.js +0 -4
  528. package/.next/server/chunks/ssr/_1fq7zgb._.js +0 -3
  529. package/.next/server/chunks/ssr/_1jbv7m1._.js +0 -3
  530. package/.next/server/chunks/ssr/features_bot_components_bot-setting_tsx_01ajft6._.js +0 -4
  531. package/.next/server/chunks/ssr/features_config_components_14jqgy4._.js +0 -3
  532. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +0 -4
  533. package/.next/server/chunks/ssr/lib_realtime_0aetuyp._.js +0 -24
  534. package/.next/server/chunks/ssr/lib_realtime_18k_aj-._.js +0 -24
  535. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_errors_05xv7vp.js +0 -3
  536. package/.next/server/chunks/ssr/node_modules_zod_v4_classic_external_15fmmz3.js +0 -55
  537. package/.next/static/chunks/0f9sq-7q_yxyl.js +0 -1
  538. package/.next/static/chunks/0tydnn2kybibk.js +0 -1
  539. package/.next/static/chunks/0yysv1gzin17t.js +0 -1
  540. package/.next/static/chunks/1fr5m75pwtyic.js +0 -1
  541. package/.next/static/chunks/1gy3bbv7usnjo.js +0 -1
  542. package/.next/static/chunks/1keib_gt066gc.js +0 -1
  543. package/.next/static/chunks/1ytnip8wdng93.js +0 -1
  544. package/.next/static/chunks/21rk8w7bda-su.js +0 -1
  545. package/.next/static/chunks/247d-r95j8xs0.js +0 -1
  546. package/.next/static/chunks/28g42tw8tsvhd.js +0 -1
  547. package/.next/static/chunks/29gyb3nubj51j.js +0 -53
  548. package/.next/static/chunks/2cwjgkt_hoyhj.js +0 -22
  549. package/.next/static/chunks/2fq_86jvq9ymq.js +0 -2
  550. package/.next/static/chunks/2rbf1fpd8n80-.js +0 -22
  551. package/.next/static/chunks/2ukj8k69y89um.js +0 -1
  552. package/.next/static/chunks/2uxum7qbyeyxd.js +0 -1
  553. package/.next/static/chunks/2wngeetfnzxkp.js +0 -2
  554. package/.next/static/chunks/388-t2v72jh39.css +0 -1
  555. package/.next/static/chunks/3fqvc0cg-atq_.js +0 -1
  556. package/.next/static/chunks/3p4egvfjxpatb.js +0 -1
  557. package/.next/static/chunks/3qe1w1ei-huhl.js +0 -1
  558. package/.next/static/chunks/3xxa2j56-f3nm.js +0 -3
  559. package/.next/static/chunks/3y40riycdip-i.js +0 -1
  560. package/.next/static/chunks/45a6zbtkelph9.js +0 -1
  561. package/.next/static/media/favicon.2vob68tjqpejf.ico +0 -0
  562. package/features/ai/prompts/memory-tidy.prompt.ts +0 -123
  563. package/features/ai/tools/tidy.tool.ts +0 -22
  564. package/features/memory/components/memory-tidy.tsx +0 -395
  565. package/features/memory/memory.tidy.ts +0 -332
  566. package/features/memory/tidy.query.ts +0 -135
  567. package/features/thursday/use-call-title.ts +0 -31
  568. /package/.next/server/app/api/{memory/tidy → bot/memory/files}/route/build-manifest.json +0 -0
  569. /package/.next/server/app/api/{memory/tidy → bot/memory/files}/route/server-reference-manifest.json +0 -0
  570. /package/.next/server/app/api/{memory/tidy → bot/memory/files}/route.js.map +0 -0
  571. /package/.next/static/{X34BUd9bfdH27ripuwwBm → x1cCqY0kWpR_VcYx_lWO5}/_buildManifest.js +0 -0
  572. /package/.next/static/{X34BUd9bfdH27ripuwwBm → x1cCqY0kWpR_VcYx_lWO5}/_clientMiddlewareManifest.js +0 -0
  573. /package/.next/static/{X34BUd9bfdH27ripuwwBm → x1cCqY0kWpR_VcYx_lWO5}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports=[913834,a=>{"use strict";var b=a.i(187924),c=a.i(572131),d=a.i(396398),e=a.i(324835);let f=2*Math.PI,g="-18 -18 276 276",h=a=>Math.round(100*a)/100,i=(a,b,c)=>Math.min(c,Math.max(b,a));function j(a){let b=a>>>0;return()=>{let a=Math.imul((b=b+0x6d2b79f5>>>0)^b>>>15,1|b);return(((a=a+Math.imul(a^a>>>7,61|a)^a)^a>>>14)>>>0)/0x100000000}}function k(a,b){return[a[0]-b[0],a[1]-b[1]]}function l(a){let b=Math.hypot(a[0],a[1])||1;return[a[0]/b,a[1]/b]}function m(a){let b=a.map((a,b)=>{let c=b/128*f;return[120+Math.cos(c)*a,120+Math.sin(c)*a]}),c=`M${h(b[0][0])} ${h(b[0][1])}`;for(let a=0;a<128;a++){let d=b[(a-1+128)%128],e=b[a],f=b[(a+1)%128],g=b[(a+2)%128],i=e[0]+(f[0]-d[0])/6,j=e[1]+(f[1]-d[1])/6,k=f[0]-(g[0]-e[0])/6,l=f[1]-(g[1]-e[1])/6;c+=`C${h(i)} ${h(j)} ${h(k)} ${h(l)} ${h(f[0])} ${h(f[1])}`}return`${c}Z`}function n(a){let b=a.tilt*Math.PI/180,c=Math.cos(b),d=Math.sin(b),e=(b,e)=>[a.cx+b*c-e*d,a.cy+b*d+e*c],f=-a.len/2,g=a.len/2,i=[],j=[];for(let b=0;b<=30;b++){let c=b/30,d=1-c,h=d*d*f+c*c*g,k=-(2*d*c*a.bend),l=-(2*d*f)+2*c*g,m=-(2*d*a.bend)+2*c*a.bend,n=Math.hypot(l,m)||1,o=-m/n,p=l/n,q=a.width/2*Math.sin(Math.PI*c)**a.taper;i.push(e(h+o*q,k+p*q)),j.push(e(h-o*q,k-p*q))}let k=`M${h(i[0][0])} ${h(i[0][1])}`;for(let a=1;a<=30;a++)k+=`L${h(i[a][0])} ${h(i[a][1])}`;for(let a=29;a>=0;a--)k+=`L${h(j[a][0])} ${h(j[a][1])}`;return`${k}Z`}let o={shape:"blob",sides:3,corner:.74,rotation:-180,squircle:4.6,wobble:.2,seed:113,autofit:!0,color:"currentColor",fill:!0,strokeWidth:14,eyeLen:51,eyeWidth:38,eyeBend:-1,eyeTaper:.35,eyeTilt:-90,eyeSkew:0,eyeGap:88,eyeY:100,gazeRange:7,follow:!0,ripple:9,pulse:7,punch:.05,bandEase:.019,bobRate:1,stretch:15,idle:!0,liveliness:55,glance:22,float:7,breathe:3.7,speed:1.7,blink:!0,shadow:16,glow:0,glowColor:null,glowStrength:55,rim:0,rimColor:"currentColor",notify:!1,notifyAngle:41,notifyDist:109,notifyR:25,notifyRing:11,notifyColor:"#FF3B30"},p=[.8,1.35],q=[.45,.77],r=[-180,180],s=[4,12],t=new Map;function u(a,b,c){var d,e,g;let h,m,n,o,p=`${"poly"===b?`poly|${a.sides}|${a.corner}|${a.rotation}|${c}`:"squircle"===b?`squircle|${a.squircle}|${c}`:`blob|${a.wobble}|${c}`}|${a.autofit}`,q=t.get(p);if(q)return q;let r=function(a){let b=Array(128);for(let c=0;c<128;c++){let d=c/128*f,e=Math.cos(d),g=Math.sin(d),h=0;for(let b=0;b<a.length;b++){let c=a[b],d=a[(b+1)%a.length],f=d[0]-c[0],i=d[1]-c[1],j=e*i-g*f;if(1e-9>Math.abs(j))continue;let k=c[0]-120,l=c[1]-120,m=(k*i-l*f)/j,n=(k*g-l*e)/j;m>h&&n>=-1e-9&&n<=1+1e-9&&(h=m)}b[c]=h||112}return b}((d=a,e=b,g=c,"squircle"===e?function(a){let b=[],c=2/a;for(let a=0;a<360;a++){let d=a/360*f,e=Math.cos(d),g=Math.sin(d);b.push([120+Math.sign(e)*Math.abs(e)**c*112,120+Math.sign(g)*Math.abs(g)**c*112])}return b}(d.squircle):"poly"===e?function(a,b,c){let d=c*Math.PI/180-Math.PI/2,e=[];for(let b=0;b<a;b++){let c=d+b/a*f;e.push([120+112*Math.cos(c),120+112*Math.sin(c)])}let g=(Math.PI-f/a)/2,h=224*Math.sin(Math.PI/a)/2*Math.tan(g)*i(b,.001,1),j=h/Math.tan(g),m=[];for(let b=0;b<a;b++){let c=e[b],d=e[(b-1+a)%a],i=e[(b+1)%a],n=l(k(d,c)),o=l(k(i,c)),p=[c[0]+n[0]*j,c[1]+n[1]*j],q=l([n[0]+o[0],n[1]+o[1]]),r=[c[0]+q[0]*h/Math.sin(g),c[1]+q[1]*h/Math.sin(g)],s=Math.atan2(p[1]-r[1],p[0]-r[0]),t=[c[0]+o[0]*j,c[1]+o[1]*j],u=Math.atan2(t[1]-r[1],t[0]-r[0])-s;for(;u>Math.PI;)u-=f;for(;u<-Math.PI;)u+=f;for(let a=0;a<=20;a++){let b=s+a/20*u;m.push([r[0]+Math.cos(b)*h,r[1]+Math.sin(b)*h])}}return m}(d.sides,d.corner,d.rotation):function(a,b){let c=j(a),d=[1,2,3,4,5].map(a=>({k:a,a:(2*c()-1)/a,p:c()*f})),e=[],g=0;for(let a=0;a<360;a++){let b=a/360*f,c=0;for(let a of d)c+=a.a*Math.sin(a.k*b+a.p);e.push(c),g=Math.max(g,Math.abs(c))}let h=g>0?b/g:0;return e.map((a,b)=>{let c=b/360*f,d=112*(1+a*h);return[120+Math.cos(c)*d,120+Math.sin(c)*d]})}(g,d.wobble))),s="blob"===b?r:(h=j(12139^c),m=[2,3,5].map(a=>({k:a,a:(2*h()-1)/a,p:h()*f})),o=Math.max(...(n=r.map((a,b)=>{let c=b/128*f,d=0;for(let a of m)d+=a.a*Math.sin(a.k*c+a.p);return d})).map(Math.abs))||1,r.map((a,b)=>a*(1+.035*n[b]/o))),u=a.autofit?function(a){let b=f/128,c=0,d=0;for(let e of a)c+=.5*e*e*b,e>d&&(d=e);if(c<=0)return a;let e=Math.min(Math.sqrt(112*Math.PI*112/c),130/d);return a.map(a=>a*e)}(s):s;return t.size>400&&t.clear(),t.set(p,u),u}let v={eyeLen:1,eyeWid:1,eyeX:0,eyeY:0,bodyX:0,bodyY:0,rot:0,scale:1,blinkIn:0},w=a=>a*a*(3-2*a),x=a=>Math.sin(Math.PI*a);function y(a,b,c){return a<=0||a>=1?0:a<b?w(a/b):a>1-c?w((1-a)/c):1}let z={glance:{weight:26,dur:[900,1400],play:(a,b,c)=>{let d=y(a,.12,.34);return{eyeX:22*b*d,eyeY:22*c*d,rot:.9*b*d,blinkIn:40*!!(a<.02&&.4>Math.random())}}},lookAway:{weight:12,dur:[1800,2600],play:(a,b,c)=>{let d=y(a,.1,.46);return{eyeX:30*b*d,eyeY:(.5*c+.35)*22*d,rot:1.6*b*d}}},widen:{weight:8,dur:[700,950],play:(a,b)=>{let c=y(a,.22,.5);return{eyeLen:1+.16*c,eyeWid:1+.2*c,rot:-(.5*b)*c}}},squint:{weight:8,dur:[800,1050],play:a=>{let b=y(a,.25,.45);return{eyeLen:1-.3*b,eyeWid:1-.12*b}}},double:{weight:7,dur:[420,420],play:a=>({blinkIn:+(a<.02)})},nod:{weight:11,dur:[1150,1400],play:a=>({bodyY:10*Math.sin(2*f*a)*x(a),rot:2.2*Math.sin(2*f*a+.5)*x(a),eyeY:3.2*Math.sin(2*f*a-.7)*x(a)})},sink:{weight:7,dur:[1800,2300],play:a=>{let b=x(a)**.7;return{eyeLen:1-.26*b,eyeY:4*b,bodyY:8*b,scale:1-.03*b,rot:1.8*b}}},wave:{weight:7,dur:[1300,1700],play:(a,b)=>{let c=y(a,.24,.34);return{bodyX:b*Math.sin(1.5*f*a)*9*c,rot:b*Math.sin(1.5*f*a+.5)*4.5*c,eyeX:b*Math.sin(1.5*f*a)*5*c,eyeLen:1-.2*c}}},reach:{weight:7,dur:[1800,2300],play:a=>{let b=y(a,.28,.34);return{scale:1+.045*b,bodyY:-4*b,eyeLen:1-.28*b,eyeY:3*b,rot:1.8*b}}},tilt:{weight:11,dur:[1500,1900],play:(a,b)=>{let c=y(a,.22,.4);return{rot:9*b*c,bodyX:-3*b*c,eyeY:-1.5*c}}},sweep:{weight:9,dur:[1600,2200],play:(a,b,c)=>{let d=y(a,.12,.18),e=Math.cos(Math.PI*i((a-.15)/.7,0,1));return{eyeX:24*b*d*e,eyeY:24*c*d*e,rot:1.2*b*d*e}}},roll:{weight:5,dur:[900,1200],play:(a,b)=>{let c=x(a)**.5,d=f*a*(b>=0?1:-1);return{eyeX:20*Math.cos(d)*c,eyeY:14*Math.sin(d)*c,rot:1.5*Math.sin(d)*c,blinkIn:+(a>.9&&a<.93)}}},shake:{weight:8,dur:[650,900],play:(a,b)=>{let c=x(a),d=Math.sin(2*f*a);return{rot:b*d*5*c,bodyX:b*d*4*c,eyeX:-b*d*4*c}}},bounce:{weight:6,dur:[850,1100],play:a=>{let b=1-.45*a,c=Math.abs(Math.sin(f*a))*b;return{bodyY:-14*c,eyeY:2.5*c,scale:1-Math.max(0,-Math.cos(f*a))*b*.04}}},slowBlink:{weight:6,dur:[900,1200],play:a=>({eyeWid:1-.88*x(a)**.6,eyeY:1.5*x(a)})},perk:{weight:5,dur:[700,950],play:(a,b)=>{let c=y(a,.09,.62);return{bodyY:-7*c,scale:1+.035*c,eyeLen:1+.14*c,eyeWid:1+.1*c,rot:.8*b*c}}}},A=Object.keys(z),B={idle:{},connecting:{nod:0,wave:0,bounce:0,sweep:1.6,roll:1.4},listening:{glance:.3,lookAway:.15,sweep:.2,roll:0,wave:0,shake:0,bounce:0,sink:.3,widen:2.2,perk:1.8,nod:1.6,slowBlink:1.4},thinking:{lookAway:2.2,squint:2,tilt:1.8,roll:2,sweep:1.4,sink:1.6,glance:.8,slowBlink:1.2,nod:.3,wave:0,bounce:.2,perk:.5},delegating:{wave:2.6,nod:1.8,perk:1.6,glance:1.4,tilt:1.2,lookAway:.4,squint:.4,sink:0,roll:0},speaking:{nod:2,glance:1.2,widen:1.2,sink:0,roll:.3,wave:.4,slowBlink:.4,bounce:.6}},C={idle:{eyes:1,body:1,churn:0,churnSpeed:0,dwell:1,breathe:1,float:1,blink:1,shadow:0,lean:0,aspect:1,gazeX:0,gazeY:0},connecting:{eyes:.75,body:.91,churn:2.5,churnSpeed:3,dwell:.8,breathe:2.2,float:.6,blink:.6,shadow:0,lean:0,aspect:1.03,gazeX:0,gazeY:4},listening:{eyes:1.3,body:1.04,churn:0,churnSpeed:0,dwell:2.6,breathe:.45,float:.35,blink:1.8,shadow:0,lean:0,aspect:.97,gazeX:0,gazeY:-3},thinking:{eyes:.66,body:.96,churn:5,churnSpeed:.6,dwell:.5,breathe:1.3,float:1.4,blink:.8,shadow:1,lean:7,aspect:1.04,gazeX:-9,gazeY:-8},delegating:{eyes:.9,body:.98,churn:0,churnSpeed:0,dwell:2.2,breathe:.6,float:.5,blink:1.3,shadow:0,lean:-6,aspect:1,gazeX:15,gazeY:2},speaking:{eyes:.95,body:1,churn:2.5,churnSpeed:3,dwell:4,breathe:.4,float:.5,blink:1.2,shadow:0,lean:0,aspect:1,gazeX:0,gazeY:0}},D=Array(e.MARK_BANDS).fill(0);function E(){let a=Math.random();return a<.15?180+320*Math.random():a<.8?1200+2300*Math.random():3500+2800*Math.random()}function F(a){if("number"==typeof a)return a;let b=0x811c9dc5;for(let c=0;c<a.length;c++)b=Math.imul(b^a.charCodeAt(c),0x1000193);return(b>>>0)%1e4}function G({size:a=32,seed:k,color:l,shape:t,vary:w,outline:x,notify:y,state:H="idle",getLevel:I,getSpectrum:J,options:K,className:L,svgRef:M}){let N=(0,c.useId)(),O=(0,c.useMemo)(()=>void 0===w||!1===w?0:F(!0===w?N:w)||1,[w,N]),P=(0,c.useMemo)(()=>(function(a,b){if(!b)return a;let c=j(b),d=([a,b])=>a+c()*(b-a);return{...a,wobble:a.wobble*d(p),corner:d(q),rotation:d(r),squircle:d(s)}})({...o,...K,...void 0===x?{}:{fill:!x}},O),[K,x,O]),Q=`${N}-glow`,R=`${N}-halo`,S=`${N}-mask`,T=`${N}-shadow`,U=(0,c.useRef)(null),V=(0,c.useRef)(null),W=(0,c.useRef)(null),X=(0,c.useRef)(null),Y=(0,c.useRef)(null),Z=(0,c.useRef)(null),$=(0,c.useRef)(null),_=(0,c.useRef)(null),aa=(0,c.useRef)(null),ab=(0,c.useRef)(null),ac=(0,c.useRef)(null),ad=(0,c.useRef)(null),ae=M??ad,af=void 0===k?P.seed:F(k),ag=O?((af^Math.imul(O,0x9e3779b1))>>>0)%1e4:af,ah=t??P.shape,ai=l??P.color,aj=y??P.notify,ak=(0,c.useMemo)(()=>u(P,ah,ag),[P,ah,ag]),al=(0,c.useMemo)(()=>m(ak),[ak]),am=(0,c.useMemo)(()=>n({len:P.eyeLen,width:P.eyeWidth,bend:P.eyeBend,taper:P.eyeTaper,tilt:P.eyeTilt,cx:120-P.eyeGap/2,cy:P.eyeY}),[P]),an=(0,c.useMemo)(()=>n({len:P.eyeLen,width:P.eyeWidth,bend:P.eyeBend,taper:P.eyeTaper,tilt:P.eyeTilt+P.eyeSkew,cx:120+P.eyeGap/2,cy:P.eyeY}),[P]),ao=(0,c.useRef)({cfg:P,state:H,getLevel:I,getSpectrum:J,radii:ak,shapeSeed:ag});ao.current={cfg:P,state:H,getLevel:I,getSpectrum:J,radii:ak,shapeSeed:ag},(0,c.useEffect)(()=>{let a=0,b=ao.current.shapeSeed%17*.91,c=0,g=0,j=performance.now()+600+E(),k=0,l=130,n=0,o=(0,d.createVoiceFollower)(),p={...C.idle},q=Object.keys(p),r=0,s=0,t=0,u=.5,w=0,x=0,y=0,F=Array(e.MARK_BANDS).fill(0),G=Array.from({length:e.MARK_BANDS},(a,b)=>1.7*b),H=0,I=performance.now(),J=null,K=performance.now()+1500+3e3*Math.random(),L=d=>{a=requestAnimationFrame(L);let{cfg:M,state:N}=ao.current,O=d/1e3*M.speed,P=Math.min(.05,(d-I)/1e3);I=d;let Q=C[N];for(let a of q)p[a]+=(Q[a]-p[a])*.06;H+=P*p.churnSpeed*M.speed;let R="speaking"===N?ao.current.getSpectrum?.():void 0,S=o.read(R??D,P),T=0;for(let a=0;a<e.MARK_BANDS;a++){let b=S.bands[a];F[a]+=(b-F[a])*M.bandEase,G[a]+=P*(.05+.018*a)*(a%2?-1:1),T+=b}let ad=ao.current.getLevel?.(),ae="speaking"===N?i(ad??S.level,0,1):0;r+=(ae-r)*.3,s+=(ae-s)*.055,t+=(ae-t)*.016,(void 0===ad?S.onset>0:r>1.25*s+.03&&r>.09)&&d-y>340&&(y=d,x-=M.punch*Math.min(1,1.6*r)*M.bobRate);let af=.01*M.bobRate*M.bobRate;if(x+=-w*af-.085*x*M.bobRate,w+=x,T>.04){let a=0;for(let b=0;b<e.MARK_BANDS;b++)a+=F[b]*b;u+=(a/T/(e.MARK_BANDS-1)-u)*.04}else u+=(.5-u)*.03;let ag=p.dwell;if(M.idle&&!J&&d>=K){let a=function(a){let b=B[a],c=a=>z[a].weight*(b[a]??1),d=0;for(let a of A)d+=c(a);let e=Math.random()*d;for(let a of A)if((e-=c(a))<=0)return a;return A[0]}(N),b=z[a],c=Math.PI/4*Math.floor(8*Math.random());J={key:a,start:d,dur:b.dur[0]+Math.random()*(b.dur[1]-b.dur[0]),dx:Math.cos(c),dy:.7*Math.sin(c)-.5*("thinking"===N)}}let ah=v;if(J){let a=(d-J.start)/J.dur;a>=1?(J=null,K=d+(9e3-74*M.liveliness)*ag*(.6+.8*Math.random())):(ah={...v,...z[J.key].play(a,J.dx,J.dy)}).blinkIn>0&&0===n&&(n=d+ah.blinkIn)}if(aa.current){let a=.5-.5*Math.cos(.55*O);aa.current.setAttribute("opacity",h(p.shadow*a*M.shadow/100).toString())}if(U.current){let a=M.breathe*p.breathe/100,c=t*M.pulse/300-.05*w,d=(.45-u)/.45*t*(M.stretch/100),e=(1+a*Math.sin(1.6*O+b)-.75*c+d)*p.body*ah.scale/p.aspect,f=(1+c-.8*d)*p.body*ah.scale*p.aspect,g=25*a*Math.sin(1.1*O+1.7*b)+ah.rot+p.lean,i=120+90*a*Math.sin(.7*O+.6*b)+ah.bodyX,j=120+120*a*Math.sin(1.3*O+2.3*b)+ah.bodyY+w*M.pulse*2;U.current.setAttribute("transform",`translate(${h(i)} ${h(j)}) rotate(${h(g)}) scale(${f.toFixed(4)} ${e.toFixed(4)}) translate(${-120} ${-120})`)}let ai=(F[0]+F[1]+F[2])/3,aj=(F[3]+F[4])/2,ak=(F[5]+F[6]+F[7])/3,al=ai+aj+ak>.03&&M.ripple>0,am=p.churn>0;if(W.current&&(al||am)){let a=H,c=m(ao.current.radii.map((c,d)=>{let e=d/128*f,g=c;return al&&(g+=M.ripple*(ai*Math.sin(2*e+G[0])+.7*aj*Math.sin(3*e+G[1])+.5*ak*Math.sin(4*e+G[2]))),am&&(g+=p.churn*(.65*Math.sin(2*e+a)+.35*Math.sin(3*e-1.4*a+b))),g}));W.current.setAttribute("d",c),X.current?.setAttribute("d",c),$.current?.setAttribute("d",c),_.current?.setAttribute("d",c),aa.current?.setAttribute("d",c),ac.current?.setAttribute("d",c),ab.current?.setAttribute("d",c)}if(V.current){let a=0,e=0;M.follow&&0;c+=(a-c)*.12,g+=(e-g)*.12;let f=M.float*p.float*(.62*Math.sin(1.15*O+b)+.38*Math.sin(.47*O+2.1*b)),i=1;if(0===k&&(n>0&&d>=n?(k=d,n=0):M.blink&&d>=j&&(k=d),k>0&&(l=110+60*Math.random())),k>0){let a=(d-k)/l;a>=1?(k=0,j=d+E()*p.blink):i=1-.94*Math.sin(Math.PI*a)}V.current.setAttribute("transform",`translate(${h(c+ah.eyeX+p.gazeX)} ${h(g+f+ah.eyeY+p.gazeY)}) translate(120 ${M.eyeY}) scale(1 ${i.toFixed(3)}) translate(${-120} ${-M.eyeY})`);let m=ah.eyeWid*(1-.13*t)*p.eyes,o=ah.eyeLen*(1+.04*t)*p.eyes,q=M.eyeGap/2;for(let[a,b]of[Y,Z].entries()){if(!b.current)continue;let c=120+(0===a?-q:q),d=0===a?M.eyeTilt:M.eyeTilt+M.eyeSkew,e=o.toFixed(3),f=m.toFixed(3);b.current.setAttribute("transform",`translate(${h(c)} ${M.eyeY}) rotate(${h(d)}) scale(${e} ${f}) rotate(${h(-d)}) translate(${h(-c)} ${-M.eyeY})`)}}};return a=requestAnimationFrame(L),()=>cancelAnimationFrame(a)},[ae]);let ap=P.notifyAngle*Math.PI/180;return(0,b.jsxs)("svg",{ref:ae,"data-slot":"bot-mark","aria-hidden":"true",className:L,viewBox:g,width:a,height:a,style:{overflow:"visible","--fg":ai},children:[(0,b.jsxs)("defs",{children:[(0,b.jsx)("clipPath",{id:N,children:(0,b.jsx)("path",{ref:X,d:al})}),P.fill&&(0,b.jsxs)("mask",{id:S,maskUnits:"userSpaceOnUse",children:[(0,b.jsx)("path",{ref:ab,d:al,fill:"#fff"}),(0,b.jsx)("g",{clipPath:`url(#${N})`,children:(0,b.jsxs)("g",{ref:V,children:[(0,b.jsx)("g",{ref:Y,children:(0,b.jsx)("path",{d:am,fill:"#000"})}),(0,b.jsx)("g",{ref:Z,children:(0,b.jsx)("path",{d:an,fill:"#000"})})]})}),aj&&(0,b.jsx)("circle",{cx:h(120+Math.cos(ap)*P.notifyDist),cy:h(120+Math.sin(ap)*P.notifyDist),r:P.notifyR+P.notifyRing,fill:"#000"})]}),P.shadow>0&&(0,b.jsx)("filter",{id:T,x:"-60%",y:"-60%",width:"220%",height:"220%",colorInterpolationFilters:"sRGB",children:(0,b.jsx)("feGaussianBlur",{stdDeviation:9})}),P.glow>0&&(0,b.jsxs)("mask",{id:R,maskUnits:"userSpaceOnUse",x:-72,y:-72,width:384,height:384,children:[(0,b.jsx)("rect",{x:-72,y:-72,width:384,height:384,fill:"#fff"}),(0,b.jsx)("path",{ref:_,d:al,fill:"#000"})]}),P.glow>0&&(0,b.jsx)("filter",{id:Q,x:"-60%",y:"-60%",width:"220%",height:"220%",colorInterpolationFilters:"sRGB",children:(0,b.jsx)("feGaussianBlur",{stdDeviation:P.glow})})]}),(0,b.jsxs)("g",{ref:U,children:[P.shadow>0&&(0,b.jsx)("path",{ref:aa,d:al,fill:"var(--fg)",filter:`url(#${T})`,transform:"translate(0 12)",opacity:0}),P.glow>0&&(0,b.jsx)("path",{ref:$,d:al,fill:P.glowColor??"var(--fg)",filter:`url(#${Q})`,mask:`url(#${R})`,opacity:P.glowStrength/100}),P.rim>0&&(0,b.jsx)("path",{ref:ac,d:al,fill:"none",stroke:P.rimColor,strokeWidth:2*P.rim,strokeLinejoin:"round"}),(0,b.jsx)("path",{ref:W,d:al,fill:P.fill?"var(--fg)":"none",stroke:P.fill?"none":"var(--fg)",strokeWidth:P.fill?0:P.strokeWidth,strokeLinejoin:"round",mask:P.fill?`url(#${S})`:void 0}),!P.fill&&(0,b.jsx)("g",{clipPath:`url(#${N})`,children:(0,b.jsxs)("g",{ref:V,children:[(0,b.jsx)("g",{ref:Y,children:(0,b.jsx)("path",{d:am,fill:"var(--fg)"})}),(0,b.jsx)("g",{ref:Z,children:(0,b.jsx)("path",{d:an,fill:"var(--fg)"})})]})}),aj&&(0,b.jsx)("circle",{cx:h(120+Math.cos(ap)*P.notifyDist),cy:h(120+Math.sin(ap)*P.notifyDist),r:P.notifyR,fill:P.notifyColor})]})]})}a.s(["BotMark",0,G,"BotsMark",0,function({size:a=16,className:c}){return(0,b.jsx)(G,{size:a,seed:"bots",className:c})},"markAtRest",0,function(a){let b=(a,b)=>n({len:o.eyeLen,width:o.eyeWidth,bend:o.eyeBend,taper:o.eyeTaper,tilt:b,cx:a,cy:o.eyeY});return{head:m(u(o,o.shape,F(a))),eyes:[b(120-o.eyeGap/2,o.eyeTilt),b(120+o.eyeGap/2,o.eyeTilt+o.eyeSkew)]}}])},324835,396398,a=>{"use strict";let b=[1,3,5,8,13,21,34,55,90],c=[1,1.1,1.25,1.45,1.7,2,2.4,2.9],d=c.length,e=Array(d).fill(0);function f(a,e,f){a.getByteFrequencyData(e);for(let a=0;a<d;a++){let d=0,g=b[a],h=Math.min(b[a+1],e.length);for(let a=g;a<h;a++)d+=e[a];let i=h>g?d/(h-g)/255:0;f[a]=Math.min(1,i*c[a])}return f}a.s(["SPECTRUM_BANDS",0,d,"createAudioTap",0,function(){let a=new Audio;a.autoplay=!0;let b=null,c=null,g=new Uint8Array(0),h=null,i=Array(d).fill(0),j=null,k=new Uint8Array(0),l=null,m=Array(d).fill(0);function n(){if(b&&c)return{context:b,analyser:c};let a=new AudioContext,d=a.createAnalyser();return d.fftSize=512,d.smoothingTimeConstant=.55,g=new Uint8Array(d.frequencyBinCount),a.resume().catch(()=>{}),b=a,c=d,{context:a,analyser:d}}return{element:a,open:n,listen(a){if(h?.mediaStream===a)return;h?.disconnect();let b=n();(h=b.context.createMediaStreamSource(a)).connect(b.analyser),b.context.resume()},speaker(){let a=n();return a.analyser.connect(a.context.destination),a},hear(a){if(l?.mediaStream===a)return;l?.disconnect();let b=n();j||((j=b.context.createAnalyser()).fftSize=512,j.smoothingTimeConstant=.6,k=new Uint8Array(j.frequencyBinCount)),(l=b.context.createMediaStreamSource(a)).connect(j),b.context.resume()},read:()=>c?f(c,g,i):e,readMic:()=>j?f(j,k,m):e}},"createVoiceFollower",0,function(){let a=Array(d).fill(0),b=Array(d).fill(0),c={level:0,phrase:0,onset:0,bands:Array(d).fill(0)},e=0,f=0,g=1/0,h=(a,b,c,d)=>a+(b-a)*Math.min(1,d/c);return{read(i,j){let k=0,l=0,m=0;for(let e=0;e<d;e++){let d=i[e]??0;k+=d,a[e]=h(a[e],d,d>a[e]?.03:2.5,j),b[e]=h(b[e],d,d<b[e]?.12:3,j);let f=a[e]-b[e],g=f>.12?Math.min(1,Math.max(0,(d-b[e])/f)):0;c.bands[e]=g,f>.12&&(l+=g,m++)}let n=Math.min(1,Math.max(0,(k/d-.03)/.09)),o=n*n*(3-2*n);for(let a=0;a<d;a++)c.bands[a]*=o;return c.level=(m?l/m:0)*o,e=h(e,c.level,.05,j),f=h(f,c.level,.22,j),c.phrase=h(c.phrase,c.level,.45,j),g+=j,c.onset=0,e>f+.1&&e>.3&&g>.12&&(g=0,c.onset=Math.min(1,e)),c}}}],396398);let g="currentColor",h=[{id:"system",label:"System",value:g},{id:"slate",label:"Slate",value:"#64748B"},{id:"indigo",label:"Indigo",value:"#6366F1"},{id:"blue",label:"Blue",value:"#3B82F6"},{id:"cyan",label:"Cyan",value:"#06B6D4"},{id:"teal",label:"Teal",value:"#14B8A6"},{id:"green",label:"Green",value:"#22C55E"},{id:"lime",label:"Lime",value:"#84CC16"},{id:"amber",label:"Amber",value:"#F59E0B"},{id:"orange",label:"Orange",value:"#F97316"},{id:"red",label:"Red",value:"#EF4444"},{id:"pink",label:"Pink",value:"#EC4899"},{id:"violet",label:"Violet",value:"#8B5CF6"},{id:"fuchsia",label:"Fuchsia",value:"#D946EF"},{id:"rose",label:"Rose",value:"#F43F5E"},{id:"sky",label:"Sky",value:"#0EA5E9"},{id:"emerald",label:"Emerald",value:"#10B981"},{id:"yellow",label:"Yellow",value:"#EAB308"},{id:"stone",label:"Stone",value:"#78716C"},{id:"navy",label:"Navy",value:"#1E3A8A",dark:!0},{id:"ocean",label:"Ocean",value:"#155E75",dark:!0},{id:"pine",label:"Pine",value:"#166534",dark:!0},{id:"moss",label:"Moss",value:"#3F6212",dark:!0},{id:"olive",label:"Olive",value:"#854D0E",dark:!0},{id:"rust",label:"Rust",value:"#9A3412",dark:!0},{id:"wine",label:"Wine",value:"#9F1239",dark:!0},{id:"plum",label:"Plum",value:"#6B21A8",dark:!0},{id:"grape",label:"Grape",value:"#5B21B6",dark:!0},{id:"iron",label:"Iron",value:"#334155",dark:!0}],i=Object.fromEntries(h.map(a=>[a.id,a.value])),j=h.filter(a=>a.value!==g).map(a=>a.value),k=[i.amber,i.red],l=[h.filter(a=>a.value!==g&&!("dark"in a)).map(a=>a.value),h.filter(a=>"dark"in a).map(a=>a.value)];a.s(["MARK_BANDS",0,d,"MARK_PALETTE",0,j,"MARK_PALETTE_ROWS",0,l,"MARK_SHAPES",0,["blob","poly","squircle"],"MARK_SYSTEM",0,g,"randomMarkColors",0,function(a){let b=j.filter(a=>!k.includes(a));for(let a=b.length-1;a>0;a--){let c=Math.floor(Math.random()*(a+1));[b[a],b[c]]=[b[c],b[a]]}return b.slice(0,a)}],324835)}];
2
+
3
+ //# sourceMappingURL=features_bot_1s_-2vj._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[405593,a=>{"use strict";var b=a.i(187924),c=a.i(164831);let d={name:"audio-lines",size:24,node:[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]};d.node;let e=(0,c.default)(d),f={name:"captions",size:24,node:[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]],aliases:["subtitles"]};f.node;let g=(0,c.default)(f);var h=a.i(752562),i=a.i(141146);let j={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};j.node;let k=(0,c.default)(j);var l=a.i(71215),m=a.i(26268),n=a.i(572131),o=a.i(767561),p=a.i(340695),q=a.i(205522),r=a.i(446181),s=a.i(608902),t=a.i(379630),u=a.i(61876),v=a.i(913834),w=a.i(405050);let x=(0,w.createServerReference)("7f25c6b89ec9d7c8f1bbbd8a43e823b5f135abdb02",w.callServer,void 0,w.findSourceMapURL,"removeConfigAction");var y=a.i(280689),z=a.i(478978),A=a.i(619477),B=a.i(313237),C=a.i(759497),D=a.i(497895);let E={image:l.Image,video:k,speech:e,transcription:g};function F({section:a}){let{data:c,isLoading:d,error:e}=(0,C.useServerRoute)(o.queryKey.config);if(d)return(0,b.jsx)(A.SettingSkeleton,{rows:4});if(e)return(0,b.jsx)(A.SettingError,{message:e.message});let f=a=>(0,z.isConfigSet)(c,a),g=a=>c?.find(b=>b.key===a)?.value,h=z.CONFIG_GROUPS.filter(b=>b.section===a),i=h.flatMap(a=>a.entries);return(0,b.jsx)(A.SettingScreen,{footer:(0,b.jsx)(A.SettingRailNote,{children:"keys"===a?(0,b.jsxs)(b.Fragment,{children:[i.filter(a=>f(a.key)).length," of"," ",i.length," set",h.some(a=>!(0,z.groupSatisfied)(a,f))?" · a call needs one voice key":" · your keys stay on this machine"]}):(0,b.jsxs)(b.Fragment,{children:[i.length," of ",i.length," resolved ·"," ",i.filter(a=>g(a.key)).length," pinned"]})}),children:h.map(a=>(0,b.jsx)(A.SettingGroup,{label:a.title,hint:a.hint,right:(0,b.jsx)(G,{group:a,isSet:f}),children:(0,b.jsx)(A.SettingItems,{children:a.entries.map(c=>c.choices?(0,b.jsx)(I,{entry:c,choices:c.choices,value:g(c.key),isSet:f},c.key):(0,b.jsx)(H,{entry:c,set:f(c.key),needed:!(0,z.groupSatisfied)(a,f)},c.key))})},a.id))})}function G({group:a,isSet:c}){return"none"===a.require?null:(0,z.groupSatisfied)(a,c)?(0,b.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,b.jsx)(h.Check,{className:"size-3"}),"ready"]}):(0,b.jsxs)("span",{className:(0,D.cn)("flex items-center gap-1 font-mono text-[11px]",D.WAITING_INK),children:[(0,b.jsx)(m.TriangleAlert,{className:"size-3"}),a.note??"Required"]})}function H({entry:a,set:c,needed:d}){return(0,b.jsxs)("button",{type:"button",onClick:()=>{var d,e;return d=a,e=c,r.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,b.jsx)(L,{entry:d,set:e,onDone:a})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[a.provider&&(0,b.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,b.jsx)(t.ProviderIcon,{provider:a.provider,className:"size-4"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsx)("span",{className:"block truncate text-sm font-medium",children:a.label}),(0,b.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:a.key})]}),(0,b.jsxs)("span",{className:(0,D.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",c?"text-muted-foreground":d?D.WAITING_INK:"text-muted-foreground/60"),children:[c&&(0,b.jsx)(h.Check,{className:"size-3"}),!c&&d&&(0,b.jsx)(m.TriangleAlert,{className:"size-3"}),c?"Set":d?"Needed":"Not set"]}),(0,b.jsx)(i.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function I({entry:a,choices:c,value:d,isSet:e}){let f=c.find(a=>a.value===d),g=c.filter(a=>e(a.needs)),h=d&&!f?d:null,j=a.kind?E[a.kind]:v.BotsMark;return(0,b.jsxs)("button",{type:"button",onClick:()=>{var d,e,f;return a.kind||a.text?(d=a,r.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,b.jsx)(J,{entry:d,onDone:a})})):(e=a,f=c,r.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,b.jsx)(K,{entry:e,choices:f,onDone:a})}))},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,b.jsx)(j,{className:"size-4 text-muted-foreground"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsx)("span",{className:"block truncate text-sm font-medium",children:a.label}),(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[!f&&!h&&(0,b.jsx)("span",{className:(0,D.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",a.kind?D.WAITING_INK:"text-muted-foreground"),children:a.kind?"off":"auto"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground",children:f?.label??h??(a.kind?"Not offered to bots until you pick one":g[0]?.label??"No key for any of these yet")})]})]}),(0,b.jsx)(i.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function J({entry:a,onDone:c}){let{data:d}=(0,C.useServerRoute)(o.queryKey.config),e=d?.find(b=>b.key===a.key)?.value,[f,g]=(0,n.useState)(()=>{let b=a.text?(0,u.parseTextModel)(e):(0,u.parseMediaModel)(e);return{provider:b?.provider??null,model:b?.model??""}}),h=()=>{(0,C.revalidate)(o.queryKey.config),c()},[i]=(0,B.useServerAction)(y.setConfigAction,{okMessage:`${a.label} saved`,onOk:h}),[j,k]=(0,B.useServerAction)(x,{okMessage:a.kind?`${a.label} switched off`:`${a.label} back to automatic`,onOk:h});return(0,b.jsx)(A.SettingDialogContent,{title:a.label,description:a.hint,footer:(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(p.Button,{variant:"ghost",loading:k,onClick:()=>j(a.key),children:a.kind?"Turn off":"Automatic"}),(0,b.jsx)(p.Button,{variant:"ghost",onClick:c,children:"Close"})]}),children:(0,b.jsx)(s.ModelPicker,{kind:a.kind,provider:f.provider,model:f.model,onChange:b=>{g(b),b.model.trim()&&i(a.key,`${b.provider}/${b.model.trim()}`)}})})}function K({entry:a,choices:c,onDone:d}){let{data:e}=(0,C.useServerRoute)(o.queryKey.config),f=e?.find(b=>b.key===a.key)?.value,g=()=>{(0,C.revalidate)(o.queryKey.config),d()},[h,i]=(0,B.useServerAction)(y.setConfigAction,{okMessage:`${a.label} saved`,onOk:g}),[j,k]=(0,B.useServerAction)(x,{okMessage:a.kind?`${a.label} switched off`:`${a.label} back to automatic`,onOk:g});return(0,b.jsx)(A.SettingDialogContent,{title:a.label,description:a.hint,footer:(0,b.jsxs)(b.Fragment,{children:[f&&(0,b.jsx)(p.Button,{variant:"ghost",loading:k,onClick:()=>j(a.key),children:a.kind?"Turn off":"Automatic"}),(0,b.jsx)(p.Button,{variant:"ghost",onClick:d,children:"Close"})]}),children:(0,b.jsx)(A.SettingChoiceRows,{options:c.map(a=>({value:a.value,label:a.label,disabled:!(0,z.isConfigSet)(e,a.needs)&&`needs ${a.needs}`})),value:f,onChange:b=>h(a.key,b),disabled:i})})}function L({entry:a,set:c,onDone:d}){let[e,f]=(0,n.useState)(""),g=()=>{(0,C.revalidate)(o.queryKey.config),(0,C.revalidate)(o.queryKey.llmModel)},[h,i]=(0,B.useServerAction)(y.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{g(),d()}}),[j,k]=(0,B.useServerAction)(x,{okMessage:`${a.label} key removed`,onOk:()=>{g(),d()}});return(0,b.jsx)(A.SettingDialogContent,{title:a.label,description:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"font-mono",children:a.key}),a.hint&&(0,b.jsxs)(b.Fragment,{children:[" · ",a.hint]})]}),footer:(0,b.jsxs)(b.Fragment,{children:[c&&(0,b.jsx)(p.Button,{variant:"ghost",loading:k,onClick:()=>j(a.key),children:"Remove"}),(0,b.jsx)(p.Button,{variant:"ghost",onClick:d,children:"Cancel"}),(0,b.jsx)(p.Button,{loading:i,disabled:e.trim().length<8,onClick:()=>h(a.key,e),children:c?"Replace":"Save"})]}),children:(0,b.jsx)(q.Input,{value:e,onChange:a=>f(a.target.value),onKeyDown:b=>{"Enter"===b.key&&e.trim().length>=8&&h(a.key,e)},placeholder:c?"New value — replaces the current key":a.key,spellCheck:!1,type:"password",autoFocus:!0})})}a.s(["ConfigGroups",0,F,"ConfigSetting",0,function(){return(0,b.jsx)(F,{section:"keys"})}],405593)}];
1
+ module.exports=[405593,a=>{"use strict";var b=a.i(187924),c=a.i(987234),d=a.i(164831);let e={name:"audio-lines",size:24,node:[["path",{d:"M2 10v3",key:"1fnikh"}],["path",{d:"M6 6v11",key:"11sgs0"}],["path",{d:"M10 3v18",key:"yhl04a"}],["path",{d:"M14 8v7",key:"3a1oy3"}],["path",{d:"M18 5v13",key:"123xd1"}],["path",{d:"M22 10v3",key:"154ddg"}]]};e.node;let f=(0,d.default)(e),g={name:"captions",size:24,node:[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]],aliases:["subtitles"]};g.node;let h=(0,d.default)(g);var i=a.i(752562),j=a.i(141146);let k={name:"clapperboard",size:24,node:[["path",{d:"m12.296 3.464 3.02 3.956",key:"qash78"}],["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3z",key:"1h7j8b"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"4lm6w1"}],["path",{d:"m6.18 5.276 3.1 3.899",key:"zjj9t3"}]]};k.node;let l=(0,d.default)(k);var m=a.i(71215),n=a.i(126766),o=a.i(233540),p=a.i(26268),q=a.i(572131),r=a.i(767561),s=a.i(340695),t=a.i(205522),u=a.i(446181),v=a.i(950463),w=a.i(852307),x=a.i(608902),y=a.i(379630),z=a.i(61876),A=a.i(913834),B=a.i(405050);let C=(0,B.createServerReference)("7f9bc624b9c7f137e24cde3bf2bd49ab2a3d39404c",B.callServer,void 0,B.findSourceMapURL,"removeConfigAction");var D=a.i(86776),E=a.i(478978),F=a.i(619477),G=a.i(313237),H=a.i(759497),I=a.i(497895);let J={[E.EXA_API_KEY]:o.Search},K={image:m.Image,video:l,speech:f,transcription:h};function L({section:a}){let{data:c,isLoading:d,error:e}=(0,H.useServerRoute)(r.queryKey.config);if(d)return(0,b.jsx)(F.SettingSkeleton,{rows:4});if(e)return(0,b.jsx)(F.SettingError,{message:e.message});let f=a=>(0,E.isConfigSet)(c,a),g=a=>c?.find(b=>b.key===a)?.value,h=E.CONFIG_GROUPS.filter(b=>b.section===a),i=h.flatMap(a=>a.entries);return(0,b.jsx)(F.SettingScreen,{footer:(0,b.jsx)(F.SettingRailNote,{children:"keys"===a?(0,b.jsxs)(b.Fragment,{children:[i.filter(a=>f(a.key)).length," of"," ",i.length," set",h.some(a=>!(0,E.groupSatisfied)(a,f))?" · a call needs one voice key":" · your keys stay on this machine"]}):(0,b.jsxs)(b.Fragment,{children:[i.length," of ",i.length," resolved ·"," ",i.filter(a=>g(a.key)).length," pinned"]})}),children:h.map(a=>(0,b.jsx)(F.SettingGroup,{label:a.title,hint:a.hint,right:(0,b.jsx)(M,{group:a,isSet:f}),children:(0,b.jsx)(F.SettingItems,{children:a.entries.map(c=>c.choices?(0,b.jsx)(W,{entry:c,choices:c.choices,value:g(c.key),isSet:f},c.key):(0,b.jsx)(N,{entry:c,set:f(c.key),needed:!(0,E.groupSatisfied)(a,f)},c.key))})},a.id))})}function M({group:a,isSet:c}){return"none"===a.require?null:(0,E.groupSatisfied)(a,c)?(0,b.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,b.jsx)(i.Check,{className:"size-3"}),"ready"]}):(0,b.jsxs)("span",{className:(0,I.cn)("flex items-center gap-1 font-mono text-[11px]",I.WAITING_INK),children:[(0,b.jsx)(p.TriangleAlert,{className:"size-3"}),a.note??"Required"]})}function N({entry:a,set:c,needed:d}){let e=Q(a,c),f=S(a,c),g=R(a,c),h=f.data?T(f.data):P(c,d,e.data,a.signIn);return(0,b.jsxs)("button",{type:"button",onClick:()=>{var d,e,f;return a.signIn?(d=a,u.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,b.jsx)(Z,{entry:d,onDone:a})})):(e=a,f=c,u.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,b.jsx)($,{entry:e,set:f,onDone:a})}))},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,b.jsx)(V,{entry:a})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsx)("span",{className:"block truncate text-sm font-medium",children:a.label}),(0,b.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:a.signIn?c?U(f.data,g):"sign in with your account":a.key})]}),e.isLoading||f.isLoading?(0,b.jsx)(v.Skeleton,{className:"h-3 w-20 shrink-0"}):(0,b.jsxs)("span",{className:(0,I.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",h.ink),children:[h.warn?(0,b.jsx)(p.TriangleAlert,{className:"size-3"}):c&&(0,b.jsx)(i.Check,{className:"size-3"}),h.text]}),(0,b.jsx)(j.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let O=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function P(a,b,c,d){return a?c?"refused"in c?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${O.format(c.balance)} left`,ink:c.low?I.WAITING_INK:"text-muted-foreground",warn:c.low}:{text:d?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:b?{text:"Needed",ink:I.WAITING_INK,warn:!0}:{text:d?"Signed out":"Not set",ink:"text-muted-foreground/60",warn:!1}}function Q(a,b){return(0,H.useServerRoute)(b&&"vercel-ai-gateway"===a.provider?r.queryKey.gatewayCredits:null)}function R(a,b){let{data:c}=(0,H.useServerRoute)(b&&a.signIn?r.queryKey.llmModel:null);return c?.find(b=>b.id===a.provider)?.plan??null}function S(a,b){return(0,H.useServerRoute)(b&&a.signIn?r.queryKey.subscriptionUsage:null)}function T(a){return"refused"in a?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:a.spent?"Limit reached":`${a.usedPercent}% used`,ink:a.high?I.WAITING_INK:"text-muted-foreground",warn:a.high}}function U(a,b){let d=!a||"refused"in a?null:a,e=`${d?.plan??b??"unknown"} plan`;return d?.resetsAt?`${e} \xb7 resets in ${(0,c.formatDistanceToNowStrict)(new Date(d.resetsAt))}`:e}function V({entry:a}){if(a.provider)return(0,b.jsx)(y.ProviderIcon,{provider:a.provider,className:"size-4"});let c=J[a.key]??n.KeyRound;return(0,b.jsx)(c,{className:"size-4 text-muted-foreground"})}function W({entry:a,choices:c,value:d,isSet:e}){let f=c.find(a=>a.value===d),g=c.filter(a=>e(a.needs)),h=d&&!f?d:null,i=a.kind?K[a.kind]:A.BotsMark;return(0,b.jsxs)("button",{type:"button",onClick:()=>{var d,e,f;return a.kind||a.text?(d=a,u.notify.component({className:"sm:max-w-lg",renderer:({close:a})=>(0,b.jsx)(X,{entry:d,onDone:a})})):(e=a,f=c,u.notify.component({className:"sm:max-w-md",renderer:({close:a})=>(0,b.jsx)(Y,{entry:e,choices:f,onDone:a})}))},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,b.jsx)(i,{className:"size-4 text-muted-foreground"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-1",children:[(0,b.jsx)("span",{className:"block truncate text-sm font-medium",children:a.label}),(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[!f&&!h&&(0,b.jsx)("span",{className:(0,I.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",a.kind?I.WAITING_INK:"text-muted-foreground"),children:a.kind?"off":"auto"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-muted-foreground",children:f?.label??h??(a.kind?"Not offered to bots until you pick one":g[0]?.label??"No key for any of these yet")})]})]}),(0,b.jsx)(j.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function X({entry:a,onDone:c}){let{data:d}=(0,H.useServerRoute)(r.queryKey.config),e=d?.find(b=>b.key===a.key)?.value,[f,g]=(0,q.useState)(()=>{let b=a.text?(0,z.parseTextModel)(e):(0,z.parseMediaModel)(e);return{provider:b?.provider??null,model:b?.model??""}}),h=()=>{(0,H.revalidate)(r.queryKey.config),c()},[i]=(0,G.useServerAction)(D.setConfigAction,{okMessage:`${a.label} saved`,onOk:h}),[j,k]=(0,G.useServerAction)(C,{okMessage:a.kind?`${a.label} switched off`:`${a.label} back to automatic`,onOk:h});return(0,b.jsx)(F.SettingDialogContent,{title:a.label,description:a.hint,footer:(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(s.Button,{variant:"ghost",loading:k,onClick:()=>j(a.key),children:a.kind?"Turn off":"Automatic"}),(0,b.jsx)(s.Button,{variant:"ghost",onClick:c,children:"Close"})]}),children:(0,b.jsx)(x.ModelPicker,{kind:a.kind,provider:f.provider,model:f.model,onChange:b=>{g(b),b.model.trim()&&i(a.key,`${b.provider}/${b.model.trim()}`)}})})}function Y({entry:a,choices:c,onDone:d}){let{data:e}=(0,H.useServerRoute)(r.queryKey.config),f=e?.find(b=>b.key===a.key)?.value,g=()=>{(0,H.revalidate)(r.queryKey.config),d()},[h,i]=(0,G.useServerAction)(D.setConfigAction,{okMessage:`${a.label} saved`,onOk:g}),[j,k]=(0,G.useServerAction)(C,{okMessage:a.kind?`${a.label} switched off`:`${a.label} back to automatic`,onOk:g});return(0,b.jsx)(F.SettingDialogContent,{title:a.label,description:a.hint,footer:(0,b.jsxs)(b.Fragment,{children:[f&&(0,b.jsx)(s.Button,{variant:"ghost",loading:k,onClick:()=>j(a.key),children:a.kind?"Turn off":"Automatic"}),(0,b.jsx)(s.Button,{variant:"ghost",onClick:d,children:"Close"})]}),children:(0,b.jsx)(F.SettingChoiceRows,{options:c.map(a=>({value:a.value,label:a.label,disabled:!(0,E.isConfigSet)(e,a.needs)&&`needs ${a.needs}`})),value:f,onChange:b=>h(a.key,b),disabled:i})})}function Z({entry:a,onDone:c}){let{data:d}=(0,H.useServerRoute)(r.queryKey.config),e=(0,E.isConfigSet)(d,a.key),f=R(a,e),g=S(a,e),h=g.data?T(g.data):null,[i,j]=(0,G.useServerAction)(C,{okMessage:`Signed out of ${a.label}`,onOk:()=>{(0,H.revalidate)(r.queryKey.config),(0,H.revalidate)(r.queryKey.llmModel),c()}});return(0,b.jsx)(F.SettingDialogContent,{title:a.label,description:e?(0,b.jsxs)(b.Fragment,{children:["Signed in ·"," ",(0,b.jsx)("span",{className:"font-mono",children:U(g.data,f)}),h&&(0,b.jsxs)(b.Fragment,{children:[" · ",(0,b.jsx)("span",{className:(0,I.cn)("font-mono",h.ink),children:h.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,b.jsxs)(b.Fragment,{children:[e&&(0,b.jsx)(s.Button,{variant:"ghost",loading:j,onClick:()=>i(a.key),children:"Sign out"}),(0,b.jsx)(s.Button,{variant:"ghost",onClick:c,children:e?"Close":"Cancel"}),!e&&(0,b.jsx)(w.ChatGptSignIn,{})]}),children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(F.SettingNote,{children:e?"Bots on this subscription spend your plan's usage, not a key. When it runs out, the job stops and says when it resets.":"The sign-in opens in its own window. Approve it there, and this turns to signed in by itself."}),g.data&&"refused"in g.data&&(0,b.jsx)(F.SettingNote,{className:"wrap-break-word text-destructive",children:g.data.refused})]})})}function $({entry:a,set:c,onDone:d}){let[e,f]=(0,q.useState)(""),{data:g}=Q(a,c),h=g?P(c,!1,g):null,i=()=>{(0,H.revalidate)(r.queryKey.config),(0,H.revalidate)(r.queryKey.llmModel)},[j,k]=(0,G.useServerAction)(D.setConfigAction,{okMessage:`${a.label} key saved`,onOk:()=>{i(),d()}}),[l,m]=(0,G.useServerAction)(C,{okMessage:`${a.label} key removed`,onOk:()=>{i(),d()}});return(0,b.jsx)(F.SettingDialogContent,{title:a.label,description:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"font-mono",children:a.key}),a.hint&&(0,b.jsxs)(b.Fragment,{children:[" · ",a.hint]}),h&&(0,b.jsxs)(b.Fragment,{children:[" · ",(0,b.jsx)("span",{className:(0,I.cn)("font-mono",h.ink),children:h.text})]})]}),footer:(0,b.jsxs)(b.Fragment,{children:[c&&(0,b.jsx)(s.Button,{variant:"ghost",loading:m,onClick:()=>l(a.key),children:"Remove"}),(0,b.jsx)(s.Button,{variant:"ghost",onClick:d,children:"Cancel"}),(0,b.jsx)(s.Button,{loading:k,disabled:e.trim().length<8,onClick:()=>j(a.key,e),children:c?"Replace":"Save"})]}),children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(t.Input,{value:e,onChange:a=>f(a.target.value),onKeyDown:b=>{"Enter"===b.key&&e.trim().length>=8&&j(a.key,e)},placeholder:c?"New value — replaces the current key":a.key,spellCheck:!1,type:"password",autoFocus:!0}),g&&"refused"in g&&(0,b.jsx)(F.SettingNote,{className:"wrap-break-word text-destructive",children:g.refused})]})})}a.s(["ConfigGroups",0,L,"ConfigSetting",0,function(){return(0,b.jsx)(L,{section:"keys"})}],405593)}];
2
2
 
3
3
  //# sourceMappingURL=features_config_components_config-setting_tsx_0xfwqdg._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[26444,a=>{"use strict";var b=a.i(187924),c=a.i(752562),d=a.i(589027),e=a.i(141146),f=a.i(164831);let g={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};g.node;let h=(0,f.default)(g);var i=a.i(403512);let j={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};j.node;let k=(0,f.default)(j),l={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};l.node;let m=(0,f.default)(l);var n=a.i(951675),o=a.i(474215),p=a.i(572131),q=a.i(767561),r=a.i(340695),s=a.i(316474),t=a.i(205522),u=a.i(497895);let v=(0,p.memo)(({data:a,name:c,initialExpandDepth:d=2})=>{let e=(0,p.useMemo)(()=>"string"==typeof a?function(a){let b=a.trim();if(!(b.startsWith("{")&&b.endsWith("}"))&&!(b.startsWith("[")&&b.endsWith("]")))return{success:!1,data:a};try{return{success:!0,data:JSON.parse(a)}}catch{return{success:!1,data:a}}}(a).data:a,[a]);return(0,b.jsx)("div",{className:" text-sm transition-all duration-300",children:(0,b.jsx)(w,{data:e,name:c,depth:0,initialExpandDepth:d})})});v.displayName="JsonView";let w=(0,p.memo)(({data:a,name:c,depth:d=0,initialExpandDepth:e})=>{var f;let g=void 0===a?"undefined":Array.isArray(a)?"array":null===a?"null":typeof a,[h,i]=(0,p.useState)("string"!==g&&d<e),j={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(g){case"object":case"array":let k,l,m;return l=(k=(f="array"===g)?a:Object.entries(a)).length,m={open:f?"[":"{",close:f?"]":"}",collapsed:f?"[ ... ]":"{ ... }",empty:f?"[]":"{}"},0===l?(0,b.jsxs)("div",{className:"flex items-center",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:m.empty})]}):(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",onClick:()=>i(!h),children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),h?(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.open}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.collapsed}),(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[l," ",1===l?"item":"items"]})]})]}),h&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:f?k.map((a,c)=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(w,{data:a,name:`${c}`,depth:d+1,initialExpandDepth:e})},c)):k.map(([a,c])=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(w,{data:c,name:a,depth:d+1,initialExpandDepth:e})},a))}),(0,b.jsx)("div",{className:"text-muted-foreground",children:m.close})]})]});case"string":return a.length>100?(0,b.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),(0,b.jsx)("pre",{className:(0,u.cn)(j.string,"cursor-pointer group-hover:text-foreground"),onClick:()=>i(!h),title:h?"Click to collapse":"Click to expand",children:h?`"${a}"`:`"${a.slice(0,100)}..."`})]}):(0,b.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsxs)("pre",{className:j.string,children:['"',a,'"']})]});case"undefined":return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j.undefined,children:"undefined"})]});default:return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j[g]||j.default,children:null===a?"null":String(a)})]})}});w.displayName="JsonNode";var x=a.i(446181),y=a.i(280281),z=a.i(621958),A=a.i(546893),B=a.i(864037),C=a.i(405050);let D=(0,C.createServerReference)("7f0319a99086ee3cd1918985c144e87ea4dc20d07e",C.callServer,void 0,C.findSourceMapURL,"callToolAction"),E=(0,C.createServerReference)("7f5032afb7983c1d0f61fd3693eebdadead290f6b7",C.callServer,void 0,C.findSourceMapURL,"deleteServerAction"),F=(0,C.createServerReference)("7f46495bb3a4bf849eb1e2069dbb9063be852be5bd",C.callServer,void 0,C.findSourceMapURL,"refreshServerAction"),G=(0,C.createServerReference)("7f860ba40e6a0fac88f2c4e6b892e39b044b4bcba0",C.callServer,void 0,C.findSourceMapURL,"registerServerAction");var H=a.i(156757),I=a.i(199169);let J=H.z.object({url:H.z.url(),headers:H.z.record(H.z.string(),H.z.string()).optional(),oauthClient:H.z.object({clientId:H.z.string().min(1),clientSecret:H.z.string().optional()}).optional()}),K=H.z.object({command:H.z.string().min(1),args:H.z.array(H.z.string()).optional(),env:H.z.record(H.z.string(),H.z.string()).optional()}),L=H.z.union([J,K]),M=H.z.object({name:H.z.string(),description:H.z.string().optional(),inputSchema:H.z.looseObject({}).optional(),outputSchema:H.z.looseObject({}).optional()});function N(a){return"url"in a}H.z.object({clientInformation:H.z.looseObject({}).optional(),tokens:H.z.looseObject({}).optional(),authorizationServer:H.z.looseObject({}).optional(),codeVerifier:H.z.string().optional(),state:H.z.string().optional()});let O=H.z.object({name:H.z.string().min(1).max(40),config:L,toolCount:H.z.number().int(),lastError:H.z.string().nullish()}),P=M.extend({id:H.z.number().int(),description:H.z.string().nullish()});O.omit({toolCount:!0}).extend({tools:P.array().default([]),toolsSyncedAt:I.DateLikeSchema});let Q=H.z.object({name:H.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:L}),R=H.z.union([H.z.object({mcpServers:H.z.record(H.z.string(),L)}),H.z.record(H.z.string(),L)]),S=[{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"figma",icon:"figma.com",description:"Design files and components",config:{url:"https://mcp.figma.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}},{name:"playwright",icon:"playwright.dev",description:"Drive a real browser",config:{command:"npx",args:["@playwright/mcp@latest"]}},{name:"chrome-devtools",icon:"developer.chrome.com",description:"Inspect and debug Chrome",config:{command:"npx",args:["chrome-devtools-mcp@latest"]}}];var T=a.i(619477),U=a.i(30681),V=a.i(313237),W=a.i(759497);function X({name:a,onDone:c}){let{data:d,isLoading:e}=(0,W.useServerRoute)(q.queryKey.mcpServer(a)),[f,g]=(0,V.useServerAction)(F,{...ai,onOk:b=>{ai.onOk(b),(0,W.revalidate)(q.queryKey.mcpServer(a))}}),[h,i]=(0,V.useServerAction)(E,{okMessage:"Server deleted",onOk:()=>{c(),(0,W.revalidate)(q.queryKey.mcp)}}),j=async()=>{await x.notify.confirm({title:`Delete ${a}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&h(a)};if(e)return(0,b.jsx)(T.SettingSkeleton,{rows:4});if(!d)return null;let l=d.tools.length,m=N(d.config)?"HTTP":"STDIO";return(0,b.jsxs)(T.SettingDialogContent,{title:d.name,description:(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:m}),(0,b.jsx)("span",{className:"truncate font-mono",children:ak(d.config)})]}),footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(r.Button,{variant:"ghost",loading:i,onClick:j,children:[(0,b.jsx)(n.Trash2,{}),"Delete"]}),(0,b.jsxs)(r.Button,{variant:"outline",loading:g,onClick:()=>f(d.name),children:[(0,b.jsx)(k,{}),"Reconnect"]})]}),children:[d.lastError&&(0,b.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:d.lastError}),(0,b.jsxs)("p",{className:"text-right font-mono text-xs text-muted-foreground",children:[l," ",1===l?"tool":"tools"]}),d.tools.map(a=>(0,b.jsx)($,{tool:a,serverName:d.name},a.name))]})}function Y({server:a}){let d=a.toolCount,f=a.lastError?"error":d>0?"connected":"idle";return(0,b.jsxs)("button",{type:"button",onClick:()=>{x.notify.component({className:"sm:max-w-3xl",renderer:({close:c})=>(0,b.jsx)(X,{name:a.name,onDone:c})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,b.jsx)(Z,{server:a})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a.name}),"connected"===f&&(0,b.jsx)(c.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,b.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===f?(0,b.jsx)("span",{className:"text-destructive",children:a.lastError}):(0,b.jsxs)(b.Fragment,{children:[d>0?`${d} ${1===d?"tool":"tools"}`:"No tools yet",(0,b.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",ak(a.config)]})]})})]}),(0,b.jsx)(e.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:a}){let c,d=(c=S.find(b=>N(b.config)?N(a.config)&&b.config.url.replace(/\/+$/,"")===a.config.url.replace(/\/+$/,""):!N(a.config)&&b.config.command===a.config.command&&(b.config.args??[]).join(" ")===(a.config.args??[]).join(" "))??S.find(b=>b.name===a.name),c?.icon);return d?(0,b.jsx)("img",{src:(0,u.faviconUrl)(d),alt:"",className:"size-5"}):(0,b.jsx)(m,{className:"size-4"})}function $({tool:a,serverName:c}){let[f,g]=(0,p.useState)(!1),[h,i]=(0,p.useState)(!1),[j,k]=(0,p.useState)(!1),l=[["inputSchema",a.inputSchema],["outputSchema",a.outputSchema]].filter(([,a])=>a);return(0,b.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,b.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,b.jsx)("span",{className:"block truncate font-mono text-sm",children:a.name}),a.description?(0,b.jsx)("p",{className:(0,u.cn)("text-xs text-muted-foreground",!j&&"line-clamp-2",a.description.length>140&&"cursor-pointer"),onClick:()=>k(!j),children:a.description}):null]}),(0,b.jsxs)("div",{className:"mt-2 flex justify-end gap-1",children:[l.length>0&&(0,b.jsxs)(r.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>g(!f),children:[f?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Schema"]}),(0,b.jsxs)(r.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>i(!h),children:[h?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Test"]})]}),f?(0,b.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:l.map(([a,c])=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===a?"in":"out"}),(0,b.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function a(b,c=0){if(!b||"object"!=typeof b)return"unknown";let d=" ".repeat(c+1),e=" ".repeat(c);if(Array.isArray(b.enum))return b.enum.map(a=>JSON.stringify(a)).join(" | ");let f=b.anyOf??b.oneOf;if(Array.isArray(f))return f.map(b=>a(b,c)).join(" | ");if("array"===b.type){let d=a(b.items,c);return/[|{]/.test(d)?`(${d})[]`:`${d}[]`}if("object"===b.type||b.properties){let f=b.properties;if(!f||0===Object.keys(f).length)return"{}";let g=b.required??[],h=Object.entries(f).map(([b,e])=>{let f=g.includes(b)?"":"?",h=e?.description,i="string"==typeof h&&h.length<=60?` // ${h}`:"";return`${d}${b}${f}: ${a(e,c+1)}${i}`});return`{
1
+ module.exports=[26444,a=>{"use strict";var b=a.i(187924),c=a.i(752562),d=a.i(589027),e=a.i(141146),f=a.i(164831);let g={name:"play",size:24,node:[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]};g.node;let h=(0,f.default)(g);var i=a.i(403512);let j={name:"refresh-cw",size:24,node:[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]};j.node;let k=(0,f.default)(j),l={name:"server",size:24,node:[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]};l.node;let m=(0,f.default)(l);var n=a.i(951675),o=a.i(474215),p=a.i(572131),q=a.i(767561),r=a.i(340695),s=a.i(316474),t=a.i(205522),u=a.i(497895);let v=(0,p.memo)(({data:a,name:c,initialExpandDepth:d=2})=>{let e=(0,p.useMemo)(()=>"string"==typeof a?function(a){let b=a.trim();if(!(b.startsWith("{")&&b.endsWith("}"))&&!(b.startsWith("[")&&b.endsWith("]")))return{success:!1,data:a};try{return{success:!0,data:JSON.parse(a)}}catch{return{success:!1,data:a}}}(a).data:a,[a]);return(0,b.jsx)("div",{className:" text-sm transition-all duration-300",children:(0,b.jsx)(w,{data:e,name:c,depth:0,initialExpandDepth:d})})});v.displayName="JsonView";let w=(0,p.memo)(({data:a,name:c,depth:d=0,initialExpandDepth:e})=>{var f;let g=void 0===a?"undefined":Array.isArray(a)?"array":null===a?"null":typeof a,[h,i]=(0,p.useState)("string"!==g&&d<e),j={number:"text-blue-500",boolean:"text-amber-500",null:"text-purple-500",undefined:"text-gray-500",string:"text-foreground break-all whitespace-pre-wrap",default:"text-muted-foreground"};switch(g){case"object":case"array":let k,l,m;return l=(k=(f="array"===g)?a:Object.entries(a)).length,m={open:f?"[":"{",close:f?"]":"}",collapsed:f?"[ ... ]":"{ ... }",empty:f?"[]":"{}"},0===l?(0,b.jsxs)("div",{className:"flex items-center",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:"text-muted-foreground",children:m.empty})]}):(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded cursor-pointer group hover:bg-input/30",onClick:()=>i(!h),children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),h?(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.open}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{className:"text-muted-foreground group-hover:text-foreground",children:m.collapsed}),(0,b.jsxs)("span",{className:"ml-1 text-muted-foreground group-hover:text-foreground",children:[l," ",1===l?"item":"items"]})]})]}),h&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"pl-2 ml-4 border-l border-border",children:f?k.map((a,c)=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(w,{data:a,name:`${c}`,depth:d+1,initialExpandDepth:e})},c)):k.map(([a,c])=>(0,b.jsx)("div",{className:"my-1",children:(0,b.jsx)(w,{data:c,name:a,depth:d+1,initialExpandDepth:e})},a))}),(0,b.jsx)("div",{className:"text-muted-foreground",children:m.close})]})]});case"string":return a.length>100?(0,b.jsxs)("div",{className:"flex mr-1 rounded group hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground hover:text-foreground",children:[c,":"]}),(0,b.jsx)("pre",{className:(0,u.cn)(j.string,"cursor-pointer group-hover:text-foreground"),onClick:()=>i(!h),title:h?"Click to collapse":"Click to expand",children:h?`"${a}"`:`"${a.slice(0,100)}..."`})]}):(0,b.jsxs)("div",{className:"flex mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsxs)("pre",{className:j.string,children:['"',a,'"']})]});case"undefined":return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j.undefined,children:"undefined"})]});default:return(0,b.jsxs)("div",{className:"flex items-center mr-1 rounded hover:bg-input/30",children:[c&&(0,b.jsxs)("span",{className:"mr-1 text-muted-foreground",children:[c,":"]}),(0,b.jsx)("span",{className:j[g]||j.default,children:null===a?"null":String(a)})]})}});w.displayName="JsonNode";var x=a.i(446181),y=a.i(280281),z=a.i(621958),A=a.i(546893),B=a.i(864037),C=a.i(405050);let D=(0,C.createServerReference)("7f5794ac71620e44519ac5e4528c812ec673d30e36",C.callServer,void 0,C.findSourceMapURL,"callToolAction"),E=(0,C.createServerReference)("7f8b31e414a34ee8f44144711314836c2ef544e4d6",C.callServer,void 0,C.findSourceMapURL,"deleteServerAction"),F=(0,C.createServerReference)("7f01ea36e10e34b1bdd93e76c79733f6d9944ba5ab",C.callServer,void 0,C.findSourceMapURL,"refreshServerAction"),G=(0,C.createServerReference)("7f0f31e6c8be9bc825768389fc145a1b3446503296",C.callServer,void 0,C.findSourceMapURL,"registerServerAction");var H=a.i(156757),I=a.i(199169);let J=H.z.object({url:H.z.url(),headers:H.z.record(H.z.string(),H.z.string()).optional(),oauthClient:H.z.object({clientId:H.z.string().min(1),clientSecret:H.z.string().optional()}).optional()}),K=H.z.object({command:H.z.string().min(1),args:H.z.array(H.z.string()).optional(),env:H.z.record(H.z.string(),H.z.string()).optional()}),L=H.z.union([J,K]),M=H.z.object({name:H.z.string(),description:H.z.string().optional(),inputSchema:H.z.looseObject({}).optional(),outputSchema:H.z.looseObject({}).optional()});function N(a){return"url"in a}H.z.object({clientInformation:H.z.looseObject({}).optional(),tokens:H.z.looseObject({}).optional(),authorizationServer:H.z.looseObject({}).optional(),codeVerifier:H.z.string().optional(),state:H.z.string().optional()});let O=H.z.object({name:H.z.string().min(1).max(40),config:L,toolCount:H.z.number().int(),lastError:H.z.string().nullish()}),P=M.extend({id:H.z.number().int(),description:H.z.string().nullish()});O.omit({toolCount:!0}).extend({tools:P.array().default([]),toolsSyncedAt:I.DateLikeSchema});let Q=H.z.object({name:H.z.string().min(1,"Name is required").max(40).regex(/^[a-zA-Z0-9_-]+$/,"Only letters, numbers, - and _ are allowed"),config:L}),R=H.z.union([H.z.object({mcpServers:H.z.record(H.z.string(),L)}),H.z.record(H.z.string(),L)]),S=[{name:"notion",icon:"notion.so",description:"Pages, databases, and search",config:{url:"https://mcp.notion.com/mcp"}},{name:"github",icon:"github.com",description:"Repos, issues, PRs — paste a personal access token",config:{url:"https://api.githubcopilot.com/mcp/",headers:{Authorization:"Bearer <your-github-pat>"}}},{name:"linear",icon:"linear.app",description:"Issues, projects, and cycles",config:{url:"https://mcp.linear.app/mcp"}},{name:"slack",icon:"slack.com",description:"Channels, messages, and search",config:{url:"https://mcp.slack.com/mcp"}},{name:"atlassian",icon:"atlassian.com",description:"Jira and Confluence",config:{url:"https://mcp.atlassian.com/v1/mcp"}},{name:"asana",icon:"asana.com",description:"Tasks, projects, and portfolios",config:{url:"https://mcp.asana.com/mcp"}},{name:"monday",icon:"monday.com",description:"Boards, items, and updates",config:{url:"https://mcp.monday.com/mcp"}},{name:"clickup",icon:"clickup.com",description:"Tasks, docs, and spaces",config:{url:"https://mcp.clickup.com/mcp"}},{name:"airtable",icon:"airtable.com",description:"Bases, tables, and records",config:{url:"https://mcp.airtable.com/mcp"}},{name:"box",icon:"box.com",description:"Files, folders, and content search",config:{url:"https://mcp.box.com/mcp"}},{name:"figma",icon:"figma.com",description:"Design files and components",config:{url:"https://mcp.figma.com/mcp"}},{name:"canva",icon:"canva.com",description:"Create and manage designs",config:{url:"https://mcp.canva.com/mcp"}},{name:"sanity",icon:"sanity.io",description:"Structured content and datasets",config:{url:"https://mcp.sanity.io/mcp"}},{name:"webflow",icon:"webflow.com",description:"Sites, pages, and CMS collections",config:{url:"https://mcp.webflow.com/mcp"}},{name:"wix",icon:"wix.com",description:"Sites, stores, and bookings",config:{url:"https://mcp.wix.com/mcp"}},{name:"hubspot",icon:"hubspot.com",description:"Contacts, deals, and companies",config:{url:"https://app.hubspot.com/mcp/v1/http"}},{name:"attio",icon:"attio.com",description:"CRM records and lists",config:{url:"https://mcp.attio.com/mcp"}},{name:"intercom",icon:"intercom.com",description:"Conversations and support tickets",config:{url:"https://mcp.intercom.com/mcp"}},{name:"fireflies",icon:"fireflies.ai",description:"Meeting transcripts and summaries",config:{url:"https://mcp.fireflies.ai/mcp"}},{name:"stripe",icon:"stripe.com",description:"Payments, invoices, and customers",config:{url:"https://mcp.stripe.com"}},{name:"paypal",icon:"paypal.com",description:"Payments and orders",config:{url:"https://mcp.paypal.com/mcp"}},{name:"square",icon:"squareup.com",description:"Payments, catalog, and orders",config:{url:"https://mcp.squareup.com/mcp"}},{name:"ramp",icon:"ramp.com",description:"Spend, cards, and transactions",config:{url:"https://mcp.ramp.com/mcp"}},{name:"vercel",icon:"vercel.com",description:"Deployments and projects",config:{url:"https://mcp.vercel.com"}},{name:"netlify",icon:"netlify.com",description:"Sites, builds, and deploys",config:{url:"https://mcp.netlify.com/mcp"}},{name:"cloudflare",icon:"cloudflare.com",description:"Workers bindings — D1, R2, KV",config:{url:"https://bindings.mcp.cloudflare.com/mcp"}},{name:"supabase",icon:"supabase.com",description:"Projects, tables, and SQL",config:{url:"https://mcp.supabase.com/mcp"}},{name:"neon",icon:"neon.tech",description:"Postgres branches and queries",config:{url:"https://mcp.neon.tech/mcp"}},{name:"prisma",icon:"prisma.io",description:"Postgres databases and schema",config:{url:"https://mcp.prisma.io/mcp"}},{name:"sentry",icon:"sentry.io",description:"Errors and performance issues",config:{url:"https://mcp.sentry.dev/mcp"}},{name:"grafana",icon:"grafana.com",description:"Dashboards, metrics, and alerts",config:{url:"https://mcp.grafana.com/mcp"}},{name:"semgrep",icon:"semgrep.dev",description:"Scan code for security findings",config:{url:"https://mcp.semgrep.ai/mcp"}},{name:"postman",icon:"postman.com",description:"Collections, environments, and requests",config:{url:"https://mcp.postman.com/mcp"}},{name:"resend",icon:"resend.com",description:"Send email and manage audiences",config:{url:"https://mcp.resend.com/mcp"}},{name:"hugging-face",icon:"huggingface.co",description:"Models, datasets, and Spaces",config:{url:"https://huggingface.co/mcp"}},{name:"apify",icon:"apify.com",description:"Run scrapers and automation actors",config:{url:"https://mcp.apify.com"}},{name:"exa",icon:"exa.ai",description:"Web search for agents",config:{url:"https://mcp.exa.ai/mcp"}},{name:"kagi",icon:"kagi.com",description:"Search, summarize, and answer",config:{url:"https://mcp.kagi.com/mcp"}},{name:"context7",icon:"context7.com",description:"Up-to-date library docs",config:{url:"https://mcp.context7.com/mcp"}},{name:"deepwiki",icon:"deepwiki.com",description:"Ask questions about any GitHub repo",config:{url:"https://mcp.deepwiki.com/mcp"}},{name:"microsoft-learn",icon:"learn.microsoft.com",description:"Microsoft and Azure docs — no account",config:{url:"https://learn.microsoft.com/api/mcp"}},{name:"aws-knowledge",icon:"aws.amazon.com",description:"AWS docs and API references — no account",config:{url:"https://knowledge-mcp.global.api.aws"}},{name:"cloudflare-docs",icon:"developers.cloudflare.com",description:"Cloudflare docs — no account",config:{url:"https://docs.mcp.cloudflare.com/mcp"}},{name:"stack-overflow",icon:"stackoverflow.com",description:"Questions, answers, and teams",config:{url:"https://mcp.stackoverflow.com"}},{name:"playwright",icon:"playwright.dev",description:"Drive a real browser",config:{command:"npx",args:["@playwright/mcp@latest"]}},{name:"chrome-devtools",icon:"developer.chrome.com",description:"Inspect and debug Chrome",config:{command:"npx",args:["chrome-devtools-mcp@latest"]}}];var T=a.i(619477),U=a.i(30681),V=a.i(313237),W=a.i(759497);function X({name:a,onDone:c}){let{data:d,isLoading:e}=(0,W.useServerRoute)(q.queryKey.mcpServer(a)),[f,g]=(0,V.useServerAction)(F,{...ai,onOk:b=>{ai.onOk(b),(0,W.revalidate)(q.queryKey.mcpServer(a))}}),[h,i]=(0,V.useServerAction)(E,{okMessage:"Server deleted",onOk:()=>{c(),(0,W.revalidate)(q.queryKey.mcp)}}),j=async()=>{await x.notify.confirm({title:`Delete ${a}?`,description:"Its connection and saved authorization go with it.",okText:"Delete",destructive:!0})&&h(a)};if(e)return(0,b.jsx)(T.SettingSkeleton,{rows:4});if(!d)return null;let l=d.tools.length,m=N(d.config)?"HTTP":"STDIO";return(0,b.jsxs)(T.SettingDialogContent,{title:d.name,description:(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[10px]",children:m}),(0,b.jsx)("span",{className:"truncate font-mono",children:ak(d.config)})]}),footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(r.Button,{variant:"ghost",loading:i,onClick:j,children:[(0,b.jsx)(n.Trash2,{}),"Delete"]}),(0,b.jsxs)(r.Button,{variant:"outline",loading:g,onClick:()=>f(d.name),children:[(0,b.jsx)(k,{}),"Reconnect"]})]}),children:[d.lastError&&(0,b.jsx)("p",{className:"rounded-lg bg-destructive/10 px-3 py-2 font-mono text-xs text-destructive",children:d.lastError}),(0,b.jsxs)("p",{className:"text-right font-mono text-xs text-muted-foreground",children:[l," ",1===l?"tool":"tools"]}),d.tools.map(a=>(0,b.jsx)($,{tool:a,serverName:d.name},a.name))]})}function Y({server:a}){let d=a.toolCount,f=a.lastError?"error":d>0?"connected":"idle";return(0,b.jsxs)("button",{type:"button",onClick:()=>{x.notify.component({className:"sm:max-w-3xl",renderer:({close:c})=>(0,b.jsx)(X,{name:a.name,onDone:c})})},className:"group flex w-full items-center gap-3 p-4 text-left outline-none transition-colors hover:bg-muted/50 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset",children:[(0,b.jsx)("span",{className:"grid size-10 shrink-0 place-items-center rounded-lg bg-muted text-muted-foreground",children:(0,b.jsx)(Z,{server:a})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,b.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:a.name}),"connected"===f&&(0,b.jsx)(c.Check,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,b.jsx)("span",{className:"block truncate text-xs text-muted-foreground",children:"error"===f?(0,b.jsx)("span",{className:"text-destructive",children:a.lastError}):(0,b.jsxs)(b.Fragment,{children:[d>0?`${d} ${1===d?"tool":"tools"}`:"No tools yet",(0,b.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/70",children:[" · ",ak(a.config)]})]})})]}),(0,b.jsx)(e.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}function Z({server:a}){let c,d=(c=S.find(b=>N(b.config)?N(a.config)&&b.config.url.replace(/\/+$/,"")===a.config.url.replace(/\/+$/,""):!N(a.config)&&b.config.command===a.config.command&&(b.config.args??[]).join(" ")===(a.config.args??[]).join(" "))??S.find(b=>b.name===a.name),c?.icon);return d?(0,b.jsx)("img",{src:(0,u.faviconUrl)(d),alt:"",className:"size-5"}):(0,b.jsx)(m,{className:"size-4"})}function $({tool:a,serverName:c}){let[f,g]=(0,p.useState)(!1),[h,i]=(0,p.useState)(!1),[j,k]=(0,p.useState)(!1),l=[["inputSchema",a.inputSchema],["outputSchema",a.outputSchema]].filter(([,a])=>a);return(0,b.jsxs)("div",{className:"rounded-xl border border-border/60 bg-background p-4",children:[(0,b.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,b.jsx)("span",{className:"block truncate font-mono text-sm",children:a.name}),a.description?(0,b.jsx)("p",{className:(0,u.cn)("text-xs text-muted-foreground",!j&&"line-clamp-2",a.description.length>140&&"cursor-pointer"),onClick:()=>k(!j),children:a.description}):null]}),(0,b.jsxs)("div",{className:"mt-2 flex justify-end gap-1",children:[l.length>0&&(0,b.jsxs)(r.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>g(!f),children:[f?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Schema"]}),(0,b.jsxs)(r.Button,{size:"xs",variant:"ghost",className:"font-mono",onClick:()=>i(!h),children:[h?(0,b.jsx)(d.ChevronDown,{}):(0,b.jsx)(e.ChevronRight,{}),"Test"]})]}),f?(0,b.jsx)("div",{className:"mt-2 space-y-3 overflow-x-auto rounded-lg border border-input p-3",children:l.map(([a,c])=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"block font-mono text-xs text-muted-foreground",children:"inputSchema"===a?"in":"out"}),(0,b.jsx)("pre",{className:"font-mono text-xs leading-relaxed whitespace-pre",children:function a(b,c=0){if(!b||"object"!=typeof b)return"unknown";let d=" ".repeat(c+1),e=" ".repeat(c);if(Array.isArray(b.enum))return b.enum.map(a=>JSON.stringify(a)).join(" | ");let f=b.anyOf??b.oneOf;if(Array.isArray(f))return f.map(b=>a(b,c)).join(" | ");if("array"===b.type){let d=a(b.items,c);return/[|{]/.test(d)?`(${d})[]`:`${d}[]`}if("object"===b.type||b.properties){let f=b.properties;if(!f||0===Object.keys(f).length)return"{}";let g=b.required??[],h=Object.entries(f).map(([b,e])=>{let f=g.includes(b)?"":"?",h=e?.description,i="string"==typeof h&&h.length<=60?` // ${h}`:"";return`${d}${b}${f}: ${a(e,c+1)}${i}`});return`{
2
2
  ${h.join("\n")}
3
3
  ${e}}`}return Array.isArray(b.type)?b.type.join(" | "):"string"==typeof b.type?b.type:"unknown"}(c)})]},a))}):null,h?(0,b.jsx)(_,{tool:a,serverName:c}):null]})}function _({tool:a,serverName:c}){let[d,e]=(0,p.useState)(()=>(function(a){let b=a.inputSchema?.properties;if(!b||"object"!=typeof b)return"{}";let c={};for(let[a,d]of Object.entries(b))c[a]=d?.type==="number"||d?.type==="integer"?0:d?.type!=="boolean"&&(d?.type==="array"?[]:d?.type==="object"?{}:"");return JSON.stringify(c,null,2)})(a)),[f,g]=(0,p.useState)(""),[i,j,k,l,m]=(0,V.useServerAction)(D,{errorMessage:!1});return(0,b.jsxs)("div",{className:"mt-2 space-y-2 rounded-lg border border-input p-3",children:[(0,b.jsx)(A.Textarea,{value:d,onChange:a=>e(a.target.value),spellCheck:!1,className:"min-h-24 resize-none font-mono text-xs"}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"font-mono text-xs text-destructive",children:f||l}),(0,b.jsxs)(r.Button,{size:"sm",loading:j,onClick:()=>{let b;try{b=d.trim()?JSON.parse(d):void 0}catch{g("Not valid JSON");return}g(""),m(),i(c,a.name,b)},children:[!j&&(0,b.jsx)(h,{}),"Run"]})]}),void 0!==k&&(0,b.jsx)("div",{className:"overflow-x-auto rounded-lg bg-muted/40 p-3",children:(0,b.jsx)(v,{data:k,initialExpandDepth:3})})]})}function aa(a){return x.notify.component({className:"sm:max-w-lg",renderer:({close:c})=>(0,b.jsx)(ab,{initial:a,onDone:c})})}function ab({initial:a,onDone:c}){let d=a&&N(a.config)?a.config:void 0,e=a&&!N(a.config)?a.config:void 0,[f,g]=(0,U.useObjectState)({mode:e?"stdio":"http",name:a?.name??"",url:d?.url??"",headers:ae(d?.headers),clientId:d?.oauthClient?.clientId??"",clientSecret:d?.oauthClient?.clientSecret??"",command:e?.command??"",args:(e?.args??[]).join(" "),env:ae(e?.env),raw:""}),{mode:h,name:i,url:j,headers:k,clientId:l,clientSecret:m,command:n,args:o,env:q,raw:u}=f,[v,w]=(0,V.useServerAction)(G,{...ai,onOk:a=>{ai.onOk(a),"error"!==a.status&&c()}}),x=(0,p.useMemo)(()=>{var a,b,c,d,e,f,g;let i,p;return"json"===h?function(a){let b,c=a.trim();if(!c)return{value:null,error:""};try{b=JSON.parse(c)}catch{return{value:null,error:"Not valid JSON"}}let d=L.safeParse(b);if(d.success)return{value:{name:null,config:d.data},error:""};let e=R.safeParse(b);if(!e.success)return{value:null,error:"Needs a url or a command"};let f=Object.entries("mcpServers"in e.data?e.data.mcpServers:e.data)[0];return f?{value:{name:f[0],config:f[1]},error:""}:{value:null,error:"No server in there"}}(u):"http"===h?(a=j,b=k,c=l,d=m,(i=J.safeParse({url:a.trim(),headers:af(b),oauthClient:c.trim()?{clientId:c.trim(),clientSecret:d.trim()}:void 0})).success?{value:{name:null,config:i.data},error:""}:{value:null,error:a.trim()?"Needs a valid url":""}):(e=n,f=o,g=q,(p=K.safeParse({command:e.trim(),args:f.split(/\s+/).filter(Boolean),env:af(g)})).success?{value:{name:null,config:p.data},error:""}:{value:null,error:e.trim()?"Needs a command":""})},[h,u,j,k,l,m,n,o,q]),B="json"===h?u:JSON.stringify([h,j,k,l,m,n,o,q]),[C,D]=(0,p.useState)(B);(0,p.useEffect)(()=>{let a=setTimeout(()=>D(B),700);return()=>clearTimeout(a)},[B]);let E=C===B?x.error:"",F=i||x.value?.name||"",H=Q.safeParse({name:F,config:x.value?.config});function I(a){let b=x.value?.config;return b?"json"===a?g({mode:a,raw:JSON.stringify(b,null,2)}):"http"===a&&N(b)?g({mode:a,url:b.url,headers:ae(b.headers),clientId:b.oauthClient?.clientId??"",clientSecret:b.oauthClient?.clientSecret??""}):"stdio"!==a||N(b)?void g({mode:a}):g({mode:a,command:b.command,args:(b.args??[]).join(" "),env:ae(b.env)}):g({mode:a})}let M=(0,b.jsxs)("span",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:["JSON",(0,b.jsx)(y.Switch,{size:"sm",checked:"json"===h,onCheckedChange:a=>{let b;return a?I("json"):void I((b=x.value?.config)&&!N(b)?"stdio":"http")}})]});return(0,b.jsx)(T.SettingDialogContent,{title:"Add MCP server",description:"Its tools become available to Thursday and every sub-agent.",footer:(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(r.Button,{variant:"ghost",onClick:c,children:"Cancel"}),(0,b.jsx)(r.Button,{disabled:!H.success,loading:w,onClick:()=>{H.success&&!w&&v(H.data)},children:"Connect"})]}),children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)(s.Field,{children:[(0,b.jsx)(s.FieldLabel,{children:"Name"}),(0,b.jsx)(t.Input,{value:F,onChange:a=>g({name:a.target.value}),placeholder:"notion",spellCheck:!1})]}),"json"===h?(0,b.jsxs)(s.Field,{children:[(0,b.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,b.jsx)(s.FieldLabel,{children:"JSON"}),M]}),(0,b.jsx)(A.Textarea,{value:u,onChange:a=>g({raw:a.target.value}),spellCheck:!1,placeholder:ag,className:"min-h-64 resize-none font-mono text-xs"})]}):(0,b.jsxs)(z.Tabs,{value:h,onValueChange:a=>I(a),className:"gap-6",children:[(0,b.jsxs)(s.Field,{children:[(0,b.jsxs)("div",{className:"flex min-h-6 items-center justify-between gap-2",children:[(0,b.jsx)(s.FieldLabel,{children:"Transport"}),M]}),(0,b.jsxs)(z.TabsList,{className:"w-full",children:[(0,b.jsx)(z.TabsTrigger,{value:"http",children:"HTTP"}),(0,b.jsx)(z.TabsTrigger,{value:"stdio",children:"STDIO"})]})]}),(0,b.jsxs)(z.TabsContent,{value:"http",className:"space-y-6",children:[(0,b.jsxs)(s.Field,{children:[(0,b.jsx)(s.FieldLabel,{children:"URL"}),(0,b.jsx)(t.Input,{value:j,onChange:a=>g({url:a.target.value}),placeholder:"https://mcp.notion.com/mcp",spellCheck:!1,className:"font-mono text-xs"})]}),(0,b.jsx)(ac,{label:"Headers",pairs:k,onChange:a=>g({headers:a}),keyPlaceholder:"Authorization",valuePlaceholder:"Bearer sk-..."}),(0,b.jsxs)(s.Field,{children:[(0,b.jsx)(s.FieldLabel,{children:"OAuth client"}),(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(t.Input,{value:l,onChange:a=>g({clientId:a.target.value}),placeholder:"Client ID",spellCheck:!1,className:"font-mono text-xs"}),(0,b.jsx)(t.Input,{value:m,onChange:a=>g({clientSecret:a.target.value}),placeholder:"Client secret",spellCheck:!1,type:"password",className:"font-mono text-xs"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:"Only for servers that refuse to register clients on their own, like Figma. Leave empty and one is created during sign-in."})]})]}),(0,b.jsxs)(z.TabsContent,{value:"stdio",className:"space-y-6",children:[(0,b.jsxs)(s.Field,{children:[(0,b.jsx)(s.FieldLabel,{children:"Command"}),(0,b.jsx)(t.Input,{value:n,onChange:a=>g({command:a.target.value}),placeholder:"npx",spellCheck:!1,className:"font-mono text-xs"})]}),(0,b.jsxs)(s.Field,{children:[(0,b.jsx)(s.FieldLabel,{children:"Args"}),(0,b.jsx)(t.Input,{value:o,onChange:a=>g({args:a.target.value}),placeholder:"-y @notionhq/notion-mcp-server",spellCheck:!1,className:"font-mono text-xs"})]}),(0,b.jsx)(ac,{label:"Env",pairs:q,onChange:a=>g({env:a}),keyPlaceholder:"NOTION_TOKEN",valuePlaceholder:"ntn_..."})]})]}),E&&(0,b.jsx)("p",{className:"font-mono text-xs text-destructive",children:E})]})})}function ac({label:a,pairs:c,onChange:d,keyPlaceholder:e,valuePlaceholder:f}){let g=(a,b)=>d(c.map(c=>c.id===a?{...c,...b}:c));return(0,b.jsxs)(s.Field,{children:[(0,b.jsx)(s.FieldLabel,{children:a}),(0,b.jsxs)("div",{className:"space-y-2",children:[c.map(a=>(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)(t.Input,{value:a.key,onChange:b=>g(a.id,{key:b.target.value}),placeholder:e,spellCheck:!1,className:"font-mono text-xs"}),(0,b.jsx)(t.Input,{value:a.value,onChange:b=>g(a.id,{value:b.target.value}),placeholder:f,spellCheck:!1,className:"font-mono text-xs"}),(0,b.jsx)(r.Button,{variant:"ghost",size:"icon",onClick:()=>d(c.filter(b=>b.id!==a.id)),children:(0,b.jsx)(o.X,{})})]},a.id)),(0,b.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>d([...c,ad()]),children:[(0,b.jsx)(i.Plus,{}),"Add"]})]})]})}let ad=(a="",b="")=>({id:crypto.randomUUID(),key:a,value:b}),ae=a=>Object.entries(a??{}).map(([a,b])=>ad(a,b)),af=a=>{let b=a.filter(a=>a.key.trim());if(b.length)return Object.fromEntries(b.map(a=>[a.key.trim(),a.value]))},ag=`/** STDIO Example */
4
4
  {
@@ -0,0 +1,3 @@
1
+ module.exports=[199169,256711,a=>{"use strict";var b=a.i(244513),c=a.i(852587),d=a.i(23464),e=a.i(57270),f=a.i(959296),g=a.i(774016);function h(a,b){let c=(0,g.toDate)(a,b?.in);return c.setHours(0,0,0,0),c}function i(a,b){let d=(0,c.getDefaultOptions)(),e=b?.weekStartsOn??b?.locale?.options?.weekStartsOn??d.weekStartsOn??d.locale?.options?.weekStartsOn??0,f=(0,g.toDate)(a,b?.in),h=f.getDay();return f.setDate(f.getDate()-(7*(h<e)+h-e)),f.setHours(0,0,0,0),f}function j(a,b){return i(a,{...b,weekStartsOn:1})}var k=a.i(42724);function l(a,b){let c=(0,g.toDate)(a,b?.in),d=c.getFullYear(),e=(0,k.constructFrom)(c,0);e.setFullYear(d+1,0,4),e.setHours(0,0,0,0);let f=j(e),h=(0,k.constructFrom)(c,0);h.setFullYear(d,0,4),h.setHours(0,0,0,0);let i=j(h);return c.getTime()>=f.getTime()?d+1:c.getTime()>=i.getTime()?d:d-1}function m(a,b){let d=(0,g.toDate)(a,b?.in),e=d.getFullYear(),f=(0,c.getDefaultOptions)(),h=b?.firstWeekContainsDate??b?.locale?.options?.firstWeekContainsDate??f.firstWeekContainsDate??f.locale?.options?.firstWeekContainsDate??1,j=(0,k.constructFrom)(b?.in||a,0);j.setFullYear(e+1,0,h),j.setHours(0,0,0,0);let l=i(j,b),m=(0,k.constructFrom)(b?.in||a,0);m.setFullYear(e,0,h),m.setHours(0,0,0,0);let n=i(m,b);return+d>=+l?e+1:+d>=+n?e:e-1}function n(a,b){let c=Math.abs(a).toString().padStart(b,"0");return(a<0?"-":"")+c}let o={y(a,b){let c=a.getFullYear(),d=c>0?c:1-c;return n("yy"===b?d%100:d,b.length)},M(a,b){let c=a.getMonth();return"M"===b?String(c+1):n(c+1,2)},d:(a,b)=>n(a.getDate(),b.length),a(a,b){let c=a.getHours()/12>=1?"pm":"am";switch(b){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];default:return"am"===c?"a.m.":"p.m."}},h:(a,b)=>n(a.getHours()%12||12,b.length),H:(a,b)=>n(a.getHours(),b.length),m:(a,b)=>n(a.getMinutes(),b.length),s:(a,b)=>n(a.getSeconds(),b.length),S(a,b){let c=b.length;return n(Math.trunc(a.getMilliseconds()*Math.pow(10,c-3)),b.length)}},p={G:function(a,b,c){let d=+(a.getFullYear()>0);switch(b){case"G":case"GG":case"GGG":return c.era(d,{width:"abbreviated"});case"GGGGG":return c.era(d,{width:"narrow"});default:return c.era(d,{width:"wide"})}},y:function(a,b,c){if("yo"===b){let b=a.getFullYear();return c.ordinalNumber(b>0?b:1-b,{unit:"year"})}return o.y(a,b)},Y:function(a,b,c,d){let e=m(a,d),f=e>0?e:1-e;return"YY"===b?n(f%100,2):"Yo"===b?c.ordinalNumber(f,{unit:"year"}):n(f,b.length)},R:function(a,b){return n(l(a),b.length)},u:function(a,b){return n(a.getFullYear(),b.length)},Q:function(a,b,c){let d=Math.ceil((a.getMonth()+1)/3);switch(b){case"Q":return String(d);case"QQ":return n(d,2);case"Qo":return c.ordinalNumber(d,{unit:"quarter"});case"QQQ":return c.quarter(d,{width:"abbreviated",context:"formatting"});case"QQQQQ":return c.quarter(d,{width:"narrow",context:"formatting"});default:return c.quarter(d,{width:"wide",context:"formatting"})}},q:function(a,b,c){let d=Math.ceil((a.getMonth()+1)/3);switch(b){case"q":return String(d);case"qq":return n(d,2);case"qo":return c.ordinalNumber(d,{unit:"quarter"});case"qqq":return c.quarter(d,{width:"abbreviated",context:"standalone"});case"qqqqq":return c.quarter(d,{width:"narrow",context:"standalone"});default:return c.quarter(d,{width:"wide",context:"standalone"})}},M:function(a,b,c){let d=a.getMonth();switch(b){case"M":case"MM":return o.M(a,b);case"Mo":return c.ordinalNumber(d+1,{unit:"month"});case"MMM":return c.month(d,{width:"abbreviated",context:"formatting"});case"MMMMM":return c.month(d,{width:"narrow",context:"formatting"});default:return c.month(d,{width:"wide",context:"formatting"})}},L:function(a,b,c){let d=a.getMonth();switch(b){case"L":return String(d+1);case"LL":return n(d+1,2);case"Lo":return c.ordinalNumber(d+1,{unit:"month"});case"LLL":return c.month(d,{width:"abbreviated",context:"standalone"});case"LLLLL":return c.month(d,{width:"narrow",context:"standalone"});default:return c.month(d,{width:"wide",context:"standalone"})}},w:function(a,b,d,e){let h,j,l,o,p,q=Math.round((i(h=(0,g.toDate)(a,e?.in),e)-(j=(0,c.getDefaultOptions)(),l=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??j.firstWeekContainsDate??j.locale?.options?.firstWeekContainsDate??1,o=m(h,e),(p=(0,k.constructFrom)(e?.in||h,0)).setFullYear(o,0,l),p.setHours(0,0,0,0),i(p,e)))/f.millisecondsInWeek)+1;return"wo"===b?d.ordinalNumber(q,{unit:"week"}):n(q,b.length)},I:function(a,b,c){let d,e,h,i=Math.round((j(d=(0,g.toDate)(a,void 0))-(e=l(d,void 0),(h=(0,k.constructFrom)(d,0)).setFullYear(e,0,4),h.setHours(0,0,0,0),j(h)))/f.millisecondsInWeek)+1;return"Io"===b?c.ordinalNumber(i,{unit:"week"}):n(i,b.length)},d:function(a,b,c){return"do"===b?c.ordinalNumber(a.getDate(),{unit:"date"}):o.d(a,b)},D:function(a,b,c){let i,j,k=function(a,b){let[c,g]=(0,e.normalizeDates)(void 0,a,b),i=h(c),j=h(g);return Math.round((i-(0,d.getTimezoneOffsetInMilliseconds)(i)-(j-(0,d.getTimezoneOffsetInMilliseconds)(j)))/f.millisecondsInDay)}(i=(0,g.toDate)(a,void 0),((j=(0,g.toDate)(i,void 0)).setFullYear(j.getFullYear(),0,1),j.setHours(0,0,0,0),j))+1;return"Do"===b?c.ordinalNumber(k,{unit:"dayOfYear"}):n(k,b.length)},E:function(a,b,c){let d=a.getDay();switch(b){case"E":case"EE":case"EEE":return c.day(d,{width:"abbreviated",context:"formatting"});case"EEEEE":return c.day(d,{width:"narrow",context:"formatting"});case"EEEEEE":return c.day(d,{width:"short",context:"formatting"});default:return c.day(d,{width:"wide",context:"formatting"})}},e:function(a,b,c,d){let e=a.getDay(),f=(e-d.weekStartsOn+8)%7||7;switch(b){case"e":return String(f);case"ee":return n(f,2);case"eo":return c.ordinalNumber(f,{unit:"day"});case"eee":return c.day(e,{width:"abbreviated",context:"formatting"});case"eeeee":return c.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return c.day(e,{width:"short",context:"formatting"});default:return c.day(e,{width:"wide",context:"formatting"})}},c:function(a,b,c,d){let e=a.getDay(),f=(e-d.weekStartsOn+8)%7||7;switch(b){case"c":return String(f);case"cc":return n(f,b.length);case"co":return c.ordinalNumber(f,{unit:"day"});case"ccc":return c.day(e,{width:"abbreviated",context:"standalone"});case"ccccc":return c.day(e,{width:"narrow",context:"standalone"});case"cccccc":return c.day(e,{width:"short",context:"standalone"});default:return c.day(e,{width:"wide",context:"standalone"})}},i:function(a,b,c){let d=a.getDay(),e=0===d?7:d;switch(b){case"i":return String(e);case"ii":return n(e,b.length);case"io":return c.ordinalNumber(e,{unit:"day"});case"iii":return c.day(d,{width:"abbreviated",context:"formatting"});case"iiiii":return c.day(d,{width:"narrow",context:"formatting"});case"iiiiii":return c.day(d,{width:"short",context:"formatting"});default:return c.day(d,{width:"wide",context:"formatting"})}},a:function(a,b,c){let d=a.getHours()/12>=1?"pm":"am";switch(b){case"a":case"aa":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"});case"aaa":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return c.dayPeriod(d,{width:"narrow",context:"formatting"});default:return c.dayPeriod(d,{width:"wide",context:"formatting"})}},b:function(a,b,c){let d,e=a.getHours();switch(d=12===e?"noon":0===e?"midnight":e/12>=1?"pm":"am",b){case"b":case"bb":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"});case"bbb":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return c.dayPeriod(d,{width:"narrow",context:"formatting"});default:return c.dayPeriod(d,{width:"wide",context:"formatting"})}},B:function(a,b,c){let d,e=a.getHours();switch(d=e>=17?"evening":e>=12?"afternoon":e>=4?"morning":"night",b){case"B":case"BB":case"BBB":return c.dayPeriod(d,{width:"abbreviated",context:"formatting"});case"BBBBB":return c.dayPeriod(d,{width:"narrow",context:"formatting"});default:return c.dayPeriod(d,{width:"wide",context:"formatting"})}},h:function(a,b,c){if("ho"===b){let b=a.getHours()%12;return 0===b&&(b=12),c.ordinalNumber(b,{unit:"hour"})}return o.h(a,b)},H:function(a,b,c){return"Ho"===b?c.ordinalNumber(a.getHours(),{unit:"hour"}):o.H(a,b)},K:function(a,b,c){let d=a.getHours()%12;return"Ko"===b?c.ordinalNumber(d,{unit:"hour"}):n(d,b.length)},k:function(a,b,c){let d=a.getHours();return(0===d&&(d=24),"ko"===b)?c.ordinalNumber(d,{unit:"hour"}):n(d,b.length)},m:function(a,b,c){return"mo"===b?c.ordinalNumber(a.getMinutes(),{unit:"minute"}):o.m(a,b)},s:function(a,b,c){return"so"===b?c.ordinalNumber(a.getSeconds(),{unit:"second"}):o.s(a,b)},S:function(a,b){return o.S(a,b)},X:function(a,b,c){let d=a.getTimezoneOffset();if(0===d)return"Z";switch(b){case"X":return r(d);case"XXXX":case"XX":return s(d);default:return s(d,":")}},x:function(a,b,c){let d=a.getTimezoneOffset();switch(b){case"x":return r(d);case"xxxx":case"xx":return s(d);default:return s(d,":")}},O:function(a,b,c){let d=a.getTimezoneOffset();switch(b){case"O":case"OO":case"OOO":return"GMT"+q(d,":");default:return"GMT"+s(d,":")}},z:function(a,b,c){let d=a.getTimezoneOffset();switch(b){case"z":case"zz":case"zzz":return"GMT"+q(d,":");default:return"GMT"+s(d,":")}},t:function(a,b,c){return n(Math.trunc(a/1e3),b.length)},T:function(a,b,c){return n(+a,b.length)}};function q(a,b=""){let c=a>0?"-":"+",d=Math.abs(a),e=Math.trunc(d/60),f=d%60;return 0===f?c+String(e):c+String(e)+b+n(f,2)}function r(a,b){return a%60==0?(a>0?"-":"+")+n(Math.abs(a)/60,2):s(a,b)}function s(a,b=""){let c=Math.abs(a);return(a>0?"-":"+")+n(Math.trunc(c/60),2)+b+n(c%60,2)}let t=(a,b)=>{switch(a){case"P":return b.date({width:"short"});case"PP":return b.date({width:"medium"});case"PPP":return b.date({width:"long"});default:return b.date({width:"full"})}},u=(a,b)=>{switch(a){case"p":return b.time({width:"short"});case"pp":return b.time({width:"medium"});case"ppp":return b.time({width:"long"});default:return b.time({width:"full"})}},v={p:u,P:(a,b)=>{let c,d=a.match(/(P+)(p+)?/)||[],e=d[1],f=d[2];if(!f)return t(a,b);switch(e){case"P":c=b.dateTime({width:"short"});break;case"PP":c=b.dateTime({width:"medium"});break;case"PPP":c=b.dateTime({width:"long"});break;default:c=b.dateTime({width:"full"})}return c.replace("{{date}}",t(e,b)).replace("{{time}}",u(f,b))}},w=/^D+$/,x=/^Y+$/,y=["D","DD","YY","YYYY"],z=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B=/^'([^]*?)'?$/,C=/''/g,D=/[a-zA-Z]/;function E(a,d,e){let f=(0,c.getDefaultOptions)(),h=e?.locale??f.locale??b.defaultLocale,i=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??f.firstWeekContainsDate??f.locale?.options?.firstWeekContainsDate??1,j=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??f.weekStartsOn??f.locale?.options?.weekStartsOn??0,k=(0,g.toDate)(a,e?.in);if(!(k instanceof Date||"object"==typeof k&&"[object Date]"===Object.prototype.toString.call(k))&&"number"!=typeof k||isNaN(+(0,g.toDate)(k)))throw RangeError("Invalid time value");let l=d.match(A).map(a=>{let b=a[0];return"p"===b||"P"===b?(0,v[b])(a,h.formatLong):a}).join("").match(z).map(a=>{if("''"===a)return{isToken:!1,value:"'"};let b=a[0];if("'"===b){var c;let b;return{isToken:!1,value:(b=(c=a).match(B))?b[1].replace(C,"'"):c}}if(p[b])return{isToken:!0,value:a};if(b.match(D))throw RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:a}});h.localize.preprocessor&&(l=h.localize.preprocessor(k,l));let m={firstWeekContainsDate:i,weekStartsOn:j,locale:h};return l.map(b=>{if(!b.isToken)return b.value;let c=b.value;return(!e?.useAdditionalWeekYearTokens&&x.test(c)||!e?.useAdditionalDayOfYearTokens&&w.test(c))&&function(a,b,c){var d,e,f;let g,h=(d=a,e=b,f=c,g="Y"===d[0]?"years":"days of the month",`Use \`${d.toLowerCase()}\` instead of \`${d}\` (in \`${e}\`) for formatting ${g} to the input \`${f}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(h),y.includes(a))throw RangeError(h)}(c,d,String(a)),(0,p[c[0]])(k,c,h.localize,m)}).join("")}a.s(["format",0,E],256711);var F=a.i(934754);function G(a,b,c){let[d,f]=(0,e.normalizeDates)(c?.in,a,b);return+h(d)==+h(f)}var H=a.i(156757);let I=H.z.union([H.z.date(),H.z.iso.datetime()]),J=a=>new Date(a);a.s(["DateLikeSchema",0,I,"shortAgo",0,function(a,b=Date.now()){let c=Math.max(0,Math.round((b-J(a).getTime())/1e3));if(c<60)return"now";let d=Math.round(c/60);if(d<60)return`${d}m`;let e=Math.round(d/60);return e<24?`${e}h`:`${Math.round(e/24)}d`},"toDate",0,J,"whenOf",0,function(a){let b=J(a),c=E(b,"HH:mm");return G((0,k.constructFrom)(b,b),(0,F.constructNow)(b))?c:!function(a){var b,c;let d;return G((0,k.constructFrom)(a,a),(b=(0,F.constructNow)(a),c=void 0,d=(0,g.toDate)(b,c?.in),isNaN(-1)?(0,k.constructFrom)(c?.in||b,NaN):(d.setDate(d.getDate()+-1),d)))}(b)?`${E(b,"MMM d")} \xb7 ${c}`:`Yesterday ${c}`}],199169)}];
2
+
3
+ //# sourceMappingURL=lib_date-like_ts_02is0pw._.js.map
@@ -0,0 +1,27 @@
1
+ module.exports=[228722,a=>{"use strict";let b={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0};async function c(a){let c=await navigator.mediaDevices.getUserMedia({audio:b}),g=new AudioContext({sampleRate:24e3});try{var h,i,j;await g.audioWorklet.addModule(f??=URL.createObjectURL(new Blob([e],{type:"application/javascript"})));let b=g.createMediaStreamSource(c),k=new AudioWorkletNode(g,d);k.port.onmessage=b=>{let c=b.data,d=new Int16Array(c.length);for(let a=0;a<c.length;a++){let b=Math.max(-1,Math.min(1,c[a]));d[a]=b<0?32768*b:32767*b}a(d)},b.connect(k);let l=g.createGain();return l.gain.value=0,k.connect(l).connect(g.destination),await g.resume(),h=c,i=g,j=k,{stream:h,setMuted(a){for(let b of h.getAudioTracks())b.enabled=!a},close(){for(let a of(j.port.onmessage=null,h.getTracks()))a.stop();i.close()}}}catch(a){for(let a of c.getTracks())a.stop();throw g.close(),a}}let d="voice-capture",e=`
2
+ class VoiceCapture extends AudioWorkletProcessor {
3
+ constructor() {
4
+ super();
5
+ this.frame = new Float32Array(1024);
6
+ this.filled = 0;
7
+ }
8
+ process(inputs) {
9
+ const input = inputs[0] && inputs[0][0];
10
+ if (!input) return true;
11
+ for (let i = 0; i < input.length; i++) {
12
+ this.frame[this.filled++] = input[i];
13
+ if (this.filled === this.frame.length) {
14
+ this.port.postMessage(this.frame.slice());
15
+ this.filled = 0;
16
+ }
17
+ }
18
+ return true;
19
+ }
20
+ }
21
+ registerProcessor("${d}", VoiceCapture);
22
+ `,f=null;a.s(["MICROPHONE_CONSTRAINTS",0,b,"PCM_SAMPLE_RATE",0,24e3,"createPcmPlayer",0,function(a,b){let{context:c,analyser:d}=a.speaker(),e=0,f=new Set;return{push(a){if(0===a.length)return;let g=c.createBuffer(1,a.length,24e3),h=g.getChannelData(0);for(let b=0;b<a.length;b++)h[b]=a[b]/32768;let i=c.createBufferSource();i.buffer=g,i.connect(d),i.onended=()=>{f.delete(i),0===f.size&&b()},e=Math.max(e,c.currentTime+.06),i.start(e),e+=g.duration,f.add(i)},stop(){for(let a of f){a.onended=null;try{a.stop()}catch{}}f.clear(),e=0},get speaking(){return f.size>0}}},"decodePcm",0,function(a){let b=atob(a),c=new Uint8Array(b.length);for(let a=0;a<b.length;a++)c[a]=b.charCodeAt(a);return new Int16Array(c.buffer,0,c.length>>1)},"encodePcm",0,function(a){let b=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),c="";for(let a=0;a<b.length;a+=32768)c+=String.fromCharCode(...b.subarray(a,a+32768));return btoa(c)},"openMicrophone",0,c])},730983,a=>{"use strict";let b={silent:{level:-1},fatal:{level:0},error:{level:0},warn:{level:1},log:{level:2},info:{level:3},success:{level:3},fail:{level:3},ready:{level:3},start:{level:3},box:{level:3},debug:{level:4},trace:{level:5},verbose:{level:1/0}};function c(a){if(null===a||"object"!=typeof a)return!1;let b=Object.getPrototypeOf(a);return(null===b||b===Object.prototype||null===Object.getPrototypeOf(b))&&!(Symbol.iterator in a)&&(!(Symbol.toStringTag in a)||"[object Module]"===Object.prototype.toString.call(a))}let d=!1,e=[];class f{options;_lastLog;_mockFn;constructor(a={}){const d=a.types||b;for(const e in this.options=((...a)=>a.reduce((a,b)=>(function a(b,d,e=".",f){if(!c(d))return a(b,{},e,f);let g=Object.assign({},d);for(let d in b){if("__proto__"===d||"constructor"===d)continue;let h=b[d];null!=h&&(f&&f(g,d,h,e)||(Array.isArray(h)&&Array.isArray(g[d])?g[d]=[...h,...g[d]]:c(h)&&c(g[d])?g[d]=a(h,g[d],(e?`${e}.`:"")+d.toString(),f):g[d]=h))}return g})(a,b,"",void 0),{}))({...a,defaults:{...a.defaults},level:g(a.level,d),reporters:[...a.reporters||[]]},{types:b,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}}),d){const a={type:e,...this.options.defaults,...d[e]};this[e]=this._wrapLogFn(a),this[e].raw=this._wrapLogFn(a,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(a){this.options.level=g(a,this.options.types,this.options.level)}prompt(a,b){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(a,b)}create(a){let b=new f({...this.options,...a});return this._mockFn&&b.mockTypes(this._mockFn),b}withDefaults(a){return this.create({...this.options,defaults:{...this.options.defaults,...a}})}withTag(a){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+a:a})}addReporter(a){return this.options.reporters.push(a),this}removeReporter(a){if(a){let b=this.options.reporters.indexOf(a);if(-1!==b)return this.options.reporters.splice(b,1)}else this.options.reporters.splice(0);return this}setReporters(a){return this.options.reporters=Array.isArray(a)?a:[a],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let a in this.options.types)console["__"+a]||(console["__"+a]=console[a]),console[a]=this[a].raw}restoreConsole(){for(let a in this.options.types)console["__"+a]&&(console[a]=console["__"+a],delete console["__"+a])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(a,b){a&&(a.__write||(a.__write=a.write),a.write=a=>{this[b].raw(String(a).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(a){a&&a.__write&&(a.write=a.__write,delete a.__write)}pauseLogs(){d=!0}resumeLogs(){for(let a of(d=!1,e.splice(0)))a[0]._logFn(a[1],a[2])}mockTypes(a){let b=a||this.options.mockFn;if(this._mockFn=b,"function"==typeof b)for(let a in this.options.types)this[a]=b(a,this.options.types[a])||this[a],this[a].raw=this[a]}_wrapLogFn(a,b){return(...c)=>d?void e.push([this,a,c,b]):this._logFn(a,c,b)}_logFn(a,b,c){var d,e;if((a.level||0)>this.level)return!1;let f={date:new Date,args:[],...a,level:g(a.level,this.options.types)};c||1!==b.length||+(e=d=b[0],"[object Object]"!==Object.prototype.toString.call(e)||!d.message&&!d.args||!!d.stack)?f.args=[...b]:Object.assign(f,b[0]),f.message&&(f.args.unshift(f.message),delete f.message),f.additional&&(Array.isArray(f.additional)||(f.additional=f.additional.split("\n")),f.args.push("\n"+f.additional.join("\n")),delete f.additional),f.type="string"==typeof f.type?f.type.toLowerCase():"log",f.tag="string"==typeof f.tag?f.tag:"";let h=(a=!1)=>{let b=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&b>0){let a=[...this._lastLog.object.args];b>1&&a.push(`(repeated ${b} times)`),this._log({...this._lastLog.object,args:a}),this._lastLog.count=1}a&&(this._lastLog.object=f,this._log(f))};clearTimeout(this._lastLog.timeout);let i=this._lastLog.time&&f.date?f.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=f.date,i<this.options.throttle)try{let a=JSON.stringify([f.type,f.tag,f.args]),b=this._lastLog.serialized===a;if(this._lastLog.serialized=a,b&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(h,this.options.throttle);return}}catch{}h(!0)}_log(a){for(let b of this.options.reporters)b.log(a,{options:this.options})}}function g(a,b={},c=3){return void 0===a?c:"number"==typeof a?a:b[a]&&void 0!==b[a].level?b[a].level:c}f.prototype.add=f.prototype.addReporter,f.prototype.remove=f.prototype.removeReporter,f.prototype.clear=f.prototype.removeReporter,f.prototype.withScope=f.prototype.withTag,f.prototype.mock=f.prototype.mockTypes,f.prototype.pause=f.prototype.pauseLogs,f.prototype.resume=f.prototype.resumeLogs;var h,i,j=a.i(812057),k=a.i(750227);function l(a,b){let c=process.cwd()+k.sep;return a.split("\n").splice(b.split("\n").length).map(a=>a.trim().replace("file://","").replace(c,""))}let m=a=>a?`[${a}]`:"";class n{formatStack(a,b,c){let d=" ".repeat((c?.errorLevel||0)+1);return d+l(a,b).join(`
23
+ ${d}`)}formatError(a,b){let c=a.message??(0,j.formatWithOptions)(b,a),d=a.stack?this.formatStack(a.stack,c,b):"",e=b?.errorLevel||0;return(e>0?`${" ".repeat(e)}[cause]: `:"")+c+"\n"+d+(a.cause?"\n\n"+this.formatError(a.cause,{...b,errorLevel:e+1}):"")}formatArgs(a,b){let c=a.map(a=>a&&"string"==typeof a.stack?this.formatError(a,b):a);return(0,j.formatWithOptions)(b,...c)}formatDate(a,b){return b.date?a.toLocaleTimeString():""}filterAndJoin(a){return a.filter(Boolean).join(" ")}formatLogObj(a,b){let c=this.formatArgs(a.args,b);return"box"===a.type?"\n"+[m(a.tag),a.title&&a.title,...c.split("\n")].filter(Boolean).map(a=>" > "+a).join("\n")+"\n":this.filterAndJoin([m(a.type),m(a.tag),c])}log(a,b){var c,d;return c=this.formatLogObj(a,{columns:b.options.stdout.columns||0,...b.options.formatOptions})+"\n",((d=a.level<2?b.options.stderr||process.stderr:b.options.stdout||process.stdout).__write||d.write).call(d,c)}}var o=a.i(59639),p=a.i(509656);let{env:q={},argv:r=[],platform:s=""}="u"<typeof process?{}:process,t="NO_COLOR"in q||r.includes("--no-color"),u="FORCE_COLOR"in q||r.includes("--color"),v="dumb"===q.TERM,w=p&&p.isatty&&p.isatty(1)&&q.TERM&&!v,x="CI"in q&&("GITHUB_ACTIONS"in q||"GITLAB_CI"in q||"CIRCLECI"in q),y=!t&&(u||"win32"===s&&!v||w||x);function z(a,b,c){return function(a,b,c=a,d=a.length+1){return e=>{var f;return e||""!==e&&void 0!==e?(f=(""+e).indexOf(b,d),f<0?a+e+b:a+function a(b,c,d,e,f=c.slice(0,Math.max(0,b))+e,g=c.slice(Math.max(0,b+d.length)),h=g.indexOf(d)){return f+(h<0?g:a(h,g,d,e))}(f,e,b,c)+b):""}}(`\x1b[${a}m`,`\x1b[${b}m`,c)}let A={reset:z(0,0),bold:z(1,22,"\x1b[22m\x1b[1m"),dim:z(2,22,"\x1b[22m\x1b[2m"),italic:z(3,23),underline:z(4,24),inverse:z(7,27),hidden:z(8,28),strikethrough:z(9,29),black:z(30,39),red:z(31,39),green:z(32,39),yellow:z(33,39),blue:z(34,39),magenta:z(35,39),cyan:z(36,39),white:z(37,39),gray:z(90,39),bgBlack:z(40,49),bgRed:z(41,49),bgGreen:z(42,49),bgYellow:z(43,49),bgBlue:z(44,49),bgMagenta:z(45,49),bgCyan:z(46,49),bgWhite:z(47,49),blackBright:z(90,39),redBright:z(91,39),greenBright:z(92,39),yellowBright:z(93,39),blueBright:z(94,39),magentaBright:z(95,39),cyanBright:z(96,39),whiteBright:z(97,39),bgBlackBright:z(100,49),bgRedBright:z(101,49),bgGreenBright:z(102,49),bgYellowBright:z(103,49),bgBlueBright:z(104,49),bgMagentaBright:z(105,49),bgCyanBright:z(106,49),bgWhiteBright:z(107,49)},B=function(a=y){return a?A:Object.fromEntries(Object.keys(A).map(a=>[a,String]))}();function C(a,b="reset"){return B[a]||B[b]}let D=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function E(a){return a.replace(RegExp(D,"g"),"")}let F={solid:{tl:"┌",tr:"┐",bl:"└",br:"┘",h:"─",v:"│"},double:{tl:"╔",tr:"╗",bl:"╚",br:"╝",h:"═",v:"║"},doubleSingle:{tl:"╓",tr:"╖",bl:"╙",br:"╜",h:"─",v:"║"},doubleSingleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"║"},singleThick:{tl:"┏",tr:"┓",bl:"┗",br:"┛",h:"━",v:"┃"},singleDouble:{tl:"╒",tr:"╕",bl:"╘",br:"╛",h:"═",v:"│"},singleDoubleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"═",v:"│"},rounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"│"}},G={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};var H={get url(){return a.F("node_modules/consola/dist/index.mjs")},env:{DEV:!1,PROD:!0,MODE:"production",BASE_URL:"/",SSR:!0}};let I=Object.create(null),J=a=>globalThis.process?.env||H.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(a?I:globalThis),K=new Proxy(I,{get:(a,b)=>J()[b]??I[b],has:(a,b)=>b in J()||b in I,set:(a,b,c)=>(J(!0)[b]=c,!0),deleteProperty(a,b){if(!b)return!1;let c=J(!0);return delete c[b],!0},ownKeys:()=>Object.keys(J(!0))}),L="u">typeof process&&process.env&&"production"||"",M=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]],N=function(){if(globalThis.process?.env)for(let a of M){let b=a[1]||a[0];if(globalThis.process?.env[b])return{name:a[0].toLowerCase(),...a[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}();function O(a){return!!a&&"false"!==a}N.name;let P=globalThis.process?.platform||"",Q=O(K.CI)||!1!==N.ci,R=O(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),S=O(K.DEBUG),T="test"===L||O(K.TEST);O(K.MINIMAL);let U=/^win/i.test(P);!O(K.NO_COLOR)&&(O(K.FORCE_COLOR)||(R||U)&&K.TERM);let V=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;V?.split(".")[0];let W=globalThis.process||Object.create(null),X={versions:{}};new Proxy(W,{get:(a,b)=>"env"===b?K:b in a?a[b]:b in X?X[b]:void 0});let Y=globalThis.process?.release?.name==="node",Z=!!globalThis.Bun||!!globalThis.process?.versions?.bun,$=!!globalThis.Deno,_=!!globalThis.fastly,aa=[[!!globalThis.Netlify,"netlify"],[!!globalThis.EdgeRuntime,"edge-light"],[globalThis.navigator?.userAgent==="Cloudflare-Workers","workerd"],[_,"fastly"],[$,"deno"],[Z,"bun"],[Y,"node"]],ab=function(){let a=aa.find(a=>a[0]);if(a)return{name:a[1]}}();ab?.name;let ac=function({onlyFirst:a=!1}={}){return RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",a?void 0:"g")}(),ad=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,ae=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:a=>a.split("")},af=/^\p{Default_Ignorable_Code_Point}$/u,ag={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},ah={0:"red",1:"yellow"},ai=function(){let{env:a}=o.default,{TERM:b,TERM_PROGRAM:c}=a;return"win32"!==o.default.platform?"linux"!==b:!!a.WT_SESSION||!!a.TERMINUS_SUBLIME||"{cmd::Cmder}"===a.ConEmuTask||"Terminus-Sublime"===c||"vscode"===c||"xterm-256color"===b||"alacritty"===b||"rxvt-unicode"===b||"rxvt-unicode-256color"===b||"JetBrains-JediTerm"===a.TERMINAL_EMULATOR}(),aj=(a,b)=>ai?a:b,ak={error:aj("✖","×"),fatal:aj("✖","×"),ready:aj("✔","√"),warn:aj("⚠","‼"),info:aj("ℹ","i"),success:aj("✔","√"),debug:aj("⚙","D"),trace:aj("→","→"),fail:aj("✖","×"),start:aj("◐","o"),log:""};function al(a){return"object"==typeof Intl&&Intl.Segmenter?function(a,b={}){if("string"!=typeof a||0===a.length)return 0;let{ambiguousIsNarrow:c=!0,countAnsiEscapeCodes:d=!1}=b;if(d||(a=function(a){if("string"!=typeof a)throw TypeError(`Expected a \`string\`, got \`${typeof a}\``);return a.replace(ac,"")}(a)),0===a.length)return 0;let e=0,f={ambiguousAsWide:!c};for(let{segment:b}of ae.segment(a)){let a=b.codePointAt(0);if(!(a<=31)&&(!(a>=127)||!(a<=159))&&(!(a>=8203)||!(a<=8207))&&65279!==a&&(!(a>=768)||!(a<=879))&&(!(a>=6832)||!(a<=6911))&&(!(a>=7616)||!(a<=7679))&&(!(a>=8400)||!(a<=8447))&&(!(a>=65056)||!(a<=65071))&&(!(a>=55296)||!(a<=57343))&&(!(a>=65024)||!(a<=65039))&&!af.test(b)){if(ad().test(b)){e+=2;continue}e+=function(a,{ambiguousAsWide:b=!1}={}){var c;if(!Number.isSafeInteger(a))throw TypeError(`Expected a code point, got \`${typeof a}\`.`);return 12288===a||a>=65281&&a<=65376||a>=65504&&a<=65510||(c=a)>=4352&&c<=4447||8986===c||8987===c||9001===c||9002===c||c>=9193&&c<=9196||9200===c||9203===c||9725===c||9726===c||9748===c||9749===c||c>=9776&&c<=9783||c>=9800&&c<=9811||9855===c||c>=9866&&c<=9871||9875===c||9889===c||9898===c||9899===c||9917===c||9918===c||9924===c||9925===c||9934===c||9940===c||9962===c||9970===c||9971===c||9973===c||9978===c||9981===c||9989===c||9994===c||9995===c||10024===c||10060===c||10062===c||c>=10067&&c<=10069||10071===c||c>=10133&&c<=10135||10160===c||10175===c||11035===c||11036===c||11088===c||11093===c||c>=11904&&c<=11929||c>=11931&&c<=12019||c>=12032&&c<=12245||c>=12272&&c<=12287||c>=12289&&c<=12350||c>=12353&&c<=12438||c>=12441&&c<=12543||c>=12549&&c<=12591||c>=12593&&c<=12686||c>=12688&&c<=12773||c>=12783&&c<=12830||c>=12832&&c<=12871||c>=12880&&c<=42124||c>=42128&&c<=42182||c>=43360&&c<=43388||c>=44032&&c<=55203||c>=63744&&c<=64255||c>=65040&&c<=65049||c>=65072&&c<=65106||c>=65108&&c<=65126||c>=65128&&c<=65131||c>=94176&&c<=94180||94192===c||94193===c||c>=94208&&c<=100343||c>=100352&&c<=101589||c>=101631&&c<=101640||c>=110576&&c<=110579||c>=110581&&c<=110587||110589===c||110590===c||c>=110592&&c<=110882||110898===c||c>=110928&&c<=110930||110933===c||c>=110948&&c<=110951||c>=110960&&c<=111355||c>=119552&&c<=119638||c>=119648&&c<=119670||126980===c||127183===c||127374===c||c>=127377&&c<=127386||c>=127488&&c<=127490||c>=127504&&c<=127547||c>=127552&&c<=127560||127568===c||127569===c||c>=127584&&c<=127589||c>=127744&&c<=127776||c>=127789&&c<=127797||c>=127799&&c<=127868||c>=127870&&c<=127891||c>=127904&&c<=127946||c>=127951&&c<=127955||c>=127968&&c<=127984||127988===c||c>=127992&&c<=128062||128064===c||c>=128066&&c<=128252||c>=128255&&c<=128317||c>=128331&&c<=128334||c>=128336&&c<=128359||128378===c||128405===c||128406===c||128420===c||c>=128507&&c<=128591||c>=128640&&c<=128709||128716===c||c>=128720&&c<=128722||c>=128725&&c<=128727||c>=128732&&c<=128735||128747===c||128748===c||c>=128756&&c<=128764||c>=128992&&c<=129003||129008===c||c>=129292&&c<=129338||c>=129340&&c<=129349||c>=129351&&c<=129535||c>=129648&&c<=129660||c>=129664&&c<=129673||c>=129679&&c<=129734||c>=129742&&c<=129756||c>=129759&&c<=129769||c>=129776&&c<=129784||c>=131072&&c<=196605||c>=196608&&c<=262141||b&&(161===a||164===a||167===a||168===a||170===a||173===a||174===a||a>=176&&a<=180||a>=182&&a<=186||a>=188&&a<=191||198===a||208===a||215===a||216===a||a>=222&&a<=225||230===a||a>=232&&a<=234||236===a||237===a||240===a||242===a||243===a||a>=247&&a<=250||252===a||254===a||257===a||273===a||275===a||283===a||294===a||295===a||299===a||a>=305&&a<=307||312===a||a>=319&&a<=322||324===a||a>=328&&a<=331||333===a||338===a||339===a||358===a||359===a||363===a||462===a||464===a||466===a||468===a||470===a||472===a||474===a||476===a||593===a||609===a||708===a||711===a||a>=713&&a<=715||717===a||720===a||a>=728&&a<=731||733===a||735===a||a>=768&&a<=879||a>=913&&a<=929||a>=931&&a<=937||a>=945&&a<=961||a>=963&&a<=969||1025===a||a>=1040&&a<=1103||1105===a||8208===a||a>=8211&&a<=8214||8216===a||8217===a||8220===a||8221===a||a>=8224&&a<=8226||a>=8228&&a<=8231||8240===a||8242===a||8243===a||8245===a||8251===a||8254===a||8308===a||8319===a||a>=8321&&a<=8324||8364===a||8451===a||8453===a||8457===a||8467===a||8470===a||8481===a||8482===a||8486===a||8491===a||8531===a||8532===a||a>=8539&&a<=8542||a>=8544&&a<=8555||a>=8560&&a<=8569||8585===a||a>=8592&&a<=8601||8632===a||8633===a||8658===a||8660===a||8679===a||8704===a||8706===a||8707===a||8711===a||8712===a||8715===a||8719===a||8721===a||8725===a||8730===a||a>=8733&&a<=8736||8739===a||8741===a||a>=8743&&a<=8748||8750===a||a>=8756&&a<=8759||8764===a||8765===a||8776===a||8780===a||8786===a||8800===a||8801===a||a>=8804&&a<=8807||8810===a||8811===a||8814===a||8815===a||8834===a||8835===a||8838===a||8839===a||8853===a||8857===a||8869===a||8895===a||8978===a||a>=9312&&a<=9449||a>=9451&&a<=9547||a>=9552&&a<=9587||a>=9600&&a<=9615||a>=9618&&a<=9621||9632===a||9633===a||a>=9635&&a<=9641||9650===a||9651===a||9654===a||9655===a||9660===a||9661===a||9664===a||9665===a||a>=9670&&a<=9672||9675===a||a>=9678&&a<=9681||a>=9698&&a<=9701||9711===a||9733===a||9734===a||9737===a||9742===a||9743===a||9756===a||9758===a||9792===a||9794===a||9824===a||9825===a||a>=9827&&a<=9829||a>=9831&&a<=9834||9836===a||9837===a||9839===a||9886===a||9887===a||9919===a||a>=9926&&a<=9933||a>=9935&&a<=9939||a>=9941&&a<=9953||9955===a||9960===a||9961===a||a>=9963&&a<=9969||9972===a||a>=9974&&a<=9977||9979===a||9980===a||9982===a||9983===a||10045===a||a>=10102&&a<=10111||a>=11094&&a<=11097||a>=12872&&a<=12879||a>=57344&&a<=63743||a>=65024&&a<=65039||65533===a||a>=127232&&a<=127242||a>=127248&&a<=127277||a>=127280&&a<=127337||a>=127344&&a<=127373||127375===a||127376===a||a>=127387&&a<=127404||a>=917760&&a<=917999||a>=983040&&a<=1048573||a>=1048576&&a<=1114109)?2:1}(a,f)}}return e}(a):E(a).length}class am extends n{formatStack(a,b,c){let d=" ".repeat((c?.errorLevel||0)+1);return`
24
+ ${d}`+l(a,b).map(a=>" "+a.replace(/^at +/,a=>B.gray(a)).replace(/\((.+)\)/,(a,b)=>`(${B.cyan(b)})`)).join(`
25
+ ${d}`)}formatType(a,b,c){let d=ag[a.type]||ah[a.level]||"gray";if(b)return(function(a="bgWhite"){return B[`bg${a[0].toUpperCase()}${a.slice(1)}`]||B.bgWhite})(d)(B.black(` ${a.type.toUpperCase()} `));let e="string"==typeof ak[a.type]?ak[a.type]:a.icon||a.type;return e?(function(a="white"){return B[a]||B.white})(d)(e):""}formatLogObj(a,b){let c,[d,...e]=this.formatArgs(a.args,b).split("\n");if("box"===a.type)return function(a,b={}){let c={...b,style:{...G,...b.style}},d=a.split("\n"),e=[],f=C(c.style.borderColor),g={..."string"==typeof c.style.borderStyle?F[c.style.borderStyle]||F.solid:c.style.borderStyle};if(f)for(let a in g)g[a]=f(g[a]);let h=c.style.padding%2==0?c.style.padding:c.style.padding+1,i=d.length+h,j=Math.max(...d.map(a=>E(a).length),c.title?E(c.title).length:0)+h,k=j+h,l=c.style.marginLeft>0?" ".repeat(c.style.marginLeft):"";if(c.style.marginTop>0&&e.push("".repeat(c.style.marginTop)),c.title){let a=f?f(c.title):c.title,b=g.h.repeat(Math.floor((j-E(c.title).length)/2)),d=g.h.repeat(j-E(c.title).length-E(b).length+h);e.push(`${l}${g.tl}${b}${a}${d}${g.tr}`)}else e.push(`${l}${g.tl}${g.h.repeat(k)}${g.tr}`);let m="center"===c.style.valign?Math.floor((i-d.length)/2):"top"===c.style.valign?i-d.length-h:i-d.length;for(let a=0;a<i;a++)if(a<m||a>=m+d.length)e.push(`${l}${g.v}${" ".repeat(k)}${g.v}`);else{let b=d[a-m],c=" ".repeat(h),f=" ".repeat(j-E(b).length);e.push(`${l}${g.v}${c}${b}${f}${g.v}`)}return e.push(`${l}${g.bl}${g.h.repeat(k)}${g.br}`),c.style.marginBottom>0&&e.push("".repeat(c.style.marginBottom)),e.join("\n")}(an(d+(e.length>0?"\n"+e.join("\n"):"")),{title:a.title?an(a.title):void 0,style:a.style});let f=this.formatDate(a.date,b),g=f&&B.gray(f),h=a.badge??a.level<2,i=this.formatType(a,h,b),j=a.tag?B.gray(a.tag):"",k=this.filterAndJoin([i,an(d)]),l=this.filterAndJoin(b.columns?[j,g]:[j]),m=(b.columns||0)-al(k)-al(l)-2;if(c=(m>0&&(b.columns||0)>=80?k+" ".repeat(m)+l:(l?`${B.gray(`[${l}]`)} `:"")+k)+an(e.length>0?"\n"+e.join("\n"):""),"trace"===a.type){let b=Error("Trace: "+a.message);c+=this.formatStack(b.stack||"",b.message)}return h?"\n"+c+"\n":c}}function an(a){return a.replace(/`([^`]+)`/gm,(a,b)=>B.cyan(b)).replace(/\s+_([^_]+)_\s+/gm,(a,b)=>` ${B.underline(b)} `)}function ao(b={}){let c=S?4:T?1:3;return process.env.CONSOLA_LEVEL&&(c=Number.parseInt(process.env.CONSOLA_LEVEL)??c),function(a={}){return new f(a)}({level:c,defaults:{level:c},stdout:process.stdout,stderr:process.stderr,prompt:(...b)=>a.A(715837).then(a=>a.prompt(...b)),reporters:b.reporters||[b.fancy??!(Q||T)?new am:new n],...b})}ao();var ap=a.i(287702);let aq=ao({level:ap.IS_DEV?4:3}),ar=(h=ap.APP_NAME,aq.withDefaults({message:(i=`${h}: `,C("blackBright")(i))}));var as=a.i(497895);a.s(["realtimeSession",0,function(a){return({credential:b,setup:c,audio:d,on:e})=>{let f=!1,g=null,h=null,i=new Set,j=[],k=new Map,l=new Set,m=(a,b)=>{k.has(a)||(k.set(a,j.length),j.push({id:a,role:b,text:""}))},n=(a,b)=>{let c=j[a];c.text.trim()&&e.turn({...c,seq:a,done:b})},o=(a,b,c,d)=>{m(a,b);let e=k.get(a),f=j[e].text,g="append"===d?f+c:c;g!==f&&(j[e]={...j[e],text:g},l.has(a)||n(e,!1))},p=a=>{let b=k.get(a);void 0===b||l.has(a)||j[b].text.trim()&&(l.add(a),n(b,!0))},q=!1,r=!1,s=!1,t=!1,u=null,v=null,w=new Map,x=0,y=!1,z=[],A=[],B="",C=()=>{u&&clearTimeout(u),u=null},D=()=>{v&&clearTimeout(v),v=null},E=()=>{if(f)return;let a=w.size>0||y||x>0,b={speaking:q,hearing:r,tools:a?z:[]},c=JSON.stringify(b);if(c!==B&&(B=c,e.activity(b)),r||s||u||q||w.size>0)return;let d=x>0;if(d||0!==A.length){for(let a of A.splice(0))F.send({type:"conversation.item.create",item:{type:"message",role:"system",content:[{type:"input_text",text:a}]}});x=0,y=d,s=!0,t=!0,D(),v=setTimeout(()=>{v=null,t&&(t=!1,s=!1,e.warn("The voice API never answered a response we asked for."),E())},5e3),F.send({type:"response.create"})}},F=a.transport({credential:b,setup:c,audio:d,on:{event:a=>{switch(a.type){case"session.updated":g?.resolve();break;case"error":{let b=a.error?.message??"The voice API reported an error";t&&(t=!1,s=!1,D()),g?g.reject(Error(b)):e.warn(b);break}case"input_audio_buffer.speech_started":r=!0,C();break;case"input_audio_buffer.speech_stopped":r=!1,C(),u=setTimeout(()=>{u=null,E()},1500);break;case"input_audio_buffer.committed":m(a.item_id,"user");break;case"conversation.item.added":case"conversation.item.created":"message"===a.item.type&&"system"!==a.item.role&&m(a.item.id,a.item.role);break;case"response.output_item.added":"message"===a.item.type?m(a.item.id,"assistant"):"function_call"===a.item.type&&m(a.item.id,"tool");break;case"conversation.item.input_audio_transcription.delta":o(a.item_id,"user",a.delta??"","append");break;case"conversation.item.input_audio_transcription.updated":o(a.item_id,"user",a.transcript,"replace");break;case"conversation.item.input_audio_transcription.completed":o(a.item_id,"user",a.transcript??"","replace"),"in_progress"!==a.status&&p(a.item_id);break;case"conversation.item.input_audio_transcription.failed":e.warn(a.error?.message?`That turn could not be transcribed: ${a.error.message}`:"That turn could not be transcribed.");break;case"response.output_audio_transcript.delta":o(a.item_id,"assistant",a.delta,"append");break;case"response.output_audio_transcript.done":a.transcript&&o(a.item_id,"assistant",a.transcript,"replace"),p(a.item_id);break;case"response.created":s=!0,t=!1,D(),C();break;case"response.done":var b;for(let c of(s=!1,y=!1,"failed"===a.response.status&&e.warn((b=a.response,b.status_details?.error?.message??"The model could not finish answering")),a.response.output??[]))"message"===c.type&&p(c.id);for(let[a,b]of j.entries())"user"!==b.role||l.has(b.id)||n(a,!0);break;case"response.function_call_arguments.done":m(a.item_id,"tool");{let b=k.get(a.item_id);j[b]={...j[b],tool:a.name,text:a.arguments||"{}"}}p(a.item_id),0!==w.size||y||(z=[]),z=[...z,a.name],w.set(a.call_id,a.name),e.runTool({id:a.call_id,name:a.name,arguments:a.arguments}).catch(a=>`Error: ${(0,as.errorToString)(a)}`).then(b=>{f||(F.send({type:"conversation.item.create",item:{type:"function_call_output",call_id:a.call_id,output:b}}),w.delete(a.call_id),x+=1,E())});break;default:i.has(a.type)||(i.add(a.type),ar.debug(`realtime: no case for ${a.type}`))}E()},playing:a=>{q=a,a&&(y=!1),E()},dropped:a=>{g?g.reject(Error(a)):e.failed(a)}}});return{async connect(){if(await F.connect(),f)throw Error("Hung up before the session opened.");F.send(a.sessionUpdate(c)),await new Promise((a,b)=>{g={resolve:a,reject:b},h=setTimeout(a,5e3)}).finally(()=>{g=null,h&&clearTimeout(h),h=null})},close(){for(let a of j)p(a.id);f=!0,C(),D(),g?.reject(Error("Hung up before the session opened.")),F.close()},mute:a=>F.mute(a),say(a){f||(A.push(a),E())}}}},"toFunctionTools",0,a=>a.map(({name:a,description:b,parameters:c})=>({type:"function",name:a,description:b,parameters:c}))],730983)},100031,a=>{"use strict";var b=a.i(228722);async function c(a,b){let c=await a.text().catch(()=>"");try{let a=JSON.parse(c)?.error?.message;if("string"==typeof a&&a)return a}catch{}return`${b} refused the call (${a.status})`}a.s(["createSocketTransport",0,function({url:a,protocols:c,label:d,audio:e,on:f}){let g=null,h=null,i=null,j=!1,k=!1,l=!1,m=!1,n=null,o=a=>{m!==a&&(m=a,f.playing(a))},p=a=>{g?.readyState===WebSocket.OPEN&&g.send(JSON.stringify(a))};return{async connect(){i=(0,b.createPcmPlayer)(e,()=>{n=null,o(!1)});let m=new Promise((b,e)=>{let h=new WebSocket(a,c);g=h,h.onopen=()=>{l=!0,b(h)};let i=a=>l?void(!j&&!k&&(k=!0,f.dropped(a))):e(Error(a));h.onerror=()=>i(`Could not reach ${d}`),h.onclose=a=>i(a.reason||`The connection to ${d} closed (${a.code})`)}),q=(0,b.openMicrophone)(a=>p({type:"input_audio_buffer.append",audio:(0,b.encodePcm)(a)})).then(a=>{j?a.close():(h=a,e.hear?.(a.stream))},a=>{throw Error(a instanceof Error?`Microphone unavailable — ${a.message}`:"Microphone unavailable")}),[r]=await Promise.all([m,q]);if(j)throw Error("Hung up before the call opened.");r.onmessage=a=>{let c;if("string"==typeof a.data){try{c=JSON.parse(a.data)}catch{return}var d=c;switch(d.type){case"response.output_audio.delta":{if(!i||!d.delta)break;let a=(0,b.decodePcm)(d.delta);n?.itemId!==d.item_id&&(n={itemId:d.item_id,contentIndex:d.content_index??0,startedAt:performance.now(),receivedMs:0}),n.receivedMs+=a.length/b.PCM_SAMPLE_RATE*1e3,i.push(a),o(!0);break}case"input_audio_buffer.speech_started":(()=>{if(!i?.speaking||!n)return;let a=Math.min(n.receivedMs,performance.now()-n.startedAt);p({type:"conversation.item.truncate",item_id:n.itemId,content_index:n.contentIndex,audio_end_ms:Math.max(0,Math.floor(a))}),i.stop(),n=null,o(!1)})()}f.event(d)}}},send:p,close:()=>{j=!0,i?.stop(),i=null,h?.close(),h=null;let a=g;g=null,a?.close()},mute(a){h?.setMuted(a)}}},"createWebRtcTransport",0,function({url:a,secret:d,label:e,audio:f,on:g}){let h=null,i=null,j=null,k=!1,l=!1,m=!1,n=!1,o=a=>{n!==a&&(n=a,g.playing(a))},p=a=>{for(let b of a?.getTracks()??[])b.stop()};return{async connect(){let n=new RTCPeerConnection;h=n;let q=n.createDataChannel("oai-events");i=q;let r=new Promise((a,b)=>{let c=a=>l?void(!k&&!m&&(m=!0,g.dropped(a))):b(Error(a));q.onopen=()=>{l=!0,a()},q.onclose=()=>c(`The connection to ${e} closed`),q.onerror=()=>c(`The connection to ${e} dropped`),n.onconnectionstatechange=()=>{let a=n.connectionState;("failed"===a||"closed"===a)&&c(`Could not reach ${e}`)}});q.onmessage=a=>{let b;if("string"==typeof a.data){try{b=JSON.parse(a.data)}catch{return}switch(b.type){case"output_audio_buffer.started":o(!0);break;case"output_audio_buffer.stopped":case"output_audio_buffer.cleared":o(!1)}g.event(b)}},n.ontrack=a=>{let[b]=a.streams;f.element.srcObject=b,f.listen(b)};let s=await navigator.mediaDevices.getUserMedia({audio:b.MICROPHONE_CONSTRAINTS});if(k)throw p(s),Error("Hung up before the call opened.");j=s,f.hear?.(s),n.addTrack(s.getAudioTracks()[0],s);let t=await n.createOffer();await n.setLocalDescription(t);let u=await fetch(a,{method:"POST",body:t.sdp,headers:{"Content-Type":"application/sdp",Authorization:`Bearer ${d}`}});if(!u.ok)throw Error(await c(u,e));await n.setRemoteDescription({type:"answer",sdp:await u.text()}),await r},send(a){i?.readyState==="open"&&i.send(JSON.stringify(a))},close:()=>{k=!0,p(j),j=null,i?.close(),i=null,h?.close(),h=null,f.element.srcObject=null},mute(a){for(let b of j?.getAudioTracks()??[])b.enabled=!a}}}])}];
26
+
27
+ //# sourceMappingURL=lib_realtime_12wg_dd._.js.map
@@ -0,0 +1,27 @@
1
+ module.exports=[228722,a=>{"use strict";let b={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0};async function c(a){let c=await navigator.mediaDevices.getUserMedia({audio:b}),g=new AudioContext({sampleRate:24e3});try{var h,i,j;await g.audioWorklet.addModule(f??=URL.createObjectURL(new Blob([e],{type:"application/javascript"})));let b=g.createMediaStreamSource(c),k=new AudioWorkletNode(g,d);k.port.onmessage=b=>{let c=b.data,d=new Int16Array(c.length);for(let a=0;a<c.length;a++){let b=Math.max(-1,Math.min(1,c[a]));d[a]=b<0?32768*b:32767*b}a(d)},b.connect(k);let l=g.createGain();return l.gain.value=0,k.connect(l).connect(g.destination),await g.resume(),h=c,i=g,j=k,{stream:h,setMuted(a){for(let b of h.getAudioTracks())b.enabled=!a},close(){for(let a of(j.port.onmessage=null,h.getTracks()))a.stop();i.close()}}}catch(a){for(let a of c.getTracks())a.stop();throw g.close(),a}}let d="voice-capture",e=`
2
+ class VoiceCapture extends AudioWorkletProcessor {
3
+ constructor() {
4
+ super();
5
+ this.frame = new Float32Array(1024);
6
+ this.filled = 0;
7
+ }
8
+ process(inputs) {
9
+ const input = inputs[0] && inputs[0][0];
10
+ if (!input) return true;
11
+ for (let i = 0; i < input.length; i++) {
12
+ this.frame[this.filled++] = input[i];
13
+ if (this.filled === this.frame.length) {
14
+ this.port.postMessage(this.frame.slice());
15
+ this.filled = 0;
16
+ }
17
+ }
18
+ return true;
19
+ }
20
+ }
21
+ registerProcessor("${d}", VoiceCapture);
22
+ `,f=null;a.s(["MICROPHONE_CONSTRAINTS",0,b,"PCM_SAMPLE_RATE",0,24e3,"createPcmPlayer",0,function(a,b){let{context:c,analyser:d}=a.speaker(),e=0,f=new Set;return{push(a){if(0===a.length)return;let g=c.createBuffer(1,a.length,24e3),h=g.getChannelData(0);for(let b=0;b<a.length;b++)h[b]=a[b]/32768;let i=c.createBufferSource();i.buffer=g,i.connect(d),i.onended=()=>{f.delete(i),0===f.size&&b()},e=Math.max(e,c.currentTime+.06),i.start(e),e+=g.duration,f.add(i)},stop(){for(let a of f){a.onended=null;try{a.stop()}catch{}}f.clear(),e=0},get speaking(){return f.size>0}}},"decodePcm",0,function(a){let b=atob(a),c=new Uint8Array(b.length);for(let a=0;a<b.length;a++)c[a]=b.charCodeAt(a);return new Int16Array(c.buffer,0,c.length>>1)},"encodePcm",0,function(a){let b=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),c="";for(let a=0;a<b.length;a+=32768)c+=String.fromCharCode(...b.subarray(a,a+32768));return btoa(c)},"openMicrophone",0,c])},730983,a=>{"use strict";let b={silent:{level:-1},fatal:{level:0},error:{level:0},warn:{level:1},log:{level:2},info:{level:3},success:{level:3},fail:{level:3},ready:{level:3},start:{level:3},box:{level:3},debug:{level:4},trace:{level:5},verbose:{level:1/0}};function c(a){if(null===a||"object"!=typeof a)return!1;let b=Object.getPrototypeOf(a);return(null===b||b===Object.prototype||null===Object.getPrototypeOf(b))&&!(Symbol.iterator in a)&&(!(Symbol.toStringTag in a)||"[object Module]"===Object.prototype.toString.call(a))}let d=!1,e=[];class f{options;_lastLog;_mockFn;constructor(a={}){const d=a.types||b;for(const e in this.options=((...a)=>a.reduce((a,b)=>(function a(b,d,e=".",f){if(!c(d))return a(b,{},e,f);let g=Object.assign({},d);for(let d in b){if("__proto__"===d||"constructor"===d)continue;let h=b[d];null!=h&&(f&&f(g,d,h,e)||(Array.isArray(h)&&Array.isArray(g[d])?g[d]=[...h,...g[d]]:c(h)&&c(g[d])?g[d]=a(h,g[d],(e?`${e}.`:"")+d.toString(),f):g[d]=h))}return g})(a,b,"",void 0),{}))({...a,defaults:{...a.defaults},level:g(a.level,d),reporters:[...a.reporters||[]]},{types:b,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}}),d){const a={type:e,...this.options.defaults,...d[e]};this[e]=this._wrapLogFn(a),this[e].raw=this._wrapLogFn(a,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(a){this.options.level=g(a,this.options.types,this.options.level)}prompt(a,b){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(a,b)}create(a){let b=new f({...this.options,...a});return this._mockFn&&b.mockTypes(this._mockFn),b}withDefaults(a){return this.create({...this.options,defaults:{...this.options.defaults,...a}})}withTag(a){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+a:a})}addReporter(a){return this.options.reporters.push(a),this}removeReporter(a){if(a){let b=this.options.reporters.indexOf(a);if(-1!==b)return this.options.reporters.splice(b,1)}else this.options.reporters.splice(0);return this}setReporters(a){return this.options.reporters=Array.isArray(a)?a:[a],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let a in this.options.types)console["__"+a]||(console["__"+a]=console[a]),console[a]=this[a].raw}restoreConsole(){for(let a in this.options.types)console["__"+a]&&(console[a]=console["__"+a],delete console["__"+a])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(a,b){a&&(a.__write||(a.__write=a.write),a.write=a=>{this[b].raw(String(a).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(a){a&&a.__write&&(a.write=a.__write,delete a.__write)}pauseLogs(){d=!0}resumeLogs(){for(let a of(d=!1,e.splice(0)))a[0]._logFn(a[1],a[2])}mockTypes(a){let b=a||this.options.mockFn;if(this._mockFn=b,"function"==typeof b)for(let a in this.options.types)this[a]=b(a,this.options.types[a])||this[a],this[a].raw=this[a]}_wrapLogFn(a,b){return(...c)=>d?void e.push([this,a,c,b]):this._logFn(a,c,b)}_logFn(a,b,c){var d,e;if((a.level||0)>this.level)return!1;let f={date:new Date,args:[],...a,level:g(a.level,this.options.types)};c||1!==b.length||+(e=d=b[0],"[object Object]"!==Object.prototype.toString.call(e)||!d.message&&!d.args||!!d.stack)?f.args=[...b]:Object.assign(f,b[0]),f.message&&(f.args.unshift(f.message),delete f.message),f.additional&&(Array.isArray(f.additional)||(f.additional=f.additional.split("\n")),f.args.push("\n"+f.additional.join("\n")),delete f.additional),f.type="string"==typeof f.type?f.type.toLowerCase():"log",f.tag="string"==typeof f.tag?f.tag:"";let h=(a=!1)=>{let b=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&b>0){let a=[...this._lastLog.object.args];b>1&&a.push(`(repeated ${b} times)`),this._log({...this._lastLog.object,args:a}),this._lastLog.count=1}a&&(this._lastLog.object=f,this._log(f))};clearTimeout(this._lastLog.timeout);let i=this._lastLog.time&&f.date?f.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=f.date,i<this.options.throttle)try{let a=JSON.stringify([f.type,f.tag,f.args]),b=this._lastLog.serialized===a;if(this._lastLog.serialized=a,b&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(h,this.options.throttle);return}}catch{}h(!0)}_log(a){for(let b of this.options.reporters)b.log(a,{options:this.options})}}function g(a,b={},c=3){return void 0===a?c:"number"==typeof a?a:b[a]&&void 0!==b[a].level?b[a].level:c}f.prototype.add=f.prototype.addReporter,f.prototype.remove=f.prototype.removeReporter,f.prototype.clear=f.prototype.removeReporter,f.prototype.withScope=f.prototype.withTag,f.prototype.mock=f.prototype.mockTypes,f.prototype.pause=f.prototype.pauseLogs,f.prototype.resume=f.prototype.resumeLogs;var h,i,j=a.i(812057),k=a.i(750227);function l(a,b){let c=process.cwd()+k.sep;return a.split("\n").splice(b.split("\n").length).map(a=>a.trim().replace("file://","").replace(c,""))}let m=a=>a?`[${a}]`:"";class n{formatStack(a,b,c){let d=" ".repeat((c?.errorLevel||0)+1);return d+l(a,b).join(`
23
+ ${d}`)}formatError(a,b){let c=a.message??(0,j.formatWithOptions)(b,a),d=a.stack?this.formatStack(a.stack,c,b):"",e=b?.errorLevel||0;return(e>0?`${" ".repeat(e)}[cause]: `:"")+c+"\n"+d+(a.cause?"\n\n"+this.formatError(a.cause,{...b,errorLevel:e+1}):"")}formatArgs(a,b){let c=a.map(a=>a&&"string"==typeof a.stack?this.formatError(a,b):a);return(0,j.formatWithOptions)(b,...c)}formatDate(a,b){return b.date?a.toLocaleTimeString():""}filterAndJoin(a){return a.filter(Boolean).join(" ")}formatLogObj(a,b){let c=this.formatArgs(a.args,b);return"box"===a.type?"\n"+[m(a.tag),a.title&&a.title,...c.split("\n")].filter(Boolean).map(a=>" > "+a).join("\n")+"\n":this.filterAndJoin([m(a.type),m(a.tag),c])}log(a,b){var c,d;return c=this.formatLogObj(a,{columns:b.options.stdout.columns||0,...b.options.formatOptions})+"\n",((d=a.level<2?b.options.stderr||process.stderr:b.options.stdout||process.stdout).__write||d.write).call(d,c)}}var o=a.i(59639),p=a.i(509656);let{env:q={},argv:r=[],platform:s=""}="u"<typeof process?{}:process,t="NO_COLOR"in q||r.includes("--no-color"),u="FORCE_COLOR"in q||r.includes("--color"),v="dumb"===q.TERM,w=p&&p.isatty&&p.isatty(1)&&q.TERM&&!v,x="CI"in q&&("GITHUB_ACTIONS"in q||"GITLAB_CI"in q||"CIRCLECI"in q),y=!t&&(u||"win32"===s&&!v||w||x);function z(a,b,c){return function(a,b,c=a,d=a.length+1){return e=>{var f;return e||""!==e&&void 0!==e?(f=(""+e).indexOf(b,d),f<0?a+e+b:a+function a(b,c,d,e,f=c.slice(0,Math.max(0,b))+e,g=c.slice(Math.max(0,b+d.length)),h=g.indexOf(d)){return f+(h<0?g:a(h,g,d,e))}(f,e,b,c)+b):""}}(`\x1b[${a}m`,`\x1b[${b}m`,c)}let A={reset:z(0,0),bold:z(1,22,"\x1b[22m\x1b[1m"),dim:z(2,22,"\x1b[22m\x1b[2m"),italic:z(3,23),underline:z(4,24),inverse:z(7,27),hidden:z(8,28),strikethrough:z(9,29),black:z(30,39),red:z(31,39),green:z(32,39),yellow:z(33,39),blue:z(34,39),magenta:z(35,39),cyan:z(36,39),white:z(37,39),gray:z(90,39),bgBlack:z(40,49),bgRed:z(41,49),bgGreen:z(42,49),bgYellow:z(43,49),bgBlue:z(44,49),bgMagenta:z(45,49),bgCyan:z(46,49),bgWhite:z(47,49),blackBright:z(90,39),redBright:z(91,39),greenBright:z(92,39),yellowBright:z(93,39),blueBright:z(94,39),magentaBright:z(95,39),cyanBright:z(96,39),whiteBright:z(97,39),bgBlackBright:z(100,49),bgRedBright:z(101,49),bgGreenBright:z(102,49),bgYellowBright:z(103,49),bgBlueBright:z(104,49),bgMagentaBright:z(105,49),bgCyanBright:z(106,49),bgWhiteBright:z(107,49)},B=function(a=y){return a?A:Object.fromEntries(Object.keys(A).map(a=>[a,String]))}();function C(a,b="reset"){return B[a]||B[b]}let D=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function E(a){return a.replace(RegExp(D,"g"),"")}let F={solid:{tl:"┌",tr:"┐",bl:"└",br:"┘",h:"─",v:"│"},double:{tl:"╔",tr:"╗",bl:"╚",br:"╝",h:"═",v:"║"},doubleSingle:{tl:"╓",tr:"╖",bl:"╙",br:"╜",h:"─",v:"║"},doubleSingleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"║"},singleThick:{tl:"┏",tr:"┓",bl:"┗",br:"┛",h:"━",v:"┃"},singleDouble:{tl:"╒",tr:"╕",bl:"╘",br:"╛",h:"═",v:"│"},singleDoubleRounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"═",v:"│"},rounded:{tl:"╭",tr:"╮",bl:"╰",br:"╯",h:"─",v:"│"}},G={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};var H={get url(){return a.F("node_modules/consola/dist/index.mjs")},env:{DEV:!1,PROD:!0,MODE:"production",BASE_URL:"/",SSR:!0}};let I=Object.create(null),J=a=>globalThis.process?.env||H.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(a?I:globalThis),K=new Proxy(I,{get:(a,b)=>J()[b]??I[b],has:(a,b)=>b in J()||b in I,set:(a,b,c)=>(J(!0)[b]=c,!0),deleteProperty(a,b){if(!b)return!1;let c=J(!0);return delete c[b],!0},ownKeys:()=>Object.keys(J(!0))}),L="u">typeof process&&process.env&&"production"||"",M=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]],N=function(){if(globalThis.process?.env)for(let a of M){let b=a[1]||a[0];if(globalThis.process?.env[b])return{name:a[0].toLowerCase(),...a[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}();function O(a){return!!a&&"false"!==a}N.name;let P=globalThis.process?.platform||"",Q=O(K.CI)||!1!==N.ci,R=O(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),S=O(K.DEBUG),T="test"===L||O(K.TEST);O(K.MINIMAL);let U=/^win/i.test(P);!O(K.NO_COLOR)&&(O(K.FORCE_COLOR)||(R||U)&&K.TERM);let V=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;V?.split(".")[0];let W=globalThis.process||Object.create(null),X={versions:{}};new Proxy(W,{get:(a,b)=>"env"===b?K:b in a?a[b]:b in X?X[b]:void 0});let Y=globalThis.process?.release?.name==="node",Z=!!globalThis.Bun||!!globalThis.process?.versions?.bun,$=!!globalThis.Deno,_=!!globalThis.fastly,aa=[[!!globalThis.Netlify,"netlify"],[!!globalThis.EdgeRuntime,"edge-light"],[globalThis.navigator?.userAgent==="Cloudflare-Workers","workerd"],[_,"fastly"],[$,"deno"],[Z,"bun"],[Y,"node"]],ab=function(){let a=aa.find(a=>a[0]);if(a)return{name:a[1]}}();ab?.name;let ac=function({onlyFirst:a=!1}={}){return RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))",a?void 0:"g")}(),ad=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,ae=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:a=>a.split("")},af=/^\p{Default_Ignorable_Code_Point}$/u,ag={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},ah={0:"red",1:"yellow"},ai=function(){let{env:a}=o.default,{TERM:b,TERM_PROGRAM:c}=a;return"win32"!==o.default.platform?"linux"!==b:!!a.WT_SESSION||!!a.TERMINUS_SUBLIME||"{cmd::Cmder}"===a.ConEmuTask||"Terminus-Sublime"===c||"vscode"===c||"xterm-256color"===b||"alacritty"===b||"rxvt-unicode"===b||"rxvt-unicode-256color"===b||"JetBrains-JediTerm"===a.TERMINAL_EMULATOR}(),aj=(a,b)=>ai?a:b,ak={error:aj("✖","×"),fatal:aj("✖","×"),ready:aj("✔","√"),warn:aj("⚠","‼"),info:aj("ℹ","i"),success:aj("✔","√"),debug:aj("⚙","D"),trace:aj("→","→"),fail:aj("✖","×"),start:aj("◐","o"),log:""};function al(a){return"object"==typeof Intl&&Intl.Segmenter?function(a,b={}){if("string"!=typeof a||0===a.length)return 0;let{ambiguousIsNarrow:c=!0,countAnsiEscapeCodes:d=!1}=b;if(d||(a=function(a){if("string"!=typeof a)throw TypeError(`Expected a \`string\`, got \`${typeof a}\``);return a.replace(ac,"")}(a)),0===a.length)return 0;let e=0,f={ambiguousAsWide:!c};for(let{segment:b}of ae.segment(a)){let a=b.codePointAt(0);if(!(a<=31)&&(!(a>=127)||!(a<=159))&&(!(a>=8203)||!(a<=8207))&&65279!==a&&(!(a>=768)||!(a<=879))&&(!(a>=6832)||!(a<=6911))&&(!(a>=7616)||!(a<=7679))&&(!(a>=8400)||!(a<=8447))&&(!(a>=65056)||!(a<=65071))&&(!(a>=55296)||!(a<=57343))&&(!(a>=65024)||!(a<=65039))&&!af.test(b)){if(ad().test(b)){e+=2;continue}e+=function(a,{ambiguousAsWide:b=!1}={}){var c;if(!Number.isSafeInteger(a))throw TypeError(`Expected a code point, got \`${typeof a}\`.`);return 12288===a||a>=65281&&a<=65376||a>=65504&&a<=65510||(c=a)>=4352&&c<=4447||8986===c||8987===c||9001===c||9002===c||c>=9193&&c<=9196||9200===c||9203===c||9725===c||9726===c||9748===c||9749===c||c>=9776&&c<=9783||c>=9800&&c<=9811||9855===c||c>=9866&&c<=9871||9875===c||9889===c||9898===c||9899===c||9917===c||9918===c||9924===c||9925===c||9934===c||9940===c||9962===c||9970===c||9971===c||9973===c||9978===c||9981===c||9989===c||9994===c||9995===c||10024===c||10060===c||10062===c||c>=10067&&c<=10069||10071===c||c>=10133&&c<=10135||10160===c||10175===c||11035===c||11036===c||11088===c||11093===c||c>=11904&&c<=11929||c>=11931&&c<=12019||c>=12032&&c<=12245||c>=12272&&c<=12287||c>=12289&&c<=12350||c>=12353&&c<=12438||c>=12441&&c<=12543||c>=12549&&c<=12591||c>=12593&&c<=12686||c>=12688&&c<=12773||c>=12783&&c<=12830||c>=12832&&c<=12871||c>=12880&&c<=42124||c>=42128&&c<=42182||c>=43360&&c<=43388||c>=44032&&c<=55203||c>=63744&&c<=64255||c>=65040&&c<=65049||c>=65072&&c<=65106||c>=65108&&c<=65126||c>=65128&&c<=65131||c>=94176&&c<=94180||94192===c||94193===c||c>=94208&&c<=100343||c>=100352&&c<=101589||c>=101631&&c<=101640||c>=110576&&c<=110579||c>=110581&&c<=110587||110589===c||110590===c||c>=110592&&c<=110882||110898===c||c>=110928&&c<=110930||110933===c||c>=110948&&c<=110951||c>=110960&&c<=111355||c>=119552&&c<=119638||c>=119648&&c<=119670||126980===c||127183===c||127374===c||c>=127377&&c<=127386||c>=127488&&c<=127490||c>=127504&&c<=127547||c>=127552&&c<=127560||127568===c||127569===c||c>=127584&&c<=127589||c>=127744&&c<=127776||c>=127789&&c<=127797||c>=127799&&c<=127868||c>=127870&&c<=127891||c>=127904&&c<=127946||c>=127951&&c<=127955||c>=127968&&c<=127984||127988===c||c>=127992&&c<=128062||128064===c||c>=128066&&c<=128252||c>=128255&&c<=128317||c>=128331&&c<=128334||c>=128336&&c<=128359||128378===c||128405===c||128406===c||128420===c||c>=128507&&c<=128591||c>=128640&&c<=128709||128716===c||c>=128720&&c<=128722||c>=128725&&c<=128727||c>=128732&&c<=128735||128747===c||128748===c||c>=128756&&c<=128764||c>=128992&&c<=129003||129008===c||c>=129292&&c<=129338||c>=129340&&c<=129349||c>=129351&&c<=129535||c>=129648&&c<=129660||c>=129664&&c<=129673||c>=129679&&c<=129734||c>=129742&&c<=129756||c>=129759&&c<=129769||c>=129776&&c<=129784||c>=131072&&c<=196605||c>=196608&&c<=262141||b&&(161===a||164===a||167===a||168===a||170===a||173===a||174===a||a>=176&&a<=180||a>=182&&a<=186||a>=188&&a<=191||198===a||208===a||215===a||216===a||a>=222&&a<=225||230===a||a>=232&&a<=234||236===a||237===a||240===a||242===a||243===a||a>=247&&a<=250||252===a||254===a||257===a||273===a||275===a||283===a||294===a||295===a||299===a||a>=305&&a<=307||312===a||a>=319&&a<=322||324===a||a>=328&&a<=331||333===a||338===a||339===a||358===a||359===a||363===a||462===a||464===a||466===a||468===a||470===a||472===a||474===a||476===a||593===a||609===a||708===a||711===a||a>=713&&a<=715||717===a||720===a||a>=728&&a<=731||733===a||735===a||a>=768&&a<=879||a>=913&&a<=929||a>=931&&a<=937||a>=945&&a<=961||a>=963&&a<=969||1025===a||a>=1040&&a<=1103||1105===a||8208===a||a>=8211&&a<=8214||8216===a||8217===a||8220===a||8221===a||a>=8224&&a<=8226||a>=8228&&a<=8231||8240===a||8242===a||8243===a||8245===a||8251===a||8254===a||8308===a||8319===a||a>=8321&&a<=8324||8364===a||8451===a||8453===a||8457===a||8467===a||8470===a||8481===a||8482===a||8486===a||8491===a||8531===a||8532===a||a>=8539&&a<=8542||a>=8544&&a<=8555||a>=8560&&a<=8569||8585===a||a>=8592&&a<=8601||8632===a||8633===a||8658===a||8660===a||8679===a||8704===a||8706===a||8707===a||8711===a||8712===a||8715===a||8719===a||8721===a||8725===a||8730===a||a>=8733&&a<=8736||8739===a||8741===a||a>=8743&&a<=8748||8750===a||a>=8756&&a<=8759||8764===a||8765===a||8776===a||8780===a||8786===a||8800===a||8801===a||a>=8804&&a<=8807||8810===a||8811===a||8814===a||8815===a||8834===a||8835===a||8838===a||8839===a||8853===a||8857===a||8869===a||8895===a||8978===a||a>=9312&&a<=9449||a>=9451&&a<=9547||a>=9552&&a<=9587||a>=9600&&a<=9615||a>=9618&&a<=9621||9632===a||9633===a||a>=9635&&a<=9641||9650===a||9651===a||9654===a||9655===a||9660===a||9661===a||9664===a||9665===a||a>=9670&&a<=9672||9675===a||a>=9678&&a<=9681||a>=9698&&a<=9701||9711===a||9733===a||9734===a||9737===a||9742===a||9743===a||9756===a||9758===a||9792===a||9794===a||9824===a||9825===a||a>=9827&&a<=9829||a>=9831&&a<=9834||9836===a||9837===a||9839===a||9886===a||9887===a||9919===a||a>=9926&&a<=9933||a>=9935&&a<=9939||a>=9941&&a<=9953||9955===a||9960===a||9961===a||a>=9963&&a<=9969||9972===a||a>=9974&&a<=9977||9979===a||9980===a||9982===a||9983===a||10045===a||a>=10102&&a<=10111||a>=11094&&a<=11097||a>=12872&&a<=12879||a>=57344&&a<=63743||a>=65024&&a<=65039||65533===a||a>=127232&&a<=127242||a>=127248&&a<=127277||a>=127280&&a<=127337||a>=127344&&a<=127373||127375===a||127376===a||a>=127387&&a<=127404||a>=917760&&a<=917999||a>=983040&&a<=1048573||a>=1048576&&a<=1114109)?2:1}(a,f)}}return e}(a):E(a).length}class am extends n{formatStack(a,b,c){let d=" ".repeat((c?.errorLevel||0)+1);return`
24
+ ${d}`+l(a,b).map(a=>" "+a.replace(/^at +/,a=>B.gray(a)).replace(/\((.+)\)/,(a,b)=>`(${B.cyan(b)})`)).join(`
25
+ ${d}`)}formatType(a,b,c){let d=ag[a.type]||ah[a.level]||"gray";if(b)return(function(a="bgWhite"){return B[`bg${a[0].toUpperCase()}${a.slice(1)}`]||B.bgWhite})(d)(B.black(` ${a.type.toUpperCase()} `));let e="string"==typeof ak[a.type]?ak[a.type]:a.icon||a.type;return e?(function(a="white"){return B[a]||B.white})(d)(e):""}formatLogObj(a,b){let c,[d,...e]=this.formatArgs(a.args,b).split("\n");if("box"===a.type)return function(a,b={}){let c={...b,style:{...G,...b.style}},d=a.split("\n"),e=[],f=C(c.style.borderColor),g={..."string"==typeof c.style.borderStyle?F[c.style.borderStyle]||F.solid:c.style.borderStyle};if(f)for(let a in g)g[a]=f(g[a]);let h=c.style.padding%2==0?c.style.padding:c.style.padding+1,i=d.length+h,j=Math.max(...d.map(a=>E(a).length),c.title?E(c.title).length:0)+h,k=j+h,l=c.style.marginLeft>0?" ".repeat(c.style.marginLeft):"";if(c.style.marginTop>0&&e.push("".repeat(c.style.marginTop)),c.title){let a=f?f(c.title):c.title,b=g.h.repeat(Math.floor((j-E(c.title).length)/2)),d=g.h.repeat(j-E(c.title).length-E(b).length+h);e.push(`${l}${g.tl}${b}${a}${d}${g.tr}`)}else e.push(`${l}${g.tl}${g.h.repeat(k)}${g.tr}`);let m="center"===c.style.valign?Math.floor((i-d.length)/2):"top"===c.style.valign?i-d.length-h:i-d.length;for(let a=0;a<i;a++)if(a<m||a>=m+d.length)e.push(`${l}${g.v}${" ".repeat(k)}${g.v}`);else{let b=d[a-m],c=" ".repeat(h),f=" ".repeat(j-E(b).length);e.push(`${l}${g.v}${c}${b}${f}${g.v}`)}return e.push(`${l}${g.bl}${g.h.repeat(k)}${g.br}`),c.style.marginBottom>0&&e.push("".repeat(c.style.marginBottom)),e.join("\n")}(an(d+(e.length>0?"\n"+e.join("\n"):"")),{title:a.title?an(a.title):void 0,style:a.style});let f=this.formatDate(a.date,b),g=f&&B.gray(f),h=a.badge??a.level<2,i=this.formatType(a,h,b),j=a.tag?B.gray(a.tag):"",k=this.filterAndJoin([i,an(d)]),l=this.filterAndJoin(b.columns?[j,g]:[j]),m=(b.columns||0)-al(k)-al(l)-2;if(c=(m>0&&(b.columns||0)>=80?k+" ".repeat(m)+l:(l?`${B.gray(`[${l}]`)} `:"")+k)+an(e.length>0?"\n"+e.join("\n"):""),"trace"===a.type){let b=Error("Trace: "+a.message);c+=this.formatStack(b.stack||"",b.message)}return h?"\n"+c+"\n":c}}function an(a){return a.replace(/`([^`]+)`/gm,(a,b)=>B.cyan(b)).replace(/\s+_([^_]+)_\s+/gm,(a,b)=>` ${B.underline(b)} `)}function ao(b={}){let c=S?4:T?1:3;return process.env.CONSOLA_LEVEL&&(c=Number.parseInt(process.env.CONSOLA_LEVEL)??c),function(a={}){return new f(a)}({level:c,defaults:{level:c},stdout:process.stdout,stderr:process.stderr,prompt:(...b)=>a.A(715837).then(a=>a.prompt(...b)),reporters:b.reporters||[b.fancy??!(Q||T)?new am:new n],...b})}ao();var ap=a.i(287702);let aq=ao({level:ap.IS_DEV?4:3}),ar=(h=ap.APP_NAME,aq.withDefaults({message:(i=`${h}: `,C("blackBright")(i))}));var as=a.i(497895);a.s(["realtimeSession",0,function(a){return({credential:b,setup:c,audio:d,on:e})=>{let f=!1,g=null,h=null,i=new Set,j=[],k=new Map,l=new Set,m=(a,b)=>{k.has(a)||(k.set(a,j.length),j.push({id:a,role:b,text:""}))},n=(a,b)=>{let c=j[a];c.text.trim()&&e.turn({...c,seq:a,done:b})},o=(a,b,c,d)=>{m(a,b);let e=k.get(a),f=j[e].text,g="append"===d?f+c:c;g!==f&&(j[e]={...j[e],text:g},l.has(a)||n(e,!1))},p=a=>{let b=k.get(a);void 0===b||l.has(a)||j[b].text.trim()&&(l.add(a),n(b,!0))},q=!1,r=!1,s=!1,t=!1,u=null,v=null,w=new Map,x=0,y=!1,z=[],A=[],B="",C=()=>{u&&clearTimeout(u),u=null},D=()=>{v&&clearTimeout(v),v=null},E=()=>{if(f)return;let a=w.size>0||y||x>0,b={speaking:q,hearing:r,tools:a?z:[]},c=JSON.stringify(b);if(c!==B&&(B=c,e.activity(b)),r||s||u||q||w.size>0)return;let d=x>0;if(d||0!==A.length){for(let a of A.splice(0))F.send({type:"conversation.item.create",item:{type:"message",role:"system",content:[{type:"input_text",text:a}]}});x=0,y=d,s=!0,t=!0,D(),v=setTimeout(()=>{v=null,t&&(t=!1,s=!1,e.warn("The voice API never answered a response we asked for."),E())},5e3),F.send({type:"response.create"})}},F=a.transport({credential:b,setup:c,audio:d,on:{event:a=>{switch(a.type){case"session.updated":g?.resolve();break;case"error":{let b=a.error?.message??"The voice API reported an error";t&&(t=!1,s=!1,D()),g?g.reject(Error(b)):e.warn(b);break}case"input_audio_buffer.speech_started":r=!0,C();break;case"input_audio_buffer.speech_stopped":r=!1,C(),u=setTimeout(()=>{u=null,E()},1500);break;case"input_audio_buffer.committed":m(a.item_id,"user");break;case"conversation.item.added":case"conversation.item.created":"message"===a.item.type&&"system"!==a.item.role&&m(a.item.id,a.item.role);break;case"response.output_item.added":"message"===a.item.type?m(a.item.id,"assistant"):"function_call"===a.item.type&&m(a.item.id,"tool");break;case"conversation.item.input_audio_transcription.delta":o(a.item_id,"user",a.delta??"","append");break;case"conversation.item.input_audio_transcription.updated":o(a.item_id,"user",a.transcript,"replace");break;case"conversation.item.input_audio_transcription.completed":o(a.item_id,"user",a.transcript??"","replace"),"in_progress"!==a.status&&p(a.item_id);break;case"conversation.item.input_audio_transcription.failed":e.warn(a.error?.message?`That turn could not be transcribed: ${a.error.message}`:"That turn could not be transcribed.");break;case"response.output_audio_transcript.delta":o(a.item_id,"assistant",a.delta,"append");break;case"response.output_audio_transcript.done":a.transcript&&o(a.item_id,"assistant",a.transcript,"replace"),p(a.item_id);break;case"response.created":s=!0,t=!1,D(),C();break;case"response.done":var b;for(let c of(s=!1,y=!1,"failed"===a.response.status&&e.warn((b=a.response,b.status_details?.error?.message??"The model could not finish answering")),a.response.output??[]))"message"===c.type&&p(c.id);for(let[a,b]of j.entries())"user"!==b.role||l.has(b.id)||n(a,!0);break;case"response.function_call_arguments.done":m(a.item_id,"tool");{let b=k.get(a.item_id);j[b]={...j[b],tool:a.name,text:a.arguments||"{}"}}p(a.item_id),0!==w.size||y||(z=[]),z=[...z,a.name],w.set(a.call_id,a.name),e.runTool({id:a.call_id,name:a.name,arguments:a.arguments}).catch(a=>`Error: ${(0,as.errorToString)(a)}`).then(b=>{f||(F.send({type:"conversation.item.create",item:{type:"function_call_output",call_id:a.call_id,output:b}}),w.delete(a.call_id),x+=1,E())});break;default:i.has(a.type)||(i.add(a.type),ar.debug(`realtime: no case for ${a.type}`))}E()},playing:a=>{q=a,a&&(y=!1),E()},dropped:a=>{g?g.reject(Error(a)):e.failed(a)}}});return{async connect(){if(await F.connect(),f)throw Error("Hung up before the session opened.");F.send(a.sessionUpdate(c)),await new Promise((a,b)=>{g={resolve:a,reject:b},h=setTimeout(a,5e3)}).finally(()=>{g=null,h&&clearTimeout(h),h=null})},close(){for(let a of j)p(a.id);f=!0,C(),D(),g?.reject(Error("Hung up before the session opened.")),F.close()},mute:a=>F.mute(a),say(a){f||(A.push(a),E())}}}},"toFunctionTools",0,a=>a.map(({name:a,description:b,parameters:c})=>({type:"function",name:a,description:b,parameters:c}))],730983)},100031,a=>{"use strict";var b=a.i(228722);async function c(a,b){let c=await a.text().catch(()=>"");try{let a=JSON.parse(c)?.error?.message;if("string"==typeof a&&a)return a}catch{}return`${b} refused the call (${a.status})`}a.s(["createSocketTransport",0,function({url:a,protocols:c,label:d,audio:e,on:f}){let g=null,h=null,i=null,j=!1,k=!1,l=!1,m=!1,n=null,o=a=>{m!==a&&(m=a,f.playing(a))},p=a=>{g?.readyState===WebSocket.OPEN&&g.send(JSON.stringify(a))};return{async connect(){i=(0,b.createPcmPlayer)(e,()=>{n=null,o(!1)});let m=new Promise((b,e)=>{let h=new WebSocket(a,c);g=h,h.onopen=()=>{l=!0,b(h)};let i=a=>l?void(!j&&!k&&(k=!0,f.dropped(a))):e(Error(a));h.onerror=()=>i(`Could not reach ${d}`),h.onclose=a=>i(a.reason||`The connection to ${d} closed (${a.code})`)}),q=(0,b.openMicrophone)(a=>p({type:"input_audio_buffer.append",audio:(0,b.encodePcm)(a)})).then(a=>{j?a.close():(h=a,e.hear?.(a.stream))},a=>{throw Error(a instanceof Error?`Microphone unavailable — ${a.message}`:"Microphone unavailable")}),[r]=await Promise.all([m,q]);if(j)throw Error("Hung up before the call opened.");r.onmessage=a=>{let c;if("string"==typeof a.data){try{c=JSON.parse(a.data)}catch{return}var d=c;switch(d.type){case"response.output_audio.delta":{if(!i||!d.delta)break;let a=(0,b.decodePcm)(d.delta);n?.itemId!==d.item_id&&(n={itemId:d.item_id,contentIndex:d.content_index??0,startedAt:performance.now(),receivedMs:0}),n.receivedMs+=a.length/b.PCM_SAMPLE_RATE*1e3,i.push(a),o(!0);break}case"input_audio_buffer.speech_started":(()=>{if(!i?.speaking||!n)return;let a=Math.min(n.receivedMs,performance.now()-n.startedAt);p({type:"conversation.item.truncate",item_id:n.itemId,content_index:n.contentIndex,audio_end_ms:Math.max(0,Math.floor(a))}),i.stop(),n=null,o(!1)})()}f.event(d)}}},send:p,close:()=>{j=!0,i?.stop(),i=null,h?.close(),h=null;let a=g;g=null,a?.close()},mute(a){h?.setMuted(a)}}},"createWebRtcTransport",0,function({url:a,secret:d,label:e,audio:f,on:g}){let h=null,i=null,j=null,k=!1,l=!1,m=!1,n=!1,o=a=>{n!==a&&(n=a,g.playing(a))},p=a=>{for(let b of a?.getTracks()??[])b.stop()};return{async connect(){let n=new RTCPeerConnection;h=n;let q=n.createDataChannel("oai-events");i=q;let r=new Promise((a,b)=>{let c=a=>l?void(!k&&!m&&(m=!0,g.dropped(a))):b(Error(a));q.onopen=()=>{l=!0,a()},q.onclose=()=>c(`The connection to ${e} closed`),q.onerror=()=>c(`The connection to ${e} dropped`),n.onconnectionstatechange=()=>{let a=n.connectionState;("failed"===a||"closed"===a)&&c(`Could not reach ${e}`)}});q.onmessage=a=>{let b;if("string"==typeof a.data){try{b=JSON.parse(a.data)}catch{return}switch(b.type){case"output_audio_buffer.started":o(!0);break;case"output_audio_buffer.stopped":case"output_audio_buffer.cleared":o(!1)}g.event(b)}},n.ontrack=a=>{let[b]=a.streams;f.element.srcObject=b,f.listen(b)};let s=await navigator.mediaDevices.getUserMedia({audio:b.MICROPHONE_CONSTRAINTS});if(k)throw p(s),Error("Hung up before the call opened.");j=s,f.hear?.(s),n.addTrack(s.getAudioTracks()[0],s);let t=await n.createOffer();await n.setLocalDescription(t);let u=await fetch(a,{method:"POST",body:t.sdp,headers:{"Content-Type":"application/sdp",Authorization:`Bearer ${d}`}});if(!u.ok)throw Error(await c(u,e));await n.setRemoteDescription({type:"answer",sdp:await u.text()}),await r},send(a){i?.readyState==="open"&&i.send(JSON.stringify(a))},close:()=>{k=!0,p(j),j=null,i?.close(),i=null,h?.close(),h=null,f.element.srcObject=null},mute(a){for(let b of j?.getAudioTracks()??[])b.enabled=!a}}}])}];
26
+
27
+ //# sourceMappingURL=lib_realtime_15h_v1v._.js.map
@@ -1,3 +1,3 @@
1
1
  module.exports=[529285,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_00ptcss._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(726362)))},568773,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1p161c7._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(702288)))},409811,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0xbyurn._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(33048)))},879004,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0mkvkrn._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(959346)))},240897,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_10l-aox._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(78860)))},979209,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_11iptmm._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(731813)))},265949,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0c6uq4c._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(995889)))},788089,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0d8brvh._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(580288)))},414059,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1lr-xqr._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(566552)))},158161,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1t9e3ef._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(931663)))},621173,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0_iovbk._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(493860)))},594722,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1_98arq._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(337649)))},685272,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_183vuvb._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(898437)))},219771,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0ha29gs._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(650794)))},510010,a=>{a.v(b=>Promise.all(["server/chunks/ssr/node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0a2p_6-._.js","server/chunks/ssr/1daa_@mermaid-js_parser_dist_chunks_mermaid-parser_core_chunk-FOHPRMQF_mjs_0ybwfeq._.js"].map(b=>a.l(b))).then(()=>b(613650)))},361055,a=>{"use strict";function b(a,b){a.accDescr&&b.setAccDescription?.(a.accDescr),a.accTitle&&b.setAccTitle?.(a.accTitle),a.title&&b.setDiagramTitle?.(a.title)}(0,a.i(539110).__name)(b,"populateCommonDb"),a.s(["populateCommonDb",0,b])}];
2
2
 
3
- //# sourceMappingURL=node_modules_1d-is1o._.js.map
3
+ //# sourceMappingURL=node_modules_063xwpp._.js.map