thursday-agent 0.12.0 → 0.13.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 (470) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/prerender-manifest.json +4 -4
  4. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  5. package/.next/server/app/_global-error.html +1 -1
  6. package/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/server/app/_not-found/page.js +1 -1
  11. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  12. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/_not-found.html +1 -1
  14. package/.next/server/app/_not-found.rsc +18 -19
  15. package/.next/server/app/_not-found.segments/_full.segment.rsc +18 -19
  16. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +14 -15
  17. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  18. package/.next/server/app/api/artifact/route.js +8 -8
  19. package/.next/server/app/api/artifact/route.js.nft.json +1 -1
  20. package/.next/server/app/api/bot/keep-working/route.js +7 -7
  21. package/.next/server/app/api/bot/keep-working/route.js.nft.json +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 +7 -7
  24. package/.next/server/app/api/bot/memory/route.js.nft.json +1 -1
  25. package/.next/server/app/api/bot/route.js +7 -7
  26. package/.next/server/app/api/bot/route.js.nft.json +1 -1
  27. package/.next/server/app/api/bot/thread/[id]/route.js +5 -5
  28. package/.next/server/app/api/bot/thread/[id]/route.js.nft.json +1 -1
  29. package/.next/server/app/api/bot/thread/route.js +3 -3
  30. package/.next/server/app/api/bot/thread/route.js.nft.json +1 -1
  31. package/.next/server/app/api/config/route.js +3 -3
  32. package/.next/server/app/api/config/route.js.nft.json +1 -1
  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/catalog/route.js +4 -4
  38. package/.next/server/app/api/llm-model/catalog/route.js.nft.json +1 -1
  39. package/.next/server/app/api/llm-model/credits/route.js +4 -4
  40. package/.next/server/app/api/llm-model/credits/route.js.nft.json +1 -1
  41. package/.next/server/app/api/llm-model/route.js +6 -6
  42. package/.next/server/app/api/llm-model/route.js.nft.json +1 -1
  43. package/.next/server/app/api/llm-model/subscription/route.js +6 -6
  44. package/.next/server/app/api/llm-model/subscription/route.js.nft.json +1 -1
  45. package/.next/server/app/api/mcp/[name]/route.js +5 -5
  46. package/.next/server/app/api/mcp/[name]/route.js.nft.json +1 -1
  47. package/.next/server/app/api/mcp/oauth/callback/route.js +5 -5
  48. package/.next/server/app/api/mcp/oauth/callback/route.js.nft.json +1 -1
  49. package/.next/server/app/api/mcp/route.js +5 -5
  50. package/.next/server/app/api/mcp/route.js.nft.json +1 -1
  51. package/.next/server/app/api/mcp/tools/route.js +5 -5
  52. package/.next/server/app/api/mcp/tools/route.js.nft.json +1 -1
  53. package/.next/server/app/api/memory/edit/route.js +15 -14
  54. package/.next/server/app/api/memory/edit/route.js.nft.json +1 -1
  55. package/.next/server/app/api/memory/route.js +4 -4
  56. package/.next/server/app/api/memory/route.js.nft.json +1 -1
  57. package/.next/server/app/api/reach/route.js +13 -12
  58. package/.next/server/app/api/reach/route.js.nft.json +1 -1
  59. package/.next/server/app/api/routine/route.js +8 -9
  60. package/.next/server/app/api/routine/route.js.nft.json +1 -1
  61. package/.next/server/app/api/signins/route.js.nft.json +1 -1
  62. package/.next/server/app/api/skills/[source]/[name]/route.js +2 -2
  63. package/.next/server/app/api/skills/[source]/[name]/route.js.nft.json +1 -1
  64. package/.next/server/app/api/skills/route.js +2 -2
  65. package/.next/server/app/api/skills/route.js.nft.json +1 -1
  66. package/.next/server/app/api/thursday/call/route.js +6 -6
  67. package/.next/server/app/api/thursday/call/route.js.nft.json +1 -1
  68. package/.next/server/app/api/thursday/skills/route.js +6 -6
  69. package/.next/server/app/api/thursday/skills/route.js.nft.json +1 -1
  70. package/.next/server/app/api/thursday/text/route.js +14 -13
  71. package/.next/server/app/api/thursday/text/route.js.nft.json +1 -1
  72. package/.next/server/app/api/thursday/tool-call/route.js +15 -14
  73. package/.next/server/app/api/thursday/tool-call/route.js.nft.json +1 -1
  74. package/.next/server/app/api/workspace/files/route.js +10 -6
  75. package/.next/server/app/api/workspace/files/route.js.nft.json +1 -1
  76. package/.next/server/app/api/workspace/route.js +9 -4
  77. package/.next/server/app/api/workspace/route.js.nft.json +1 -1
  78. package/.next/server/app/artifact/[...path]/page/server-reference-manifest.json +2 -2
  79. package/.next/server/app/artifact/[...path]/page.js +5 -4
  80. package/.next/server/app/artifact/[...path]/page.js.nft.json +1 -1
  81. package/.next/server/app/artifact/[...path]/page_client-reference-manifest.js +1 -1
  82. package/.next/server/app/favicon.ico/route.js.nft.json +1 -1
  83. package/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  84. package/.next/server/app/page/server-reference-manifest.json +67 -56
  85. package/.next/server/app/page.js +10 -11
  86. package/.next/server/app/page.js.nft.json +1 -1
  87. package/.next/server/app/page_client-reference-manifest.js +1 -1
  88. package/.next/server/chunks/{[root-of-the-server]__0o49ztf._.js → [root-of-the-server]__0-k4_ie._.js} +2 -2
  89. package/.next/server/chunks/[root-of-the-server]__0209ah4._.js +6 -6
  90. package/.next/server/chunks/[root-of-the-server]__04wldw9._.js +1 -1
  91. package/.next/server/chunks/[root-of-the-server]__0h_x6q6._.js +2 -2
  92. package/.next/server/chunks/{[root-of-the-server]__0cfszwn._.js → [root-of-the-server]__0i23tc1._.js} +2 -2
  93. package/.next/server/chunks/[root-of-the-server]__0mrk2it._.js +1 -1
  94. package/.next/server/chunks/[root-of-the-server]__0nr-v8s._.js +1 -1
  95. package/.next/server/chunks/{[root-of-the-server]__1tg5got._.js → [root-of-the-server]__0paqm5y._.js} +2 -2
  96. package/.next/server/chunks/[root-of-the-server]__0qog7sm._.js +8 -0
  97. package/.next/server/chunks/[root-of-the-server]__0sm5xvm._.js +1 -1
  98. package/.next/server/chunks/[root-of-the-server]__0yisc5v._.js +5 -0
  99. package/.next/server/chunks/[root-of-the-server]__1-swlkw._.js +3 -3
  100. package/.next/server/chunks/[root-of-the-server]__12iddfq._.js +2 -2
  101. package/.next/server/chunks/{[root-of-the-server]__0npn_pn._.js → [root-of-the-server]__15p29m3._.js} +2 -2
  102. package/.next/server/chunks/[root-of-the-server]__17ses32._.js +3 -0
  103. package/.next/server/chunks/[root-of-the-server]__18-2tsq._.js +2 -2
  104. package/.next/server/chunks/[root-of-the-server]__1cjxw0-._.js +1 -1
  105. package/.next/server/chunks/[root-of-the-server]__1gi2nns._.js +5 -0
  106. package/.next/server/chunks/{[root-of-the-server]__0rqgb17._.js → [root-of-the-server]__1iauz8a._.js} +2 -2
  107. package/.next/server/chunks/[root-of-the-server]__1k3j52n._.js +1 -1
  108. package/.next/server/chunks/{[root-of-the-server]__209k6pk._.js → [root-of-the-server]__1lb_pxg._.js} +2 -2
  109. package/.next/server/chunks/[root-of-the-server]__1ndi14y._.js +1 -1
  110. package/.next/server/chunks/[root-of-the-server]__1orn-5b._.js +1 -1
  111. package/.next/server/chunks/[root-of-the-server]__1xqsrqq._.js +5 -0
  112. package/.next/server/chunks/[root-of-the-server]__1ygplx1._.js +1 -1
  113. package/.next/server/chunks/[root-of-the-server]__2163i40._.js +5 -0
  114. package/.next/server/chunks/_0ci0abh._.js +3 -0
  115. package/.next/server/chunks/_0eauz4t._.js +1 -1
  116. package/.next/server/chunks/_0f6ts7z._.js +1 -1
  117. package/.next/server/chunks/_0fg-1oj._.js +5 -0
  118. package/.next/server/chunks/_0khihjk._.js +2 -2
  119. package/.next/server/chunks/_0n74zsf._.js +1 -1
  120. package/.next/server/chunks/_0na2fj1._.js +2 -2
  121. package/.next/server/chunks/_0oh_99-._.js +3 -0
  122. package/.next/server/chunks/_0x-ej3f._.js +24 -24
  123. package/.next/server/chunks/_0z3nz21._.js +3 -0
  124. package/.next/server/chunks/_10tkr26._.js +1 -1
  125. package/.next/server/chunks/_12-amdu._.js +2 -2
  126. package/.next/server/chunks/_136j09a._.js +1 -1
  127. package/.next/server/chunks/_15740dw._.js +1 -1
  128. package/.next/server/chunks/_18izeh1._.js +5 -0
  129. package/.next/server/chunks/_1_5mnq4._.js +1 -1
  130. package/.next/server/chunks/_1ajbhv6._.js +2 -2
  131. package/.next/server/chunks/_1dc_d1q._.js +2 -2
  132. package/.next/server/chunks/_1drgfx4._.js +1 -1
  133. package/.next/server/chunks/_1e48czp._.js +2 -2
  134. package/.next/server/chunks/_1f06zo4._.js +3 -0
  135. package/.next/server/chunks/_1ic3bew._.js +2 -2
  136. package/.next/server/chunks/_1jn-aep._.js +2 -2
  137. package/.next/server/chunks/_1jn5btd._.js +6 -0
  138. package/.next/server/chunks/_1kg70wc._.js +2 -2
  139. package/.next/server/chunks/_1m2i5pt._.js +5 -0
  140. package/.next/server/chunks/_1ogqovh._.js +4 -4
  141. package/.next/server/chunks/_1qxheoa._.js +1 -1
  142. package/.next/server/chunks/_1ry6afh._.js +18 -0
  143. package/.next/server/chunks/_1taa4bs._.js +1 -1
  144. package/.next/server/chunks/_1tpr507._.js +1 -1
  145. package/.next/server/chunks/_1y8w80a._.js +1 -1
  146. package/.next/server/chunks/_1zxp-p6._.js +1 -1
  147. package/.next/server/chunks/_204744f._.js +5 -0
  148. package/.next/server/chunks/_20fsr_z._.js +1 -1
  149. package/.next/server/chunks/config_ts_1g4sz5o._.js +1 -1
  150. package/.next/server/chunks/features_0-cnt0l._.js +1 -1
  151. package/.next/server/chunks/features_0hdaci0._.js +1 -1
  152. package/.next/server/chunks/features_0p85gv6._.js +3 -0
  153. package/.next/server/chunks/{node_modules_zod_v4_0_v5xf5._.js → node_modules_zod_v4_01bha1c._.js} +2 -2
  154. package/.next/server/chunks/{node_modules_zod_v4_0q9hvql._.js → node_modules_zod_v4_0b99z6a._.js} +2 -2
  155. package/.next/server/chunks/{node_modules_zod_v4_1jg8iwg._.js → node_modules_zod_v4_1zz6lo1._.js} +2 -2
  156. package/.next/server/chunks/ssr/[root-of-the-server]__04upd5v._.js +3 -0
  157. package/.next/server/chunks/ssr/[root-of-the-server]__0dxszdt._.js +3 -0
  158. package/.next/server/chunks/ssr/[root-of-the-server]__0eezycw._.js +3 -0
  159. package/.next/server/chunks/ssr/[root-of-the-server]__0hpp3nw._.js +1 -1
  160. package/.next/server/chunks/ssr/[root-of-the-server]__0yngu44._.js +3 -0
  161. package/.next/server/chunks/ssr/[root-of-the-server]__16z72ny._.js +6 -0
  162. package/.next/server/chunks/ssr/[root-of-the-server]__1u_ry86._.js +3 -0
  163. package/.next/server/chunks/ssr/{[root-of-the-server]__1iwyp1e._.js → [root-of-the-server]__1unh_ew._.js} +1 -1
  164. package/.next/server/chunks/ssr/[root-of-the-server]__20re7ya._.js +3 -0
  165. package/.next/server/chunks/ssr/_00pgq9d._.js +5 -0
  166. package/.next/server/chunks/ssr/_07ke63g._.js +3 -0
  167. package/.next/server/chunks/ssr/_0agcbk7._.js +3 -0
  168. package/.next/server/chunks/ssr/_0e-gw2_._.js +3 -0
  169. package/.next/server/chunks/ssr/{_0fbi6om._.js → _0f_om6y._.js} +3 -3
  170. package/.next/server/chunks/ssr/_0fqhhwi._.js +1 -1
  171. package/.next/server/chunks/ssr/{_026qnc9._.js → _0gpn71k._.js} +3 -3
  172. package/.next/server/chunks/ssr/_0iizjr9._.js +3 -0
  173. package/.next/server/chunks/ssr/_0ixvzo6._.js +75 -0
  174. package/.next/server/chunks/ssr/_0kkdx7t._.js +3 -0
  175. package/.next/server/chunks/ssr/_0lufvw7._.js +118 -0
  176. package/.next/server/chunks/ssr/_0vi6ky6._.js +115 -0
  177. package/.next/server/chunks/ssr/{_10f-jib._.js → _0yhji3e._.js} +2 -2
  178. package/.next/server/chunks/ssr/_0z38nha._.js +3 -0
  179. package/.next/server/chunks/ssr/{_10mo72m._.js → _11nx2d4._.js} +2 -2
  180. package/.next/server/chunks/ssr/_12mijol._.js +2 -2
  181. package/.next/server/chunks/ssr/_150463c._.js +164 -0
  182. package/.next/server/chunks/ssr/{_0rmaf32._.js → _17d2ikl._.js} +2 -2
  183. package/.next/server/chunks/ssr/_19jez1a._.js +3 -0
  184. package/.next/server/chunks/ssr/_1blui1m._.js +3 -0
  185. package/.next/server/chunks/ssr/_1d423aj._.js +4 -4
  186. package/.next/server/chunks/ssr/_1kbk28w._.js +3 -0
  187. package/.next/server/chunks/ssr/_1kj_r9v._.js +3 -0
  188. package/.next/server/chunks/ssr/_1mqn9mc._.js +1 -1
  189. package/.next/server/chunks/ssr/{_0u5xv6g._.js → _1myh7ss._.js} +2 -2
  190. package/.next/server/chunks/ssr/_1neoj22._.js +1 -1
  191. package/.next/server/chunks/ssr/_1ou5sj0._.js +3 -0
  192. package/.next/server/chunks/ssr/_1p8xorg._.js +3 -0
  193. package/.next/server/chunks/ssr/_1tzacpl._.js +3 -0
  194. package/.next/server/chunks/ssr/_1xoch6f._.js +1 -1
  195. package/.next/server/chunks/ssr/_1yh5bj5._.js +1 -1
  196. package/.next/server/chunks/ssr/{_02c7o30._.js → _2021n9-._.js} +2 -2
  197. package/.next/server/chunks/ssr/_20argo3._.js +3 -0
  198. package/.next/server/chunks/ssr/features_bot_1ll3wp7._.js +3 -0
  199. package/.next/server/chunks/ssr/features_bot_1s_-2vj._.js +1 -1
  200. package/.next/server/chunks/ssr/features_bot_thread_query_ts_023eklt._.js +1 -1
  201. package/.next/server/chunks/ssr/features_config_1qxe5ur._.js +20 -0
  202. package/.next/server/chunks/ssr/features_connectors_components_mcp-setting_tsx_0jmbgvp._.js +3 -3
  203. package/.next/server/chunks/ssr/features_memory_components_memory-setting_tsx_0oa43sw._.js +1 -1
  204. package/.next/server/chunks/ssr/features_routine_components_routine-setting_tsx_055fknz._.js +1 -1
  205. package/.next/server/chunks/ssr/features_workspace_00jz2hu._.js +1 -1
  206. package/.next/server/chunks/ssr/{node_modules_0ky76fz._.js → node_modules_06e0wlv._.js} +1 -1
  207. package/.next/server/chunks/ssr/{node_modules_0-x0zxm._.js → node_modules_0cj26-9._.js} +1 -1
  208. package/.next/server/chunks/ssr/{node_modules_0operbz._.js → node_modules_0d1rf5e._.js} +1 -1
  209. package/.next/server/chunks/ssr/{node_modules_0b0iy01._.js → node_modules_0e86703._.js} +1 -1
  210. package/.next/server/chunks/ssr/{node_modules_05b6e99._.js → node_modules_0es09am._.js} +1 -1
  211. package/.next/server/chunks/ssr/{node_modules_1iau_ea._.js → node_modules_0gr_dzf._.js} +1 -1
  212. package/.next/server/chunks/ssr/{node_modules_1hv-j1l._.js → node_modules_0gtcwz9._.js} +1 -1
  213. package/.next/server/chunks/ssr/{node_modules_1c2ikr9._.js → node_modules_0hi9h8f._.js} +1 -1
  214. package/.next/server/chunks/ssr/{node_modules_01u4ea3._.js → node_modules_0lkop0t._.js} +1 -1
  215. package/.next/server/chunks/ssr/{node_modules_1wvf3oo._.js → node_modules_0nghisk._.js} +1 -1
  216. package/.next/server/chunks/ssr/{node_modules_0yzmxfq._.js → node_modules_0stovz0._.js} +1 -1
  217. package/.next/server/chunks/ssr/{node_modules_00nrzz_._.js → node_modules_0we85kr._.js} +1 -1
  218. package/.next/server/chunks/ssr/{node_modules_01ed0yi._.js → node_modules_0ya7y1s._.js} +1 -1
  219. package/.next/server/chunks/ssr/{node_modules_0m3_5ge._.js → node_modules_0yrbwkj._.js} +1 -1
  220. package/.next/server/chunks/ssr/{node_modules_0v_-uht._.js → node_modules_1-x70ie._.js} +1 -1
  221. package/.next/server/chunks/ssr/{node_modules_07jp6tj._.js → node_modules_12fd9g0._.js} +1 -1
  222. package/.next/server/chunks/ssr/{node_modules_1wgnj8q._.js → node_modules_12wxrgr._.js} +1 -1
  223. package/.next/server/chunks/ssr/{node_modules_0azd56x._.js → node_modules_139uu4q._.js} +1 -1
  224. package/.next/server/chunks/ssr/{node_modules_1omg9xr._.js → node_modules_14gpoe1._.js} +1 -1
  225. package/.next/server/chunks/ssr/{node_modules_1ma_y68._.js → node_modules_18fmji6._.js} +1 -1
  226. package/.next/server/chunks/ssr/{node_modules_0ucridu._.js → node_modules_19kkel8._.js} +1 -1
  227. package/.next/server/chunks/ssr/{node_modules_0fpnetd._.js → node_modules_1gcine1._.js} +1 -1
  228. package/.next/server/chunks/ssr/{node_modules_1z3sh11._.js → node_modules_1h4trkm._.js} +1 -1
  229. package/.next/server/chunks/ssr/{node_modules_0lautv3._.js → node_modules_1mub_qu._.js} +1 -1
  230. package/.next/server/chunks/ssr/{node_modules_0ou0all._.js → node_modules_1p78svs._.js} +1 -1
  231. package/.next/server/chunks/ssr/{node_modules_19b0bir._.js → node_modules_1xp-7ep._.js} +1 -1
  232. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0tmjn9w._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_0ay7_oi._.js} +1 -1
  233. package/.next/server/chunks/ssr/{node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_1_e8c3o._.js → node_modules_@mermaid-js_parser_dist_chunks_mermaid-parser_core_182ydq_._.js} +1 -1
  234. package/.next/server/middleware-build-manifest.js +3 -3
  235. package/.next/server/pages/404.html +1 -1
  236. package/.next/server/pages/500.html +1 -1
  237. package/.next/server/server-reference-manifest.js +1 -1
  238. package/.next/server/server-reference-manifest.json +69 -58
  239. package/.next/static/chunks/03df16hs01-xi.js +1 -0
  240. package/.next/static/chunks/0crocb7272z8k.js +1 -0
  241. package/.next/static/chunks/{0p9jcyqkpq71f.js → 0dqsenl3uk_8z.js} +1 -1
  242. package/.next/static/chunks/0hhn8mf953761.js +1 -0
  243. package/.next/static/chunks/0n1o3k0z4m7c_.js +1 -0
  244. package/.next/static/chunks/0oe2zavre2a7d.css +1 -0
  245. package/.next/static/chunks/0srg9tv4105-i.js +1 -0
  246. package/.next/static/chunks/0t599wrclly7i.js +18 -0
  247. package/.next/static/chunks/0x34bhth_sn35.js +1 -0
  248. package/.next/static/chunks/{0mscosx0eh3ee.js → 0x_6z8vt8hyf4.js} +3 -3
  249. package/.next/static/chunks/{0p50d-au6-3hx.js → 1_wstwzu1md-6.js} +2 -2
  250. package/.next/static/chunks/{40ij3wsn3vt7h.js → 1aughn81slf90.js} +1 -1
  251. package/.next/static/chunks/1g1j03h_l-e67.js +1 -0
  252. package/.next/static/chunks/1lp02y2nmddxg.js +1 -0
  253. package/.next/static/chunks/211s4xjtecj2l.js +1 -0
  254. package/.next/static/chunks/2244-cat2jlvd.js +1 -0
  255. package/.next/static/chunks/{2r6xnyg7ezyxr.js → 2eev_i93slion.js} +2 -2
  256. package/.next/static/chunks/2sjq4gsimlfqr.js +113 -0
  257. package/.next/static/chunks/{0qgn3u86jkbm7.js → 2uleilh8ph06-.js} +1 -1
  258. package/.next/static/chunks/{1czfknd4luo6t.js → 2zchsg03a1pdp.js} +1 -1
  259. package/.next/static/chunks/32tmfirfjpulv.js +1 -0
  260. package/.next/static/chunks/{2_c7mu6x1lu49.js → 376-s_i83irs-.js} +1 -1
  261. package/.next/static/chunks/3blk-kpn39xr-.js +1 -0
  262. package/.next/static/chunks/3eieehp7wquyu.js +1 -0
  263. package/.next/static/chunks/3kc-e7pcj50ae.js +1 -0
  264. package/.next/static/chunks/3rwpyuo9nrrop.js +17 -0
  265. package/.next/static/chunks/3sf4l25l353ja.js +1 -0
  266. package/.next/static/chunks/3vz7m1w688juj.js +3 -0
  267. package/.next/static/chunks/43skgt0h9woyu.js +1 -0
  268. package/app/api/events/app-event.client.ts +8 -2
  269. package/app/api/events/app-event.server.ts +7 -5
  270. package/app/api/events/app-event.ts +19 -8
  271. package/app/api/query-key.ts +13 -5
  272. package/bin/database.mjs +21 -11
  273. package/bin/thursday.mjs +5 -2
  274. package/components/ui/shiny-text.tsx +2 -2
  275. package/database/migrations/20260920024909_messy_baron_strucker/migration.sql +1 -0
  276. package/database/migrations/20260920024909_messy_baron_strucker/snapshot.json +1937 -0
  277. package/features/artifact/components/artifact-setting.tsx +18 -24
  278. package/features/bot/bot.action.ts +3 -0
  279. package/features/bot/bot.runner.ts +25 -3
  280. package/features/bot/bot.seed.ts +98 -22
  281. package/features/bot/components/bot-badge.tsx +2 -2
  282. package/features/bot/components/bot-mark.tsx +12 -3
  283. package/features/bot/components/bot-room.tsx +33 -10
  284. package/features/bot/components/bot-setting.tsx +88 -34
  285. package/features/bot/components/crew-motion.ts +161 -0
  286. package/features/bot/components/mark-palette.tsx +3 -3
  287. package/features/bot/components/room-conversation.tsx +13 -8
  288. package/features/bot/components/room-list.tsx +9 -5
  289. package/features/bot/components/room-pill.tsx +131 -41
  290. package/features/bot/components/thread-badge.tsx +4 -4
  291. package/features/bot/components/thread-setting.tsx +58 -19
  292. package/features/bot/mark.const.ts +24 -0
  293. package/features/bot/thread.query.ts +32 -14
  294. package/features/bot/thread.store.ts +19 -16
  295. package/features/config/components/config-badge.tsx +2 -2
  296. package/features/config/components/config-setting.tsx +63 -213
  297. package/features/config/config.const.ts +2 -1
  298. package/features/connectors/components/mcp-setting.tsx +60 -29
  299. package/features/intro/components/intro.tsx +2 -2
  300. package/features/memory/components/memory-setting.tsx +11 -7
  301. package/features/reach/channel.ts +9 -1
  302. package/features/reach/components/reach-guide.tsx +606 -105
  303. package/features/reach/discord.ts +18 -3
  304. package/features/reach/reach.schema.ts +6 -0
  305. package/features/reach/reach.ts +55 -2
  306. package/features/reach/slack.ts +2 -1
  307. package/features/reach/telegram.ts +5 -1
  308. package/features/routine/components/routine-setting.tsx +46 -18
  309. package/features/settings/components/setting-ui.tsx +17 -68
  310. package/features/settings/components/settings.tsx +4 -3
  311. package/features/settings/settings.alert.ts +8 -8
  312. package/features/skills/components/skills-setting.tsx +78 -12
  313. package/features/skills/skills.action.ts +12 -0
  314. package/features/skills/skills.query.ts +24 -0
  315. package/features/thursday/components/call-log.tsx +19 -14
  316. package/features/thursday/components/side-captions.tsx +3 -2
  317. package/features/thursday/components/thursday-setting.tsx +5 -6
  318. package/features/thursday/components/thursday.tsx +8 -9
  319. package/features/thursday/components/write-line.tsx +10 -5
  320. package/features/thursday/thursday.action.ts +4 -0
  321. package/features/thursday/thursday.query.ts +3 -2
  322. package/features/thursday/thursday.schema.ts +5 -0
  323. package/features/thursday/use-call-ring.ts +6 -1
  324. package/features/thursday/use-text-call.ts +25 -10
  325. package/features/thursday/use-thursday.ts +10 -1
  326. package/features/workspace/components/artifact-view.tsx +42 -33
  327. package/features/workspace/components/file-thumb.tsx +8 -4
  328. package/features/workspace/components/file-view.tsx +25 -2
  329. package/features/workspace/components/workspace-setting.tsx +27 -23
  330. package/features/workspace/workspace.query.ts +20 -1
  331. package/features/workspace/workspace.ts +14 -0
  332. package/guide/bots.md +27 -4
  333. package/guide/calls.md +5 -3
  334. package/guide/phone.md +23 -12
  335. package/guide/setup.md +20 -5
  336. package/guide/trouble.md +1 -1
  337. package/hooks/use-theme.ts +14 -0
  338. package/lib/protocol/events.client.ts +56 -14
  339. package/lib/protocol/events.server.ts +41 -12
  340. package/lib/utils.ts +1 -1
  341. package/package.json +1 -1
  342. package/scripts/reach-channels.test.mts +15 -2
  343. package/seed-skills/brief/daily-brief/SKILL.md +39 -0
  344. package/seed-skills/brief/daily-brief/page/brief.css +406 -0
  345. package/seed-skills/brief/daily-brief/references/brief.md +106 -0
  346. package/seed-skills/brief/daily-brief/references/preferences.md +67 -0
  347. package/seed-skills/brief/daily-brief/scripts/glance.mjs +128 -0
  348. package/seed-skills/brief/daily-brief/scripts/lib.mjs +182 -0
  349. package/seed-skills/brief/daily-brief/scripts/news.mjs +320 -0
  350. package/seed-skills/brief/daily-brief/scripts/page.mjs +322 -0
  351. package/seed-skills/brief/daily-brief/scripts/story.mjs +265 -0
  352. package/seed-skills/digest/README.md +20 -0
  353. package/seed-skills/digest/media-digest/SKILL.md +32 -0
  354. package/seed-skills/digest/media-digest/references/no-captions.md +20 -0
  355. package/seed-skills/digest/media-digest/references/page.md +56 -0
  356. package/seed-skills/digest/media-digest/references/reading.md +56 -0
  357. package/seed-skills/digest/media-digest/scripts/audio.mjs +232 -0
  358. package/seed-skills/digest/media-digest/scripts/digest.mjs +379 -0
  359. package/seed-skills/digest/media-digest/scripts/lib.mjs +284 -0
  360. package/seed-skills/digest/media-digest/scripts/part.mjs +16 -0
  361. package/seed-skills/digest/media-digest/scripts/text.mjs +287 -0
  362. package/seed-skills/digest/media-digest/scripts/yt.mjs +487 -0
  363. package/seed-skills/docs/README.md +32 -0
  364. package/seed-skills/docs/documents/SKILL.md +34 -0
  365. package/seed-skills/docs/documents/kit/package-lock.json +1596 -0
  366. package/seed-skills/docs/documents/kit/package.json +17 -0
  367. package/seed-skills/docs/documents/references/deck.md +63 -0
  368. package/seed-skills/docs/documents/references/invoice.md +64 -0
  369. package/seed-skills/docs/documents/references/pdf.md +59 -0
  370. package/seed-skills/docs/documents/references/print.md +43 -0
  371. package/seed-skills/docs/documents/references/sheets.md +49 -0
  372. package/seed-skills/docs/documents/references/translate.md +37 -0
  373. package/seed-skills/docs/documents/references/word.md +45 -0
  374. package/seed-skills/docs/documents/scripts/doc.mjs +123 -0
  375. package/seed-skills/docs/documents/scripts/lib/browser.mjs +259 -0
  376. package/seed-skills/docs/documents/scripts/lib/deck-chart.mjs +150 -0
  377. package/seed-skills/docs/documents/scripts/lib/deck.mjs +1132 -0
  378. package/seed-skills/docs/documents/scripts/lib/invoice.mjs +505 -0
  379. package/seed-skills/docs/documents/scripts/lib/kit.mjs +244 -0
  380. package/seed-skills/docs/documents/scripts/lib/pdf.mjs +645 -0
  381. package/seed-skills/docs/documents/scripts/lib/report.mjs +38 -0
  382. package/seed-skills/docs/documents/scripts/lib/sheet.mjs +523 -0
  383. package/seed-skills/docs/documents/scripts/lib/templates.mjs +34 -0
  384. package/seed-skills/docs/documents/scripts/lib/translate.mjs +691 -0
  385. package/seed-skills/docs/documents/scripts/lib/word.mjs +678 -0
  386. package/seed-skills/docs/documents/templates/letter.html +56 -0
  387. package/seed-skills/docs/documents/templates/print.css +219 -0
  388. package/seed-skills/docs/documents/templates/report.html +47 -0
  389. package/seed-skills/docs/documents/templates/resume.html +61 -0
  390. package/seed-skills/insta/instagram/references/post.md +31 -7
  391. package/seed-skills/trip/README.md +11 -0
  392. package/seed-skills/trip/travel/SKILL.md +40 -0
  393. package/seed-skills/trip/travel/page/itinerary.css +488 -0
  394. package/seed-skills/trip/travel/references/itinerary.md +70 -0
  395. package/seed-skills/trip/travel/references/plan.md +75 -0
  396. package/seed-skills/trip/travel/references/watch-and-book.md +39 -0
  397. package/seed-skills/trip/travel/scripts/flights.mjs +374 -0
  398. package/seed-skills/trip/travel/scripts/fx.mjs +57 -0
  399. package/seed-skills/trip/travel/scripts/hotels.mjs +356 -0
  400. package/seed-skills/trip/travel/scripts/itinerary.mjs +482 -0
  401. package/seed-skills/trip/travel/scripts/lib.mjs +120 -0
  402. package/seed-skills/trip/travel/scripts/selectors.mjs +78 -0
  403. package/seed-skills/trip/travel/scripts/watch.mjs +147 -0
  404. package/seed-skills/trip/travel/scripts/weather.mjs +150 -0
  405. package/seed-skills/tutor/picture-book/SKILL.md +6 -0
  406. package/seed-skills/tutor/picture-book/references/picture-book.md +22 -2
  407. package/.next/server/chunks/[root-of-the-server]__014ydvq._.js +0 -8
  408. package/.next/server/chunks/[root-of-the-server]__01d285y._.js +0 -5
  409. package/.next/server/chunks/[root-of-the-server]__04r4h-2._.js +0 -7
  410. package/.next/server/chunks/[root-of-the-server]__0ayldfn._.js +0 -5
  411. package/.next/server/chunks/[root-of-the-server]__17weeeg._.js +0 -5
  412. package/.next/server/chunks/[root-of-the-server]__1ai5lme._.js +0 -8
  413. package/.next/server/chunks/_05v8k21._.js +0 -7
  414. package/.next/server/chunks/_0k6qjcf._.js +0 -5
  415. package/.next/server/chunks/_1d_enhu._.js +0 -3
  416. package/.next/server/chunks/_1jc5g4p._.js +0 -6
  417. package/.next/server/chunks/_1nfr-75._.js +0 -3
  418. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_0md6j0x._.js +0 -3
  419. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_14ih1vy._.js +0 -3
  420. package/.next/server/chunks/node_modules_consola_dist_chunks_prompt_mjs_1d6ez5-._.js +0 -3
  421. package/.next/server/chunks/ssr/[root-of-the-server]__0a967km._.js +0 -3
  422. package/.next/server/chunks/ssr/[root-of-the-server]__0tzekbl._.js +0 -68
  423. package/.next/server/chunks/ssr/[root-of-the-server]__1756892._.js +0 -3
  424. package/.next/server/chunks/ssr/[root-of-the-server]__1mzi-ju._.js +0 -3
  425. package/.next/server/chunks/ssr/[root-of-the-server]__1nqw56a._.js +0 -3
  426. package/.next/server/chunks/ssr/[root-of-the-server]__1r77-88._.js +0 -3
  427. package/.next/server/chunks/ssr/[root-of-the-server]__1w9hqq8._.js +0 -8
  428. package/.next/server/chunks/ssr/_05pl_u8._.js +0 -3
  429. package/.next/server/chunks/ssr/_097-ljd._.js +0 -4
  430. package/.next/server/chunks/ssr/_0euzzf8._.js +0 -3
  431. package/.next/server/chunks/ssr/_0evkpto._.js +0 -3
  432. package/.next/server/chunks/ssr/_0igfcax._.js +0 -20
  433. package/.next/server/chunks/ssr/_0lu1n_x._.js +0 -3
  434. package/.next/server/chunks/ssr/_0nvh1h9._.js +0 -3
  435. package/.next/server/chunks/ssr/_0qmpw35._.js +0 -3
  436. package/.next/server/chunks/ssr/_0uv-qs4._.js +0 -3
  437. package/.next/server/chunks/ssr/_132qkfz._.js +0 -5
  438. package/.next/server/chunks/ssr/_15zqt-t._.js +0 -3
  439. package/.next/server/chunks/ssr/_16gfxpn._.js +0 -3
  440. package/.next/server/chunks/ssr/_184327j._.js +0 -3
  441. package/.next/server/chunks/ssr/_18ujhhq._.js +0 -3
  442. package/.next/server/chunks/ssr/_1lx6w_o._.js +0 -67
  443. package/.next/server/chunks/ssr/_1ntpny5._.js +0 -3
  444. package/.next/server/chunks/ssr/_1o1g4uk._.js +0 -5
  445. package/.next/server/chunks/ssr/_1xx4zlb._.js +0 -3
  446. package/.next/server/chunks/ssr/_2008vmi._.js +0 -164
  447. package/.next/server/chunks/ssr/features_bot_1n1s7bh._.js +0 -3
  448. package/.next/static/chunks/09pkygbht7ki8.js +0 -18
  449. package/.next/static/chunks/0bm-nhblcmmj4.js +0 -17
  450. package/.next/static/chunks/0c_g4-11sha-1.js +0 -1
  451. package/.next/static/chunks/0hhza87hkbqaz.js +0 -1
  452. package/.next/static/chunks/0samf80yu2b17.js +0 -1
  453. package/.next/static/chunks/0vlgzqo9ka90v.js +0 -1
  454. package/.next/static/chunks/1g9yyvculuxj2.js +0 -1
  455. package/.next/static/chunks/1jz8n0mhtdzr8.js +0 -1
  456. package/.next/static/chunks/206laxm6maiz2.js +0 -1
  457. package/.next/static/chunks/23nfu5g4vl_m7.js +0 -1
  458. package/.next/static/chunks/2h-tlhb2ffhkk.js +0 -1
  459. package/.next/static/chunks/2i5_w8olnrvo0.js +0 -3
  460. package/.next/static/chunks/2m6jd3586ijb-.js +0 -1
  461. package/.next/static/chunks/2m8iqwc6sykln.js +0 -1
  462. package/.next/static/chunks/33fyp-byw48ju.js +0 -65
  463. package/.next/static/chunks/35yd_27d9ylra.js +0 -1
  464. package/.next/static/chunks/3ag1i3__yl94f.js +0 -1
  465. package/.next/static/chunks/3m_ejzg-xn21r.css +0 -1
  466. package/.next/static/chunks/3s-jpd3ky49-n.js +0 -1
  467. package/features/reach/components/reach-state.tsx +0 -71
  468. /package/.next/static/{QSe0rTdXU5kh5BBzr2XBB → fiNGsQfna8qldl8wU8wqr}/_buildManifest.js +0 -0
  469. /package/.next/static/{QSe0rTdXU5kh5BBzr2XBB → fiNGsQfna8qldl8wU8wqr}/_clientMiddlewareManifest.js +0 -0
  470. /package/.next/static/{QSe0rTdXU5kh5BBzr2XBB → fiNGsQfna8qldl8wU8wqr}/_ssgManifest.js +0 -0
@@ -1,17 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,302707,e=>{"use strict";var t=e.i(843476),n=e.i(689664),r=e.i(24071),i=e.i(867927),s=e.i(638292),a=e.i(456420);let o={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};o.node;let l=(0,a.default)(o),u={name:"volume-x",size:24,node:[["path",{d:"M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z",key:"1p7khw"}],["path",{d:"m16.5 14.5 5-5",key:"cul3yw"}],["path",{d:"m16.5 9.5 5 5",key:"1akey5"}]]};u.node;let c=(0,a.default)(u);var d=e.i(618566),h=e.i(271645),f=e.i(798120),p=e.i(167881),m=e.i(660302),g=e.i(319036),x=e.i(728231),y=e.i(146538),v=e.i(265402),b=e.i(463625),_=e.i(635963),w=e.i(747985),k=e.i(805995),j=e.i(616816),T=e.i(560334),S=e.i(722560),N=e.i(992112),C=e.i(218080);let E={hello:"Hi, I'm Thursday. One thing first: this is a recording. You'll hear my real voice on our first call.",key:"My real voice comes from OpenAI, and it needs a key — think of it as a password. Paste one in, and I wake up. Don't have one yet? No problem, skip ahead. I'll ask again later.",awake:"There we go — I'm awake. That key is all a call needs. The rest is quick: your microphone, who does the work for you, and what they think with.",mic:"Now let me hear you. Your browser will ask before it turns the microphone on. Say yes, then say anything — and watch the line under me move. It's only on during a call, unless you ask for more.",heard:"I hear you — that line is your voice. If you'd rather wake me by saying my name instead of tapping, switch that on here and give it a try.",bots:"Big jobs go to my helper bots, so you and I can keep talking while they work. They work right here on your computer, with a browser and your files. Signing in and paying always stay with you.",models:"Every bot runs on an A.I. model that you pick. Start small: a small one is fast and cheap, and you can move any bot up later. Your OpenAI key already covers it. A GPT subscription, or a Vercel key, opens up a lot more.",call:"That's everything. Call me, tell me what to call you, and ask for one thing — anything you'd ask someone sitting next to you. From here on, it's my real voice. I'll show you the rest as we go.",asleep:"I still don't have a voice of my own, so no calls yet — but everything else works. Have a look around. When you have a key, tap me, and I'll take it from there."},M=Array(C.SPECTRUM_BANDS).fill(0),O="thursday.intro.muted";var A=e.i(745747),R=e.i(333495),I=e.i(435135),L=e.i(692888),P=e.i(762074),D=e.i(114923),z=e.i(234916),F=e.i(67045),B=e.i(895499),$=e.i(656572),q=e.i(609856),U=e.i(283653),H=e.i(647163);let K=["key","mic","bots","models","call"];function Y({children:e}){return(0,t.jsxs)("p",{className:"text-[17px] leading-[1.675] tracking-[0.3px]",children:[(0,t.jsx)("span",{className:"mr-4 inline-block size-2.5 rounded-full bg-foreground align-middle opacity-55"}),e]})}let V=({children:e})=>(0,t.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-pretty text-muted-foreground/70",children:e});function W({children:e,tail:r}){return(0,t.jsxs)("p",{className:"flex items-center gap-2.5 text-sm",children:[(0,t.jsx)("span",{className:"grid size-5 shrink-0 animate-in place-items-center rounded-full bg-primary text-primary-foreground duration-300 zoom-in-50",children:(0,t.jsx)(n.Check,{className:"size-3"})}),(0,t.jsx)("span",{className:"animate-in delay-150 duration-300 fill-mode-backwards fade-in slide-in-from-left-1",children:e}),r&&(0,t.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground/70",children:r})]})}function G({keyed:e,onSaved:n}){return e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{children:"OpenAI key saved"}),(0,t.jsx)(V,{children:"Change it any time in Settings › API keys."})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Paste your OpenAI API key"}),(0,t.jsx)(j.VoiceKeys,{dense:!0,plain:!0,autoFocus:!0,onSaved:n}),(0,t.jsx)(j.GetKeyLink,{}),(0,t.jsx)("ol",{className:"flex flex-col gap-1.75 text-[13px] text-muted-foreground",children:["Sign in, or make an account","Create new secret key, and copy it","Paste it here"].map((e,n)=>(0,t.jsxs)("li",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"grid size-4.5 shrink-0 place-items-center rounded font-mono text-[10px] text-foreground bg-secondary",children:n+1}),e]},e))}),(0,t.jsx)(V,{children:"OpenAI bills it by the minute of call, separately from ChatGPT."})]})}function X({mic:e}){let r=(0,F.useThursdayStore)(e=>e.wake),i=(0,F.useThursdayStore)(e=>e.patch),[a,o]=(0,h.useState)(!1),[l,u]=(0,h.useState)(null);return((0,$.useWakeWord)({enabled:e.on&&r.enabled&&!l,phrases:[r.phrase],onWake:()=>o(!0),onError:u}),e.on)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{children:"Microphone is on"}),(0,t.jsxs)("label",{className:"mt-1.5 flex cursor-pointer items-start gap-3",children:[(0,t.jsxs)("span",{className:"flex flex-1 flex-col gap-0.75",children:[(0,t.jsx)("span",{className:"text-sm",children:"Wake her by voice"}),(0,t.jsxs)(V,{children:["Say ",(0,t.jsxs)("span",{className:"text-foreground",children:['"',r.phrase,'"']})," and she picks up. The microphone stays open for as long as this tab is."]}),r.enabled&&!l&&(a?(0,t.jsxs)("span",{className:"mt-1.5 flex items-center gap-2 text-[13px]",children:[(0,t.jsx)("span",{className:"grid size-5 shrink-0 animate-in place-items-center rounded-full bg-foreground text-background duration-300 zoom-in-50",children:(0,t.jsx)(n.Check,{className:"size-3"})}),"Heard you. That is how you call her."]}):(0,t.jsxs)("span",{className:"mt-1.5 flex items-center gap-2 text-[13px]",children:[(0,t.jsx)(s.Mic,{className:"size-4 shrink-0"}),(0,t.jsx)(m.ShinyText,{text:`Try it now: say "${r.phrase}"`,speed:2.2})]})),l&&(0,t.jsx)(V,{children:l})]}),(0,t.jsx)(g.Switch,{checked:r.enabled,onCheckedChange:e=>i({wake:{...r,enabled:e}})})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Turn on the microphone"}),(0,t.jsxs)(p.Button,{onClick:()=>void e.turnOn(),className:"h-11 self-start rounded-full px-5 pl-4 text-sm",children:[(0,t.jsx)(s.Mic,{className:""}),"Turn it on"]}),e.blocked?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-[13px] leading-normal text-amber-700 dark:text-amber-400",children:"This page is not allowed the microphone yet."}),(0,t.jsx)(V,{children:"The icon at the left of the address bar opens the site's settings: set Microphone to Allow and come back. Or just go on."})]}):(0,t.jsx)(V,{children:"Used on a call, and nowhere else unless you switch on waking her by voice."})]})}function J({picked:e,face:n,onToggle:r}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Pick who comes along"}),(0,t.jsx)("div",{className:"flex flex-col",children:b.BOT_SEEDS.map(i=>{let s=!!e[i.name];return(0,t.jsxs)("label",{className:"flex h-9.5 cursor-pointer items-center gap-2.75",children:[(0,t.jsx)(_.BotMark,{size:24,seed:i.name,...n(i),notify:!1,className:(0,H.cn)("shrink-0 transition-opacity",!s&&"opacity-40")}),(0,t.jsx)("span",{className:(0,H.cn)("w-17.5 shrink-0 text-[13.5px] font-medium",!s&&"text-muted-foreground"),children:i.name}),(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate text-xs text-muted-foreground",children:i.hint}),(0,t.jsx)(g.Switch,{checked:s,onCheckedChange:()=>r(i.name)})]},i.name)})}),(0,t.jsx)(V,{children:"Every one comes along. Switch off any you will not use: Settings › Bots has them all, and you can make your own."})]})}function Q(){let{data:e}=(0,U.useServerRoute)(f.queryKey.config),n=(0,v.parseTextModel)(e?.find(e=>e.key===N.DEFAULT_MODEL_KEY)?.value),[r,i]=(0,h.useState)(null),[s]=(0,q.useServerAction)(S.setConfigAction,{onOk:()=>(0,U.revalidate)(f.queryKey.config)}),[a]=(0,q.useServerAction)(T.removeConfigAction,{onOk:()=>(0,U.revalidate)(f.queryKey.config)});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Y,{children:"Pick what they think with"}),(0,t.jsx)(k.AccountsSetup,{withoutVoice:!0}),(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("span",{className:"shrink-0 text-[13px] text-muted-foreground",children:"Bots think with"}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsx)(y.ModelPicker,{provider:r??n?.provider??null,model:r?"":n?.model??"",unset:"Automatic",onChange:e=>{if(!e.model.trim())return i(e.provider);i(null),s(N.DEFAULT_MODEL_KEY,`${e.provider}/${e.model.trim()}`)},onUnset:()=>{i(null),n&&a(N.DEFAULT_MODEL_KEY)}})})]})]})}function Z({mic:e,bots:r}){let i=["voice",e?"microphone":null,r>0?`${r} ${1===r?"bot":"bots"}`:null].filter(e=>null!==e);return(0,t.jsx)("span",{className:"flex items-center gap-2 text-xs",children:i.map((e,r)=>(0,t.jsxs)("span",{style:{animationDelay:`${300+260*r}ms`},className:"flex animate-in items-center gap-2 duration-300 fill-mode-backwards fade-in slide-in-from-bottom-1",children:[r>0&&(0,t.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(n.Check,{className:"size-3.25"}),e]})]},e))})}let ee={threadId:"demo",label:"Osaka flights, October",bot:"Analyst",words:"Three fares from ₩296,000 out of Incheon. The Tuesday morning one is the pick: direct, and the cheapest by a little.",paths:[]};function et({stage:e,icons:n}){return(0,t.jsxs)(t.Fragment,{children:["landed"===e&&(0,t.jsx)("div",{className:"pointer-events-none absolute bottom-5 left-5 w-90 text-left",children:(0,t.jsx)(B.FinishedCard,{row:ee,bot:{icon:n[b.BOT_SEEDS.findIndex(e=>e.name===ee.bot)]},onOpen:()=>{},onClose:()=>{}})}),(0,t.jsxs)("div",{className:"absolute right-5 bottom-5 flex h-10 items-center gap-2.5 rounded-full bg-background pr-3.5 pl-2.5 ring-1 ring-border",children:[(0,t.jsx)("span",{className:"flex",children:b.BOT_SEEDS.map((r,i)=>(0,t.jsx)(_.BotMark,{size:22,seed:r.name,...n[i],state:"working"===e&&"Analyst"===r.name?"thinking":"idle",notify:!1,className:(0,H.cn)("shrink-0",i>0&&"-ml-1.5")},r.name))}),(0,t.jsx)("span",{className:"w-40 truncate text-left text-[13px] text-muted-foreground",children:"working"===e?"Analyst · reading fares":"landed"===e?"Analyst finished":"Need a hand?"})]})]})}e.s(["Intro",0,function({ready:e,firstRun:n,forced:s,icons:a}){let o=n||s,u=(0,d.useRouter)(),f=(0,P.useThursdayFace)(),[m,g]=(0,h.useState)("hello"),[y,v]=(0,h.useState)(!1),[_,k]=(0,h.useState)(!1),[j,T]=(0,h.useState)(e),[S,N]=(0,h.useState)(null),[F,B]=(0,h.useState)(()=>Object.fromEntries(b.BOT_SEEDS.map(e=>[e.name,!0]))),$=function(e){let[t,n]=(0,h.useState)("off"),[r,i]=(0,h.useState)(!1),[s,a]=(0,h.useState)(""),o=(0,h.useRef)(null),l=(0,h.useRef)(null),u=(0,h.useCallback)(()=>{for(let e of l.current?.getTracks()??[])e.stop();l.current=null},[]);return(0,h.useEffect)(()=>{e||(u(),n(e=>"on"===e?"off":e))},[e,u]),(0,h.useEffect)(()=>u,[u]),{on:"on"===t,blocked:"blocked"===t,allowed:r,label:s,turnOn:(0,h.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});l.current=e,o.current??=(0,C.createAudioTap)(),o.current.open(),o.current.hear?.(e),a(e.getAudioTracks()[0]?.label??""),n("on"),i(!0)}catch{n("blocked")}},[]),spectrum:(0,h.useCallback)(()=>o.current?.readMic()??[],[])}}("mic"===m&&!y),q=function(e){let[t,n]=(0,h.useState)(0);(0,h.useEffect)(()=>{if(!e)return;let t=performance.now(),r=setInterval(()=>n((performance.now()-t)%16e3),120);return()=>clearInterval(r)},[e]);let r=(e,t,n)=>({id:e,role:t,text:n}),i=[];t>900&&i.push(r("ask","user","Find me flights to Osaka in October.")),t>4700&&i.push(r("onIt","assistant","On it. Analyst is looking. Keep talking, I will say when it is back.")),t>11500&&i.push(r("back","assistant","Analyst is back. From ₩296,000, out of Incheon. The page is on your screen."));let s=t>4700&&t<8300||t>11500&&t<14500;return{turns:i,status:s?"speaking":t>900&&t<4700?"listening":"idle",stage:t>9600?"landed":t>5400?"working":t>900?"asked":"rest",saying:s,voice:z.silentVoice}}("hello"===m&&o&&!y),U=o&&!y;(0,h.useEffect)(()=>(A.callSignal.hold(U),()=>A.callSignal.hold(!1)),[U]),(0,h.useEffect)(()=>{if(!y)return;let e=setTimeout(()=>k(!0),700);return()=>clearTimeout(e)},[y]);let Y=K.indexOf(m),V=(0,h.useMemo)(()=>{var e,t,n;let r,i;return e=m,t=j,n=$.on,r=(e,t)=>({id:e,role:"assistant",text:t}),i=[],"hello"===e||(i.push(r("key","I am Thursday. My voice comes from OpenAI, so the first thing I need is a key: paste one and I wake up. No key yet? Go on without it, and I will ask again when you call.")),t&&i.push(r("awake","There, I am awake, and that key is everything a call needs. From here on it is quick: your microphone, who works for you, and what they think with.")),"key"===e||(i.push(r("mic","Now let me hear you. Your browser asks before it opens the microphone: say yes, then say anything at all and watch the line under me move. It is only open on a call, unless you ask for more.")),n&&i.push(r("heard","I hear you: that line is your voice. If you would rather wake me by saying my name than by tapping me, switch it on here and try it once.")),"mic"===e||(i.push(r("bots","Long work goes to bots, so we can keep talking while they are at it. They work on this computer, with a shell, a browser and your files, and signing in or paying always stays with you.")),"bots"===e||(i.push(r("models","Bots think with a model you choose. Start small: a small model is quick and costs little, and any bot can move up later. An OpenAI key already covers it; a GPT subscription or one Vercel key opens far more.")),"models"===e||i.push(t?r("call","That is everything I need. Call me, tell me what to call you, and ask for one thing, anything you would ask a person at the next desk. I will show you the rest as we go."):r("asleep","I still have no voice of my own, so there is no call yet, but everything else works. Look around; tap me whenever you have a key and I will take it from there.")))))),i},[m,j,$.on]),W="hello"===m?q.turns:V,ee=(0,I.useTurnFocus)(W,!0),en=function(e){let t=(0,h.useRef)(null),n=(0,h.useRef)(new Set),r=(0,h.useRef)([]),i=(0,h.useRef)(!1),[s,a]=(0,h.useState)(!1),[o,l]=(0,h.useState)(!1),u=(0,h.useRef)(!1);(0,h.useEffect)(()=>{try{let e="1"===window.localStorage.getItem(O);u.current=e,l(e)}catch{}},[]);let c=(0,h.useCallback)(()=>{r.current=[],t.current?.audio.pause()},[]),d=(0,h.useCallback)(()=>{let e=r.current.shift();if(!e||!t.current)return;let{audio:n,clip:i}=t.current;i.resume(),n.src=`/voices/intro/${e}-${function(e){let t=0x811c9dc5;for(let n of`marin|${e}`)t^=n.codePointAt(0)??0,t=Math.imul(t,0x1000193);return(t>>>0).toString(16).padStart(8,"0")}(E[e])}.ogg`,n.play().catch(()=>{})},[]),f=(0,h.useCallback)((...e)=>{let s=e.filter(e=>!n.current.has(e));if(!u.current&&s.length){if(!t.current){let e=new Audio,n=e=>()=>{i.current=e,a(e)};for(let t of(e.addEventListener("playing",n(!0)),["pause","ended","error"]))e.addEventListener(t,n(!1));e.addEventListener("ended",d),e.addEventListener("error",d),t.current={audio:e,clip:(0,C.createClipTap)(e)}}for(let e of s)n.current.add(e);r.current=s,d()}},[d]);(0,h.useEffect)(()=>{e&&t.current&&f(e)},[e,f]),(0,h.useEffect)(()=>()=>{t.current?.audio.pause(),t.current?.clip.close(),t.current=null},[]);let p=(0,h.useCallback)(()=>{let t=!u.current;u.current=t,l(t);try{window.localStorage.setItem(O,t?"1":"0")}catch{}if(t)return c();e&&(n.current.delete(e),f(e))},[c,e,f]);return{say:f,hush:c,speaking:s,muted:o,toggle:p,spectrum:(0,h.useCallback)(()=>t.current&&i.current?t.current.clip.read():M,[])}}(y?null:V.at(-1)?.id??null);if(_||!o)return null;let er=e=>a[b.BOT_SEEDS.indexOf(e)],ei=e=>{en.hush(),v(!0),j&&(0,w.installSeedBots)(b.BOT_SEEDS.filter(e=>F[e.name]).map(e=>({name:e.name,icon:er(e)}))),e&&A.callSignal.place(),u.replace("/"),u.refresh()},es="hello"===m?q.status:en.speaking?"speaking":"mic"===m&&$.on?"listening":"idle",ea="call"===m;return(0,t.jsxs)("div",{className:(0,H.cn)("fixed inset-0 z-40 bg-background transition-opacity duration-700",y&&"pointer-events-none opacity-0"),children:[(0,t.jsx)(x.TooltipProvider,{children:(0,t.jsxs)(x.Tooltip,{children:[(0,t.jsx)(x.TooltipTrigger,{render:(0,t.jsx)(p.Button,{size:"icon",variant:"ghost",onClick:en.toggle,"aria-label":en.muted?"Let her speak":"Mute her","aria-pressed":en.muted,className:"absolute top-5 right-5 z-10 text-muted-foreground hover:text-foreground"}),children:en.muted?(0,t.jsx)(c,{}):(0,t.jsx)(l,{})}),(0,t.jsx)(x.TooltipContent,{side:"bottom",children:en.muted?"Let her speak":"Mute her voice"})]})}),(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-5 pt-[7vh]",children:[(0,t.jsxs)("div",{className:"relative w-[min(20rem,52vw,37.5vh)] [--face-bleed:19.5%]",children:[(0,t.jsx)("button",{type:"button",disabled:!ea||!j,onClick:()=>ei(!0),"aria-label":ea&&j?"Call Thursday":void 0,className:(0,H.cn)("block w-full rounded-full outline-none transition-all duration-700 ease-out focus-visible:ring-3 focus-visible:ring-ring/50","hello"!==m&&!j&&"opacity-35"),children:(0,t.jsx)(R.Face,{look:f,status:es,failed:!1,word:S,getSpectrum:"hello"===m?q.voice:en.spectrum,className:"-m-(--face-bleed) w-[calc(100%+2*var(--face-bleed))] max-w-none"})}),(0,t.jsx)(I.SideCaptions,{turns:W,pinned:ee.pinned,live:"hello"===m?q.saying:en.speaking,onPick:ee.pick}),"hello"!==m&&(0,t.jsxs)("div",{className:"absolute top-1/2 left-full ml-[calc(var(--face-bleed)+0.375rem)] flex w-[min(22rem,26vw)] -translate-y-1/2 animate-in flex-col gap-4 text-left fade-in slide-in-from-bottom-1 duration-300",children:["key"===m&&(0,t.jsx)(G,{keyed:j,onSaved:()=>{T(!0),N((0,D.awake)())}}),"mic"===m&&(0,t.jsx)(X,{mic:$}),"bots"===m&&(0,t.jsx)(J,{picked:F,face:er,onToggle:e=>B(t=>({...t,[e]:!t[e]}))}),"models"===m&&(0,t.jsx)(Q,{})]},m)]}),(0,t.jsxs)("div",{className:"flex w-full max-w-3xl flex-col items-center gap-4 px-6 text-center",children:[(0,t.jsx)("div",{className:"flex h-14 items-center gap-2 text-[13px] text-muted-foreground",children:"hello"===m?(0,t.jsx)("p",{className:"max-w-130 animate-in text-[20px] leading-[1.5] text-balance text-foreground duration-700 fill-mode-backwards fade-in slide-in-from-bottom-2",children:"Just talk to her. She gets it done on this computer, and tells you when it is ready."}):"mic"===m&&$.on?(0,t.jsx)(L.Ear,{live:!0,getMicSpectrum:$.spectrum}):j?ea?(0,t.jsx)(Z,{mic:$.allowed,bots:b.BOT_SEEDS.filter(e=>F[e.name]).length}):null:"Asleep"}),(0,t.jsxs)(p.Button,{variant:"brand",onClick:()=>{"hello"===m?(en.say("hello",j?"awake":"key"),g("key")):ea?ei(j):g(K[Y+1])},className:(0,H.cn)("h-12 px-7 pl-8 text-[15px]","hello"===m&&"animate-in delay-300 duration-700 fill-mode-backwards fade-in slide-in-from-bottom-2"),children:["hello"===m?"Start":ea?j?"Call her":"Look around":"Continue",(0,t.jsx)(i.ChevronRight,{})]}),(0,t.jsx)("p",{className:"h-4 font-mono text-[11px] text-muted-foreground/70",children:"hello"===m?"two minutes · every step can wait":"key"!==m||j?"mic"!==m||$.on?ea&&j?"or tap her":"":"or allow it when the first call asks":"no key is fine — it can go in from the call screen"})]})]}),"hello"===m?(0,t.jsx)(et,{stage:q.stage,icons:a}):(0,t.jsxs)("div",{className:"absolute inset-x-0 bottom-6 grid grid-cols-[1fr_auto_1fr] items-center gap-4.5 font-mono text-[11px] text-muted-foreground/70 [@media(max-height:720px)]:bottom-3",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>g(Y>0?K[Y-1]:"hello"),className:"flex items-center gap-1 justify-self-end rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,t.jsx)(r.ChevronLeft,{className:"size-3"}),"Back"]}),(0,t.jsxs)("span",{className:"flex items-center gap-4.5",children:[(0,t.jsx)("span",{className:"flex items-center gap-1.75",children:K.map((e,n)=>(0,t.jsx)("span",{className:(0,H.cn)("h-1.75 rounded-full transition-all duration-300",n===Y?"w-5.5 bg-foreground":"w-1.75",n<Y&&"bg-foreground/40",n>Y&&"bg-border")},e))}),(0,t.jsxs)("span",{children:[Y+1," of ",K.length]})]}),ea&&!j?(0,t.jsx)("span",{}):(0,t.jsx)("button",{type:"button",onClick:()=>ei(!1),className:(0,H.cn)("justify-self-start rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",ea&&"text-muted-foreground"),children:ea?"Look around first":"Skip all"})]})]})}],302707)},756958,e=>{"use strict";var t=e.i(271645),n=e.i(511769),r=e.i(798120),i=e.i(917162),s=e.i(283653),a=e.i(95187);let o=(0,a.createServerReference)("7f3250354c6e5059e2bc62ba95c04fb29bcbbc6b22",a.callServer,void 0,a.findSourceMapURL,"allowReachAction"),l=(0,a.createServerReference)("7f10db6f53a268108d301b644da64f501481c30726",a.callServer,void 0,a.findSourceMapURL,"declineReachAction");var u=e.i(36174);e.s(["ReachAsk",0,function(){let{data:e}=(0,s.useServerRoute)(r.queryKey.reach);(0,n.useAppEvent)({reach:()=>void(0,s.revalidate)(r.queryKey.reach)});let a=(0,t.useRef)(null),c=e?.channels.find(e=>e.asking)??null,d=c?.asking??null,h=c?.name??null;return(0,t.useEffect)(()=>{if(!d||!h){a.current=null;return}let e=`${h}:${d.chat}`;a.current!==e&&(a.current=e,i.notify.confirm({title:`Let ${d.name} reach Thursday from a phone?`,description:`They wrote to your ${u.REACH_LABEL[h]} bot. Whoever you let in can talk to Thursday from there — and through her, start work on this computer. One person can be let in.`,okText:"Allow",cancelText:"Not them"}).then(e=>e?o(h,d.chat):l(h)))},[d,h]),null}],756958)},252284,e=>{"use strict";var t=e.i(843476),n=e.i(271645);e.s(["Boot",0,function(){let[e,r]=(0,n.useState)(!1);return((0,n.useEffect)(()=>r(!0),[]),e)?null:(0,t.jsx)("p",{"aria-hidden":!0,className:"pointer-events-none fixed inset-x-0 bottom-16 z-50 animate-stalled text-center text-[13px] text-muted-foreground opacity-0",children:"The page did not start. Reload it."})}])},692888,638292,728231,747985,234916,895499,656572,745747,114923,435135,e=>{"use strict";var t,n,r,i,s=e.i(843476),a=e.i(989366),o=e.i(716327),l=e.i(456420);let u={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};u.node;let c=(0,l.default)(u),d={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};d.node;let h=(0,l.default)(d),f={name:"mic",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]};f.node;let p=(0,l.default)(f);e.s(["Mic",0,p],638292);let m={name:"mic-off",size:24,node:[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]};m.node;let g=(0,l.default)(m),x={name:"phone-missed",size:24,node:[["path",{d:"m16 2 6 6",key:"1gw87d"}],["path",{d:"m22 2-6 6",key:"6f0sa0"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]};x.node;let y=(0,l.default)(x),v={name:"settings-2",size:24,node:[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]};v.node;let b=(0,l.default)(v);var _=e.i(263676),w=e.i(271645),k=e.i(798120),j=e.i(167881),T=e.i(225913),S=e.i(647163);let N=(0,T.cva)("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-1.5 [&>*]:relative [&>*]:focus-visible:z-10",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});function C({className:e,orientation:t="horizontal",...n}){return(0,s.jsx)("div",{"data-slot":"button-group","data-orientation":t,role:"group",className:(0,S.cn)(N({orientation:t}),e),...n})}let E=new Intl.Segmenter(void 0,{granularity:"grapheme"});function M({text:e}){let t=(0,w.useMemo)(()=>Array.from(E.segment(e),e=>e.segment),[e]),n=(0,w.useRef)([]),r=0;for(;r<t.length&&t[r]===n.current[r];)r++;return(0,w.useEffect)(()=>{n.current=t},[t]),t.map((e,t)=>(0,s.jsx)(O,{wait:25*Math.max(0,t-r),children:e},`${e}${t}`))}function O({wait:e,children:t}){let[n]=(0,w.useState)(e);return(0,s.jsx)("span",{style:{animationDelay:`${n}ms`},className:"animate-letter motion-reduce:animate-none",children:t})}var A=e.i(660302),R=e.i(633669);function I(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var P,D,z,F,B,$,q,U,H,K,Y,V,W,G,X,J,Q,Z,ee,et,en,er,ei,es,ea,eo,el={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},eu={duration:.5,overwrite:!1,delay:0},ec=2*Math.PI,ed=ec/4,eh=0,ef=Math.sqrt,ep=Math.cos,em=Math.sin,eg=function(e){return"string"==typeof e},ex=function(e){return"function"==typeof e},ey=function(e){return"number"==typeof e},ev=function(e){return void 0===e},eb=function(e){return"object"==typeof e},e_=function(e){return!1!==e},ew=function(){return"u">typeof window},ek=function(e){return ex(e)||eg(e)},ej="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},eT=Array.isArray,eS=/random\([^)]+\)/g,eN=/,\s*/g,eC=/(?:-?\.?\d|\.)+/gi,eE=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,eM=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,eO=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,eA=/[+-]=-?[.\d]+/,eR=/[^,'"\[\]\s]+/gi,eI=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,eL={},eP={},eD=function(e){return(eP=tr(e,eL))&&n3},ez=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},eF=function(e,t){return!t&&console.warn(e)},eB=function(e,t){return e&&(eL[e]=t)&&eP&&(eP[e]=t)||eL},e$=function(){return 0},eq={suppressEvents:!0,isStart:!0,kill:!1},eU={suppressEvents:!0,kill:!1},eH={suppressEvents:!0},eK={},eY=[],eV={},eW={},eG={},eX=30,eJ=[],eQ="",eZ=function(e){var t,n,r=e[0];if(eb(r)||ex(r)||(e=[e]),!(t=(r._gsap||{}).harness)){for(n=eJ.length;n--&&!eJ[n].targetTest(r););t=eJ[n]}for(n=e.length;n--;)e[n]&&(e[n]._gsap||(e[n]._gsap=new nc(e[n],t)))||e.splice(n,1);return e},e0=function(e){return e._gsap||eZ(tD(e))[0]._gsap},e1=function(e,t,n){return(n=e[t])&&ex(n)?e[t]():ev(n)&&e.getAttribute&&e.getAttribute(t)||n},e2=function(e,t){return(e=e.split(",")).forEach(t)||e},e5=function(e){return Math.round(1e5*e)/1e5||0},e3=function(e){return Math.round(1e7*e)/1e7||0},e4=function(e,t){var n=t.charAt(0),r=parseFloat(t.substr(2));return e=parseFloat(e),"+"===n?e+r:"-"===n?e-r:"*"===n?e*r:e/r},e6=function(e,t){for(var n=t.length,r=0;0>e.indexOf(t[r])&&++r<n;);return r<n},e7=function(){var e,t,n=eY.length,r=eY.slice(0);for(eV={},eY.length=0,e=0;e<n;e++)(t=r[e])&&t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0)._lazy=0)},e8=function(e){return!!(e._initted||e._startAt||e.add)},e9=function(e,t,n,r){eY.length&&!Q&&e7(),e.render(t,n,r||!!(Q&&t<0&&e8(e))),eY.length&&!Q&&e7()},te=function(e){var t=parseFloat(e);return(t||0===t)&&(e+"").match(eR).length<2?t:eg(e)?e.trim():e},tt=function(e){return e},tn=function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e},tr=function(e,t){for(var n in t)e[n]=t[n];return e},ti=function e(t,n){for(var r in n)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=eb(n[r])?e(t[r]||(t[r]={}),n[r]):n[r]);return t},ts=function(e,t){var n,r={};for(n in e)n in t||(r[n]=e[n]);return r},ta=function(e){var t,n=e.parent||ee,r=e.keyframes?(t=eT(e.keyframes),function(e,n){for(var r in n)r in e||"duration"===r&&t||"ease"===r||(e[r]=n[r])}):tn;if(e_(e.inherit))for(;n;)r(e,n.vars.defaults),n=n.parent||n._dp;return e},to=function(e,t){for(var n=e.length,r=n===t.length;r&&n--&&e[n]===t[n];);return n<0},tl=function(e,t,n,r,i){void 0===n&&(n="_first"),void 0===r&&(r="_last");var s,a=e[r];if(i)for(s=t[i];a&&a[i]>s;)a=a._prev;return a?(t._next=a._next,a._next=t):(t._next=e[n],e[n]=t),t._next?t._next._prev=t:e[r]=t,t._prev=a,t.parent=t._dp=e,t},tu=function(e,t,n,r){void 0===n&&(n="_first"),void 0===r&&(r="_last");var i=t._prev,s=t._next;i?i._next=s:e[n]===t&&(e[n]=s),s?s._prev=i:e[r]===t&&(e[r]=i),t._next=t._prev=t.parent=null},tc=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},td=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},th=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},tf=function(e,t,n,r){return e._startAt&&(Q?e._startAt.revert(eU):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,r))},tp=function(e){return e._repeat?tm(e._tTime,e=e.duration()+e._rDelay)*e:0},tm=function(e,t){var n=Math.floor(e=e3(e/t));return e&&n===e?n-1:n},tg=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},tx=function(e){return e._end=e3(e._start+(e._tDur/Math.abs(e._ts||e._rts||1e-8)||0))},ty=function(e,t){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=e3(n._time-(e._ts>0?t/e._ts:-(((e._dirty?e.totalDuration():e._tDur)-t)/e._ts))),tx(e),n._dirty||td(n,e)),e},tv=function(e,t){var n;if((t._time||!t._dur&&t._initted||t._start<e._time&&(t._dur||!t.add))&&(n=tg(e.rawTime(),t),(!t._dur||tR(0,t.totalDuration(),n)-t._tTime>1e-8)&&t.render(n,!0)),td(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-1e-8}},tb=function(e,t,n,r){return t.parent&&tc(t),t._start=e3((ey(n)?n:n||e!==ee?tM(e,n,t):e._time)+t._delay),t._end=e3(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),tl(e,t,"_first","_last",e._sort?"_start":0),tj(t)||(e._recent=t),r||tv(e,t),e._ts<0&&ty(e,e._tTime),e},t_=function(e,t){return(eL.ScrollTrigger||ez("scrollTrigger",t))&&eL.ScrollTrigger.create(t,e)},tw=function(e,t,n,r,i){return(nk(e,t,i),e._initted)?!n&&e._pt&&!Q&&(e._dur&&!1!==e.vars.lazy||!e._dur&&e.vars.lazy)&&es!==t6.frame?(eY.push(e),e._lazy=[i,r],1):void 0:1},tk=function e(t){var n=t.parent;return n&&n._ts&&n._initted&&!n._lock&&(0>n.rawTime()||e(n))},tj=function(e){var t=e.data;return"isFromStart"===t||"isStart"===t},tT=function(e,t,n,r){var i,s,a,o=e.ratio,l=t<0||!t&&(!e._start&&tk(e)&&!(!e._initted&&tj(e))||(e._ts<0||e._dp._ts<0)&&!tj(e))?0:1,u=e._rDelay,c=0;if(u&&e._repeat&&(s=tm(c=tR(0,e._tDur,t),u),e._yoyo&&1&s&&(l=1-l),s!==tm(e._tTime,u)&&(o=1-l,e.vars.repeatRefresh&&e._initted&&e.invalidate())),l!==o||Q||r||1e-8===e._zTime||!t&&e._zTime){if(!e._initted&&tw(e,t,r,n,c))return;for(a=e._zTime,e._zTime=t||1e-8*!!n,n||(n=t&&!a),e.ratio=l,e._from&&(l=1-l),e._time=0,e._tTime=c,i=e._pt;i;)i.r(l,i.d),i=i._next;t<0&&tf(e,t,n,!0),e._onUpdate&&!n&&tW(e,"onUpdate"),c&&e._repeat&&!n&&e.parent&&tW(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===l&&(l&&tc(e,1),n||Q||(tW(e,l?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},tS=function(e,t,n){var r;if(n>t)for(r=e._first;r&&r._start<=n;){if("isPause"===r.data&&r._start>t)return r;r=r._next}else for(r=e._last;r&&r._start>=n;){if("isPause"===r.data&&r._start<t)return r;r=r._prev}},tN=function(e,t,n,r){var i=e._repeat,s=e3(t)||0,a=e._tTime/e._tDur;return a&&!r&&(e._time*=s/e._dur),e._dur=s,e._tDur=i?i<0?1e10:e3(s*(i+1)+e._rDelay*i):s,a>0&&!r&&ty(e,e._tTime=e._tDur*a),e.parent&&tx(e),n||td(e.parent,e),e},tC=function(e){return e instanceof nh?td(e):tN(e,e._dur)},tE={_start:0,endTime:e$,totalDuration:e$},tM=function e(t,n,r){var i,s,a,o=t.labels,l=t._recent||tE,u=t.duration()>=1e8?l.endTime(!1):t._dur;return eg(n)&&(isNaN(n)||n in o)?(s=n.charAt(0),a="%"===n.substr(-1),i=n.indexOf("="),"<"===s||">"===s)?(i>=0&&(n=n.replace(/=/,"")),("<"===s?l._start:l.endTime(l._repeat>=0))+(parseFloat(n.substr(1))||0)*(a?(i<0?l:r).totalDuration()/100:1)):i<0?(n in o||(o[n]=u),o[n]):(s=parseFloat(n.charAt(i-1)+n.substr(i+1)),a&&r&&(s=s/100*(eT(r)?r[0]:r).totalDuration()),i>1?e(t,n.substr(0,i-1),r)+s:u+s):null==n?u:+n},tO=function(e,t,n){var r,i,s=ey(t[1]),a=(s?2:1)+(e<2?0:1),o=t[a];if(s&&(o.duration=t[1]),o.parent=n,e){for(r=o,i=n;i&&!("immediateRender"in r);)r=i.vars.defaults||{},i=e_(i.vars.inherit)&&i.parent;o.immediateRender=e_(r.immediateRender),e<2?o.runBackwards=1:o.startAt=t[a-1]}return new nM(t[0],o,t[a+1])},tA=function(e,t){return e||0===e?t(e):t},tR=function(e,t,n){return n<e?e:n>t?t:n},tI=function(e,t){return eg(e)&&(t=eI.exec(e))?t[1]:""},tL=[].slice,tP=function(e,t){return e&&eb(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&eb(e[0]))&&!e.nodeType&&e!==et},tD=function(e,t,n){var r;return Z&&!t&&Z.selector?Z.selector(e):eg(e)&&!n&&(en||!t7())?tL.call((t||er).querySelectorAll(e),0):eT(e)?(void 0===r&&(r=[]),e.forEach(function(e){var t;return eg(e)&&!n||tP(e,1)?(t=r).push.apply(t,tD(e)):r.push(e)})||r):tP(e)?tL.call(e,0):e?[e]:[]},tz=function(e){return e=tD(e)[0]||eF("Invalid scope")||{},function(t){var n=e.current||e.nativeElement||e;return tD(t,n.querySelectorAll?n:n===e?eF("Invalid scope")||er.createElement("div"):e)}},tF=function(e){return e.sort(function(){return .5-Math.random()})},tB=function(e){if(ex(e))return e;var t=eb(e)?e:{each:e},n=ns(t.ease),r=t.from||0,i=parseFloat(t.base)||0,s={},a=r>0&&r<1,o=isNaN(r)||a,l=t.axis,u=r,c=r;return eg(r)?u=c=({center:.5,edges:.5,end:1})[r]||0:!a&&o&&(u=r[0],c=r[1]),function(e,a,d){var h,f,p,m,g,x,y,v,b,_=(d||t).length,w=s[_];if(!w){if(!(b="auto"===t.grid?0:(t.grid||[1,1e8])[1])){for(y=-1e8;y<(y=d[b++].getBoundingClientRect().left)&&b<_;);b<_&&b--}for(w=s[_]=[],h=o?Math.min(b,_)*u-.5:r%b,f=1e8===b?0:o?_*c/b-.5:r/b|0,y=0,v=1e8,x=0;x<_;x++)p=x%b-h,m=f-(x/b|0),w[x]=g=l?Math.abs("y"===l?m:p):ef(p*p+m*m),g>y&&(y=g),g<v&&(v=g);"random"===r&&tF(w),w.max=y-v,w.min=v,w.v=_=(parseFloat(t.amount)||parseFloat(t.each)*(b>_?_-1:l?"y"===l?_/b:b:Math.max(b,_/b))||0)*("edges"===r?-1:1),w.b=_<0?i-_:i,w.u=tI(t.amount||t.each)||0,n=n&&_<0?ni(n):n}return _=(w[e]-w.min)/w.max||0,e3(w.b+(n?n(_):_)*w.v)+w.u}},t$=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var r=e3(Math.round(parseFloat(n)/e)*e*t);return(r-r%1)/t+(ey(n)?0:tI(n))}},tq=function(e,t){var n,r,i=eT(e);return!i&&eb(e)&&(n=i=e.radius||1e8,e.values?(r=!ey((e=tD(e.values))[0]))&&(n*=n):e=t$(e.increment)),tA(t,i?ex(e)?function(t){return Math.abs((r=e(t))-t)<=n?r:t}:function(t){for(var i,s,a=parseFloat(r?t.x:t),o=parseFloat(r?t.y:0),l=1e8,u=0,c=e.length;c--;)(i=r?(i=e[c].x-a)*i+(s=e[c].y-o)*s:Math.abs(e[c]-a))<l&&(l=i,u=c);return u=!n||l<=n?e[u]:t,r||u===t||ey(t)?u:u+tI(t)}:t$(e))},tU=function(e,t,n,r){return tA(eT(e)?!t:!0===n?(n=0,!1):!r,function(){return eT(e)?e[~~(Math.random()*e.length)]:(r=(n=n||1e-5)<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(t-e+.99*n))/n)*n*r)/r})},tH=function(e,t,n){return tA(n,function(n){return e[~~t(n)]})},tK=function(e){return e.replace(eS,function(e){var t=e.indexOf("[")+1,n=e.substring(t||7,t?e.indexOf("]"):e.length-1).split(eN);return tU(t?n:+n[0],t?0:+n[1],+n[2]||1e-5)})},tY=function(e,t,n,r,i){var s=t-e,a=r-n;return tA(i,function(t){return n+((t-e)/s*a||0)})},tV=function(e,t,n){var r,i,s,a=e.labels,o=1e8;for(r in a)(i=a[r]-t)<0==!!n&&i&&o>(i=Math.abs(i))&&(s=r,o=i);return s},tW=function(e,t,n){var r,i,s,a=e.vars,o=a[t],l=Z,u=e._ctx;if(o)return r=a[t+"Params"],i=a.callbackScope||e,n&&eY.length&&e7(),u&&(Z=u),s=r?o.apply(i,r):o.call(i),Z=l,s},tG=function(e){return tc(e),e.scrollTrigger&&e.scrollTrigger.kill(!!Q),1>e.progress()&&tW(e,"onInterrupt"),e},tX=[],tJ=function(e){if(e)if(e=!e.name&&e.default||e,ew()||e.headless){var t=e.name,n=ex(e),r=t&&!n&&e.init?function(){this._props=[]}:e,i={init:e$,render:nF,add:nb,kill:n$,modifier:nB,rawVars:0},s={targetTest:0,get:0,getSetter:nL,aliases:{},register:0};if(t7(),e!==r){if(eW[t])return;tn(r,tn(ts(e,i),s)),tr(r.prototype,tr(i,ts(e,s))),eW[r.prop=t]=r,e.targetTest&&(eJ.push(r),eK[t]=1),t=("css"===t?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}eB(t,r),e.register&&e.register(n3,r,nH)}else tX.push(e)},tQ={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},tZ=function(e,t,n){return(6*(e+=e<0?1:e>1?-1:0)<1?t+(n-t)*e*6:e<.5?n:3*e<2?t+(n-t)*(2/3-e)*6:t)*255+.5|0},t0=function(e,t,n){var r,i,s,a,o,l,u,c,d,h,f=e?ey(e)?[e>>16,e>>8&255,255&e]:0:tQ.black;if(!f){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),tQ[e])f=tQ[e];else if("#"===e.charAt(0)){if(e.length<6&&(r=e.charAt(1),e="#"+r+r+(i=e.charAt(2))+i+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(f=parseInt(e.substr(1,6),16))>>16,f>>8&255,255&f,parseInt(e.substr(7),16)/255];f=[(e=parseInt(e.substr(1),16))>>16,e>>8&255,255&e]}else if("hsl"===e.substr(0,3))if(f=h=e.match(eC),t){if(~e.indexOf("="))return f=e.match(eE),n&&f.length<4&&(f[3]=1),f}else a=f[0]%360/360,o=f[1]/100,i=(l=f[2]/100)<=.5?l*(o+1):l+o-l*o,r=2*l-i,f.length>3&&(f[3]*=1),f[0]=tZ(a+1/3,r,i),f[1]=tZ(a,r,i),f[2]=tZ(a-1/3,r,i);else f=e.match(eC)||tQ.transparent;f=f.map(Number)}return t&&!h&&(r=f[0]/255,l=((u=Math.max(r,i=f[1]/255,s=f[2]/255))+(c=Math.min(r,i,s)))/2,u===c?a=o=0:(d=u-c,o=l>.5?d/(2-u-c):d/(u+c),a=(u===r?(i-s)/d+6*(i<s):u===i?(s-r)/d+2:(r-i)/d+4)*60),f[0]=~~(a+.5),f[1]=~~(100*o+.5),f[2]=~~(100*l+.5)),n&&f.length<4&&(f[3]=1),f},t1=function(e){var t=[],n=[],r=-1;return e.split(t5).forEach(function(e){var i=e.match(eM)||[];t.push.apply(t,i),n.push(r+=i.length+1)}),t.c=n,t},t2=function(e,t,n){var r,i,s,a,o="",l=(e+o).match(t5),u=t?"hsla(":"rgba(",c=0;if(!l)return e;if(l=l.map(function(e){return(e=t0(e,t,1))&&u+(t?e[0]+","+e[1]+"%,"+e[2]+"%,"+e[3]:e.join(","))+")"}),n&&(s=t1(e),(r=n.c).join(o)!==s.c.join(o)))for(a=(i=e.replace(t5,"1").split(eM)).length-1;c<a;c++)o+=i[c]+(~r.indexOf(c)?l.shift()||u+"0,0,0,0)":(s.length?s:l.length?l:n).shift());if(!i)for(a=(i=e.split(t5)).length-1;c<a;c++)o+=i[c]+l[c];return o+i[a]},t5=function(){var e,t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(e in tQ)t+="|"+e+"\\b";return RegExp(t+")","gi")}(),t3=/hsl[a]?\(/,t4=function(e){var t,n=e.join(" ");if(t5.lastIndex=0,t5.test(n))return t=t3.test(n),e[1]=t2(e[1],t),e[0]=t2(e[0],t,t1(e[1])),!0},t6=(q=Date.now,U=500,H=33,Y=K=q(),V=1e3/240,W=1e3/240,G=[],X=function e(t){var n,r,i,s,a=q()-Y,o=!0===t;if((a>U||a<0)&&(K+=a-H),Y+=a,((n=(i=Y-K)-W)>0||o)&&(s=++F.frame,B=i-1e3*F.time,F.time=i/=1e3,W+=n+(n>=V?4:V-n),r=1),o||(P=D(e)),r)for($=0;$<G.length;$++)G[$](i,B,s,t)},F={time:0,frame:0,tick:function(){X(!0)},deltaRatio:function(e){return B/(1e3/(e||60))},wake:function(){ei&&(!en&&ew()&&(er=(et=en=window).document||{},eL.gsap=n3,(et.gsapVersions||(et.gsapVersions=[])).push(n3.version),eD(eP||et.GreenSockGlobals||!et.gsap&&et||{}),tX.forEach(tJ)),z="u">typeof requestAnimationFrame&&requestAnimationFrame,P&&F.sleep(),D=z||function(e){return setTimeout(e,W-1e3*F.time+1|0)},eo=1,X(2))},sleep:function(){(z?cancelAnimationFrame:clearTimeout)(P),eo=0,D=e$},lagSmoothing:function(e,t){H=Math.min(t||33,U=e||1/0)},fps:function(e){V=1e3/(e||240),W=1e3*F.time+V},add:function(e,t,n){var r=t?function(t,n,i,s){e(t,n,i,s),F.remove(r)}:e;return F.remove(e),G[n?"unshift":"push"](r),t7(),r},remove:function(e,t){~(t=G.indexOf(e))&&G.splice(t,1)&&$>=t&&$--},_listeners:G}),t7=function(){return!eo&&t6.wake()},t8={},t9=/^[\d.\-M][\d.\-,\s]/,ne=/["']/g,nt=function(e){for(var t,n,r,i={},s=e.substr(1,e.length-3).split(":"),a=s[0],o=1,l=s.length;o<l;o++)n=s[o],t=o!==l-1?n.lastIndexOf(","):n.length,r=n.substr(0,t),i[a]=isNaN(r)?r.replace(ne,"").trim():+r,a=n.substr(t+1).trim();return i},nn=function(e){var t=e.indexOf("(")+1,n=e.indexOf(")"),r=e.indexOf("(",t);return e.substring(t,~r&&r<n?e.indexOf(")",n+1):n)},nr=function(e){var t=(e+"").split("("),n=t8[t[0]];return n&&t.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[nt(t[1])]:nn(e).split(",").map(te)):t8._CE&&t9.test(e)?t8._CE("",e):n},ni=function(e){return function(t){return 1-e(1-t)}},ns=function(e,t){return e&&(ex(e)?e:t8[e]||nr(e))||t},na=function(e,t,n,r){void 0===n&&(n=function(e){return 1-t(1-e)}),void 0===r&&(r=function(e){return e<.5?t(2*e)/2:1-t((1-e)*2)/2});var i,s={easeIn:t,easeOut:n,easeInOut:r};return e2(e,function(e){for(var t in t8[e]=eL[e]=s,t8[i=e.toLowerCase()]=n,s)t8[i+("easeIn"===t?".in":"easeOut"===t?".out":".inOut")]=t8[e+"."+t]=s[t]}),s},no=function(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e((t-.5)*2)/2}},nl=function e(t,n,r){var i=n>=1?n:1,s=(r||(t?.3:.45))/(n<1?n:1),a=s/ec*(Math.asin(1/i)||0),o=function(e){return 1===e?1:i*Math.pow(2,-10*e)*em((e-a)*s)+1},l="out"===t?o:"in"===t?function(e){return 1-o(1-e)}:no(o);return s=ec/s,l.config=function(n,r){return e(t,n,r)},l},nu=function e(t,n){void 0===n&&(n=1.70158);var r=function(e){return e?--e*e*((n+1)*e+n)+1:0},i="out"===t?r:"in"===t?function(e){return 1-r(1-e)}:no(r);return i.config=function(n){return e(t,n)},i};e2("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var n=t<5?t+1:t;na(e+",Power"+(n-1),t?function(e){return Math.pow(e,n)}:function(e){return e},function(e){return 1-Math.pow(1-e,n)},function(e){return e<.5?Math.pow(2*e,n)/2:1-Math.pow((1-e)*2,n)/2})}),t8.Linear.easeNone=t8.none=t8.Linear.easeIn,na("Elastic",nl("in"),nl("out"),nl()),np=2*(nf=1/2.75),nm=2.5*nf,na("Bounce",function(e){return 1-ng(1-e)},ng=function(e){return e<nf?7.5625*e*e:e<np?7.5625*Math.pow(e-1.5/2.75,2)+.75:e<nm?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*Math.pow(e-2.625/2.75,2)+.984375}),na("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)}),na("Circ",function(e){return-(ef(1-e*e)-1)}),na("Sine",function(e){return 1===e?1:-ep(e*ed)+1}),na("Back",nu("in"),nu("out"),nu()),t8.SteppedEase=t8.steps=eL.SteppedEase={config:function(e,t){void 0===e&&(e=1);var n=1/e,r=e+ +!t,i=+!!t,s=.99999999;return function(e){return((r*tR(0,s,e)|0)+i)*n}}},eu.ease=t8["quad.out"],e2("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return eQ+=e+","+e+"Params,"});var nc=function(e,t){this.id=eh++,e._gsap=this,this.target=e,this.harness=t,this.get=t?t.get:e1,this.set=t?t.getSetter:nL},nd=function(){function e(e){this.vars=e,this._delay=+e.delay||0,(this._repeat=e.repeat===1/0?-2:e.repeat||0)&&(this._rDelay=e.repeatDelay||0,this._yoyo=!!e.yoyo||!!e.yoyoEase),this._ts=1,tN(this,+e.duration,1,1),this.data=e.data,Z&&(this._ctx=Z,Z.data.push(this)),eo||t6.wake()}var t=e.prototype;return t.delay=function(e){return e||0===e?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+e-this._delay),this._delay=e,this):this._delay},t.duration=function(e){return arguments.length?this.totalDuration(this._repeat>0?e+(e+this._rDelay)*this._repeat:e):this.totalDuration()&&this._dur},t.totalDuration=function(e){return arguments.length?(this._dirty=0,tN(this,this._repeat<0?e:(e-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(e,t){if(t7(),!arguments.length)return this._tTime;var n=this._dp;if(n&&n.smoothChildTiming&&this._ts){for(ty(this,e),!n._dp||n.parent||tv(n,this);n&&n.parent;)n.parent._time!==n._start+(n._ts>=0?n._tTime/n._ts:-((n.totalDuration()-n._tTime)/n._ts))&&n.totalTime(n._tTime,!0),n=n.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&e<this._tDur||this._ts<0&&e>0||!this._tDur&&!e)&&tb(this._dp,this,this._start-this._delay)}return(this._tTime!==e||!this._dur&&!t||this._initted&&1e-8===Math.abs(this._zTime)||!this._initted&&this._dur&&e||!e&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=e),e9(this,e,t)),this},t.time=function(e,t){return arguments.length?this.totalTime(Math.min(this.totalDuration(),e+tp(this))%(this._dur+this._rDelay)||(e?this._dur:0),t):this._time},t.totalProgress=function(e,t){return arguments.length?this.totalTime(this.totalDuration()*e,t):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(e,t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(1&this.iteration())?1-e:e)+tp(this),t):this.duration()?Math.min(1,this._time/this._dur):+(this.rawTime()>0)},t.iteration=function(e,t){var n=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(e-1)*n,t):this._repeat?tm(this._tTime,n)+1:1},t.timeScale=function(e,t){if(!arguments.length)return -1e-8===this._rts?0:this._rts;if(this._rts===e)return this;var n=this.parent&&this._ts?tg(this.parent._time,this):this._tTime;return this._rts=+e||0,this._ts=this._ps||-1e-8===e?0:this._rts,this.totalTime(tR(-Math.abs(this._delay),this.totalDuration(),n),!1!==t),tx(this),th(this)},t.paused=function(e){return arguments.length?(this._ps!==e&&(this._ps=e,e?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(t7(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&1e-8!==Math.abs(this._zTime)&&(this._tTime-=1e-8)))),this):this._ps},t.startTime=function(e){if(arguments.length){this._start=e3(e);var t=this.parent||this._dp;return t&&(t._sort||!this.parent)&&tb(t,this,this._start-this._delay),this}return this._start},t.endTime=function(e){return this._start+(e_(e)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(e){var t=this.parent||this._dp;return t?e&&(!this._ts||this._repeat&&this._time&&1>this.totalProgress())?this._tTime%(this._dur+this._rDelay):this._ts?tg(t.rawTime(e),this):this._tTime:this._tTime},t.revert=function(e){void 0===e&&(e=eH);var t=Q;return Q=e,e8(this)&&(this.timeline&&this.timeline.revert(e),this.totalTime(-.01,e.suppressEvents)),"nested"!==this.data&&!1!==e.kill&&this.kill(),Q=t,this},t.globalTime=function(e){for(var t=this,n=arguments.length?e:t.rawTime();t;)n=t._start+n/(Math.abs(t._ts)||1),t=t._dp;return!this.parent&&this._sat?this._sat.globalTime(e):n},t.repeat=function(e){return arguments.length?(this._repeat=e===1/0?-2:e,tC(this)):-2===this._repeat?1/0:this._repeat},t.repeatDelay=function(e){if(arguments.length){var t=this._time;return this._rDelay=e,tC(this),t?this.time(t):this}return this._rDelay},t.yoyo=function(e){return arguments.length?(this._yoyo=e,this):this._yoyo},t.seek=function(e,t){return this.totalTime(tM(this,e),e_(t))},t.restart=function(e,t){return this.play().totalTime(e?-this._delay:0,e_(t)),this._dur||(this._zTime=-1e-8),this},t.play=function(e,t){return null!=e&&this.seek(e,t),this.reversed(!1).paused(!1)},t.reverse=function(e,t){return null!=e&&this.seek(e||this.totalDuration(),t),this.reversed(!0).paused(!1)},t.pause=function(e,t){return null!=e&&this.seek(e,t),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(e){return arguments.length?(!!e!==this.reversed()&&this.timeScale(-this._rts||(e?-1e-8:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-1e-8,this},t.isActive=function(){var e,t=this.parent||this._dp,n=this._start;return!!(!t||this._ts&&this._initted&&t.isActive()&&(e=t.rawTime(!0))>=n&&e<this.endTime(!0)-1e-8)},t.eventCallback=function(e,t,n){var r=this.vars;return arguments.length>1?(t?(r[e]=t,n&&(r[e+"Params"]=n),"onUpdate"===e&&(this._onUpdate=t)):delete r[e],this):r[e]},t.then=function(e){var t=this,n=t._prom;return new Promise(function(r){var i=ex(e)?e:tt,s=function(){var e=t.then;t.then=null,n&&n(),ex(i)&&(i=i(t))&&(i.then||i===t)&&(t.then=e),r(i),t.then=e};t._initted&&1===t.totalProgress()&&t._ts>=0||!t._tTime&&t._ts<0?s():t._prom=s})},t.kill=function(){tG(this)},e}();tn(nd.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-1e-8,_prom:0,_ps:!1,_rts:1});var nh=function(e){function t(t,n){var r;return void 0===t&&(t={}),(r=e.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=e_(t.sortChildren),ee&&tb(t.parent||ee,I(r),n),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&t_(I(r),t.scrollTrigger),r}L(t,e);var n=t.prototype;return n.to=function(e,t,n){return tO(0,arguments,this),this},n.from=function(e,t,n){return tO(1,arguments,this),this},n.fromTo=function(e,t,n,r){return tO(2,arguments,this),this},n.set=function(e,t,n){return t.duration=0,t.parent=this,ta(t).repeatDelay||(t.repeat=0),t.immediateRender=!!t.immediateRender,new nM(e,t,tM(this,n),1),this},n.call=function(e,t,n){return tb(this,nM.delayedCall(0,e,t),n)},n.staggerTo=function(e,t,n,r,i,s,a){return n.duration=t,n.stagger=n.stagger||r,n.onComplete=s,n.onCompleteParams=a,n.parent=this,new nM(e,n,tM(this,i)),this},n.staggerFrom=function(e,t,n,r,i,s,a){return n.runBackwards=1,ta(n).immediateRender=e_(n.immediateRender),this.staggerTo(e,t,n,r,i,s,a)},n.staggerFromTo=function(e,t,n,r,i,s,a,o){return r.startAt=n,ta(r).immediateRender=e_(r.immediateRender),this.staggerTo(e,t,r,i,s,a,o)},n.render=function(e,t,n){var r,i,s,a,o,l,u,c,d,h,f,p,m=this._time,g=this._dirty?this.totalDuration():this._tDur,x=this._dur,y=e<=0?0:e3(e),v=this._zTime<0!=e<0&&(this._initted||!x);if(this!==ee&&y>g&&e>=0&&(y=g),y!==this._tTime||n||v){if(m!==this._time&&x&&(y+=this._time-m,e+=this._time-m),r=y,d=this._start,l=!(c=this._ts),v&&(x||(m=this._zTime),(e||!t)&&(this._zTime=e)),this._repeat){if(f=this._yoyo,o=x+this._rDelay,this._repeat<-1&&e<0)return this.totalTime(100*o+e,t,n);if(r=e3(y%o),y===g?(a=this._repeat,r=x):((a=~~(h=e3(y/o)))&&a===h&&(r=x,a--),r>x&&(r=x)),h=tm(this._tTime,o),!m&&this._tTime&&h!==a&&this._tTime-h*o-this._dur<=0&&(h=a),f&&1&a&&(r=x-r,p=1),a!==h&&!this._lock){var b=f&&1&h,_=b===(f&&1&a);if(a<h&&(b=!b),m=b?0:y%x?x:y,this._lock=1,this.render(m||(p?0:e3(a*o)),t,!x)._lock=0,this._tTime=y,!t&&this.parent&&tW(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,h=a),m&&m!==this._time||!this._ts!==l||this.vars.onRepeat&&!this.parent&&!this._act||(x=this._dur,g=this._tDur,_&&(this._lock=2,m=b?x:-1e-4,this.render(m,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!l))return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(u=tS(this,e3(m),e3(r)))&&(y-=r-(r=u._start)),this._tTime=y,this._time=r,this._act=!!c,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=e,m=0),!m&&y&&x&&!t&&!h&&(tW(this,"onStart"),this._tTime!==y))return this;if(r>=m&&e>=0)for(i=this._first;i;){if(s=i._next,(i._act||r>=i._start)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(r-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(r-i._start)*i._ts,t,n),r!==this._time||!this._ts&&!l){u=0,s&&(y+=this._zTime=-1e-8);break}}i=s}else{i=this._last;for(var w=e<0?e:r;i;){if(s=i._prev,(i._act||w<=i._end)&&i._ts&&u!==i){if(i.parent!==this)return this.render(e,t,n);if(i.render(i._ts>0?(w-i._start)*i._ts:(i._dirty?i.totalDuration():i._tDur)+(w-i._start)*i._ts,t,n||Q&&e8(i)),r!==this._time||!this._ts&&!l){u=0,s&&(y+=this._zTime=w?-1e-8:1e-8);break}}i=s}}if(u&&!t&&(this.pause(),u.render(r>=m?0:-1e-8)._zTime=r>=m?1:-1,this._ts))return this._start=d,tx(this),this.render(e,t,n);this._onUpdate&&!t&&tW(this,"onUpdate",!0),(y===g&&this._tTime>=this.totalDuration()||!y&&m)&&(d===this._start||Math.abs(c)!==Math.abs(this._ts))&&!this._lock&&((e||!x)&&(y===g&&this._ts>0||!y&&this._ts<0)&&tc(this,1),t||e<0&&!m||!y&&!m&&g||(tW(this,y===g&&e>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(y<g&&this.timeScale()>0)&&this._prom()))}return this},n.add=function(e,t){var n=this;if(ey(t)||(t=tM(this,t,e)),!(e instanceof nd)){if(eT(e))return e.forEach(function(e){return n.add(e,t)}),this;if(eg(e))return this.addLabel(e,t);if(!ex(e))return this;e=nM.delayedCall(0,e)}return this!==e?tb(this,e,t):this},n.getChildren=function(e,t,n,r){void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===n&&(n=!0),void 0===r&&(r=-1e8);for(var i=[],s=this._first;s;)s._start>=r&&(s instanceof nM?t&&i.push(s):(n&&i.push(s),e&&i.push.apply(i,s.getChildren(!0,t,n)))),s=s._next;return i},n.getById=function(e){for(var t=this.getChildren(1,1,1),n=t.length;n--;)if(t[n].vars.id===e)return t[n]},n.remove=function(e){return eg(e)?this.removeLabel(e):ex(e)?this.killTweensOf(e):(e.parent===this&&tu(this,e),e===this._recent&&(this._recent=this._last),td(this))},n.totalTime=function(t,n){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=e3(t6.time-(this._ts>0?t/this._ts:-((this.totalDuration()-t)/this._ts)))),e.prototype.totalTime.call(this,t,n),this._forcing=0,this):this._tTime},n.addLabel=function(e,t){return this.labels[e]=tM(this,t),this},n.removeLabel=function(e){return delete this.labels[e],this},n.addPause=function(e,t,n){var r=nM.delayedCall(0,t||e$,n);return r.data="isPause",this._hasPause=1,tb(this,r,tM(this,e))},n.removePause=function(e){var t=this._first;for(e=tM(this,e);t;)t._start===e&&"isPause"===t.data&&tc(t),t=t._next},n.killTweensOf=function(e,t,n){for(var r=this.getTweensOf(e,n),i=r.length;i--;)nx!==r[i]&&r[i].kill(e,t);return this},n.getTweensOf=function(e,t){for(var n,r=[],i=tD(e),s=this._first,a=ey(t);s;)s instanceof nM?e6(s._targets,i)&&(a?(!nx||s._initted&&s._ts)&&s.globalTime(0)<=t&&s.globalTime(s.totalDuration())>t:!t||s.isActive())&&r.push(s):(n=s.getTweensOf(i,t)).length&&r.push.apply(r,n),s=s._next;return r},n.tweenTo=function(e,t){t=t||{};var n,r=this,i=tM(r,e),s=t,a=s.startAt,o=s.onStart,l=s.onStartParams,u=s.immediateRender,c=nM.to(r,tn({ease:t.ease||"none",lazy:!1,immediateRender:!1,time:i,overwrite:"auto",duration:t.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale())||1e-8,onStart:function(){if(r.pause(),!n){var e=t.duration||Math.abs((i-(a&&"time"in a?a.time:r._time))/r.timeScale());c._dur!==e&&tN(c,e,0,1).render(c._time,!0,!0),n=1}o&&o.apply(c,l||[])}},t));return u?c.render(0):c},n.tweenFromTo=function(e,t,n){return this.tweenTo(t,tn({startAt:{time:tM(this,e)}},n))},n.recent=function(){return this._recent},n.nextLabel=function(e){return void 0===e&&(e=this._time),tV(this,tM(this,e))},n.previousLabel=function(e){return void 0===e&&(e=this._time),tV(this,tM(this,e),1)},n.currentLabel=function(e){return arguments.length?this.seek(e,!0):this.previousLabel(this._time+1e-8)},n.shiftChildren=function(e,t,n){void 0===n&&(n=0);var r,i=this._first,s=this.labels;for(e=e3(e);i;)i._start>=n&&(i._start+=e,i._end+=e),i=i._next;if(t)for(r in s)s[r]>=n&&(s[r]+=e);return td(this)},n.invalidate=function(t){var n=this._first;for(this._lock=0;n;)n.invalidate(t),n=n._next;return e.prototype.invalidate.call(this,t)},n.clear=function(e){void 0===e&&(e=!0);for(var t,n=this._first;n;)t=n._next,this.remove(n),n=t;return this._dp&&(this._time=this._tTime=this._pTime=0),e&&(this.labels={}),td(this)},n.totalDuration=function(e){var t,n,r,i=0,s=this._last,a=1e8;if(arguments.length)return this.timeScale((this._repeat<0?this.duration():this.totalDuration())/(this.reversed()?-e:e));if(this._dirty){for(r=this.parent;s;)t=s._prev,s._dirty&&s.totalDuration(),(n=s._start)>a&&this._sort&&s._ts&&!this._lock?(this._lock=1,tb(this,s,n-s._delay,1)._lock=0):a=n,n<0&&s._ts&&(i-=n,(!r&&!this._dp||r&&r.smoothChildTiming)&&(this._start+=e3(n/this._ts),this._time-=n,this._tTime-=n),this.shiftChildren(-n,!1,-Infinity),a=0),s._end>i&&s._ts&&(i=s._end),s=t;tN(this,this===ee&&this._time>i?this._time:i,1,1),this._dirty=0}return this._tDur},t.updateRoot=function(e){if(ee._ts&&(e9(ee,tg(e,ee)),es=t6.frame),t6.frame>=eX){eX+=el.autoSleep||120;var t=ee._first;if((!t||!t._ts)&&el.autoSleep&&t6._listeners.length<2){for(;t&&!t._ts;)t=t._next;t||t6.sleep()}}},t}(nd);tn(nh.prototype,{_lock:0,_hasPause:0,_forcing:0});var nf,np,nm,ng,nx,ny,nv=function(e,t,n,r,i,s,a){var o,l,u,c,d,h,f,p,m=new nH(this._pt,e,t,0,1,nz,null,i),g=0,x=0;for(m.b=n,m.e=r,n+="",r+="",(f=~r.indexOf("random("))&&(r=tK(r)),s&&(s(p=[n,r],e,t),n=p[0],r=p[1]),l=n.match(eO)||[];o=eO.exec(r);)c=o[0],d=r.substring(g,o.index),u?u=(u+1)%5:"rgba("===d.substr(-5)&&(u=1),c!==l[x++]&&(h=parseFloat(l[x-1])||0,m._pt={_next:m._pt,p:d||1===x?d:",",s:h,c:"="===c.charAt(1)?e4(h,c)-h:parseFloat(c)-h,m:u&&u<4?Math.round:0},g=eO.lastIndex);return m.c=g<r.length?r.substring(g,r.length):"",m.fp=a,(eA.test(r)||f)&&(m.e=0),this._pt=m,m},nb=function(e,t,n,r,i,s,a,o,l,u){ex(r)&&(r=r(i||0,e,s));var c,d=e[t],h="get"!==n?n:ex(d)?l?e[t.indexOf("set")||!ex(e["get"+t.substr(3)])?t:"get"+t.substr(3)](l):e[t]():d,f=ex(d)?l?nR:nA:nO;if(eg(r)&&(~r.indexOf("random(")&&(r=tK(r)),"="===r.charAt(1)&&((c=e4(h,r)+(tI(h)||0))||0===c)&&(r=c)),!u||h!==r||ny)return isNaN(h*r)||""===r?(d||t in e||ez(t,r),nv.call(this,e,t,h,r,f,o||el.stringFilter,l)):(c=new nH(this._pt,e,t,+h||0,r-(h||0),"boolean"==typeof d?nD:nP,0,f),l&&(c.fp=l),a&&c.modifier(a,this,e),this._pt=c)},n_=function(e,t,n,r,i){if(ex(e)&&(e=nN(e,i,t,n,r)),!eb(e)||e.style&&e.nodeType||eT(e)||ej(e))return eg(e)?nN(e,i,t,n,r):e;var s,a={};for(s in e)a[s]=nN(e[s],i,t,n,r);return a},nw=function(e,t,n,r,i,s){var a,o,l,u;if(eW[e]&&!1!==(a=new eW[e]).init(i,a.rawVars?t[e]:n_(t[e],r,i,s,n),n,r,s)&&(n._pt=o=new nH(n._pt,i,e,0,1,a.render,a,0,a.priority),n!==ea))for(l=n._ptLookup[n._targets.indexOf(i)],u=a._props.length;u--;)l[a._props[u]]=o;return a},nk=function e(t,n,r){var i,s,a,o,l,u,c,d,h,f,p,m,g,x=t.vars,y=x.ease,v=x.startAt,b=x.immediateRender,_=x.lazy,w=x.onUpdate,k=x.runBackwards,j=x.yoyoEase,T=x.keyframes,S=x.autoRevert,N=t._dur,C=t._startAt,E=t._targets,M=t.parent,O=M&&"nested"===M.data?M.vars.targets:E,A="auto"===t._overwrite&&!J,R=t.timeline,I=x.easeReverse||j;if(!R||T&&y||(y="none"),t._ease=ns(y,eu.ease),t._rEase=I&&(ns(I)||t._ease),t._from=!R&&!!x.runBackwards,t._from&&(t.ratio=1),!R||T&&!x.stagger){if(m=(d=E[0]?e0(E[0]).harness:0)&&x[d.prop],i=ts(x,eK),C&&(C._zTime<0&&C.progress(1),n<0&&k&&b&&!S?C.render(-1,!0):C.revert(k&&N?eU:eq),C._lazy=0),v){if(tc(t._startAt=nM.set(E,tn({data:"isStart",overwrite:!1,parent:M,immediateRender:!0,lazy:!C&&e_(_),startAt:null,delay:0,onUpdate:w&&function(){return tW(t,"onUpdate")},stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,n<0&&(Q||!b&&!S)&&t._startAt.revert(eU),b&&N&&n<=0&&r<=0){n&&(t._zTime=n);return}}else if(k&&N&&!C)if(n&&(b=!1),a=tn({overwrite:!1,data:"isFromStart",lazy:b&&!C&&e_(_),immediateRender:b,stagger:0,parent:M},i),m&&(a[d.prop]=m),tc(t._startAt=nM.set(E,a)),t._startAt._dp=0,t._startAt._sat=t,n<0&&(Q?t._startAt.revert(eU):t._startAt.render(-1,!0)),t._zTime=n,b){if(!n)return}else e(t._startAt,1e-8,1e-8);for(t._pt=t._ptCache=0,_=N&&e_(_)||_&&!N,s=0;s<E.length;s++){if(c=(l=E[s])._gsap||eZ(E)[s]._gsap,t._ptLookup[s]=f={},eV[c.id]&&eY.length&&e7(),p=O===E?s:O.indexOf(l),d&&!1!==(h=new d).init(l,m||i,t,p,O)&&(t._pt=o=new nH(t._pt,l,h.name,0,1,h.render,h,0,h.priority),h._props.forEach(function(e){f[e]=o}),h.priority&&(u=1)),!d||m)for(a in i)eW[a]&&(h=nw(a,i,t,p,l,O))?h.priority&&(u=1):f[a]=o=nb.call(t,l,a,"get",i[a],p,O,0,x.stringFilter);t._op&&t._op[s]&&t.kill(l,t._op[s]),A&&t._pt&&(nx=t,ee.killTweensOf(l,f,t.globalTime(n)),g=!t.parent,nx=0),t._pt&&_&&(eV[c.id]=1)}u&&nU(t),t._onInit&&t._onInit(t)}t._onUpdate=w,t._initted=(!t._op||t._pt)&&!g,T&&n<=0&&R.render(1e8,!0,!0)},nj=function(e,t,n,r,i,s,a,o){var l,u,c,d,h=(e._pt&&e._ptCache||(e._ptCache={}))[t];if(!h)for(h=e._ptCache[t]=[],c=e._ptLookup,d=e._targets.length;d--;){if((l=c[d][t])&&l.d&&l.d._pt)for(l=l.d._pt;l&&l.p!==t&&l.fp!==t;)l=l._next;if(!l)return ny=1,e.vars[t]="+=0",nk(e,a),ny=0,o?eF(t+" not eligible for reset. Try splitting into individual properties"):1;h.push(l)}for(d=h.length;d--;)(l=(u=h[d])._pt||u).s=(r||0===r)&&!i?r:l.s+(r||0)+s*l.c,l.c=n-l.s,u.e&&(u.e=e5(n)+tI(u.e)),u.b&&(u.b=l.s+tI(u.b))},nT=function(e,t){var n,r,i,s,a=e[0]?e0(e[0]).harness:0,o=a&&a.aliases;if(!o)return t;for(r in n=tr({},t),o)if(r in n)for(i=(s=o[r].split(",")).length;i--;)n[s[i]]=n[r];return n},nS=function(e,t,n,r){var i,s,a=t.ease||r||"power1.inOut";if(eT(t))s=n[e]||(n[e]=[]),t.forEach(function(e,n){return s.push({t:n/(t.length-1)*100,v:e,e:a})});else for(i in t)s=n[i]||(n[i]=[]),"ease"===i||s.push({t:parseFloat(e),v:t[i],e:a})},nN=function(e,t,n,r,i){return ex(e)?e.call(t,n,r,i):eg(e)&&~e.indexOf("random(")?tK(e):e},nC=eQ+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",nE={};e2(nC+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return nE[e]=1});var nM=function(e){function t(t,n,r,i){"number"==typeof n&&(r.duration=n,n=r,r=null);var s,a,o,l,u,c,d,h,f=e.call(this,i?n:ta(n))||this,p=f.vars,m=p.duration,g=p.delay,x=p.immediateRender,y=p.stagger,v=p.overwrite,b=p.keyframes,_=p.defaults,w=p.scrollTrigger,k=n.parent||ee,j=(eT(t)||ej(t)?ey(t[0]):"length"in n)?[t]:tD(t);if(f._targets=j.length?eZ(j):eF("GSAP target "+t+" not found. https://gsap.com",!el.nullTargetWarn)||[],f._ptLookup=[],f._overwrite=v,b||y||ek(m)||ek(g)){var T=(n=f.vars).easeReverse||n.yoyoEase;if((s=f.timeline=new nh({data:"nested",defaults:_||{},targets:k&&"nested"===k.data?k.vars.targets:j})).kill(),s.parent=s._dp=I(f),s._start=0,y||ek(m)||ek(g)){if(l=j.length,d=y&&tB(y),eb(y))for(u in y)~nC.indexOf(u)&&(h||(h={}),h[u]=y[u]);for(a=0;a<l;a++)(o=ts(n,nE)).stagger=0,T&&(o.easeReverse=T),h&&tr(o,h),c=j[a],o.duration=+nN(m,I(f),a,c,j),o.delay=(+nN(g,I(f),a,c,j)||0)-f._delay,!y&&1===l&&o.delay&&(f._delay=g=o.delay,f._start+=g,o.delay=0),s.to(c,o,d?d(a,c,j):0),s._ease=t8.none;s.duration()?m=g=0:f.timeline=0}else if(b){ta(tn(s.vars.defaults,{ease:"none"})),s._ease=ns(b.ease||n.ease||"none");var S,N,C,E=0;if(eT(b))b.forEach(function(e){return s.to(j,e,">")}),s.duration();else{for(u in o={},b)"ease"===u||"easeEach"===u||nS(u,b[u],o,b.easeEach);for(u in o)for(S=o[u].sort(function(e,t){return e.t-t.t}),E=0,a=0;a<S.length;a++)(C={ease:(N=S[a]).e,duration:(N.t-(a?S[a-1].t:0))/100*m})[u]=N.v,s.to(j,C,E),E+=C.duration;s.duration()<m&&s.to({},{duration:m-s.duration()})}}m||f.duration(m=s.duration())}else f.timeline=0;return!0!==v||J||(nx=I(f),ee.killTweensOf(j),nx=0),tb(k,I(f),r),n.reversed&&f.reverse(),n.paused&&f.paused(!0),(x||!m&&!b&&f._start===e3(k._time)&&e_(x)&&function e(t){return!t||t._ts&&e(t.parent)}(I(f))&&"nested"!==k.data)&&(f._tTime=-1e-8,f.render(Math.max(0,-g)||0)),w&&t_(I(f),w),f}L(t,e);var n=t.prototype;return n.render=function(e,t,n){var r,i,s,a,o,l,u,c,d=this._time,h=this._tDur,f=this._dur,p=e<0,m=e>h-1e-8&&!p?h:e<1e-8?0:e;if(f){if(m!==this._tTime||!e||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==p||this._lazy){if(r=m,c=this.timeline,this._repeat){if(a=f+this._rDelay,this._repeat<-1&&p)return this.totalTime(100*a+e,t,n);if(r=e3(m%a),m===h?(s=this._repeat,r=f):(s=~~(o=e3(m/a)))&&s===o?(r=f,s--):r>f&&(r=f),(l=this._yoyo&&1&s)&&(r=f-r),o=tm(this._tTime,a),r===d&&!n&&this._initted&&s===o)return this._tTime=m,this;s!==o&&this.vars.repeatRefresh&&!l&&!this._lock&&r!==a&&this._initted&&(this._lock=n=1,this.render(e3(a*s),!0).invalidate()._lock=0)}if(!this._initted){if(tw(this,p?e:r,n,t,m))return this._tTime=0,this;if(d!==this._time&&!(n&&this.vars.repeatRefresh&&s!==o))return this;if(f!==this._dur)return this.render(e,t,n)}if(this._rEase){var g=r<d;if(g!==this._inv){var x=g?d:f-d;this._inv=g,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=d,this._invRecip=x?(g?-1:1)/x:0,this._invScale=g?-this.ratio:1-this.ratio,this._invEase=g?this._rEase:this._ease}this.ratio=u=this._invRatio+this._invScale*this._invEase((r-this._invTime)*this._invRecip)}else this.ratio=u=this._ease(r/f);if(this._from&&(this.ratio=u=1-u),this._tTime=m,this._time=r,!this._act&&this._ts&&(this._act=1,this._lazy=0),!d&&m&&!t&&!o&&(tW(this,"onStart"),this._tTime!==m))return this;for(i=this._pt;i;)i.r(u,i.d),i=i._next;c&&c.render(e<0?e:c._dur*c._ease(r/this._dur),t,n)||this._startAt&&(this._zTime=e),this._onUpdate&&!t&&(p&&tf(this,e,t,n),tW(this,"onUpdate")),this._repeat&&s!==o&&this.vars.onRepeat&&!t&&this.parent&&tW(this,"onRepeat"),(m===this._tDur||!m)&&this._tTime===m&&(p&&!this._onUpdate&&tf(this,e,!0,!0),(e||!f)&&(m===this._tDur&&this._ts>0||!m&&this._ts<0)&&tc(this,1),!t&&!(p&&!d)&&(m||d||l)&&(tW(this,m===h?"onComplete":"onReverseComplete",!0),this._prom&&!(m<h&&this.timeScale()>0)&&this._prom()))}}else tT(this,e,t,n);return this},n.targets=function(){return this._targets},n.invalidate=function(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),e.prototype.invalidate.call(this,t)},n.resetTo=function(e,t,n,r,i){eo||t6.wake(),this._ts||this.play();var s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return(this._initted||nk(this,s),nj(this,e,t,n,r,this._ease(s/this._dur),s,i))?this.resetTo(e,t,n,r,1):(ty(this,0),this.parent||tl(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},n.kill=function(e,t){if(void 0===t&&(t="all"),!e&&(!t||"all"===t))return this._lazy=this._pt=0,this.parent?tG(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Q),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(e,t,nx&&!0!==nx.vars.overwrite)._first||tG(this),this.parent&&n!==this.timeline.totalDuration()&&tN(this,this._dur*this.timeline._tDur/n,0,1),this}var r,i,s,a,o,l,u,c=this._targets,d=e?tD(e):c,h=this._ptLookup,f=this._pt;if((!t||"all"===t)&&to(c,d))return"all"===t&&(this._pt=0),tG(this);for(r=this._op=this._op||[],"all"!==t&&(eg(t)&&(o={},e2(t,function(e){return o[e]=1}),t=o),t=nT(c,t)),u=c.length;u--;)if(~d.indexOf(c[u]))for(o in i=h[u],"all"===t?(r[u]=t,a=i,s={}):(s=r[u]=r[u]||{},a=t),a)(l=i&&i[o])&&("kill"in l.d&&!0!==l.d.kill(o)||tu(this,l,"_pt"),delete i[o]),"all"!==s&&(s[o]=1);return this._initted&&!this._pt&&f&&tG(this),this},t.to=function(e,n){return new t(e,n,arguments[2])},t.from=function(e,t){return tO(1,arguments)},t.delayedCall=function(e,n,r,i){return new t(n,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:e,onComplete:n,onReverseComplete:n,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},t.fromTo=function(e,t,n){return tO(2,arguments)},t.set=function(e,n){return n.duration=0,n.repeatDelay||(n.repeat=0),new t(e,n)},t.killTweensOf=function(e,t,n){return ee.killTweensOf(e,t,n)},t}(nd);tn(nM.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),e2("staggerTo,staggerFrom,staggerFromTo",function(e){nM[e]=function(){var t=new nh,n=tL.call(arguments,0);return n.splice("staggerFromTo"===e?5:4,0,0),t[e].apply(t,n)}});var nO=function(e,t,n){return e[t]=n},nA=function(e,t,n){return e[t](n)},nR=function(e,t,n,r){return e[t](r.fp,n)},nI=function(e,t,n){return e.setAttribute(t,n)},nL=function(e,t){return ex(e[t])?nA:ev(e[t])&&e.setAttribute?nI:nO},nP=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},nD=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},nz=function(e,t){var n=t._pt,r="";if(!e&&t.b)r=t.b;else if(1===e&&t.e)r=t.e;else{for(;n;)r=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+r,n=n._next;r+=t.c}t.set(t.t,t.p,r,t)},nF=function(e,t){for(var n=t._pt;n;)n.r(e,n.d),n=n._next},nB=function(e,t,n,r){for(var i,s=this._pt;s;)i=s._next,s.p===r&&s.modifier(e,t,n),s=i},n$=function(e){for(var t,n,r=this._pt;r;)n=r._next,(r.p!==e||r.op)&&r.op!==e?r.dep||(t=1):tu(this,r,"_pt"),r=n;return!t},nq=function(e,t,n,r){r.mSet(e,t,r.m.call(r.tween,n,r.mt),r)},nU=function(e){for(var t,n,r,i,s=e._pt;s;){for(t=s._next,n=r;n&&n.pr>s.pr;)n=n._next;(s._prev=n?n._prev:i)?s._prev._next=s:r=s,(s._next=n)?n._prev=s:i=s,s=t}e._pt=r},nH=function(){function e(e,t,n,r,i,s,a,o,l){this.t=t,this.s=r,this.c=i,this.p=n,this.r=s||nP,this.d=a||this,this.set=o||nO,this.pr=l||0,this._next=e,e&&(e._prev=this)}return e.prototype.modifier=function(e,t,n){this.mSet=this.mSet||this.set,this.set=nq,this.m=e,this.mt=n,this.tween=t},e}();e2(eQ+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return eK[e]=1}),eL.TweenMax=eL.TweenLite=nM,eL.TimelineLite=eL.TimelineMax=nh,ee=new nh({sortChildren:!1,defaults:eu,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),el.stringFilter=t4;var nK=[],nY={},nV=[],nW=0,nG=0,nX=function(e){return(nY[e]||nV).map(function(e){return e()})},nJ=function(){var e=Date.now(),t=[];e-nW>2&&(nX("matchMediaInit"),nK.forEach(function(e){var n,r,i,s,a=e.queries,o=e.conditions;for(r in a)(n=et.matchMedia(a[r]).matches)&&(i=1),n!==o[r]&&(o[r]=n,s=1);s&&(e.revert(),i&&t.push(e))}),nX("matchMediaRevert"),t.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),nW=e,nX("matchMedia"))},nQ=function(){function e(e,t){this.selector=t&&tz(t),this.data=[],this._r=[],this.isReverted=!1,this.id=nG++,e&&this.add(e)}var t=e.prototype;return t.add=function(e,t,n){ex(e)&&(n=t,t=e,e=ex);var r=this,i=function(){var e,i=Z,s=r.selector;return i&&i!==r&&i.data.push(r),n&&(r.selector=tz(n)),Z=r,e=t.apply(r,arguments),ex(e)&&r._r.push(e),Z=i,r.selector=s,r.isReverted=!1,e};return r.last=i,e===ex?i(r,function(e){return r.add(null,e)}):e?r[e]=i:i},t.ignore=function(e){var t=Z;Z=null,e(this),Z=t},t.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof e?t.push.apply(t,n.getTweens()):n instanceof nM&&!(n.parent&&"nested"===n.parent.data)&&t.push(n)}),t},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(e,t){var n=this;if(e){for(var r,i=n.getTweens(),s=n.data.length;s--;)"isFlip"===(r=n.data[s]).data&&(r.revert(),r.getChildren(!0,!0,!1).forEach(function(e){return i.splice(i.indexOf(e),1)}));for(i.map(function(e){return{g:e._dur||e._delay||e._sat&&!e._sat.vars.immediateRender?e.globalTime(0):-1/0,t:e}}).sort(function(e,t){return t.g-e.g||-1/0}).forEach(function(t){return t.t.revert(e)}),s=n.data.length;s--;)(r=n.data[s])instanceof nh?"nested"!==r.data&&(r.scrollTrigger&&r.scrollTrigger.revert(),r.kill()):r instanceof nM||!r.revert||r.revert(e);n._r.forEach(function(t){return t(e,n)}),n.isReverted=!0}else this.data.forEach(function(e){return e.kill&&e.kill()});if(this.clear(),t)for(var a=nK.length;a--;)nK[a].id===this.id&&nK.splice(a,1)},t.revert=function(e){this.kill(e||{})},e}(),nZ=function(){function e(e){this.contexts=[],this.scope=e,Z&&Z.data.push(this)}var t=e.prototype;return t.add=function(e,t,n){eb(e)||(e={matches:e});var r,i,s,a=new nQ(0,n||this.scope),o=a.conditions={};for(i in Z&&!a.selector&&(a.selector=Z.selector),this.contexts.push(a),t=a.add("onMatch",t),a.queries=e,e)"all"===i?s=1:(r=et.matchMedia(e[i]))&&(0>nK.indexOf(a)&&nK.push(a),(o[i]=r.matches)&&(s=1),r.addListener?r.addListener(nJ):r.addEventListener("change",nJ));return s&&t(a,function(e){return a.add(null,e)}),this},t.revert=function(e){this.kill(e||{})},t.kill=function(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},e}(),n0={registerPlugin:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t.forEach(function(e){return tJ(e)})},timeline:function(e){return new nh(e)},getTweensOf:function(e,t){return ee.getTweensOf(e,t)},getProperty:function(e,t,n,r){eg(e)&&(e=tD(e)[0]);var i=e0(e||{}).get,s=n?tt:te;return"native"===n&&(n=""),e?t?s((eW[t]&&eW[t].get||i)(e,t,n,r)):function(t,n,r){return s((eW[t]&&eW[t].get||i)(e,t,n,r))}:e},quickSetter:function(e,t,n){if((e=tD(e)).length>1){var r=e.map(function(e){return n3.quickSetter(e,t,n)}),i=r.length;return function(e){for(var t=i;t--;)r[t](e)}}e=e[0]||{};var s=eW[t],a=e0(e),o=a.harness&&(a.harness.aliases||{})[t]||t,l=s?function(t){var r=new s;ea._pt=0,r.init(e,n?t+n:t,ea,0,[e]),r.render(1,r),ea._pt&&nF(1,ea)}:a.set(e,o);return s?l:function(t){return l(e,o,n?t+n:t,a,1)}},quickTo:function(e,t,n){var r,i=n3.to(e,tn(((r={})[t]="+=0.1",r.paused=!0,r.stagger=0,r),n||{})),s=function(e,n,r){return i.resetTo(t,e,n,r)};return s.tween=i,s},isTweening:function(e){return ee.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=ns(e.ease,eu.ease)),ti(eu,e||{})},config:function(e){return ti(el,e||{})},registerEffect:function(e){var t=e.name,n=e.effect,r=e.plugins,i=e.defaults,s=e.extendTimeline;(r||"").split(",").forEach(function(e){return e&&!eW[e]&&!eL[e]&&eF(t+" effect requires "+e+" plugin.")}),eG[t]=function(e,t,r){return n(tD(e),tn(t||{},i),r)},s&&(nh.prototype[t]=function(e,n,r){return this.add(eG[t](e,eb(n)?n:(r=n)&&{},this),r)})},registerEase:function(e,t){t8[e]=ns(t)},parseEase:function(e,t){return arguments.length?ns(e,t):t8},getById:function(e){return ee.getById(e)},exportRoot:function(e,t){void 0===e&&(e={});var n,r,i=new nh(e);for(i.smoothChildTiming=e_(e.smoothChildTiming),ee.remove(i),i._dp=0,i._time=i._tTime=ee._time,n=ee._first;n;)r=n._next,(t||!(!n._dur&&n instanceof nM&&n.vars.onComplete===n._targets[0]))&&tb(i,n,n._start-n._delay),n=r;return tb(ee,i,0),i},context:function(e,t){return e?new nQ(e,t):Z},matchMedia:function(e){return new nZ(e)},matchMediaRefresh:function(){return nK.forEach(function(e){var t,n,r=e.conditions;for(n in r)r[n]&&(r[n]=!1,t=1);t&&e.revert()})||nJ()},addEventListener:function(e,t){var n=nY[e]||(nY[e]=[]);~n.indexOf(t)||n.push(t)},removeEventListener:function(e,t){var n=nY[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},utils:{wrap:function e(t,n,r){var i=n-t;return eT(t)?tH(t,e(0,t.length),n):tA(r,function(e){return(i+(e-t)%i)%i+t})},wrapYoyo:function e(t,n,r){var i=n-t,s=2*i;return eT(t)?tH(t,e(0,t.length-1),n):tA(r,function(e){return e=(s+(e-t)%s)%s||0,t+(e>i?s-e:e)})},distribute:tB,random:tU,snap:tq,normalize:function(e,t,n){return tY(e,t,0,1,n)},getUnit:tI,clamp:function(e,t,n){return tA(n,function(n){return tR(e,t,n)})},splitColor:t0,toArray:tD,selector:tz,mapRange:tY,pipe:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduce(function(e,t){return t(e)},e)}},unitize:function(e,t){return function(n){return e(parseFloat(n))+(t||tI(n))}},interpolate:function e(t,n,r,i){var s=isNaN(t+n)?0:function(e){return(1-e)*t+e*n};if(!s){var a,o,l,u,c,d=eg(t),h={};if(!0===r&&(i=1)&&(r=null),d)t={p:t},n={p:n};else if(eT(t)&&!eT(n)){for(l=[],c=(u=t.length)-2,o=1;o<u;o++)l.push(e(t[o-1],t[o]));u--,s=function(e){var t=Math.min(c,~~(e*=u));return l[t](e-t)},r=n}else i||(t=tr(eT(t)?[]:{},t));if(!l){for(a in n)nb.call(h,t,a,"get",n[a]);s=function(e){return nF(e,h)||(d?t.p:t)}}}return tA(r,s)},shuffle:tF},install:eD,effects:eG,ticker:t6,updateRoot:nh.updateRoot,plugins:eW,globalTimeline:ee,core:{PropTween:nH,globals:eB,Tween:nM,Timeline:nh,Animation:nd,getCache:e0,_removeLinkedListItem:tu,reverting:function(){return Q},context:function(e){return e&&Z&&(Z.data.push(e),e._ctx=Z),Z},suppressOverwrites:function(e){return J=e}}};e2("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return n0[e]=nM[e]}),t6.add(nh.updateRoot),ea=n0.to({},{duration:0});var n1=function(e,t){for(var n=e._pt;n&&n.p!==t&&n.op!==t&&n.fp!==t;)n=n._next;return n},n2=function(e,t){var n,r,i,s=e._targets;for(n in t)for(r=s.length;r--;)(i=e._ptLookup[r][n])&&(i=i.d)&&(i._pt&&(i=n1(i,n)),i&&i.modifier&&i.modifier(t[n],e,s[r],n))},n5=function(e,t){return{name:e,headless:1,rawVars:1,init:function(e,n,r){r._onInit=function(e){var r,i;if(eg(n)&&(r={},e2(n,function(e){return r[e]=1}),n=r),t){for(i in r={},n)r[i]=t(n[i]);n=r}n2(e,n)}}}},n3=n0.registerPlugin({name:"attr",init:function(e,t,n,r,i){var s,a,o;for(s in this.tween=n,t)o=e.getAttribute(s)||"",(a=this.add(e,"setAttribute",(o||0)+"",t[s],r,i,0,0,s)).op=s,a.b=o,this._props.push(s)},render:function(e,t){for(var n=t._pt;n;)Q?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,t){for(var n=t.length;n--;)this.add(e,n,e[n]||0,t[n],0,0,0,0,0,1)}},n5("roundProps",t$),n5("modifiers"),n5("snap",tq))||n0;nM.version=nh.version=n3.version="3.15.0",ei=1,ew()&&t7(),t8.Power0,t8.Power1,t8.Power2,t8.Power3,t8.Power4,t8.Linear,t8.Quad,t8.Cubic,t8.Quart,t8.Quint,t8.Strong,t8.Elastic,t8.Back,t8.SteppedEase,t8.Bounce,t8.Sine,t8.Expo,t8.Circ;var n4,n6,n7,n8,n9,re,rt,rn={},rr=180/Math.PI,ri=Math.PI/180,rs=Math.atan2,ra=/([A-Z])/g,ro=/(left|right|width|margin|padding|x)/i,rl=/[\s,\(]\S/,ru={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},rc=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},rd=function(e,t){return t.set(t.t,t.p,1===e?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},rh=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},rf=function(e,t){return t.set(t.t,t.p,1===e?t.e:e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},rp=function(e,t){var n=t.s+t.c*e;t.set(t.t,t.p,~~(n+(n<0?-.5:.5))+t.u,t)},rm=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},rg=function(e,t){return t.set(t.t,t.p,1!==e?t.b:t.e,t)},rx=function(e,t,n){return e.style[t]=n},ry=function(e,t,n){return e.style.setProperty(t,n)},rv=function(e,t,n){return e._gsap[t]=n},rb=function(e,t,n){return e._gsap.scaleX=e._gsap.scaleY=n},r_=function(e,t,n,r,i){var s=e._gsap;s.scaleX=s.scaleY=n,s.renderTransform(i,s)},rw=function(e,t,n,r,i){var s=e._gsap;s[t]=n,s.renderTransform(i,s)},rk="transform",rj=rk+"Origin",rT=function e(t,n){var r=this,i=this.target,s=i.style,a=i._gsap;if(t in rn&&s){if(this.tfm=this.tfm||{},"transform"===t)return ru.transform.split(",").forEach(function(t){return e.call(r,t,n)});if(~(t=ru[t]||t).indexOf(",")?t.split(",").forEach(function(e){return r.tfm[e]=rU(i,e)}):this.tfm[t]=a.x?a[t]:rU(i,t),t===rj&&(this.tfm.zOrigin=a.zOrigin),this.props.indexOf(rk)>=0)return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(rj,n,"")),t=rk}(s||n)&&this.props.push(t,n,s[t])},rS=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},rN=function(){var e,t,n=this.props,r=this.target,i=r.style,s=r._gsap;for(e=0;e<n.length;e+=3)n[e+1]?2===n[e+1]?r[n[e]](n[e+2]):r[n[e]]=n[e+2]:n[e+2]?i[n[e]]=n[e+2]:i.removeProperty("--"===n[e].substr(0,2)?n[e]:n[e].replace(ra,"-$1").toLowerCase());if(this.tfm){for(t in this.tfm)s[t]=this.tfm[t];s.svg&&(s.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),(e=re())&&e.isStart||i[rk]||(rS(i),s.zOrigin&&i[rj]&&(i[rj]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},rC=function(e,t){var n={target:e,props:[],revert:rN,save:rT};return e._gsap||n3.core.getCache(e),t&&e.style&&e.nodeType&&t.split(",").forEach(function(e){return n.save(e)}),n},rE=function(e,t){var n=n4.createElementNS?n4.createElementNS((t||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):n4.createElement(e);return n&&n.style?n:n4.createElement(e)},rM=function e(t,n,r){var i=getComputedStyle(t);return i[n]||i.getPropertyValue(n.replace(ra,"-$1").toLowerCase())||i.getPropertyValue(n)||!r&&e(t,rA(n)||n,1)||""},rO="O,Moz,ms,Ms,Webkit".split(","),rA=function(e,t,n){var r=(t||n8).style,i=5;if(e in r&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);i--&&!(rO[i]+e in r););return i<0?null:(3===i?"ms":i>=0?rO[i]:"")+e},rR=function(){"u">typeof window&&window.document&&(n6=(n4=window.document).documentElement,n8=rE("div")||{style:{}},rE("div"),rj=(rk=rA(rk))+"Origin",n8.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",rt=!!rA("perspective"),re=n3.core.reverting,n7=1)},rI=function(e){var t,n=e.ownerSVGElement,r=rE("svg",n&&n.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),i=e.cloneNode(!0);i.style.display="block",r.appendChild(i),n6.appendChild(r);try{t=i.getBBox()}catch(e){}return r.removeChild(i),n6.removeChild(r),t},rL=function(e,t){for(var n=t.length;n--;)if(e.hasAttribute(t[n]))return e.getAttribute(t[n])},rP=function(e){var t,n;try{t=e.getBBox()}catch(r){t=rI(e),n=1}return t&&(t.width||t.height)||n||(t=rI(e)),!t||t.width||t.x||t.y?t:{x:+rL(e,["x","cx","x1"])||0,y:+rL(e,["y","cy","y1"])||0,width:0,height:0}},rD=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&rP(e))},rz=function(e,t){if(t){var n,r=e.style;t in rn&&t!==rj&&(t=rk),r.removeProperty?(("ms"===(n=t.substr(0,2))||"webkit"===t.substr(0,6))&&(t="-"+t),r.removeProperty("--"===n?t:t.replace(ra,"-$1").toLowerCase())):r.removeAttribute(t)}},rF=function(e,t,n,r,i,s){var a=new nH(e._pt,t,n,0,1,s?rg:rm);return e._pt=a,a.b=r,a.e=i,e._props.push(n),a},rB={deg:1,rad:1,turn:1},r$={grid:1,flex:1},rq=function e(t,n,r,i){var s,a,o,l,u=parseFloat(r)||0,c=(r+"").trim().substr((u+"").length)||"px",d=n8.style,h=ro.test(n),f="svg"===t.tagName.toLowerCase(),p=(f?"client":"offset")+(h?"Width":"Height"),m="px"===i,g="%"===i;if(i===c||!u||rB[i]||rB[c])return u;if("px"===c||m||(u=e(t,n,r,"px")),l=t.getCTM&&rD(t),(g||"%"===c)&&(rn[n]||~n.indexOf("adius")))return s=l?t.getBBox()[h?"width":"height"]:t[p],e5(g?u/s*100:u/100*s);if(d[h?"width":"height"]=100+(m?c:i),a="rem"!==i&&~n.indexOf("adius")||"em"===i&&t.appendChild&&!f?t:t.parentNode,l&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==n4&&a.appendChild||(a=n4.body),(o=a._gsap)&&g&&o.width&&h&&o.time===t6.time&&!o.uncache)return e5(u/o.width*100);if(g&&("height"===n||"width"===n)){var x=t.style[n];t.style[n]=100+i,s=t[p],x?t.style[n]=x:rz(t,n)}else(g||"%"===c)&&!r$[rM(a,"display")]&&(d.position=rM(t,"position")),a===t&&(d.position="static"),a.appendChild(n8),s=n8[p],a.removeChild(n8),d.position="absolute";return h&&g&&((o=e0(a)).time=t6.time,o.width=a[p]),e5(m?s*u/100:s&&u?100/s*u:0)},rU=function(e,t,n,r){var i;return n7||rR(),t in ru&&"transform"!==t&&~(t=ru[t]).indexOf(",")&&(t=t.split(",")[0]),rn[t]&&"transform"!==t?(i=r1(e,r),i="transformOrigin"!==t?i[t]:i.svg?i.origin:r2(rM(e,rj))+" "+i.zOrigin+"px"):(!(i=e.style[t])||"auto"===i||r||~(i+"").indexOf("calc("))&&(i=rW[t]&&rW[t](e,t,n)||rM(e,t)||e1(e,t)||+("opacity"===t)),n&&!~(i+"").trim().indexOf(" ")?rq(e,t,i,n)+n:i},rH=function(e,t,n,r){if(!n||"none"===n){var i=rA(t,e,1),s=i&&rM(e,i,1);s&&s!==n?(t=i,n=s):"borderColor"===t&&(n=rM(e,"borderTopColor"))}var a,o,l,u,c,d,h,f,p,m,g,x=new nH(this._pt,e.style,t,0,1,nz),y=0,v=0;if(x.b=n,x.e=r,n+="","var(--"===(r+="").substring(0,6)&&(r=rM(e,r.substring(4,r.indexOf(")")))),"auto"===r&&(d=e.style[t],e.style[t]=r,r=rM(e,t)||r,d?e.style[t]=d:rz(e,t)),t4(a=[n,r]),n=a[0],r=a[1],l=n.match(eM)||[],(r.match(eM)||[]).length){for(;o=eM.exec(r);)h=o[0],p=r.substring(y,o.index),c?c=(c+1)%5:("rgba("===p.substr(-5)||"hsla("===p.substr(-5))&&(c=1),h!==(d=l[v++]||"")&&(u=parseFloat(d)||0,g=d.substr((u+"").length),"="===h.charAt(1)&&(h=e4(u,h)+g),f=parseFloat(h),m=h.substr((f+"").length),y=eM.lastIndex-m.length,m||(m=m||el.units[t]||g,y===r.length&&(r+=m,x.e+=m)),g!==m&&(u=rq(e,t,d,m)||0),x._pt={_next:x._pt,p:p||1===v?p:",",s:u,c:f-u,m:c&&c<4||"zIndex"===t?Math.round:0});x.c=y<r.length?r.substring(y,r.length):""}else x.r="display"===t&&"none"===r?rg:rm;return eA.test(r)&&(x.e=0),this._pt=x,x},rK={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},rY=function(e){var t=e.split(" "),n=t[0],r=t[1]||"50%";return("top"===n||"bottom"===n||"left"===r||"right"===r)&&(e=n,n=r,r=e),t[0]=rK[n]||n,t[1]=rK[r]||r,t.join(" ")},rV=function(e,t){if(t.tween&&t.tween._time===t.tween._dur){var n,r,i,s=t.t,a=s.style,o=t.u,l=s._gsap;if("all"===o||!0===o)a.cssText="",r=1;else for(i=(o=o.split(",")).length;--i>-1;)rn[n=o[i]]&&(r=1,n="transformOrigin"===n?rj:rk),rz(s,n);r&&(rz(s,rk),l&&(l.svg&&s.removeAttribute("transform"),a.scale=a.rotate=a.translate="none",r1(s,1),l.uncache=1,rS(a)))}},rW={clearProps:function(e,t,n,r,i){if("isFromStart"!==i.data){var s=e._pt=new nH(e._pt,t,n,0,0,rV);return s.u=r,s.pr=-10,s.tween=i,e._props.push(n),1}}},rG=[1,0,0,1,0,0],rX={},rJ=function(e){return"matrix(1, 0, 0, 1, 0, 0)"===e||"none"===e||!e},rQ=function(e){var t=rM(e,rk);return rJ(t)?rG:t.substr(7).match(eE).map(e5)},rZ=function(e,t){var n,r,i,s,a=e._gsap||e0(e),o=e.style,l=rQ(e);return a.svg&&e.getAttribute("transform")?"1,0,0,1,0,0"===(l=[(i=e.transform.baseVal.consolidate().matrix).a,i.b,i.c,i.d,i.e,i.f]).join(",")?rG:l:(l!==rG||e.offsetParent||e===n6||a.svg||(i=o.display,o.display="block",(n=e.parentNode)&&(e.offsetParent||e.getBoundingClientRect().width)||(s=1,r=e.nextElementSibling,n6.appendChild(e)),l=rQ(e),i?o.display=i:rz(e,"display"),s&&(r?n.insertBefore(e,r):n?n.appendChild(e):n6.removeChild(e))),t&&l.length>6?[l[0],l[1],l[4],l[5],l[12],l[13]]:l)},r0=function(e,t,n,r,i,s){var a,o,l,u,c=e._gsap,d=i||rZ(e,!0),h=c.xOrigin||0,f=c.yOrigin||0,p=c.xOffset||0,m=c.yOffset||0,g=d[0],x=d[1],y=d[2],v=d[3],b=d[4],_=d[5],w=t.split(" "),k=parseFloat(w[0])||0,j=parseFloat(w[1])||0;n?d!==rG&&(o=g*v-x*y)&&(l=v/o*k+-y/o*j+(y*_-v*b)/o,u=-x/o*k+g/o*j-(g*_-x*b)/o,k=l,j=u):(k=(a=rP(e)).x+(~w[0].indexOf("%")?k/100*a.width:k),j=a.y+(~(w[1]||w[0]).indexOf("%")?j/100*a.height:j)),r||!1!==r&&c.smooth?(c.xOffset=p+((b=k-h)*g+(_=j-f)*y)-b,c.yOffset=m+(b*x+_*v)-_):c.xOffset=c.yOffset=0,c.xOrigin=k,c.yOrigin=j,c.smooth=!!r,c.origin=t,c.originIsAbsolute=!!n,e.style[rj]="0px 0px",s&&(rF(s,c,"xOrigin",h,k),rF(s,c,"yOrigin",f,j),rF(s,c,"xOffset",p,c.xOffset),rF(s,c,"yOffset",m,c.yOffset)),e.setAttribute("data-svg-origin",k+" "+j)},r1=function(e,t){var n=e._gsap||new nc(e);if("x"in n&&!t&&!n.uncache)return n;var r,i,s,a,o,l,u,c,d,h,f,p,m,g,x,y,v,b,_,w,k,j,T,S,N,C,E,M,O,A,R,I,L=e.style,P=n.scaleX<0,D=getComputedStyle(e),z=rM(e,rj)||"0";return r=i=s=l=u=c=d=h=f=0,a=o=1,n.svg=!!(e.getCTM&&rD(e)),D.translate&&(("none"!==D.translate||"none"!==D.scale||"none"!==D.rotate)&&(L[rk]=("none"!==D.translate?"translate3d("+(D.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==D.rotate?"rotate("+D.rotate+") ":"")+("none"!==D.scale?"scale("+D.scale.split(" ").join(",")+") ":"")+("none"!==D[rk]?D[rk]:"")),L.scale=L.rotate=L.translate="none"),g=rZ(e,n.svg),n.svg&&(n.uncache?(N=e.getBBox(),z=n.xOrigin-N.x+"px "+(n.yOrigin-N.y)+"px",S=""):S=!t&&e.getAttribute("data-svg-origin"),r0(e,S||z,!!S||n.originIsAbsolute,!1!==n.smooth,g)),p=n.xOrigin||0,m=n.yOrigin||0,g!==rG&&(b=g[0],_=g[1],w=g[2],k=g[3],r=j=g[4],i=T=g[5],6===g.length?(a=Math.sqrt(b*b+_*_),o=Math.sqrt(k*k+w*w),l=b||_?rs(_,b)*rr:0,(d=w||k?rs(w,k)*rr+l:0)&&(o*=Math.abs(Math.cos(d*ri))),n.svg&&(r-=p-(p*b+m*w),i-=m-(p*_+m*k))):(I=g[6],A=g[7],E=g[8],M=g[9],O=g[10],R=g[11],r=g[12],i=g[13],s=g[14],u=(x=rs(I,O))*rr,x&&(S=j*(y=Math.cos(-x))+E*(v=Math.sin(-x)),N=T*y+M*v,C=I*y+O*v,E=-(j*v)+E*y,M=-(T*v)+M*y,O=-(I*v)+O*y,R=-(A*v)+R*y,j=S,T=N,I=C),c=(x=rs(-w,O))*rr,x&&(S=b*(y=Math.cos(-x))-E*(v=Math.sin(-x)),N=_*y-M*v,C=w*y-O*v,R=k*v+R*y,b=S,_=N,w=C),l=(x=rs(_,b))*rr,x&&(S=b*(y=Math.cos(x))+_*(v=Math.sin(x)),N=j*y+T*v,_=_*y-b*v,T=T*y-j*v,b=S,j=N),u&&Math.abs(u)+Math.abs(l)>359.9&&(u=l=0,c=180-c),a=e5(Math.sqrt(b*b+_*_+w*w)),o=e5(Math.sqrt(T*T+I*I)),d=Math.abs(x=rs(j,T))>2e-4?x*rr:0,f=R?1/(R<0?-R:R):0),n.svg&&(S=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!rJ(rM(e,rk)),S&&e.setAttribute("transform",S))),Math.abs(d)>90&&270>Math.abs(d)&&(P?(a*=-1,d+=l<=0?180:-180,l+=l<=0?180:-180):(o*=-1,d+=d<=0?180:-180)),t=t||n.uncache,n.x=r-((n.xPercent=r&&(!t&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-r)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+"px",n.y=i-((n.yPercent=i&&(!t&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-i)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+"px",n.z=s+"px",n.scaleX=e5(a),n.scaleY=e5(o),n.rotation=e5(l)+"deg",n.rotationX=e5(u)+"deg",n.rotationY=e5(c)+"deg",n.skewX=d+"deg",n.skewY=h+"deg",n.transformPerspective=f+"px",(n.zOrigin=parseFloat(z.split(" ")[2])||!t&&n.zOrigin||0)&&(L[rj]=r2(z)),n.xOffset=n.yOffset=0,n.force3D=el.force3D,n.renderTransform=n.svg?r7:rt?r6:r3,n.uncache=0,n},r2=function(e){return(e=e.split(" "))[0]+" "+e[1]},r5=function(e,t,n){var r=tI(t);return e5(parseFloat(t)+parseFloat(rq(e,"x",n+"px",r)))+r},r3=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,r6(e,t)},r4="0deg",r6=function(e,t){var n=t||this,r=n.xPercent,i=n.yPercent,s=n.x,a=n.y,o=n.z,l=n.rotation,u=n.rotationY,c=n.rotationX,d=n.skewX,h=n.skewY,f=n.scaleX,p=n.scaleY,m=n.transformPerspective,g=n.force3D,x=n.target,y=n.zOrigin,v="",b="auto"===g&&e&&1!==e||!0===g;if(y&&(c!==r4||u!==r4)){var _,w=parseFloat(u)*ri,k=Math.sin(w),j=Math.cos(w);s=r5(x,s,-(k*(_=Math.cos(w=parseFloat(c)*ri))*y)),a=r5(x,a,-(-Math.sin(w)*y)),o=r5(x,o,-(j*_*y)+y)}"0px"!==m&&(v+="perspective("+m+") "),(r||i)&&(v+="translate("+r+"%, "+i+"%) "),(b||"0px"!==s||"0px"!==a||"0px"!==o)&&(v+="0px"!==o||b?"translate3d("+s+", "+a+", "+o+") ":"translate("+s+", "+a+") "),l!==r4&&(v+="rotate("+l+") "),u!==r4&&(v+="rotateY("+u+") "),c!==r4&&(v+="rotateX("+c+") "),(d!==r4||h!==r4)&&(v+="skew("+d+", "+h+") "),(1!==f||1!==p)&&(v+="scale("+f+", "+p+") "),x.style[rk]=v||"translate(0, 0)"},r7=function(e,t){var n,r,i,s,a,o=t||this,l=o.xPercent,u=o.yPercent,c=o.x,d=o.y,h=o.rotation,f=o.skewX,p=o.skewY,m=o.scaleX,g=o.scaleY,x=o.target,y=o.xOrigin,v=o.yOrigin,b=o.xOffset,_=o.yOffset,w=o.forceCSS,k=parseFloat(c),j=parseFloat(d);h=parseFloat(h),f=parseFloat(f),(p=parseFloat(p))&&(f+=p=parseFloat(p),h+=p),h||f?(h*=ri,f*=ri,n=Math.cos(h)*m,r=Math.sin(h)*m,i=-(Math.sin(h-f)*g),s=Math.cos(h-f)*g,f&&(p*=ri,i*=a=Math.sqrt(1+(a=Math.tan(f-p))*a),s*=a,p&&(n*=a=Math.sqrt(1+(a=Math.tan(p))*a),r*=a)),n=e5(n),r=e5(r),i=e5(i),s=e5(s)):(n=m,s=g,r=i=0),(k&&!~(c+"").indexOf("px")||j&&!~(d+"").indexOf("px"))&&(k=rq(x,"x",c,"px"),j=rq(x,"y",d,"px")),(y||v||b||_)&&(k=e5(k+y-(y*n+v*i)+b),j=e5(j+v-(y*r+v*s)+_)),(l||u)&&(k=e5(k+l/100*(a=x.getBBox()).width),j=e5(j+u/100*a.height)),a="matrix("+n+","+r+","+i+","+s+","+k+","+j+")",x.setAttribute("transform",a),w&&(x.style[rk]=a)},r8=function(e,t,n,r,i){var s,a,o=eg(i),l=parseFloat(i)*(o&&~i.indexOf("rad")?rr:1)-r,u=r+l+"deg";return o&&("short"===(s=i.split("_")[1])&&(l%=360)!=l%180&&(l+=l<0?360:-360),"cw"===s&&l<0?l=(l+36e9)%360-360*~~(l/360):"ccw"===s&&l>0&&(l=(l-36e9)%360-360*~~(l/360))),e._pt=a=new nH(e._pt,t,n,r,l,rd),a.e=u,a.u="deg",e._props.push(n),a},r9=function(e,t){for(var n in t)e[n]=t[n];return e},ie=function(e,t,n){var r,i,s,a,o,l,u,c=r9({},n._gsap),d=n.style;for(i in c.svg?(s=n.getAttribute("transform"),n.setAttribute("transform",""),d[rk]=t,r=r1(n,1),rz(n,rk),n.setAttribute("transform",s)):(s=getComputedStyle(n)[rk],d[rk]=t,r=r1(n,1),d[rk]=s),rn)(s=c[i])!==(a=r[i])&&0>"perspective,force3D,transformOrigin,svgOrigin".indexOf(i)&&(o=tI(s)!==(u=tI(a))?rq(n,i,s,u):parseFloat(s),l=parseFloat(a),e._pt=new nH(e._pt,r,i,o,l-o,rc),e._pt.u=u||0,e._props.push(i));r9(r,c)};e2("padding,margin,Width,Radius",function(e,t){var n="Right",r="Bottom",i="Left",s=(t<3?["Top",n,r,i]:["Top"+i,"Top"+n,r+n,r+i]).map(function(n){return t<2?e+n:"border"+n+e});rW[t>1?"border"+e:e]=function(e,t,n,r,i){var a,o;if(arguments.length<4)return 5===(o=(a=s.map(function(t){return rU(e,t,n)})).join(" ")).split(a[0]).length?a[0]:o;a=(r+"").split(" "),o={},s.forEach(function(e,t){return o[e]=a[t]=a[t]||a[(t-1)/2|0]}),e.init(t,o,i)}});var it={name:"css",register:rR,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,n,r,i){var s,a,o,l,u,c,d,h,f,p,m,g,x,y,v,b,_,w=this._props,k=e.style,j=n.vars.startAt;for(d in n7||rR(),this.styles=this.styles||rC(e),b=this.styles.props,this.tween=n,t)if("autoRound"!==d&&(a=t[d],!(eW[d]&&nw(d,t,n,r,e,i)))){if(u=typeof a,c=rW[d],"function"===u&&(u=typeof(a=a.call(n,r,e,i))),"string"===u&&~a.indexOf("random(")&&(a=tK(a)),c)c(this,e,d,a,n)&&(v=1);else if("--"===d.substr(0,2))s=(getComputedStyle(e).getPropertyValue(d)+"").trim(),a+="",t5.lastIndex=0,!t5.test(s)&&(h=tI(s),(f=tI(a))?h!==f&&(s=rq(e,d,s,f)+f):h&&(a+=h)),this.add(k,"setProperty",s,a,r,i,0,0,d),w.push(d),b.push(d,0,k[d]);else if("undefined"!==u){if(j&&d in j?(eg(s="function"==typeof j[d]?j[d].call(n,r,e,i):j[d])&&~s.indexOf("random(")&&(s=tK(s)),tI(s+"")||"auto"===s||(s+=el.units[d]||tI(rU(e,d))||""),"="===(s+"").charAt(1)&&(s=rU(e,d))):s=rU(e,d),l=parseFloat(s),(p="string"===u&&"="===a.charAt(1)&&a.substr(0,2))&&(a=a.substr(2)),o=parseFloat(a),d in ru&&("autoAlpha"===d&&(1===l&&"hidden"===rU(e,"visibility")&&o&&(l=0),b.push("visibility",0,k.visibility),rF(this,k,"visibility",l?"inherit":"hidden",o?"inherit":"hidden",!o)),"scale"!==d&&"transform"!==d&&~(d=ru[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in rn){if(this.styles.save(d),_=a,"string"===u&&"var(--"===a.substring(0,6)){if("calc("===(a=rM(e,a.substring(4,a.indexOf(")")))).substring(0,5)){var T=e.style.perspective;e.style.perspective=a,a=rM(e,"perspective"),T?e.style.perspective=T:rz(e,"perspective")}o=parseFloat(a)}if(g||((x=e._gsap).renderTransform&&!t.parseTransform||r1(e,t.parseTransform),y=!1!==t.smoothOrigin&&x.smooth,(g=this._pt=new nH(this._pt,k,rk,0,1,x.renderTransform,x,0,-1)).dep=1),"scale"===d)this._pt=new nH(this._pt,x,"scaleY",x.scaleY,(p?e4(x.scaleY,p+o):o)-x.scaleY||0,rc),this._pt.u=0,w.push("scaleY",d),d+="X";else if("transformOrigin"===d){b.push(rj,0,k[rj]),a=rY(a),x.svg?r0(e,a,0,y,0,this):((f=parseFloat(a.split(" ")[2])||0)!==x.zOrigin&&rF(this,x,"zOrigin",x.zOrigin,f),rF(this,k,d,r2(s),r2(a)));continue}else if("svgOrigin"===d){r0(e,a,1,y,0,this);continue}else if(d in rX){r8(this,x,d,l,p?e4(l,p+a):a);continue}else if("smoothOrigin"===d){rF(this,x,"smooth",x.smooth,a);continue}else if("force3D"===d){x[d]=a;continue}else if("transform"===d){ie(this,a,e);continue}}else d in k||(d=rA(d)||d);if(m||(o||0===o)&&(l||0===l)&&!rl.test(a)&&d in k)h=(s+"").substr((l+"").length),o||(o=0),f=tI(a)||(d in el.units?el.units[d]:h),h!==f&&(l=rq(e,d,s,f)),this._pt=new nH(this._pt,m?x:k,d,l,(p?e4(l,p+o):o)-l,!m&&("px"===f||"zIndex"===d)&&!1!==t.autoRound?rp:rc),this._pt.u=f||0,m&&_!==a?(this._pt.b=s,this._pt.e=_,this._pt.r=rf):h!==f&&"%"!==f&&(this._pt.b=s,this._pt.r=rh);else if(d in k)rH.call(this,e,d,s,p?p+a:a);else if(d in e)this.add(e,d,s||e[d],p?p+a:a,r,i);else if("parseTransform"!==d){ez(d,a);continue}m||(d in k?b.push(d,0,k[d]):"function"==typeof e[d]?b.push(d,2,e[d]()):b.push(d,1,s||e[d])),w.push(d)}}v&&nU(this)},render:function(e,t){if(t.tween._time||!re())for(var n=t._pt;n;)n.r(e,n.d),n=n._next;else t.styles.revert()},get:rU,aliases:ru,getSetter:function(e,t,n){var r=ru[t];return r&&0>r.indexOf(",")&&(t=r),t in rn&&t!==rj&&(e._gsap.x||rU(e,"x"))?n&&n9===n?"scale"===t?rb:rv:(n9=n||{},"scale"===t?r_:rw):e.style&&!ev(e.style[t])?rx:~t.indexOf("-")?ry:nL(e,t)},core:{_removeProperty:rz,_getMatrix:rZ}};n3.utils.checkPrefix=rA,n3.core.getStyleSaver=rC,n=e2("x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+(t="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(e){rn[e]=1}),e2(t,function(e){el.units[e]="deg",rX[e]=1}),ru[n[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+t,e2("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(e){var t=e.split(":");ru[t[1]]=n[t[0]]}),e2("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){el.units[e]="px"}),n3.registerPlugin(it);var ir=n3.registerPlugin(it)||n3;ir.core.Tween;let ii=({text:e,as:t="div",typingSpeed:n=50,initialDelay:r=0,pauseDuration:i=2e3,deletingSpeed:a=30,loop:o=!0,className:l="",showCursor:u=!0,hideCursorWhileTyping:c=!1,cursorCharacter:d="|",cursorClassName:h="",cursorBlinkDuration:f=.5,textColors:p=[],variableSpeed:m,onSentenceComplete:g,startOnVisible:x=!1,reverseMode:y=!1,...v})=>{let[b,_]=(0,w.useState)(""),[k,j]=(0,w.useState)(0),[T,S]=(0,w.useState)(!1),[N,C]=(0,w.useState)(0),[E,M]=(0,w.useState)(!x),O=(0,w.useRef)(null),A=(0,w.useRef)(null),R=(0,w.useMemo)(()=>Array.isArray(e)?e:[e],[e]),I=(0,w.useCallback)(()=>{if(!m)return n;let{min:e,max:t}=m;return Math.random()*(t-e)+e},[m,n]);(0,w.useEffect)(()=>{if(!x||!A.current)return;let e=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&M(!0)})},{threshold:.1});return e.observe(A.current),()=>e.disconnect()},[x]),(0,w.useEffect)(()=>{u&&O.current&&(ir.set(O.current,{opacity:1}),ir.to(O.current,{opacity:0,duration:f,repeat:-1,yoyo:!0,ease:"power2.inOut"}))},[u,f]),(0,w.useEffect)(()=>{let e;if(!E)return;let t=R[N],s=y?t.split("").reverse().join(""):t,l=()=>{if(T)if(""===b){if(S(!1),N===R.length-1&&!o)return;g&&g(R[N],N),C(e=>(e+1)%R.length),j(0),e=setTimeout(()=>{},i)}else e=setTimeout(()=>{_(e=>e.slice(0,-1))},a);else if(k<s.length)e=setTimeout(()=>{_(e=>e+s[k]),j(e=>e+1)},m?I():n);else if(R.length>=1){if(!o&&N===R.length-1)return;e=setTimeout(()=>{S(!0)},i)}};return 0!==k||T||""!==b?l():e=setTimeout(l,r),()=>clearTimeout(e)},[k,b,T,n,a,i,R,N,o,r,E,y,m,g]);let L=c&&(k<R[N].length||T);return(0,w.createElement)(t,{ref:A,className:`inline-block whitespace-pre-wrap tracking-tight ${l}`,...v},(0,s.jsx)("span",{className:"inline",style:{color:(0===p.length?"inherit":p[N%p.length])||"inherit"},children:b}),u&&(0,s.jsx)("span",{ref:O,className:`ml-1 inline-block opacity-100 ${L?"hidden":""} ${h}`,children:d}))};e.s([],951047),e.i(951047);var is=e.i(247167),ia=e.i(896499),io=e.i(956789),il=e.i(146376),iu=e.i(733332);let ic=w.createContext(void 0);function id(e){let t=w.useContext(ic);if(void 0===t&&!e)throw Error((0,iu.default)(72));return t}var ih=e.i(574735),ip=e.i(667865),im=e.i(229315),ig=e.i(584446),ix=e.i(157940);function iy(e){return null!=e&&null!=e.clientX}var iv=e.i(17989),ib=e.i(675606),i_=e.i(264111),iw=e.i(176782),ik=e.i(301252),ij=e.i(56434),iT=e.i(18478),iS=e.i(116786),iN=e.i(990627);let iC={...iS.popupStoreSelectors,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class iE extends ik.ReactStore{constructor(e,t,n){const r=new iN.PopupTriggerMap;super(iM(e,r,t,n),iO(r),iC)}setOpen=(e,t)=>{(0,i_.applyPopupOpenChange)(this,e,t,{extraState:{openChangeReason:t.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,(0,ib.createChangeEventDetails)(ij.REASONS.triggerPress,e))}}function iM(e,t,n,r=!1){return{...(0,iS.createInitialPopupStoreState)(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function iO(e){return{popupRef:w.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}let iA=(0,ia.fastComponent)(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a="none",actionsRef:o,onOpenChange:l,onOpenChangeComplete:u,handle:c,triggerId:d,defaultTriggerId:h=null,children:f}=e,p=(0,i_.usePopupRootStore)((e,t)=>new iE({open:n,openProp:r,activeTriggerId:h,triggerIdProp:d},e,t));p.useControlledProp("openProp",r),p.useControlledProp("triggerIdProp",d),p.useContextCallback("onOpenChange",l),p.useContextCallback("onOpenChangeComplete",u);let m=p.useState("open"),g=!t&&m,x=p.useState("activeTriggerId"),y=p.useState("mounted"),v=p.useState("payload");p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i,disabled:t}),(0,i_.useImplicitActiveTrigger)(p,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:b,transitionStatus:_}=(0,i_.useOpenStateTransitions)(g,p),k=p.useState("isInstantPhase"),j=p.useState("instantType"),T=p.useState("lastOpenChangeReason"),S=w.useRef(null);(0,il.useIsoLayoutEffect)(()=>{m&&t&&p.setOpen(!1,(0,ib.createChangeEventDetails)(ij.REASONS.disabled))},[m,t,p]),(0,il.useIsoLayoutEffect)(()=>{"ending"===_&&T===ij.REASONS.none||"ending"!==_&&k?("delay"!==j&&(S.current=j),p.set("instantType","delay")):null!==S.current&&(p.set("instantType",S.current),S.current=null)},[_,k,T,j,p]),(0,il.useIsoLayoutEffect)(()=>{g&&null==x&&p.set("payload",void 0)},[p,x,g]),w.useImperativeHandle(o,()=>({unmount:b,close:()=>p.setOpen(!1,(0,ib.createChangeEventDetails)(ij.REASONS.imperativeAction))}),[b,p]);let N=g||y||!t&&"none"!==a;return(0,s.jsxs)(ic.Provider,{value:p,children:[c&&(0,s.jsx)(i_.PopupHandleAttachment,{handle:c,store:p}),N&&(0,s.jsx)(iR,{store:p,disabled:t,trackCursorAxis:a}),"function"==typeof f?f({payload:v}):f]})});function iR({store:e,disabled:t,trackCursorAxis:n}){let r=e.useState("floatingRootContext"),i=(0,iv.useDismiss)(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=function(e,t={}){let{enabled:n=!0,axis:r="both"}=t,i="rootStore"in e?e.rootStore:e,s=i.useState("open"),a=i.useState("floatingElement"),o=i.useState("domReferenceElement"),l=i.context.dataRef,u=w.useRef(!1),c=w.useRef(null),[d,h]=w.useState(),[f,p]=w.useState([]),m=(0,ip.useStableCallback)(e=>{i.set("positionReference",e)}),g=(0,ip.useStableCallback)((e,t,n)=>{if(!u.current&&(!l.current.openEvent||iy(l.current.openEvent))){var s,a;let u,c,h;i.set("positionReference",(s=n??o,a={x:e,y:t,axis:r,dataRef:l,pointerType:d},u=null,c=null,h=!1,{contextElement:s||void 0,getBoundingClientRect(){let e=s?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},t="x"===a.axis||"both"===a.axis,n="y"===a.axis||"both"===a.axis,r=["mouseenter","mousemove"].includes(a.dataRef.current.openEvent?.type||"")&&"touch"!==a.pointerType,i=e.width,o=e.height,l=e.x,d=e.y;return null==u&&a.x&&t&&(u=e.x-a.x),null==c&&a.y&&n&&(c=e.y-a.y),l-=u||0,d-=c||0,i=0,o=0,!h||r?(i="y"===a.axis?e.width:0,o="x"===a.axis?e.height:0,l=t&&null!=a.x?a.x:l,d=n&&null!=a.y?a.y:d):h&&!r&&(o="x"===a.axis?e.height:o,i="y"===a.axis?e.width:i),h=!0,{width:i,height:o,x:l,y:d,top:d,right:l+i,bottom:d+o,left:l}}}))}}),x=(0,ip.useStableCallback)(e=>{s?c.current||(g(e.clientX,e.clientY,e.currentTarget),p([])):g(e.clientX,e.clientY,e.currentTarget)}),y=(0,ix.isMouseLikePointerType)(d)?a:s;w.useEffect(()=>{if(!n)return void m(o);if(!y)return;function e(){c.current?.(),c.current=null}let t=(0,im.getWindow)(a);return!l.current.openEvent||iy(l.current.openEvent)?c.current=(0,ih.addEventListener)(t,"mousemove",function(t){let n=(0,ig.getTarget)(t);(0,ig.contains)(a,n)?e():g(t.clientX,t.clientY)}):m(o),e},[y,n,a,l,o,i,g,m,f]),w.useEffect(()=>()=>{i.set("positionReference",null)},[i]),w.useEffect(()=>{n&&!a&&(u.current=!1)},[n,a]),w.useEffect(()=>{!n&&s&&(u.current=!0)},[n,s]);let v=w.useMemo(()=>{function e(e){h(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:x,onMouseEnter:x}},[x]);return w.useMemo(()=>n?{reference:v,trigger:v}:{},[n,v])}(r,{enabled:!t&&"none"!==n,axis:"none"===n?void 0:n}),a=w.useMemo(()=>(0,iw.mergeProps)(s.reference,i.reference),[s.reference,i.reference]);return(0,i_.usePopupInteractionProps)(e,{activeTriggerProps:a,inactiveTriggerProps:a,popupProps:i.floating??io.EMPTY_OBJECT}),null}var iI=e.i(439957),iL=e.i(446265),iP=e.i(879938),iD=e.i(552245),iz=e.i(459636),iF=e.i(788015);let iB=w.createContext(void 0);var i$=e.i(650316),iq=e.i(944681);let iU=w.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new iI.Timeout,currentIdRef:{current:null},currentContextRef:{current:null}});function iH(e){let{children:t,delay:n,timeoutMs:r=0}=e,i=w.useRef(n),a=w.useRef(n),o=w.useRef(null),l=w.useRef(null),u=(0,iI.useTimeout)();return(0,il.useIsoLayoutEffect)(()=>{if(a.current=n,!o.current){i.current=n;return}i.current={open:(0,iq.getDelay)(i.current,"open"),close:(0,iq.getDelay)(n,"close")}},[n,o,i,a]),(0,s.jsx)(iU.Provider,{value:w.useMemo(()=>({hasProvider:!0,delayRef:i,initialDelayRef:a,currentIdRef:o,timeoutMs:r,currentContextRef:l,timeout:u}),[r,u]),children:t})}var iK=e.i(413082),iY=e.i(872135),iV=e.i(673752),iW=e.i(322846);let iG="data-base-ui-tooltip-trigger";function iX(e){if("composedPath"in e){let t=e.composedPath();for(let e=0;e<t.length;e+=1){let n=t[e];if((0,im.isElement)(n))return n}}let t=e.target;return(0,im.isElement)(t)?t:null}let iJ=(0,ia.fastComponentRef)(function(e,t){let{render:n,className:r,style:i,handle:s,payload:a,disabled:o,delay:l,closeOnClick:u=!0,closeDelay:c,id:d,...h}=e,f=id(!0),p=(0,iz.usePopupHandleStore)(s)??f;if(!p)throw Error((0,iu.default)(82));let m=(0,iF.useBaseUiId)(d),g=p.useState("isTriggerActive",m),x=p.useState("isOpenedByTrigger",m),y=p.useState("floatingRootContext"),v=w.useRef(null),b=c??0,{registerTrigger:_,isMountedByThisTrigger:k}=(0,i_.useTriggerDataForwarding)(m,v,p,{payload:a,closeOnClick:u,closeDelay:b}),j=w.useContext(iB),{activeIdRef:T,delayRef:S,isInstantPhase:N,hasProvider:C}=function(e,t={open:!1}){let{open:n}=t,r="rootStore"in e?e.rootStore:e,i=r.useState("floatingId"),{currentIdRef:s,delayRef:a,timeoutMs:o,initialDelayRef:l,currentContextRef:u,hasProvider:c,timeout:d}=w.useContext(iU),[h,f]=w.useState(!1),p=w.useRef(n);return(0,il.useIsoLayoutEffect)(()=>{p.current=n},[n]),(0,il.useIsoLayoutEffect)(()=>{function e(){u.current?.setIsInstantPhase(!1),s.current=null,u.current=null,a.current=l.current,d.clear()}if(s.current&&!n&&s.current===i){if(f(!1),o)return d.start(o,()=>{r.select("open")||s.current&&s.current!==i||e()}),()=>{(p.current||s.current!==i)&&d.clear()};e()}},[n,i,s,a,o,l,u,d,r]),(0,il.useIsoLayoutEffect)(()=>{if(!n)return;let e=u.current,t=s.current;d.clear(),u.current={onOpenChange:r.setOpen,setIsInstantPhase:f},s.current=i,a.current={open:0,close:(0,iq.getDelay)(l.current,"close")},null!==t&&t!==i?(f(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,(0,ib.createChangeEventDetails)(ij.REASONS.none))):(f(!1),e?.setIsInstantPhase(!1))},[n,i,r,s,a,l,u,d]),(0,il.useIsoLayoutEffect)(()=>()=>{s.current===i&&(u.current=null,p.current)&&(s.current=null,a.current=l.current,d.clear())},[u,s,a,i,l,d]),w.useMemo(()=>({activeIdRef:s,hasProvider:c,delayRef:a,isInstantPhase:h}),[s,c,a,h])}(y,{open:x}),E=(0,iV.useHoverInteractionSharedState)(y);p.useSyncedValue("isInstantPhase",N);let M=p.useState("disabled"),O=o??M,A=(0,iL.useValueAsRef)(O),R=p.useState("trackCursorAxis"),I=p.useState("disableHoverablePopup"),L=w.useRef(!1),P=(0,iI.useTimeout)(),D=w.useRef(void 0);function z(){return C&&null!=T.current?0:l??j??600}function F(e){let t=v.current;if(!t||!e)return!1;let n=function(e){let t=e;for(;t;){let e=t.closest(`[${iG}]`);if(e)return e;let n=t.getRootNode();t="host"in n&&(0,im.isElement)(n.host)?n.host:null}return null}(e);return null!==n&&n!==t&&(0,ig.contains)(t,n)}let B=(0,iY.useHoverReferenceInteraction)(y,{enabled:!O,mouseOnly:!0,move:!1,handleClose:I||"both"===R?null:(0,i$.safePolygon)(),restMs:z,delay:()=>null==c&&C?{close:(0,iq.getDelay)(S.current,"close")}:{close:b},triggerElementRef:v,isActiveTrigger:g,isClosing:()=>"ending"===p.select("transitionStatus"),shouldOpen:()=>!L.current}),$=(0,iK.useFocus)(y,{enabled:!O}).reference,q=p.useState("triggerProps",k),U=k||"none"!==R;return(0,iD.useRenderElement)("button",e,{state:{open:x},ref:[t,_,v],props:[B,$,U?q:void 0,{onMouseOver(e){(e=>{let t,n=L.current,r=iX(e),i=(L.current=t=F(r),t&&(E.openChangeTimeout.clear(),E.restTimeout.clear(),E.restTimeoutPending=!1,P.clear()),t),s=v.current,a=s&&r&&(0,ig.contains)(s,r);if(i&&p.select("open")&&p.select("lastOpenChangeReason")===ij.REASONS.triggerHover)return p.setOpen(!1,(0,ib.createChangeEventDetails)(ij.REASONS.triggerHover,e));if(n&&!i&&a&&!A.current&&!p.select("open")&&s&&(0,ix.isMouseLikePointerType)(D.current)){let t=()=>{L.current||A.current||p.select("open")||p.setOpen(!0,(0,ib.createChangeEventDetails)(ij.REASONS.triggerHover,e,s))},n=z();0===n?(P.clear(),t()):P.start(n,t)}})(e.nativeEvent)},onFocus(e){F(iX(e.nativeEvent))&&e.preventBaseUIHandler()},onMouseLeave(){L.current=!1,P.clear(),D.current=void 0},onPointerEnter(e){D.current=e.pointerType},onPointerDown(e){D.current=e.pointerType,p.set("closeOnClick",u),u&&!p.select("open")&&p.cancelPendingOpen(e.nativeEvent)},onClick(e){u&&!p.select("open")&&p.cancelPendingOpen(e.nativeEvent)},id:m,[iW.triggerDisabled]:O?"":void 0,[iG]:O?void 0:""},h],stateAttributesMapping:iP.triggerOpenStateMapping})}),iQ=w.createContext(void 0);var iZ=e.i(378680);let i0=w.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return id().useState("mounted")||n?(0,s.jsx)(iQ.Provider,{value:n,children:(0,s.jsx)(iZ.FloatingPortalLite,{ref:t,...r})}):null}),i1=w.createContext(void 0);function i2(){let e=w.useContext(i1);if(void 0===e)throw Error((0,iu.default)(71));return e}var i5=e.i(923706),i3=e.i(638396),i4=e.i(789579);let i6=w.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a="absolute",side:o="top",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:h=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:g=i3.POPUP_COLLISION_AVOIDANCE,style:x,...y}=e,v=id(),b=function(){let e=w.useContext(iQ);if(void 0===e)throw Error((0,iu.default)(70));return e}(),_=v.useState("open"),k=v.useState("mounted"),j=v.useState("trackCursorAxis"),T=v.useState("disableHoverablePopup"),S=v.useState("floatingRootContext"),N=v.useState("instantType"),C=v.useState("transitionStatus"),E=v.useState("adaptiveOrigin"),M=(0,i5.useAnchorPositioning)({anchor:i,positionMethod:a,floatingRootContext:S,mounted:k,side:o,sideOffset:u,align:l,alignOffset:c,collisionBoundary:d,collisionPadding:h,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:g,adaptiveOrigin:E}),O=w.useMemo(()=>({open:_,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:"none"!==j?"tracking-cursor":N}),[_,M.side,M.align,M.anchorHidden,j,N]),A=(0,i4.usePositioner)(e,O,{styles:M.positionerStyles,transitionStatus:C,props:y,refs:[t,v.useStateSetter("positionerElement")],hidden:!k,inert:!_||"both"===j||T});return(0,s.jsx)(i1.Provider,{value:M,children:A})});var i7=e.i(137584),i8=e.i(253984),i9=e.i(431157);let se=w.forwardRef(function(e,t){let{render:n,className:r,style:i,...s}=e,a=id(),{side:o,align:l}=i2(),u=a.useState("open"),c=a.useState("instantType"),d=a.useState("transitionStatus"),h=a.useState("popupProps"),f=a.useState("floatingRootContext"),p=a.useState("disabled"),m=a.useState("closeDelay");(0,i7.useOpenChangeComplete)({open:u,ref:a.context.popupRef,onComplete(){u&&a.context.onOpenChangeComplete?.(!0)}}),(0,i9.useHoverFloatingInteraction)(f,{enabled:!p,closeDelay:m});let g=a.useStateSetter("popupElement");return(0,iD.useRenderElement)("div",e,{state:{open:u,side:o,align:l,instant:c,transitionStatus:d},ref:[t,a.context.popupRef,g],props:[i_.FOCUSABLE_POPUP_PROPS,h,(0,i8.getDisabledMountTransitionStyles)(d),s],stateAttributesMapping:iP.popupTransitionStateMapping})}),st=w.forwardRef(function(e,t){let{render:n,className:r,style:i,...s}=e,a=id(),{arrowRef:o,side:l,align:u,arrowUncentered:c,arrowStyles:d}=i2(),h=a.useState("open"),f=a.useState("instantType");return(0,iD.useRenderElement)("div",e,{state:{open:h,side:l,align:u,uncentered:c,instant:f},ref:[t,o],props:[{style:d,"aria-hidden":!0},s],stateAttributesMapping:iP.popupStateMapping})});var sn=e.i(818390);let sr=w.forwardRef(function(e,t){let{render:n,className:r,style:i,children:s,...a}=e,o=id(),l=i2(),u=o.useState("instantType"),{children:c,state:d}=(0,sn.usePopupViewport)({store:o,side:l.side,children:s}),h={activationDirection:d.activationDirection,transitioning:d.transitioning,instant:u};return(0,iD.useRenderElement)("div",e,{state:h,ref:t,props:[a,{children:c}],stateAttributesMapping:sn.popupViewportStateMapping})});var si=e.i(564170);class ss extends si.BasePopupHandle{constructor(){super(function(){let e=new iN.PopupTriggerMap;return Object.assign(new iT.NullStore(Object.freeze(iM(void 0,e)),Object.freeze(iO(e)),iC),{setOpen:io.NOOP,cancelPendingOpen:io.NOOP})}(),"Tooltip")}open(e){this.openByTrigger(e)}close(){this.closePopup()}get isOpen(){return this.attachedStore?.select("open")??!1}}e.s(["Arrow",0,st,"Handle",0,ss,"Popup",0,se,"Portal",0,i0,"Positioner",0,i6,"Provider",0,function(e){let{delay:t,closeDelay:n,timeout:r=400}=e,i=w.useMemo(()=>({open:t,close:n}),[t,n]);return(0,s.jsx)(iB.Provider,{value:t,children:(0,s.jsx)(iH,{delay:i,timeoutMs:r,children:e.children})})},"Root",0,iA,"Trigger",0,iJ,"Viewport",0,sr,"createHandle",0,function(){return new ss}],599643);var sa=e.i(599643),sa=sa;function so({delay:e=0,...t}){return(0,s.jsx)(sa.Provider,{"data-slot":"tooltip-provider",delay:e,...t})}function sl({...e}){return(0,s.jsx)(sa.Root,{"data-slot":"tooltip",...e})}function su({...e}){return(0,s.jsx)(sa.Trigger,{"data-slot":"tooltip-trigger",...e})}function sc({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:a,...o}){return(0,s.jsx)(sa.Portal,{children:(0,s.jsx)(sa.Positioner,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:(0,s.jsxs)(sa.Popup,{"data-slot":"tooltip-content",className:(0,S.cn)("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[a,(0,s.jsx)(sa.Arrow,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}e.s(["Tooltip",0,sl,"TooltipContent",0,sc,"TooltipProvider",0,so,"TooltipTrigger",0,su],728231);var sd=e.i(41533),sh=e.i(149666),sf=e.i(265402),sp=e.i(451888),sm=e.i(635963),sg=e.i(511769),sx=e.i(399512),sy=e.i(245629),sv=e.i(661504),sb=e.i(283653),s_=e.i(978411),sw=e.i(351866),sk=e.i(401851),sj=e.i(677241),sT=e.i(24708),sS=e.i(845110),sN=e.i(980797),sC=e.i(383482),sE=e.i(24071),sM=e.i(931619),sO=e.i(632781),sA=e.i(671428),sR=e.i(127341),sI=e.i(835878),sL=e.i(431594);let sP=sp.needsThreadReply,sD=e=>"done"===e.status&&!e.seen;function sz({tab:e,current:t,onTab:n,onClose:r}){return(0,s.jsxs)("div",{className:"flex items-center gap-2 pt-3 pr-3.5 pb-1.5 pl-2.5",children:[(0,s.jsx)(sR.Tabs,{value:e,onValueChange:e=>n(e),className:"gap-0",children:(0,s.jsxs)(sR.TabsList,{className:"gap-1 rounded-none bg-transparent p-0 group-data-horizontal/tabs:h-auto",children:[(0,s.jsxs)(sR.TabsTrigger,{value:"now",className:sw.TAB,children:["Now",t>0&&(0,s.jsx)("span",{className:"font-mono text-[10px] font-normal text-muted-foreground tabular-nums",children:t})]}),(0,s.jsx)(sR.TabsTrigger,{value:"history",className:sw.TAB,children:"History"})]})}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)(sw.FoldButton,{onClick:r})]})}function sF({bots:e}){return(0,s.jsx)("p",{className:"px-6 pt-4 pb-5 text-center text-[12px] text-muted-foreground",children:e?.length?"Nothing handed over yet — ask for something that takes a while.":`Thursday hands work to ${sp.DEFAULT_BOT.name} until you make bots of your own in Settings › Bots.`})}function sB(){return(0,s.jsx)("p",{className:"px-6 pt-4 pb-5 text-center text-[12px] text-muted-foreground",children:"Nothing running or waiting."})}function s$({pages:e,threads:t,scroll:n,onPick:r}){let i=(0,w.useCallback)(e=>{e&&(e.scrollTop=n.current)},[n]),a=[];for(let e of t){let t=function(e){let t=(0,sy.toDate)(e);return(0,sN.isToday)(t)?"today":(0,sC.isYesterday)(t)?"yesterday":(0,sk.format)(t,function(e,t){let[n,r]=(0,sS.normalizeDates)(void 0,e,t);return n.getFullYear()===r.getFullYear()}((0,sj.constructFrom)(t,t),(0,sT.constructNow)(t))?"MMM d":"MMM d, yyyy").toLowerCase()}(e.updatedAt),n=a.at(-1);n?.day===t?n.rows.push(e):a.push({day:t,rows:[e]})}return(0,s.jsx)("div",{ref:i,onScroll:e=>{n.current=e.currentTarget.scrollTop},className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-2 scrollbar-none",children:e.error?(0,s.jsx)("p",{className:"px-2.5 py-3 text-[12px] text-destructive",children:e.error.message}):e.isLoading?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex h-6 items-center px-2.5 pt-1",children:(0,s.jsx)(sA.Skeleton,{className:"h-2.5 w-16"})}),(0,s.jsx)(sU,{})]}):(0,s.jsxs)(s.Fragment,{children:[a.map((e,t)=>(0,s.jsxs)(w.Fragment,{children:[(0,s.jsxs)("p",{className:(0,S.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===t?"pt-1":"pt-3"),children:[e.day," · ",e.rows.length]}),e.rows.map(e=>(0,s.jsx)(sY,{thread:e,onPick:()=>r(e.id)},e.id))]},e.day)),e.hasMore?(0,s.jsx)("div",{ref:e.sentinelRef,children:(0,s.jsx)(sU,{})}):0===a.length&&(0,s.jsx)("p",{className:"px-6 pt-3 pb-4 text-center text-[12px] text-muted-foreground",children:"Nothing has ended yet."})]})})}function sq({onBack:e,onClose:t}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1",children:[(0,s.jsx)("button",{type:"button",onClick:e,"aria-label":"Back to the list",className:"shrink-0 rounded-md p-1 text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(sE.ChevronLeft,{className:"size-4"})}),(0,s.jsx)(sA.Skeleton,{className:"size-5.5 shrink-0 rounded-md"}),(0,s.jsx)("span",{className:"flex min-w-0 flex-1",children:(0,s.jsx)(sA.Skeleton,{className:"h-3.5 w-2/5"})}),(0,s.jsx)(sw.FoldButton,{onClick:t})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-4 py-4",children:[(0,s.jsx)(sA.Skeleton,{className:"h-3 w-4/5"}),(0,s.jsx)(sA.Skeleton,{className:"h-3 w-3/5"}),(0,s.jsx)(sA.Skeleton,{className:"h-3 w-2/3"})]})]})}function sU(){return(0,s.jsxs)("div",{className:"flex items-center gap-2.5 px-2 py-1.5",children:[(0,s.jsx)(sA.Skeleton,{className:"size-8 shrink-0 rounded-[10px]"}),(0,s.jsxs)("span",{className:"flex h-9 min-w-0 flex-1 flex-col justify-center gap-1.5",children:[(0,s.jsx)(sA.Skeleton,{className:"h-3.5 w-2/5"}),(0,s.jsx)(sA.Skeleton,{className:"h-2.5 w-3/5"})]})]})}let sH=[{id:"you",label:"needs you",holds:sP},{id:"unread",label:"new results",holds:sD},{id:"working",label:"working",holds:e=>"working"===e.status},{id:"done",label:"done",holds:()=>!0}];function sK({threads:e,onPick:t}){let n=new Map;for(let t of e){let e=sH.find(e=>e.holds(t))??sH[sH.length-1],r=n.get(e.id);r?r.push(t):n.set(e.id,[t])}return(0,s.jsx)("div",{className:"flex min-h-0 flex-1 flex-col gap-0.5 overflow-y-auto px-2 pt-1 pb-1 scrollbar-none",children:sH.map((e,r)=>{let i=n.get(e.id)??[];return i.length?(0,s.jsxs)(w.Fragment,{children:[(0,s.jsxs)("p",{className:(0,S.cn)("px-2.5 pb-1 font-mono text-[10px] text-muted-foreground",0===r?"pt-1":"pt-3"),children:[e.label," · ",i.length]}),i.map(e=>(0,s.jsx)(sY,{thread:e,onPick:()=>t(e.id)},e.id))]},e.id):null})})}function sY({thread:e,onPick:t}){let n=sP(e),r=e.lines.at(-1),i=(0,w.useMemo)(()=>(function(e){let t=e.room.questions[0];if(t)return{text:(0,S.plainText)(t.text),tone:"text-foreground"};if("waiting"===e.status&&e.ask)return{text:(0,sp.isAppStop)(e.ask)?(0,S.plainText)(e.outcome??e.ask.question):e.ask.question,tone:S.WAITING_INK};let n=e.seen;if("cancelled"===e.status)return{text:"Stopped",tone:"text-muted-foreground"};if("done"===e.status)return{text:(0,S.plainText)(e.outcome??"Done"),tone:n?"text-muted-foreground":"text-foreground"};let r=(0,s_.lastSaid)(e);return r?{text:"tool"===r.kind&&r.tool?r.tool.note??`${r.tool.name} \xb7 ${r.tool.input}`:r.text,tone:"text-muted-foreground"}:{text:`${e.bot.name} is taking it on…`,tone:"text-muted-foreground italic"}})(e),[e.status,e.outcome,e.seen,e.ask,e.room.questions,r?.id]),[a,o]=(0,sx.useAnswerThread)(),[l,u]=(0,w.useState)(null),c="waiting"===e.status&&(0,sp.isAppStop)(e.ask)?e.ask?.options??[]:[];return(0,s.jsxs)("div",{className:"rounded-xl transition-colors hover:bg-muted/60",children:[(0,s.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2.5 rounded-xl px-2 py-1.5 text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("span",{className:"relative flex size-8 shrink-0 items-center justify-center overflow-visible",title:e.bot.name,children:(0,s.jsx)(sm.BotMark,{size:32,seed:e.bot.name,color:e.bot.icon?.color,shape:e.bot.icon?.shape,outline:e.bot.icon?.outline,paint:e.bot.icon?.paint,state:"working"===e.status?"thinking":"idle",notify:n,crossed:"cancelled"===e.status})}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(n||sD(e))&&(0,s.jsx)("span",{className:(0,S.cn)("block font-mono text-[10px] tracking-wide",n?"text-muted-foreground":"text-brand"),children:e.room.questions.length?`${1===e.room.questions.length?"Question":`${e.room.questions.length} questions`} \xb7 ${[...new Set(e.room.questions.map(e=>e.bot))].join(", ")}`:"waiting"===e.status?(0,sp.isAppStop)(e.ask)?"Paused":"Question":"New result"}),(0,s.jsxs)("span",{className:"flex items-center justify-between gap-2",children:[(0,s.jsx)("span",{className:(0,S.cn)("min-w-0 truncate text-[14px] leading-5 tracking-[-0.15px]",n?"text-foreground":"text-foreground/80",(n||sD(e))&&"font-medium"),children:e.label}),e.routineId&&(0,s.jsx)("span",{title:"Started by a routine",className:"shrink-0",children:(0,s.jsx)(sL.RoutineMark,{className:"size-3 text-muted-foreground/80"})}),(0,s.jsx)(sI.BotRoster,{bots:(0,s_.rosterOf)(e)}),(0,s.jsx)("span",{className:"flex-1"}),(0,s.jsx)("span",{className:"shrink-0 font-mono text-[11px] leading-4 text-muted-foreground/70 tabular-nums",children:(0,sy.shortAgo)(e.updatedAt)})]}),(0,s.jsxs)("span",{className:"mt-px flex h-4 items-center gap-1.5",children:["working"===e.status&&(0,s.jsx)(sO.Loader2,{className:"size-3 shrink-0 animate-spin text-muted-foreground/70"}),"working"!==e.status||n?(0,s.jsx)("span",{className:(0,S.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",i.tone),children:i.text}):(0,s.jsx)(A.ShinyText,{text:i.text,speed:2.2,className:(0,S.cn)("min-w-0 flex-1 truncate text-[12px] leading-4",i.tone.includes("italic")&&"italic")})]})]})]}),c.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-0.5 pr-2 pb-2 pl-12.5",children:c.map(t=>(0,s.jsxs)(j.Button,{size:"sm",variant:"outline",loading:l===t,disabled:o,onClick:async()=>{u(t),await a(e,t),u(null)},className:"h-7 gap-1.5 rounded-full border-brand bg-background px-3 text-[12px] text-brand hover:bg-brand/8 hover:text-brand dark:border-brand dark:bg-transparent dark:hover:bg-brand/12",children:[t===sp.THREAD_CONTINUE&&(0,s.jsx)(sM.ChevronsRight,{className:"size-3.5"}),t]},t))})]})}var sV=e.i(689664);let sW={name:"circle-pause",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]],aliases:["pause-circle"]};sW.node;let sG=(0,l.default)(sW);var sX=e.i(51481),sJ=e.i(77071),sQ=e.i(825398),sZ=e.i(256604),s0=e.i(864723);let s1={done:sV.Check,cancelled:_.X,question:sX.CircleQuestionMark,stopped:sG,resumed:sQ.RotateCw},s2={question:S.WAITING_INK,stopped:S.WAITING_INK},s5=e=>{let t=(0,S.plainText)(e).replace(/\s+/g," ").trim();return t.length>28?`${t.slice(0,27)}…`:t};function s3({crew:e,more:t,bubble:n,rows:r,count:i,busy:a,pending:o,onPick:l,onOpen:u}){let c=(0,s_.useWriteLineUp)(),d=r.length>0&&!c;return(0,s.jsxs)("div",{className:(0,S.cn)("pointer-events-auto w-fit max-w-full bg-background/78 ring-1 ring-border/50 backdrop-blur-md transition-shadow duration-300",d?"w-132 rounded-3xl shadow-lg shadow-black/8":"rounded-full shadow-sm shadow-black/3"),children:[(0,s.jsx)("div",{className:(0,S.cn)("grid overflow-hidden contain-inline-size transition-[grid-template-rows] duration-300 ease-out",d?"grid-rows-[1fr]":"grid-rows-[0fr]"),children:(0,s.jsxs)("div",{className:"min-h-0 overflow-hidden",inert:!d,children:[(0,s.jsxs)("p",{className:"px-3 py-2 font-mono text-[10px] tracking-wide text-muted-foreground",children:[o," ",1===o?"needs":"need"," a reply"]}),(0,s.jsx)("div",{className:"max-h-[45vh] overflow-y-auto px-1.5 pb-2",children:(0,s.jsx)("div",{children:r.map((e,t)=>(0,s.jsx)("div",{style:{animationDelay:`${120+60*t}ms`},className:"animate-in duration-300 fill-mode-backwards fade-in slide-in-from-bottom-1",children:(0,s.jsx)(sY,{thread:e,onPick:()=>l(e.id)})},e.id))},String(d))}),(0,s.jsx)("span",{className:"block h-1.5"})]})}),(0,s.jsx)(s4,{crew:e,more:t,bubble:d?null:n,label:i?`Threads (${i})`:"Bots",onClick:u,side:(0,s.jsx)(s6,{busy:a,pending:o,grown:d}),onWrite:s_.writeLine.open})]})}function s4({crew:e,more:t,bubble:n,side:r,label:i,onClick:a,onWrite:o}){return(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 py-1.5 pr-3 pl-1.5",children:[(0,s.jsxs)(sl,{children:[(0,s.jsx)(su,{render:(0,s.jsx)("button",{type:"button",onClick:o,"aria-label":"Write to Thursday or a bot",className:"grid size-7 shrink-0 place-items-center rounded-full bg-muted text-foreground outline-none transition-colors hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"}),children:(0,s.jsx)(sJ.Plus,{className:"size-3.5"})}),(0,s.jsxs)(sc,{children:["Write to Thursday or a bot",(0,s.jsx)("kbd",{"data-slot":"kbd",className:"bg-background/20 px-1.5 font-mono text-[10px]",children:"/"})]})]}),(0,s.jsxs)("button",{type:"button",onClick:a,"aria-label":i,className:"flex min-w-0 flex-1 items-center gap-2 rounded-full text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)(s8,{crew:e,more:t,bubble:n}),r]})]})}function s6(e){let t=function({busy:e,pending:t,grown:n}){return t>0?{text:1===t?"waiting on you":`${t} waiting on you`,shine:!0}:e>0?{text:"working",shine:!0,spin:!0}:n?null:{text:"Need a hand?",shine:!1}}(e);return t?(0,s.jsxs)("span",{className:"ml-auto flex h-7 shrink-0 items-center gap-1.5",children:[t.shine?(0,s.jsx)(A.ShinyText,{text:t.text,speed:2.6,className:"block truncate text-[14px] leading-5 tracking-[-0.15px]"}):(0,s.jsx)("span",{className:"block animate-in truncate text-[14px] leading-5 tracking-[-0.15px] text-muted-foreground fade-in duration-300",children:t.text},t.text),t.spin&&(0,s.jsx)(sO.Loader2,{className:"size-4 shrink-0 animate-spin text-muted-foreground/70"})]}):null}let s7=["alto","brio","cinder","delta"].map((e,t)=>({name:e,icon:{color:s0.MARK_PALETTE[Math.floor(t*s0.MARK_PALETTE.length/4)],shape:s0.MARK_SHAPES[t%s0.MARK_SHAPES.length]},awake:!1,waiting:!1,word:null,standIn:!0}));function s8({crew:e,more:t,bubble:n}){let r=e=>e.awake||e.waiting||e.word,i=e.some(r);return(0,s.jsxs)("span",{className:"flex min-w-0 shrink items-center",children:[e.map((t,a)=>(0,s.jsxs)(w.Fragment,{children:[(0,s.jsxs)("span",{className:(0,S.cn)("relative shrink-0 transition-[margin,opacity] duration-500 ease-out",i&&!r(t)&&"opacity-40",a>0&&!e[a-1].word&&"-ml-2",t.standIn&&"opacity-35"),style:{zIndex:e.length-a},children:[(0,s.jsx)("span",{className:(0,S.cn)("flex transition-transform duration-500 ease-out",t.awake&&"-translate-y-0.5 scale-110"),children:(0,s.jsx)(s9,{face:t})}),n?.at===t.name&&(0,s.jsx)(ae,{handoff:n})]}),t.word&&(0,s.jsx)("span",{className:"mx-2.5 min-w-0 shrink truncate",children:(0,s.jsx)(A.ShinyText,{text:t.word,speed:2.6,className:"truncate text-[13px] leading-5 tracking-[-0.1px]"})})]},t.name)),t>0&&(0,s.jsxs)("span",{className:(0,S.cn)("grid size-7 shrink-0 place-items-center rounded-[9px] bg-muted font-mono text-[10px] text-muted-foreground ring-1 ring-border/50",!e.at(-1)?.word&&"-ml-2"),title:`${t} more`,children:["+",t]})]})}function s9({face:e}){return(0,s.jsx)(sm.BotMark,{size:28,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:e.waiting})}function ae({handoff:e}){return(0,s.jsxs)("span",{className:"pointer-events-none absolute bottom-[calc(100%+10px)] left-1/2 flex w-max -translate-x-1/2 animate-in flex-col items-center fade-in zoom-in-95 duration-200",children:[(0,s.jsx)("span",{className:"flex rounded-full bg-background py-2 pr-3.5 pl-2.5 shadow-lg shadow-black/10 ring-1 ring-border",children:(0,s.jsx)(an,{handoff:e})}),(0,s.jsx)("span",{className:"-mt-px size-0 border-x-[6px] border-t-[7px] border-x-transparent border-t-border"}),(0,s.jsx)("span",{className:"-mt-[7.5px] size-0 border-x-[6px] border-t-[7px] border-x-transparent border-t-background"})]})}function at({handoff:e}){return(0,s.jsx)("span",{className:"ml-auto flex h-7 min-w-0 shrink animate-in items-center pl-4 fade-in duration-200",children:(0,s.jsx)(an,{handoff:e})})}function an({handoff:e}){let t=e.sign?s1[e.sign]:null,n=e.sign?s2[e.sign]:void 0;return(0,s.jsxs)("span",{className:(0,S.cn)("flex min-w-0 items-center gap-2 text-[13px] leading-[18px] tracking-[-0.1px] whitespace-nowrap",n),children:[(0,s.jsx)(ar,{from:e.from,to:e.to}),t&&(0,s.jsx)(t,{className:(0,S.cn)("size-3.5 shrink-0",!n&&"text-muted-foreground/70")}),e.shine?(0,s.jsx)(A.ShinyText,{text:e.text,speed:2.2,className:"min-w-0 truncate"}):(0,s.jsx)("span",{className:"min-w-0 truncate",children:e.text})]})}function ar({from:e,to:t}){let n=[e,...t];return(0,s.jsx)("span",{className:"flex shrink-0 items-center",children:n.map((e,t)=>(0,s.jsx)("span",{className:(0,S.cn)("relative flex",t>0&&"-ml-1.25"),style:{zIndex:n.length-t},children:(0,s.jsx)(ai,{bot:e})},e.name))})}function ai({bot:e}){return e.name===sw.THURSDAY.name?(0,s.jsx)(sZ.ThursdayMark,{size:18,className:"shrink-0"}):(0,s.jsx)(sm.BotMark,{size:18,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}let as=(0,w.memo)(function(){let e=(0,s_.useBotThreads)(),t=(0,s_.useRingingThreads)(),{data:n}=(0,sb.useServerRoute)(k.queryKey.bot),[r,i]=(0,w.useState)(!1),[a,o]=(0,w.useState)(null),l=r&&null!==a;(0,w.useEffect)(()=>(s_.roomOpen.set(l),()=>s_.roomOpen.set(!1)),[l]);let[u,c]=(0,w.useState)({}),[d,h]=(0,w.useState)("now"),f=(0,w.useRef)(0),p=[...e].reverse(),m=0,g=p.filter(e=>"cancelled"!==e.status&&("done"!==e.status||(m+=1)<=sd.INBOX_FINISHED||!e.seen)),x=r&&"history"===d,y=(0,sv.useServerPages)({key:(e,t)=>{if(!x)return null;if(0===e)return k.queryKey.threadHistory(null);let n=t?.at(-1);return n?k.queryKey.threadHistory((0,sy.toDate)(n.updatedAt).toISOString()):null},size:sd.PAGE_SIZE}),{refresh:v}=y,b=(0,w.useRef)(!1);b.current=y.items.length>0,(0,w.useEffect)(()=>{x&&b.current&&v()},[x,v]);let _=(0,w.useMemo)(()=>y.items.filter(e=>"done"===e.status||"cancelled"===e.status).map(e=>(0,s_.threadFromRow)(e,n)),[y.items,n]),j=a?p.find(e=>e.id===a)??_.find(e=>e.id===a)??null:null,{data:T,isLoading:S}=(0,sb.useServerRoute)(a&&!j?k.queryKey.thread(a):null),N=(0,w.useMemo)(()=>T&&T.id===a?(0,s_.threadFromRow)(T,n):null,[T,a,n]),C=j??N,[E,M]=function(){let[e,t]=(0,w.useState)(null),n=(0,w.useRef)(null);return(0,w.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),[e,(0,w.useCallback)(e=>{t(e),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,t(null)},3400)},[])]}(),O=(0,w.useMemo)(()=>E??function(e,t){for(let n of e){if("working"!==n.status)continue;let e=n.room.deliveries.find(e=>!e.delivered);if(e)return{at:e.bot,from:t(e.bot),to:[],text:"Step-in · waits for its next step",shine:!0}}return null}(e,e=>({name:e,icon:n?.find(t=>t.name===e)?.icon??null})),[E,e,n]),{crew:A,more:R}=(0,w.useMemo)(()=>(function(e,t){let n=new Map;for(let e of(0,s_.latestPerBot)(t)){let{thread:t,bot:r,line:i}=e;if("waiting"===t.status&&t.bot.name===r.name){n.set(r.name,{waiting:!0,word:null});continue}!("working"!==t.status||n.get(r.name)?.waiting)&&n.set(r.name,{waiting:!1,word:i?.kind==="tool"||i?.kind==="say"?s5((0,sw.stepOf)(i)):null})}let r=new Map;for(let t of e??[])r.set(t.name,{name:t.name,icon:t.icon,awake:n.has(t.name),waiting:n.get(t.name)?.waiting??!1,word:n.get(t.name)?.word??null});for(let[e,t]of n)r.has(e)||r.set(e,{name:e,icon:null,awake:!0,waiting:t.waiting,word:t.word});let i=[...r.values()];if(!i.length)return{crew:s7.slice(0,3),more:0};for(let e of s7){if(i.length>=3)break;r.has(e.name)||i.push(e)}let s=e=>e.waiting?0:e.awake?1:e.standIn?3:2,a=i.map((e,t)=>({face:e,at:t})).sort((e,t)=>s(e.face)-s(t.face)||e.at-t.at).map(e=>e.face);return{crew:a.slice(0,10),more:Math.max(0,a.length-10)}})(n,e),[n,e]),I=(0,w.useRef)(null),L=(0,w.useRef)(new Map),P=(0,w.useRef)(new Set);(0,w.useEffect)(()=>{if(!s_.botThreads.primed())return;let t=I.current;I.current=new Map(e.map(e=>[e.id,e.status]));let n=L.current;L.current=function(e){let t=new Map;for(let n of e)for(let e of n.room.participants)t.set(`${n.id}
2
- ${e.bot}`,e.state);return t}(e);let r=P.current;if(P.current=new Set(e.flatMap(e=>e.lines.map(e=>e.id))),!t)return;let i=null;for(let s of e)for(let e of function(e,t,n,r,i){let s=[],a=e.lines.filter(e=>!n.has(e.id)),o=e.bot,l=new Map;for(let e of a)"user"===e.kind?s.push(e.steppedIn?{rank:1,at:e.bot.name,from:e.bot,to:[],text:"Step-in · read"}:{rank:1,at:e.bot.name,from:sw.THURSDAY,to:[e.bot],text:s5(e.text)}):"stop"===e.kind?s.push({rank:3,at:e.bot.name,from:e.bot,to:[],sign:"stopped",text:(0,sw.leadOf)(e.text)}):"ask"===e.kind&&e.to?.name===sw.THURSDAY.name?s.push(e.question?{rank:4,at:e.bot.name,from:e.bot,to:[],sign:"question",text:`asks you \xb7 ${s5(e.text)}`}:{rank:2,at:e.bot.name,from:e.bot,to:[sw.THURSDAY],text:s5(e.text)}):"ask"===e.kind&&e.to&&l.set(e.bot.name,[...l.get(e.bot.name)??[],e]);for(let[e,t]of l){let n=new Map;for(let e of t)e.to&&n.set(e.to.name,e.to);s.push({rank:2,at:e,from:t[0].bot,to:[...n.values()],text:1===t.length?s5(t[0].text):`sent ${t.length} parts out`})}for(let t of(0,s_.rosterOf)(e)){let n=`${e.id}
3
- ${t.name}`;t.name===o.name||"running"!==r.get(n)||"done"!==i.get(n)||a.some(e=>e.bot.name===t.name&&("ask"===e.kind||"say"===e.kind))||s.push({rank:1,at:t.name,from:t,to:[],sign:"done",text:"finished its part"})}if(!t)return"working"===e.status&&s.push({rank:1,at:o.name,from:sw.THURSDAY,to:[o],text:`took on “${s5(e.label)}”`}),s;if(t===e.status)return s;let u=s5(e.label);return"cancelled"===e.status?s.push({rank:3,at:o.name,from:o,to:[],sign:"cancelled",text:`stopped \xb7 ${u}`}):"done"===e.status||("working"===e.status?a.some(e=>"user"===e.kind)||s.push({rank:1,at:o.name,from:o,to:[],sign:"resumed",text:"picked it back up"}):(0,sp.isAppStop)(e.ask)&&!s.some(e=>"question"===e.sign||"stopped"===e.sign)&&s.push({rank:3,at:o.name,from:o,to:[],sign:"stopped",text:"paused"})),s}(s,t.get(s.id),r,n,L.current))(!i||e.rank>=i.rank)&&(i=e);i&&M(i)},[e,M]),(0,s_.useSeenOnDetail)(r?C:null),(0,sg.useAppEvent)({showThread:e=>{o(e.threadId),i(!0)}}),(0,w.useEffect)(()=>s_.roomOpens.subscribe(e=>{o(e),i(!0)}),[]);let D=e.filter(e=>"working"===e.status).length,z=p.filter(sP).length,F=(0,w.useMemo)(()=>A.map(e=>({...e,word:null})),[A]),B=()=>{i(!1),o(null),h("now"),f.current=0};return(0,s.jsx)("div",{className:"pointer-events-none absolute right-5 bottom-5 z-10 flex w-[min(80vw,calc(100vw-2.5rem))] flex-col items-end gap-2",children:r?(0,s.jsx)("div",{"data-room":!0,className:"pointer-events-auto flex max-h-[calc(100dvh-5.5rem)] w-160 max-w-full animate-in flex-col overflow-hidden rounded-3xl bg-background/75 shadow-2xl shadow-black/6 ring-1 ring-border/50 backdrop-blur-xl fade-in slide-in-from-bottom-1 duration-200",children:!C&&a&&S?(0,s.jsx)(sq,{onBack:()=>o(null),onClose:B}):C?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sw.ThreadHeader,{thread:C,onBack:()=>o(null),onClose:B}),(0,s.jsx)(sw.Conversation,{thread:C,tab:u[C.id]??null,onTab:e=>c(t=>({...t,[C.id]:e})),className:"min-h-0 flex-1"}),(0,s.jsx)(sx.ThreadReply,{thread:{id:C.id,label:C.label,bot:C.bot.name,ask:C.ask,room:C.room},status:"working"===C.status?"running":C.status,faces:(0,s_.rosterOf)(C),to:u[C.id]??C.bot.name,className:"mx-3 mb-2 shrink-0"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(sz,{tab:d,current:g.length,onTab:h,onClose:B}),"history"===d?(0,s.jsx)(s$,{pages:y,threads:_,scroll:f,onPick:o}):g.length?(0,s.jsx)(sK,{threads:g,onPick:o}):p.length?(0,s.jsx)(sB,{}):(0,s.jsx)(sF,{bots:n}),(0,s.jsx)(s4,{crew:F,more:R,bubble:null,label:"Fold the room away",onClick:B,onWrite:s_.writeLine.open,side:O?(0,s.jsx)(at,{handoff:O}):(0,s.jsx)(s6,{busy:D,pending:z,grown:!0})})]})}):(0,s.jsx)(s3,{crew:A,more:R,bubble:O,rows:p.filter(e=>!t.includes(e.id)&&sP(e)),count:e.length,busy:D,pending:z,onPick:e=>{o(e),i(!0)},onOpen:()=>i(!0)})})});var aa=e.i(222055),ao=e.i(6799),al=e.i(393080),au=e.i(742978),ac=e.i(463625);function ad(e){let t=e??ac.BOT_SEEDS.map(e=>({name:e.name}));t.length&&(0,au.createSeedBotsAction)(t).then(al.unwrapResult).then(()=>(0,sb.revalidate)(k.queryKey.bot)).catch(e=>ao.toast.add({type:"warning",title:"Could not set up the bots",description:(0,S.errorToString)(e)}))}e.s(["installSeedBots",0,ad],747985);var ah=e.i(616816),af=e.i(992112);let ap={name:"app-window-mac",size:24,node:[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M14 8h.01",key:"1primd"}]]};ap.node;let am=(0,l.default)(ap);var ag=e.i(375775);let ax="thursday.install-asked",ay=null,av=new Set,ab=()=>{for(let e of av)e()};function a_(){return(0,w.useSyncExternalStore)(e=>(av.add(e),()=>av.delete(e)),()=>ay,()=>null)}async function aw(){let e=ay;e&&(ay=null,ab(),await e.prompt(),await e.userChoice.catch(()=>void 0))}function ak({hidden:e}){let t=null!==a_(),[n,r]=(0,w.useState)(!0);if((0,w.useEffect)(()=>{try{r(null!==window.localStorage.getItem(ax))}catch{}},[]),!t||n||e)return null;let i=()=>{r(!0);try{window.localStorage.setItem(ax,"1")}catch{}};return(0,s.jsxs)("div",{className:"flex w-76 animate-in items-start gap-3 rounded-2xl bg-background p-3.5 shadow-[0_22px_44px_-20px_rgb(0_0_0/0.22)] ring-1 ring-border duration-300 fade-in slide-in-from-top-1",children:[(0,s.jsx)("span",{className:"grid size-8 shrink-0 place-items-center rounded-lg bg-muted",children:(0,s.jsx)(am,{className:"size-4"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-2.5",children:[(0,s.jsxs)("p",{className:"text-[13px] leading-snug",children:[(0,s.jsx)("span",{className:"block font-medium",children:"Keep her in her own window"}),(0,s.jsx)("span",{className:"block text-muted-foreground",children:"Install Thursday as an app, with its own icon. A closed tab no longer takes her calls with it."})]}),(0,s.jsxs)("div",{className:"flex gap-1.5",children:[(0,s.jsx)(j.Button,{size:"sm",className:"rounded-full px-3.5",onClick:()=>{i(),aw()},children:"Install"}),(0,s.jsx)(j.Button,{size:"sm",variant:"ghost",className:"rounded-full px-3 text-muted-foreground",onClick:i,children:"Not now"})]})]})]})}function aj(){return null===a_()?null:(0,s.jsx)("button",{type:"button",onClick:()=>void aw(),className:"group/install flex w-full items-start gap-2.5 rounded-xl px-3 py-2.5 text-left outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1 text-sm font-medium",children:["Install app",(0,s.jsx)(ag.ArrowUpRight,{className:"ml-auto size-3.5 text-muted-foreground transition-transform group-hover/install:translate-x-px group-hover/install:-translate-y-px"})]}),(0,s.jsx)("span",{className:"block text-xs leading-snug text-muted-foreground",children:"Its own window, apart from your tabs"})]})})}window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),ay=e,ab()}),window.addEventListener("appinstalled",()=>{ay=null,ab()});let aT={name:"aperture",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]]};aT.node;let aS=(0,l.default)(aT);var aN=e.i(758925),aC=e.i(218964),aE=e.i(97923);let aM={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};aM.node;let aO=(0,l.default)(aM),aA={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};aA.node;let aR=(0,l.default)(aA);var aI=e.i(986206);let aL={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};aL.node;let aP=(0,l.default)(aL);var aD=e.i(770703),az=e.i(630374),aF=e.i(421429),aB=e.i(895836);function a$(){let{data:e}=(0,sb.useServerRoute)(k.queryKey.bot);return e&&0===e.length?"amber":null}function aq(){let{data:e}=(0,sb.useServerRoute)(k.queryKey.threads);return{owed:(e??[]).filter(e=>(0,sp.needsThreadReply)(e)||"done"===e.status&&!e.seen).length}}function aU(){let{data:e,isLoading:t}=(0,sb.useServerRoute)(k.queryKey.config);if(t)return null;let n=t=>(0,af.isConfigSet)(e,t);return af.CONFIG_GROUPS.some(e=>"keys"===e.section&&!(0,af.groupSatisfied)(e,n))?"amber":null}let aH=af.CONFIG_GROUPS.filter(e=>"models"===e.section).flatMap(e=>e.entries.filter(e=>e.kind).map(e=>e.key));function aK(){let{data:e,isLoading:t}=(0,sb.useServerRoute)(k.queryKey.config);return t||!e?null:aH.every(t=>!(0,af.isConfigSet)(e,t))?"brand":null}function aY(){let{data:e}=(0,sb.useServerRoute)(k.queryKey.mcp);return e?.some(e=>e.lastError)?"red":null}var aV=e.i(991322),aW=e.i(852116),aG=e.i(589128);let aX=e.i(569644).FolderOpen;var aJ=e.i(922521),aQ=e.i(734080),aZ=e.i(989409),a0=aB;let a1=(e,t=a0.SettingSkeleton)=>(0,aD.default)(e,{loading:()=>(0,s.jsx)(t,{})}),a2=a1(()=>e.A(48663).then(e=>({default:e.MemorySetting}))),a5=a1(()=>e.A(959484).then(e=>({default:e.BotSetting})),a0.SettingPanesSkeleton),a3=a1(()=>e.A(954404).then(e=>({default:e.ThreadSetting}))),a4=a1(()=>e.A(483782).then(e=>({default:e.RoutineSetting}))),a6=a1(()=>e.A(711454).then(e=>({default:e.ModelsSetting}))),a7=a1(()=>e.A(711454).then(e=>({default:e.KeysSetting}))),a8=a1(()=>e.A(711454).then(e=>({default:e.PhoneSetting}))),a9=a1(()=>e.A(17613).then(e=>({default:e.ThursdaySetting}))),oe=a1(()=>e.A(706108).then(e=>({default:e.ArtifactSetting})),a0.SettingPanesSkeleton),ot=a1(()=>e.A(194379).then(e=>({default:e.WorkspaceSetting})),a0.SettingPanesSkeleton),on=a1(()=>e.A(832663).then(e=>({default:e.SkillsSetting}))),or=a1(()=>e.A(959108).then(e=>({default:e.McpSetting}))),oi=a1(()=>e.A(663973).then(e=>({default:e.SignInsSetting})));function os({tabs:e}){let[t,n]=(0,w.useState)(0),r=e[t].Component;return(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,s.jsx)("div",{className:"shrink-0 px-8 pt-5",children:(0,s.jsx)(a0.SettingColumn,{children:(0,s.jsx)(aF.Segmented,{"aria-label":"Screens of this section",options:e.map((e,t)=>({value:String(t),label:e.label})),value:String(t),onChange:e=>n(Number(e))})})}),(0,s.jsx)("div",{className:"min-h-0 flex-1",children:(0,s.jsx)(r,{})})]})}let oa=[{label:"Finished",Component:oe},{label:"All files",Component:ot}],oo=["call","work","app"],ol=[{id:"thursday",label:"Thursday",group:"call",hint:"Her face, models, and how a call starts",icon:sZ.ThursdayMark,Component:a9},{id:"memory",label:"Memory",group:"call",hint:"What the agent knows",icon:aW.MemoryMark,Component:a2},{id:"bot",label:"Bots",group:"work",hint:"Workers the agent delegates to",icon:sm.BotsMark,Component:a5,Badge:function(){return a$()?(0,s.jsx)(aB.NavBadge,{tone:"amber"}):null}},{id:"threads",label:"Threads",group:"work",hint:"Work the bots were handed",icon:aC.ListChecks,Component:a3,Badge:function(){return(0,s.jsx)(aB.NavBadge,{tone:"amber",count:aq().owed})}},{id:"routines",label:"Routines",group:"work",hint:"Work that starts by itself, on a schedule",icon:sL.RoutineMark,Component:a4},{id:"files",label:"Files",group:"work",hint:"What the bots finished, and everything else they wrote",icon:aX,Component:()=>(0,s.jsx)(os,{tabs:oa})},{id:"skills",label:"Skills",group:"work",hint:"Instructions the bots load on demand",icon:aG.SkillsMark,Component:on},{id:"mcp",label:"Connectors",group:"work",hint:"Tools from MCP servers",icon:aV.McpMark,Component:or,Badge:function(){return aY()?(0,s.jsx)(aB.NavBadge,{tone:"red"}):null}},{id:"signins",label:"Sign-ins",group:"work",hint:"The sites you signed in to, and the bots that may use each",icon:aE.LogIn,Component:oi},{id:"models",label:"Models",group:"app",hint:"What bots think with, and what they draw, film and speak with",icon:aS,Component:a6,Badge:function(){return aK()?(0,s.jsx)(aB.NavBadge,{tone:"brand"}):null}},{id:"keys",label:"API keys",group:"app",hint:"The accounts the app runs on",icon:aN.KeyRound,Component:a7,Badge:function(){return aU()?(0,s.jsx)(aB.NavBadge,{tone:"amber"}):null}},{id:"phone",label:"Phone",group:"app",hint:"Write to Thursday from a chat app",icon:aI.Smartphone,Component:a8}],ou={system:{label:"System",icon:aO},light:{label:"Light",icon:aP},dark:{label:"Dark",icon:aR}};function oc(){let e=(0,aJ.useTheme)();return(0,s.jsx)(aF.Segmented,{"aria-label":"Theme",className:"w-full gap-0.5 *:flex-1 *:py-1.5",options:aQ.THEMES.map(e=>{let{label:t,icon:n}=ou[e];return{value:e,title:t,label:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n,{className:"size-3.5"}),(0,s.jsx)("span",{className:"sr-only",children:t})]})}}),value:e,onChange:aJ.setTheme})}function od({children:e}){let t=(0,aZ.useSettingsStore)(e=>e.open),n=(0,aZ.useSettingsStore)(e=>e.section),r=(0,aZ.useSettingsStore)(e=>e.show),i=(0,aZ.useSettingsStore)(e=>e.hide),a=(0,aZ.useSettingsStore)(e=>e.pick),o=(0,w.useRef)(null),l=ol.find(e=>e.id===n)??ol[0];return(0,w.useEffect)(()=>{if(!t)return;let e=e=>{if(!e.metaKey&&!e.ctrlKey)return;if("k"===e.key){let t=o.current?.querySelector("[data-setting-filter]");if(!t)return;e.preventDefault(),t.focus(),t.select();return}let t=Number(e.key);Number.isInteger(t)&&t>=1&&t<=ol.length&&(e.preventDefault(),a(ol[t-1].id))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,a]),(0,s.jsxs)(az.Dialog,{open:t,onOpenChange:e=>e?r():i(),children:[e&&(0,s.jsx)(az.DialogTrigger,{render:e}),(0,s.jsxs)(az.DialogContent,{className:"block h-[min(52rem,calc(100vh-3rem))] overflow-hidden p-0 sm:max-w-[min(80rem,calc(100vw-3rem))]",children:[(0,s.jsx)(az.DialogTitle,{className:"sr-only",children:"Settings"}),(0,s.jsxs)("div",{className:"flex h-full min-h-0",children:[(0,s.jsxs)("nav",{"aria-label":"Settings sections",onKeyDown:e=>{let t,r="ArrowDown"===e.key?1:"ArrowUp"===e.key?-1:0;if(!r)return;e.preventDefault();let i=(t=(ol.findIndex(e=>e.id===n)+r+ol.length)%ol.length,ol[t].id);a(i),e.currentTarget.querySelector(`[data-section="${i}"]`)?.focus()},className:"flex w-52 shrink-0 flex-col gap-0.5 border-r border-border/60 bg-muted/30 p-3",children:[oo.map(e=>(0,s.jsxs)(w.Fragment,{children:[(0,s.jsx)("span",{className:"px-3 pt-3 pb-1 font-mono text-[10px] text-muted-foreground/60",children:e}),ol.filter(t=>t.group===e).map(e=>(0,s.jsxs)(j.Button,{"data-section":e.id,onClick:()=>a(e.id),variant:e.id===n?"secondary":"ghost",className:(0,S.cn)("justify-start",e.id===n?"text-foreground bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]":"text-muted-foreground"),children:[(0,s.jsx)(e.icon,{className:(0,S.cn)("mr-1")}),(0,s.jsx)("span",{className:"truncate text-sm",children:e.label}),e.Badge&&(0,s.jsx)("span",{className:"ml-auto flex items-center",children:(0,s.jsx)(e.Badge,{})})]},e.id))]},e)),(0,s.jsxs)("div",{className:"mt-auto flex flex-col gap-2 pt-3",children:[(0,s.jsx)(aj,{}),(0,s.jsx)("div",{className:"px-1",children:(0,s.jsx)(oc,{})})]})]}),(0,s.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,s.jsx)("div",{className:"shrink-0 px-8 pt-10",children:(0,s.jsxs)(a0.SettingColumn,{className:"animate-in space-y-0.5 fade-in slide-in-from-bottom-1 duration-300",children:[(0,s.jsx)("p",{className:"truncate text-2xl font-semibold",children:l.label}),(0,s.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:l.hint})]},l.id)}),(0,s.jsx)("div",{ref:o,className:"min-h-0 min-w-0 flex-1",children:(0,s.jsx)(l.Component,{})})]})]})]})]})}function oh(e){return e.includes("red")?"red":e.includes("amber")?"amber":e.includes("brand")?"brand":null}function of(){let e=a$(),t=aq().owed>0?"amber":null,n=aY();return{bot:e,threads:t,mcp:n,keys:aU(),models:aK()}}var op=e.i(762074);function om(){let e=performance.now()/1e3;return Array.from({length:8},(t,n)=>.18+.16*Math.sin(e*(5+.9*n)+1.7*n)**2)}e.s(["silentVoice",0,om],234916);var og=e.i(671228),ox=e.i(67045),oy=e.i(670097),ov=e.i(640262),ob=e.i(213377),o_=e.i(95187);let ow=(0,o_.createServerReference)("7f4757231c23f4688dd89431d98f3f99a31578d580",o_.callServer,void 0,o_.findSourceMapURL,"acceptThreadRelaysAction");var ok=e.i(609856);let oj=new Set,oT={message:"says",question:"asks",report:"reports",interrupted:"was cut off"},oS={question:0,stopped:1,done:2,progress:3};function oN(e){let t=e.trim();if(t.length<=sd.CALL_RELAY.chars)return t;let n=t.slice(0,sd.CALL_RELAY.chars),r=Math.max(n.lastIndexOf("\n\n"),n.lastIndexOf(". "),n.lastIndexOf(".\n"),n.lastIndexOf("。")),i=(r>sd.CALL_RELAY.chars/3?n.slice(0,r+1):n).trim();return`${i}
4
- [The message goes on; the rest is in its thread on screen.]`}function oC(e){let t=[];for(let n of e){let{relays:e,questions:r}=n.room,i=(0,sy.toDate)(n.updatedAt).getTime(),s=(e,t)=>`[${e} → Thursday, thread "${n.label}" (${n.id}), ${t}.]`,a=(e,t)=>({kind:"relay",name:n.label,line:t,done:!0,bot:e});for(let n of r){let r=n.options?.length?` Options: ${n.options.join(" / ")}.`:"";t.push({rank:oS.question,key:`question:${n.id}`,kind:"question",line:`${s(n.bot,"question")}
5
- ${oN(n.text)}${r}`,relayIds:e.filter(e=>e.messageId===n.id).map(e=>e.id),show:a(n.bot,`${n.bot} asks`)})}let o=e.filter(e=>!r.some(t=>t.id===e.messageId)),l="done"===n.status,u="waiting"===n.status&&(0,sp.isAppStop)(n.ask)&&!n.ask?.auto;if(l||u){if(n.seen)continue;let e=u?"stopped":"done",r="stopped"===e?`It stopped before finishing. Where it got to: ${oN(n.ask?.question??n.outcome??"")}`:`Done. Its answer: ${oN(n.outcome??"")}`;t.push({rank:oS[e],key:`${e}:${n.id}@${i}`,kind:"ending",line:`${s(n.bot,e)}
6
- ${r}`,relayIds:o.map(e=>e.id),show:a(n.bot,"stopped"===e?`${n.bot} stopped`:`${n.bot} finished`)});continue}for(let e of o)t.push({rank:oS.progress,key:`progress:${e.id}`,kind:"progress",line:`${s(e.bot,e.kind)}
7
- ${oN(e.text)}`,relayIds:[e.id],show:a(e.bot,`${e.bot} ${oT[e.kind]}`)})}return t.sort((e,t)=>e.rank-t.rank)}let oE=(0,o_.createServerReference)("7fa34e106a7dd94c3d0094dd4fd6d81455adf72402",o_.callServer,void 0,o_.findSourceMapURL,"endCallAction"),oM=(0,o_.createServerReference)("7f2d4f6df5d034760fe258a98bb27aebaba2c53c18",o_.callServer,void 0,o_.findSourceMapURL,"openTextCallAction");var oO=e.i(561540);let oA={relay:!0},oR=new ov.DefaultChatTransport({api:k.queryKey.textCall}),oI=()=>ox.useThursdayStore.getState().textModel;async function oL(e,t,n,r){try{let i=await fetch(k.queryKey.toolCall,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({toolCallId:t.id,callId:e,webSearch:n,name:t.name,input:t.arguments?JSON.parse(t.arguments):{}}),signal:r}),{output:s}=(0,al.unwrapResult)(await i.json());return"string"==typeof s?s:JSON.stringify(s??null)}catch(e){return`Error: ${(0,S.errorToString)(e)}`}}var oP=e.i(124412),oD=e.i(807038),oz=e.i(83928),oF=e.i(616172),oB=e.i(621285);function o$(){return(0,s.jsx)(oB.FileViewer,{children:(0,s.jsx)(oV,{})})}let oq="thursday.corner-dismissed";function oU(){try{let e=JSON.parse(window.localStorage.getItem(oq)??"[]");return Array.isArray(e)?e:[]}catch{return[]}}function oH(e){try{let t=[...e,...oU().filter(t=>!e.includes(t))].slice(0,50);window.localStorage.setItem(oq,JSON.stringify(t))}catch{}}function oK(){"u"<typeof Notification||"default"===Notification.permission&&Notification.requestPermission().catch(()=>void 0)}function oY(e){let t=(0,oF.pathsIn)(e.outcome??""),n=t.findIndex(oF.opensOnFinish);return{threadId:e.id,label:e.label,bot:e.bot.name,words:(0,S.plainText)(e.outcome??"").slice(0,sd.FINISHED_NOTICE.words),paths:n>0?[t[n],...t.filter((e,t)=>t!==n)]:t}}function oV(){let[e,t]=(0,w.useState)([]),{data:n}=(0,sb.useServerRoute)(k.queryKey.bot),r=(0,s_.useBotThreads)(),i=(0,oB.useOpenFile)();(0,sg.useAppEvent)({showFile:e=>i(e.paths[0],e.paths.filter(e=>"image"===(0,oF.viewKindOf)(e))),finished:e=>{!function(e,t,n){if(!("u"<typeof Notification)&&"granted"===Notification.permission&&!("visible"===document.visibilityState&&document.hasFocus()))try{let r=new Notification(t,{body:n,tag:e,icon:"/icon.svg"});r.onclick=()=>{window.focus(),r.close()}}catch{}}(e.threadId,e.label,e.words),t(t=>[{threadId:e.threadId,label:e.label,bot:e.bot,words:e.words,paths:e.paths},...t.filter(t=>t.threadId!==e.threadId)].slice(0,sd.FINISHED_NOTICE.rows))}});let a=(0,w.useRef)(!1);(0,w.useEffect)(()=>{if(a.current||!r.length)return;a.current=!0;let e=new Set(oU()),n=r.filter(t=>"done"===t.status&&!t.seen&&!e.has(t.id)).sort((e,t)=>(0,sy.toDate)(t.updatedAt).getTime()-(0,sy.toDate)(e.updatedAt).getTime());n.length&&t(e=>[...e,...n.filter(t=>!e.some(e=>e.threadId===t.id)).map(oY)].slice(0,sd.FINISHED_NOTICE.rows))},[r]);let o=e=>{oH([e]),t(t=>t.filter(t=>t.threadId!==e))},l=(0,w.useRef)(new Set);return((0,w.useEffect)(()=>{let n=[];for(let t of e){let e=r.find(e=>e.id===t.threadId);e&&(e.seen?l.current.delete(t.threadId)&&n.push(t.threadId):l.current.add(t.threadId))}n.length&&t(e=>e.filter(e=>!n.includes(e.threadId)))},[e,r]),e.length)?(0,s.jsxs)("div",{className:"absolute bottom-3 left-3 z-10 flex max-h-[calc(100%-1.5rem)] w-82 max-w-[calc(100vw-1.5rem)] flex-col-reverse gap-2 overflow-y-auto p-2 scrollbar-none",children:[e.map(e=>(0,s.jsx)(oW,{row:e,bot:n?.find(t=>t.name===e.bot),onOpen:t=>{if(t){var n;i(t,e.paths.filter(e=>"image"===(0,oF.viewKindOf)(e))),o(n=e.threadId),(0,oP.markSeenAction)([n]).then(al.unwrapResult).then(()=>(0,sb.revalidate)(k.queryKey.threads)).catch(e=>ao.toast.add({type:"error",title:"Could not mark the thread as read",description:(0,S.errorToString)(e)}))}else s_.roomOpens.open(e.threadId),o(e.threadId)},onClose:()=>o(e.threadId)},e.threadId)),e.length>1&&(0,s.jsxs)("p",{className:"flex shrink-0 items-center px-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex-1",children:[e.length," new"]}),(0,s.jsx)("button",{type:"button",onClick:()=>{oH(e.map(e=>e.threadId)),t([])},className:"rounded-md px-1 font-sans text-[11px] outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:"Clear all"})]})]}):null}function oW({row:e,bot:t,onOpen:n,onClose:r}){let i=e.paths.length-4;return(0,s.jsxs)("div",{className:"flex shrink-0 animate-in gap-2.5 rounded-[20px] bg-background py-2.5 pr-2 pl-2.5 shadow-black/10 shadow-lg ring-1 ring-border fade-in slide-in-from-bottom-2 duration-300",children:[(0,s.jsx)(sm.BotMark,{size:32,seed:e.bot,color:t?.icon?.color,shape:t?.icon?.shape,outline:t?.icon?.outline,paint:t?.icon?.paint,notify:!1,className:"shrink-0"}),(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[(0,s.jsxs)("div",{className:"flex items-start gap-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>n(e.paths[0]??null),className:"flex min-w-0 flex-1 flex-col gap-1.5 rounded-lg text-left outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsxs)("span",{className:"flex min-h-8 flex-col justify-center",children:[(0,s.jsx)("span",{className:"truncate font-medium text-[14px] leading-5 tracking-[-0.15px]",children:e.label}),(0,s.jsx)("span",{className:"truncate font-mono text-[10px] leading-[13px] text-muted-foreground",children:e.bot})]}),e.words&&(0,s.jsx)("span",{className:"line-clamp-2 break-keep text-[12.5px] leading-normal text-muted-foreground",children:(0,oD.shortenPaths)(e.words)})]}),(0,s.jsx)(j.Button,{variant:"ghost",size:"icon-sm","aria-label":"Dismiss",onClick:r,className:"shrink-0 text-muted-foreground",children:(0,s.jsx)(_.X,{})})]}),e.paths.length>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[e.paths.slice(0,4).map(e=>(0,s.jsx)("button",{type:"button",title:e.split("/").pop(),onClick:()=>n(e),className:"rounded-[10px] outline-none focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(oz.FileThumb,{path:e,glyph:"size-4",className:"h-15 w-12 rounded-[10px] ring-1 ring-border"})},e)),i>0&&(0,s.jsxs)("span",{className:"px-1 font-mono text-[11px] text-muted-foreground",children:["+",i]})]})]})]})}e.s(["ArtifactView",0,o$,"FinishedCard",0,oW,"askToNotify",0,oK],895499);var oG=e.i(319841);let oX={"not-allowed":"The microphone is not allowed","service-not-allowed":"The microphone is not allowed","audio-capture":"There is no microphone","language-not-supported":"This browser cannot listen in that language"},oJ=e=>e.toLowerCase().replace(/[^a-z0-9 ]/g,"").split(/\s+/).filter(Boolean),oQ=(e,t,n)=>Math.abs(e.length-t.length)<=n&&function(e,t){let n=Array.from({length:e.length+1},(e,t)=>t),r=Array(e.length+1).fill(0);for(let i=1;i<=t.length;i++){r[0]=i;for(let s=1;s<=e.length;s++){let a=n[s-1]+ +(t[i-1]!==e[s-1]);r[s]=Math.min(a,n[s]+1,r[s-1]+1)}[n,r]=[r,n]}return n[e.length]}(e,t)<=n;function oZ({enabled:e,onWake:t,phrases:n,lang:r="en-US",tolerance:i=.34,onError:s}){let a=(0,w.useRef)({onWake:t,onError:s,phrases:n,tolerance:i});a.current={onWake:t,onError:s,phrases:n,tolerance:i},(0,w.useEffect)(()=>{if(!e)return;let t=window,n=t.SpeechRecognition??t.webkitSpeechRecognition;if(!n)return void a.current.onError?.("This browser cannot listen for a wake word");let i=new n,s=!0,o=!0,l=null,u=300;i.lang=r,i.continuous=!0,i.interimResults=!0,i.maxAlternatives=3;let c=()=>{if(s){o=!0;try{i.start()}catch{}}};return i.onresult=({resultIndex:e,results:t})=>{if(!s||!o)return;u=300;let{phrases:n,tolerance:r,onWake:l}=a.current,c=n.map(oJ).filter(e=>e.length);for(let n=e;n<t.length;n++){let e=t[n];for(let t=0;t<e.length;t++){let n=e[t].transcript,s=oJ(n);if(c.some(e=>(function(e,t,n){for(let r=0;r<e.length;r++)if(function e(t,n,r,i,s){if(i===r.length)return!0;if(n>=t.length)return!1;let a=r[i],o=Math.max(1,Math.round(a.length*s));return!!(oQ(t[n],a,o)&&e(t,n+1,r,i+1,s))||n+1<t.length&&oQ(t[n]+t[n+1],a,o)&&e(t,n+2,r,i+1,s)}(e,r,t,0,n))return!0;return!1})(s,e,r))){o=!1,i.abort(),l(n.trim());return}}}},i.onerror=({error:e})=>{let t=oX[e];t?(s=!1,a.current.onError?.(t)):"network"===e&&(u=Math.min(2*u,1e4))},i.onend=()=>{s&&(l=setTimeout(c,u))},c(),()=>{s=!1,l&&clearTimeout(l),i.onresult=null,i.onerror=null,i.onend=null,i.abort()}},[e,r])}e.s(["useWakeWord",0,oZ],656572);let o0={silent:{level:-1},fatal:{level:0},error:{level:0},warn:{level:1},log:{level:2},info:{level:3},success:{level:3},fail:{level:3},ready:{level:3},start:{level:3},box:{level:3},debug:{level:4},trace:{level:5},verbose:{level:1/0}};function o1(e){if(null===e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.iterator in e)&&(!(Symbol.toStringTag in e)||"[object Module]"===Object.prototype.toString.call(e))}let o2=!1,o5=[];class o3{options;_lastLog;_mockFn;constructor(e={}){const t=e.types||o0;for(const n in this.options=((...e)=>e.reduce((e,t)=>(function e(t,n,r=".",i){if(!o1(n))return e(t,{},r,i);let s=Object.assign({},n);for(let n in t){if("__proto__"===n||"constructor"===n)continue;let a=t[n];null!=a&&(i&&i(s,n,a,r)||(Array.isArray(a)&&Array.isArray(s[n])?s[n]=[...a,...s[n]]:o1(a)&&o1(s[n])?s[n]=e(a,s[n],(r?`${r}.`:"")+n.toString(),i):s[n]=a))}return s})(e,t,"",void 0),{}))({...e,defaults:{...e.defaults},level:o4(e.level,t),reporters:[...e.reporters||[]]},{types:o0,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}}),t){const e={type:n,...this.options.defaults,...t[n]};this[n]=this._wrapLogFn(e),this[n].raw=this._wrapLogFn(e,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=o4(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){let t=new o3({...this.options,...e});return this._mockFn&&t.mockTypes(this._mockFn),t}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){let t=this.options.reporters.indexOf(e);if(-1!==t)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(let e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=e=>{this[t].raw(String(e).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){o2=!0}resumeLogs(){for(let e of(o2=!1,o5.splice(0)))e[0]._logFn(e[1],e[2])}mockTypes(e){let t=e||this.options.mockFn;if(this._mockFn=t,"function"==typeof t)for(let e in this.options.types)this[e]=t(e,this.options.types[e])||this[e],this[e].raw=this[e]}_wrapLogFn(e,t){return(...n)=>o2?void o5.push([this,e,n,t]):this._logFn(e,n,t)}_logFn(e,t,n){var r,i;if((e.level||0)>this.level)return!1;let s={date:new Date,args:[],...e,level:o4(e.level,this.options.types)};n||1!==t.length||+(i=r=t[0],"[object Object]"!==Object.prototype.toString.call(i)||!r.message&&!r.args||!!r.stack)?s.args=[...t]:Object.assign(s,t[0]),s.message&&(s.args.unshift(s.message),delete s.message),s.additional&&(Array.isArray(s.additional)||(s.additional=s.additional.split("\n")),s.args.push("\n"+s.additional.join("\n")),delete s.additional),s.type="string"==typeof s.type?s.type.toLowerCase():"log",s.tag="string"==typeof s.tag?s.tag:"";let a=(e=!1)=>{let t=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&t>0){let e=[...this._lastLog.object.args];t>1&&e.push(`(repeated ${t} times)`),this._log({...this._lastLog.object,args:e}),this._lastLog.count=1}e&&(this._lastLog.object=s,this._log(s))};clearTimeout(this._lastLog.timeout);let o=this._lastLog.time&&s.date?s.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=s.date,o<this.options.throttle)try{let e=JSON.stringify([s.type,s.tag,s.args]),t=this._lastLog.serialized===e;if(this._lastLog.serialized=e,t&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(a,this.options.throttle);return}}catch{}a(!0)}_log(e){for(let t of this.options.reporters)t.log(e,{options:this.options})}}function o4(e,t={},n=3){return void 0===e?n:"number"==typeof e?e:t[e]&&void 0!==t[e].level?t[e].level:n}o3.prototype.add=o3.prototype.addReporter,o3.prototype.remove=o3.prototype.removeReporter,o3.prototype.clear=o3.prototype.removeReporter,o3.prototype.withScope=o3.prototype.withTag,o3.prototype.mock=o3.prototype.mockTypes,o3.prototype.pause=o3.prototype.pauseLogs,o3.prototype.resume=o3.prototype.resumeLogs;class o6{options;defaultColor;levelColorMap;typeColorMap;constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:1===e?console.__warn||console.warn:console.__log||console.log}log(e){let t=this._getLogFn(e.level),n="log"===e.type?"":e.type,r=e.tag||"",i=this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor,s=`
8
- background: ${i};
9
- border-radius: 0.5em;
10
- color: white;
11
- font-weight: bold;
12
- padding: 2px 0.5em;
13
- `,a=`%c${[r,n].filter(Boolean).join(":")}`;"string"==typeof e.args[0]?t(`${a}%c ${e.args[0]}`,s,"",...e.args.slice(1)):t(a,s,...e.args)}}function o7(e={}){return function(e={}){return new o3(e)}({reporters:e.reporters||[new o6({})],prompt:(e,t={})=>"confirm"===t.type?Promise.resolve(confirm(e)):Promise.resolve(prompt(e)),...e})}o7();var o8=e.i(379227);let{env:o9={},argv:le=[],platform:lt=""}=void 0===is.default?{}:is.default,ln="NO_COLOR"in o9||le.includes("--no-color"),lr="FORCE_COLOR"in o9||le.includes("--color"),li="dumb"===o9.TERM,ls=o8&&o8.isatty&&o8.isatty(1)&&o9.TERM&&!li,la="CI"in o9&&("GITHUB_ACTIONS"in o9||"GITLAB_CI"in o9||"CIRCLECI"in o9),lo=!ln&&(lr||"win32"===lt&&!li||ls||la);function ll(e,t,n){return function(e,t,n=e,r=e.length+1){return i=>{var s;return i||""!==i&&void 0!==i?(s=(""+i).indexOf(t,r),s<0?e+i+t:e+function e(t,n,r,i,s=n.slice(0,Math.max(0,t))+i,a=n.slice(Math.max(0,t+r.length)),o=a.indexOf(r)){return s+(o<0?a:e(o,a,r,i))}(s,i,t,n)+t):""}}(`\x1b[${e}m`,`\x1b[${t}m`,n)}let lu={reset:ll(0,0),bold:ll(1,22,"\x1b[22m\x1b[1m"),dim:ll(2,22,"\x1b[22m\x1b[2m"),italic:ll(3,23),underline:ll(4,24),inverse:ll(7,27),hidden:ll(8,28),strikethrough:ll(9,29),black:ll(30,39),red:ll(31,39),green:ll(32,39),yellow:ll(33,39),blue:ll(34,39),magenta:ll(35,39),cyan:ll(36,39),white:ll(37,39),gray:ll(90,39),bgBlack:ll(40,49),bgRed:ll(41,49),bgGreen:ll(42,49),bgYellow:ll(43,49),bgBlue:ll(44,49),bgMagenta:ll(45,49),bgCyan:ll(46,49),bgWhite:ll(47,49),blackBright:ll(90,39),redBright:ll(91,39),greenBright:ll(92,39),yellowBright:ll(93,39),blueBright:ll(94,39),magentaBright:ll(95,39),cyanBright:ll(96,39),whiteBright:ll(97,39),bgBlackBright:ll(100,49),bgRedBright:ll(101,49),bgGreenBright:ll(102,49),bgYellowBright:ll(103,49),bgBlueBright:ll(104,49),bgMagentaBright:ll(105,49),bgCyanBright:ll(106,49),bgWhiteBright:ll(107,49)},lc=function(e=lo){return e?lu:Object.fromEntries(Object.keys(lu).map(e=>[e,String]))}();[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");let ld=o7({level:sd.IS_DEV?4:3}),lh=(r=sd.APP_NAME,ld.withDefaults({message:(i=`${r}: `,(function(e,t="reset"){return lc[e]||lc[t]})("blackBright")(i))}));var lf=e.i(413168);let lp={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},lm=new TextEncoder;async function lg(e){let t=lx(e);try{return await t.connect(),t}catch(e){throw await t.close(),e}}let lx=({initialize:e,audio:t,on:n})=>{let r,i,s,a,o,l,u,c,d=!1,h=!1,f=!1,p=0,m=0,g="",x=[],y=new Set,v=new Set,b=new Set,_=new Map,w=!1,k=new Map,j=new Map,T=[],N=null,C=-1/0,E=()=>{for(let e of(clearTimeout(u),u=void 0,y))n.turn({...e.turn,fragments:[...e.fragments],done:!0});y.clear()},M=()=>{if(!f){for(let e of(f=!0,clearTimeout(o),clearTimeout(c),clearInterval(l),E(),N=null,T.splice(0)))e.settle(!1);z.close(),s?.()}},O=e=>{i?.(Error(e)),M(),d&&!h?n.failed(e):h&&n.warn(e)},A=-1/0,R=()=>{if(f||h)return;let e=performance.now(),r=t.levels?.();r&&r.output>.01&&(C=e);let i={speaking:e-C<300,working:[..._.values()].some(e=>!e.terminal)||j.size>0||e-A<5e3,tools:[...j.values()]},s=JSON.stringify(i);(s!==g||i.speaking||i.working)&&(g=s,n.activity(i))},I=()=>{if(!d||f||h||N||!T.length)return;let[e]=T;N=crypto.randomUUID(),z.send({type:`session.${e.kind}.append`,event_id:N,delegation_id:null,content:e.chunks[0]}),c=setTimeout(()=>{n.warn("Live did not acknowledge the conversation update; delivery is unknown."),L(!1)},sd.LIVE_CALL.appendMs)},L=e=>{clearTimeout(c),N=null;let[t]=T;t&&(e&&t.chunks.shift(),e&&t.chunks.length||(T.shift(),t.settle(e)),I())},P=(e,t)=>{if(!e.delta||void 0===e.start_ms||void 0===e.end_ms)return;let r=e.start_ms,i=e.end_ms,s=x.findLast(e=>e.turn.role===t&&r>=e.turn.seq-sd.LIVE_CALL.transcriptGapMs&&r<=e.end+sd.LIVE_CALL.transcriptGapMs&&("user"===t||!x.some(t=>"user"===t.turn.role&&t.turn.seq>e.turn.seq&&t.turn.seq<r)));s||(s={turn:{id:`live-${m++}`,role:t,text:"",seq:r,done:!1},end:i,fragments:[]},x.push(s)),s.fragments.push({start:r,end:i,text:e.delta}),s.fragments.sort((e,t)=>e.start-t.start),s.end=Math.max(s.end,i),s.turn.text=s.fragments.map(e=>e.text).join(""),n.turn({...s.turn,done:!1}),y.add(s),u??=setTimeout(E,sd.LIVE_CALL.transcriptSaveMs)},D=async e=>{e.terminal&&!e.continued&&e.calls.size&&(e.continued=!0,await Promise.all(e.calls.values()),h||f||(A=performance.now(),z.send({type:"response.create",event_id:crypto.randomUUID()})),R())},z=function({negotiate:e,audio:t,on:n}){let r,i,s=null,a=null,o=null,l=!1,u=!1,c=!1,d=e=>{for(let t of e?.getTracks()??[])t.stop()};return{async connect(){let h=new RTCPeerConnection;s=h;let f=h.createDataChannel("oai-events");a=f;let p=new Promise((e,t)=>{r=t;let i=e=>{l||c||(c=!0,u?n.dropped(e):t(Error(e)))};f.onopen=()=>{u=!0,e()},f.onclose=()=>i("The connection to OpenAI Live closed."),f.onerror=()=>i("The connection to OpenAI Live dropped."),h.onconnectionstatechange=()=>{["failed","closed"].includes(h.connectionState)&&i("Could not reach OpenAI Live.")}});p.catch(()=>{}),f.onmessage=({data:e})=>{let t;if(!l&&"string"==typeof e){try{t=JSON.parse(e)}catch{n.dropped("OpenAI Live sent an unreadable event.");return}n.event(t)}},h.ontrack=e=>{if(l)return;let n=e.streams[0]??new MediaStream([e.track]);t.element.srcObject=n,t.listen(n)};let m=await navigator.mediaDevices.getUserMedia({audio:lp});if(l)throw d(m),Error("The call closed before connecting.");for(let e of(o=m,t.hear?.(m),m.getAudioTracks()))h.addTrack(e,m);await h.setLocalDescription(await h.createOffer()),"complete"!==h.iceGatheringState&&await new Promise((e,t)=>{let n=n=>{clearTimeout(s),h.removeEventListener("icegatheringstatechange",r),i=void 0,n?t(n):e()},r=()=>{"complete"===h.iceGatheringState&&n()},s=setTimeout(()=>n(Error("ICE gathering timed out.")),1e4);i=()=>n(Error("The call closed before connecting.")),h.addEventListener("icegatheringstatechange",r),r()});let g=h.localDescription?.sdp;if(!g||l)throw Error("No live SDP offer is available.");let x=await e(g);if(l)throw Error("The call closed before connecting.");await h.setRemoteDescription({type:"answer",sdp:x}),await p},send(e){l||a?.readyState!=="open"||a.send(JSON.stringify(e))},close:()=>{l||(l=!0,r?.(Error("The call closed before connecting.")),i?.(),d(o),o=null,a?.close(),s?.close(),t.element.srcObject=null)}}}({audio:t,negotiate:async t=>{let n=await e(t);if(!n)throw Error("OpenAI Live returned no SDP answer.");return n},on:{event:e=>{if(!f){if(e.event_id){if(v.has(e.event_id))return;v.add(e.event_id)}switch(p=Math.max(p,e.offset_ms??0,e.end_ms??0),e.type){case"session.started":d=!0,r?.(),I();break;case"session.closed":n.finalized?.({reason:e.reason??"closed",seconds:e.usage?.seconds??null}),lh.info("Live session closed",{reason:e.reason,seconds:e.usage?.seconds}),i?.(Error("OpenAI Live closed before startup completed.")),M(),h||n.failed(`The Live call ended (${e.reason??"closed"}).`);break;case"session.input_transcript.delta":P(e,"user");break;case"session.output_transcript.delta":P(e,"assistant");break;case"session.instructions.appended":case"session.commentary.appended":case"session.thinking.appended":N&&e.client_event_id===N&&L(!0);break;case"error":{let t=e.error?.message??"OpenAI Live reported an error.";if(!d){O(t);break}n.warn(t),N&&e.error?.client_event_id===N&&L(!1);break}case"response.event":{let t=e.event;if(!t||h)break;"response.created"===t.type&&(A=-1/0),"response.created"===t.type&&t.response&&e.delegation_id&&k.set(e.delegation_id,t.response.id);let r=t.response?.id??t.response_id??(e.delegation_id?k.get(e.delegation_id):void 0);if(!r)break;let i=_.get(r);if(i||(i={calls:new Map,terminal:!1,continued:!1},_.set(r,i)),"response.reasoning_summary_text.done"===t.type&&n.reasoning?.({id:`${t.item_id}:${t.summary_index??0}`,text:t.text??"",seq:p}),("response.output_item.added"===t.type||"response.output_item.done"===t.type)&&t.item?.type===lf.LIVE_HOSTED_TOOLS.webSearch.item){let e=t.item,i="response.output_item.done"===t.type;i&&lh.debug("Live web search",e),n.search?.({id:e.id,responseId:r,query:(e.action?.query??e.action?.queries?.join(" · "))?.trim()||null,sources:[...new Set((e.action?.sources??[]).flatMap(e=>e.url?[e.url]:[]))].map(e=>({url:e})),done:i,seq:p})}if("response.output_item.done"===t.type&&t.item?.type==="message"){let e=function(e){let t=new Map;for(let n of e??[])for(let e of n.annotations??[])"url_citation"===e.type&&e.url&&!t.has(e.url)&&t.set(e.url,{url:e.url,...e.title?{title:e.title}:{}});return[...t.values()]}(t.item.content);e.length&&n.cited?.(r,e)}if("response.output_item.done"===t.type&&t.item?.type==="function_call"){let e=t.item;if(b.has(e.call_id))break;if(b.add(e.call_id),"incomplete"===e.status){i.terminal=!0,lh.warn("Live backend call cut off; not run",{responseId:r,name:e.name,arguments:e.arguments.slice(0,200)}),i.calls.size&&!w?(w=!0,D(i)):i.continued=!0;break}n.turn({id:e.id,role:"tool",tool:e.name,text:e.arguments,seq:p,done:!0}),E(),j.set(e.call_id,e.name);let s=Promise.resolve().then(()=>n.runTool({id:e.call_id,name:e.name,arguments:e.arguments,item:e.id})).catch(e=>`Error: ${(0,S.errorToString)(e)}`).then(t=>{j.delete(e.call_id),f||h||z.send({type:"response.item.create",event_id:crypto.randomUUID(),item:{type:"function_call_output",call_id:e.call_id,output:t}}),R()});i.calls.set(e.call_id,s),D(i)}["response.completed","response.failed","response.incomplete","response.cancelled"].includes(t.type)&&(i.terminal=!0,"response.completed"===t.type?(w=!1,lh.debug("Live backend usage",{responseId:r,usage:t.response?.usage}),D(i)):"response.incomplete"===t.type&&i.calls.size&&!w?(w=!0,lh.warn("Live backend response incomplete; continuing once",{responseId:r}),D(i)):(w=!1,i.continued=!0,n.warn(t.response?.error?.message??`The Live backend ${t.type.slice(9)}.`)))}}R()}},dropped:O}});return{async connect(){t.element.muted=!1;let e=new Promise((e,t)=>{r=e,i=t});e.catch(()=>{});let n=setTimeout(()=>O("OpenAI Live did not start in time."),sd.LIVE_CALL.startupMs);try{if(await Promise.all([z.connect(),e]),f)throw Error("The Live call closed during startup.");l=setInterval(R,100)}catch(e){throw M(),e}finally{clearTimeout(n),i=void 0}},close:()=>a||(f?Promise.resolve():(h=!0,E(),d)?(a=new Promise(e=>{s=e}),o=setTimeout(()=>{n.warn("Live disconnected without confirming final session usage."),M()},sd.LIVE_CALL.closeMs),t.element.muted=!0,z.send({type:"session.close",event_id:crypto.randomUUID()}),a):(M(),Promise.resolve())),append(e,t){let n=function(e){let t=[],n="",r=0,i=e=>{let i=lm.encode(e).length;if(r+i>480&&n&&(t.push(n),n="",r=0),i<=480){n+=e,r+=i;return}for(let i of e){let e=lm.encode(i).length;r+e>480&&(t.push(n),n="",r=0),n+=i,r+=e}};for(let t of e.split(/(?<=\s)/))i(t);return n&&t.push(n),t}(t);return f||h||!n.length?Promise.resolve(!1):new Promise(t=>{T.push({kind:e,chunks:n,settle:t}),I()})}}};var ly=e.i(218080),lv=e.i(567334);let lb=!1,l_=new Set,lw=new Set,lk={hold(e){if(e!==lb)for(let t of(lb=e,l_))t()},place(){for(let e of lw)e()},onPlace:e=>(lw.add(e),()=>{lw.delete(e)})};function lj(){return(0,w.useSyncExternalStore)(e=>(l_.add(e),()=>l_.delete(e)),()=>lb,()=>!1)}e.s(["callSignal",0,lk,"useCallHeld",0,lj],745747);let lT=[[22,["HELLO","HI","HEY"]],[17,["EVENING","HELLO","HI"]],[11,["HELLO","HI","HEY"]],[5,["MORNING","HELLO","HI"]],[0,["HELLO","HI","HEY"]]],lS=e=>e[Math.floor(Math.random()*e.length)],lN=(e,t)=>({text:e,at:Date.now(),hold:t});function lC(e=new Date){let t=e.getHours();return lN(lS(lT.find(([e])=>t>=e)?.[1]??["HI"]),1.6)}function lE(e=new Date){let t=e.getHours();return lN(t>=22||t<5?lS(["NIGHT","BYE"]):"BYE",1.2)}let lM=()=>lN("OK",1);e.s(["awake",0,()=>lN("HI",1.6),"finished",0,lM,"goodbye",0,lE,"greeting",0,lC],114923);let lO=(0,o_.createServerReference)("7f22850f30798a2f3997523883e7f2eae719e79fd2",o_.callServer,void 0,o_.findSourceMapURL,"openCallAction"),lA=(0,o_.createServerReference)("7fc3bd4347c619a4d08f9fcc75a7993b85d1460ed2",o_.callServer,void 0,o_.findSourceMapURL,"saveThoughtAction"),lR=(0,o_.createServerReference)("7fcf157d446b126d7e64d98cacc07fdfd480bf9375",o_.callServer,void 0,o_.findSourceMapURL,"saveTurnsAction"),lI=[620,775],lL=Array(ly.SPECTRUM_BANDS).fill(0),lP=!1;function lD(e){let t=e.replace(/\[[^\]]*\]?|\]/g,"").trim();return/[\p{L}\p{N}]/u.test(t)?t:""}function lz(e,t,n="This call is not being saved"){e.failures>=3||t().then(e=>(0,al.unwrapResult)(e)).catch(t=>{e.failures+=1,3===e.failures&&ao.toast.add({type:"warning",title:n,description:(0,S.errorToString)(t)})})}var lF=e.i(174080);let lB="700 9px ui-monospace, SFMono-Regular, Menlo, monospace",l$=Math.ceil(13.5);function lq(e){let t=document.createElement("canvas");t.width=l$*e.length,t.height=l$;let n=t.getContext("2d");return n?(n.textAlign="center",n.textBaseline="middle",n.font=lB,e.forEach((e,t)=>{n.fillText(e,t*l$+l$/2,l$/2)}),t):null}function lU({status:e,charset:t}){let n=(0,w.useRef)(null),r=(0,w.useRef)(null),i=(0,w.useRef)(e),[a,o]=(0,w.useState)(!1),l=lj(),u=(0,w.useRef)(l);u.current=l;let c=(0,w.useRef)(null);return(0,w.useEffect)(()=>{c.current="ascii"===t?null:lq(lv.EMOJI_POOL)},[t]),(0,w.useEffect)(()=>{let t=i.current;i.current=e,"connecting"!==t||"connecting"===e||"idle"===e||"ending"===e||window.matchMedia("(prefers-reduced-motion: reduce)").matches||o(!0)},[e]),(0,w.useEffect)(()=>{let e,t=!1;return document.fonts.ready.then(()=>{t||(e=setTimeout(()=>{u.current||window.matchMedia("(prefers-reduced-motion: reduce)").matches||o(!0)},700))}),()=>{t=!0,clearTimeout(e)}},[]),(0,w.useEffect)(()=>{let e=r.current,i=n.current?.getBoundingClientRect();if(!a||!e||!i)return;let s=window.innerWidth,l=window.innerHeight,u=i.left+i.width/2,d=i.top+i.height/2,h=Math.hypot(Math.max(u,s-u),Math.max(d,l-d)),f=Math.ceil(s/11),p=Math.ceil(l/11),m=[];for(let e=0;e<p;e++)for(let t=0;t<f;t++){if((0,lv.hash)(t+53,e+5)>.4)continue;let n=11*t+5.5,r=11*e+5.5,i=Math.atan2(r-d,n-u),s=(0,lv.hash)(t+31,e+17),a=Math.hypot(n-u,r-d)/h*(1+.1*Math.sin(3*i+1.3)+.05*Math.sin(7*i-.7)+(s-.5)*.1);a<.1||m.push({x:n,y:r,dd:a,seed:(0,lv.hash)(t,e),grain:s,speck:(0,lv.hash)(t+7,e+101),roll:(0,lv.hash)(t+211,e+89)})}m.sort((e,t)=>e.dd-t.dd);let g=e=>{let t=0,n=m.length;for(;t<n;){let r=t+n>>1;m[r].dd<e?t=r+1:n=r}return t};e.width=s,e.height=l;let x=e.getContext("2d"),y=c.current??lq(lv.EMOJI_POOL);if(!x||!y)return;x.textAlign="center",x.textBaseline="middle",x.font=lB,x.fillStyle=getComputedStyle(e).color;let v=lv.RAMP.length-1,b=(e,n)=>"emojiOnly"===t||"emoji"===t&&e.roll<lv.EMOJI_RATIO&&n>=lv.EMOJI_MIN_LEVEL,_="emojiOnly"===t?lv.EMOJI_CHAR_RATE:lv.CHAR_RATE,w=l$/2,k=performance.now(),j=0,T=0,S=()=>{let e=(performance.now()-k)/1e3;if(e>1.9736842105263157)return o(!1);if(T=requestAnimationFrame(S),j++%2)return;let t=.95*e;x.clearRect(0,0,s,l);for(let n=g(t-.2-.475);n<m.length;n++){let r=m[n],i=t-r.dd;if(i<-.03)break;let s=(0,lv.smoothstep)(-.03,.02,i)*(1-(0,lv.smoothstep)(.02,.2,i))*(.72+.28*Math.sin(46*r.dd-7*e+6.283*r.seed));if(r.speck<.06){let e=.18+.32*r.grain,t=(i-.2)/.95;s=Math.max(s,(.3+.4*r.grain)*(1-(0,lv.smoothstep)(.4*e,e,t)))}let a=Math.round(s*v);if(a<1)continue;let o=Math.floor(e*_+10*r.seed);if(b(r,a)){x.globalAlpha=.35+a/v*.65;let e=Math.floor((0,lv.hash)(97*r.seed,o)*lv.EMOJI_POOL.length);x.drawImage(y,e*l$,0,l$,l$,r.x-w,r.y-w,l$,l$);continue}x.globalAlpha=lv.ALPHA_TOP*(a/v);let l=lv.RAMP[a];x.fillText(l[Math.floor((0,lv.hash)(131*r.seed,o)*l.length)],r.x,r.y)}x.globalAlpha=1};return T=requestAnimationFrame(S),()=>cancelAnimationFrame(T)},[a,t]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{ref:n,"aria-hidden":!0,className:"pointer-events-none absolute inset-0"}),a&&(0,lF.createPortal)((0,s.jsx)("canvas",{ref:r,"aria-hidden":!0,className:"pointer-events-none fixed inset-0 z-30 size-full text-foreground"}),document.body)]})}var lH=e.i(333495);function lK(e){let t=[];for(let n of e){let e=t.at(-1);e?.role===n.role?e.text=`${e.text} ${n.text}`:t.push({...n})}return t}let lY={assistant:null,user:null};function lV(e,t){let[n,r]=(0,w.useState)(lY);return(0,w.useEffect)(()=>{t||r(lY)},[t]),(0,w.useEffect)(()=>{if(!t)return;let e=e=>{"ArrowDown"!==e.key||e.defaultPrevented||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(0,oG.capturesKeys)(e.target)||e.target?.closest?.('[role="dialog"]')||(e.preventDefault(),r(lY))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]),{pinned:n,pick:(0,w.useCallback)((t,n)=>{let i=e.filter(e=>e.role===t).length-1;r(e=>({...e,[t]:n>=i?null:n}))},[e]),back:null!==n.assistant||null!==n.user}}let lW="(under)";function lG({turns:e,pinned:t,live:n,onPick:r,under:i=null,ahead:a=!1,workOf:o,typed:l=!1}){let u=e.at(-1);return(0,s.jsx)(s.Fragment,{children:["assistant","user"].map(c=>(0,s.jsx)(lX,{role:c,turns:e.filter(e=>e.role===c),pinned:t[c],saying:n?u?.id:void 0,onPick:e=>r(c,e),under:"assistant"===c?i:null,ahead:"assistant"===c&&a,workOf:"assistant"===c?o:void 0,whole:l&&"user"===c},c))})}function lX({role:e,turns:t,pinned:n,saying:r,onPick:i,under:a,ahead:o,workOf:l,whole:u}){let c="user"===e,[d,h]=(0,w.useState)({}),[f,p]=(0,w.useState)({}),m=(0,w.useRef)(null);(0,w.useEffect)(()=>()=>m.current?.disconnect(),[]);let g=(0,w.useCallback)(e=>{if(!e)return;let t=e=>(t,n)=>{let r=t;for(let i of n){let n=i.target,s=n.dataset.turn;s&&t[s]!==e(n)&&(r===t&&(r={...t}),r[s]=e(n))}return r},n=t(e=>e.offsetHeight),r=t(e=>e.offsetWidth);return m.current??=new ResizeObserver(e=>{h(t=>n(t,e)),p(t=>r(t,e))}),m.current.observe(e),()=>m.current?.unobserve(e)},[]);if(!t.length&&!a)return null;let x=t.length-1,y=null===n&&(o||!t.length)?t.length:Math.min(n??x,x),v=e=>1150/(1150+700*Math.abs(e-y)),b=e=>e===y?1:.78,_=e=>(d[t[e].id]??28.475)*v(e)*b(e),k=y===t.length?a:l?.(t[y].id)??null,j=Array(t.length+1).fill(0);j[y]=-28.475/2;for(let e=y-1;e>=0;e--)j[e]=j[e+1]-49-_(e);let T=k&&y<t.length?(d[lW]??0)+8:0;for(let e=y+1;e<t.length;e++)j[e]=j[e-1]+_(e-1)+49+(e-1===y?T:0);let N=k?y===t.length?j[y]:j[y]+(d[t[y].id]??28.475)+8:null;return(0,s.jsxs)("div",{className:(0,S.cn)("pointer-events-none absolute h-0 w-[min(21.25rem,24vw)]",c?"left-full ml-[calc(var(--face-bleed,0px)+0.375rem)] [perspective-origin:0_0]":"right-full mr-[calc(var(--face-bleed,0px)+0.375rem)] [perspective-origin:100%_0]"),style:{top:"calc(50% + -40px)",perspective:1150},children:[t.map((e,n)=>{let a=Math.abs(n-y),o=n<y?y-n<=2:n-y<=2,l=n===y,d=o?l?1:.56*.6**(a-1):0,h=o&&!l,f=14*a*(c?-1:1)/v(n),p=j[n]/v(n);return(0,s.jsx)("div",{ref:g,"data-turn":e.id,"aria-hidden":!o,onClick:h?()=>i(n):void 0,style:{transform:`translate(${f.toFixed(1)}px, ${p.toFixed(1)}px) translateZ(${-700*a}px) scale(${b(n)})`,"--ink":d,"--lift":Math.max(d,.9)},className:(0,S.cn)("group/turn absolute top-0 w-max max-w-full text-[17px] leading-[1.675] tracking-[0.3px] text-foreground transition-transform duration-[520ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none",u&&n===t.length-1&&"animate-in fade-in duration-200 motion-reduce:animate-none",c?"left-0 origin-top-left":"right-0 origin-top-right",!o&&"invisible",h&&"pointer-events-auto cursor-pointer",l&&"pointer-events-auto"),children:(0,s.jsxs)("p",{className:(0,S.cn)("break-keep text-pretty opacity-(--ink) transition-opacity duration-[520ms] motion-reduce:transition-none",!l&&"line-clamp-4",h&&"group-hover/turn:opacity-(--lift)"),children:[l&&(0,s.jsx)("span",{className:(0,S.cn)("mr-4 inline-block size-2.5 rounded-full align-middle",e.id===r?"animate-pulse motion-reduce:animate-none":"opacity-55",c?"bg-foreground":"bg-brand")}),n!==t.length-1||u?e.text:(0,s.jsx)(M,{text:e.text})]})},e.id)}),k&&(0,s.jsx)("div",{ref:g,"data-turn":lW,style:{transform:`translateY(${(N??0).toFixed(1)}px)`,width:y<t.length?f[t[y].id]:void 0},className:(0,S.cn)("absolute top-0 flex w-full transition-transform duration-[520ms] ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none",c?"left-0 justify-start":"right-0 justify-end"),children:k})]})}e.s(["SideCaptions",0,lG,"turnsOf",0,lK,"useTurnFocus",0,lV],435135);let lJ=["▁▄▇▄","▂▆▆▂","▄▇▄▁","▆▆▂▂","▇▄▁▄","▆▂▂▆","▄▁▄▇","▂▂▆▆"];function lQ({live:e,ringing:t}){let{owed:n}=aq(),r=oh(Object.values(of()).map(e=>e??null)),i="brand"===r?null:r;return(0,w.useEffect)(()=>{let r=t?`${sd.APP_NAME} is calling`:sd.APP_NAME,i=n>0?`(${n}) ${r}`:r;if(!e){document.title=i;return}let s=0;document.title=`${i} ${lJ[s]}`;let a=setInterval(()=>{s=(s+1)%lJ.length,document.title=`${i} ${lJ[s]}`},100);return()=>clearInterval(a)},[e,n,t]),(0,w.useEffect)(()=>{let e=document.head.querySelector("link[data-tab-icon]");e||((e=document.createElement("link")).rel="icon",e.type="image/svg+xml",e.setAttribute("sizes","any"),e.dataset.tabIcon="",document.head.append(e)),e.href=`data:image/svg+xml,${encodeURIComponent(function(e){let{head:t,eyes:n}=(0,sm.markAtRest)(sZ.THURSDAY_SEED),r=e?`<circle cx="200" cy="200" r="${66}"/>`:"",i=e?`<circle class="${e}" cx="200" cy="200" r="46"/>`:"";return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 252 252"><style>.ink{fill:#0a0a0a}.amber{fill:#e17100}.red{fill:#e7000b}@media (prefers-color-scheme:dark){.ink{fill:#fafafa}.amber{fill:#ffb900}.red{fill:#ff6467}}</style><mask id="m" maskUnits="userSpaceOnUse"><path d="${t}" fill="#fff"/><path d="${n[0]}"/><path d="${n[1]}"/>${r}</mask><path class="ink" d="${t}" mask="url(#m)"/>${i}</svg>`}(i))}`},[i]),null}let lZ={name:"arrow-down-to-line",size:24,node:[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]};lZ.node;let l0=(0,l.default)(lZ);var l1=e.i(96892),l2=e.i(64801),l5=e.i(59377),l3=e.i(184762),l4=e.i(146538);let l6=(0,o_.createServerReference)("7f5bf14e770ea3a12f9d0fb0ace4bef64f3f89ab13",o_.callServer,void 0,o_.findSourceMapURL,"startThreadAction");var l7=e.i(553429),l8=e.i(709190);let l9={name:l7.ROOM_THURSDAY,description:"A call in writing — she answers here"},ue="thursday.write.to",ut=e=>/^@(\S*)$/.exec(e.split(/\s/,1)[0]);function un({written:e,onCall:t=!1}){let{data:n}=(0,sb.useServerRoute)(k.queryKey.bot),r=(0,w.useMemo)(()=>[...e?[l9]:[],...n?.length?n.filter(e=>!e.disabled).map(({name:e,icon:t,description:n})=>({name:e,icon:t,description:n})):[sp.DEFAULT_BOT]],[n,e]),[i,a]=(0,w.useState)(!1),[l,u]=(0,w.useState)(!1),[c,d]=(0,w.useState)(!1),[h,f]=(0,w.useState)(null),[p,m]=(0,w.useState)(""),g=(0,w.useRef)(t);g.current=t;let x=(0,l8.useGivenFiles)({onKept:e=>{if(g.current)return s_.screenActs.announce({kind:"gave",paths:e}),"she knows it is here"}}),y=(0,w.useRef)(null),v=(0,w.useRef)(null),b=(0,s_.useRoomOpen)();(0,w.useEffect)(()=>{try{f(window.localStorage.getItem(ue))}catch{}},[]);let _=!!e?.on,[T,N]=(0,w.useState)(null);(0,w.useEffect)(()=>{_||N(null)},[_]);let C=_?r.find(e=>e.name===T)??l9:r.find(e=>e.name===h)??r[0],E=C===l9,M=lj(),O=(0,w.useCallback)(()=>{M||(a(!0),requestAnimationFrame(()=>y.current?.focus()))},[M]),{take:A}=x,R=(0,w.useCallback)(e=>{O(),A(e)},[A,O]);(0,w.useEffect)(()=>s_.writeLine.subscribe(O),[O]),(0,w.useEffect)(()=>{let e=e=>{"/"!==e.key||e.metaKey||e.ctrlKey||e.altKey||e.defaultPrevented||(0,oG.capturesKeys)(e.target)||e.target?.closest?.('[role="dialog"]')||(e.preventDefault(),O())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[O]),(0,w.useEffect)(()=>{if(M)return;let e=e=>!!e.dataTransfer?.types.includes("Files"),t=t=>{e(t)&&(t.preventDefault(),d(!0))},n=e=>{null===e.relatedTarget&&d(!1)},r=t=>{if(!e(t))return;t.preventDefault(),d(!1);let n=[...t.dataTransfer?.files??[]];l8.roomDrop.offer(t.target,n)||R(n)};return window.addEventListener("dragover",t),window.addEventListener("dragleave",n),window.addEventListener("drop",r),()=>{window.removeEventListener("dragover",t),window.removeEventListener("dragleave",n),window.removeEventListener("drop",r)}},[R,M]);let[I,L]=(0,ok.useServerAction)(l6,{onOk:({id:e})=>{(0,sb.revalidate)(k.queryKey.threads),m(""),x.clear(),a(!1),N(null),s_.roomOpens.open(e)}}),P=e=>{if(u(!1),m(e=>ut(e)?e.replace(/^@\S*\s?/,""):e),y.current?.focus(),_)return N(e.name===l9.name?null:e.name);f(e.name);try{window.localStorage.setItem(ue,e.name)}catch{}},D=ut(p),z=D?r.filter(e=>e.name.toLowerCase().startsWith(D[1].toLowerCase())):r,[F,B]=(0,w.useState)(!1),$=L||F||!!(E&&e?.busy),q=!!p.trim()&&!D&&!x.arriving&&!$&&!(E&&!e?.runsOn),U=()=>{if(!q)return;let t=x.withPaths(p);E?e&&(B(!0),e.say(t).then(()=>{m(""),x.clear()}).catch(()=>{}).finally(()=>B(!1))):I(C.name,t)},H=()=>{if(_&&!E)return N(null);_&&e?.end(),a(!1)},K=(0,w.useRef)(H);K.current=H;let Y=(0,w.useRef)(t);(0,w.useEffect)(()=>{let e=t&&!Y.current;Y.current=t,!e||p.trim()||x.files.length||a(!1)},[t,p,x.files.length]);let V=i||c||_;(0,w.useEffect)(()=>{if(!V)return;let e=e=>{"Escape"!==e.key||e.defaultPrevented||e.target?.closest?.('[role="dialog"]')||(e.preventDefault(),K.current())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[V]);let W=L||F;return((0,w.useEffect)(()=>{V&&!W&&y.current?.focus()},[V,W]),(0,w.useEffect)(()=>(s_.writeLine.shown(V),()=>s_.writeLine.shown(!1)),[V]),V)?(0,s.jsxs)(s.Fragment,{children:[c&&(0,s.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none fixed inset-0 z-20 bg-background/60",children:(0,s.jsx)("div",{className:"absolute inset-3 rounded-3xl border-[1.5px] border-dashed border-foreground/30"})}),(0,s.jsx)("div",{className:(0,S.cn)("pointer-events-none fixed inset-x-0 bottom-7 z-30 flex justify-center px-5 transition-[padding] duration-500 ease-out max-[1180px]:bottom-18",b&&"min-[1180px]:pr-[41.25rem]"),children:(0,s.jsxs)("div",{className:"pointer-events-auto flex w-160 max-w-full animate-in flex-col gap-2 fade-in slide-in-from-bottom-2 duration-200",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 rounded-[26px] bg-background p-2 shadow-[0_22px_44px_-20px_rgb(0_0_0/0.22)] ring-1 ring-border",children:[(x.files.length>0||c)&&(0,s.jsx)(l8.GivenFiles,{files:x.files,onRemove:x.remove,className:"px-0.5 pt-0.5",children:c&&(0,s.jsxs)("span",{className:"flex h-13 items-center gap-2 rounded-[14px] border-[1.5px] border-dashed border-foreground/60 px-4 text-[13px]",children:[(0,s.jsx)(l0,{className:"size-4"}),"Let go — it waits here"]})}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault(),U()},className:"flex items-end gap-2",children:[(0,s.jsxs)(l5.Popover,{open:l||!!D,onOpenChange:u,children:[(0,s.jsxs)(l5.PopoverTrigger,{render:(0,s.jsx)("button",{type:"button","aria-label":`To ${C.name}. Choose someone else`,className:"flex h-9 shrink-0 items-center gap-1.5 rounded-full bg-muted pr-2.5 pl-1.5 text-[13px] font-medium outline-none transition-colors hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50"}),children:[(0,s.jsx)(ua,{bot:C,size:22}),C.name,(0,s.jsx)(o.ChevronDown,{className:"size-3 text-muted-foreground"})]}),(0,s.jsxs)(l5.PopoverContent,{side:"top",align:"start",sideOffset:14,initialFocus:!D&&void 0,className:"w-90 gap-0 rounded-[18px] p-1.5",children:[(0,s.jsx)("p",{className:"px-2.5 pt-1.5 pb-1 font-mono text-[10px] text-muted-foreground",children:"to"}),z.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>P(e),className:(0,S.cn)("flex h-11.5 w-full items-center gap-2.5 rounded-xl px-2.5 text-left outline-none hover:bg-muted focus-visible:bg-muted",e.name===C.name&&!D&&"bg-muted"),children:[(0,s.jsx)(ua,{bot:e,size:24}),(0,s.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col",children:[(0,s.jsx)("span",{className:"text-[13.5px] leading-4.5 font-medium",children:e.name}),(0,s.jsx)("span",{className:"truncate text-xs leading-4 text-muted-foreground",children:e.description})]})]},e.name)),0===z.length&&(0,s.jsx)("p",{className:"px-2.5 py-2 text-[13px] text-muted-foreground",children:"Nobody by that name."})]})]}),(0,s.jsx)(l3.Textarea,{ref:y,value:p,rows:1,disabled:L||F,onChange:e=>m(e.target.value),onPaste:e=>{let t=[...e.clipboardData.files];t.length&&(e.preventDefault(),R(t))},onKeyDown:e=>{if("Escape"===e.key)return e.preventDefault(),H();if("Enter"===e.key&&!e.shiftKey&&!e.nativeEvent.isComposing&&229!==e.keyCode){if(e.preventDefault(),D){z[0]&&P(z[0]);return}U()}},placeholder:x.files.length?"Say what to do with them":_&&E?"Write back":E?"Write to her instead of calling":`Say the whole job — ${C.name} cannot hear the call`,"aria-label":`Message for ${C.name}`,className:"max-h-36 min-h-9 flex-1 resize-none border-0 bg-transparent px-0 py-1.5 text-[15px] leading-6 shadow-none focus-visible:ring-0 dark:bg-transparent"}),(0,s.jsx)("input",{ref:v,type:"file",multiple:!0,hidden:!0,onChange:e=>{R([...e.target.files??[]]),e.target.value=""}}),(0,s.jsx)("button",{type:"button","aria-label":"Add files",onClick:()=>v.current?.click(),className:"grid size-9 shrink-0 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:(0,s.jsx)(l2.Paperclip,{className:"size-4"})}),(0,s.jsx)("button",{type:"submit","aria-label":"Send",disabled:!q,className:(0,S.cn)("grid size-9 shrink-0 place-items-center rounded-full outline-none transition-colors focus-visible:ring-3 focus-visible:ring-brand/30",q?"bg-brand text-brand-foreground hover:bg-brand/85":"bg-muted text-muted-foreground/40"),children:$?(0,s.jsx)("span",{className:"size-3.5 animate-spin rounded-full border-2 border-current/30 border-t-current"}):(0,s.jsx)(l1.ArrowUp,{className:"size-4"})})]})]}),E&&e?.error&&(0,s.jsx)("p",{className:"px-4 text-center text-xs leading-5 text-destructive",children:e.error}),E&&e?.error&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-3",children:[(0,s.jsxs)(j.Button,{type:"button",size:"sm",variant:"brand",disabled:e.busy,onClick:()=>{e.fallback&&ox.useThursdayStore.getState().patch({textModel:e.fallback}),e.again()},children:[(0,s.jsx)(sQ.RotateCw,{}),e.fallback?"Send it again on your OpenAI key":"Send it again"]}),(0,s.jsx)("span",{className:"font-mono text-[10.5px] text-muted-foreground/70",children:(0,s.jsx)(us,{children:"API keys"})})]}),(0,s.jsxs)("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1 font-mono text-[10.5px] text-muted-foreground/70",children:[E?(0,s.jsx)(ur,{runsOn:e?.runsOn??null}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(uo,{children:"Enter"})," send",(0,s.jsx)(ui,{}),(0,s.jsx)(uo,{children:"@"})," pick a bot"]}),(0,s.jsx)(ui,{}),(0,s.jsx)(uo,{children:"Esc"})," ",_?E?"to end":"back to her":"close"]})]})})]}):null}function ur({runsOn:e}){let t=sf.TEXT_MODEL_PROVIDERS.chatgpt.label,n=(0,s.jsx)(l4.ModelPicker,{compact:!0,provider:e?.provider??null,model:e?.model??"",unset:"pick a model",onChange:e=>ox.useThursdayStore.getState().patch({textModel:e})});return e?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"text"}),(0,s.jsx)(ui,{}),(0,s.jsx)("span",{children:"runs on"}),n]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Writing to her needs a ",t,", an OpenAI key, or"]}),n,(0,s.jsx)(ui,{}),(0,s.jsx)(us,{children:"API keys"})]})}let ui=()=>(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"});function us({children:e}){return(0,s.jsx)("button",{type:"button",onClick:()=>(0,aZ.openSettings)("keys"),className:"rounded-sm text-foreground/80 underline underline-offset-3 outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:e})}function ua({bot:e,size:t}){return e===l9?(0,s.jsx)(sZ.ThursdayMark,{size:t,className:"shrink-0"}):(0,s.jsx)(sm.BotMark,{size:t,seed:e.name,color:e.icon?.color,shape:e.icon?.shape,outline:e.icon?.outline,paint:e.icon?.paint,notify:!1,className:"shrink-0"})}function uo({children:e}){return(0,s.jsx)("kbd",{className:"rounded-md border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 shadow-[0_1px_0_var(--border)]",children:e})}function ul({status:e,failed:t=!1,messages:n,tool:r,thinkingSince:i=null,thinkingTitle:a=null,ended:o=null,faceWord:l=null,onTap:u,ringing:c=null,onDecline:d,wakePhrase:h=null,hotkeyLabel:f=null,idleLeft:p=null,since:m=null,getSpectrum:g,getMicSpectrum:x,captionView:y="sides",face:v=og.FACE_DEFAULT,callable:b=!0,written:_=null}){var k;let[j,T]=(0,w.useState)(!1),N=!b&&"idle"===e,C="connecting"===e||"ending"===e,E=!!_?.on,M="idle"!==e&&!C&&!E,O=n.findLast(e=>"assistant"===e.role)?.text??"",A=(k=ud,(0,w.useSyncExternalStore)(e=>{let t=window.matchMedia(`(min-width: ${k}px)`);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)},()=>window.matchMedia(`(min-width: ${k}px)`).matches,()=>!0)),R="sides"===y&&"idle"!==e&&A,I=(0,w.useMemo)(()=>lK(n),[n]),L=lV(I,R),P=I.at(-1)?.role,D=function(e,t){let[n,r]=(0,w.useState)(e),i=(0,w.useRef)(e?[e]:[]),s=(0,w.useRef)(Date.now()),a=(0,w.useRef)(!1),o=(0,w.useRef)(null),l=(0,w.useCallback)(()=>{o.current&&clearTimeout(o.current),o.current=null,(i.current.length>1||a.current)&&i.current.length&&(o.current=setTimeout(()=>{i.current.shift(),s.current=Date.now(),r(i.current[0]??null),l()},Math.max(0,s.current+sd.CALL_LINE.dwellMs-Date.now())))},[]);return(0,w.useEffect)(()=>{if(!e){a.current=!0,i.current.length<=1&&(i.current=[],r(null)),l();return}a.current=!1;let t=i.current.findIndex(t=>t.id===e.id);t>=0?(i.current[t]=e,0===t&&r(e)):(i.current=[...i.current.map((e,t)=>0===t?e:{...e,done:!0}),e],1===i.current.length&&(s.current=Date.now(),r(e))),l()},[e,l]),(0,w.useEffect)(()=>{if(!t)return;let e=i.current.at(-1);i.current=e&&!a.current?[e]:[],s.current=Date.now(),r(i.current[0]??null),l()},[t,l]),(0,w.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),n}(r,"speaking"===e),z=function(e,t){let n=null!==e||t,[r,i]=(0,w.useState)([]),[s,a]=(0,w.useState)(n);return(0,w.useEffect)(()=>{i(t=>{let n=t.some(e=>!e.done)?t.map(e=>e.done?e:{...e,done:!0}):t;if(!e)return n;let r=t.findIndex(t=>uw(t)===uw(e));return r>=0?t.map((t,n)=>n===r?e:t):[...n,e].slice(-4)})},[e]),(0,w.useEffect)(()=>{if(n)return void a(!0);let e=setTimeout(()=>{a(!1),i([])},300);return()=>clearTimeout(e)},[n]),{lines:r,on:n,held:s}}(D,null!==i),[F,B]=(0,w.useState)(!1);(0,w.useEffect)(()=>{"user"!==P?B(!1):z.on&&B(!0)},[P,z.on]);let $=function(e,t,n){let[r,i]=(0,w.useState)(uk),s=e.findLast(e=>"assistant"===e.role),a=s?.id??null,o=s?`${s.id}:${s.text.length}`:null,l=!n&&e.at(-1)?.role==="assistant";(0,w.useEffect)(()=>{i(e=>{let n=e;for(let e of t){let t=uw(e),r=n.owner[t];if(void 0===r){let e=t in n.seen?n.seen[t]:o;if(t in n.seen||(n={...n,seen:{...n.seen,[t]:o}}),!a||e===o&&!l)continue;r=a,n={...n,owner:{...n.owner,[t]:r}}}let i=n.turns[r]??[],s=i.findIndex(e=>uw(e)===t);s>=0&&i[s]===e||(n={...n,turns:{...n.turns,[r]:s>=0?i.map((t,n)=>n===s?e:t):[...i,e]}})}return n})},[t,o,a,l]),(0,w.useEffect)(()=>{e.length||i(uk)},[e.length]);let u=(0,w.useMemo)(()=>t.filter(e=>void 0===r.owner[uw(e)]),[t,r.owner]);return{turns:r.turns,pending:u,latest:a}}(I,z.lines,z.on),q="assistant"===P&&"speaking"===e||"user"===P&&"listening"===e&&!E,U=null!==c&&null===c.missedAt,H=function(e){let[t,n]=(0,w.useState)(null);return(0,w.useEffect)(()=>{if(!e)return void n(null);let t=()=>n({...uT,at:Date.now()});t();let r=setInterval(t,2600);return()=>clearInterval(r)},[e]),t}(U);return(0,s.jsxs)("div",{className:"relative flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"absolute top-5 right-5 z-10 flex flex-col items-end gap-3",children:[(0,s.jsx)(uh,{}),(0,s.jsx)(ak,{hidden:"idle"!==e||null!==c||E})]}),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-5 pt-[7vh]",children:[(0,s.jsxs)("div",{className:"relative w-[min(20rem,52vw,37.5vh)] [--face-bleed:19.5%]",children:[(0,s.jsx)("button",{type:"button",disabled:C,onClick:N?()=>T(!0):E&&!b?void 0:u,"aria-label":N?"Add a speech key":M?"End the call":U?"Answer Thursday":"Call Thursday",className:(0,S.cn)("block w-full rounded-full outline-none transition-all duration-700 ease-out focus-visible:ring-3 focus-visible:ring-ring/50 enabled:active:scale-[0.99] disabled:opacity-70",N&&"opacity-35"),children:(0,s.jsx)("span",{className:"block",children:(0,s.jsx)(lH.Face,{look:v,status:e,failed:t,word:H??l,getSpectrum:g,className:"-m-(--face-bleed) w-[calc(100%+2*var(--face-bleed))] max-w-none"})})}),(0,s.jsx)(lU,{status:e,charset:v.charset}),R&&(0,s.jsx)(lG,{turns:I,pinned:L.pinned,live:q,onPick:L.pick,under:z.held&&$.pending.length>0?(0,s.jsx)(uj,{lines:$.pending,shown:z.on}):null,ahead:F&&z.held&&$.pending.length>0,typed:E,workOf:e=>{let t=[...$.turns[e]??[],...e===$.latest&&"assistant"===P?$.pending:[]];return t.length?(0,s.jsx)(uj,{lines:t,shown:!0}):null}})]}),(0,s.jsxs)("div",{className:"relative flex w-full max-w-3xl flex-col items-center gap-2 px-6 text-center",children:[c&&(0,s.jsx)(uN,{ringing:c,wakePhrase:h,onAnswer:u,onDecline:()=>d?.()}),(0,s.jsxs)("div",{className:(0,S.cn)("contents",c&&"*:invisible"),children:[(0,s.jsx)(ub,{tool:R?null:D,toolUp:null!==D,thinkingSince:i,thinkingTitle:a,listening:"listening"===e&&null===i&&!E,getMicSpectrum:x}),(0,s.jsx)(uf,{text:R||"idle"===e?"":O,fadeIn:!0,className:"w-full max-w-160 text-center text-base"}),(0,s.jsx)("div",{className:(0,S.cn)("flex flex-col items-center","idle"===e&&"order-first"),children:N?(0,s.jsx)(uL,{open:j,onOpen:()=>T(!0),onClose:()=>T(!1)}):E?(0,s.jsx)("span",{className:"h-6"}):(0,s.jsx)(uR,{status:e,idleLeft:p,since:m,ended:o,behind:R&&L.back,wakePhrase:h,hotkeyLabel:f})})]})]})]}),(0,s.jsx)(o$,{}),(0,s.jsx)(as,{}),(0,s.jsx)(un,{written:_,onCall:M})]})}let uu=["thursday","memory","bot"];function uc({alert:e}){return e?(0,s.jsx)("span",{"aria-hidden":!0,className:(0,S.cn)("absolute top-0.5 right-0.5 size-1.5 rounded-full ring-2 ring-background","red"===e?"bg-destructive":"brand"===e?"bg-brand":"bg-amber-600 dark:bg-amber-400")}):null}let ud=1e3;function uh(){let e=of(),t=oh(ol.filter(e=>!uu.includes(e.id)).map(t=>e[t.id]??null));return(0,s.jsxs)(so,{children:[(0,s.jsxs)(C,{className:"bg-background/75 backdrop-blur-md",children:[(0,s.jsx)(C,{children:uu.map(t=>{let n=ol.find(e=>e.id===t);return n?(0,s.jsxs)(sl,{children:[(0,s.jsxs)(su,{render:(0,s.jsx)(j.Button,{size:"icon",variant:"outline","aria-label":n.label,onClick:()=>(0,aZ.openSettings)(t)}),children:[(0,s.jsx)(n.icon,{className:"text-muted-foreground"}),(0,s.jsx)(uc,{alert:e[t]??null})]}),(0,s.jsx)(sc,{side:"bottom",children:n.label})]},t):null})}),(0,s.jsx)(C,{children:(0,s.jsxs)(j.Button,{variant:"outline",onClick:()=>(0,aZ.openSettings)(),className:"gap-1.5 px-2.5 text-[12.5px] font-normal",children:[(0,s.jsx)(b,{className:"text-muted-foreground"}),"Settings",(0,s.jsx)(uc,{alert:t})]})})]}),(0,s.jsx)(od,{})]})}function uf({text:e,lines:t=3,fadeIn:n=!1,className:r}){let i=(0,w.useRef)(null),[a,l]=(0,w.useState)(t),[u,d]=(0,w.useState)(0);(0,w.useEffect)(()=>d(0),[e]),(0,w.useEffect)(()=>{let e=i.current;if(!e)return;let t=()=>{let t=Number.parseFloat(getComputedStyle(e).lineHeight);t&&l(Math.max(1,Math.round(e.scrollHeight/t)))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[e]);let h=Math.ceil(Math.max(0,a-t)/t),f=Math.max(0,a-t-Math.min(u,h)*t),p=`calc(${t} * 1.625em)`,m=(0,s.jsx)("p",{ref:i,style:{lineHeight:1.625,transform:`translateY(-${1.625*f}em)`},className:"break-keep transition-transform duration-200",children:n?(0,s.jsx)(M,{text:e}):e});return(0,s.jsxs)("div",{className:"relative flex w-full justify-center",children:[(0,s.jsx)("div",{style:{height:p},onClick:h>0?()=>d(e=>e>=h?0:e+1):void 0,className:(0,S.cn)("overflow-hidden",h>0&&"cursor-pointer",r),children:m}),h>0&&(0,s.jsxs)("div",{className:"absolute top-1/2 right-0 flex -translate-y-1/2 flex-col items-center gap-0.5",children:[(0,s.jsx)(up,{look:c,label:"Earlier lines",shown:u<h,onPick:()=>d(e=>Math.min(h,e+1))}),(0,s.jsx)(up,{look:o.ChevronDown,label:"Later lines",shown:u>0,onPick:()=>d(e=>Math.max(0,e-1))})]})]})}function up({look:e,label:t,shown:n,onPick:r}){return(0,s.jsx)("button",{type:"button","aria-label":t,"aria-hidden":!n,tabIndex:n?void 0:-1,onClick:e=>{e.stopPropagation(),r()},className:(0,S.cn)("grid size-7 place-items-center rounded-full text-muted-foreground/60 outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",!n&&"invisible"),children:(0,s.jsx)(e,{className:"size-3.5"})})}let um=[{id:"a",from:0,to:1,gain:.8},{id:"b",from:1,to:3,gain:1},{id:"c",from:3,to:5,gain:1.15},{id:"d",from:5,to:6,gain:1.35},{id:"e",from:6,to:8,gain:1.55}];function ug({live:e,getMicSpectrum:t}){let n=(0,w.useRef)({}),r=(0,w.useRef)(um.map(()=>0));return(0,w.useEffect)(()=>{if(!e||!t)return;let i=requestAnimationFrame(function e(){let s=t();um.forEach((e,t)=>{let i=0;for(let t=e.from;t<e.to;t++)i=Math.max(i,s[t]??0);let a=Math.min(1,(i*e.gain)**.8),o=r.current[t],l=o+(a-o)*(a>o?.6:.16);r.current[t]=l;let u=n.current[e.id];u&&(u.style.height=`${2+12*l}px`)}),i=requestAnimationFrame(e)});return()=>cancelAnimationFrame(i)},[e,t]),(0,s.jsx)("span",{"aria-hidden":!0,className:"flex h-3.5 w-[18px] shrink-0 items-center gap-0.5",children:um.map(e=>(0,s.jsx)("span",{ref:t=>{n.current[e.id]=t},style:{height:2},className:"w-0.5 rounded-full bg-muted-foreground/70"},e.id))})}function ux({live:e,getMicSpectrum:t}){return(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-[13px] leading-5 text-muted-foreground",children:[(0,s.jsx)(ug,{live:e,getMicSpectrum:t}),"Listening"]})}function uy({tool:e}){let t="relay"===e.kind?h:(0,aa.toolIcon)(e.name),n=e.line??e.name,r=e.line?"min-w-0 truncate text-[13px] leading-5 break-keep":"min-w-0 truncate font-mono text-xs leading-5",i=(0,sb.useServerRoute)(k.queryKey.bot).data,a=e.bot?i?.find(t=>t.name===e.bot)??null:null;return(0,s.jsxs)("span",{className:"flex max-w-full items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"relative grid size-[18px] shrink-0 place-items-center",children:[(0,s.jsx)(uv,{tool:e,bot:a,icon:t}),!e.done&&(0,s.jsx)("span",{className:"absolute inset-0 grid animate-ink place-items-center",children:(0,s.jsx)(uv,{tool:e,bot:a,icon:t,running:!0})})]}),e.done&&e.sources?.length?(0,s.jsx)(R.SourceChips,{sources:e.sources,limit:2,className:"flex-nowrap"}):e.done?(0,s.jsx)("span",{className:(0,S.cn)(r,"text-muted-foreground"),children:n}):(0,s.jsx)(A.ShinyText,{text:n,className:r})]})}function uv({tool:e,bot:t,icon:n,running:r}){return e.bot?(0,s.jsx)("span",{className:(0,S.cn)("flex",!r&&!e.done&&"opacity-40"),children:(0,s.jsx)(sm.BotMark,{size:16,seed:e.bot,color:t?.icon?.color,shape:t?.icon?.shape,outline:t?.icon?.outline,paint:t?.icon?.paint,notify:!1})}):(0,s.jsx)(n,{className:(0,S.cn)("size-3.5",r?"text-foreground":"text-muted-foreground",!r&&!e.done&&"opacity-40")})}function ub({tool:e,toolUp:t,thinkingSince:n,thinkingTitle:r,listening:i,getMicSpectrum:a}){let[o,l]=(0,w.useState)(e);(0,w.useEffect)(()=>{e&&l(e)},[e]);let{thought:u,title:c}=function(e,t){let[n,r]=(0,w.useState)(null!==e),[i,s]=(0,w.useState)(t);return(0,w.useEffect)(()=>{null!==e&&(r(!0),s(t))},[e,t]),{thought:n,title:i}}(n,r),d=i&&!e;return(0,s.jsxs)("div",{className:"grid h-7 max-w-full items-center justify-items-center",children:[o&&(0,s.jsx)(uO,{at:"col-start-1 row-start-1 max-w-full",shown:null!==e,children:(0,s.jsx)(uy,{tool:o})}),u&&(0,s.jsx)(uO,{at:"col-start-1 row-start-1",shown:null!==n&&!t,children:(0,s.jsx)(uP,{title:c})}),(0,s.jsx)(uO,{at:"col-start-1 row-start-1",shown:d,children:(0,s.jsx)(ux,{live:d,getMicSpectrum:a})})]})}let u_=[1,.7,.45],uw=e=>e.id??`${e.kind??"tool"}:${e.name}`,uk={turns:{},owner:{},seen:{}};function uj({lines:e,shown:t}){let n=Math.max(0,e.length-3),r=e.length-n;return(0,s.jsx)("div",{"aria-hidden":!t,className:(0,S.cn)("pointer-events-auto relative w-full transition-opacity duration-300 ease-out",!t&&"pointer-events-none opacity-0"),style:{height:26*r},children:e.map((t,r)=>{let i=r-n;return(0,s.jsx)("div",{style:{transform:`translateY(${26*i}px)`,opacity:i<0?0:u_[e.length-1-r],height:26},className:"absolute inset-x-0 top-0 flex items-center transition-[transform,opacity] duration-300 ease-out motion-reduce:transition-none",children:(0,s.jsx)("div",{className:"flex min-w-0 animate-in duration-300 fade-in slide-in-from-bottom-1 motion-reduce:animate-none",children:(0,s.jsx)(uy,{tool:t})})},uw(t))})})}let uT={text:"CALL",hold:1.5},uS="rounded-md border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground/80 shadow-[0_1px_0_var(--border)]";function uN({ringing:e,wakePhrase:t,onAnswer:n,onDecline:r}){let i=(0,sb.useServerRoute)(k.queryKey.bot).data,a=(e,t)=>{let n=i?.find(t=>t.name===e.bot)?.icon;return(0,s.jsx)(sm.BotMark,{size:t,seed:e.bot,color:n?.color,shape:n?.shape,outline:n?.outline,paint:n?.paint,notify:!1,className:"shrink-0"})},{first:o,others:l,missedAt:u}=e;if(null!==u){let e=[o,...l];return(0,s.jsxs)("div",{className:"absolute inset-x-0 -top-20 z-10 flex animate-in flex-col items-center px-6 fade-in duration-300",children:[(0,s.jsxs)("div",{className:"flex w-full max-w-140 flex-col text-left",children:[(0,s.jsxs)("p",{className:"mb-1.5 flex items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,s.jsx)(y,{className:"size-3"}),(0,s.jsxs)("span",{children:["Missed · ",(0,s.jsx)(uC,{at:u})]}),(0,s.jsxs)("button",{type:"button",onClick:r,className:"ml-auto flex items-center gap-1.5 rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("kbd",{className:uS,children:"Esc"}),"clear"]})]}),e.slice(0,3).map(e=>(0,s.jsxs)("div",{className:"flex h-8.5 items-center gap-2.5",children:[a(e,20),(0,s.jsx)("span",{className:"w-32 shrink-0 truncate text-[13.5px]",children:e.label}),(0,s.jsx)("span",{className:"w-14 shrink-0 font-mono text-[10.5px] text-muted-foreground",children:uM[e.kind]}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-muted-foreground",children:(0,S.plainText)(e.text)})]},e.id)),e.length>3&&(0,s.jsxs)("p",{className:"mt-1 font-mono text-[10.5px] text-muted-foreground/70",children:["+",e.length-3," more in the room"]})]}),(0,s.jsx)(j.Button,{variant:"brand",onClick:n,className:"mt-5 h-12 px-8 text-[15px]",children:"Call back"}),t&&(0,s.jsxs)("span",{className:"mt-3 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground/70",children:["or say ",(0,s.jsx)(uE,{phrase:t})]})]})}return(0,s.jsxs)("div",{className:"absolute inset-x-0 -top-20 z-10 flex animate-in flex-col items-center gap-3 px-6 fade-in duration-300",children:[(0,s.jsxs)("span",{className:"flex max-w-full items-center gap-2 text-sm",children:[a(o,18),(0,s.jsx)("span",{children:o.bot}),(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,s.jsx)("span",{className:"truncate text-muted-foreground",children:o.label})]}),(0,s.jsx)("p",{className:"line-clamp-3 max-w-150 text-base/relaxed text-pretty break-keep [@media(min-height:860px)]:line-clamp-5",children:(0,S.plainText)(o.text)}),o.options.length>0&&(0,s.jsx)("span",{className:"flex max-w-full flex-wrap justify-center gap-1.5",children:o.options.map(e=>(0,s.jsx)("span",{className:"flex h-7 max-w-60 items-center truncate rounded-full px-3 text-[12.5px] text-muted-foreground ring-1 ring-border",children:e},e))}),(0,s.jsx)(j.Button,{variant:"brand",onClick:n,className:"mt-3 h-12 px-8 text-[15px]",children:"Answer"}),l.length>0&&(0,s.jsxs)("span",{className:"flex max-w-full flex-wrap items-center justify-center gap-x-4.5 gap-y-1 text-[13px] text-muted-foreground",children:[l.slice(0,2).map(e=>(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[a(e,16),(0,s.jsx)("span",{className:"max-w-44 truncate text-foreground",children:e.label}),uM[e.kind]]},e.id)),l.length>2&&(0,s.jsxs)("span",{children:["+",l.length-2]})]}),(0,s.jsxs)("span",{className:"mt-1 flex items-center gap-3 font-mono text-[11px] text-muted-foreground/70",children:[t&&(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:["say ",(0,s.jsx)(uE,{phrase:t})," to answer"]}),(0,s.jsxs)("button",{type:"button",onClick:r,className:"flex items-center gap-2 rounded-md outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50",children:[(0,s.jsx)("kbd",{className:uS,children:"Esc"}),"not now"]})]})]})}function uC({at:e}){let[t,n]=(0,w.useState)(()=>Date.now());return(0,w.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),3e4);return()=>clearInterval(e)},[]),t-e<6e4?"just now":(0,a.formatDistanceStrict)(e,t,{addSuffix:!0})}function uE({phrase:e}){return(0,s.jsxs)("span",{className:"flex items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-foreground/80",children:[(0,s.jsx)(p,{className:"size-3"}),e]})}let uM={question:"asks",done:"finished",stopped:"stopped"};function uO({at:e,shown:t,children:n}){return(0,s.jsx)("span",{"aria-hidden":!t,className:(0,S.cn)("flex transition-opacity duration-300 ease-out",e,t?"opacity-100":"pointer-events-none opacity-0"),children:n})}let uA={quiet:`${sd.CALL_IDLE.hangUpMs/1e3}s of quiet`,hungUp:"Thursday hung up",closed:"Live closed the call",dropped:"the connection dropped"};function uR({status:e,idleLeft:t,since:n,ended:r,behind:i,wakePhrase:a,hotkeyLabel:o}){let l,u,c="connecting"===e||"ending"===e,d="idle"!==e&&!c;return c?(u=e,l=(0,s.jsx)(A.ShinyText,{text:"connecting"===e?"Connecting…":"Ending…",className:"text-muted-foreground/70"})):d&&null!==t?(u="quiet",l=`Quiet — ending in ${t}s. Say anything to stay.`):d?(u=i?"behind":"live",l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"Tap Thursday to end"}),(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("kbd",{className:uS,children:"↓"}),(0,s.jsx)("span",{children:"back to now"})]}):(0,s.jsx)(uD,{since:n})]})):r?(u=`ended:${r}`,l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{children:["Ended — ",uA[r]]}),(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,s.jsx)("span",{children:"Tap to call again"})]})):a?(u=`wake:${a}`,l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"Tap Thursday, or say"}),(0,s.jsx)(uE,{phrase:a}),(0,s.jsx)(uI,{})]})):o?(u=`key:${o}`,l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{children:"Tap Thursday, or press"}),(0,s.jsx)("kbd",{className:uS,children:o}),(0,s.jsx)(uI,{})]})):(u="tap",l=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ii,{as:"span",text:"Tap Thursday to talk",loop:!1,typingSpeed:95,initialDelay:400,cursorCharacter:"▌",cursorClassName:"ml-0.5 text-muted-foreground/50",className:"tracking-normal"}),(0,s.jsx)("span",{className:"flex animate-in items-center gap-1.5 delay-[2600ms] duration-700 fill-mode-backwards fade-in",children:(0,s.jsx)(uI,{})})]})),(0,s.jsx)("span",{className:"flex h-6 animate-in items-center gap-1.5 font-mono text-[11px] text-muted-foreground fade-in duration-700",children:l},u)}function uI(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-muted-foreground/40",children:"·"}),(0,s.jsx)("kbd",{className:uS,children:"/"}),(0,s.jsx)("span",{children:"to write"})]})}function uL({open:e,onOpen:t,onClose:n}){return e?(0,s.jsxs)("div",{className:"w-[min(26rem,84vw)] animate-in space-y-2.5 rounded-2xl bg-background/80 p-3 ring-1 ring-border/60 backdrop-blur-md fade-in duration-300",children:[(0,s.jsxs)("div",{className:"flex h-6 items-center justify-between gap-2 pl-0.5",children:[(0,s.jsx)("span",{className:"text-[13px] font-medium",children:"Paste your OpenAI API key"}),(0,s.jsx)(j.Button,{type:"button",size:"icon",variant:"ghost","aria-label":"Not now",onClick:n,className:"-my-1 size-6",children:(0,s.jsx)(_.X,{className:"size-3.5"})})]}),(0,s.jsx)(ah.VoiceKeys,{dense:!0,plain:!0,autoFocus:!0,onSaved:()=>ad()}),(0,s.jsx)(ah.GetKeyLink,{})]}):(0,s.jsxs)("span",{className:"flex animate-in items-center gap-2 rounded-full bg-muted/60 py-1 pr-1 pl-1.5 ring-1 ring-border/60 fade-in duration-500",children:[(0,s.jsxs)("span",{className:"relative flex size-6 shrink-0 items-center justify-center",children:[(0,s.jsx)(sm.BotMark,{size:24,seed:sp.DEFAULT_BOT.name,color:sp.DEFAULT_BOT.icon?.color,shape:sp.DEFAULT_BOT.icon?.shape,outline:sp.DEFAULT_BOT.icon?.outline,notify:!1}),(0,s.jsx)(g,{className:"absolute -right-0.5 -bottom-0.5 size-2.5 rounded-full bg-muted text-muted-foreground"})]}),(0,s.jsx)("span",{className:"text-[13px] text-muted-foreground break-keep",children:"Calls need one speech key. Everything else here already works."}),(0,s.jsx)(j.Button,{size:"sm",variant:"brand",onClick:t,className:"h-7 px-3.5",children:"Add key"})]})}function uP({title:e}){var t;let n=e?`Thinking about ${t=e,/^\p{Lu}\p{Lu}/u.test(t)?t:t.charAt(0).toLowerCase()+t.slice(1)}`:"Thinking…";return(0,s.jsx)("span",{className:"flex max-w-full items-center text-[13px] leading-5",children:(0,s.jsx)(A.ShinyText,{text:n,className:"min-w-0 animate-in truncate fade-in duration-300"},n)})}function uD({since:e}){let[t,n]=(0,w.useState)(()=>Date.now());if((0,w.useEffect)(()=>{if(null===e)return;let t=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(t)},[e]),null===e)return null;let r=Math.max(0,Math.floor((t-e)/1e3)),i=String(Math.floor(r/60)).padStart(2,"0"),a=String(r%60).padStart(2,"0");return(0,s.jsxs)("span",{className:"tabular-nums",children:[i,":",a]})}e.s(["Ear",0,ux,"Thursday",0,function({ready:e}){let t=function(){let[e,t]=(0,w.useState)(null),n=(0,w.useRef)(e);n.current=e;let[r]=(0,ok.useServerAction)(oM),{messages:i,sendMessage:s,regenerate:a,setMessages:o,status:l,stop:u,error:c,clearError:d}=(0,oy.useChat)({transport:oR}),h="submitted"===l||"streaming"===l,f=(0,w.useCallback)(()=>{let e=n.current;e&&(n.current=null,t(null),u(),o([]),d(),oE(e.callId).then(al.unwrapResult).finally(()=>(0,sb.revalidate)(k.queryKey.callHistory(null))))},[u,o,d]),p=(0,w.useRef)(f);p.current=f,(0,w.useEffect)(()=>()=>p.current(),[]);let m=(0,w.useCallback)(async e=>{let i=(0,ox.thursdaySettings)(),a=n.current;a||(n.current=a={...await r(i,oI()),at:Date.now()},t(a)),d(),s({text:e},{body:{callId:a.callId,settings:i,standing:a.standing,runsOn:oI()}})},[r,s,d]),g=(0,w.useCallback)(()=>{let e=n.current;e&&(d(),a({body:{callId:e.callId,settings:(0,ox.thursdaySettings)(),standing:e.standing,runsOn:oI()}}))},[a,d]),{data:x}=(0,sb.useServerRoute)(k.queryKey.threads),y=(0,w.useRef)(x);y.current=x;let v=(0,w.useRef)(Date.now()),b=(0,w.useRef)(null),[_,j]=(0,w.useState)(null),T=(0,w.useRef)(h);T.current=h,(0,w.useEffect)(()=>{v.current=Date.now();let e=b.current;if(h){e&&(e.began=!0);return}if(e&&!e.began)return;if(b.current=null,e&&c)for(let t of e.keys)oj.delete(t);if(e?.rows.length&&!c&&ow(e.rows).then(al.unwrapResult).catch(()=>{}),!_)return;let t=setTimeout(()=>j(null),2500);return()=>clearTimeout(t)},[h,c,_]);let N=null!==e;(0,w.useEffect)(()=>{if(!N)return;let e=setInterval(()=>{let e=n.current;if(!e||T.current||b.current||!y.current||Date.now()-v.current<sd.CALL_RELAY.quietMs)return;let t=oC(y.current).filter(e=>!oj.has(e.key)),r=t[0];if(!r)return;let i=t.filter(e=>e.kind===r.kind).slice(0,sd.CALL_RELAY.perTurn);for(let e of i)oj.add(e.key);b.current={keys:i.map(e=>e.key),rows:i.flatMap(e=>e.relayIds),began:!1},j((i.at(-1)??r).show),v.current=Date.now(),d();let a=i.map(e=>e.line);s({text:1===a.length?a[0]:`[${a.length} updates.]
14
-
15
- ${a.join("\n\n")}`,metadata:oA},{body:{callId:e.callId,settings:(0,ox.thursdaySettings)(),standing:e.standing,runsOn:oI()}})},1e3);return()=>clearInterval(e)},[N,s,d]);let C=i.at(-1)?.role==="assistant"?i.at(-1):null,E=C?.parts??[],M=E.at(-1),O=(0,w.useMemo)(()=>i.flatMap(e=>{if("system"===e.role||e.metadata?.relay===!0)return[];let t=e.parts.flatMap(e=>"text"===e.type?e.text:[]).join("\n\n").trim(),n="assistant"===e.role?(0,S.plainText)(t):t;return n?[{id:e.id,role:e.role,text:n}]:[]}),[i]),A=[...E].reverse().find(ov.isToolUIPart),R=A?.toolCallId??null,I=A?(0,ov.getToolName)(A):null,L=A?.state==="output-available"||A?.state==="output-error",P=A?.output,D=(0,w.useMemo)(()=>L&&I===ob.TOOL_NAMES.web_search?(0,oO.searchSourcesOf)(JSON.stringify(P??null)):[],[L,I,P]),z=P?.action?.query,F=JSON.stringify({..."string"==typeof z?{query:z}:{},...A?.input??{}}),B=I?(0,oO.toolBot)(I,F,y.current,void 0===P?void 0:JSON.stringify(P)):null,$=I?(0,oO.toolLine)(I,F,B):null,q=M?.type==="text",U=(0,w.useMemo)(()=>R&&I&&(!q||D.length)?{id:R,name:I,line:$,bot:B,done:L,...D.length?{sources:D}:{}}:null,[R,I,$,B,L,D,q]),[H,K]=(0,w.useState)(null),Y=U?.done&&!U.sources?U.id:null;(0,w.useEffect)(()=>{if(!Y)return;let e=setTimeout(()=>K(Y),2500);return()=>clearTimeout(e)},[Y]);let V=U&&U.id!==H?U:_,W=!!h&&M?.type!=="text"&&(!U||!!U.done),[G,X]=(0,w.useState)(null);(0,w.useEffect)(()=>{X(W?Date.now():null)},[W]);let J=[...E].reverse().find(e=>"reasoning"===e.type),Q=W&&J?.type==="reasoning"&&/^\s*\*\*(.+?)\*\*/.exec(J.text)?.[1]?.trim()||null,Z=e?h?M?.type==="text"?"speaking":U&&!U.done&&U.name===ob.TOOL_NAMES.thread_start?"delegating":"working":"listening":"idle";return{on:null!==e,busy:h,status:Z,messages:O,tool:V,thinkingSince:G,thinkingTitle:Q,since:e?.at??null,error:c?c.message:null,say:m,again:g,end:f}}(),{status:n,failed:r,messages:i,tool:a,thinkingSince:o,thinkingTitle:l,ended:u,faceWord:c,idleLeft:d,since:h,call:f,ringing:p,decline:m,getSpectrum:g,getMicSpectrum:x,wakePhrase:y,hotkey:v}=function(e=!1){let t,n,r=(0,w.useRef)(null),i=(0,w.useRef)(null),s=(0,w.useRef)(null),[a,o]=(0,w.useState)("idle"),[l,u]=(0,w.useState)(!1),c=(0,w.useRef)(null),d=(0,w.useCallback)(e=>{c.current&&clearTimeout(c.current),c.current=e?setTimeout(()=>u(!1),6e3):null,u(e)},[]),[h,f]=(0,w.useState)([]),[p,m]=(0,w.useState)(null),[g,x]=(0,w.useState)(null),[y,v]=(0,w.useState)(null),[b,_]=(0,w.useState)(null),[j,T]=(0,w.useState)(null),[N,C]=(0,w.useState)(null),[E,M]=(0,w.useState)(null);(0,w.useEffect)(()=>M(lC()),[]);let O=(0,w.useRef)(null),A=(0,w.useRef)(null),R=(0,w.useRef)({on:!1,spoke:!1,giveUp:null}),I=(0,w.useRef)(null),L=(0,w.useRef)(0),P=(0,w.useRef)(null),D=(0,w.useRef)(!1),z=(0,w.useRef)(null),F=(0,w.useRef)(null),B=(0,w.useRef)(oj),$=(0,w.useRef)(new Set),q=(0,w.useRef)([]),U=(0,w.useRef)([]),H=(0,w.useRef)(0),K=(0,w.useRef)(null),Y=(0,w.useRef)(0),V=(0,w.useRef)(!1),W=(0,w.useRef)(!1),G=(0,w.useRef)(void 0),X=(0,w.useRef)(null),J=X.current??=(t=[],n=null,{send(e){n?n(e):t.push(e)},open(e){n=e;let r=t;for(let n of(t=[],r))e(n)},close(){n=null},clear(){let e=t;return t=[],e}}),Q=(0,w.useRef)(!1),Z=(0,w.useRef)(!1),ee=(0,w.useRef)(!1),et=(0,w.useRef)(0),en=(0,w.useCallback)(e=>{P.current&&clearTimeout(P.current),D.current=!1;let t=(0,oO.toolBot)(e.name,e.arguments,G.current);m({id:e.id,name:e.name,line:(0,oO.toolLine)(e.name,e.arguments,t),bot:t,done:!1})},[]),er=(0,w.useCallback)((e,t)=>{let n=(0,oO.toolBot)(e.name,e.arguments,G.current,t);n&&m(t=>t?.id===e.id&&t.bot!==n?{...t,bot:n,line:(0,oO.toolLine)(e.name,e.arguments,n)}:t)},[]),ei=(0,w.useCallback)(e=>{P.current&&clearTimeout(P.current),D.current=!0,m({...e,done:!1})},[]),es=(0,w.useCallback)(e=>{m(t=>t?.id===e?{...t,done:!0}:t),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>m(e=>e?.done?null:e),2500)},[]),ea=(0,w.useCallback)(()=>{if(R.current.giveUp&&clearTimeout(R.current.giveUp),R.current.spoke){for(let e of q.current)$.current.delete(e);let e=U.current;e.length&&ow(e).then(al.unwrapResult).catch(e=>ao.toast.add({type:"error",title:"Could not record relay delivery",description:(0,S.errorToString)(e)}))}U.current=[],q.current=[],R.current={on:!1,spoke:!1,giveUp:null},D.current&&(D.current=!1,m(e=>e?.kind==="relay"?{...e,done:!0}:e),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>m(e=>e?.kind==="relay"?null:e),5e3))},[]),eo=(0,w.useCallback)(()=>{R.current.giveUp&&clearTimeout(R.current.giveUp),R.current={on:!0,spoke:!1,giveUp:setTimeout(ea,sd.CALL_RELAY.readMs)}},[ea]),el=(0,w.useCallback)(e=>{O.current=e,T(e),C(null)},[]),eu=(0,w.useCallback)((e,t)=>{let n=()=>{A.current&&clearTimeout(A.current),A.current=null};if(t){n(),null!==O.current&&el(null);return}if(e){n(),null===O.current&&el(Date.now());return}null===O.current||A.current||(A.current=setTimeout(()=>{A.current=null,el(null)},6e3))},[el]),ec=(0,w.useCallback)(()=>{let e=r.current,t=G.current;if(!e||!t||R.current.on||W.current||null!==O.current||K.current)return;let n=V.current;if(V.current=!1,!n&&Date.now()-Y.current<sd.CALL_RELAY.quietMs)return;let i=oC(t).filter(e=>!B.current.has(e.key)),s=i[0];if(!s)return;let a=i.filter(e=>e.kind===s.kind).slice(0,sd.CALL_RELAY.perTurn),o=a.map(e=>e.line);for(let e of a)B.current.add(e.key),$.current.add(e.key);s.key.startsWith("done:")&&M(lM()),eo(),q.current=a.map(e=>e.key),U.current=a.flatMap(e=>e.relayIds),ei((a.at(-1)??s).show),e.append("commentary",1===o.length?o.join(""):`[${o.length} updates.]
16
-
17
- ${o.join("\n\n")}`).then(e=>{e||(U.current=[],ea())})},[eo,ea,ei]),ed=(0,w.useRef)(a);(0,w.useEffect)(()=>{ed.current=a},[a]);let eh=(0,w.useRef)("listening"),ef=(0,w.useRef)(null),ep=(0,w.useCallback)(()=>{ef.current&&clearTimeout(ef.current),ef.current=null},[]),em=(0,w.useCallback)(e=>{ed.current=e,o(e)},[]),eg=(0,w.useCallback)(e=>{eh.current=e;let t=ed.current;if("speaking"===e){ep(),em(e);return}let n="working"===e||"delegating"===e;if(n&&("working"===t||"delegating"===t)){ep(),em(e);return}n||"listening"!==t?ef.current||(ef.current=setTimeout(()=>{ef.current=null,em(eh.current)},n?800:600)):ep()},[ep,em]),ex="idle"!==a&&"connecting"!==a&&"ending"!==a,{data:ey}=(0,sb.useServerRoute)(k.queryKey.threads,{refreshInterval:3e4});(0,sg.useAppEvent)({hello:()=>{(0,sb.revalidateAll)()},threads:()=>void(0,sb.revalidate)(k.queryKey.threads),routines:()=>void(0,sb.revalidate)(k.queryKey.routines),memory:()=>void(0,sb.revalidate)(k.queryKey.memory),mcp:()=>{(0,sb.revalidate)(k.queryKey.mcp),(0,sb.revalidate)(k.queryKey.mcpTools)},config:()=>{(0,sb.revalidate)(k.queryKey.config),(0,sb.revalidate)(k.queryKey.llmModel)}});let{data:ev}=(0,sb.useServerRoute)(k.queryKey.bot);(0,w.useEffect)(()=>{ey&&s_.botThreads.sync(ey,ev)},[ey,ev]),(0,w.useEffect)(()=>{G.current=ey},[ey]);let eb=function({threads:e,resting:t,writing:n}){let r=(0,w.useRef)(Date.now()),[i,s]=(0,w.useState)([]),[a,o]=(0,w.useState)(null),l=i.length>0,u=(0,ox.useThursdayStore)(e=>e.callBack);(0,w.useEffect)(()=>{if(!e)return;let i=new Set(e.filter(e=>{let t,n;return t=e,"off"!==(n=u)&&!t.seen&&!t.ask?.auto&&(t.room.questions.length>0||"any"===n&&"running"!==t.status)}).map(e=>e.id));if(s(e=>e.every(e=>i.has(e))?e:e.filter(e=>i.has(e))),!t||n)return;let a=r.current,l=e.filter(e=>i.has(e.id)&&(0,sy.toDate)(e.updatedAt).getTime()>a);l.length&&(r.current=Date.now(),o(null),s(e=>[...e,...l.map(e=>e.id).filter(t=>!e.includes(t))]))},[e,u,t,n]),(0,w.useEffect)(()=>{n?(s([]),o(null)):r.current=Date.now()},[n]);let c=(0,w.useCallback)(()=>{s([]),o(null)},[]);(0,w.useEffect)(()=>{if(!l)return;let e=null===a?setTimeout(()=>o(Date.now()),sd.CALL_BACK.ringMs):null,t=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),c())};return window.addEventListener("keydown",t),()=>{e&&clearTimeout(e),window.removeEventListener("keydown",t)}},[l,a,c]),(0,w.useEffect)(()=>{let e,t,n,r;if(!l||null!==a)return;let i=(e=null,t=null,n=(e,t)=>{let n=e.createGain();for(let r of(n.gain.setValueAtTime(0,t),n.gain.linearRampToValueAtTime(.05,t+.03),n.gain.setValueAtTime(.05,t+.34-.08),n.gain.linearRampToValueAtTime(0,t+.34),n.connect(e.destination),lI)){let i=e.createOscillator();i.type="sine",i.frequency.value=r,i.connect(n),i.start(t),i.stop(t+.34)}},r=()=>{if(!e||"running"!==e.state)return;let t=e.currentTime+.02;n(e,t),n(e,t+.34+.16)},{start(){!t&&"u">typeof AudioContext&&((e??=new AudioContext).resume().then(r).catch(()=>{}),t=setInterval(r,2600))},stop(){t&&clearInterval(t),t=null,e?.close().catch(()=>{}),e=null}});return i.start(),()=>i.stop()},[l,a]);let d=(0,w.useMemo)(()=>{let[t,...n]=i.flatMap(t=>{let n=e?.find(e=>e.id===t);if(!n)return[];let r=n.room.questions[0];return[{id:n.id,bot:r?.bot??n.bot,kind:r?"question":"done"===n.status?"done":"stopped",label:n.label,text:r?.text??n.outcome??n.ask?.question??n.label,options:r?.options??[]}]});return t?{first:t,others:n,missedAt:a}:null},[i,e,a]);return(0,w.useEffect)(()=>{s_.ringingThreads.set(i)},[i]),{ringing:d,isRinging:l,ringingFor:i,answered:(0,w.useCallback)(()=>{s([]),o(null)},[]),settle:(0,w.useCallback)(()=>{r.current=Date.now()},[]),decline:c}}({threads:ey,resting:"idle"===a,writing:e}),{answered:e_,settle:ew}=eb;(0,w.useEffect)(()=>s_.screenActs.subscribe(e=>{Q.current&&J.send("answered"===e.kind?`The user sent a message on screen to ${e.recipient??"the coordinator"} in thread "${e.label}" (${e.id})${e.replyTo?`, replying to ${e.replyTo}`:""}: ${e.answer}. It has reached that participant.`:"stopped"===e.kind?`The user stopped thread "${e.label}" on screen. It is no longer running.`:`The user put ${1===e.paths.length?"a file":`${e.paths.length} files`} down on screen, kept on this computer at ${e.paths.join(", ")}.`)}),[J]);let ek=(0,w.useCallback)(async(e=null)=>{if(ee.current)return;ee.current=!0,K.current&&clearInterval(K.current),K.current=null,et.current+=1;let t=r.current,n=F.current;for(let e of(r.current=null,F.current=null,Q.current=!1,Z.current=!1,V.current=!1,$.current))B.current.delete(e);$.current.clear(),J.close(),J.clear(),z.current?.abort(),z.current=null,ea(),P.current&&clearTimeout(P.current),ep(),ew(),v(null),x(null),o(t?"ending":"idle"),t&&M(lE()),f([]),m(null),el(null),A.current&&clearTimeout(A.current),A.current=null,D.current=!1,await t?.close();let i=I.current;I.current=null,ee.current=!1,o("idle"),t&&_(e),n&&oE(n,i),t&&s.current&&(s.current.currentTime=0,s.current.play().catch(()=>{}))},[J,ep,ea,el]);(0,w.useEffect)(()=>()=>{et.current+=1,r.current?.close(),r.current=null;let e=F.current;F.current=null,Q.current=!1,Z.current=!1,e&&oE(e),z.current?.abort(),z.current=null,P.current&&clearTimeout(P.current),ef.current&&clearTimeout(ef.current),R.current.giveUp&&clearTimeout(R.current.giveUp),A.current&&clearTimeout(A.current),c.current&&clearTimeout(c.current),K.current&&clearInterval(K.current)},[]);let ej=(0,w.useCallback)(()=>{if(K.current)return;let e=Date.now();K.current=setInterval(()=>{let t=Date.now();((H.current>e-sd.CALL_END.unsaidMs?t-Math.max(H.current,e)>=sd.CALL_END.quietMs:t-e>=sd.CALL_END.unsaidMs)||t-e>=sd.CALL_END.maxMs)&&ek("hungUp")},100)},[ek]);(0,w.useEffect)(()=>{if(!ex)return;L.current=Date.now();let e=setInterval(()=>{if(!r.current)return;let e=sd.CALL_IDLE.hangUpMs-(Date.now()-L.current);v(e<=sd.CALL_IDLE.warnMs?Math.max(0,Math.ceil(e/1e3)):null),e<=0&&ek("quiet")},1e3);return()=>clearInterval(e)},[ex,ek]),(0,w.useEffect)(()=>{if(!ex)return;let e=setInterval(ec,1e3);return()=>clearInterval(e)},[ex,ec]);let eT=(0,w.useCallback)(async()=>{let e=eb.isRinging;if(Z.current||ee.current)return;if(Q.current||"idle"!==a)return ek();e_(),oK(),o("connecting"),_(null),d(!1),Z.current=!0,Q.current=!0,I.current=null,J.clear(),et.current+=1;let t=et.current,n=()=>Q.current&&et.current===t;try{i.current??=(0,ly.createAudioTap)(),function(e){if("suspended"!==e.state||lP)return;lP=!0;let t=()=>{lP=!1,window.removeEventListener("pointerdown",t),window.removeEventListener("keydown",t),e.resume().catch(()=>{})};window.addEventListener("pointerdown",t),window.addEventListener("keydown",t),ao.toast.add({type:"warning",title:"Tap anywhere to hear her",description:"This call opened on its own, so the browser is holding the audio."})}(i.current.open().context);let t=new Audio("/sounds/start_voice.ogg");s.current??=new Audio("/sounds/end_voice.ogg");let a=(0,ox.thursdaySettings)(),o=new AbortController;z.current=o;let l={failures:0},u={failures:0},c={callId:"",last:null,opening:null,standing:null},h=new Map,p=new Map,g=null,y=e=>{let t={query:e.query,sources:e.sources};return lz(l,()=>lR(c.callId,[{id:e.row,role:"tool",tool:ob.TOOL_NAMES.web_search,text:JSON.stringify(t),seq:Math.max(0,Math.round(e.seq)),fragments:null}])),!!e.sources.length&&g===e.id&&(P.current&&clearTimeout(P.current),m(n=>n&&n.id!==e.id?n:{id:e.id,name:ob.TOOL_NAMES.web_search,line:(0,oO.toolLine)(ob.TOOL_NAMES.web_search,JSON.stringify(t)),done:!0,bot:null,sources:e.sources}),!0)},v=await lg({initialize:async t=>{let r=(0,al.unwrapResult)(await lO(a,t,e));if(!n())throw oE(r.callId),Error("The call closed during startup.");return F.current=r.callId,c.callId=r.callId,c.last=r.last,c.opening=r.opening,c.standing=r.standing,r.sdp},audio:i.current,on:{runTool:async e=>{if(e.name===ob.TOOL_NAMES.end_call)return ej(),"Ending the call.";if(e.name===ob.TOOL_NAMES.emote){let{word:t,reply:n}=function(e){let t="";try{let n=JSON.parse(e);n&&"object"==typeof n&&"text"in n&&(t=String(n.text??"").trim())}catch{t=""}let n=Array.from(t).length;if(!n)return{word:null,reply:"Nothing was shown: text is empty."};if(n>lv.FACE_WORD_MAX)return{word:null,reply:`Too long: ${n} characters, ${lv.FACE_WORD_MAX} at most. Nothing was shown.`};let r=(0,lv.undrawable)(t);return r?{word:null,reply:`Cannot draw "${r}"; use only the characters \`text\` lists. Nothing was shown.`}:{word:t.toUpperCase(),reply:"Shown."}}(e.arguments);return t&&M({text:t,at:Date.now()}),n}en(e);let t=e.name===ob.TOOL_NAMES.web_search;t&&(g=e.id);let n=!1;try{let r=await oL(c.callId,e,a.webSearch,o.signal);return er(e,r),t&&(n=y({id:e.id,row:e.item??e.id,query:(0,oO.searchQueryOf)(e.arguments),sources:(0,oO.searchSourcesOf)(r),seq:0})),r}finally{n||es(e.id)}},search:e=>{if(!e.done){g=e.id,en({id:e.id,name:ob.TOOL_NAMES.web_search,arguments:JSON.stringify({query:e.query})});return}let t={id:e.id,row:e.id,query:e.query,sources:e.sources,seq:e.seq};p.set(e.responseId,t),y(t)||es(t.id)},cited:(e,t)=>{let n=p.get(e);if(!n)return;let r=new Set(n.sources.map(e=>e.url));n.sources=[...n.sources.map(e=>t.find(t=>t.url===e.url)??e),...t.filter(e=>!r.has(e.url))],y(n)},reasoning:e=>{let t=/^\s*\*\*(.+?)\*\*/.exec(e.text)?.[1]?.trim();t&&C(t),lz(u,()=>lA(c.callId,{...e,seq:Math.max(0,Math.round(e.seq))}),"The backend's thinking is not being saved")},turn:e=>{let t="tool"===e.role?"":lD(e.text),n=!!t&&t!==lD(h.get(e.id)?.text??"");if(n&&(Y.current=Date.now()),n&&"user"===e.role&&(L.current=Date.now(),g)){let e=g;g=null,m(t=>t?.id===e?null:t)}"tool"!==e.role&&F.current===c.callId&&(h.set(e.id,{seq:e.seq,id:e.id,role:e.role,text:e.text}),f([...h.values()].sort((e,t)=>e.seq-t.seq).slice(-24))),e.done&&lz(l,()=>lR(c.callId,[{id:e.id,role:e.role,tool:e.tool,text:e.text,seq:Math.max(0,Math.round(e.seq)),fragments:e.fragments??null}]))},activity:e=>{var t;eg((t=e).speaking?"speaking":t.working||t.tools.length?t.tools.includes(ob.TOOL_NAMES.thread_start)?"delegating":"working":"listening");let n=e.working||e.tools.length>0;W.current=n,eu(n,e.speaking),e.speaking&&(H.current=Date.now()),(e.speaking&&!R.current.on||e.working||e.tools.length)&&(L.current=Date.now()),R.current.on&&(e.speaking?R.current.spoke=!0:R.current.spoke&&ea())},finalized:e=>{I.current=e},warn:e=>ao.toast.add({type:"warning",title:"Call warning",description:e}),failed:e=>{ao.toast.add({type:"error",title:"Call failed",description:e}),d(!0),ek(I.current?"closed":"dropped")}}});if(!n())return void await v.close();r.current=v,Z.current=!1,V.current=e,J.open(e=>void v.append("thinking",e)),Y.current=Date.now(),c.last&&v.append("thinking",c.last),c.opening&&(eo(),v.append("instructions",c.opening).then(e=>{e||ea()})),c.standing&&v.append("thinking",c.standing),em("listening"),x(Date.now()),t.play().catch(()=>{})}catch(e){if(n()&&(ao.toast.add({type:"error",title:"Could not start the call",description:(0,S.errorToString)(e)}),d(!0)),et.current!==t)return;F.current&&oE(F.current),F.current=null,Z.current=!1,Q.current=!1,z.current=null,J.clear(),o("idle")}},[a,ek,en,er,es,eg,em,J,eo,ea,eu,d,ej,eb.isRinging,eb.ringingFor,e_]);(0,w.useEffect)(()=>{if(!b)return;let e=setTimeout(()=>_(null),sd.CALL_ENDED_MS);return()=>clearTimeout(e)},[b]);let eS=(0,w.useCallback)(()=>i.current?.read()??lL,[]),eN=(0,w.useCallback)(()=>i.current?.readMic()??lL,[]),eC=(0,ox.useThursdayStore)(e=>e.wake),[eE,eM]=(0,w.useState)(!1),eO=lj();(0,w.useEffect)(()=>lk.onPlace(()=>void eT()),[eT]),oZ({enabled:"idle"===a&&eC.enabled&&!eE&&!eO,phrases:[eC.phrase],onWake:()=>void eT(),onError:e=>{eM(!0),ao.toast.add({type:"error",title:"Wake word off",description:e})}});let eA=(0,ox.useThursdayStore)(e=>e.hotkey),eR="connecting"===a||"ending"===a;return(0,oG.useHotkey)({enabled:eA.enabled&&!eR&&!eO,combo:eA.enabled&&(0,oG.isCombo)(eA.combo)?eA.combo:null,onPress:()=>void eT()}),{status:a,failed:l,messages:h,tool:p,ended:b,thinkingSince:j,thinkingTitle:N,faceWord:E,idleLeft:y,since:g,call:eT,ringing:eb.ringing,decline:eb.decline,getSpectrum:eS,getMicSpectrum:eN,wakePhrase:eC.enabled&&!eE?eC.phrase:null,hotkey:eA.enabled&&(0,oG.isCombo)(eA.combo)?eA.combo:null}}(t.on),b=(0,oG.useHotkeyLabel)(v),_=(0,op.useThursdayFace)(),j=(0,ox.useThursdayStore)(e=>e.captionView),{data:T}=(0,sb.useServerRoute)(k.queryKey.config),N=T?(0,af.isConfigSet)(T,sh.LIVE_PROVIDER.apiKeyName):e,C="idle"!==n,E=t.end;(0,w.useEffect)(()=>{C&&t.on&&E()},[C,t.on,E]);let M=t.on&&!C,O=(0,ox.useThursdayStore)(e=>e.textModel),A=(0,ox.useThursdayStore)(e=>e.backendModel),R=(0,w.useMemo)(()=>{let e=e=>(0,af.isConfigSet)(T,e),n=(0,og.textCallRunsOn)(e),r=O&&e(sf.TEXT_MODEL_PROVIDERS[O.provider].apiKeyName)?O:n?{provider:n,model:A}:null;return{on:M,busy:t.busy,error:t.error,say:t.say,again:t.again,end:t.end,runsOn:r,fallback:r?.provider!=="openai"&&e(sf.TEXT_MODEL_PROVIDERS.openai.apiKeyName)?{provider:"openai",model:A}:null}},[M,t.busy,t.error,t.say,t.again,t.end,T,O,A]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(lQ,{live:"idle"!==n,ringing:null!==p}),(0,s.jsx)(ul,{status:M?t.status:n,failed:M?null!==t.error:r,messages:M?t.messages:i,tool:M?t.tool:a,thinkingSince:M?t.thinkingSince:o,thinkingTitle:M?t.thinkingTitle:l,ended:u,faceWord:c,onTap:f,ringing:N?p:null,onDecline:m,wakePhrase:y,hotkeyLabel:b,idleLeft:d,since:h,getSpectrum:M?om:g,getMicSpectrum:x,face:_,captionView:j,callable:N,written:C?null:R})]})}],692888)},379227,(e,t,n)=>{var r;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/next/dist/compiled/tty-browserify/"),(r={}).isatty=function(){return!1},r.ReadStream=function(){throw Error("tty.ReadStream is not implemented")},r.WriteStream=function(){throw Error("tty.WriteStream is not implemented")},t.exports=r},90317,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r={bindSnapshot:function(){return u},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return c}};for(var i in r)Object.defineProperty(n,i,{enumerable:!0,get:r[i]});let s=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class a{disable(){throw s}getStore(){}run(){throw s}exit(){throw s}enterWith(){throw s}static bind(e){return e}}let o="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return o?new o:new a}function u(e){return o?o.bind(e):a.bind(e)}function c(){return o?o.snapshot():function(e,...t){return e(...t)}}},242344,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,e.r(90317).createAsyncLocalStorage)()},563599,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=e.r(242344)},309885,(e,t,n)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return r}})},667585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return i}});let r=e.r(132061);function i({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},652157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return l}});let r=e.r(843476),i=e.r(174080),s=e.r(563599),a=e.r(309885),o=e.r(543369);function l({moduleIds:e}){if("u">typeof window)return null;let t=s.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;n.push(...e)}}if(0===n.length)return null;let u=(0,o.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,a.encodeURIPath)(e)}${u}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,i.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},869093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return u}});let r=e.r(843476),i=e.r(271645),s=e.r(667585),a=e.r(652157);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},u=function(e){let t={...l,...e},n=(0,i.lazy)(()=>t.loader().then(o)),u=t.loading;function c(e){let o=u?(0,r.jsx)(u,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,c=l?i.Suspense:i.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(a.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(c,{...l?{fallback:o}:{},children:d})}return c.displayName="LoadableComponent",c}},770703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return i}});let r=e.r(555682)._(e.r(869093));function i(e,t){let n={};"function"==typeof e&&(n.loader=e);let i={...n,...t};return(0,r.default)({...i,modules:i.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},618566,(e,t,n)=>{t.exports=e.r(976562)}]);