thursday-agent 0.18.0 → 0.19.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 (342) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +3 -2
  3. package/.next/build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/routes-manifest.json +22 -12
  6. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next/server/app/_global-error.html +1 -1
  8. package/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +12 -12
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +12 -12
  17. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +11 -11
  18. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/server/app/api/artifact/route.js +6 -6
  20. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  21. package/.next/server/app/api/bot/memory/files/route.js +1 -1
  22. package/.next/server/app/api/bot/memory/files/route.js.nft.json +1 -1
  23. package/.next/server/app/api/bot/memory/route.js +3 -3
  24. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bot/route.js +3 -3
  26. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  27. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  28. package/.next/server/app/api/bot/thread/file/route.js +17 -17
  29. package/.next/server/app/api/bot/thread/file/route.js.nft.json +1 -1
  30. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  31. package/.next/server/app/api/config/route.js.nft.json +1 -1
  32. package/.next/server/app/api/events/route.js +2 -2
  33. package/.next/server/app/api/events/route.js.nft.json +1 -1
  34. package/.next/server/app/api/favicon/[host]/route.js.nft.json +1 -1
  35. package/.next/server/app/api/file/[...path]/route.js +2 -2
  36. package/.next/server/app/api/file/[...path]/route.js.nft.json +1 -1
  37. package/.next/server/app/api/llm-model/automatic/route.js +2 -2
  38. package/.next/server/app/api/llm-model/automatic/route.js.nft.json +1 -1
  39. package/.next/server/app/api/llm-model/catalog/[provider]/route/app-paths-manifest.json +3 -0
  40. package/.next/server/app/api/llm-model/catalog/{route.js → [provider]/route.js} +7 -7
  41. package/.next/server/app/api/llm-model/catalog/[provider]/route.js.nft.json +1 -0
  42. package/.next/server/app/api/llm-model/catalog/[provider]/route_client-reference-manifest.js +3 -0
  43. package/.next/server/app/api/llm-model/credits/[provider]/route/app-paths-manifest.json +3 -0
  44. package/.next/server/app/api/llm-model/credits/{route.js → [provider]/route.js} +7 -7
  45. package/.next/server/app/api/llm-model/credits/[provider]/route.js.nft.json +1 -0
  46. package/.next/server/app/api/llm-model/credits/[provider]/route_client-reference-manifest.js +3 -0
  47. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  48. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  49. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  50. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  51. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  52. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  53. package/.next/server/app/api/memory/edit/route.js +12 -12
  54. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  55. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  56. package/.next/server/app/api/reach/route.js +16 -16
  57. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  58. package/.next/server/app/api/routine/route.js +5 -5
  59. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  60. package/.next/server/app/api/running/route/app-paths-manifest.json +3 -0
  61. package/.next/server/app/api/running/route/build-manifest.json +12 -0
  62. package/.next/server/app/api/running/route/server-reference-manifest.json +4 -0
  63. package/.next/server/app/api/running/route.js +10 -0
  64. package/.next/server/app/api/running/route.js.map +5 -0
  65. package/.next/server/app/api/running/route.js.nft.json +1 -0
  66. package/.next/server/app/api/running/route_client-reference-manifest.js +3 -0
  67. package/.next/server/app/api/signins/route.js +4 -4
  68. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  69. package/.next/server/app/api/skills/[source]/[name]/route.js +6 -6
  70. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  71. package/.next/server/app/api/skills/route.js +6 -6
  72. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  73. package/.next/server/app/api/thursday/call/end/route.js.nft.json +1 -1
  74. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  75. package/.next/server/app/api/thursday/settings/route.js.nft.json +1 -1
  76. package/.next/server/app/api/thursday/text/route.js +12 -12
  77. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  78. package/.next/server/app/api/thursday/tool-call/route.js +12 -12
  79. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  80. package/.next/server/app/api/workspace/files/route.js +6 -6
  81. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  82. package/.next/server/app/api/workspace/route.js +5 -5
  83. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  84. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +11 -11
  85. package/.next/server/app/artifact/[...path]/page.js +7 -6
  86. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  87. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  88. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  89. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  90. package/.next/server/app/page/server-reference-manifest.json +63 -63
  91. package/.next/server/app/page.js +10 -9
  92. package/.next/server/app/page.js.nft.json +1 -1
  93. package/.next/server/app/page_client-reference-manifest.js +1 -1
  94. package/.next/server/app-paths-manifest.json +3 -2
  95. package/.next/server/chunks/{[externals]__178rv3v._.js → [externals]__12stas-._.js} +1 -1
  96. package/.next/server/chunks/[root-of-the-server]__02ra64t._.js +1 -1
  97. package/.next/server/chunks/{[root-of-the-server]__05dp5tr._.js → [root-of-the-server]__06ky9of._.js} +2 -2
  98. package/.next/server/chunks/[root-of-the-server]__0b565-x._.js +7 -0
  99. package/.next/server/chunks/{[root-of-the-server]__1izes4_._.js → [root-of-the-server]__0bmtib_._.js} +2 -2
  100. package/.next/server/chunks/[root-of-the-server]__0bqveex._.js +1 -1
  101. package/.next/server/chunks/[root-of-the-server]__0brmiv2._.js +2 -2
  102. package/.next/server/chunks/[root-of-the-server]__0eivkvk._.js +2 -2
  103. package/.next/server/chunks/[root-of-the-server]__0f7m79q._.js +1 -1
  104. package/.next/server/chunks/[root-of-the-server]__0g38-aj._.js +2 -2
  105. package/.next/server/chunks/[root-of-the-server]__0gvdr2h._.js +1 -1
  106. package/.next/server/chunks/[root-of-the-server]__0h656y-._.js +2 -2
  107. package/.next/server/chunks/[root-of-the-server]__0hm3tiq._.js +2 -2
  108. package/.next/server/chunks/[root-of-the-server]__0hzdqnv._.js +2 -2
  109. package/.next/server/chunks/{[root-of-the-server]__0my9geo._.js → [root-of-the-server]__0kzmxpg._.js} +1 -1
  110. package/.next/server/chunks/[root-of-the-server]__0mgyt8p._.js +2 -2
  111. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  112. package/.next/server/chunks/[root-of-the-server]__0o5s5-o._.js +5 -0
  113. package/.next/server/chunks/[root-of-the-server]__0p80i1n._.js +1 -1
  114. package/.next/server/chunks/[root-of-the-server]__0qdoc_9._.js +1 -1
  115. package/.next/server/chunks/[root-of-the-server]__0qzho69._.js +1 -1
  116. package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +1 -1
  117. package/.next/server/chunks/[root-of-the-server]__0v_kuor._.js +1 -1
  118. package/.next/server/chunks/{[root-of-the-server]__1k2qs1m._.js → [root-of-the-server]__0ypkfbu._.js} +1 -1
  119. package/.next/server/chunks/[root-of-the-server]__1-18_pz._.js +1 -1
  120. package/.next/server/chunks/[root-of-the-server]__13hng6h._.js +1 -1
  121. package/.next/server/chunks/{[root-of-the-server]__01k3vi3._.js → [root-of-the-server]__14iga7p._.js} +1 -1
  122. package/.next/server/chunks/[root-of-the-server]__16gn7zn._.js +3 -0
  123. package/.next/server/chunks/[root-of-the-server]__18e65_-._.js +3 -0
  124. package/.next/server/chunks/[root-of-the-server]__1_04mcf._.js +2 -2
  125. package/.next/server/chunks/{[root-of-the-server]__0lvjz0b._.js → [root-of-the-server]__1_cgawk._.js} +2 -2
  126. package/.next/server/chunks/[root-of-the-server]__1ceammd._.js +1 -1
  127. package/.next/server/chunks/[root-of-the-server]__1ckt1yj._.js +1 -1
  128. package/.next/server/chunks/[root-of-the-server]__1cu5f3z._.js +1 -1
  129. package/.next/server/chunks/[root-of-the-server]__1dth047._.js +1 -1
  130. package/.next/server/chunks/{[root-of-the-server]__061o2_x._.js → [root-of-the-server]__1fc6v12._.js} +1 -1
  131. package/.next/server/chunks/[root-of-the-server]__1hviq62._.js +2 -2
  132. package/.next/server/chunks/[root-of-the-server]__1m1q6u5._.js +3 -0
  133. package/.next/server/chunks/[root-of-the-server]__1m_dmf6._.js +1 -1
  134. package/.next/server/chunks/[root-of-the-server]__1mys2c3._.js +1 -1
  135. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  136. package/.next/server/chunks/[root-of-the-server]__1p0njle._.js +2 -2
  137. package/.next/server/chunks/[root-of-the-server]__1p47fbb._.js +1 -1
  138. package/.next/server/chunks/[root-of-the-server]__1pugoq0._.js +1 -1
  139. package/.next/server/chunks/{[root-of-the-server]__0ts7ai0._.js → [root-of-the-server]__1trns9g._.js} +1 -1
  140. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  141. package/.next/server/chunks/[root-of-the-server]__1zn039k._.js +1 -1
  142. package/.next/server/chunks/[root-of-the-server]__20w_g71._.js +3 -0
  143. package/.next/server/chunks/_06hnfi8._.js +2 -2
  144. package/.next/server/chunks/_06u9yo-._.js +1 -1
  145. package/.next/server/chunks/_08_-9ay._.js +2 -2
  146. package/.next/server/chunks/_0bgjf07._.js +1 -1
  147. package/.next/server/chunks/_0c49lmw._.js +1 -1
  148. package/.next/server/chunks/_0hgvg55._.js +1 -1
  149. package/.next/server/chunks/_0s8ao8z._.js +1 -1
  150. package/.next/server/chunks/_0ucx1jv._.js +1 -1
  151. package/.next/server/chunks/_0uzj57i._.js +1 -1
  152. package/.next/server/chunks/_1-sk_q4._.js +1 -1
  153. package/.next/server/chunks/_1dxq827._.js +2 -2
  154. package/.next/server/chunks/_1e54wxa._.js +1 -1
  155. package/.next/server/chunks/_1frcwj1._.js +1 -1
  156. package/.next/server/chunks/_1gn2r2q._.js +4 -2
  157. package/.next/server/chunks/_1gxankq._.js +2 -2
  158. package/.next/server/chunks/_1i3uucm._.js +1 -1
  159. package/.next/server/chunks/_1jvy78-._.js +1 -1
  160. package/.next/server/chunks/_1lg0lsu._.js +53 -0
  161. package/.next/server/chunks/_1njolhx._.js +294 -0
  162. package/.next/server/chunks/_1q6e56i._.js +4 -2
  163. package/.next/server/chunks/_1wtb-77._.js +294 -0
  164. package/.next/server/chunks/_next-internal_server_app_api_llm-model_catalog_[provider]_route_actions_1i0449q.js +3 -0
  165. package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_[provider]_route_actions_0iui9hz.js +3 -0
  166. package/.next/server/chunks/_next-internal_server_app_api_running_route_actions_0o1g-aw.js +3 -0
  167. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  168. package/.next/server/chunks/features_bot_0zy_q8y._.js +7 -7
  169. package/.next/server/chunks/features_bot_1dfrdsb._.js +7 -7
  170. package/.next/server/chunks/{node_modules_1rosz79._.js → node_modules_035o7ku._.js} +1 -1
  171. package/.next/server/chunks/{node_modules_1er1u8w._.js → node_modules_0tn5t13._.js} +1 -1
  172. package/.next/server/chunks/{node_modules_103lpef._.js → node_modules_12oq3hr._.js} +1 -1
  173. package/.next/server/chunks/ssr/[root-of-the-server]__04upd5v._.js +1 -1
  174. package/.next/server/chunks/ssr/[root-of-the-server]__0p0mv2u._.js +3 -0
  175. package/.next/server/chunks/ssr/{[root-of-the-server]__1r7tj27._.js → [root-of-the-server]__0sk5enu._.js} +1 -1
  176. package/.next/server/chunks/ssr/[root-of-the-server]__0xyaud4._.js +3 -0
  177. package/.next/server/chunks/ssr/{[root-of-the-server]__128hnrd._.js → [root-of-the-server]__1-gi9sm._.js} +1 -1
  178. package/.next/server/chunks/ssr/{[root-of-the-server]__0h6jo0s._.js → [root-of-the-server]__16nn3pe._.js} +2 -2
  179. package/.next/server/chunks/ssr/[root-of-the-server]__1867koj._.js +1 -1
  180. package/.next/server/chunks/ssr/[root-of-the-server]__1c8-7cw._.js +3 -0
  181. package/.next/server/chunks/ssr/[root-of-the-server]__1tb5vve._.js +2 -1
  182. package/.next/server/chunks/ssr/_02cm0fr._.js +5 -0
  183. package/.next/server/chunks/ssr/_07nmtxo._.js +1 -1
  184. package/.next/server/chunks/ssr/_088vzgn._.js +1 -1
  185. package/.next/server/chunks/ssr/{_1oafxdu._.js → _0bg1u1j._.js} +2 -2
  186. package/.next/server/chunks/ssr/_0cv9tmv._.js +1 -1
  187. package/.next/server/chunks/ssr/_0f9hx5p._.js +1 -1
  188. package/.next/server/chunks/ssr/_0g9ula_._.js +3 -0
  189. package/.next/server/chunks/ssr/{_0wuvkqk._.js → _0irozu9._.js} +2 -2
  190. package/.next/server/chunks/ssr/_0iwsdp7._.js +3 -0
  191. package/.next/server/chunks/ssr/_0l7rjg5._.js +1 -1
  192. package/.next/server/chunks/ssr/{_0fo4552._.js → _0nk80t6._.js} +44 -5
  193. package/.next/server/chunks/ssr/_0pbav_w._.js +1 -1
  194. package/.next/server/chunks/ssr/{_1r4mc3i._.js → _0q-mdwv._.js} +8 -8
  195. package/.next/server/chunks/ssr/{_1w899wx._.js → _0s5_ahb._.js} +2 -2
  196. package/.next/server/chunks/ssr/{_1omom9y._.js → _0t5f2c3._.js} +2 -2
  197. package/.next/server/chunks/ssr/_0v9r8g2._.js +1 -1
  198. package/.next/server/chunks/ssr/_0x8ophf._.js +1 -1
  199. package/.next/server/chunks/ssr/_0x9f717._.js +1 -1
  200. package/.next/server/chunks/ssr/_107vtdk._.js +162 -0
  201. package/.next/server/chunks/ssr/{_0ixe3g3._.js → _12lql1x._.js} +3 -3
  202. package/.next/server/chunks/ssr/_165wnr4._.js +1 -1
  203. package/.next/server/chunks/ssr/_16_7zeo._.js +1 -1
  204. package/.next/server/chunks/ssr/_17komoi._.js +3 -0
  205. package/.next/server/chunks/ssr/{_0j9vh-8._.js → _190hjys._.js} +2 -2
  206. package/.next/server/chunks/ssr/_1bfrntd._.js +2 -2
  207. package/.next/server/chunks/ssr/{_1tx-2k7._.js → _1booff4._.js} +2 -2
  208. package/.next/server/chunks/ssr/{_12jv_41._.js → _1ew1j7l._.js} +2 -2
  209. package/.next/server/chunks/ssr/_1i2swyr._.js +1 -1
  210. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  211. package/.next/server/chunks/ssr/{_0osvxkt._.js → _1qsa25k._.js} +2 -2
  212. package/.next/server/chunks/ssr/_1soynbw._.js +2 -2
  213. package/.next/server/chunks/ssr/_1vc2xmu._.js +3 -0
  214. package/.next/server/chunks/ssr/{_1_ogjze._.js → _1wq90j8._.js} +2 -2
  215. package/.next/server/chunks/ssr/{_1pgxh81._.js → _1zrhkf0._.js} +44 -5
  216. package/.next/server/chunks/ssr/{_0mpn6q0._.js → _21awrs2._.js} +2 -2
  217. package/.next/server/chunks/ssr/features_0796o8r._.js +1 -1
  218. package/.next/server/chunks/ssr/features_bot_1c56lew._.js +37 -0
  219. package/.next/server/chunks/ssr/{features_bot_18gqkr_._.js → features_bot_1fn_grf._.js} +2 -2
  220. package/.next/server/chunks/ssr/{features_config_1ond01n._.js → features_config_05zi68v._.js} +3 -3
  221. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +1 -1
  222. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  223. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  224. package/.next/server/chunks/ssr/{node_modules_1-4q6is._.js → node_modules_0-sux1a._.js} +1 -1
  225. package/.next/server/chunks/ssr/{node_modules_17o218r._.js → node_modules_01oezhb._.js} +1 -1
  226. package/.next/server/chunks/ssr/{node_modules_0f485jl._.js → node_modules_04m6ebg._.js} +1 -1
  227. package/.next/server/chunks/ssr/{node_modules_0upwx50._.js → node_modules_067jfov._.js} +1 -1
  228. package/.next/server/chunks/ssr/{node_modules_0i_v0-m._.js → node_modules_06ugby3._.js} +1 -1
  229. package/.next/server/chunks/ssr/{node_modules_0lxwg2v._.js → node_modules_07p51j3._.js} +1 -1
  230. package/.next/server/chunks/ssr/{node_modules_16z7p8b._.js → node_modules_0995xyq._.js} +1 -1
  231. package/.next/server/chunks/ssr/{node_modules_004qt-z._.js → node_modules_0_uecwx._.js} +1 -1
  232. package/.next/server/chunks/ssr/{node_modules_0lrn9ci._.js → node_modules_0dsyc90._.js} +1 -1
  233. package/.next/server/chunks/ssr/{node_modules_0v__o4h._.js → node_modules_0hli6s2._.js} +1 -1
  234. package/.next/server/chunks/ssr/{node_modules_1gpapfv._.js → node_modules_0m-bde_._.js} +1 -1
  235. package/.next/server/chunks/ssr/{node_modules_1tus4vi._.js → node_modules_0oqfdbr._.js} +1 -1
  236. package/.next/server/chunks/ssr/{node_modules_09dy7tk._.js → node_modules_0tgy5s5._.js} +1 -1
  237. package/.next/server/chunks/ssr/{node_modules_1hdaxu9._.js → node_modules_1-kjmls._.js} +1 -1
  238. package/.next/server/chunks/ssr/{node_modules_0gbx70b._.js → node_modules_1-l3ka5._.js} +1 -1
  239. package/.next/server/chunks/ssr/{node_modules_20448xv._.js → node_modules_1-w3ayh._.js} +1 -1
  240. package/.next/server/chunks/ssr/{node_modules_06m6e97._.js → node_modules_133exgm._.js} +1 -1
  241. package/.next/server/chunks/ssr/{node_modules_1srjf5c._.js → node_modules_17xc5_k._.js} +1 -1
  242. package/.next/server/chunks/ssr/{node_modules_1tv_7lk._.js → node_modules_1_i_w30._.js} +1 -1
  243. package/.next/server/chunks/ssr/{node_modules_1hjvwkh._.js → node_modules_1a2cjfk._.js} +1 -1
  244. package/.next/server/chunks/ssr/{node_modules_0_hy3i2._.js → node_modules_1k752fe._.js} +1 -1
  245. package/.next/server/chunks/ssr/{node_modules_0n2-p5q._.js → node_modules_1lie7z8._.js} +1 -1
  246. package/.next/server/chunks/ssr/{node_modules_0pw13ww._.js → node_modules_1mv70-y._.js} +1 -1
  247. package/.next/server/chunks/ssr/{node_modules_10mb0cv._.js → node_modules_1r611t2._.js} +1 -1
  248. package/.next/server/chunks/ssr/{node_modules_0nj36zf._.js → node_modules_1vfd8dz._.js} +2 -2
  249. package/.next/server/chunks/ssr/{node_modules_0ppirau._.js → node_modules_1yaowd7._.js} +1 -1
  250. package/.next/server/chunks/ssr/{node_modules_1j886a5._.js → node_modules_20a1wpo._.js} +1 -1
  251. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0lg9pkl._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1r8pxbe._.js} +1 -1
  252. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1xgbf5j._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1siiu4h._.js} +1 -1
  253. package/.next/server/middleware-build-manifest.js +3 -3
  254. package/.next/server/middleware.js +1 -1
  255. package/.next/server/pages/404.html +1 -1
  256. package/.next/server/pages/500.html +1 -1
  257. package/.next/server/server-reference-manifest.js +1 -1
  258. package/.next/server/server-reference-manifest.json +64 -64
  259. package/.next/static/chunks/{1dpg1u4a16ujt.js → 088d3w5qxu19g.js} +2 -2
  260. package/.next/static/chunks/0bxekp4hnuk1g.js +1 -0
  261. package/.next/static/chunks/{17dx6w478vnb0.js → 0fw4u_s974j24.js} +1 -1
  262. package/.next/static/chunks/0hy2x7qhk8wgx.css +1 -0
  263. package/.next/static/chunks/{240nfv2dtidhc.js → 0n_eshmn_7wfn.js} +2 -2
  264. package/.next/static/chunks/0ulcp_u_y1u0b.js +15 -0
  265. package/.next/static/chunks/0vj93zo0yvix9.js +35 -0
  266. package/.next/static/chunks/{05uvci-bk-vgp.js → 10f98bh4hdmhe.js} +1 -1
  267. package/.next/static/chunks/{0ruf3dqs--3ve.js → 1b8bce_z_act0.js} +1 -1
  268. package/.next/static/chunks/1c32d2azsjaj_.js +1 -0
  269. package/.next/static/chunks/1fs829mz69pxz.js +1 -0
  270. package/.next/static/chunks/{2ug8q1x9e-_j6.js → 1lwlh4mo_vv8d.js} +1 -1
  271. package/.next/static/chunks/{3r7u1y9xjoh-v.js → 1po8fkg40peu-.js} +1 -1
  272. package/.next/static/chunks/{27l8qwnk1j66z.js → 1rg6b9l5fm1hj.js} +1 -1
  273. package/.next/static/chunks/{1pe7i5yu779ta.js → 26g3iwfuad-7p.js} +1 -1
  274. package/.next/static/chunks/2bjnmtke_q43c.js +1 -0
  275. package/.next/static/chunks/2c86k0o-1p9_w.js +1 -0
  276. package/.next/static/chunks/2gf4t0d76bvyv.js +1 -0
  277. package/.next/static/chunks/2rj3q_ahctv19.js +1 -0
  278. package/.next/static/chunks/{2lhc74urf3acr.js → 2x6-fpctvucte.js} +1 -1
  279. package/.next/static/chunks/{2gxfy__ef51n9.js → 2yicf7bky866n.js} +1 -1
  280. package/.next/static/chunks/{0oqviw3f55nfp.js → 350ws7svim7ij.js} +1 -1
  281. package/.next/static/chunks/3e1w_nwfb39j-.js +1 -0
  282. package/.next/static/chunks/3v3ooretb54ag.js +1 -0
  283. package/.next/static/chunks/{2lzg4zedtmyic.js → 44bcbnmup71so.js} +1 -1
  284. package/.next/static/chunks/{1h_6rh86q3i4p.js → 458dtbsemx996.js} +1 -1
  285. package/bin/background.mjs +995 -0
  286. package/bin/lock.mjs +64 -29
  287. package/bin/thursday.mjs +111 -42
  288. package/bin/tools.mjs +58 -4
  289. package/guide/calls.md +8 -0
  290. package/guide/setup.md +27 -13
  291. package/package.json +1 -1
  292. package/seed-skills/concierge/travel/references/itinerary.md +1 -1
  293. package/seed-skills/concierge/travel/scripts/itinerary.mjs +7 -2
  294. package/skills/artifact/references/book.md +3 -3
  295. package/.next/server/app/api/llm-model/catalog/route/app-paths-manifest.json +0 -3
  296. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +0 -1
  297. package/.next/server/app/api/llm-model/catalog/route_client-reference-manifest.js +0 -3
  298. package/.next/server/app/api/llm-model/credits/route/app-paths-manifest.json +0 -3
  299. package/.next/server/app/api/llm-model/credits/route.js.nft.json +0 -1
  300. package/.next/server/app/api/llm-model/credits/route_client-reference-manifest.js +0 -3
  301. package/.next/server/chunks/[root-of-the-server]__03xamry._.js +0 -3
  302. package/.next/server/chunks/[root-of-the-server]__04hhvpu._.js +0 -7
  303. package/.next/server/chunks/[root-of-the-server]__1-rmal0._.js +0 -5
  304. package/.next/server/chunks/[root-of-the-server]__10xnb7e._.js +0 -3
  305. package/.next/server/chunks/[root-of-the-server]__1etbk64._.js +0 -3
  306. package/.next/server/chunks/[root-of-the-server]__1v7x5ym._.js +0 -3
  307. package/.next/server/chunks/_07nxi75._.js +0 -255
  308. package/.next/server/chunks/_0srlnvd._.js +0 -16
  309. package/.next/server/chunks/_0xygcxs._.js +0 -255
  310. package/.next/server/chunks/_next-internal_server_app_api_llm-model_catalog_route_actions_1eu2y41.js +0 -3
  311. package/.next/server/chunks/_next-internal_server_app_api_llm-model_credits_route_actions_0v424pb.js +0 -3
  312. package/.next/server/chunks/ssr/[root-of-the-server]__06knwl5._.js +0 -3
  313. package/.next/server/chunks/ssr/[root-of-the-server]__07ehpky._.js +0 -3
  314. package/.next/server/chunks/ssr/[root-of-the-server]__1gzje-h._.js +0 -3
  315. package/.next/server/chunks/ssr/_0jstvlg._.js +0 -39
  316. package/.next/server/chunks/ssr/_1-41lck._.js +0 -3
  317. package/.next/server/chunks/ssr/_10jtmhl._.js +0 -3
  318. package/.next/server/chunks/ssr/_19jez1a._.js +0 -3
  319. package/.next/server/chunks/ssr/_1jd8rjm._.js +0 -3
  320. package/.next/server/chunks/ssr/_1mdjoak._.js +0 -162
  321. package/.next/static/chunks/09y_43y1cy5jw.js +0 -1
  322. package/.next/static/chunks/0vggwjufw2-6r.js +0 -1
  323. package/.next/static/chunks/0x4m9nj2fazl2.js +0 -35
  324. package/.next/static/chunks/1-1yfu34-3p2p.js +0 -1
  325. package/.next/static/chunks/10oyyypxn_cpx.js +0 -1
  326. package/.next/static/chunks/184-r80rv0xay.css +0 -1
  327. package/.next/static/chunks/1_hgdoungpm0o.js +0 -1
  328. package/.next/static/chunks/2kjwmo70judc2.js +0 -15
  329. package/.next/static/chunks/2uk8rdtr-pk58.js +0 -1
  330. package/.next/static/chunks/3vg1-oc-zgw_7.js +0 -1
  331. package/.next/static/chunks/3vrmcm31ih7gb.js +0 -1
  332. package/.next/static/chunks/41ztsnjn4qrn-.js +0 -1
  333. package/bin/autostart.mjs +0 -192
  334. /package/.next/server/app/api/llm-model/catalog/{route → [provider]/route}/build-manifest.json +0 -0
  335. /package/.next/server/app/api/llm-model/catalog/{route → [provider]/route}/server-reference-manifest.json +0 -0
  336. /package/.next/server/app/api/llm-model/catalog/{route.js.map → [provider]/route.js.map} +0 -0
  337. /package/.next/server/app/api/llm-model/credits/{route → [provider]/route}/build-manifest.json +0 -0
  338. /package/.next/server/app/api/llm-model/credits/{route → [provider]/route}/server-reference-manifest.json +0 -0
  339. /package/.next/server/app/api/llm-model/credits/{route.js.map → [provider]/route.js.map} +0 -0
  340. /package/.next/static/{-IBxB5oqr6e3RuOCCmYtL → YhaRHJqObuAcXZe5VLFs0}/_buildManifest.js +0 -0
  341. /package/.next/static/{-IBxB5oqr6e3RuOCCmYtL → YhaRHJqObuAcXZe5VLFs0}/_clientMiddlewareManifest.js +0 -0
  342. /package/.next/static/{-IBxB5oqr6e3RuOCCmYtL → YhaRHJqObuAcXZe5VLFs0}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,18068,e=>{"use strict";var t,n=e.i(843476),s=e.i(493801),r=e.i(375775),i=e.i(422411),o=e.i(525335),a=e.i(689664),l=e.i(867927),d=e.i(456420);let c={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"}]]};c.node;let u=(0,d.default)(c);var h=e.i(560972),h=h,f=e.i(815170),m=e.i(758925),g=e.i(566595),x=e.i(466787),p=e.i(271645),y=e.i(798120),k=e.i(167881),v=e.i(23750),j=e.i(917162),b=e.i(59377),w=e.i(818125),N=e.i(671428),A=e.i(41533),S=e.i(412294),C=e.i(458898),M=e.i(146538),z=e.i(968978),E=e.i(265402),R=e.i(635963),I=e.i(95187);let F=(0,I.createServerReference)("7f9f5cbd4d689ed4d45ffcafb4479363132599b1c5",I.callServer,void 0,I.findSourceMapURL,"removeConfigAction");e.s(["removeConfigAction",0,F],18068);var P=e.i(734899),T=e.i(992112),K=e.i(508734),_=e.i(482022),$=((t=$||{})[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t);let B=[1,0],O=[2,3],L=[3,2],q={L:[0,1],M:B,Q:O,H:L},D=/^\d*$/,H=/^[A-Z0-9 $%*+./:-]*$/,U="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",G=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Y=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class W{constructor(e,t,n,s){if(this.version=e,this.ecc=t,e<1||e>40)throw RangeError("Version value out of range");if(s<-1||s>7)throw RangeError("Mask value out of range");this.size=4*e+17;const r=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.types.push(r.map(()=>0));this.drawFunctionPatterns();const i=this.addEccAndInterleave(n);if(this.drawCodewords(i),-1===s){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(s=t,e=n),this.applyMask(t)}}this.mask=s,this.applyMask(s),this.drawFormatBits(s)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,$.Timing),this.setFunctionModule(e,6,e%2==0,$.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)(0!==n||0!==s)&&(0!==n||s!==t-1)&&(n!==t-1||0!==s)&&this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let s=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,Q(s,e));this.setFunctionModule(8,7,Q(s,6)),this.setFunctionModule(8,8,Q(s,7)),this.setFunctionModule(7,8,Q(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,Q(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,Q(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,Q(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=Q(t,e),s=this.size-11+e%3,r=Math.floor(e/3);this.setFunctionModule(s,r,n),this.setFunctionModule(r,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){let r=Math.max(Math.abs(s),Math.abs(n)),i=e+s,o=t+n;i>=0&&i<this.size&&o>=0&&o<this.size&&this.setFunctionModule(i,o,2!==r&&4!==r,$.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!==Math.max(Math.abs(s),Math.abs(n)),$.Alignment)}setFunctionModule(e,t,n,s=$.Function){this.modules[t][e]=n,this.types[t][e]=s}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==er(t,n))throw RangeError("Invalid argument");let s=Y[n[0]][t],r=G[n[0]][t],i=Math.floor(es(t)/8),o=s-i%s,a=Math.floor(i/s),l=[],d=function(e){if(e<1||e>255)throw RangeError("Degree out of range");let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let s=0;s<e;s++){for(let e=0;e<t.length;e++)t[e]=ei(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=ei(n,2)}return t}(r);for(let t=0,n=0;t<s;t++){let s=e.slice(n,n+a-r+(t<o?0:1));n+=s.length;let i=function(e,t){let n=t.map(e=>0);for(let s of e){let e=s^n.shift();n.push(0),t.forEach((t,s)=>n[s]^=ei(t,e))}return n}(s,d);t<o&&s.push(0),l.push(s.concat(i))}let c=[];for(let e=0;e<l[0].length;e++)l.forEach((t,n)=>{(e!==a-r||n>=o)&&c.push(t[e])});return c}drawCodewords(e){if(e.length!==Math.floor(es(this.version)/8))throw RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6===n&&(n=5);for(let s=0;s<this.size;s++)for(let r=0;r<2;r++){let i=n-r,o=(n+1&2)==0?this.size-1-s:s;!this.types[o][i]&&t<8*e.length&&(this.modules[o][i]=Q(e[t>>>3],7-(7&t)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw Error("Unreachable")}!this.types[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[t][i]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[t][i],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][t]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[i][t],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let s=this.modules[t][n];s===this.modules[t][n+1]&&s===this.modules[t+1][n]&&s===this.modules[t+1][n+1]&&(e+=3)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size;return e+(Math.ceil(Math.abs(20*t-10*n)/n)-1)*10}getAlignmentPatternPositions(){if(1===this.version)return[];{let e=Math.floor(this.version/7)+2,t=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===3*t&&e[4]===t&&e[5]===t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0===t[0]&&(e+=this.size),t.pop(),t.unshift(e)}}function V(e,t,n){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function Q(e,t){return(e>>>t&1)!=0}class X{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}let Z=[1,10,12,14],J=[2,9,11,13],ee=[4,8,16,16];function et(e,t){return e[Math.floor((t+7)/17)+1]}function en(e){let t=[];for(let n of e)V(n,8,t);return new X(ee,e.length,t)}function es(e){if(e<1||e>40)throw RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function er(e,t){return Math.floor(es(e)/8)-G[t[0]][e]*Y[t[0]][e]}function ei(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^(n>>>7)*285^(t>>>s&1)*e;return n}var eo=e.i(511769),ea=e.i(660302),el=e.i(895836),ed=e.i(609856),ec=e.i(283653),eu=e.i(647163);let eh=(0,I.createServerReference)("7f787b69f6e9bbb92118d8190ab3b8f9f18bd05fb9",I.callServer,void 0,I.findSourceMapURL,"forgetReachAction");var ef=e.i(36174);let em={telegram:"telegram.org",discord:"discord.com",slack:"slack.com"},eg=`display_information:
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,805995,294970,e=>{"use strict";var t,n=e.i(843476),s=e.i(493801),r=e.i(375775),i=e.i(422411),o=e.i(525335),a=e.i(689664),l=e.i(867927),d=e.i(456420);let c={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"}]]};c.node;let u=(0,d.default)(c);var h=e.i(560972),h=h,f=e.i(815170),m=e.i(758925),g=e.i(566595),x=e.i(466787),p=e.i(271645),y=e.i(798120),k=e.i(167881),v=e.i(23750),j=e.i(917162),b=e.i(59377),w=e.i(818125),N=e.i(671428),A=e.i(41533),S=e.i(412294),C=e.i(458898),M=e.i(146538),z=e.i(968978),E=e.i(265402),R=e.i(635963),I=e.i(95187);let F=(0,I.createServerReference)("7fc5ad2ca5f880c272d3b36234f095644501ad4300",I.callServer,void 0,I.findSourceMapURL,"removeConfigAction");e.s(["removeConfigAction",0,F],294970);var P=e.i(432653),T=e.i(992112),K=e.i(508734),_=e.i(482022),$=((t=$||{})[t.Border=-1]="Border",t[t.Data=0]="Data",t[t.Function=1]="Function",t[t.Position=2]="Position",t[t.Timing=3]="Timing",t[t.Alignment=4]="Alignment",t);let B=[1,0],O=[2,3],L=[3,2],q={L:[0,1],M:B,Q:O,H:L},D=/^\d*$/,H=/^[A-Z0-9 $%*+./:-]*$/,U="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",G=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Y=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class W{constructor(e,t,n,s){if(this.version=e,this.ecc=t,e<1||e>40)throw RangeError("Version value out of range");if(s<-1||s>7)throw RangeError("Mask value out of range");this.size=4*e+17;const r=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(r.slice()),this.types.push(r.map(()=>0));this.drawFunctionPatterns();const i=this.addEccAndInterleave(n);if(this.drawCodewords(i),-1===s){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(s=t,e=n),this.applyMask(t)}}this.mask=s,this.applyMask(s),this.drawFormatBits(s)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,$.Timing),this.setFunctionModule(e,6,e%2==0,$.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let s=0;s<t;s++)(0!==n||0!==s)&&(0!==n||s!==t-1)&&(n!==t-1||0!==s)&&this.drawAlignmentPattern(e[n],e[s]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let s=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,Q(s,e));this.setFunctionModule(8,7,Q(s,6)),this.setFunctionModule(8,8,Q(s,7)),this.setFunctionModule(7,8,Q(s,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,Q(s,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,Q(s,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,Q(s,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=Q(t,e),s=this.size-11+e%3,r=Math.floor(e/3);this.setFunctionModule(s,r,n),this.setFunctionModule(r,s,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let s=-4;s<=4;s++){let r=Math.max(Math.abs(s),Math.abs(n)),i=e+s,o=t+n;i>=0&&i<this.size&&o>=0&&o<this.size&&this.setFunctionModule(i,o,2!==r&&4!==r,$.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let s=-2;s<=2;s++)this.setFunctionModule(e+s,t+n,1!==Math.max(Math.abs(s),Math.abs(n)),$.Alignment)}setFunctionModule(e,t,n,s=$.Function){this.modules[t][e]=n,this.types[t][e]=s}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==er(t,n))throw RangeError("Invalid argument");let s=Y[n[0]][t],r=G[n[0]][t],i=Math.floor(es(t)/8),o=s-i%s,a=Math.floor(i/s),l=[],d=function(e){if(e<1||e>255)throw RangeError("Degree out of range");let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let s=0;s<e;s++){for(let e=0;e<t.length;e++)t[e]=ei(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=ei(n,2)}return t}(r);for(let t=0,n=0;t<s;t++){let s=e.slice(n,n+a-r+(t<o?0:1));n+=s.length;let i=function(e,t){let n=t.map(e=>0);for(let s of e){let e=s^n.shift();n.push(0),t.forEach((t,s)=>n[s]^=ei(t,e))}return n}(s,d);t<o&&s.push(0),l.push(s.concat(i))}let c=[];for(let e=0;e<l[0].length;e++)l.forEach((t,n)=>{(e!==a-r||n>=o)&&c.push(t[e])});return c}drawCodewords(e){if(e.length!==Math.floor(es(this.version)/8))throw RangeError("Invalid argument");let t=0;for(let n=this.size-1;n>=1;n-=2){6===n&&(n=5);for(let s=0;s<this.size;s++)for(let r=0;r<2;r++){let i=n-r,o=(n+1&2)==0?this.size-1-s:s;!this.types[o][i]&&t<8*e.length&&(this.modules[o][i]=Q(e[t>>>3],7-(7&t)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let s;switch(e){case 0:s=(n+t)%2==0;break;case 1:s=t%2==0;break;case 2:s=n%3==0;break;case 3:s=(n+t)%3==0;break;case 4:s=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:s=n*t%2+n*t%3==0;break;case 6:s=(n*t%2+n*t%3)%2==0;break;case 7:s=((n+t)%2+n*t%3)%2==0;break;default:throw Error("Unreachable")}!this.types[t][n]&&s&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[t][i]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[t][i],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size;t++){let n=!1,s=0,r=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][t]===n?5==++s?e+=3:s>5&&e++:(this.finderPenaltyAddHistory(s,r),n||(e+=40*this.finderPenaltyCountPatterns(r)),n=this.modules[i][t],s=1);e+=40*this.finderPenaltyTerminateAndCount(n,s,r)}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let s=this.modules[t][n];s===this.modules[t][n+1]&&s===this.modules[t+1][n]&&s===this.modules[t+1][n+1]&&(e+=3)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size;return e+(Math.ceil(Math.abs(20*t-10*n)/n)-1)*10}getAlignmentPatternPositions(){if(1===this.version)return[];{let e=Math.floor(this.version/7)+2,t=32===this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2)),n=[6];for(let s=this.size-7;n.length<e;s-=t)n.splice(1,0,s);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===3*t&&e[4]===t&&e[5]===t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0===t[0]&&(e+=this.size),t.pop(),t.unshift(e)}}function V(e,t,n){if(t<0||t>31||e>>>t!=0)throw RangeError("Value out of range");for(let s=t-1;s>=0;s--)n.push(e>>>s&1)}function Q(e,t){return(e>>>t&1)!=0}class X{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError("Invalid argument");this.bitData=n.slice()}getData(){return this.bitData.slice()}}let Z=[1,10,12,14],J=[2,9,11,13],ee=[4,8,16,16];function et(e,t){return e[Math.floor((t+7)/17)+1]}function en(e){let t=[];for(let n of e)V(n,8,t);return new X(ee,e.length,t)}function es(e){if(e<1||e>40)throw RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function er(e,t){return Math.floor(es(e)/8)-G[t[0]][e]*Y[t[0]][e]}function ei(e,t){if(e>>>8!=0||t>>>8!=0)throw RangeError("Byte out of range");let n=0;for(let s=7;s>=0;s--)n=n<<1^(n>>>7)*285^(t>>>s&1)*e;return n}var eo=e.i(511769),ea=e.i(660302),el=e.i(895836),ed=e.i(609856),ec=e.i(283653),eu=e.i(647163);let eh=(0,I.createServerReference)("7f1de1f12ee8e3b472973865a1b455fbca4fbe4919",I.callServer,void 0,I.findSourceMapURL,"forgetReachAction");var ef=e.i(36174);let em={telegram:"telegram.org",discord:"discord.com",slack:"slack.com"},eg=`display_information:
2
2
  name: Thursday
3
3
  features:
4
4
  app_home:
@@ -15,4 +15,4 @@ settings:
15
15
  interactivity:
16
16
  is_enabled: true
17
17
  socket_mode_enabled: true
18
- `,ex=({children:e})=>(0,n.jsx)("span",{className:"font-medium text-foreground",children:e}),ep={telegram:[{body:(0,n.jsxs)(n.Fragment,{children:["In Telegram, write to ",(0,n.jsx)(ex,{children:"@BotFather"}),", send ",(0,n.jsx)(ex,{children:"/newbot"})," and pick a name. It answers with a ",(0,n.jsx)(ex,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.TELEGRAM_TOKEN_KEY,looks:"123456789:AAE…"}},{body:(0,n.jsx)(n.Fragment,{children:"From your phone, write anything to your bot."}),slot:{says:"Point your phone's camera at it to open the chat."}},{body:(0,n.jsxs)(n.Fragment,{children:["A question with a code appears on this computer. Press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(ex,{children:"discord.com/developers"}),", make a ",(0,n.jsx)(ex,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,n.jsx)(ex,{children:"Install Link"})," to"," ",(0,n.jsx)(ex,{children:"None"})," on its ",(0,n.jsx)(ex,{children:"Installation"})," page and turn off"," ",(0,n.jsx)(ex,{children:"Public Bot"})," on its ",(0,n.jsx)(ex,{children:"Bot"})," page. There, press"," ",(0,n.jsx)(ex,{children:"Reset Token"})," and copy it."]}),slot:{open:"https://discord.com/developers/applications",label:"Open discord.com/developers"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Add the bot to a server of your own"})," — Discord only delivers a message to a bot you share a server with. A private server made for this is fine."]}),slot:{says:"Point your phone's camera at it, or open it here. It asks which server, and adds the bot with no permissions in it.",does:"Add the bot to a server"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Send the bot a direct message"}),", not in the server: on a phone, tap the bot in the server's member list, then ",(0,n.jsx)(ex,{children:"Message"}),". A question with a code appears here: press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(({href:e,children:t})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:t}),{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,n.jsx)(ex,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,n.jsx)(ex,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:ef.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:ef.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,n.jsxs)(n.Fragment,{children:["In Slack, open the app under ",(0,n.jsx)(ex,{children:"Apps"})," and write in its"," ",(0,n.jsx)(ex,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,n.jsx)(ex,{children:"Allow"})," if Slack shows the same code."]})}]};function ey(){let e=(0,ec.useServerRoute)(y.queryKey.config),t=(0,ec.useServerRoute)(y.queryKey.reach);(0,eo.useAppEvent)({reach:()=>void(0,ec.revalidate)(y.queryKey.reach)});let s=t=>(0,T.isConfigSet)(e.data,t),r=e=>t.data?.channels.find(t=>t.name===e)??null,i=e=>!!r(e)?.allowed,o=ef.REACH_CHANNELS.find(e=>r(e)?.refused),a=ef.REACH_CHANNELS.find(e=>ef.REACH_KEYS[e].every(s)&&!i(e)),l=!ef.REACH_CHANNELS.some(i),[d,c]=(0,p.useState)(o??a??(l?ef.REACH_CHANNELS[0]:null));return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingItems,{children:ef.REACH_CHANNELS.map(e=>(0,n.jsx)(ek,{name:e,status:r(e),tokensIn:ef.REACH_KEYS[e].filter(s).length,isSet:s,open:d===e,onOpen:()=>c(d===e?null:e)},e))}),(0,n.jsx)(el.SettingNote,{children:"Only the one person you allow can write, and only direct messages are read. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function ek({name:e,status:t,tokensIn:s,isSet:r,open:i,onOpen:o}){var a;let d,c,u,h,f=ep[e],g=t?.refused??null,x=(a={connected:!!t?.bot,allowed:!!t?.allowed,refused:g},d=f.map(e=>e.slot&&"key"in e.slot?e.slot.key:null),c=e=>!r(e)||e===a.refused,u=d.findIndex(e=>e&&c(e)),h=d.reduce((e,t,n)=>t?n:e,-1),f.map((e,t)=>{let n=d[t];return n?c(n)?t===u?"now":"later":"done":u>=0?t<u?a.refused?"done":"flat":"later":a.allowed||t<h?"done":a.connected?"now":"flat"})),p=!!t?.bot&&!t?.allowed&&!g;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex w-full items-center gap-3 px-4 py-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)(w.SiteIcon,{host:em[e],className:"size-4 rounded-[4px]",fallback:(0,n.jsx)(m.KeyRound,{className:"size-4 text-muted-foreground"})}),(0,n.jsx)("span",{className:"text-sm font-medium",children:ef.REACH_LABEL[e]}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:(0,n.jsx)(ev,{status:t,tokensIn:s,tokens:ef.REACH_KEYS[e].length})}),(0,n.jsx)(l.ChevronRight,{className:(0,eu.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")})]}),i&&(0,n.jsxs)("div",{className:"px-4 pt-1 pb-4",children:[(0,n.jsx)("ol",{className:"space-y-3",children:f.map((e,s)=>(0,n.jsx)(ej,{n:s+1,step:e,state:x[s],set:!!e.slot&&"key"in e.slot&&r(e.slot.key),refused:e.slot&&"key"in e.slot&&e.slot.key===g?t?.problem??"":null,link:t?.link??null,waiting:p&&s===f.length-1},s))}),t?.allowed&&(0,n.jsx)(ez,{name:e,who:t.allowed.name,stopped:!!g})]})]})}function ev({status:e,tokensIn:t,tokens:s}){let r="text-xs";return t<s?(0,n.jsx)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:t?`${t} of ${s} tokens in`:"Not set"}):e?.refused?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-destructive"),children:["Stopped — ",ef.REACH_LABEL[e.name]," turned the token away"]}):e?.problem?(0,n.jsx)(ea.ShinyText,{text:`${e.bot?"Reconnecting":"Connecting"}… ${e.problem}`,className:(0,eu.cn)(r,"align-middle")}):e?.allowed?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:["Listening as ",e.bot,". ",e.allowed.name," is let in."]}):e?.bot?(0,n.jsx)(ea.ShinyText,{text:`Listening as ${e.bot} — waiting for your first message`,tone:"waiting",className:(0,eu.cn)(r,"align-middle")}):(0,n.jsx)(ea.ShinyText,{text:"Connecting…",className:(0,eu.cn)(r,"align-middle")})}function ej({n:e,step:t,state:s,set:r,refused:i,link:o,waiting:a}){return(0,n.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,n.jsx)(eb,{n:e,state:s}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,n.jsx)("p",{className:(0,eu.cn)("done"===s||"later"===s?"text-muted-foreground/60 **:text-inherit":"text-muted-foreground"),children:t.body}),(0,n.jsx)(ew,{slot:t.slot,state:s,set:r,refused:i,link:o,waiting:a})]})]})}function eb({n:e,state:t}){return"done"===t?(0,n.jsx)("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-foreground text-background",children:(0,n.jsx)(a.Check,{className:"size-3"})}):(0,n.jsx)("span",{className:(0,eu.cn)("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-background font-mono text-[10.5px] ring-1","now"===t?(0,eu.cn)(eu.WAITING_INK,"ring-waiting/40"):"text-muted-foreground ring-border/60","later"===t&&"opacity-60"),children:e})}function ew({slot:e,state:t,set:s,refused:r,link:i,waiting:o}){let a=o&&(0,n.jsx)(ea.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===t?null:e&&"key"in e?(0,n.jsx)(eC,{configKey:e.key,looks:e.looks,set:s,refused:r}):"done"===t?e&&"says"in e&&i?(0,n.jsx)(eS,{href:i,children:e.does??eA(i)}):null:e?"open"in e?(0,n.jsx)(eS,{href:e.open,children:e.label}):"manifest"in e?(0,n.jsx)(eM,{}):i?(0,n.jsxs)("div",{className:"space-y-2.5",children:[(0,n.jsx)(eN,{link:i,says:e.says,does:e.does}),a]}):a||null:a||null}function eN({link:e,says:t,does:s}){let{size:r,data:i}=function(e){let{ecc:t="L",boostEcc:n=!1,minVersion:s=1,maxVersion:r=40,maskPattern:i=-1,border:o=1}={},a="string"==typeof e?function(e){var t,n;if(""===e)return[];if(t=e,D.test(t))return[function(e){var t;if(t=e,!D.test(t))throw RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){let s=Math.min(e.length-t,3);V(Number.parseInt(e.substring(t,t+s),10),3*s+1,n),t+=s}return new X(Z,e.length,n)}(e)];return(n=e,H.test(n))?[function(e){var t;let n;if(t=e,!H.test(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let s=[];for(n=0;n+2<=e.length;n+=2){let t=45*U.indexOf(e.charAt(n));V(t+=U.indexOf(e.charAt(n+1)),11,s)}return n<e.length&&V(U.indexOf(e.charAt(n)),6,s),new X(J,e.length,s)}(e)]:[en(function(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!==e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}(e))]}(e):Array.isArray(e)?[en(e)]:void 0;if(!a)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=function(e,t,n=1,s=40,r=-1,i=!0){let o,a;if(!(1<=n&&n<=s&&s<=40)||r<-1||r>7)throw RangeError("Invalid value");for(o=n;;o++){let n=8*er(o,t),r=function(e,t){let n=0;for(let s of e){let e=et(s.mode,t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}(e,o);if(r<=n){a=r;break}if(o>=s)throw RangeError("Data too long")}for(let e of[B,O,L])i&&a<=8*er(o,e)&&(t=e);let l=[];for(let t of e)for(let e of(V(t.mode[0],4,l),V(t.numChars,et(t.mode,o),l),t.getData()))l.push(e);let d=8*er(o,t);V(0,Math.min(4,d-l.length),l),V(0,(8-l.length%8)%8,l);for(let e=236;l.length<d;e^=253)V(e,8,l);let c=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((e,t)=>c[t>>>3]|=e<<7-(7&t)),new W(o,t,c,r)}(a,q[t],s,r,i,n);return function(e,t=1){if(!t)return e;let{size:n}=e,s=n+2*t;e.size=s,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:s},e=>!1)),e.data.push(Array.from({length:s},e=>!1));let r=$.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(r),e.push(r)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:s},e=>r)),e.types.push(Array.from({length:s},e=>r));return e}({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},o)}(e),o=eA(e);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,n.jsx)("div",{className:"rounded-lg bg-white p-2.5",children:(0,n.jsx)("svg",{viewBox:`0 0 ${r} ${r}`,className:"block size-31 text-black",role:"img","aria-label":`A picture of ${o} for a phone camera`,children:i.flatMap((e,t)=>e.map((e,s)=>e?(0,n.jsx)("rect",{x:s,y:t,width:1,height:1,fill:"currentColor"},`${s}-${t}`):null))})}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-muted-foreground",children:t}),(0,n.jsx)(eS,{href:e,children:s??o})]})]})}let eA=e=>e.replace(/^https:\/\//,"");function eS({href:e,children:t}){return(0,n.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:(0,eu.cn)((0,k.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,n.jsx)(_.ExternalLink,{}),t]})}function eC({configKey:e,looks:t,set:s,refused:r}){let[i,o]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),d=()=>{o(""),l(!1),(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.reach)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{onOk:d}),[h,f]=(0,ed.useServerAction)(F,{onOk:d}),m=async()=>{await j.notify.confirm({title:"Remove this token?",description:"That service stops, and whoever is let in is let go.",okText:"Remove",destructive:!0})&&h(e)};return s&&!a&&null===r?(0,n.jsx)(k.Button,{size:"xs",variant:"ghost",onClick:()=>l(!0),className:"-ml-2 text-muted-foreground",children:"Change the token"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:t=>{t.preventDefault(),c(e,i)},children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),placeholder:t,"aria-label":"Token",type:"password",autoComplete:"off",spellCheck:!1,className:"w-72 font-mono"}),(0,n.jsx)(k.Button,{type:"submit",size:"sm",loading:u,disabled:i.trim().length<A.KEY_MIN,children:s?"Replace":"Save"}),s&&(0,n.jsxs)(n.Fragment,{children:[null===r&&(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",onClick:()=>l(!1),children:"Cancel"}),(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",loading:f,onClick:()=>void m(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]}),r&&(0,n.jsx)("p",{className:"max-w-xl text-destructive",children:r})]})}function eM(){let[e,t]=(0,p.useState)(!1);return(0,n.jsxs)(k.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(eg).then(()=>{t(!0),setTimeout(()=>t(!1),2e3)}),children:[e?(0,n.jsx)(a.Check,{}):(0,n.jsx)(K.Copy,{}),e?"Copied":"Copy the manifest"]})}function ez({name:e,who:t,stopped:s}){let[r,i]=(0,ed.useServerAction)(eh,{onOk:()=>(0,ec.revalidate)(y.queryKey.reach)});return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3 pl-8 text-[13px] text-muted-foreground",children:[(0,n.jsx)("span",{children:s?`${t} is let in.`:`${t} can write from a phone.`}),(0,n.jsx)(k.Button,{size:"sm",variant:"outline",loading:i,onClick:async()=>{await j.notify.confirm({title:`Let ${t} go?`,description:"Nobody can write to Thursday through this service until someone is let in again.",okText:"Let them go",destructive:!0})&&r(e)},children:"Let them go"})]})}let eE={[T.EXA_API_KEY]:g.Search},eR={image:f.Image,video:u,speech:i.AudioLines,transcription:o.Captions},eI={keys:["voice","easy","text","search"],models:["bots","studio"]};function eF({screen:e}){let{data:t,isLoading:s,error:r}=(0,ec.useServerRoute)(y.queryKey.config);if(s)return(0,n.jsx)(el.SettingSkeleton,{rows:4});if(r)return(0,n.jsx)(el.SettingError,{message:r.message});let i=e=>(0,T.isConfigSet)(t,e),o=e=>t?.find(t=>t.key===e)?.value,a=eI[e].flatMap(e=>T.CONFIG_GROUPS.find(t=>t.id===e)??[]),l=a.filter(e=>"keys"===e.section).flatMap(e=>e.entries);return(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"models"===e?"Her own voice and backend models are in Thursday. A bot can pick its own on its page.":`${l.filter(e=>i(e.key)).length} of ${l.length} set${a.some(e=>!(0,T.groupSatisfied)(e,i))?" · a call needs one voice key":" · your keys stay on this machine"}`}),children:a.map(e=>(0,n.jsx)(el.SettingGroup,{label:e.title,hint:e.hint,right:(0,n.jsx)(eT,{group:e,isSet:i}),children:"easy"===e.id?(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.entries.map(e=>(0,n.jsx)(eK,{card:!0,entry:e,set:i(e.key),needed:!1},e.key))}):"text"===e.id?(0,n.jsx)("div",{className:"flex flex-wrap gap-x-1.5 gap-y-3.5",children:e.entries.map(e=>(0,n.jsx)(eP,{entry:e,set:i(e.key)},e.key))}):(0,n.jsx)(el.SettingItems,{children:e.entries.map(t=>t.effortOf?null:t.choices?(0,n.jsx)(eU,{entry:t,choices:t.choices,value:o(t.key),effort:eG(e,t.key),effortValue:o(T.DEFAULT_EFFORT_KEY)},t.key):(0,n.jsx)(eK,{entry:t,set:i(t.key),needed:!(0,T.groupSatisfied)(e,i)},t.key))})},e.id))})}function eP({entry:e,set:t}){return(0,n.jsxs)("button",{type:"button",onClick:()=>eW(e,t),"aria-label":`${e.label}: ${t?"set":"not set"}`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsxs)("span",{className:"relative grid size-10.5 place-items-center rounded-[13px] bg-muted/60 transition-colors group-hover:bg-muted",children:[(0,n.jsx)(eH,{entry:e}),t&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-primary-foreground ring-2 ring-background",children:(0,n.jsx)(a.Check,{className:"size-2.5"})})]}),(0,n.jsx)("span",{className:(0,eu.cn)("max-w-full truncate text-[11px]",t?"text-foreground":"text-muted-foreground"),children:e.label})]})}function eT({group:e,isSet:t}){return"none"===e.require?null:(0,T.groupSatisfied)(e,t)?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,n.jsx)(a.Check,{className:"size-3"}),"ready"]}):(0,n.jsxs)("span",{className:(0,eu.cn)("flex items-center gap-1 font-mono text-[11px]",eu.WAITING_INK),children:[(0,n.jsx)(x.TriangleAlert,{className:"size-3"}),e.note??"Required"]})}function eK({entry:e,set:t,needed:s,card:r=!1,narrow:i=!1}){let o=eB(e,t),d=eL(e,t),c=eO(e,t),u=d.data?eq(d.data):e$(t,s,o.data,e.signIn),h=o.isLoading||d.isLoading,f=(0,n.jsxs)("span",{className:(0,eu.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",u.ink),children:[u.warn?(0,n.jsx)(x.TriangleAlert,{className:"size-3"}):t&&(0,n.jsx)(a.Check,{className:"size-3"}),u.text]});return(0,n.jsxs)("button",{type:"button",onClick:()=>{var s;return e.signIn?(s=e,j.notify.component({className:"sm:max-w-md",renderer:({close:e})=>(0,n.jsx)(eY,{entry:s,onDone:e})})):eW(e,t)},className:(0,eu.cn)("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",r&&"rounded-xl border border-border/60"),children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(eH,{entry:e})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 truncate text-sm font-medium",children:[e.label,e.recommended&&(0,n.jsx)("span",{className:"rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:"recommended"})]}),i?h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20"}):f:(0,n.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:e.signIn?t?eD(d.data,c):"sign in with your account":e.key})]}),i?null:h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20 shrink-0"}):f,(0,n.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let e_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function e$(e,t,n,s){return e?n?"refused"in n?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${e_.format(n.balance)} left`,ink:n.low?eu.WAITING_INK:"text-muted-foreground",warn:n.low}:{text:s?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:t?{text:"Needed",ink:eu.WAITING_INK,warn:!0}:{text:s?"Signed out":"Not set",ink:"text-muted-foreground/60",warn:!1}}function eB(e,t){return(0,ec.useServerRoute)(t&&"vercel-ai-gateway"===e.provider?y.queryKey.gatewayCredits:null)}function eO(e,t){let{data:n}=(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.llmModel:null);return n?.find(t=>t.id===e.provider)?.plan??null}function eL(e,t){return(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.subscriptionUsage:null)}function eq(e){return"refused"in e?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:e.spent?"Limit reached":`${e.usedPercent}% used`,ink:e.high?eu.WAITING_INK:"text-muted-foreground",warn:e.high}}function eD(e,t){let n=!e||"refused"in e?null:e,r=`${n?.plan??t??"unknown"} plan`;return n?.resetsAt?`${r} \xb7 resets in ${(0,s.formatDistanceToNowStrict)(new Date(n.resetsAt))}`:r}function eH({entry:e}){if(e.provider)return(0,n.jsx)(z.ProviderIcon,{provider:e.provider,className:"size-4"});let t=eE[e.key]??m.KeyRound,s=(0,n.jsx)(t,{className:"size-4 text-muted-foreground"});return e.site?(0,n.jsx)(w.SiteIcon,{host:e.site,className:"size-4 rounded-[4px]",fallback:s}):s}function eU({entry:e,choices:t,value:s,effort:r,effortValue:i}){let o=e.text?(0,E.parseTextModel)(s):(0,E.parseMediaModel)(s),{data:a}=(0,ec.useServerRoute)(e.text&&!s&&y.queryKey.automaticModel),l=e.kind?eR[e.kind]:R.BotsMark,[d]=(0,ed.useServerAction)(P.setConfigAction,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}}),[c]=(0,ed.useServerAction)(F,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}});return(0,n.jsxs)("div",{className:"flex w-full items-start gap-3 p-4",children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(l,{className:"size-4 text-muted-foreground"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 pt-1.5",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),!s&&(0,n.jsx)("span",{className:(0,eu.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",e.kind?eu.WAITING_INK:"text-muted-foreground"),children:e.kind?"off":"auto"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)(M.ModelPicker,{kind:e.kind,provider:o?.provider??null,model:o?.model??"",unset:e.kind?"Not offered to bots until you pick one":function(e,t){if(!e)return"Automatic";if(!e.ref)return e.problem;let{provider:n,model:s}=e.ref,r=t.find(e=>e.value===`${n}/${s}`);return`Automatic \xb7 ${r?.label??s}`}(a,t),onChange:t=>d(e.key,`${t.provider}/${t.model.trim()}`),onUnset:s?()=>{c(e.key),r&&i&&c(r.key)}:void 0})}),r&&o&&(0,n.jsxs)("div",{className:"flex items-start gap-3 pt-0.5",children:[(0,n.jsx)("span",{className:"w-12 shrink-0 pt-1.5 font-mono text-[11px] text-muted-foreground",children:"effort"}),(0,n.jsx)(C.EffortSwitch,{provider:o.provider,model:o.model,value:E.effortSchema.safeParse(i).data??null,onChange:e=>e?d(r.key,e):c(r.key)})]})]})]})]})}let eG=(e,t)=>e.entries.find(e=>e.effortOf===t);function eY({entry:e,onDone:t}){let{data:s}=(0,ec.useServerRoute)(y.queryKey.config),r=(0,T.isConfigSet)(s,e.key),i=eO(e,r),o=eL(e,r),a=o.data?eq(o.data):null,[l,d]=(0,ed.useServerAction)(F,{okMessage:`Signed out of ${e.label}`,onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel),t()}});return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:r?(0,n.jsxs)(n.Fragment,{children:["Signed in ·"," ",(0,n.jsx)("span",{className:"font-mono",children:eD(o.data,i)}),a&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",a.ink),children:a.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(k.Button,{variant:"ghost",loading:d,onClick:async()=>{await j.notify.confirm({title:`Sign out of ${e.label}?`,description:"Nothing runs on your plan until you sign in again.",okText:"Sign out",destructive:!0})&&l(e.key)},children:"Sign out"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:t,children:r?"Close":"Cancel"}),!r&&(0,n.jsx)(S.ChatGptSignIn,{})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingNote,{children:r?"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."}),o.data&&"refused"in o.data&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:o.data.refused})]})})}function eW(e,t){return j.notify.component({className:"sm:max-w-md",renderer:({close:s})=>(0,n.jsx)(eV,{entry:e,set:t,onDone:s})})}function eV({entry:e,set:t,onDone:s}){let[i,o]=(0,p.useState)(""),{data:a}=eB(e,t),l=a?e$(t,!1,a):null,d=()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{d(),s()}}),[h,f]=(0,ed.useServerAction)(F,{okMessage:`${e.label} key removed`,onOk:()=>{d(),s()}}),m=async()=>{await j.notify.confirm({title:`Remove the ${e.label} key?`,description:"It is deleted from this computer, and nothing runs on it until a key is pasted again.",okText:"Remove",destructive:!0})&&h(e.key)};return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"font-mono",children:e.key}),e.hint&&(0,n.jsxs)(n.Fragment,{children:[" · ",e.hint]}),l&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",l.ink),children:l.text})]})]}),footer:(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(k.Button,{variant:"ghost",loading:f,onClick:()=>void m(),className:"mr-auto text-destructive hover:text-destructive",children:"Remove"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:s,children:"Cancel"}),(0,n.jsx)(k.Button,{loading:u,disabled:i.trim().length<A.KEY_MIN,onClick:()=>c(e.key,i),children:t?"Replace":"Save"})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),onKeyDown:t=>{"Enter"===t.key&&i.trim().length>=A.KEY_MIN&&c(e.key,i)},placeholder:t?"New value — replaces the current key":e.keyLooks??"Paste the key",spellCheck:!1,type:"password",autoFocus:!0}),!t&&e.keysAt&&(0,n.jsxs)("a",{href:e.keysAt,target:"_blank",rel:"noreferrer",className:"flex w-fit items-center gap-1 px-0.5 text-[13px] text-foreground underline underline-offset-3 hover:text-foreground/80",children:["Get a key at ",new URL(e.keysAt).host,(0,n.jsx)(r.ArrowUpRight,{className:"size-3.5"})]}),a&&"refused"in a&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:a.refused})]})})}e.s(["AccountsSetup",0,function({withoutVoice:e=!1}){let{data:t}=(0,ec.useServerRoute)(y.queryKey.config),s=e=>(0,T.isConfigSet)(t,e),r=e=>T.CONFIG_GROUPS.find(t=>t.id===e)?.entries??[],[i,o]=(0,p.useState)(!1),a=r("voice"),l=[...a,...r("text")],d=l.filter((t,n)=>(n<4||s(t.key))&&!(e&&a.includes(t))),c=l.filter(t=>!d.includes(t)&&!(e&&a.includes(t)));return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)("div",{className:"flex flex-col gap-2",children:r("easy").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-y-2.5",children:[d.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key)),c.length>0&&(0,n.jsxs)(b.Popover,{open:i,onOpenChange:o,children:[(0,n.jsxs)(b.PopoverTrigger,{"aria-label":`${c.length} more providers`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)("span",{className:"grid size-10.5 place-items-center rounded-[13px] bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,n.jsx)(h.default,{className:"size-4"})}),(0,n.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"More"})]}),(0,n.jsx)(b.PopoverContent,{align:"end",className:"w-78 flex-row flex-wrap gap-0 gap-y-2.5 rounded-2xl p-2.5",onClick:()=>o(!1),children:c.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key))})]})]}),r("search").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))]})},"KeysSetting",0,()=>(0,n.jsx)(eF,{screen:"keys"}),"ModelsSetting",0,()=>(0,n.jsx)(eF,{screen:"models"}),"PhoneSetting",0,()=>(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"Nothing on this computer is opened to the internet: the app asks the chat service what was written."}),children:(0,n.jsx)(ey,{})})],805995)}]);
18
+ `,ex=({children:e})=>(0,n.jsx)("span",{className:"font-medium text-foreground",children:e}),ep={telegram:[{body:(0,n.jsxs)(n.Fragment,{children:["In Telegram, write to ",(0,n.jsx)(ex,{children:"@BotFather"}),", send ",(0,n.jsx)(ex,{children:"/newbot"})," and pick a name. It answers with a ",(0,n.jsx)(ex,{children:"token"}),"."]}),slot:{open:"https://t.me/BotFather",label:"Open @BotFather"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.TELEGRAM_TOKEN_KEY,looks:"123456789:AAE…"}},{body:(0,n.jsx)(n.Fragment,{children:"From your phone, write anything to your bot."}),slot:{says:"Point your phone's camera at it to open the chat."}},{body:(0,n.jsxs)(n.Fragment,{children:["A question with a code appears on this computer. Press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],discord:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(ex,{children:"discord.com/developers"}),", make a ",(0,n.jsx)(ex,{children:"New Application"}),". So nobody else can add it to a server, set ",(0,n.jsx)(ex,{children:"Install Link"})," to"," ",(0,n.jsx)(ex,{children:"None"})," on its ",(0,n.jsx)(ex,{children:"Installation"})," page and turn off"," ",(0,n.jsx)(ex,{children:"Public Bot"})," on its ",(0,n.jsx)(ex,{children:"Bot"})," page. There, press"," ",(0,n.jsx)(ex,{children:"Reset Token"})," and copy it."]}),slot:{open:"https://discord.com/developers/applications",label:"Open discord.com/developers"}},{body:(0,n.jsx)(n.Fragment,{children:"Paste the token here."}),slot:{key:ef.DISCORD_TOKEN_KEY,looks:"MTE…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Add the bot to a server of your own"})," — Discord only delivers a message to a bot you share a server with. A private server made for this is fine."]}),slot:{says:"Point your phone's camera at it, or open it here. It asks which server, and adds the bot with no permissions in it.",does:"Add the bot to a server"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Send the bot a direct message"}),", not in the server: on a phone, tap the bot in the server's member list, then ",(0,n.jsx)(ex,{children:"Message"}),". A question with a code appears here: press ",(0,n.jsx)(ex,{children:"Allow"})," if your phone shows the same code."]})}],slack:[{body:(0,n.jsxs)(n.Fragment,{children:["At ",(0,n.jsx)(({href:e,children:t})=>(0,n.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"font-medium text-foreground underline underline-offset-4 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:t}),{href:"https://api.slack.com/apps",children:"api.slack.com/apps"}),","," ",(0,n.jsx)(ex,{children:"Create New App › From a manifest"}),", and paste the manifest."]}),slot:{manifest:!0}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Basic Information › App-Level Tokens"}),": generate one with"," ",(0,n.jsx)(ex,{children:"connections:write"}),". It starts with xapp-."]}),slot:{key:ef.SLACK_APP_TOKEN_KEY,looks:"xapp-…"}},{body:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ex,{children:"Install App"})," to your workspace. The Bot User OAuth Token starts with xoxb-."]}),slot:{key:ef.SLACK_BOT_TOKEN_KEY,looks:"xoxb-…"}},{body:(0,n.jsxs)(n.Fragment,{children:["In Slack, open the app under ",(0,n.jsx)(ex,{children:"Apps"})," and write in its"," ",(0,n.jsx)(ex,{children:"Messages"})," tab. A question with a code appears here: press"," ",(0,n.jsx)(ex,{children:"Allow"})," if Slack shows the same code."]})}]};function ey(){let e=(0,ec.useServerRoute)(y.queryKey.config),t=(0,ec.useServerRoute)(y.queryKey.reach);(0,eo.useAppEvent)({reach:()=>void(0,ec.revalidate)(y.queryKey.reach)});let s=t=>(0,T.isConfigSet)(e.data,t),r=e=>t.data?.channels.find(t=>t.name===e)??null,i=e=>!!r(e)?.allowed,o=ef.REACH_CHANNELS.find(e=>r(e)?.refused),a=ef.REACH_CHANNELS.find(e=>ef.REACH_KEYS[e].every(s)&&!i(e)),l=!ef.REACH_CHANNELS.some(i),[d,c]=(0,p.useState)(o??a??(l?ef.REACH_CHANNELS[0]:null));return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingItems,{children:ef.REACH_CHANNELS.map(e=>(0,n.jsx)(ek,{name:e,status:r(e),tokensIn:ef.REACH_KEYS[e].filter(s).length,isSet:s,open:d===e,onOpen:()=>c(d===e?null:e)},e))}),(0,n.jsx)(el.SettingNote,{children:"Only the one person you allow can write, and only direct messages are read. Work started here runs whether or not a tab is open, while Thursday is running on this computer."})]})}function ek({name:e,status:t,tokensIn:s,isSet:r,open:i,onOpen:o}){var a;let d,c,u,h,f=ep[e],g=t?.refused??null,x=(a={connected:!!t?.bot,allowed:!!t?.allowed,refused:g},d=f.map(e=>e.slot&&"key"in e.slot?e.slot.key:null),c=e=>!r(e)||e===a.refused,u=d.findIndex(e=>e&&c(e)),h=d.reduce((e,t,n)=>t?n:e,-1),f.map((e,t)=>{let n=d[t];return n?c(n)?t===u?"now":"later":"done":u>=0?t<u?a.refused?"done":"flat":"later":a.allowed||t<h?"done":a.connected?"now":"flat"})),p=!!t?.bot&&!t?.allowed&&!g;return(0,n.jsxs)("div",{children:[(0,n.jsxs)("button",{type:"button",onClick:o,"aria-expanded":i,className:"flex w-full items-center gap-3 px-4 py-3 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)(w.SiteIcon,{host:em[e],className:"size-4 rounded-[4px]",fallback:(0,n.jsx)(m.KeyRound,{className:"size-4 text-muted-foreground"})}),(0,n.jsx)("span",{className:"text-sm font-medium",children:ef.REACH_LABEL[e]}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate",children:(0,n.jsx)(ev,{status:t,tokensIn:s,tokens:ef.REACH_KEYS[e].length})}),(0,n.jsx)(l.ChevronRight,{className:(0,eu.cn)("size-4 shrink-0 text-muted-foreground transition-transform",i&&"rotate-90")})]}),i&&(0,n.jsxs)("div",{className:"px-4 pt-1 pb-4",children:[(0,n.jsx)("ol",{className:"space-y-3",children:f.map((e,s)=>(0,n.jsx)(ej,{n:s+1,step:e,state:x[s],set:!!e.slot&&"key"in e.slot&&r(e.slot.key),refused:e.slot&&"key"in e.slot&&e.slot.key===g?t?.problem??"":null,link:t?.link??null,waiting:p&&s===f.length-1},s))}),t?.allowed&&(0,n.jsx)(ez,{name:e,who:t.allowed.name,stopped:!!g})]})]})}function ev({status:e,tokensIn:t,tokens:s}){let r="text-xs";return t<s?(0,n.jsx)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:t?`${t} of ${s} tokens in`:"Not set"}):e?.refused?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-destructive"),children:["Stopped — ",ef.REACH_LABEL[e.name]," turned the token away"]}):e?.problem?(0,n.jsx)(ea.ShinyText,{text:`${e.bot?"Reconnecting":"Connecting"}… ${e.problem}`,className:(0,eu.cn)(r,"align-middle")}):e?.allowed?(0,n.jsxs)("span",{className:(0,eu.cn)(r,"text-muted-foreground"),children:["Listening as ",e.bot,". ",e.allowed.name," is let in."]}):e?.bot?(0,n.jsx)(ea.ShinyText,{text:`Listening as ${e.bot} — waiting for your first message`,tone:"waiting",className:(0,eu.cn)(r,"align-middle")}):(0,n.jsx)(ea.ShinyText,{text:"Connecting…",className:(0,eu.cn)(r,"align-middle")})}function ej({n:e,step:t,state:s,set:r,refused:i,link:o,waiting:a}){return(0,n.jsxs)("li",{className:"flex gap-3 text-[13px] leading-relaxed",children:[(0,n.jsx)(eb,{n:e,state:s}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,n.jsx)("p",{className:(0,eu.cn)("done"===s||"later"===s?"text-muted-foreground/60 **:text-inherit":"text-muted-foreground"),children:t.body}),(0,n.jsx)(ew,{slot:t.slot,state:s,set:r,refused:i,link:o,waiting:a})]})]})}function eb({n:e,state:t}){return"done"===t?(0,n.jsx)("span",{className:"mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-foreground text-background",children:(0,n.jsx)(a.Check,{className:"size-3"})}):(0,n.jsx)("span",{className:(0,eu.cn)("mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-background font-mono text-[10.5px] ring-1","now"===t?(0,eu.cn)(eu.WAITING_INK,"ring-waiting/40"):"text-muted-foreground ring-border/60","later"===t&&"opacity-60"),children:e})}function ew({slot:e,state:t,set:s,refused:r,link:i,waiting:o}){let a=o&&(0,n.jsx)(ea.ShinyText,{text:"Waiting for your first message…",tone:"waiting"});return"later"===t?null:e&&"key"in e?(0,n.jsx)(eC,{configKey:e.key,looks:e.looks,set:s,refused:r}):"done"===t?e&&"says"in e&&i?(0,n.jsx)(eS,{href:i,children:e.does??eA(i)}):null:e?"open"in e?(0,n.jsx)(eS,{href:e.open,children:e.label}):"manifest"in e?(0,n.jsx)(eM,{}):i?(0,n.jsxs)("div",{className:"space-y-2.5",children:[(0,n.jsx)(eN,{link:i,says:e.says,does:e.does}),a]}):a||null:a||null}function eN({link:e,says:t,does:s}){let{size:r,data:i}=function(e){let{ecc:t="L",boostEcc:n=!1,minVersion:s=1,maxVersion:r=40,maskPattern:i=-1,border:o=1}={},a="string"==typeof e?function(e){var t,n;if(""===e)return[];if(t=e,D.test(t))return[function(e){var t;if(t=e,!D.test(t))throw RangeError("String contains non-numeric characters");let n=[];for(let t=0;t<e.length;){let s=Math.min(e.length-t,3);V(Number.parseInt(e.substring(t,t+s),10),3*s+1,n),t+=s}return new X(Z,e.length,n)}(e)];return(n=e,H.test(n))?[function(e){var t;let n;if(t=e,!H.test(t))throw RangeError("String contains unencodable characters in alphanumeric mode");let s=[];for(n=0;n+2<=e.length;n+=2){let t=45*U.indexOf(e.charAt(n));V(t+=U.indexOf(e.charAt(n+1)),11,s)}return n<e.length&&V(U.indexOf(e.charAt(n)),6,s),new X(J,e.length,s)}(e)]:[en(function(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!==e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2);return t}(e))]}(e):Array.isArray(e)?[en(e)]:void 0;if(!a)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=function(e,t,n=1,s=40,r=-1,i=!0){let o,a;if(!(1<=n&&n<=s&&s<=40)||r<-1||r>7)throw RangeError("Invalid value");for(o=n;;o++){let n=8*er(o,t),r=function(e,t){let n=0;for(let s of e){let e=et(s.mode,t);if(s.numChars>=1<<e)return 1/0;n+=4+e+s.bitData.length}return n}(e,o);if(r<=n){a=r;break}if(o>=s)throw RangeError("Data too long")}for(let e of[B,O,L])i&&a<=8*er(o,e)&&(t=e);let l=[];for(let t of e)for(let e of(V(t.mode[0],4,l),V(t.numChars,et(t.mode,o),l),t.getData()))l.push(e);let d=8*er(o,t);V(0,Math.min(4,d-l.length),l),V(0,(8-l.length%8)%8,l);for(let e=236;l.length<d;e^=253)V(e,8,l);let c=Array.from({length:Math.ceil(l.length/8)},()=>0);return l.forEach((e,t)=>c[t>>>3]|=e<<7-(7&t)),new W(o,t,c,r)}(a,q[t],s,r,i,n);return function(e,t=1){if(!t)return e;let{size:n}=e,s=n+2*t;e.size=s,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:s},e=>!1)),e.data.push(Array.from({length:s},e=>!1));let r=$.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(r),e.push(r)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:s},e=>r)),e.types.push(Array.from({length:s},e=>r));return e}({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},o)}(e),o=eA(e);return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,n.jsx)("div",{className:"rounded-lg bg-white p-2.5",children:(0,n.jsx)("svg",{viewBox:`0 0 ${r} ${r}`,className:"block size-31 text-black",role:"img","aria-label":`A picture of ${o} for a phone camera`,children:i.flatMap((e,t)=>e.map((e,s)=>e?(0,n.jsx)("rect",{x:s,y:t,width:1,height:1,fill:"currentColor"},`${s}-${t}`):null))})}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-muted-foreground",children:t}),(0,n.jsx)(eS,{href:e,children:s??o})]})]})}let eA=e=>e.replace(/^https:\/\//,"");function eS({href:e,children:t}){return(0,n.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:(0,eu.cn)((0,k.buttonVariants)({variant:"outline",size:"sm"})),children:[(0,n.jsx)(_.ExternalLink,{}),t]})}function eC({configKey:e,looks:t,set:s,refused:r}){let[i,o]=(0,p.useState)(""),[a,l]=(0,p.useState)(!1),d=()=>{o(""),l(!1),(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.reach)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{onOk:d}),[h,f]=(0,ed.useServerAction)(F,{onOk:d}),m=async()=>{await j.notify.confirm({title:"Remove this token?",description:"That service stops, and whoever is let in is let go.",okText:"Remove",destructive:!0})&&h(e)};return s&&!a&&null===r?(0,n.jsx)(k.Button,{size:"xs",variant:"ghost",onClick:()=>l(!0),className:"-ml-2 text-muted-foreground",children:"Change the token"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("form",{className:"flex flex-wrap items-center gap-2",onSubmit:t=>{t.preventDefault(),c(e,i)},children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),placeholder:t,"aria-label":"Token",type:"password",autoComplete:"off",spellCheck:!1,className:"w-72 font-mono"}),(0,n.jsx)(k.Button,{type:"submit",size:"sm",loading:u,disabled:i.trim().length<A.KEY_MIN,children:s?"Replace":"Save"}),s&&(0,n.jsxs)(n.Fragment,{children:[null===r&&(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",onClick:()=>l(!1),children:"Cancel"}),(0,n.jsx)(k.Button,{size:"sm",variant:"ghost",loading:f,onClick:()=>void m(),className:"ml-auto text-destructive hover:text-destructive",children:"Remove"})]})]}),r&&(0,n.jsx)("p",{className:"max-w-xl text-destructive",children:r})]})}function eM(){let[e,t]=(0,p.useState)(!1);return(0,n.jsxs)(k.Button,{size:"sm",variant:"outline",onClick:()=>void navigator.clipboard.writeText(eg).then(()=>{t(!0),setTimeout(()=>t(!1),2e3)}),children:[e?(0,n.jsx)(a.Check,{}):(0,n.jsx)(K.Copy,{}),e?"Copied":"Copy the manifest"]})}function ez({name:e,who:t,stopped:s}){let[r,i]=(0,ed.useServerAction)(eh,{onOk:()=>(0,ec.revalidate)(y.queryKey.reach)});return(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3 pl-8 text-[13px] text-muted-foreground",children:[(0,n.jsx)("span",{children:s?`${t} is let in.`:`${t} can write from a phone.`}),(0,n.jsx)(k.Button,{size:"sm",variant:"outline",loading:i,onClick:async()=>{await j.notify.confirm({title:`Let ${t} go?`,description:"Nobody can write to Thursday through this service until someone is let in again.",okText:"Let them go",destructive:!0})&&r(e)},children:"Let them go"})]})}let eE={[T.EXA_API_KEY]:g.Search},eR={image:f.Image,video:u,speech:i.AudioLines,transcription:o.Captions},eI={keys:["voice","easy","text","search"],models:["bots","studio"]};function eF({screen:e}){let{data:t,isLoading:s,error:r}=(0,ec.useServerRoute)(y.queryKey.config);if(s)return(0,n.jsx)(el.SettingSkeleton,{rows:4});if(r)return(0,n.jsx)(el.SettingError,{message:r.message});let i=e=>(0,T.isConfigSet)(t,e),o=e=>t?.find(t=>t.key===e)?.value,a=eI[e].flatMap(e=>T.CONFIG_GROUPS.find(t=>t.id===e)??[]),l=a.filter(e=>"keys"===e.section).flatMap(e=>e.entries);return(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"models"===e?"Her own voice and backend models are in Thursday. A bot can pick its own on its page.":`${l.filter(e=>i(e.key)).length} of ${l.length} set${a.some(e=>!(0,T.groupSatisfied)(e,i))?" · a call needs one voice key":" · your keys stay on this machine"}`}),children:a.map(e=>(0,n.jsx)(el.SettingGroup,{label:e.title,hint:e.hint,right:(0,n.jsx)(eT,{group:e,isSet:i}),children:"easy"===e.id?(0,n.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.entries.map(e=>(0,n.jsx)(eK,{card:!0,entry:e,set:i(e.key),needed:!1},e.key))}):"text"===e.id?(0,n.jsx)("div",{className:"flex flex-wrap gap-x-1.5 gap-y-3.5",children:e.entries.map(e=>(0,n.jsx)(eP,{entry:e,set:i(e.key)},e.key))}):(0,n.jsx)(el.SettingItems,{children:e.entries.map(t=>t.effortOf?null:t.choices?(0,n.jsx)(eU,{entry:t,choices:t.choices,value:o(t.key),effort:eG(e,t.key),effortValue:o(T.DEFAULT_EFFORT_KEY)},t.key):(0,n.jsx)(eK,{entry:t,set:i(t.key),needed:!(0,T.groupSatisfied)(e,i)},t.key))})},e.id))})}function eP({entry:e,set:t}){return(0,n.jsxs)("button",{type:"button",onClick:()=>eW(e,t),"aria-label":`${e.label}: ${t?"set":"not set"}`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsxs)("span",{className:"relative grid size-10.5 place-items-center rounded-[13px] bg-muted/60 transition-colors group-hover:bg-muted",children:[(0,n.jsx)(eH,{entry:e}),t&&(0,n.jsx)("span",{className:"absolute -top-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-primary-foreground ring-2 ring-background",children:(0,n.jsx)(a.Check,{className:"size-2.5"})})]}),(0,n.jsx)("span",{className:(0,eu.cn)("max-w-full truncate text-[11px]",t?"text-foreground":"text-muted-foreground"),children:e.label})]})}function eT({group:e,isSet:t}){return"none"===e.require?null:(0,T.groupSatisfied)(e,t)?(0,n.jsxs)("span",{className:"flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,n.jsx)(a.Check,{className:"size-3"}),"ready"]}):(0,n.jsxs)("span",{className:(0,eu.cn)("flex items-center gap-1 font-mono text-[11px]",eu.WAITING_INK),children:[(0,n.jsx)(x.TriangleAlert,{className:"size-3"}),e.note??"Required"]})}function eK({entry:e,set:t,needed:s,card:r=!1,narrow:i=!1}){let o=eB(e,t),d=eL(e,t),c=eO(e,t),u=d.data?eq(d.data):e$(t,s,o.data,e.signIn),h=o.isLoading||d.isLoading,f=(0,n.jsxs)("span",{className:(0,eu.cn)("flex shrink-0 items-center gap-1.5 font-mono text-xs",u.ink),children:[u.warn?(0,n.jsx)(x.TriangleAlert,{className:"size-3"}):t&&(0,n.jsx)(a.Check,{className:"size-3"}),u.text]});return(0,n.jsxs)("button",{type:"button",onClick:()=>{var s;return e.signIn?(s=e,j.notify.component({className:"sm:max-w-md",renderer:({close:e})=>(0,n.jsx)(eY,{entry:s,onDone:e})})):eW(e,t)},className:(0,eu.cn)("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",r&&"rounded-xl border border-border/60"),children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(eH,{entry:e})}),(0,n.jsxs)("span",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 truncate text-sm font-medium",children:[e.label,e.recommended&&(0,n.jsx)("span",{className:"rounded-full px-1.5 font-mono text-[9.5px] leading-4 font-normal text-muted-foreground ring-1 ring-border ring-inset",children:"recommended"})]}),i?h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20"}):f:(0,n.jsx)("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:e.signIn?t?eD(d.data,c):"sign in with your account":e.key})]}),i?null:h?(0,n.jsx)(N.Skeleton,{className:"h-3 w-20 shrink-0"}):f,(0,n.jsx)(l.ChevronRight,{className:"size-4 shrink-0 text-muted-foreground/60 transition-colors group-hover:text-foreground"})]})}let e_=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});function e$(e,t,n,s){return e?n?"refused"in n?{text:"Key refused",ink:"text-destructive",warn:!0}:{text:`${e_.format(n.balance)} left`,ink:n.low?eu.WAITING_INK:"text-muted-foreground",warn:n.low}:{text:s?"Signed in":"Set",ink:"text-muted-foreground",warn:!1}:t?{text:"Needed",ink:eu.WAITING_INK,warn:!0}:{text:s?"Signed out":"Not set",ink:"text-muted-foreground/60",warn:!1}}function eB(e,t){return(0,ec.useServerRoute)(t&&(0,E.isCatalogProvider)(e.provider)?y.queryKey.keyCredits(e.provider):null)}function eO(e,t){let{data:n}=(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.llmModel:null);return n?.find(t=>t.id===e.provider)?.plan??null}function eL(e,t){return(0,ec.useServerRoute)(t&&e.signIn?y.queryKey.subscriptionUsage:null)}function eq(e){return"refused"in e?{text:"Sign-in refused",ink:"text-destructive",warn:!0}:{text:e.spent?"Limit reached":`${e.usedPercent}% used`,ink:e.high?eu.WAITING_INK:"text-muted-foreground",warn:e.high}}function eD(e,t){let n=!e||"refused"in e?null:e,r=`${n?.plan??t??"unknown"} plan`;return n?.resetsAt?`${r} \xb7 resets in ${(0,s.formatDistanceToNowStrict)(new Date(n.resetsAt))}`:r}function eH({entry:e}){if(e.provider)return(0,n.jsx)(z.ProviderIcon,{provider:e.provider,className:"size-4"});let t=eE[e.key]??m.KeyRound,s=(0,n.jsx)(t,{className:"size-4 text-muted-foreground"});return e.site?(0,n.jsx)(w.SiteIcon,{host:e.site,className:"size-4 rounded-[4px]",fallback:s}):s}function eU({entry:e,choices:t,value:s,effort:r,effortValue:i}){let o=e.text?(0,E.parseTextModel)(s):(0,E.parseMediaModel)(s),{data:a}=(0,ec.useServerRoute)(e.text&&!s&&y.queryKey.automaticModel),l=e.kind?eR[e.kind]:R.BotsMark,[d]=(0,ed.useServerAction)(P.setConfigAction,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}}),[c]=(0,ed.useServerAction)(F,{onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.automaticModel)}});return(0,n.jsxs)("div",{className:"flex w-full items-start gap-3 p-4",children:[(0,n.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted/60",children:(0,n.jsx)(l,{className:"size-4 text-muted-foreground"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,n.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5 pt-1.5",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:e.label}),!s&&(0,n.jsx)("span",{className:(0,eu.cn)("shrink-0 rounded-[5px] border border-border/60 px-1 font-mono text-[10px]",e.kind?eu.WAITING_INK:"text-muted-foreground"),children:e.kind?"off":"auto"})]}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("div",{className:"min-w-0",children:(0,n.jsx)(M.ModelPicker,{kind:e.kind,provider:o?.provider??null,model:o?.model??"",unset:e.kind?"Not offered to bots until you pick one":function(e,t){if(!e)return"Automatic";if(!e.ref)return e.problem;let{provider:n,model:s}=e.ref,r=t.find(e=>e.value===`${n}/${s}`);return`Automatic \xb7 ${r?.label??s}`}(a,t),onChange:t=>d(e.key,`${t.provider}/${t.model.trim()}`),onUnset:s?()=>{c(e.key),r&&i&&c(r.key)}:void 0})}),r&&o&&(0,n.jsxs)("div",{className:"flex items-start gap-3 pt-0.5",children:[(0,n.jsx)("span",{className:"w-12 shrink-0 pt-1.5 font-mono text-[11px] text-muted-foreground",children:"effort"}),(0,n.jsx)(C.EffortSwitch,{provider:o.provider,model:o.model,value:E.effortSchema.safeParse(i).data??null,onChange:e=>e?d(r.key,e):c(r.key)})]})]})]})]})}let eG=(e,t)=>e.entries.find(e=>e.effortOf===t);function eY({entry:e,onDone:t}){let{data:s}=(0,ec.useServerRoute)(y.queryKey.config),r=(0,T.isConfigSet)(s,e.key),i=eO(e,r),o=eL(e,r),a=o.data?eq(o.data):null,[l,d]=(0,ed.useServerAction)(F,{okMessage:`Signed out of ${e.label}`,onOk:()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel),t()}});return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:r?(0,n.jsxs)(n.Fragment,{children:["Signed in ·"," ",(0,n.jsx)("span",{className:"font-mono",children:eD(o.data,i)}),a&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",a.ink),children:a.text})]})]}):"Sign in with your ChatGPT account instead of a key",footer:(0,n.jsxs)(n.Fragment,{children:[r&&(0,n.jsx)(k.Button,{variant:"ghost",loading:d,onClick:async()=>{await j.notify.confirm({title:`Sign out of ${e.label}?`,description:"Nothing runs on your plan until you sign in again.",okText:"Sign out",destructive:!0})&&l(e.key)},children:"Sign out"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:t,children:r?"Close":"Cancel"}),!r&&(0,n.jsx)(S.ChatGptSignIn,{})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(el.SettingNote,{children:r?"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."}),o.data&&"refused"in o.data&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:o.data.refused})]})})}function eW(e,t){return j.notify.component({className:"sm:max-w-md",renderer:({close:s})=>(0,n.jsx)(eV,{entry:e,set:t,onDone:s})})}function eV({entry:e,set:t,onDone:s}){let[i,o]=(0,p.useState)(""),{data:a}=eB(e,t),l=a?e$(t,!1,a):null,d=()=>{(0,ec.revalidate)(y.queryKey.config),(0,ec.revalidate)(y.queryKey.llmModel)},[c,u]=(0,ed.useServerAction)(P.setConfigAction,{okMessage:`${e.label} key saved`,onOk:()=>{d(),s()}}),[h,f]=(0,ed.useServerAction)(F,{okMessage:`${e.label} key removed`,onOk:()=>{d(),s()}}),m=async()=>{await j.notify.confirm({title:`Remove the ${e.label} key?`,description:"It is deleted from this computer, and nothing runs on it until a key is pasted again.",okText:"Remove",destructive:!0})&&h(e.key)};return(0,n.jsx)(el.SettingDialogContent,{title:e.label,description:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"font-mono",children:e.key}),e.hint&&(0,n.jsxs)(n.Fragment,{children:[" · ",e.hint]}),l&&(0,n.jsxs)(n.Fragment,{children:[" · ",(0,n.jsx)("span",{className:(0,eu.cn)("font-mono",l.ink),children:l.text})]})]}),footer:(0,n.jsxs)(n.Fragment,{children:[t&&(0,n.jsx)(k.Button,{variant:"ghost",loading:f,onClick:()=>void m(),className:"mr-auto text-destructive hover:text-destructive",children:"Remove"}),(0,n.jsx)(k.Button,{variant:"ghost",onClick:s,children:"Cancel"}),(0,n.jsx)(k.Button,{loading:u,disabled:i.trim().length<A.KEY_MIN,onClick:()=>c(e.key,i),children:t?"Replace":"Save"})]}),children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(v.Input,{value:i,onChange:e=>o(e.target.value),onKeyDown:t=>{"Enter"===t.key&&i.trim().length>=A.KEY_MIN&&c(e.key,i)},placeholder:t?"New value — replaces the current key":e.keyLooks??"Paste the key",spellCheck:!1,type:"password",autoFocus:!0}),!t&&e.keysAt&&(0,n.jsxs)("a",{href:e.keysAt,target:"_blank",rel:"noreferrer",className:"flex w-fit items-center gap-1 px-0.5 text-[13px] text-foreground underline underline-offset-3 hover:text-foreground/80",children:["Get a key at ",new URL(e.keysAt).host,(0,n.jsx)(r.ArrowUpRight,{className:"size-3.5"})]}),a&&"refused"in a&&(0,n.jsx)(el.SettingNote,{className:"wrap-break-word text-destructive",children:a.refused})]})})}e.s(["AccountsSetup",0,function({withoutVoice:e=!1}){let{data:t}=(0,ec.useServerRoute)(y.queryKey.config),s=e=>(0,T.isConfigSet)(t,e),r=e=>T.CONFIG_GROUPS.find(t=>t.id===e)?.entries??[],[i,o]=(0,p.useState)(!1),a=r("voice"),l=[...a,...r("text")],d=l.filter((t,n)=>(n<4||s(t.key))&&!(e&&a.includes(t))),c=l.filter(t=>!d.includes(t)&&!(e&&a.includes(t)));return(0,n.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,n.jsx)("div",{className:"flex flex-col gap-2",children:r("easy").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-y-2.5",children:[d.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key)),c.length>0&&(0,n.jsxs)(b.Popover,{open:i,onOpenChange:o,children:[(0,n.jsxs)(b.PopoverTrigger,{"aria-label":`${c.length} more providers`,className:"group flex w-17 flex-col items-center gap-1.5 rounded-xl py-1 outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,n.jsx)("span",{className:"grid size-10.5 place-items-center rounded-[13px] bg-muted/60 text-muted-foreground transition-colors group-hover:bg-muted",children:(0,n.jsx)(h.default,{className:"size-4"})}),(0,n.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"More"})]}),(0,n.jsx)(b.PopoverContent,{align:"end",className:"w-78 flex-row flex-wrap gap-0 gap-y-2.5 rounded-2xl p-2.5",onClick:()=>o(!1),children:c.map(e=>(0,n.jsx)(eP,{entry:e,set:s(e.key)},e.key))})]})]}),r("search").map(e=>(0,n.jsx)(eK,{card:!0,narrow:!0,entry:e,set:s(e.key),needed:!1},e.key))]})},"KeysSetting",0,()=>(0,n.jsx)(eF,{screen:"keys"}),"ModelsSetting",0,()=>(0,n.jsx)(eF,{screen:"models"}),"PhoneSetting",0,()=>(0,n.jsx)(el.SettingScreen,{footer:(0,n.jsx)(el.SettingRailNote,{children:"Nothing on this computer is opened to the internet: the app asks the chat service what was written."}),children:(0,n.jsx)(ey,{})})],805995)}]);