@vellumai/web 0.11.4-staging.3 → 0.11.4-staging.4

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 (304) hide show
  1. package/dist/assets/{Trans-BUsRawhS.js → Trans-FBE1EuwL.js} +1 -1
  2. package/dist/assets/{access-Cngxal_O.js → access-D0krXly2.js} +1 -1
  3. package/dist/assets/account-DEWe1CJv.js +1 -0
  4. package/dist/assets/{account-page-IVZcGHZy.js → account-page-Df1VB34_.js} +1 -1
  5. package/dist/assets/{account-shell-DdH2Ze4T.js → account-shell-Dk4m-iaE.js} +1 -1
  6. package/dist/assets/{acp-run-detail-panel-UjpE_MSy.js → acp-run-detail-panel-DsqMAPE4.js} +1 -1
  7. package/dist/assets/{activity-steps-panel-ChM6OAY8.js → activity-steps-panel-C9z9FMmK.js} +1 -1
  8. package/dist/assets/{add-credits-modal-ByR0kDly.js → add-credits-modal-RIAYgbOT.js} +1 -1
  9. package/dist/assets/{ai-page-BmOCqfyq.js → ai-page-CI4LZXTY.js} +1 -1
  10. package/dist/assets/api-BjYAXdCk.js +1 -0
  11. package/dist/assets/{api-CQ3nejmH.js → api-Cx3i50oG.js} +1 -1
  12. package/dist/assets/{api-key-screen-BnQoBDlm.js → api-key-screen-BKFAcyqU.js} +1 -1
  13. package/dist/assets/{app-card--MsNli_3.js → app-card-CjRGDYCX.js} +1 -1
  14. package/dist/assets/{assistant-status-panel-BkuUZfnZ.js → assistant-status-panel-BkLYzQAL.js} +1 -1
  15. package/dist/assets/{auth-store-DDMY1UvK.js → auth-store-CVtcHK0b.js} +2 -2
  16. package/dist/assets/auth-welcome-screen-Pw3qXxi5.js +1 -0
  17. package/dist/assets/{avatar-random-D1LU-C7V.js → avatar-random-B5F8Cp2E.js} +1 -1
  18. package/dist/assets/{background-task-detail-panel-DQeMsdpK.js → background-task-detail-panel-DtJ1ZolD.js} +1 -1
  19. package/dist/assets/{billing-page-BU6n42tO.js → billing-page-CmVjD4bw.js} +3 -3
  20. package/dist/assets/{bookmarks-page-DIzvqlcG.js → bookmarks-page-DUbnEAgS.js} +1 -1
  21. package/dist/assets/{browser-Nd92UvKg.js → browser-Ca2R8csw.js} +2 -2
  22. package/dist/assets/{build-state-BZ5ujToI.js → build-state-laR44jYU.js} +1 -1
  23. package/dist/assets/channels-page-route-sLLh-p2k.js +9 -0
  24. package/dist/assets/{chat-C0-tqEYA.js → chat-1xy90pMn.js} +1 -1
  25. package/dist/assets/{chat-BWQujip4.js → chat-CHVUM3s0.js} +1 -1
  26. package/dist/assets/{chat-markdown-message-mIiMHNFn.js → chat-markdown-message-CtLdsT2K.js} +1 -1
  27. package/dist/assets/{checkout-continuation-UVo_MUjH.js → checkout-continuation-BvY4Kjz7.js} +1 -1
  28. package/dist/assets/{checkout-page-C1hWo56h.js → checkout-page-CWRkiEj1.js} +1 -1
  29. package/dist/assets/checkout-return-target-_Y86sfo0.js +1 -0
  30. package/dist/assets/{client-perf-DHnnpVkx.js → client-perf-BZu5XQCP.js} +1 -1
  31. package/dist/assets/{command-palette-C6fyPEFS.js → command-palette-B6PZe9A0.js} +1 -1
  32. package/dist/assets/command-palette-window-page-BYkkAV88.js +1 -0
  33. package/dist/assets/{community-page-DK1RRzQb.js → community-page-Dd84pjdI.js} +1 -1
  34. package/dist/assets/companion-surface-CZHv2avR.js +1 -0
  35. package/dist/assets/companion-surface-page-BvDSOFVH.js +1 -0
  36. package/dist/assets/{composer-settings-Bs2Ux46E.js → composer-settings-DBAb6W2i.js} +1 -1
  37. package/dist/assets/{connect-page-DcyvGKph.js → connect-page-DiO1EqEC.js} +1 -1
  38. package/dist/assets/{consent-controls-BqSz1Rrx.js → consent-controls-B_zCicqo.js} +1 -1
  39. package/dist/assets/{contacts-page-route--H1bhesC.js → contacts-page-route-fUfbhwZ5.js} +1 -1
  40. package/dist/assets/{conversation-cache-C3KMXxZQ.js → conversation-cache-qk0nNm6Q.js} +1 -1
  41. package/dist/assets/{conversation-navigation-DQEOhOXf.js → conversation-navigation-B_4jZ9Z2.js} +1 -1
  42. package/dist/assets/{conversation-queries-Crrs0Ih6.js → conversation-queries-M4Inozp_.js} +1 -1
  43. package/dist/assets/{conversation-selection-BFTHfyYb.js → conversation-selection-4ubh2ui-.js} +1 -1
  44. package/dist/assets/{credential-entry-page-DNW0ZIUD.js → credential-entry-page--HYBfvoW.js} +1 -1
  45. package/dist/assets/{credentials-page-BUxLoFkv.js → credentials-page-C-e4DqWt.js} +1 -1
  46. package/dist/assets/{csv-preview-FnIpBtF1.js → csv-preview-T_KT_vef.js} +1 -1
  47. package/dist/assets/{debug-page-01b8L6vC.js → debug-page-Be5Y5TVM.js} +2 -2
  48. package/dist/assets/{deploy-dialogs-I_QAK81w.js → deploy-dialogs-CgicOESj.js} +1 -1
  49. package/dist/assets/{deploy-store-C-WH19q9.js → deploy-store-dyN183E8.js} +1 -1
  50. package/dist/assets/{desktop-voice-activity-CPOU-25i.js → desktop-voice-activity-D1BSf0I-.js} +1 -1
  51. package/dist/assets/{detail-card-BzCuPjtL.js → detail-card-Bqnvs6YE.js} +1 -1
  52. package/dist/assets/{detail-drawer-CYUmZIyK.js → detail-drawer-j2jaITAL.js} +1 -1
  53. package/dist/assets/{detail-shell-B1BZYIqh.js → detail-shell-D1UEZCzz.js} +1 -1
  54. package/dist/assets/{developer-page-DshJ0gl6.js → developer-page-DD8xa8mQ.js} +1 -1
  55. package/dist/assets/{diagnostics-BrWbafo7.js → diagnostics-CwFqcLv_.js} +1 -1
  56. package/dist/assets/{doctor-handoff-store-CX39mMuw.js → doctor-handoff-store-Cy96Na-O.js} +1 -1
  57. package/dist/assets/{document-viewer-container-Bb7omFZS.js → document-viewer-container-BMmSidmj.js} +2 -2
  58. package/dist/assets/{document-viewer-page-Cyul2rIj.js → document-viewer-page-tTTco75r.js} +1 -1
  59. package/dist/assets/{emails-page-CArz1548.js → emails-page-CJM4OS94.js} +1 -1
  60. package/dist/assets/{esm-DYyr0ITx.js → esm-BD6nxr-q.js} +2 -2
  61. package/dist/assets/{esm-DjphWBuP.js → esm-BaEdQNCe.js} +2 -2
  62. package/dist/assets/esm-CtKndoc9.js +2 -0
  63. package/dist/assets/{esm-CfdMbmKl.js → esm-DTIJZw37.js} +2 -2
  64. package/dist/assets/{esm-tSqvpvZa.js → esm-FpGTFn5W.js} +2 -2
  65. package/dist/assets/{esm-L7cqLUll.js → esm-kYXyJ2zw.js} +2 -2
  66. package/dist/assets/{esm-DbEwZ3Za.js → esm-nl105Ya0.js} +2 -2
  67. package/dist/assets/{external-anchor-DQhNmTOb.js → external-anchor-CLy6d_za.js} +1 -1
  68. package/dist/assets/feed-item-status-actions--CCeCtuw.js +1 -0
  69. package/dist/assets/file-markdown-C1rEGVrN.js +2 -0
  70. package/dist/assets/first-run-scope-DdSaiULx.js +1 -0
  71. package/dist/assets/format-usd-tespTIex.js +1 -0
  72. package/dist/assets/{funnel-events-BfR30ND5.js → funnel-events-BP3XPaB5.js} +1 -1
  73. package/dist/assets/general-page-Bi87XguF.js +1 -0
  74. package/dist/assets/{haptics-Sti0ZroX.js → haptics-D3hzTCtH.js} +2 -2
  75. package/dist/assets/{hatching-screen-DUCKM3qi.js → hatching-screen-DA0yyXD1.js} +1 -1
  76. package/dist/assets/home-page-route-BSoWksW0.js +1 -0
  77. package/dist/assets/{hosting-screen-By2Dt_ov.js → hosting-screen-cfhZ-ct7.js} +1 -1
  78. package/dist/assets/{i18n--HmJLuhM.js → i18n-C9hRT4Lf.js} +3 -3
  79. package/dist/assets/{identity-page-route-4IEB7D_s.js → identity-page-route-BjSsi8PM.js} +1 -1
  80. package/dist/assets/index-BmDctEOW.css +2 -0
  81. package/dist/assets/{index-CflMsKlP.js → index-I9kwAKzY.js} +3 -3
  82. package/dist/assets/{ingest-C3QOaKA5.js → ingest-DXklElaR.js} +1 -1
  83. package/dist/assets/{inspect-page-D3vuZY29.js → inspect-page-naqIziez.js} +3 -3
  84. package/dist/assets/{integrations-page-Ck4sUGfr.js → integrations-page-zrUmh2xn.js} +1 -1
  85. package/dist/assets/{intelligence-layout-2iu6OgCh.js → intelligence-layout-CXzIl0Vl.js} +1 -1
  86. package/dist/assets/{invalidate-memory-queries-CSQ9nfIN.js → invalidate-memory-queries-C4-KSsdB.js} +1 -1
  87. package/dist/assets/{latest-assistant-text-hKWwKxXi.js → latest-assistant-text-JCjtByys.js} +1 -1
  88. package/dist/assets/{library-detail-page-DcRn2wsJ.js → library-detail-page-CyWiXwb9.js} +1 -1
  89. package/dist/assets/{library-page-Db5Pstgx.js → library-page-CzcvMljL.js} +1 -1
  90. package/dist/assets/{local-runtime-upgrade-T5WFNI2L.js → local-runtime-upgrade-BkoG5uVr.js} +1 -1
  91. package/dist/assets/{login-flow-Bprf1KQp.js → login-flow-D6ivg6PM.js} +1 -1
  92. package/dist/assets/login-page-Dmpz0GgT.js +1 -0
  93. package/dist/assets/{logout-page-HF_SMBkj.js → logout-page-CI3LDcqG.js} +1 -1
  94. package/dist/assets/{logs-layout-CNyrG8d2.js → logs-layout-BHP-ADUq.js} +1 -1
  95. package/dist/assets/{markdown-preview-CYSaj1MV.js → markdown-preview-Dx8E021p.js} +1 -1
  96. package/dist/assets/{memory-page-route-DDdpEiCD.js → memory-page-route-qvBEERTa.js} +1 -1
  97. package/dist/assets/memory-router-playground-page-Bnxf4hzQ.js +1 -0
  98. package/dist/assets/{message-files-panel-25T5M1Ct.js → message-files-panel-ZPa7eZHc.js} +1 -1
  99. package/dist/assets/{messages-DJ6wO978.js → messages-CPTfRZA4.js} +1 -1
  100. package/dist/assets/{metric-card-Bg72JUq3.js → metric-card-bXd-f58c.js} +1 -1
  101. package/dist/assets/multi-activity-group-AECQlBbV.js +1 -0
  102. package/dist/assets/native-anchor-Bn22ZLay.js +1 -0
  103. package/dist/assets/{native-biometric-BxYhgb-X.js → native-biometric-D9IxNvJM.js} +1 -1
  104. package/dist/assets/{native-deep-link-C-s7GeV-.js → native-deep-link-IwasVyFQ.js} +2 -2
  105. package/dist/assets/{native-file-B3U837ed.js → native-file-BpFW1c_c.js} +2 -2
  106. package/dist/assets/{navigation-resolver-D4kCxpGf.js → navigation-resolver-jIQ5B6JB.js} +1 -1
  107. package/dist/assets/{not-found-DlCb1TjZ.js → not-found-ui-gcXqK.js} +1 -1
  108. package/dist/assets/{notifications-CZJragaI.js → notifications-DK6b8YVI.js} +1 -1
  109. package/dist/assets/{notifications-page-D7nqzDdY.js → notifications-page-GRXZE_lL.js} +1 -1
  110. package/dist/assets/{oauth-complete-page-4tmCqzLC.js → oauth-complete-page-7NZZRVcj.js} +1 -1
  111. package/dist/assets/{oauth-connection-utils-DmZFWfiy.js → oauth-connection-utils-19Tfw-lp.js} +1 -1
  112. package/dist/assets/{oauth-popup-complete-page-CjVEoYgl.js → oauth-popup-complete-page-Ci39YXpe.js} +1 -1
  113. package/dist/assets/{onboarding-step-layout-BfHbyjc0.js → onboarding-step-layout-2G2ptxpI.js} +1 -1
  114. package/dist/assets/open-workspace-file-CYf_Tqw3.js +2 -0
  115. package/dist/assets/{operational-status-T7FDD0t5.js → operational-status-CMN32PL8.js} +1 -1
  116. package/dist/assets/page-shell-C3ZmdIop.js +1 -0
  117. package/dist/assets/page-surface-store-DJLLsNFC.js +1 -0
  118. package/dist/assets/{pairing-page-CweLlHZS.js → pairing-page-YPN7ISIr.js} +1 -1
  119. package/dist/assets/{pdf-file-preview-6vptz6t6.js → pdf-file-preview-udA0Apx_.js} +1 -1
  120. package/dist/assets/{pdf-preview-sG04pSiE.js → pdf-preview-6Xfl1tO1.js} +2 -2
  121. package/dist/assets/{personality-page-DV3W2t42.js → personality-page-CLsRq5L2.js} +1 -1
  122. package/dist/assets/{plans-page-D-z14zHg.js → plans-page-DkVXE0Jv.js} +1 -1
  123. package/dist/assets/{platform-detection-Dt0-jSAU.js → platform-detection-zth6eCY8.js} +1 -1
  124. package/dist/assets/{platform-login-notice-jeJJGuqn.js → platform-login-notice-CvFpWLJY.js} +1 -1
  125. package/dist/assets/{platform-loopback-page-y_4YDCry.js → platform-loopback-page-B8cGk07e.js} +1 -1
  126. package/dist/assets/{preview-error-BkNW-Vj0.js → preview-error-gCViZZRw.js} +1 -1
  127. package/dist/assets/{privacy-page-BXSqDC_-.js → privacy-page-BxJ2Cuev.js} +1 -1
  128. package/dist/assets/{privacy-screen-BkGGAYzN.js → privacy-screen-DlSj_9FT.js} +1 -1
  129. package/dist/assets/{provider-callback-page-C-bl_GDk.js → provider-callback-page-BPp1TM7J.js} +1 -1
  130. package/dist/assets/{provider-signup-page-PSLa_T38.js → provider-signup-page-Cv9_b_58.js} +1 -1
  131. package/dist/assets/{provisioning-targets-QWEnNCue.js → provisioning-targets-DDUZDQ_a.js} +1 -1
  132. package/dist/assets/{push-registration-BMwgTQHf.js → push-registration-CH_t0mI8.js} +2 -2
  133. package/dist/assets/{remove-from-device-dialog-BDRSkSad.js → remove-from-device-dialog-DeJ_gAmf.js} +1 -1
  134. package/dist/assets/{research-facts-_ZlA6tzF.js → research-facts-C2cY_gU2.js} +1 -1
  135. package/dist/assets/{research-mock-page-PPKtT6UI.js → research-mock-page-CB1_bEoa.js} +1 -1
  136. package/dist/assets/research-onboarding-route-BY3X_d2-.js +50 -0
  137. package/dist/assets/{research-results-view-BFBI--6l.js → research-results-view-BcQs2Zh9.js} +1 -1
  138. package/dist/assets/{retire-confirm-dialog-DPyqO3ao.js → retire-confirm-dialog-f-A5OVYj.js} +1 -1
  139. package/dist/assets/{review-terms-screen-Cba1alNi.js → review-terms-screen-CI_29cnc.js} +1 -1
  140. package/dist/assets/routes-OwGjl0BS.js +24 -0
  141. package/dist/assets/{runtime-upgrade-banner-BrXnDFJZ.js → runtime-upgrade-banner-Cj9E7kWP.js} +2 -2
  142. package/dist/assets/{sandbox-bridge-CXqBkVsW.js → sandbox-bridge-Dj1pIOXJ.js} +1 -1
  143. package/dist/assets/{schedules-page-D81oQFHC.js → schedules-page-0V6ECw0t.js} +1 -1
  144. package/dist/assets/{section-membership-B23vBXXp.js → section-membership-vg-XaMPS.js} +1 -1
  145. package/dist/assets/{select-assistant-screen-Bpp_Fhfx.js → select-assistant-screen-BZxPQqe4.js} +1 -1
  146. package/dist/assets/{self-hosted-servers-DYKQjALI.js → self-hosted-servers-BviPyNnl.js} +1 -1
  147. package/dist/assets/settings-CEQzAg2m.js +1 -0
  148. package/dist/assets/{settings-divider-DGdHGRSV.js → settings-divider-C0NZsB-L.js} +1 -1
  149. package/dist/assets/{settings-layout-Vv6ixknD.js → settings-layout-DgNBNUT7.js} +1 -1
  150. package/dist/assets/settings-navigation-CVw10LL_.js +1 -0
  151. package/dist/assets/{share-feedback-modal-BIIdahKH.js → share-feedback-modal-PlN6X3Pm.js} +2 -2
  152. package/dist/assets/{sidebar-tree-BNzVigoN.js → sidebar-tree-Bp0eeKf2.js} +1 -1
  153. package/dist/assets/{signup-page-DwghsKON.js → signup-page-gqz5_wG1.js} +1 -1
  154. package/dist/assets/{site-favicon-D5oxJG4i.js → site-favicon-Cu07pwc9.js} +1 -1
  155. package/dist/assets/{skill-detail-page-DrVoo07c.js → skill-detail-page-c0s3w3K3.js} +1 -1
  156. package/dist/assets/{skill-detail-panel-Co6OpnMY.js → skill-detail-panel-NYXq557_.js} +1 -1
  157. package/dist/assets/{skills-CAAcLlNJ.js → skills-5MnTu98B.js} +1 -1
  158. package/dist/assets/{src-qDZBwoEm.js → src-CImIAPTd.js} +1 -1
  159. package/dist/assets/{start-screen-CO55WEqw.js → start-screen-CHO19RCi.js} +1 -1
  160. package/dist/assets/{status-badge-pill-CoGc_Kjf.js → status-badge-pill-D8m98tJa.js} +1 -1
  161. package/dist/assets/{stt-language-picker-modal-7-gnUFiL.js → stt-language-picker-modal-BXLEBM7b.js} +1 -1
  162. package/dist/assets/{subagent-detail-panel-B7yd49jl.js → subagent-detail-panel-CrbpQRzW.js} +1 -1
  163. package/dist/assets/{subagent-store-D79M-K__.js → subagent-store-DqKEBlAM.js} +1 -1
  164. package/dist/assets/{superpowers-page-B0zX5FZy.js → superpowers-page-B5WGXphq.js} +1 -1
  165. package/dist/assets/{swipe-action-reveal-Ctx7MIFN.js → swipe-action-reveal-Ai9lRgUU.js} +1 -1
  166. package/dist/assets/{system-events-page-7z3m1kM5.js → system-events-page-_aap_0av.js} +1 -1
  167. package/dist/assets/{telegram-setup-wizard-DhIkHgMe.js → telegram-setup-wizard-BENKNAuh.js} +1 -1
  168. package/dist/assets/{text-preview-DFo5f2uH.js → text-preview-DUlKYC4u.js} +1 -1
  169. package/dist/assets/{theme-stage-page-CmF6f7RN.js → theme-stage-page-CbGuxQ23.js} +1 -1
  170. package/dist/assets/{tiptap-document-editor-DDfxW_SE.js → tiptap-document-editor-0vqw7hch.js} +1 -1
  171. package/dist/assets/{tool-detail-panel-Zx64Drl4.js → tool-detail-panel-C2wUYsf2.js} +1 -1
  172. package/dist/assets/{trust-rules-api-BtUxkSk-.js → trust-rules-api-DRJ1qP-y.js} +1 -1
  173. package/dist/assets/{upgrade-cancel-page-H2SezHRI.js → upgrade-cancel-page-Dbd3VJdm.js} +1 -1
  174. package/dist/assets/{upgrade-success-page-DoM6CoFp.js → upgrade-success-page-CHbEmpjg.js} +1 -1
  175. package/dist/assets/{use-assistant-capability-CmwC8eoT.js → use-assistant-capability-C-yHcMH4.js} +1 -1
  176. package/dist/assets/{use-assistant-identity-details-DqD-wXki.js → use-assistant-identity-details-u9sG9ip2.js} +1 -1
  177. package/dist/assets/{use-attachment-preview-BfZe160h.js → use-attachment-preview-Cq_IWTdT.js} +2 -2
  178. package/dist/assets/{use-attachment-squares-jfCXyibr.js → use-attachment-squares-BKi30wmg.js} +1 -1
  179. package/dist/assets/{use-bookmarks-Dg-dtmf5.js → use-bookmarks-Bl4tx8xK.js} +1 -1
  180. package/dist/assets/{use-checkout-dismiss-refresh-lXbrGudW.js → use-checkout-dismiss-refresh-BHuxVDUc.js} +1 -1
  181. package/dist/assets/use-command-palette-sections-CvNjev8s.js +1 -0
  182. package/dist/assets/{use-edge-swipe-CJ8niuZL.js → use-edge-swipe-C4IrskOL.js} +1 -1
  183. package/dist/assets/use-edge-swipe-back-CiO9raEw.js +2 -0
  184. package/dist/assets/{use-edit-app-CAyA09nW.js → use-edit-app-ByAfCYIL.js} +1 -1
  185. package/dist/assets/{use-is-org-ready-BYJTuCXo.js → use-is-org-ready-GDBxqujc.js} +1 -1
  186. package/dist/assets/use-onboarding-login-BdVTfZ3o.js +1 -0
  187. package/dist/assets/{use-platform-assistant-id-CuqHJket.js → use-platform-assistant-id-B7TrEBmf.js} +1 -1
  188. package/dist/assets/{use-platform-gate-DJ7NtOkG.js → use-platform-gate-DG9Xg3Hs.js} +1 -1
  189. package/dist/assets/{use-return-to-short-circuit-CXFMS-0F.js → use-return-to-short-circuit-EtY8cSC7.js} +1 -1
  190. package/dist/assets/{use-side-list-room-DtmLatRX.js → use-side-list-room-CUXPQyjw.js} +1 -1
  191. package/dist/assets/{use-skill-actions-DjwFUePB.js → use-skill-actions-CdbZjq6a.js} +1 -1
  192. package/dist/assets/{use-sticky-profiles-BYBk-2VZ.js → use-sticky-profiles-vQLFyEh0.js} +1 -1
  193. package/dist/assets/{use-stt-language-selection-82DrT6kd.js → use-stt-language-selection-CK6bUfVS.js} +1 -1
  194. package/dist/assets/{use-subagent-card-data-CTkK6bHj.js → use-subagent-card-data-DlVOBxXw.js} +1 -1
  195. package/dist/assets/use-transcript-message-by-id-FmIIrRsf.js +1 -0
  196. package/dist/assets/{use-transcript-messages-BvoNGyuA.js → use-transcript-messages-Q1PBxvSF.js} +1 -1
  197. package/dist/assets/{use-voice-sample-preview-BHCiYpHq.js → use-voice-sample-preview-CZoWWEeH.js} +1 -1
  198. package/dist/assets/useTranslation-D9pPv-bA.js +1 -0
  199. package/dist/assets/{voice-page-CqgBuO-G.js → voice-page-B1mJ2hkc.js} +1 -1
  200. package/dist/assets/{voice-providers-note-DmCKsoh8.js → voice-providers-note-TDQxSwUj.js} +1 -1
  201. package/dist/assets/{web-C6ruWL7-.js → web-CxX3pST-.js} +1 -1
  202. package/dist/assets/{web-ByBZa2-p.js → web-D1mJSG8v.js} +1 -1
  203. package/dist/assets/welcome-screen-DPXQU47t.js +1 -0
  204. package/dist/assets/{workflow-detail-panel-CXQymzrA.js → workflow-detail-panel-C0kN-iH3.js} +1 -1
  205. package/dist/assets/{workflow-store-DMcem5b6.js → workflow-store-BXqyb8CL.js} +1 -1
  206. package/dist/assets/{workspace-page-CHN0AzFJ.js → workspace-page-Mj_A1eeR.js} +1 -1
  207. package/dist/assets/{workspace-tree-query-BmugmuTC.js → workspace-tree-query-Dyls8wmV.js} +1 -1
  208. package/dist/index.html +93 -93
  209. package/package.json +1 -1
  210. package/dist/assets/account-C-_tLpl9.js +0 -1
  211. package/dist/assets/api-Cet3wU2m.js +0 -1
  212. package/dist/assets/channels-page-route-BVzZL9QF.js +0 -9
  213. package/dist/assets/checkout-return-target-Bj6qL3Z7.js +0 -1
  214. package/dist/assets/command-palette-window-page-nIdxmxPV.js +0 -1
  215. package/dist/assets/companion-surface-page-BZHSeP1U.js +0 -1
  216. package/dist/assets/esm-B8RIzuiy.js +0 -2
  217. package/dist/assets/file-markdown-Br-X9E8g.js +0 -2
  218. package/dist/assets/first-run-scope-CGwas_dv.js +0 -1
  219. package/dist/assets/format-usd-BSn1PAt3.js +0 -1
  220. package/dist/assets/general-page-DqxymzlR.js +0 -1
  221. package/dist/assets/home-page-route--ZWIkqRA.js +0 -1
  222. package/dist/assets/home-tool-permission-card-BGkMa_5c.js +0 -1
  223. package/dist/assets/index-yCM21OWQ.css +0 -2
  224. package/dist/assets/login-page-DsrM-8gG.js +0 -1
  225. package/dist/assets/memory-router-playground-page-Bvv1GiG1.js +0 -1
  226. package/dist/assets/multi-activity-group-CvLkSXkq.js +0 -1
  227. package/dist/assets/native-anchor-WUfwamgX.js +0 -1
  228. package/dist/assets/native-auth-error-B4gY5JEl.js +0 -1
  229. package/dist/assets/open-workspace-file-CDO9erng.js +0 -2
  230. package/dist/assets/page-shell-3Yi5Ezsv.js +0 -1
  231. package/dist/assets/page-surface-store-d61YqYCV.js +0 -1
  232. package/dist/assets/research-onboarding-route-Cv91i-43.js +0 -50
  233. package/dist/assets/routes-Cu81Z_6p.js +0 -24
  234. package/dist/assets/settings-DWADkKSC.js +0 -1
  235. package/dist/assets/settings-navigation-Dt128ttq.js +0 -1
  236. package/dist/assets/use-command-palette-sections-D3ZIddUs.js +0 -1
  237. package/dist/assets/use-edge-swipe-back-Dl-lRTON.js +0 -2
  238. package/dist/assets/use-onboarding-login-BosEuDpc.js +0 -1
  239. package/dist/assets/use-transcript-message-by-id-DTaTEqgT.js +0 -1
  240. package/dist/assets/useTranslation-DdVCKPgw.js +0 -1
  241. package/dist/assets/welcome-screen-Cghao5xK.js +0 -1
  242. /package/dist/assets/{app-types-DhugcUAb.js → app-types-DET4dder.js} +0 -0
  243. /package/dist/assets/{archive-redirect-page-DddErONf.js → archive-redirect-page-LFqfq3Zx.js} +0 -0
  244. /package/dist/assets/{billing-redirect-page-CaXtswvd.js → billing-redirect-page-B6zuKMxb.js} +0 -0
  245. /package/dist/assets/{build.umd-Bnx74y6d.js → build.umd-CwkQd6wk.js} +0 -0
  246. /package/dist/assets/{channels-BdtsaKuZ.js → channels-CXuBInAc.js} +0 -0
  247. /package/dist/assets/{common-CYa3Lx5T.js → common-EmSgsWNa.js} +0 -0
  248. /package/dist/assets/{contacts-Adtv7fIG.js → contacts-BRU7ohw2.js} +0 -0
  249. /package/dist/assets/{credential-requests-BjLAoauv.js → credential-requests-BbBZKJHx.js} +0 -0
  250. /package/dist/assets/{danger-zone-redirect-page-C45lMfXW.js → danger-zone-redirect-page-BuIG9f9S.js} +0 -0
  251. /package/dist/assets/{definitions-BvE4YCqW.js → definitions-Co0yLSy_.js} +0 -0
  252. /package/dist/assets/{definitions-BOuhvvgh.js → definitions-Yz8Uao4u.js} +0 -0
  253. /package/dist/assets/{devices-redirect-page-CTLNcuXg.js → devices-redirect-page-BoKYF1E9.js} +0 -0
  254. /package/dist/assets/{diff-rows-CMQi83GC.js → diff-rows-BrFK496i.js} +0 -0
  255. /package/dist/assets/{emoji-catalog-data-zwouAP3d.js → emoji-catalog-data-BIIBfSqk.js} +0 -0
  256. /package/dist/assets/{environment-store-CgcCuCfv.js → environment-store-C4So_j-o.js} +0 -0
  257. /package/dist/assets/{esm-B3RQnhQB.js → esm-BJhqsukI.js} +0 -0
  258. /package/dist/assets/{esm-U4mAZE_5.js → esm-CPFvOH-c.js} +0 -0
  259. /package/dist/assets/{external-urls-B0QJBkzP.js → external-urls-Bg18AU4S.js} +0 -0
  260. /package/dist/assets/{file-editor-C2Qy2Ujg.js → file-editor-BwdObVSu.js} +0 -0
  261. /package/dist/assets/{home-DaG8KIqs.js → home-BwSxL4rM.js} +0 -0
  262. /package/dist/assets/{intelligence-B920vsi4.js → intelligence-DXpXyKbw.js} +0 -0
  263. /package/dist/assets/{keyboard-shortcuts-redirect-page-DSUfuOqd.js → keyboard-shortcuts-redirect-page-DSnux9sJ.js} +0 -0
  264. /package/dist/assets/{library-DqQriY4U.js → library-CuKVNDEp.js} +0 -0
  265. /package/dist/assets/{link-click-3KBltS8g.js → link-click-BsxbQxDe.js} +0 -0
  266. /package/dist/assets/{logs-s74ABgur.js → logs-Blq4k473.js} +0 -0
  267. /package/dist/assets/{machine-sizes-BEgYDPIN.js → machine-sizes-DzJ0TVYS.js} +0 -0
  268. /package/dist/assets/{media-preview-C0jyQw5_.js → media-preview-HgLvcAQ9.js} +0 -0
  269. /package/dist/assets/{onboarding-orcvuvpJ.js → onboarding-DK0I_g8T.js} +0 -0
  270. /package/dist/assets/{page-empty-state-BG1VeXc8.js → page-empty-state-CzHxZkBR.js} +0 -0
  271. /package/dist/assets/{password-reset-page-D4zTOGaM.js → password-reset-page-D8ONrPU-.js} +0 -0
  272. /package/dist/assets/{pdf-CjG-njep.js → pdf-UON6A_nT.js} +0 -0
  273. /package/dist/assets/{plugin-attribution-CcHpmela.js → plugin-attribution-C0u-eDRH.js} +0 -0
  274. /package/dist/assets/{plugin-detail-page-DWr7S8VR.js → plugin-detail-page--CvX0OXv.js} +0 -0
  275. /package/dist/assets/{plugins-page-BZLdfa7d.js → plugins-page-CZ16U_6n.js} +0 -0
  276. /package/dist/assets/{profile-metadata-CsakJtzD.js → profile-metadata-D9zzZn4_.js} +0 -0
  277. /package/dist/assets/{provider-key-CsMdPcM5.js → provider-key-DpdSx5gG.js} +0 -0
  278. /package/dist/assets/{radio-card-nav-D_-kt3tm.js → radio-card-nav-CrM7VJUk.js} +0 -0
  279. /package/dist/assets/{remote-web-DxCgPeJc.js → remote-web-DBCYTF2P.js} +0 -0
  280. /package/dist/assets/{schedules-D3oXqJMY.js → schedules-C3wE8OML.js} +0 -0
  281. /package/dist/assets/{schedules-rtwsTU7E.js → schedules-Co4-ymK5.js} +0 -0
  282. /package/dist/assets/{security-redirect-page-DbXxE5Ym.js → security-redirect-page-D6x3MANY.js} +0 -0
  283. /package/dist/assets/{setting-row-C0mDhzZy.js → setting-row-BvQpFvtr.js} +0 -0
  284. /package/dist/assets/{signup-shell-DnLhiMGV.js → signup-shell-DW976E_0.js} +0 -0
  285. /package/dist/assets/{skill-icon-sj-wJGzd.js → skill-icon-yVnZg-J1.js} +0 -0
  286. /package/dist/assets/{skills-page-yj4WNgG3.js → skills-page-B_VTCiN2.js} +0 -0
  287. /package/dist/assets/{sounds-page-Co2G6n-5.js → sounds-page-BdSO1UIf.js} +0 -0
  288. /package/dist/assets/{system-events-redirect-page-Dbxsscgn.js → system-events-redirect-page-DbyqOqe_.js} +0 -0
  289. /package/dist/assets/{terminal-og9TTXfZ.js → terminal-_tzbWcM4.js} +0 -0
  290. /package/dist/assets/{usage-redirect-page-NZfMbBv6.js → usage-redirect-page-DyTnwv4x.js} +0 -0
  291. /package/dist/assets/{use-skill-detail-files-DNaNHaP0.js → use-skill-detail-files-Bg4G44J3.js} +0 -0
  292. /package/dist/assets/{use-supports-credentials-settings-BCD9S39r.js → use-supports-credentials-settings-Cj-Py42f.js} +0 -0
  293. /package/dist/assets/{use-truncated-blob-text-CHF4X4vL.js → use-truncated-blob-text-BYAPiP8I.js} +0 -0
  294. /package/dist/assets/{weather-forecast-display-8i3-jfUZ.js → weather-forecast-display-D3IBgGHv.js} +0 -0
  295. /package/dist/assets/{web-DXzSQlx4.js → web-B60tNeyj.js} +0 -0
  296. /package/dist/assets/{web-Crg_ekZH.js → web-BSizndvP.js} +0 -0
  297. /package/dist/assets/{web-to2ecOqW.js → web-CXad-fWd.js} +0 -0
  298. /package/dist/assets/{web-xhYMQG7j.js → web-Cpz2h_dP.js} +0 -0
  299. /package/dist/assets/{web-eg_n1fSm.js → web-Cr238HhI.js} +0 -0
  300. /package/dist/assets/{web-B5o07_c8.js → web-Nd-L7NoL.js} +0 -0
  301. /package/dist/assets/{web-Ctf28EEk.js → web-W2HEHjFb.js} +0 -0
  302. /package/dist/assets/{workspace-BBqltPoi.js → workspace-BFa6JWKe.js} +0 -0
  303. /package/dist/assets/{xterm-DJn4nvHR.js → xterm-DFQikp5h.js} +0 -0
  304. /package/dist/assets/{xterm-addon-fit-DEYHenuA.js → xterm-addon-fit-B04vX_IV.js} +0 -0
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{i as t,l as n}from"./local-settings-Bx7FsNo5.js";import{o as r,r as i}from"./device-settings-DZvv4pnY.js";import{t as a}from"./capture-error-DiNp24s6.js";import{t as o}from"./react-BFJW0bSv.js";import{t as s}from"./button-VkxVX0DM.js";import{d as c,h as l,t as u}from"./chunk-5KNZJZUH-BUqIilZr.js";import{n as d}from"./QueryClientProvider-EuRl-wrW.js";import{t as f}from"./useQuery-CTSuec5b.js";import{t as p}from"./useMutation-D2YPyfEH.js";import{t as m}from"./jsx-runtime-BJ8jcmzB.js";import{t as h}from"./cn-Cf8SmgbR.js";import{t as g}from"./card-DUsAeHUS.js";import{d as _,o as v}from"./list-row-CDwzGT9g.js";import{t as y}from"./createLucideIcon-B-ZPaMbU.js";import{t as b}from"./bell-CHRdx4mp.js";import{t as x}from"./check-pgeLaeXx.js";import{t as S}from"./chevron-down-CmQCCo_x.js";import{t as C}from"./circle-alert-DvkPmyIg.js";import{t as w}from"./circle-check-BlOeCme9.js";import{t as T}from"./hard-drive-BV9-fN_J.js";import{t as E}from"./heart-Bd-pnn1X.js";import{t as D}from"./loader-circle-DYe85z3g.js";import{t as O}from"./monitor-BHYV5XBf.js";import{t as k}from"./moon-CZZGDGLY.js";import{C as A,S as j,T as M,b as N,d as ee,h as P,i as F,l as I,m as L,n as R,o as te,t as ne,u as re}from"./composer-settings-Bs2Ux46E.js";import{t as ie}from"./refresh-cw-p138DTtp.js";import{t as ae}from"./rotate-ccw-Cs7aCSL9.js";import{t as oe}from"./smartphone-AcA2Q0mQ.js";import{t as se}from"./sparkles-Bhr0JiLM.js";import{t as ce}from"./sun-BzqYfTxT.js";import{t as le}from"./triangle-alert-43gIbLca.js";import{t as ue}from"./x-zfSDUG5z.js";import{t as z}from"./notice-BlYF-xU3.js";import{t as de}from"./progress-bar-C4e3e4vV.js";import{B as fe,a as pe,o as me,r as he,z as ge}from"./src-qDZBwoEm.js";import{t as _e}from"./tag-Ddzwz3ij.js";import{t as B}from"./input-DkgpMeG9.js";import{t as ve}from"./toggle-0qt1e_3r.js";import{t as V}from"./modal-UYNawsIu.js";import{n as H}from"./toast-DqqWkjsh.js";import{t as ye}from"./confirm-dialog-Drw1adml.js";import{t as be}from"./select-BKyejRky.js";import{t as U}from"./skeleton-D8_lkywC.js";import{C as xe,M as Se,P as Ce,S as we,V as Te,Y as Ee,_ as De,a as Oe,f as ke,i as Ae,p as je,u as Me,v as Ne,z as Pe}from"./local-mode-BNr2MrWI.js";import{t as W}from"./is-electron-wgAC5Mzb.js";import{r as Fe}from"./resolved-assistants-store-BNadgXqb.js";import{i as G,n as Ie,t as Le}from"./api-errors-CASENJGT.js";import{r as Re,t as ze}from"./semver-C2-EZfiR.js";import{i as Be}from"./utils-BEkyAhbA.js";import{$ as Ve,E as He,S as Ue,T as We,Z as Ge,a as Ke,g as qe,n as Je,q as Ye,tt as Xe,w as Ze,x as Qe}from"./auth-store-DDMY1UvK.js";import{t as K}from"./client.gen-CxTOBLiH.js";import{$ as $e,C as et,N as tt,P as nt,Q as rt,T as it,W as at,Wt as ot}from"./sdk.gen-DWvuzSBW.js";import{a as st,o as ct}from"./api-CQ3nejmH.js";import{c as lt}from"./remote-gateway-session-CzPLaXuT.js";import{t as q}from"./client-feature-flag-store-CT2T_Fg7.js";import{d as J}from"./routes-B7wRw3UT.js";import{d as ut,h as dt,o as ft,p as pt,u as mt}from"./platform-detection-Dt0-jSAU.js";import{i as ht,r as gt,t as _t}from"./use-platform-gate-DJ7NtOkG.js";import{A as vt,D as yt,E as bt,Ft as xt,It as St,Lt as Ct,Mt as wt,N as Tt,Nt as Et,O as Dt,Ot,P as kt,Pt as At,T as jt,c as Mt,ft as Nt,j as Pt,k as Ft,kt as It,mt as Lt,v as Rt,w as zt,wt as Bt}from"./react-query.gen-CwRPAiHT.js";import{t as Vt}from"./hard-navigate-CNxvVrtC.js";import{t as Ht}from"./assistant-feature-flag-store-CNWz-RMv.js";import{t as Ut}from"./pointer-BMK9brNn.js";import{n as Wt,t as Gt}from"./retire-confirm-dialog-DPyqO3ao.js";import{a as Kt,i as qt,r as Jt,s as Yt}from"./local-runtime-upgrade-T5WFNI2L.js";import{t as Xt}from"./copy-to-clipboard-D76_3Coc.js";import{t as Zt}from"./proxy-CT_qJI1K.js";import{t as Qt}from"./AnimatePresence-CxaKvfs9.js";import{t as $t}from"./use-reduced-motion-CU3dPXKf.js";import{t as Y}from"./platform-login-notice-jeJJGuqn.js";import{t as en}from"./use-active-assistant-id-BADYKVyx.js";import{t as tn}from"./use-copy-to-clipboard-B7Yrgm0s.js";import{t as X}from"./detail-card-BzCuPjtL.js";import{t as nn}from"./app-info-CvBesesf.js";import{a as rn,i as an,l as on,o as sn}from"./machine-sizes-BEgYDPIN.js";import{t as cn}from"./environment-store-CgcCuCfv.js";import{a as ln,i as un,n as dn,r as fn,t as pn}from"./assistant-status-panel-BkuUZfnZ.js";import{t as mn}from"./settings-divider-DGdHGRSV.js";var hn=y(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),gn=y(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),_n=y(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Z=e(o(),1),Q=m();function vn(){let e=q.use.velvet(),{theme:t,setThemePreference:n}=L(),r=[{value:`system`,label:`System`,icon:(0,Q.jsx)(O,{className:`h-4 w-4`})},{value:`light`,label:`Light`,icon:(0,Q.jsx)(ce,{className:`h-4 w-4`})},{value:`dark`,label:`Dark`,icon:(0,Q.jsx)(k,{className:`h-4 w-4`})},...e?[{value:`velvet`,label:`Velvet`,icon:(0,Q.jsx)(E,{className:`h-4 w-4`})}]:[]];return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Theme`}),(0,Q.jsx)(`div`,{className:`mt-2 max-w-[360px]`,children:(0,Q.jsx)(v,{ariaLabel:`Theme`,value:t,onChange:n,items:r})})]})}var yn=Qe,bn=`Please choose a different handle.`;async function xn(e,t){let{data:n,error:r,response:i}=await nt({path:{id:e},body:{handle:t},throwOnError:!1});if(!i)return{kind:`error`,message:G(r,void 0,`Failed to save handle.`)??`Failed to save handle.`};if(i.ok&&n)return{kind:`ok`,data:n};if(i.status===409){let{message:e}=He(r,`handle`,yn.taken);return{kind:`taken`,message:e}}if(i.status===400){let{code:e,message:t}=He(r,`handle`,bn);return{kind:`invalid`,code:e,message:t}}return{kind:`error`,message:G(r,i,`Failed to save handle.`)}}async function Sn(e,t,n){let{data:r,error:i,response:a}=await et({path:{assistant_id:e},query:{handle:t},signal:n,throwOnError:!1});if(Ie(a,i,`Failed to check handle availability.`),!a.ok||!r)throw new Le(a.status,a.status===429?`Too many checks — try again in a moment.`:G(i,a,`Failed to check handle availability.`));return{available:r.available,code:r.code??null,message:r.message??null}}function Cn(e){return/\d{2,}$/.test(e)}var wn=300,Tn=1400;function En({initialHandle:e,inputLabel:t,helperText:n,idleHelperText:r,checkAvailable:i,save:a,onSaved:o,saveSuccessToast:c,fieldId:l}){let[u,d]=(0,Z.useState)(e),[f,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(`idle`),[v,y]=(0,Z.useState)(null),b=$t(),S=(0,Z.useRef)(null),w=(0,Z.useMemo)(()=>u.trim().toLowerCase(),[u]),T=w===e.toLowerCase();(0,Z.useEffect)(()=>{if(T||w.length===0){h(!1),S.current?.abort();return}let e=new AbortController;S.current?.abort(),S.current=e,h(!0);let t=window.setTimeout(async()=>{try{let t=await i(w,e.signal);e.signal.aborted||p(t)}catch(t){e.signal.aborted||y(t instanceof Error?t.message:`Couldn't check availability.`)}finally{e.signal.aborted||h(!1)}},wn);return()=>{window.clearTimeout(t),e.abort()}},[w,T,i]);let E=(()=>{if(v)return v;if(f&&!f.available){let e=f.code;return f.message??(e?yn[e]:`Please choose a different handle.`)}return null})(),O=E?n:T?r??null:m?`Checking availability…`:f?.available?`Available.`:null,k=!T&&!m&&f?.available!==!1&&g!==`saving`,A=(0,Z.useCallback)(async()=>{if(!k)return;_(`saving`),y(null);let e=await a(w);if(e.kind===`ok`){_(`saved`),o(e.data),H.success(c),window.setTimeout(()=>_(`idle`),Tn);return}if(e.kind===`taken`){_(`idle`),p({available:!1,code:`taken`,message:e.message});return}if(e.kind===`invalid`){_(`idle`),p({available:!1,code:e.code,message:e.message});return}_(`error`),y(e.message),H.error(e.message)},[k,w,o,a,c]),j=(()=>{if(T&&u.length>0||u.length===0)return null;let e=m?`checking`:f?.available?`available`:f?.available===!1?`invalid`:null;return e?(0,Q.jsx)(Qt,{mode:`wait`,initial:!1,children:(0,Q.jsxs)(Zt.span,{initial:b?!1:{opacity:0,scale:.85},animate:{opacity:1,scale:1},exit:b?void 0:{opacity:0,scale:.85},transition:{duration:.14,ease:`easeOut`},className:`flex items-center`,"aria-hidden":e!==`available`&&e!==`invalid`,children:[e===`checking`&&(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),e===`available`&&(0,Q.jsx)(x,{className:`h-4 w-4 text-[var(--system-positive-strong)]`,"aria-label":`Available`}),e===`invalid`&&(0,Q.jsx)(C,{className:`h-4 w-4 text-[var(--system-negative-strong)]`,"aria-label":`Not available`})]},e)}):null})(),M=(()=>{switch(g){case`saving`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(D,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}),`Saving…`]});case`saved`:return(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,Q.jsx)(x,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),`Saved`]});default:return`Save`}})();return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(B,{label:t,value:u,onChange:e=>{d(e.target.value.replace(/\s+/g,``)),p(null),y(null)},autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,maxLength:30,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),rightIcon:j,errorText:E??void 0,helperText:O??void 0,"aria-invalid":!!E,fullWidth:!0,"data-testid":`${l}-input`}),(!T||g!==`idle`)&&(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsx)(s,{variant:`primary`,size:`compact`,onClick:A,disabled:!k,"aria-live":`polite`,"data-testid":`${l}-save`,children:M})})]})}function Dn({initial:e,onSaved:t}){let n=Je.use.refreshSession(),r=Cn(e.username)?`Your handle was auto-generated at signup — pick one you like.`:void 0,i=(0,Z.useCallback)(async e=>await We({username:e}),[]),a=(0,Z.useCallback)((e,t)=>Ue(e,t),[]),o=(0,Z.useCallback)(e=>{t(e),n()},[t,n]);return(0,Q.jsx)(En,{initialHandle:e.username,inputLabel:`User handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:r,checkAvailable:a,save:i,onSaved:o,saveSuccessToast:`Profile updated.`,fieldId:`user-handle`})}function On({assistant:e,onSaved:t}){let n=e.handle??``,r=f({...Mt({path:{assistant_id:e.id}})}).data?.results?.[0],i=!!r&&r.subdomain.toLowerCase()===n.toLowerCase(),a=n.length===0?`Your assistant doesn't have a handle yet — claim one to make it mentionable.`:void 0,o=(0,Z.useCallback)(async t=>await xn(e.id,t),[e.id]),s=(0,Z.useCallback)((t,n)=>Sn(e.id,t,n),[e.id]);return i?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(B,{label:`Assistant handle`,value:n,readOnly:!0,disabled:!0,leftIcon:(0,Q.jsx)(`span`,{className:`select-none font-mono text-[var(--content-tertiary)]`,"aria-hidden":!0,children:`@`}),fullWidth:!0,"data-testid":`assistant-handle-input`}),(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Your assistant's handle is locked because it's used as its email subdomain. To change it,`,` `,(0,Q.jsx)(u,{to:`${J.settings.ai}?release=1#email`,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`release the subdomain`}),` `,`first.`]})]}):(0,Q.jsx)(En,{initialHandle:n,inputLabel:`Assistant handle`,helperText:`Lowercase letters, digits, hyphens, and underscores. 3–30 characters.`,idleHelperText:a,checkAvailable:s,save:o,onSaved:t,saveSuccessToast:`Assistant handle updated.`,fieldId:`assistant-handle`})}function kn(){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,"aria-busy":!0,"aria-live":`polite`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(U,{className:`h-3 w-16`}),(0,Q.jsx)(U,{className:`h-9 w-full rounded-md`}),(0,Q.jsx)(U,{className:`h-3 w-72`})]}),(0,Q.jsx)(U,{className:`h-9 w-full rounded-md`}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsx)(U,{className:`h-3 w-60`}),(0,Q.jsx)(U,{className:`h-7 w-16 rounded-md`})]}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Loading your profile…`})]})}function An(){return(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`})}function jn({assistant:e,showHandles:t=!0,children:n}={}){let r=Je.use.user?.()?.email??null;return(0,Q.jsx)(X,{title:`Profile`,subtitle:`Manage your account details and preferences.`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[r&&(0,Q.jsx)(`div`,{className:`max-w-[420px]`,children:(0,Q.jsx)(B,{label:`Email`,value:r,disabled:!0,readOnly:!0})}),t&&(0,Q.jsxs)(Q.Fragment,{children:[r&&(0,Q.jsx)(An,{}),(0,Q.jsx)(Mn,{assistant:e})]}),n!=null&&(0,Q.jsxs)(Q.Fragment,{children:[(r||t)&&(0,Q.jsx)(An,{}),n]})]})})}function Mn({assistant:e}){let[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a=$t(),[o,s]=(0,Z.useState)(e??null);return(0,Z.useEffect)(()=>{s(e??null)},[e]),(0,Z.useEffect)(()=>{let e=!1;return Ze().then(t=>{e||n(t)}).catch(t=>{e||i(t instanceof Error?t.message:`Failed to load profile.`)}),()=>{e=!0}},[]),r?(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:r}):t?(0,Q.jsxs)(Zt.div,{initial:a?!1:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.22,ease:`easeOut`},className:`flex flex-col gap-6`,children:[(0,Q.jsx)(Dn,{initial:t,onSaved:n}),o&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(On,{assistant:o,onSaved:s})]})]}):(0,Q.jsx)(kn,{})}var Nn=Rt({query:{hosting:`platform`}});function Pn(){let e=en(),t=f(Nn),n=t.data?.results??[];return t.isPending||n.length<2?null:(0,Q.jsx)(X,{title:`Switch Assistant`,subtitle:`Choose which assistant is active for this account.`,children:(0,Q.jsx)(`div`,{className:`space-y-2`,children:n.map(t=>{let n=t.id===e;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border px-4 py-3 ${n?`border-[var(--border-focus)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-default)]`}`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(O,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsx)(`div`,{className:`min-w-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`truncate text-body-medium-default text-[var(--content-default)]`,children:t.name||`Unnamed`}),t.status!==`active`&&(0,Q.jsx)(_e,{tone:`warning`,children:t.status})]})})]}),(0,Q.jsx)(`div`,{className:`shrink-0`,children:n?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 text-body-small-default text-[var(--system-positive-default)]`,children:[(0,Q.jsx)(x,{className:`h-4 w-4`}),`Active`]}):(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,disabled:t.status!==`active`,onClick:()=>{Ge(t.id),H.success(`Switched active assistant.`)},children:`Switch`})})]},t.id)})})})}var Fn=[{label:`Never`,seconds:0},{label:`5 min`,seconds:300,devOnly:!0},{label:`10 min`,seconds:600,devOnly:!0},{label:`1 hour`,seconds:3600},{label:`3 hours`,seconds:10800},{label:`1 day`,seconds:86400},{label:`3 days`,seconds:259200},{label:`7 days`,seconds:604800},{label:`14 days`,seconds:1209600},{label:`30 days`,seconds:2592e3}];function In(e){if(e===0)return`Never (sleep disabled)`;let t=Math.floor(e/86400),n=Math.floor(e%86400/3600);if(t>0&&n>0)return`${t}d ${n}h`;if(t>0)return`${t} day${t===1?``:`s`}`;if(n>0)return`${n} hour${n===1?``:`s`}`;let r=Math.floor(e/60);return r>0?`${r} minute${r===1?``:`s`}`:`${e}s`}function Ln({assistantId:e}){let t=d(),n=cn.use.isNonProduction(),r=(0,Z.useMemo)(()=>Fn.filter(e=>!e.devOnly||n),[n]),{data:i,isLoading:a,isError:o}=f(vt({path:{id:e}})),c=(0,Z.useMemo)(()=>i?.idle_timeout_seconds??259200,[i]),[l,u]=(0,Z.useState)(null),p=l??c,m=l!==null,h=It({onSuccess:()=>{H.success(`Sleep policy saved.`),u(null),t.invalidateQueries({queryKey:Pt({path:{id:e}})})},onError:()=>{H.error(`Failed to save sleep policy. Please try again.`)}});return a?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Loading sleep settings...`]}):o?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load sleep policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`label`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:`Idle timeout`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`How long the assistant can be idle before it is put to sleep. "Never" disables idle sleep entirely.`}),(0,Q.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:r.map(e=>(0,Q.jsx)(s,{variant:`outlined`,active:p===e.seconds,onClick:()=>u(e.seconds),children:e.label},e.seconds))}),(0,Q.jsxs)(`p`,{className:`mt-2 text-body-small-default text-[var(--content-tertiary)]`,children:[`Current: `,In(p)]})]}),m&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(s,{variant:`primary`,leftIcon:h.isPending?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:()=>h.mutate({path:{id:e},body:{idle_timeout_seconds:p}}),disabled:h.isPending,children:`Save`}),(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>u(null),disabled:h.isPending,children:`Cancel`})]})]})}function Rn(e,t,n){let r=[e.version];return e.version===n&&r.push(`(latest)`),t&&e.version===t&&r.push(`(current)`),r.join(` `)}var zn=3e3;function Bn({version:e,assistantId:t}){let{onTap:n,message:r}=un(t);return(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`button`,{type:`button`,className:`block min-w-0 break-all text-left text-body-medium-lighter text-[var(--content-default)]`,onClick:n,children:e??`—`}),r&&(0,Q.jsx)(`p`,{className:`mt-1 text-body-small-default text-[var(--content-accent)]`,children:r})]})}function Vn({assistantId:e,currentVersion:t,releaseChannel:n,onUpgradeComplete:r}){let i=Ht.use.rollbackEnabled(),a=q.use.previewChannel(),o=d(),c=qt(n,a),l=c===`preview`,[u,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(null),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(!1),[b,x]=(0,Z.useState)(!1),[S,C]=(0,Z.useState)(null),w=e=>e&&h.current&&e===h.current?(queueMicrotask(()=>{C(b?`Successfully rolled back to version ${h.current}.`:`Successfully updated to version ${h.current}.`),m(!1),h.current=null,_(null),H.success(b?`Rollback complete. Your assistant is healthy.`:`Update complete. Your assistant is healthy.`,{id:`runtime-upgrade-complete`,tone:`strong`}),r?.()}),!1):zn;f({...Dt({path:{id:e}}),refetchInterval:u?e=>w(e.state.data?.current_release_version):!1});let{data:T,isLoading:E}=f(Bt({query:{channel:c}})),O=T?.find(e=>e.is_stable!==!1)??T?.[0],k=g??O?.version??null,A=(0,Z.useMemo)(()=>{if(!i||!k||!t)return!1;let e=Re(k),n=Re(t);return!e||!n?!1:ze(e,n)<0},[i,k,t]),j=(0,Z.useMemo)(()=>{if(!k)return!1;if(!t)return!0;let e=Re(k),n=Re(t);if(!e||!n)return k!==t;let r=ze(e,n);return i?r!==0:r>0},[i,k,t]),M=p({mutationFn:async t=>{let{data:n}=await rt({path:{id:e},body:t,throwOnError:!0});return n}}),N=p({mutationFn:async t=>{let{data:n}=await at({path:{id:e},body:t,throwOnError:!0});return n}});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(Bn,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:l?`Preview release`:j?A?`Rollback to`:`Update to`:`Selected`}),(0,Q.jsx)(`span`,{className:`block min-w-0`,children:E?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`}),`Loading...`]}):T&&T.length>0?i?(0,Q.jsx)(be,{value:k??``,onChange:e=>_(e===O?.version?null:e),disabled:u||M.isPending||N.isPending,options:T.map(e=>({value:e.version,label:Rn(e,t,O?.version)}))}):(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:O?Rn(O,t,O.version):`—`}):`No releases available`})]})]}),(0,Q.jsx)(s,{variant:A?`outlined`:`primary`,className:`min-w-[160px]`,leftIcon:M.isPending||N.isPending||u?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),onClick:()=>y(!0),disabled:!j||M.isPending||N.isPending||u||E||!T?.length,children:u?b?`Rolling back...`:`Updating...`:A?`Rollback`:l?`Update preview`:`Update`}),l&&(0,Q.jsxs)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:[`Using Preview releases.`,` `,(0,Q.jsx)(`a`,{href:`#preview-release-channel`,className:`text-[var(--primary-base)] underline-offset-2 hover:underline`,children:`Switch back to Stable`})]}),!j&&t&&k&&!E&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:S??`You are already on this version.`}),(0,Q.jsx)(ye,{open:v,title:A?`Rollback assistant`:l?`Update preview release`:`Update assistant`,message:A?`Rollback to version ${k??`unknown`}? The assistant will be briefly unavailable.`:l?`Update to preview version ${k??`latest`}? The assistant will be briefly unavailable during the update.`:`Update to version ${k??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:A?`Rollback`:l?`Update preview`:`Update`,onConfirm:async()=>{y(!1),C(null);let t=i?k??void 0:void 0;try{if(A){let e=await N.mutateAsync({version:t});h.current=e.version??t??null,H.success(e.detail||`Rollback to ${t} initiated.`)}else{let e=await M.mutateAsync({version:t});if(e.detail?.includes(`Already on the latest`)){H.warning(e.detail);return}h.current=e.version??t??null,H.success(e.detail||`Update to ${e.version??t??`latest`} initiated.`)}x(A),m(!0),o.invalidateQueries({queryKey:Ft({path:{id:e}})})}catch{H.error(A?`Failed to trigger rollback. Please try again.`:`Failed to trigger update. Please try again.`)}},onCancel:()=>y(!1)})]})}function Hn({assistantId:e,currentVersion:t,onUpgradeComplete:n}){let[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(null),{data:c,isLoading:l}=f(Bt({query:{stable:!0,limit:100}})),u=(0,Z.useMemo)(()=>Jt(c),[c]),d=u?.version,p=t?Kt(t,d):!!d,m=Yt({assistantId:e,targetVersion:d});return(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4 md:grid md:grid-cols-[auto_minmax(0,1fr)] md:items-center md:gap-x-8 md:gap-y-4`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(Bn,{version:t,assistantId:e})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 md:contents`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Update to`}),(0,Q.jsx)(`span`,{className:`block min-w-0 break-all text-body-medium-lighter text-[var(--content-default)]`,children:l?`Loading...`:d&&u?Rn(u,t,d):`No releases available`})]})]}),(0,Q.jsx)(s,{variant:`primary`,className:`min-w-[160px]`,leftIcon:m.isPending?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),onClick:()=>i(!0),disabled:m.isPending||l||!d||!p,children:m.isPending?`Updating...`:d?`Update to ${d}`:`Update`}),a&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:a}),!a&&!p&&d&&!l&&(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-positive-strong)]`,children:`You are already on this version.`}),(0,Q.jsx)(ye,{open:r,title:`Update assistant`,message:`Update to version ${d??`latest`}? The assistant will be briefly unavailable during the update.`,confirmLabel:`Update`,onConfirm:async()=>{i(!1),o(null);try{let e=await m.upgrade();o(e.version?`Successfully updated to version ${e.version}.`:`Successfully updated to version ${d??`latest`}.`),H.success(`Update complete. Your assistant is healthy.`,{id:`runtime-upgrade-complete`,tone:`strong`}),n?.()}catch(e){H.error(e instanceof Error?e.message:`Failed to trigger update. Please try again.`)}},onCancel:()=>i(!1)})]})}function Un(){let e=ht({platformHostedOnly:!0}),t=gt(),n=Je.use.user()?.id??null,r=Je.use.logout(),[i,a]=(0,Z.useState)(!1),o=wt({onSuccess:async()=>{H.success(`Account deletion requested. You will be logged out shortly.`),qe(n),await r(),Vt(J.account.login)},onError:()=>{H.error(`Failed to request account deletion. Please try again.`)}}),c=e===`full`&&t;return(0,Z.useEffect)(()=>{c&&i&&a(!1)},[c,i]),e===`gated`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Delete Account`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Permanently delete your account and all associated data.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:e===`disabled`?(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to delete your account.`}):(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(s,{variant:`dangerOutline`,onClick:()=>a(!0),disabled:o.isPending||c,className:`self-start`,children:`Delete My Account`}),c&&(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`})]})})]}),(0,Q.jsx)(ye,{open:i,title:`Delete Account`,message:`This will permanently delete your account and all associated data. This action cannot be undone.`,confirmLabel:`Delete Account`,destructive:!0,onConfirm:()=>{if(c){a(!1);return}a(!1),o.mutate({})},onCancel:()=>a(!1)})]})}function Wn({title:e,subtitle:t,benefits:n,ctaLabel:r,ctaLeftIcon:i,onAction:a}){return(0,Q.jsx)(X,{title:e,subtitle:t,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,Q.jsx)(`ul`,{className:`space-y-3`,children:n.map(({icon:e,text:t})=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md`,style:{background:`var(--surface-base)`},children:(0,Q.jsx)(e,{size:14,style:{color:`var(--content-secondary)`},"aria-hidden":!0})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]},t))}),(0,Q.jsx)(s,{variant:`primary`,size:`regular`,leftIcon:i,onClick:a,className:`self-start`,children:r})]})})}function Gn(){let e=ut(),t=mt(),n=e?`ios`:t?`android`:null,r=n?F(n):null;return r?(0,Q.jsx)(Wn,{title:`Get the ${r.appName} App`,subtitle:`The Vellum ${r.appName} app gives you a native experience.`,benefits:[{icon:b,text:`Push notifications`},{icon:hn,text:`Biometric login`},{icon:_n,text:`Native haptics`},{icon:oe,text:`Home screen access`}],ctaLabel:`Download`,ctaLeftIcon:(0,Q.jsx)(oe,{size:16}),onAction:()=>{I(r.platform),te(r.platform)}}):null}var Kn=`0.10.0`;function qn(){return Be(Kn)}var Jn=[`login.tailscale.com`,`tailscale.com`,`www.tailscale.com`,`ngrok.com`,`dashboard.ngrok.com`,`dash.cloudflare.com`,`cloudflare.com`,`www.cloudflare.com`];function Yn(e){let t;try{t=new URL(e).hostname}catch{return!1}return Jn.includes(t)}function Xn(e){let t;try{t=new URL(e).hostname}catch{return null}return Jn.includes(t)?t.includes(`tailscale`)?`Tailscale`:t.includes(`ngrok`)?`ngrok`:t.includes(`cloudflare`)?`Cloudflare`:null:null}function Zn(e){try{let t=new URL(e).hostname;return t===`localhost`||t===`[::1]`||/^127(?:\.\d{1,3}){3}$/.test(t)}catch{return!1}}function Qn(e){let t=new URL(e);t.search=``,t.hash=``;let n=t.pathname.split(`/`).filter(Boolean),r=n.indexOf(`assistant`);return r>=0&&n.splice(r),t.pathname=n.length?`/${n.join(`/`)}`:`/`,t.toString().replace(/\/+$/,``)}function $n(e){let t;try{t=Qn(e)}catch{return{ok:!1,reason:`unparseable`}}return Zn(t)?{ok:!1,reason:`loopback`}:Yn(t)?{ok:!1,reason:`service-website`}:new URL(t).protocol===`https:`?{ok:!0,url:t}:{ok:!1,reason:`non-https`}}function er(e){let t=new URL(e.verificationUri);return t.hash=new URLSearchParams({device_code:e.deviceCode}).toString(),t.toString()}function tr(e,t){switch(e){case`unparseable`:return`Enter a valid URL, e.g. https://your-assistant.ts.net.`;case`loopback`:return`This is a loopback address other devices can't reach. Enter the assistant's public https URL.`;case`non-https`:return`The URL must use https so your devices can connect securely.`;case`service-website`:return`This is ${t&&Xn(t)||`the tunnel provider`}'s website, not your assistant's address. Run \`vellum tunnel\` on the host to get one.`}}var nr=`/v1/remote-web/pairing-challenge`,rr=`/v1/remote-web/pairing-verification`,ir="If a scan can't connect, make sure a tunnel is running on the host (`vellum tunnel`) and the public URL points at it, then generate a new code.",ar=class extends Error{hint;constructor(e,t){super(e),this.name=`PairDeviceError`,this.hint=t}};function or(){if(typeof window>`u`)return null;let e=je(),t=Oe(e);return t?{base:`${window.location.origin}${t}`,assistantName:e?.name?.trim()||null,ingressUrl:e?.ingressUrl?.trim()||null}:null}function sr(e){let t=e?.error?.message;return typeof t==`string`&&t.trim()?t:null}async function cr(e,t,n){let r;try{r=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:n})}catch(e){throw e instanceof DOMException&&e.name===`AbortError`?e:new ar(`Couldn't reach the assistant. Make sure it's running and try again.`)}let i=await r.json().catch(()=>null);if(!r.ok)throw new ar(sr(i)??`Pairing failed (HTTP ${r.status}).`,ir);if(typeof i!=`object`||!i)throw new ar(`The assistant returned an unexpected response.`);return i}async function lr(e){let{base:t,publicBaseUrl:n,signal:r}=e,i=await cr(`${t}${nr}`,{publicBaseUrl:n},r);return await cr(`${t}${rr}`,{userCode:i.userCode},r),{pairUrl:er(i),expiresAt:i.expiresAt}}var ur=Object.defineProperty,dr=Object.getOwnPropertySymbols,fr=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,mr=(e,t,n)=>t in e?ur(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||={})fr.call(t,n)&&mr(e,n,t[n]);if(dr)for(var n of dr(t))pr.call(t,n)&&mr(e,n,t[n]);return e},gr=(e,t)=>{var n={};for(var r in e)fr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&dr)for(var r of dr(e))t.indexOf(r)<0&&pr.call(e,r)&&(n[r]=e[r]);return n},_r;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(_r||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(_r||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(_r||={});var vr=_r,yr={L:vr.QrCode.Ecc.LOW,M:vr.QrCode.Ecc.MEDIUM,Q:vr.QrCode.Ecc.QUARTILE,H:vr.QrCode.Ecc.HIGH},br=128,xr=`L`,Sr=`#FFFFFF`,Cr=`#000000`,wr=!1,Tr=1,Er=4,Dr=0,Or=.1;function kr(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function Ar(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function jr(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*Or),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function Mr(e,t){return t==null?e?Er:Dr:Math.max(Math.floor(t),0)}function Nr({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=Z.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...vr.QrSegment.makeSegments(t)),e),[]);return vr.QrCode.encodeSegments(r,yr[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=Z.useMemo(()=>{let e=c.getModules(),t=Mr(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:jr(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var Pr=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Fr=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=br,level:a=xr,bgColor:o=Sr,fgColor:s=Cr,includeMargin:c=wr,minVersion:l=Tr,boostLevel:u,marginSize:d,imageSettings:f}=n,p=gr(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=gr(p,[`style`]),g=f?.src,_=Z.useRef(null),v=Z.useRef(null),y=Z.useCallback(e=>{_.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[b,x]=Z.useState(!1),{margin:S,cells:C,numCells:w,calculatedImageSettings:T}=Nr({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});Z.useEffect(()=>{if(_.current!=null){let e=_.current,t=e.getContext(`2d`);if(!t)return;let n=C,r=v.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=Ar(C,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/w*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,w,w),t.fillStyle=s,Pr?t.fill(new Path2D(kr(n,S))):C.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+S,n+S,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+S,T.y+S,T.w,T.h)}}),Z.useEffect(()=>{x(!1)},[g]);let E=hr({height:i,width:i},m),D=null;return g!=null&&(D=Z.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{x(!0)},ref:v,crossOrigin:T?.crossOrigin})),Z.createElement(Z.Fragment,null,Z.createElement(`canvas`,hr({style:E,height:i,width:i,ref:y,role:`img`},h)),D)});Fr.displayName=`QRCodeCanvas`;var Ir=Z.forwardRef(function(e,t){let n=e,{value:r,size:i=br,level:a=xr,bgColor:o=Sr,fgColor:s=Cr,includeMargin:c=wr,minVersion:l=Tr,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=gr(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:_,calculatedImageSettings:v}=Nr({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),y=g,b=null;p!=null&&v!=null&&(v.excavation!=null&&(y=Ar(g,v.excavation)),b=Z.createElement(`image`,{href:p.src,height:v.h,width:v.w,x:v.x+h,y:v.y+h,preserveAspectRatio:`none`,opacity:v.opacity,crossOrigin:v.crossOrigin}));let x=kr(y,h);return Z.createElement(`svg`,hr({height:i,width:i,viewBox:`0 0 ${_} ${_}`,ref:t,role:`img`},m),!!d&&Z.createElement(`title`,null,d),Z.createElement(`path`,{fill:o,d:`M0,0 h${_}v${_}H0z`,shapeRendering:`crispEdges`}),Z.createElement(`path`,{fill:s,d:x,shapeRendering:`crispEdges`}),b)});Ir.displayName=`QRCodeSVG`;function Lr(e){if(!Number.isFinite(e)||e<=0)return`Single-use.`;let t=Math.ceil(e/1e3);return`Expires in ${Math.floor(t/60)}:${(t%60).toString().padStart(2,`0`)} · single-use.`}function Rr({pairUrl:e,remainingMs:t,expired:n,copied:r,onCopy:i}){return n?(0,Q.jsx)(z,{tone:`warning`,title:`This pairing code expired.`,children:`Generate a new code to pair a device.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(`div`,{className:`w-fit rounded-lg bg-white p-3`,children:(0,Q.jsx)(Ir,{value:e,size:192,level:`M`,title:`Device pairing QR code`})}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(`code`,{"data-testid":`pair-device-url`,className:`min-w-0 flex-1 truncate rounded-md bg-[var(--surface-active)] px-2.5 py-1.5 text-body-small-default text-[var(--content-secondary)]`,children:e}),(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,leftIcon:r?(0,Q.jsx)(x,{}):(0,Q.jsx)(_,{}),onClick:()=>i(e),children:r?`Copied`:`Copy`})]}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:Lr(t)})]})}var zr=`vellum:pair-device:public-base-url`;function Br(e){let n=e?.trim();if(n)return{url:n,source:`tunnel`};let r=t(zr,``).trim();return r?{url:r,source:`stored`}:{url:``,source:`none`}}function Vr(e,t){let[r]=(0,Z.useState)(()=>Br(t)),[i,o]=(0,Z.useState)(r.url),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)({kind:`idle`}),[d,f]=(0,Z.useState)(()=>Date.now()),p=(0,Z.useRef)(null);(0,Z.useEffect)(()=>()=>p.current?.abort(),[]),(0,Z.useEffect)(()=>{if(l.kind!==`ready`)return;f(Date.now());let e=setInterval(()=>f(Date.now()),1e3);return()=>clearInterval(e)},[l]);let m=(0,Z.useCallback)(e=>{o(e),c(null)},[]),h=(0,Z.useCallback)(()=>{if(!e)return;let t=i.trim(),r=$n(t);if(!r.ok){c(tr(r.reason,t));return}c(null),p.current?.abort();let o=new AbortController;p.current=o,u({kind:`minting`}),(async()=>{try{let t=await lr({base:e,publicBaseUrl:r.url,signal:o.signal});if(o.signal.aborted)return;n(zr,r.url),u({kind:`ready`,pairUrl:t.pairUrl,expiresAtMs:Date.parse(t.expiresAt)})}catch(e){if(o.signal.aborted)return;if(e instanceof ar){u({kind:`error`,message:e.message,hint:e.hint});return}a(e,{context:`pair-device-mint`}),u({kind:`error`,message:`Something went wrong while generating the code.`})}})()},[e,i]),g=l.kind===`ready`?Math.max(0,l.expiresAtMs-d):0,_=l.kind===`ready`&&g<=0;return{publicBaseUrl:i,setPublicBaseUrl:m,prefillSource:r.source,inputError:s,phase:l,remainingMs:g,expired:_,generate:h}}function Hr(){let e=or(),t=qn(),n=q.use.webRemoteIngress(),r=Vr(e?.base??null,e?.ingressUrl??null),{copy:i,copied:a}=tn({errorMessage:`Could not copy the pairing address.`});if(!e||!t||!n)return null;let{phase:o}=r,c=o.kind===`minting`,l=o.kind===`ready`,u=r.prefillSource===`tunnel`,d=r.prefillSource===`none`&&r.publicBaseUrl.trim()===``,f=c?`Generating…`:l?`Generate new code`:`Generate pairing QR`;return(0,Q.jsx)(X,{title:`Pair a device`,subtitle:`Scan with another device's camera — or open the link on it — to use ${e.assistantName??`this assistant`} there.`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[d&&(0,Q.jsx)(z,{tone:`info`,title:`No tunnel detected`,children:"On this computer, run `vellum tunnel --provider tailscale` (or another provider) — its address appears here."}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,Q.jsx)(B,{label:`Public URL`,fullWidth:!0,placeholder:`https://your-assistant.ts.net`,helperText:u?"This address comes from `vellum tunnel` on this computer. Edit it if your devices reach this assistant at a different URL.":`The https address your devices can reach this assistant at (your Tailscale URL, or another tunnel's).`,value:r.publicBaseUrl,errorText:r.inputError??void 0,disabled:c,onChange:e=>r.setPublicBaseUrl(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),r.generate())}}),(0,Q.jsx)(s,{variant:`primary`,className:`self-start`,disabled:c||r.publicBaseUrl.trim()===``,onClick:r.generate,children:f})]}),o.kind===`error`&&(0,Q.jsx)(z,{tone:`error`,title:o.message,children:o.hint}),l&&(0,Q.jsx)(Rr,{pairUrl:o.pairUrl,remainingMs:r.remainingMs,expired:r.expired,copied:a,onCopy:i})]})})}async function Ur(){if(!W())return[];let e=window.vellum;return e?.hotkeys?e.hotkeys.get():[]}async function Wr(e,t){if(!W())return;let n=window.vellum;n?.hotkeys&&await n.hotkeys.set(e,t)}function Gr(e){if(!W())return()=>{};let t=window.vellum;return t?.hotkeys?t.hotkeys.onChange(e):()=>{}}var Kr={ArrowUp:`Up`,ArrowDown:`Down`,ArrowLeft:`Left`,ArrowRight:`Right`,Enter:`Return`,NumpadEnter:`Return`,Space:`Space`,Tab:`Tab`,Escape:`Escape`,Backspace:`Backspace`,Delete:`Delete`,Insert:`Insert`,Home:`Home`,End:`End`,PageUp:`PageUp`,PageDown:`PageDown`,Minus:`-`,Equal:`=`,BracketLeft:`[`,BracketRight:`]`,Backslash:`\\`,Semicolon:`;`,Quote:`'`,Backquote:"`",Comma:`,`,Period:`.`,Slash:`/`},qr=new Set([`MetaLeft`,`MetaRight`,`ControlLeft`,`ControlRight`,`AltLeft`,`AltRight`,`ShiftLeft`,`ShiftRight`]),Jr=e=>{let t=e.code;return qr.has(t)?null:/^Key[A-Z]$/.test(t)?t.slice(3):/^Digit[0-9]$/.test(t)?t.slice(5):/^Numpad[0-9]$/.test(t)?`num${t.slice(6)}`:/^F[0-9]{1,2}$/.test(t)?t:Kr[t]??null},Yr=e=>{let t=Jr(e);if(t===null)return null;let n=[];return e.metaKey&&n.push(`CmdOrCtrl`),e.ctrlKey&&n.push(`Control`),e.altKey&&n.push(`Alt`),e.shiftKey&&n.push(`Shift`),[...n,t].join(`+`)},Xr=(e,t,n)=>n===``?null:e.find(e=>e.key!==t&&e.accelerator===n)??null,Zr=[{scope:`global`,title:`Global shortcuts`,description:`Work anywhere, even when Vellum is in the background.`},{scope:`menu`,title:`App shortcuts`,description:`Work while a Vellum window is focused.`}];function Qr({hotkey:e,recording:t,conflictLabel:n,onStartRecording:r,onCancelRecording:i,onReset:a,onRemove:o}){let c=e.accelerator===``,l=e.override!==null;return(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-lighter text-[var(--content-default)]`,children:e.label}),n!==null&&(0,Q.jsxs)(`div`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:[`Already used by `,n]})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:`Recording… press a shortcut, or Esc to cancel`}):c?(0,Q.jsx)(`span`,{className:`text-body-small-default italic text-[var(--content-disabled)]`,children:`Disabled`}):(0,Q.jsx)(he,{accelerator:e.accelerator}),t?(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:i,children:`Cancel`}):(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,onClick:r,"aria-label":`Record shortcut for ${e.label}`,children:`Record`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:!l,leftIcon:(0,Q.jsx)(ae,{className:`h-3.5 w-3.5`}),onClick:a,"aria-label":`Reset ${e.label} to default`}),(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:c,leftIcon:(0,Q.jsx)(ue,{className:`h-3.5 w-3.5`}),onClick:o,"aria-label":`Remove ${e.label} binding`})]})]})}function $r(){let[e,t]=(0,Z.useState)([]),[n,r]=(0,Z.useState)(null),[i,a]=(0,Z.useState)(null),o=(0,Z.useCallback)(()=>{Ur().then(t)},[]);(0,Z.useEffect)(()=>(o(),Gr(t)),[o]);let s=(0,Z.useCallback)(()=>{r(null),a(null)},[]);(0,Z.useEffect)(()=>{if(n===null)return;let t=t=>{if(t.preventDefault(),t.stopPropagation(),t.code===`Escape`){s();return}let r=Yr(t);if(r===null)return;let i=Xr(e,n,r);if(i!==null){a({key:n,label:i.label});return}Wr(n,r).then(o),s()};return window.addEventListener(`keydown`,t,!0),()=>window.removeEventListener(`keydown`,t,!0)},[n,e,o,s]);let c=(0,Z.useCallback)(e=>{a(null),r(e)},[]),l=(0,Z.useCallback)(t=>{let n=Xr(e,t,e.find(e=>e.key===t)?.defaultAccelerator??``);if(n!==null){r(null),a({key:t,label:n.label});return}s(),Wr(t,null).then(o)},[e,o,s]),u=(0,Z.useCallback)(e=>{s(),Wr(e,``).then(o)},[o,s]),d=(0,Z.useMemo)(()=>Zr.map(t=>({...t,commands:e.filter(e=>e.rebindable&&e.scope===t.scope)})).filter(e=>e.commands.length>0),[e]);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[i!==null&&(0,Q.jsxs)(z,{tone:`warning`,children:[`That shortcut is already used by `,i.label,`.`,` `,n===null?`Remove or change that binding before resetting.`:`Pick a different combination, or press Esc to cancel.`]}),d.map(e=>(0,Q.jsxs)(g,{bordered:!0,children:[(0,Q.jsxs)(`div`,{className:`mb-2`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-emphasised text-[var(--content-default)]`,children:e.title}),(0,Q.jsx)(`div`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:e.description})]}),(0,Q.jsx)(`div`,{className:`divide-y divide-[var(--border-base)]`,children:e.commands.map(e=>(0,Q.jsx)(Qr,{hotkey:e,recording:n===e.key,conflictLabel:i!==null&&i.key===e.key?i.label:null,onStartRecording:()=>c(e.key),onCancelRecording:s,onReset:()=>l(e.key),onRemove:()=>u(e.key)},e.key))})]},e.scope))]})}async function ei(){if(!W())return!1;let e=window.vellum;return e?.launchAtLogin?e.launchAtLogin.get():!1}async function ti(e){if(!W())return;let t=window.vellum;t?.launchAtLogin&&await t.launchAtLogin.set(e)}function ni(){let e=ne.useValue(),t=R.useValue(),n=!Ut(),r=ft()?`Cmd`:`Ctrl`;return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Composer`}),(0,Q.jsxs)(`div`,{className:`mt-2 space-y-4`,children:[n&&(0,Q.jsx)(ve,{checked:e,onChange:ne.save,label:`Send with ${r}+Enter`,helperText:`When enabled, Enter inserts a new line and ${r}+Enter sends.`}),(0,Q.jsx)(ve,{checked:t,onChange:R.save,label:`Show context window usage`,helperText:`Adds a ring to the composer tracking how full the context window is. Your assistant compacts its context automatically either way.`})]})]})}function ri(){let[e,t]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{ei().then(t)},[]);let n=async e=>{t(e);try{await ti(e)}catch{t(!e)}};return(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Launch at Login`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Automatically start Vellum when you log in to your Mac.`}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)(ve,{checked:e,onChange:e=>void n(e),"aria-label":`Launch at Login`})})]})}function ii({open:e,onClose:t}){return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>{e||t()},children:(0,Q.jsxs)(V.Content,{size:`lg`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:`Preferences`}),(0,Q.jsx)(V.Description,{children:`Customize shortcuts and how Vellum behaves on this device.`})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[W()&&(0,Q.jsxs)(`section`,{children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Keyboard Shortcuts`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Customize the shortcuts for Vellum's commands.`}),(0,Q.jsx)(`div`,{className:`mt-2`,children:(0,Q.jsx)($r,{})})]}),(0,Q.jsx)(ni,{}),W()&&(0,Q.jsx)(ri,{})]})})]})})}function ai(e){return e===`preview`?`preview`:`stable`}function oi(e){if(!e)return`Unknown`;let t=new Date(e);return Number.isNaN(t.getTime())?`Unknown`:t.toLocaleString(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function si(e){return e.source_release_version?`Stable ${e.source_release_version}`:e.snapshot_name}function ci(e){return e.filter(e=>e.ready_to_use)}function li(e){return e?.feature_enabled===!1}function ui({assistantId:e,onComplete:t}){let n=q.use.previewChannel(),r=d(),[i,a]=(0,Z.useState)(),[o,s]=(0,Z.useState)(!1),[c,l]=(0,Z.useState)(!1),[u,m]=(0,Z.useState)(`restore_backup`),[h,g]=(0,Z.useState)(``),_=bt({path:{assistant_id:e}}),v=yt({path:{assistant_id:e}}),y=Ft({path:{id:e}}),{data:b,isLoading:x,isError:C}=f({..._,enabled:n,retry:!1}),w=b?.preview_backups??[],T=(0,Z.useMemo)(()=>ci(w),[w]),E=T[0],O=T.find(e=>e.snapshot_name===h)??E,k=()=>{r.invalidateQueries({queryKey:v}),r.invalidateQueries({queryKey:y}),t?.()},A=p(zt()),j=p(jt()),M=ai(b?.current_channel),N=A.isPending||j.isPending,ee=N||li(b)||!b?.latest_preview_release,P=u===`restore_backup`&&!O;if((0,Z.useEffect)(()=>{a(M===`preview`?`release-channel`:void 0)},[M]),!n)return null;let F=b?.standard_upgrade_available??!1;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(me.Root,{type:`single`,collapsible:!0,value:i,onValueChange:e=>a(e||void 0),className:`mt-5 border-t border-[var(--border-base)] pt-5`,children:(0,Q.jsxs)(me.Item,{value:`release-channel`,id:`preview-release-channel`,children:[(0,Q.jsxs)(me.Trigger,{className:`group justify-between gap-3`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-secondary)]`,children:`Release Channel`}),b&&(0,Q.jsx)(_e,{tone:M===`preview`?`warning`:`neutral`,children:M===`preview`?`Preview`:`Stable`})]}),(0,Q.jsx)(S,{className:`h-4 w-4 shrink-0 text-[var(--content-tertiary)] transition-transform group-data-[state=open]:rotate-180`})]}),(0,Q.jsx)(me.Content,{children:(0,Q.jsxs)(`div`,{className:`mt-4 space-y-4`,children:[x&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Loading release channel...`]}),C&&(0,Q.jsx)(z,{tone:`error`,title:`Could not load release channel status`,children:`Refresh this page before changing release channels.`}),b&&(0,Q.jsxs)(Q.Fragment,{children:[li(b)&&(0,Q.jsx)(z,{tone:`neutral`,title:`Preview channel is unavailable`,children:`The Preview channel is not enabled for this assistant.`}),M===`stable`?(0,Q.jsx)(di,{status:b,isChangingChannel:N,optInDisabled:ee,onOptIn:()=>s(!0)}):(0,Q.jsx)(fi,{status:b,isChangingChannel:N,onOptOut:()=>{let e=E;g(e?.snapshot_name??``),m(e?`restore_backup`:F?`standard_upgrade`:`restore_backup`),l(!0)}})]})]})})]})}),(0,Q.jsx)(mi,{open:o,isPending:A.isPending,previewVersion:b?.latest_preview_release?.version,onConfirm:async()=>{try{let t=await A.mutateAsync({path:{assistant_id:e}});H.success(t.detail||`Preview channel enabled.`),s(!1),k()}catch(e){H.error(G(e,void 0,`Could not enable Preview channel.`))}},onCancel:()=>s(!1)}),(0,Q.jsx)(hi,{open:c,backups:T,mode:u,selectedSnapshotName:O?.snapshot_name??``,isPending:j.isPending,restoreModeDisabled:P,standardUpgradeAvailable:F,onModeChange:m,onSnapshotChange:g,onConfirm:async()=>{if(!P)try{let t=await j.mutateAsync({path:{assistant_id:e},body:u===`restore_backup`?{mode:`restore_backup`,snapshot_name:O?.snapshot_name}:{mode:`standard_upgrade`}});H.success(t.detail||`Stable channel enabled.`),l(!1),k()}catch(e){H.error(G(e,void 0,`Could not switch to Stable.`))}},onCancel:()=>l(!1)})]})}function di({status:e,isChangingChannel:t,optInDisabled:n,onOptIn:r}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(pi,{status:e}),!e.latest_preview_release&&(0,Q.jsx)(z,{tone:`neutral`,title:`No Preview release is available`,children:`Stable remains the only available release channel.`}),(0,Q.jsx)(s,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(M,{}),disabled:n,onClick:r,children:`Opt in to Preview`})]})}function fi({status:e,isChangingChannel:t,onOptOut:n}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(pi,{status:e}),(0,Q.jsx)(s,{variant:`outlined`,leftIcon:t?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ae,{}),disabled:t,onClick:n,children:`Switch back to Stable`})]})}function pi({status:e}){return(0,Q.jsxs)(`dl`,{className:`grid gap-3 text-body-medium-lighter sm:grid-cols-2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Stable`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_stable_release?.version??`None`})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`dt`,{className:`text-[var(--content-tertiary)]`,children:`Latest Preview`}),(0,Q.jsx)(`dd`,{className:`break-all text-[var(--content-default)]`,children:e.latest_preview_release?.version??`None`})]})]})}function mi({open:e,isPending:t,previewVersion:n,onConfirm:r,onCancel:i}){return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(V.Content,{size:`md`,hideCloseButton:t,children:[(0,Q.jsxs)(V.Header,{icon:le,children:[(0,Q.jsx)(V.Title,{children:`Opt in to Preview`}),(0,Q.jsx)(V.Description,{children:`Preview releases may be unstable. A 90-day safety backup is taken before the image changes.`})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(z,{tone:`warning`,title:`Data loss may occur when returning to Stable`,children:`Preview data may not be compatible with the Stable channel. The safety backup lets you restore the Stable-channel data that existed before opt-in.`}),(0,Q.jsxs)(`ol`,{className:`list-decimal space-y-2 pl-5 text-body-medium-lighter text-[var(--content-secondary)]`,children:[(0,Q.jsx)(`li`,{children:`Create and verify a Preview safety backup.`}),(0,Q.jsxs)(`li`,{children:[`Switch to Preview image `,n??`latest`,`.`]}),(0,Q.jsx)(`li`,{children:`Run the normal upgrade path and wait for health.`})]})]})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(s,{variant:`outlined`,disabled:t,onClick:i,children:`Cancel`}),(0,Q.jsx)(s,{variant:`primary`,disabled:t,leftIcon:t?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(M,{}),onClick:r,children:t?`Switching...`:`Take Backup and Switch`})]})]})})}function hi({open:e,backups:t,mode:n,selectedSnapshotName:r,isPending:i,restoreModeDisabled:a,standardUpgradeAvailable:o,onModeChange:c,onSnapshotChange:l,onConfirm:u,onCancel:d}){return(0,Q.jsx)(V.Root,{open:e,onOpenChange:e=>!e&&d(),children:(0,Q.jsxs)(V.Content,{size:`md`,hideCloseButton:i,children:[(0,Q.jsxs)(V.Header,{icon:le,children:[(0,Q.jsx)(V.Title,{children:`Switch back to Stable`}),(0,Q.jsx)(V.Description,{children:`Choose how this assistant should leave the Preview channel.`})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsxs)(fe,{value:n,onValueChange:c,disabled:i,"aria-label":`Stable channel return method`,children:[(0,Q.jsx)(ge,{value:`restore_backup`,disabled:t.length===0,label:`Restore safety backup`,helperText:`Return to the Stable-channel data captured before Preview opt-in.`}),(0,Q.jsx)(ge,{value:`standard_upgrade`,disabled:!o,label:`Switch to Stable without restoring backup`,helperText:o?`Keep the current data and directly switch to the Stable image.`:`Unavailable because the latest Stable release is older than this assistant's Preview release.`})]}),n===`restore_backup`&&t.length>0&&(0,Q.jsxs)(`label`,{className:`flex flex-col gap-1 text-body-medium-default text-[var(--content-secondary)]`,children:[`Safety backup`,(0,Q.jsx)(be,{value:r,onChange:l,disabled:i,options:t.map(e=>({value:e.snapshot_name,label:`${si(e)} - ${oi(e.created_at)}`}))})]}),n===`restore_backup`&&t.length===0&&!o&&(0,Q.jsx)(z,{tone:`error`,title:`Stable requires a safety backup`,children:`This Preview release is newer than the latest Stable release, so switching directly is blocked. Wait for a newer Stable release, or run Vellum Doctor if the safety backup is missing.`}),n===`standard_upgrade`&&(0,Q.jsx)(z,{tone:`error`,title:`Preview data may not survive this`,children:`Switching directly to the Stable image without restoring the safety backup may cause data loss or leave the assistant unusable if Preview data is incompatible with Stable.`})]})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(s,{variant:`outlined`,disabled:i,onClick:d,children:`Cancel`}),(0,Q.jsx)(s,{variant:n===`standard_upgrade`?`danger`:`primary`,disabled:i||a||n===`standard_upgrade`&&!o,leftIcon:i?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),onClick:u,children:i?`Switching...`:`Switch to Stable`})]})]})})}var gi=new Set([`exceeds_machine_tier`,`exceeds_storage_tier`]);function _i(e,t){return e&&typeof e==`object`&&!Array.isArray(e)&&`error`in e&&typeof e.error==`string`&&gi.has(e.error)?`That size isn't available on your plan.`:G(e,void 0,t)}function vi({assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}){let o=c(),l=pt(),d=f(Lt()),p=d.data,m=!e.is_local,h=p?.plan_id===`pro`,g=f({...Nt(),enabled:h}),_=e.machine_size||`small`,v=rn(g.data?.max_machine_tier??null),y=(0,Z.useMemo)(()=>sn(v,_,(0,Q.jsx)(_e,{tone:`positive`,children:`Current`})),[v,_]),b=g.data?.selected_storage_gib??null,[x,S]=(0,Z.useState)(!1),C=v.length>0?v[v.length-1]:null,[w,E]=(0,Z.useState)(null),O=w??C??_,[k,A]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(null),N=Ot({onSuccess:(e,n)=>{H.success(`Resize started. Changes will apply shortly.`,{id:`assistant-resize`}),M(null),E(null),S(!1),n.body?.machine_size==null?i():a(t)},onError:e=>{M(_i(e,`Failed to resize assistant. Please try again.`))}});if(d.isError&&p==null)return(0,Q.jsx)(X,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(z,{tone:`error`,children:`Could not load your subscription. Please try again.`})});let ee=h&&v.includes(O)&&O!==_?O:null,P=h&&b!=null&&!0,F=h&&v.length>0&&on(_)<on(v[v.length-1]),I=N.isPending||r,L=b==null?t?.disk?.totalMb??null:b*1024,R=t?.disk&&L!=null?{value:t.disk.usedMb,max:L,caption:`${pn(t.disk.usedMb)} of ${pn(L)}`}:null,te=t?.cpu?{value:t.cpu.currentPercent,max:100,caption:`${t.cpu.currentPercent.toFixed(1)}%`}:null,ne=t?.memory?{value:t.memory.currentMb,max:t.memory.maxMb,caption:`${pn(t.memory.currentMb)} of ${pn(t.memory.maxMb)}`}:null,re=l?null:(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,onClick:()=>A(!0),children:`Resize`}),ae=m?h?P?(0,Q.jsxs)(`button`,{type:`button`,disabled:I,onClick:()=>S(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(se,{className:`h-3.5 w-3.5`}),`Increase Storage`]}):(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:I,onClick:()=>S(!0),children:`Resize`}):re:null,oe=m?h?F?(0,Q.jsxs)(`button`,{type:`button`,disabled:I,onClick:()=>S(!0),className:`flex items-center gap-1.5 rounded-lg border border-amber-500/30 bg-amber-500/15 px-3 py-1.5 text-body-small-default font-medium text-amber-400 transition-colors hover:bg-amber-500/25 disabled:opacity-50`,children:[(0,Q.jsx)(se,{className:`h-3.5 w-3.5`}),`Increase Size`]}):(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,disabled:I,onClick:()=>S(!0),children:`Resize`}):re:null;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(X,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,compactAccessory:!0,accessory:(0,Q.jsx)(s,{variant:`ghost`,size:`compact`,iconOnly:n||r?(0,Q.jsx)(D,{className:`animate-spin`}):(0,Q.jsx)(ie,{}),tooltip:r?`Applying resize…`:`Refresh resource metrics`,"aria-label":`Refresh resource metrics`,disabled:n||r,onClick:()=>void i()}),children:(0,Q.jsxs)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr]`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(T,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Disk`})]}),ae]}),(0,Q.jsxs)(`div`,{className:`mt-auto flex flex-col gap-1 pt-3`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Storage`}),R?(0,Q.jsx)(ln,{value:R.value,max:R.max,caption:R.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Unavailable`})]})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col rounded-lg bg-[var(--surface-base)] p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-[var(--content-tertiary)]`,children:(0,Q.jsx)(gn,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Machine`}),(0,Q.jsx)(_e,{tone:`neutral`,children:an[_]})]}),oe]}),(0,Q.jsxs)(`div`,{className:`mt-auto grid grid-cols-2 gap-3 pt-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`CPU`}),te?(0,Q.jsx)(ln,{value:te.value,max:te.max,caption:te.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`Memory`}),ne?(0,Q.jsx)(ln,{value:ne.value,max:ne.max,caption:ne.caption}):n?(0,Q.jsx)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:(0,Q.jsx)(D,{className:`h-3 w-3 animate-spin`})}):(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-tertiary)]`,children:`—`})]})]})]})]})}),(0,Q.jsx)(V.Root,{open:k,onOpenChange:e=>{e||A(!1)},children:(0,Q.jsxs)(V.Content,{size:`sm`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:`Upgrade your plan`}),(0,Q.jsx)(V.Description,{children:`Move to a higher plan for more power, more storage, and a larger credit bundle.`})]}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(s,{variant:`ghost`,onClick:()=>A(!1),children:`Cancel`}),(0,Q.jsx)(s,{onClick:()=>{A(!1),o(J.plans)},children:`Upgrade`})]})]})}),(0,Q.jsx)(V.Root,{open:x,onOpenChange:e=>{e||(S(!1),E(null),M(null))},children:(0,Q.jsxs)(V.Content,{size:`sm`,children:[(0,Q.jsxs)(V.Header,{icon:gn,children:[(0,Q.jsx)(V.Title,{children:`Resize Assistant`}),(0,Q.jsx)(V.Description,{children:`Resize your assistant's compute and storage. Your assistant will briefly restart.`})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[v.length===0?(0,Q.jsx)(z,{tone:`warning`,children:`No machine tier configured. Visit the community for help.`}):(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Q.jsx)(`span`,{className:`text-label-medium-default text-[var(--content-secondary)]`,children:`Machine Size`}),(0,Q.jsx)(be,{options:y,value:O,onChange:E,"aria-label":`Compute machine size`,"data-testid":`resize-machine-size`})]}),P?(0,Q.jsx)(z,{tone:`info`,children:`Storage will be expanded to ${b} GB.`}):(0,Q.jsx)(z,{tone:`neutral`,children:`Storage will not change.`}),j&&(0,Q.jsx)(z,{tone:`error`,children:j})]})}),(0,Q.jsxs)(V.Footer,{className:l?`justify-end`:`items-center justify-between`,children:[l?null:(0,Q.jsxs)(`span`,{className:`text-label-small-default text-[var(--content-tertiary)]`,children:[`Need more?`,` `,(0,Q.jsx)(u,{to:J.plans,className:`text-[var(--content-secondary)] underline decoration-[var(--border-element)] underline-offset-2 transition-colors hover:text-[var(--content-default)]`,onClick:()=>S(!1),children:`Upgrade plan`})]}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(s,{variant:`ghost`,onClick:()=>{S(!1),E(null),M(null)},children:`Cancel`}),(0,Q.jsx)(s,{disabled:ee==null&&!P||I,leftIcon:I?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:()=>{M(null);let t={};ee!=null&&(t.machine_size=ee),P&&b!=null&&(t.storage_gib=b),N.mutate({path:{id:e.id},body:t})},children:j?`Retry`:`Apply`})]})]})]})})]})}function yi({assistantId:e}){let t=c(),[n,r]=(0,Z.useState)(!1),[i,a]=(0,Z.useState)(!1);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(s,{variant:`dangerOutline`,onClick:()=>r(!0),className:`shrink-0`,children:`Retire Assistant`}),(0,Q.jsx)(Gt,{open:n,isPending:i,onConfirm:async()=>{a(!0);let n=await Wt(e);if(n.ok){r(!1),t(n.nextRoute,{replace:!0});return}H.error(n.error),a(!1),r(!1)},onCancel:()=>r(!1)})]})}function bi(){let e=A(),t=N.useValue();return j(e)?(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:`Show tips`}),(0,Q.jsx)(`p`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Occasional tips in the sidebar that highlight features you haven't tried yet.`})]}),(0,Q.jsx)(ve,{checked:t,onChange:t=>{N.save(t),t||P(`settings`,`dont_show_again`,e)},"aria-label":`Show tips`})]}):null}var xi=`UTC.Africa/Cairo.Africa/Johannesburg.Africa/Lagos.Africa/Nairobi.America/Anchorage.America/Argentina/Buenos_Aires.America/Bogota.America/Chicago.America/Denver.America/Halifax.America/Lima.America/Los_Angeles.America/Mexico_City.America/New_York.America/Phoenix.America/Santiago.America/Sao_Paulo.America/Toronto.America/Vancouver.Asia/Bangkok.Asia/Dubai.Asia/Hong_Kong.Asia/Jakarta.Asia/Jerusalem.Asia/Karachi.Asia/Kolkata.Asia/Kuala_Lumpur.Asia/Manila.Asia/Seoul.Asia/Shanghai.Asia/Singapore.Asia/Taipei.Asia/Tokyo.Australia/Melbourne.Australia/Perth.Australia/Sydney.Europe/Amsterdam.Europe/Athens.Europe/Berlin.Europe/Brussels.Europe/Dublin.Europe/Istanbul.Europe/Lisbon.Europe/London.Europe/Madrid.Europe/Moscow.Europe/Paris.Europe/Rome.Europe/Stockholm.Europe/Vienna.Europe/Warsaw.Europe/Zurich.Pacific/Auckland.Pacific/Honolulu`.split(`.`);function Si(){let e=Intl;if(typeof e.supportedValuesOf==`function`)try{let t=e.supportedValuesOf(`timeZone`);if(t.length>0)return[...t].sort()}catch{}return[...xi].sort()}function Ci(e){let t=e.split(`/`),n=(t[t.length-1]??e).replace(/_/g,` `),r=t.length>1?(t[0]??``).replace(/_/g,` `):``,i=0,a=``;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`shortOffset`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??`GMT`;a=t.startsWith(`GMT`)||t.startsWith(`UTC`)?t:`GMT ${t}`;let n=t.match(/([+-])(\d{1,2})(?::(\d{2}))?/);if(n){let e=n[1]===`-`?-1:1,t=parseInt(n[2]??`0`,10),r=parseInt(n[3]??`0`,10);i=e*(t*60+r)}}catch{return null}return{identifier:e,city:n,region:r,offsetLabel:a,offsetMinutes:i}}function wi(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e,hour:`numeric`,minute:`2-digit`,hour12:!0}).format(new Date)}catch{return``}}function Ti(e){if(!e)return`Not set`;try{let t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`long`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;if(t)return t}catch{}return e.replace(/_/g,` `)}var Ei=200;function Di({value:e,onChange:t}){let[n,r]=(0,Z.useState)(``),i=(0,Z.useMemo)(()=>Si().map(e=>Ci(e)).filter(e=>e!==null),[]),a=n.trim().toLowerCase(),o=(0,Z.useMemo)(()=>(a?i.filter(e=>e.city.toLowerCase().includes(a)||e.region.toLowerCase().includes(a)||e.offsetLabel.toLowerCase().includes(a)||e.identifier.toLowerCase().includes(a)):i).slice(0,Ei),[i,a]),s=(0,Z.useMemo)(()=>o.map(e=>e.identifier),[o]),c=(0,Z.useMemo)(()=>{if(!e)return``;let t=e.split(`/`);return(t[t.length-1]??e).replace(/_/g,` `)},[e]);return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Closest city`}),(0,Q.jsxs)(pe.Root,{className:`w-full md:max-w-[280px]`,options:s,value:e,onSelect:t,onOpenChange:e=>{e||r(``)},autoActivateFirst:a.length>0,children:[(0,Q.jsx)(pe.Input,{type:`text`,"aria-label":`Closest city`,value:n,placeholder:c||`Search city or country...`,onChange:e=>r(e.target.value),fullWidth:!0}),(0,Q.jsx)(pe.List,{"aria-label":`Cities`,className:`absolute left-0 right-0 top-full z-20 mt-1 max-h-[240px] rounded-md border border-[var(--border-base)] bg-[var(--surface-lift)] shadow-lg`,emptyState:(0,Q.jsx)(`p`,{className:`px-3 py-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:`No matching cities`}),children:o.map(e=>(0,Q.jsxs)(pe.Option,{value:e.identifier,className:h(`flex w-full items-center justify-between gap-3 px-3 py-2`,`text-body-medium-lighter text-[var(--content-default)] transition-colors`,`hover:bg-[var(--surface-active)]`,`data-[active]:bg-[var(--surface-active)] aria-selected:bg-[var(--surface-active)]`),children:[(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`truncate text-body-medium-default`,children:e.city}),e.region&&(0,Q.jsx)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:e.region})]}),(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col items-end gap-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(`span`,{children:wi(e.identifier)}),(0,Q.jsx)(`span`,{children:e.offsetLabel})]})]},e.identifier))})]})]}),(0,Q.jsx)(mn,{}),(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`Time zone`}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:Ti(e)})]})]})}function Oi(){let e=Fe.use.activeAssistantId(),[t,n]=(0,Z.useState)(()=>i(`timezone`,``)),o=(0,Z.useRef)(e);(0,Z.useEffect)(()=>{o.current=e},[e]);let s=(0,Z.useRef)(!1),c=(0,Z.useRef)(null),l=(0,Z.useRef)(()=>{}),u=e=>{if(s.current){c.current=e;return}let t=o.current;if(!t){c.current=null;return}s.current=!0,c.current=null,K.patch({url:`/v1/assistants/{assistant_id}/config`,path:{assistant_id:t},body:{ui:{userTimezone:e}},throwOnError:!0}).catch(e=>{a(e,{context:`settings-timezone-override`})}).finally(()=>{s.current=!1;let e=c.current;c.current=null,e!==null&&l.current(e)})};return(0,Z.useEffect)(()=>{l.current=u}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Timezone`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Used when displaying times and scheduling reminders.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(0,Q.jsx)(Di,{value:t,onChange:e=>{n(e),r(`timezone`,e),u(e)}})})]})}var ki=[[`Mon`,0],[`Tue`,1],[`Wed`,2],[`Thu`,3],[`Fri`,4],[`Sat`,5],[`Sun`,6]];function Ai(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(Date.UTC(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate(),t,n));return`${i.getHours().toString().padStart(2,`0`)}:${i.getMinutes().toString().padStart(2,`0`)}`}function ji(e){let[t,n]=e.split(`:`).map(Number),r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate(),t,n);return`${i.getUTCHours().toString().padStart(2,`0`)}:${i.getUTCMinutes().toString().padStart(2,`0`)}`}function Mi(){return Intl.DateTimeFormat(void 0,{timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value??``}function Ni(e){let t=e?.schedule?.window.start??`06:00`,n=e?.schedule?.window.end??`08:00`;return{enabled:e?.enabled??!0,timezone:`UTC`,frequency:e?.schedule?.frequency??`weekly`,daysOfWeek:e?.schedule?.days_of_week??[0],daysOfMonth:e?.schedule?.days_of_month??[],windowStart:Ai(t),windowEnd:Ai(n)}}function Pi({assistantId:e}){let t=d(),{data:n,isLoading:r,isError:i}=f(Tt({path:{id:e}})),a=(0,Z.useMemo)(()=>Ni(n),[n]),[o,c]=(0,Z.useState)(null),l=o??a,u=o!==null,m=(0,Z.useMemo)(()=>Mi(),[]),[h,g]=(0,Z.useState)(null),_=h??l.daysOfMonth.join(`, `),y=p({mutationFn:async t=>{let{data:n}=await $e({path:{id:e},body:t,throwOnError:!0});return n}}),b=e=>{c(t=>({...t??a,...e}))},x=e=>{b({daysOfWeek:l.daysOfWeek.includes(e)?l.daysOfWeek.filter(t=>t!==e):[...l.daysOfWeek,e].sort((e,t)=>e-t)})},S=e=>e.split(`,`).map(e=>parseInt(e.trim(),10)).filter(e=>!isNaN(e)&&e>=1&&e<=31);return r?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-body-medium-lighter text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),`Loading update window settings...`]}):i?(0,Q.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--system-negative-strong)]`,children:`Failed to load update window policy. Refresh the page to try again.`}):(0,Q.jsxs)(`div`,{className:`space-y-6`,children:[(0,Q.jsx)(ve,{checked:l.enabled,onChange:e=>b({enabled:e}),label:`Automatic updates`,helperText:`Update automatically during a configured time window`}),l.enabled&&(0,Q.jsxs)(`div`,{className:`space-y-5`,children:[(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Frequency`}),(0,Q.jsx)(`div`,{className:`max-w-[400px]`,children:(0,Q.jsx)(v,{ariaLabel:`Frequency`,value:l.frequency,onChange:e=>{e!==`monthly`&&g(null),b({frequency:e})},items:[{value:`daily`,label:`Daily`},{value:`weekly`,label:`Weekly`},{value:`monthly`,label:`Monthly`}]})})]}),l.frequency===`weekly`&&(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:`Day(s) of week`}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:ki.map(([e,t])=>(0,Q.jsx)(s,{variant:`outlined`,size:`compact`,active:l.daysOfWeek.includes(t),onClick:()=>x(t),children:e},t))})]}),l.frequency===`monthly`&&(0,Q.jsx)(B,{label:`Day(s) of month`,type:`text`,value:_,onChange:e=>g(e.target.value),onBlur:e=>{let t=S(e.target.value);b({daysOfMonth:t}),g(t.join(`, `))},placeholder:`e.g. 1, 15`,helperText:`Comma-separated day numbers (1–31)`,className:`w-48`}),(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`label`,{className:`block text-body-small-default text-[var(--content-secondary)]`,children:[`Update window`,m?` (${m})`:``]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Q.jsx)(B,{type:`time`,value:l.windowStart,onChange:e=>b({windowStart:e.target.value})}),(0,Q.jsx)(`span`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:`to`}),(0,Q.jsx)(B,{type:`time`,value:l.windowEnd,onChange:e=>b({windowEnd:e.target.value})})]})]})]}),(0,Q.jsx)(s,{variant:`primary`,leftIcon:y.isPending?(0,Q.jsx)(D,{className:`animate-spin`}):void 0,onClick:async()=>{let n=l.frequency===`monthly`&&h!==null?S(h):l.daysOfMonth;try{await y.mutateAsync({enabled:l.enabled,timezone:`UTC`,schedule:{frequency:l.frequency,days_of_week:l.frequency===`weekly`?l.daysOfWeek:[],days_of_month:l.frequency===`monthly`?n:[],window:{start:ji(l.windowStart),end:ji(l.windowEnd)}}}),H.success(`Auto-update policy saved.`),c(null),g(null),t.invalidateQueries({queryKey:kt({path:{id:e}})})}catch{H.error(`Failed to save policy. Please try again.`)}},disabled:y.isPending||!u,children:`Save policy`})]})}function Fi({assistantId:e,open:t,onClose:n}){return(0,Q.jsx)(V.Root,{open:t,onOpenChange:e=>{e||n()},children:(0,Q.jsxs)(V.Content,{size:`md`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:`Update Window`}),(0,Q.jsx)(V.Description,{children:`Configure when automatic updates are applied.`})]}),(0,Q.jsx)(V.Body,{children:(0,Q.jsx)(Pi,{assistantId:e})})]})})}function Ii(e){if(typeof e==`object`&&e&&`code`in e){let t=e.code;if(typeof t==`string`)return t}}function Li({open:e,onOpenChange:t}){let n=d(),[r,i]=(0,Z.useState)(null),[a,o]=(0,Z.useState)(``),[c,l]=(0,Z.useState)(null),u=(0,Z.useRef)(!1),f=(0,Z.useRef)(e),p=()=>n.invalidateQueries({queryKey:Ct()}),m=e=>{ot({path:{id:e}}).catch(()=>void 0).finally(()=>void p())},h=Et({onSuccess:e=>{if(!f.current){m(e.factor_id);return}i(e)},onError:e=>{let n=Ii(e);n===`no_workos_account`?H.error(`Two-factor authentication is only available for Vellum platform accounts.`):n===`throttled`||n===`workos_rate_limited`?H.error(`Too many attempts. Try again in a minute.`):n===`factor_limit_reached`?H.error(`An authenticator app is already set up. Remove it before adding another.`):H.error(`Failed to start setup. Please try again.`),t(!1)}}),g=xt({onSuccess:e=>{e.valid?(u.current=!0,H.success(`Two-factor authentication is on.`),p(),t(!1)):l(`That code didn't match. Check your authenticator app and try again.`)},onError:e=>{let n=Ii(e);if(n===`challenge_already_verified`){u.current=!0,H.success(`Two-factor authentication is on.`),p(),t(!1);return}if(n===`challenge_expired`||n===`challenge_not_found`){r&&m(r.factor_id),i(null),o(``),l(`This setup session expired. Scan the new QR code and try again.`),h.mutate({});return}if(n===`throttled`||n===`workos_rate_limited`){l(`Too many attempts. Wait a minute and try again.`);return}l(`Couldn't verify the code. Wait a moment and try again.`)}});(0,Z.useEffect)(()=>{f.current=e,e&&(u.current=!1,i(null),o(``),l(null),h.mutate({}))},[e]);let v=e=>{!e&&g.isPending||(!e&&r&&!u.current&&m(r.factor_id),t(e))},y=()=>{r&&Xt(r.secret,{successMessage:`Setup key copied.`,errorMessage:`Couldn't copy the setup key.`})},b=()=>{!r||a.length!==6||g.isPending||(l(null),g.mutate({body:{challenge_id:r.challenge_id,code:a}}))};return(0,Q.jsx)(V.Root,{open:e,onOpenChange:v,children:(0,Q.jsxs)(V.Content,{size:`sm`,children:[(0,Q.jsxs)(V.Header,{children:[(0,Q.jsx)(V.Title,{children:`Set up authenticator app`}),(0,Q.jsx)(V.Description,{children:`Scan the QR code with an authenticator app such as Google Authenticator or 1Password, then enter the 6-digit code it shows.`})]}),(0,Q.jsx)(V.Body,{children:r===null?(0,Q.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,Q.jsx)(D,{className:`h-5 w-5 animate-spin text-[var(--content-tertiary)]`})}):(0,Q.jsxs)(`form`,{className:`flex flex-col items-center gap-4`,onSubmit:e=>{e.preventDefault(),b()},children:[(0,Q.jsx)(`img`,{src:r.qr_code,alt:`QR code for your authenticator app`,className:`h-44 w-44 rounded-lg bg-white p-2`}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`span`,{className:`text-body-small-default text-[var(--content-tertiary)]`,children:`Can't scan it? Enter this setup key manually:`}),(0,Q.jsxs)(`button`,{type:`button`,onClick:y,className:`flex cursor-pointer items-center gap-2 self-start font-mono text-body-small-default text-[var(--content-default)] hover:text-[var(--content-emphasised)]`,children:[(0,Q.jsx)(`span`,{className:`break-all text-left`,children:r.secret}),(0,Q.jsx)(_,{className:`h-3.5 w-3.5 shrink-0`})]})]}),(0,Q.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,Q.jsx)(`label`,{htmlFor:`totp-code`,className:`text-body-small-default text-[var(--content-tertiary)]`,children:`6-digit code`}),(0,Q.jsx)(B,{id:`totp-code`,inputMode:`numeric`,autoComplete:`one-time-code`,maxLength:6,placeholder:`123456`,value:a,onChange:e=>o(e.target.value.replace(/\D/g,``).slice(0,6))}),c&&(0,Q.jsx)(`p`,{role:`alert`,className:`text-body-small-default text-[var(--system-negative-strong)]`,children:c})]})]})}),(0,Q.jsxs)(V.Footer,{children:[(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>v(!1),disabled:g.isPending,children:`Cancel`}),(0,Q.jsx)(s,{onClick:b,disabled:r===null||a.length!==6||g.isPending,children:g.isPending?`Verifying…`:`Verify`})]})]})})}function Ri(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function zi(){let e=d(),[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(null),a=f({...St()}),o=a.data??[],c=()=>e.invalidateQueries({queryKey:Ct()}),l=At({onSuccess:()=>{H.success(`Authenticator app removed.`),c()},onError:e=>{if(Ii(e)===`factor_not_found`){c();return}H.error(`Failed to remove the authenticator app. Please try again.`)}});return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a.isPending?(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default`,children:`Loading authenticator apps…`})]}):a.isError?(0,Q.jsxs)(z,{tone:`error`,children:[`Couldn't load your authenticator apps.`,` `,(0,Q.jsx)(`button`,{type:`button`,className:`cursor-pointer underline`,onClick:()=>void a.refetch(),children:`Try again`})]}):o.length===0?(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`No authenticator app is set up. Add one to require a one-time code at sign-in.`}):(0,Q.jsx)(`ul`,{className:`flex flex-col divide-y divide-[var(--border-base)]`,children:o.map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center justify-between gap-3 py-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,Q.jsx)(oe,{className:`h-5 w-5 shrink-0 text-[var(--content-tertiary)]`}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsx)(`div`,{className:`text-body-medium-default text-[var(--content-default)]`,children:`Authenticator app`}),(0,Q.jsxs)(`div`,{className:`truncate text-body-small-default text-[var(--content-tertiary)]`,children:[e.user,e.created_at?` · Added ${Ri(e.created_at)}`:``]})]})]}),(0,Q.jsx)(s,{variant:`dangerOutline`,onClick:()=>i(e),disabled:l.isPending,children:`Remove`})]},e.id))}),!a.isPending&&!a.isError&&o.length===0&&(0,Q.jsx)(s,{onClick:()=>n(!0),className:`self-start`,children:`Add authenticator app`}),(0,Q.jsx)(Li,{open:t,onOpenChange:n}),(0,Q.jsx)(ye,{open:r!==null,title:`Remove authenticator app`,message:`Signing in will no longer ask for a code from this app. You can set up a new authenticator app at any time.`,confirmLabel:`Remove`,destructive:!0,onConfirm:()=>{r&&l.mutate({path:{id:r.id}}),i(null)},onCancel:()=>i(null)})]})}var $=class extends Error{code;constructor(e,t){super(t),this.name=`TeleportError`,this.code=e}},Bi=`local`,Vi=`docker`,Hi=`vellum`;function Ui(e){switch((e??``).toLowerCase()){case Bi:return`local`;case Vi:return`docker`;case Hi:return`managed`;default:return`other`}}function Wi(e){let t=Ui(e);return t===`managed`?`local`:t===`local`?`platform`:null}function Gi(e){switch(e){case`docker`:return`Move to Docker`;case`platform`:return`Move to Cloud (Platform)`;case`local`:return`Move to Local`}}function Ki(e){switch(e){case`docker`:return`Run your assistant in a Docker container on this Mac.`;case`platform`:return`Run your assistant in the cloud, managed by the Vellum platform.`;case`local`:return`Run your assistant locally on this Mac.`}}function qi(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.reason!==`version_mismatch`)return null;let n=t.bundle_compat,r=t.target_runtime_version;if(!n||typeof n!=`object`||typeof r!=`string`)return null;let i=n,a=i.min_runtime_version;if(typeof a!=`string`)return null;let o=typeof i.max_runtime_version==`string`?i.max_runtime_version:null;return`Cannot import: bundle requires runtime ${o?`${a}–${o}`:`${a}+`}, but this local runtime is ${r}. Update your local runtime before importing.`}async function Ji(e,t){let n=Number(e.headers.get(`Content-Length`)??0);if(!e.body||!t||n<=0){let n=await e.arrayBuffer();return t?.(1),n}let r=e.body.getReader(),i=[],a=0;for(;;){let{done:e,value:o}=await r.read();if(e)break;i.push(o),a+=o.length,t(a/n)}let o=new Uint8Array(a),s=0;for(let e of i)o.set(e,s),s+=e.length;return t(1),o.buffer}function Yi(e){let t=Oe(e);if(!t)throw new $(`local_assistant_not_found`,`Assistant ${e.assistantId} has no resolved local gateway.`);return`${window.location.origin}${t}`}async function Xi(e,t){let n=await Pe(e.assistantId),r=await fetch(`${t}/auth/token`,{method:`POST`,headers:{Authorization:`Bearer ${n}`}});if(!r.ok)throw new $(`not_signed_in`,`Gateway token request failed (HTTP ${r.status}).`);let{token:i}=await r.json();return i}async function Zi(e,t){let n=Yi(e),r=await Xi(e,n),i=await fetch(`${n}/v1/migrations/export`,{method:`POST`,headers:{Authorization:`Bearer ${r}`}});if(!i.ok)throw new $(`export_failed`,`Export failed (HTTP ${i.status}).`);return Ji(i,t)}async function Qi(e,t){let n=Yi(e),r=await Xi(e,n),i=await fetch(`${n}/v1/migrations/import`,{method:`POST`,headers:{Authorization:`Bearer ${r}`},body:new Blob([t],{type:`application/octet-stream`})});if(!i.ok)throw new $(`import_failed`,`Import failed (HTTP ${i.status}).`);let a=await ta(i);if(a&&a.success===!1)throw new $(`import_failed`,a.error??`Import reported failure`)}async function $i(e,t){let{data:n,response:r}=await K.post({url:`/v1/assistants/{assistant_id}/migrations/export-to-gcs/`,path:{assistant_id:e},body:{upload_url:t},throwOnError:!1}),i=r?.status??0;if(!(r?.ok??!1)&&i!==202)throw new $(`export_failed`,`Export failed (HTTP ${i}).`);let a=n?.job_id;if(!a)throw new $(`export_failed`,`Export accepted but no job ID was returned.`);return a}async function ea(e,t){let{data:n,response:r}=await K.get({url:`/v1/assistants/{assistant_id}/migrations/jobs/{job_id}`,path:{assistant_id:e,job_id:t},throwOnError:!1}),i=r?.status??0;if(i>=500)return`processing`;if(!(r?.ok??!1))throw new $(`export_job_failed`,`Job status check failed (HTTP ${i})`);let a=n;if(a?.status===`failed`)throw new $(`export_job_failed`,a.error??`Export job failed`);return a?.status??`processing`}async function ta(e){try{return await e.json()}catch{return null}}var na=new Set([500,502,503,504]),ra=3,ia=e=>new Promise(t=>setTimeout(t,e));async function aa(e,t=new Set){for(let n=0;n<=ra;n++){let{response:r,data:i,error:a}=await e(),o=r?.status??0;if(n<ra&&na.has(o)&&!t.has(o)){await ia(2**n*1e3);continue}return{status:o,data:i,error:a}}throw new $(`unknown`,`Unexpected retry loop exit`)}async function oa(e,t){let n={operation:`upload`};e&&(n.min_runtime_version=e,n.max_runtime_version=null),t&&(n.consumer=t);let{status:r,data:i}=await aa(()=>K.post({url:`/v1/migrations/signed-url/`,body:n,throwOnError:!1}),new Set([404,503]));if(r===503||r===404)throw new $(`export_failed`,`Signed URL uploads are not available — the platform may not support this feature yet.`);if(r!==201)throw new $(`export_failed`,`Migration request failed (HTTP ${r}).`);let a=i;return{url:a.url,bundleKey:a.bundle_key,expiresAt:a.expires_at}}async function sa(e,t){let{status:n,data:r,error:i}=await aa(()=>K.post({url:`/v1/migrations/signed-url/`,body:{operation:`download`,bundle_key:e,target_runtime_version:t},throwOnError:!1}),new Set([422]));if(n===422){let e=qi(i);if(e)throw new $(`version_mismatch`,e)}if(n!==200&&n!==201)throw new $(`import_failed`,`Migration request failed (HTTP ${n}).`);return r.url}async function ca(e,t,n){for(let r=0;r<=ra;r++){let i=await la(e,t,n);if(r<ra&&na.has(i)){await ia(2**r*1e3),n?.(0);continue}if(i<200||i>=300)throw new $(`export_failed`,`Bundle upload failed (HTTP ${i}).`);return}}function la(e,t,n){return new Promise((r,i)=>{let a=new XMLHttpRequest;a.open(`PUT`,e),a.setRequestHeader(`Content-Type`,`application/octet-stream`),a.timeout=36e5,n&&(a.upload.onprogress=e=>{e.lengthComputable&&n(e.loaded/e.total)}),a.onload=()=>{n?.(1),r(a.status)},a.onerror=()=>i(new $(`export_failed`,`Bundle upload failed.`)),a.ontimeout=()=>i(new $(`export_timed_out`,`Bundle upload timed out.`)),a.send(t)})}async function ua(e,t){for(let n=0;n<=ra;n++){let r=await fetch(e,{method:`GET`});if(n<ra&&na.has(r.status)){await ia(2**n*1e3),t?.(0);continue}if(!r.ok)throw new $(`import_failed`,`Bundle download failed (HTTP ${r.status}).`);return Ji(r,t)}throw new $(`import_failed`,`Unexpected retry loop exit`)}async function da(e){let{status:t,data:n,error:r}=await aa(()=>K.post({url:`/v1/migrations/import-from-gcs/`,body:{bundle_key:e},throwOnError:!1}));return{status:t,body:n??r??null}}async function fa(e){let{status:t,data:n}=await aa(()=>K.get({url:`/v1/migrations/jobs/{job_id}/`,path:{job_id:e},throwOnError:!1}));if(t!==200)throw new $(`import_failed`,`Job status check failed (HTTP ${t})`);let r=n??{};return{status:typeof r.status==`string`?r.status:`unknown`,jobId:typeof r.job_id==`string`?r.job_id:null,error:typeof r.error==`string`?r.error:null}}var pa=5e3,ma=36e5,ha=5*6e4,ga=30,_a=e=>new Promise(t=>setTimeout(t,e));function va(){let e=c(),t=je(),n=Wi(t?.cloud),[r,i]=(0,Z.useState)({kind:`idle`}),[o,s]=(0,Z.useState)(!1),l=(0,Z.useRef)(null),u=(0,Z.useRef)(null),d=(0,Z.useCallback)(e=>{i({kind:`transferring`,step:e,progress:null})},[]),f=(0,Z.useCallback)(e=>{i(t=>t.kind===`transferring`?{...t,progress:e}:t)},[]),p=(0,Z.useCallback)(async()=>{if(!(!t||!n)){u.current={id:t.assistantId,kind:Ui(t.cloud)===`managed`?`managed`:`local`,createdFresh:!1};try{if(n===`platform`)await ya(t,d,f,l);else if(n===`local`)await ba(t,d,f,l);else throw new $(`unknown`,`Unsupported teleport destination.`);i({kind:`verifying`})}catch(e){i({kind:`failed`,error:`Teleport failed: ${e instanceof $||e instanceof Error?e.message:`Teleport failed.`}`}),a(e,{context:`teleport-execute`}),await Sa(l.current,u.current,`teleport-execute-cleanup`),l.current=null}}},[t,n,d,f]),m=(0,Z.useCallback)(()=>s(!0),[]),h=(0,Z.useCallback)(()=>s(!1),[]),g=(0,Z.useCallback)(()=>{s(!1),p()},[p]),_=(0,Z.useCallback)(()=>{l.current=null,u.current=null,i({kind:`idle`})},[]);return{destination:n,phase:r,confirmOpen:o,requestTeleport:m,cancelConfirm:h,confirm:g,confirmAndSwitch:(0,Z.useCallback)(()=>{let t=l.current,n=u.current;t&&(async()=>{try{let e=Je.getState();t.kind===`managed`?await e.connectPlatformAssistant(t.id):(await e.connectLocalAssistant(t.id),Ye(t.id,{onError:e=>a(e,{context:`teleport-inject-platform-identity`})}))}catch(e){i({kind:`failed`,error:`Switch failed: ${e instanceof Error?e.message:`Failed to switch assistant.`}`}),a(e,{context:`teleport-confirm-switch`});return}n&&Wt(n.id).then(e=>{e.ok||a(Error(e.error),{context:`teleport-retire-source`})}),_(),e(J.assistant,{replace:!0})})()},[e,_]),cancelTeleport:(0,Z.useCallback)(()=>{let e=l.current,t=u.current;l.current=null,u.current=null,i({kind:`idle`}),Sa(e,t,`teleport-cancel-retire-target`)},[]),reset:_}}async function ya(e,t,n,r){t(`Exporting assistant data...`);let i=await Zi(e,n);t(`Resolving organization...`);let a=await wa();t(`Checking for existing assistant...`);let o=(await it({query:{hosting:`platform`},throwOnError:!1})).data?.results?.[0];if(o)throw new $(`existing_platform_assistant`,`You already have a platform assistant '${o.id}'. Retire it first, then retry the teleport.`);t(`Uploading data to cloud...`);let s=await oa(e.resources?.runtimeVersion);await ca(s.url,i,n),t(`Setting up cloud assistant...`);let c=await ct(void 0,`create`);if(!c.ok)throw new $(`import_failed`,`Failed to set up the cloud assistant.`);if(c.status===200)throw new $(`existing_platform_assistant`,`You already have a platform assistant '${c.data.id}'. Retire it first, then retry the teleport.`);let l=c.data.id;await Se({assistantId:l,name:c.data.name,cloud:`vellum`,runtimeUrl:Ee(),hatchedAt:c.data.created??new Date().toISOString(),organizationId:a}),await Ce(e.assistantId),r.current={id:l,kind:`managed`,createdFresh:!0},t(`Finalizing cloud assistant...`),await Ta(l),t(`Importing data to cloud...`);let u=await da(s.bundleKey);if(u.status<200||u.status>=300){let e=u.body;throw new $(`import_failed`,e?.error??`Import failed (HTTP ${u.status}).`)}if(u.status===202){let e=u.body?.job_id;if(!e)throw new $(`import_failed`,`Import accepted but no job ID returned.`);await Ea(e)}else{let e=u.body;if(e&&e.success===!1)throw new $(`import_failed`,e.error??`Import reported failure.`)}}async function ba(e,t,n,r){t(`Preparing export...`);let i=await oa(await Ca(e.assistantId),`runtime`);t(`Exporting cloud data...`);let a=await $i(e.assistantId,i.url);await Da(e.assistantId,a),t(`Preparing local assistant...`);let{assistant:o,createdFresh:s}=await Oa();r.current={id:o.assistantId,kind:`local`,createdFresh:s};let c=await xa(o,s);if(!c)throw new $(`local_assistant_not_found`,`Could not determine the local assistant's runtime version. Restart or upgrade the local assistant, then retry the teleport.`);t(`Preparing import...`);let l=await sa(i.bundleKey,c);t(`Downloading data...`);let u=await ua(l,n);t(`Importing data...`),await Aa(o,u),await Ce(e.assistantId)}async function xa(e,t){if(e.resources?.runtimeVersion)return e.resources.runtimeVersion;if(t)return(await nn())?.version??void 0}async function Sa(e,t,n){if(e?.createdFresh){let t=await Wt(e.id);t.ok||a(Error(t.error),{context:n})}t&&await Ce(t.id)}async function Ca(e){let t=await st(e);return t.ok?t.data.version??void 0:void 0}async function wa(){let e=Xe.getState();e.organizations.length===0&&await e.fetchOrganizations();let t=Xe.getState().organizations,n=Ve();if(n&&t.some(e=>e.id===n))return n;if(t.length===0)throw new $(`no_organizations`,`No organizations found for this account.`);if(t.length>1)throw new $(`multiple_organizations`,`Multiple organizations found — please select one in account settings first.`);let r=t[0].id;return Xe.getState().setCurrentOrganizationId(r),r}async function Ta(e){let t=Date.now();for(;Date.now()-t<ha;){let{data:t,response:n}=await tt({path:{id:e},throwOnError:!1});if(n?.ok&&t?.state===`active`)return;await _a(pa)}}async function Ea(e){let t=Date.now();for(;Date.now()-t<ma;){await _a(pa);let t=await fa(e);if(t.status===`complete`)return;if(t.status===`failed`)throw new $(`import_failed`,t.error??`Import job failed`)}throw new $(`import_failed`,`Import timed out after 60 minutes.`)}async function Da(e,t){let n=Date.now();for(;Date.now()-n<ma;)if(await _a(pa),await ea(e,t)===`complete`)return;throw new $(`export_timed_out`,`Export timed out.`)}async function Oa(){let e=await Te(void 0,void 0);if(!e.ok)throw new $(`local_assistant_not_found`,e.error??`Could not create a local assistant.`);await xe();let t=e.assistantId?Ae().find(t=>t.assistantId===e.assistantId):ka();if(!t)throw new $(`local_assistant_not_found`,`Could not find or create a local assistant.`);return{assistant:t,createdFresh:!0}}function ka(){return Ae().slice().sort((e,t)=>(t.hatchedAt??``).localeCompare(e.hatchedAt??``))[0]}async function Aa(e,t){let n;for(let r=0;r<ga;r++)try{await Qi(e,t);return}catch(e){n=e,await _a(1e3)}throw n instanceof Error?n:new $(`import_failed`,`Import failed.`)}function ja(){let e=va(),{destination:t,phase:n}=e;return t?(0,Q.jsxs)(X,{title:`Teleport`,subtitle:`Move your assistant to a different hosting environment.`,children:[n.kind===`idle`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:Ki(t)}),(0,Q.jsx)(s,{variant:`outlined`,className:`self-start`,onClick:e.requestTeleport,children:Gi(t)})]}),n.kind===`transferring`&&(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n.progress==null&&(0,Q.jsx)(D,{className:`h-4 w-4 animate-spin text-[var(--content-tertiary)]`}),(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:n.step})]}),n.progress!=null&&(0,Q.jsx)(de,{value:n.progress,"aria-label":`Teleport progress`,className:`max-w-[240px]`})]}),n.kind===`verifying`&&(0,Q.jsx)(z,{tone:`success`,icon:(0,Q.jsx)(w,{className:`h-4 w-4`}),title:`Transfer complete — verify your new assistant is working.`,actions:(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsx)(s,{variant:`primary`,onClick:e.confirmAndSwitch,children:`Confirm & Switch`}),(0,Q.jsx)(s,{variant:`outlined`,onClick:e.cancelTeleport,children:`Cancel`})]})}),n.kind===`failed`&&(0,Q.jsx)(z,{tone:`error`,title:n.error,actions:(0,Q.jsx)(s,{variant:`outlined`,onClick:e.reset,children:`Try Again`})}),(0,Q.jsx)(ye,{open:e.confirmOpen,title:Gi(t),message:`Your data will be copied to the new environment. The current assistant will remain available until you confirm the new one works.`,confirmLabel:`Teleport`,onConfirm:e.confirm,onCancel:e.cancelConfirm})]}):null}function Ma(){let{assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}=dn(),o=q.use.multiPlatformAssistant(),u=q.use.assistantSwitcher(),d=q.use.teleport(),f=q.use.accountMfa(),p=Ht.use.settingsSleepPolicy(),m=Ke(),h=dt(),g=u&&(Ne()||m||we()||h),_=c(),v=ht(),y=ht({platformHostedOnly:!0}),b=_t(),x=pt(),S=ee({assistantId:e?.id??null,enabled:y===`full`&&b}),[C,w]=(0,Z.useState)(!1),[T,E]=(0,Z.useState)(!1),[D,O]=l();(0,Z.useEffect)(()=>{if(D.get(`preferences`)!==`open`)return;let e=new URLSearchParams(D);e.delete(`preferences`),O(e,{replace:!0}),E(!0)},[D,O]);let k=e?.is_local&&!Ne()?null:e,A=je(),j=Ne()&&!!e&&!!A&&De(A),M=j,N=j&&!we(),P=y===`full`&&!!k||N&&!!e;(0,Z.useEffect)(()=>{!e||window.location.hash!==`#storage-resources`||requestAnimationFrame(()=>{document.getElementById(`storage-resources`)?.scrollIntoView({block:`start`})})},[e]);let F=t?.version??e?.current_release_version??null,I=()=>{let e=ke();if(we()&&!h&&e){let t=new URLSearchParams({register:lt()}),n=Me();n&&t.set(`name`,n);let r=new URL(e).origin;window.location.assign(`${r}${J.selectAssistant}?${t.toString()}`);return}_(`${J.selectAssistant}?noAutoSkip=1`)},L=(v===`full`||M)&&!!k||v===`disabled`&&!M,R=y!==`gated`;return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[S.status&&S.mode!==`inactive`&&(0,Q.jsx)(re,{status:S.status,mode:S.mode,isAcknowledging:S.isAcknowledging,acknowledgeError:S.acknowledgeError?.message??null,onAcknowledge:()=>void S.acknowledge(),onReviewWorkspaceData:()=>void _(`${J.workspace}?sort=size`),onUpgradeStorage:y===`full`&&!x?()=>void _(J.plans):null}),(0,Q.jsxs)(jn,{assistant:b?k:null,showHandles:m&&v===`full`,children:[(0,Q.jsx)(Oi,{}),f&&v!==`gated`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Two-Factor Authentication`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Require a code from an authenticator app when you sign in.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:v===`disabled`?(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage two-factor authentication.`}):(0,Q.jsx)(zi,{})})]})]})]}),(0,Q.jsx)(X,{title:`Version`,subtitle:`Manage your assistant's software version and updates.`,accessory:y===`full`&&k?(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>w(!0),children:`Update Window`}):void 0,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[y===`full`&&k&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Vn,{assistantId:k.id,currentVersion:F,releaseChannel:k.release_channel,onUpgradeComplete:()=>{i()}}),(0,Q.jsx)(ui,{assistantId:k.id,onComplete:()=>{i()}})]}),N&&e&&(0,Q.jsx)(Hn,{assistantId:e.id,currentVersion:F,onUpgradeComplete:()=>{i()}}),!P&&e&&(0,Q.jsxs)(`div`,{className:`grid grid-cols-[140px_minmax(0,1fr)] gap-y-3`,children:[(0,Q.jsx)(`span`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Current`}),(0,Q.jsx)(fn,{version:F,loading:n&&!e.current_release_version,assistantId:e.id??null})]}),y===`disabled`&&!N&&(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage software updates.`})]})}),y===`full`&&k&&(0,Q.jsx)(Fi,{assistantId:k.id,open:C,onClose:()=>w(!1)}),y===`full`&&e&&(0,Q.jsx)(vi,{assistant:e,healthz:t,healthzLoading:n,healthzPolling:r,refetch:i,refetchUntilResized:a}),y===`disabled`&&(0,Q.jsx)(X,{id:`storage-resources`,title:`Compute & Resources`,subtitle:`Monitor resource usage and manage your assistant's compute profile.`,children:(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage compute resources.`})}),(0,Q.jsx)(X,{title:`Preferences`,subtitle:`Customize how Vellum looks and behaves on this device.`,accessory:(0,Q.jsx)(s,{variant:`outlined`,onClick:()=>E(!0),children:`Customize`}),children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,Q.jsx)(vn,{}),(0,Q.jsx)(bi,{})]})}),(0,Q.jsx)(ii,{open:T,onClose:()=>E(!1)}),d&&W()&&(0,Q.jsx)(ja,{}),(0,Q.jsx)(Gn,{}),(0,Q.jsx)(Hr,{}),y===`full`&&k&&p&&(0,Q.jsx)(X,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(Ln,{assistantId:k.id})}),y===`disabled`&&p&&(0,Q.jsx)(X,{title:`Sleep Policy`,subtitle:`Control how long this assistant stays awake when idle.`,children:(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to manage sleep policy.`})}),o&&!g&&(0,Q.jsx)(Pn,{}),g&&(0,Q.jsx)(X,{title:`Switch Assistant`,subtitle:`Choose which assistant this device is connected to.`,accessory:(0,Q.jsx)(s,{variant:`outlined`,onClick:I,children:`Choose Assistant`})}),(L||R)&&(0,Q.jsx)(X,{variant:`danger`,title:`Danger Zone`,children:(0,Q.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[L&&(0,Q.jsxs)(`section`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(`h3`,{className:`text-title-small text-[var(--content-emphasised)]`,children:`Retire Assistant`}),(0,Q.jsx)(`p`,{className:`text-body-medium-default text-[var(--content-tertiary)]`,children:`Permanently retire this assistant and delete all associated data.`}),(0,Q.jsx)(`div`,{className:`mt-1`,children:(v===`full`||M)&&k?(0,Q.jsx)(yi,{assistantId:k.id}):(0,Q.jsx)(Y,{children:`Log in to the Vellum platform to retire this assistant.`})})]}),L&&R&&(0,Q.jsx)(`div`,{className:`border-t border-[var(--border-subtle)]`}),(0,Q.jsx)(Un,{})]})})]})}export{Ma as GeneralPage};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{t as n}from"./button-VkxVX0DM.js";import{d as r,u as i}from"./chunk-5KNZJZUH-BUqIilZr.js";import{n as a}from"./QueryClientProvider-EuRl-wrW.js";import{t as o}from"./useQuery-CTSuec5b.js";import{t as s}from"./jsx-runtime-BJ8jcmzB.js";import{t as c}from"./typography-DekrYXvs.js";import{t as l}from"./arrow-left-Ciai6BHG.js";import{t as u}from"./bell-CHRdx4mp.js";import{t as d}from"./chevron-right-Dwr_Sx98.js";import{_ as f,a as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,o as C,r as w,s as T,t as E,u as D,x as O}from"./home-tool-permission-card-BGkMa_5c.js";import{t as k}from"./mail-9qQtaWSe.js";import{t as A}from"./rotate-ccw-Cs7aCSL9.js";import{t as j}from"./trash-2-V2WT_DbX.js";import{o as M}from"./src-qDZBwoEm.js";import{t as N}from"./tag-Ddzwz3ij.js";import{t as P}from"./skeleton-D8_lkywC.js";import"./i18n--HmJLuhM.js";import{t as F}from"./useTranslation-DdVCKPgw.js";import{G as I,K as L}from"./react-query.gen-Bbh5MII3.js";import{n as R}from"./conversation-navigation-DQEOhOXf.js";import{n as z}from"./use-is-mobile-q9Lr7beO.js";import{i as B}from"./conversation-cache-C3KMXxZQ.js";import{t as V}from"./chat-layout-slots-store-CE2p0OE9.js";import{a as H,n as U,o as W}from"./conversation-queries-Crrs0Ih6.js";import{t as G}from"./use-active-assistant-id-BADYKVyx.js";import{t as K}from"./detail-shell-B1BZYIqh.js";import{i as q,r as J}from"./format-date-B_oQDqU9.js";import{t as Y}from"./page-shell-3Yi5Ezsv.js";import{n as X,t as ee}from"./detail-drawer-CYUmZIyK.js";import{t as te}from"./page-empty-state-BG1VeXc8.js";var Z=e(t(),1),Q=s();function ne({item:e,isMobile:t,validConversationIds:r,onClose:i,onGoToThread:a,onUpdateStatus:o,onDismiss:s,entityLinks:u=[],onNavigate:d}){let{t:f}=F(`home`);if(!e)return null;let p=e.detailPanel?.kind,m=_(e.category),h=e.title?e.title:e.category?f(m.labelKey):f(`homeDetailPanel.untitled`),g=m.icon,v=e.status===`new`,y=f(v?`actions.markAsRead`:`actions.markAsUnread`),b=e.status===`dismissed`,x=!!e.conversationId&&r.has(e.conversationId);return t?(0,Q.jsxs)(`div`,{className:`flex h-full flex-col bg-[var(--surface-overlay)]`,children:[(0,Q.jsxs)(`div`,{className:`relative flex shrink-0 items-center px-3 py-2`,children:[(0,Q.jsx)(n,{variant:`ghost`,iconOnly:(0,Q.jsx)(l,{}),onClick:i,"aria-label":f(`homeDetailPanel.back`),tooltip:f(`homeDetailPanel.back`)}),(0,Q.jsx)(c,{variant:`body-medium-default`,className:`pointer-events-none absolute inset-x-0 text-center text-[var(--content-secondary)]`,children:f(`homeDetailPanel.heading`)}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,Q.jsx)(n,{variant:`ghost`,iconOnly:v?(0,Q.jsx)(O,{}):(0,Q.jsx)(k,{}),onClick:()=>o(e.id,v?`seen`:`new`),"aria-label":y,tooltip:y}),b?(0,Q.jsx)(n,{variant:`ghost`,iconOnly:(0,Q.jsx)(A,{}),onClick:()=>o(e.id,`seen`),"aria-label":f(`actions.restore`),tooltip:f(`actions.restore`)}):(0,Q.jsx)(n,{variant:`ghost`,iconOnly:(0,Q.jsx)(j,{}),onClick:()=>s(e.id),"aria-label":f(`actions.dismiss`),tooltip:f(`actions.dismiss`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 px-4 py-3`,children:[(0,Q.jsx)(`span`,{className:`flex shrink-0 items-center justify-center rounded-full`,style:{width:40,height:40,backgroundColor:m.weak},"aria-hidden":`true`,children:(0,Q.jsx)(g,{width:18,height:18,style:{color:m.strong}})}),(0,Q.jsx)(c,{variant:`title-small`,className:`min-w-0 text-[var(--content-default)]`,children:h}),(0,Q.jsx)(N,{tone:`neutral`,className:`shrink-0`,title:J(e.timestamp),children:q(e.timestamp)})]}),(0,Q.jsx)(`div`,{className:`mx-4 border-b border-[var(--border-disabled)]`}),(0,Q.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4`,children:p===`toolPermission`?(0,Q.jsx)(E,{item:e}):(0,Q.jsx)(S,{item:e})}),x||u.length>0?(0,Q.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 px-4 pb-4 pt-2`,children:[u.map(e=>(0,Q.jsx)(n,{variant:`outlined`,fullWidth:!0,leftIcon:(0,Q.jsx)(e.icon,{className:`size-4`}),onClick:()=>d?.(e.to),children:f(e.labelKey)},e.kind)),x?(0,Q.jsx)(n,{variant:`primary`,fullWidth:!0,onClick:()=>a(e.conversationId),children:f(`actions.goToConversation`)}):null]}):null]}):(0,Q.jsxs)(K,{icon:(0,Q.jsx)(g,{className:`h-5 w-5 shrink-0 text-[var(--content-secondary)]`,"aria-hidden":!0}),title:h,headerActions:x?(0,Q.jsx)(n,{variant:`outlined`,onClick:()=>a(e.conversationId),children:f(`actions.goToConvo`)}):void 0,closeLabel:f(`homeDetailPanel.closeAriaLabel`),closeTooltip:f(`homeDetailPanel.close`),onClose:i,footer:(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-[var(--app-spacing-sm)]`,children:[(0,Q.jsx)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:u.map(e=>(0,Q.jsx)(n,{variant:`outlined`,leftIcon:(0,Q.jsx)(e.icon,{className:`size-4`}),onClick:()=>d?.(e.to),children:f(e.labelKey)},e.kind))}),(0,Q.jsx)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:b?(0,Q.jsx)(n,{variant:`primary`,onClick:()=>o(e.id,`seen`),children:f(`actions.restore`)}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(n,{variant:`outlined`,onClick:()=>o(e.id,v?`seen`:`new`),children:y}),(0,Q.jsx)(n,{variant:`primary`,onClick:()=>s(e.id),children:f(`actions.dismiss`)})]})})]}),children:[p===`toolPermission`?(0,Q.jsx)(E,{item:e}):(0,Q.jsx)(S,{item:e}),(0,Q.jsx)(`div`,{className:`mt-[var(--app-spacing-md)]`,children:(0,Q.jsx)(N,{tone:`neutral`,title:J(e.timestamp),children:q(e.timestamp)})})]})}var re={today:`homeFeedList.today`,yesterday:`homeFeedList.yesterday`,older:`homeFeedList.older`},ie=10080*60*1e3;function $(e,t){return e.status===`new`||e.status===`dismissed`?!1:t-new Date(e.createdAt).getTime()>ie}function ae({items:e,selectedItemId:t,validConversationIds:n,onSelectItem:r,onDismissItem:i,onRestoreItem:a,onToggleRead:o,onGoToThread:s,archivedOpen:l,onArchivedOpenChange:f,dismissedOpen:g,onDismissedOpenChange:_}){let{t:y}=F(`home`),[S,C]=(0,Z.useState)(null),[w]=(0,Z.useState)(()=>Date.now()),E=T(e.filter(e=>e.status!==`dismissed`)),D=E.filter(e=>!$(e,w)),O=x(E.filter(e=>$(e,w))),k=b(D),A=S&&k.includes(S)?S:null;S!==A&&C(A);let j=h(x(m(D,A))),N=e.filter(e=>e.status===`dismissed`).sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-lg)]`,children:[(0,Q.jsx)(v,{categories:k,activeFilter:A,onFilterChange:C}),j.size===0?A?(0,Q.jsx)(c,{variant:`body-medium-lighter`,className:`py-[var(--app-spacing-xl)] text-center text-[var(--content-disabled)]`,children:y(`homeFeedList.noMatches`)}):(0,Q.jsx)(te,{icon:u,title:y(`homeFeedList.emptyTitle`),description:y(`homeFeedList.emptyBody`)}):[...j.entries()].map(([e,a])=>(0,Q.jsxs)(`section`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,Q.jsx)(c,{variant:`body-small-default`,as:`h3`,className:`text-[var(--content-tertiary)]`,children:y(re[e])}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)]`,children:a.map(e=>(0,Q.jsx)(p,{item:e,isActive:e.id===t,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:o,onGoToThread:s},e.id))})]},e)),O.length>0&&(0,Q.jsx)(M.Root,{type:`single`,collapsible:!0,value:l?`archived-read`:``,onValueChange:e=>f?.(e===`archived-read`),children:(0,Q.jsxs)(M.Item,{value:`archived-read`,children:[(0,Q.jsxs)(M.Trigger,{className:`group gap-[var(--app-spacing-xs)] text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(d,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{children:y(`homeFeedList.earlier`,{count:O.length})})]}),(0,Q.jsx)(M.Content,{children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)] pt-[var(--app-spacing-sm)]`,children:O.map(e=>(0,Q.jsx)(p,{item:e,isActive:e.id===t,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:o,onGoToThread:s},e.id))})})]})}),N.length>0&&(0,Q.jsx)(M.Root,{type:`single`,collapsible:!0,value:g?`dismissed`:``,onValueChange:e=>_?.(e===`dismissed`),children:(0,Q.jsxs)(M.Item,{value:`dismissed`,children:[(0,Q.jsxs)(M.Trigger,{className:`group gap-[var(--app-spacing-xs)] text-body-small-default text-[var(--content-tertiary)]`,children:[(0,Q.jsx)(d,{size:14,"aria-hidden":!0,className:`shrink-0 transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{children:y(`homeFeedList.dismissed`,{count:N.length})})]}),(0,Q.jsx)(M.Content,{children:(0,Q.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)] pt-[var(--app-spacing-sm)]`,children:N.map(e=>(0,Q.jsx)(p,{item:e,onSelect:r,onDismiss:a,trailingAction:`restore`},e.id))})})]})})]})}function oe(){let{t:e}=F(`home`);return(0,Q.jsx)(`h1`,{className:`shrink-0 text-title-large text-[var(--content-default)]`,children:e(`homeTopHeader.title`)})}function se(e){let t=a(),n=(0,Z.useMemo)(()=>L({path:{assistant_id:e??``}}),[e]),r=o({...I({path:{assistant_id:e}}),enabled:!!e,staleTime:6e4}),i=(0,Z.useCallback)(()=>{e&&t.invalidateQueries({queryKey:n})},[e,t,n]);return{...r,invalidate:i}}function ce(){return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xl)]`,children:[(0,Q.jsx)(P,{className:`h-7 w-64 rounded-md`}),(0,Q.jsx)(`div`,{className:`flex flex-col gap-[var(--app-spacing-sm)]`,children:Array.from({length:4},(e,t)=>(0,Q.jsx)(P,{className:`h-16 rounded-md`},t))})]})}function le({assistantId:e,validConversationIds:t,onOpenConversation:r,onNavigate:i,initialFeedItemId:a,navigationKey:o,onInitialFeedItemConsumed:s}){let{t:c}=F(`home`),l=z(),u=w(e);se(e);let[d,p]=(0,Z.useState)(null),[m,h]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)(!1),b=(0,Z.useCallback)(e=>{e.status===`new`?(p({...e,status:`seen`}),u.updateStatus.mutate({itemId:e.id,status:`seen`})):p(e)},[u.updateStatus]),x=(0,Z.useCallback)(()=>{p(null)},[]),S=(0,Z.useCallback)(e=>{u.updateStatus.mutate({itemId:e,status:`dismissed`}),d?.id===e&&p(null)},[u.updateStatus,d?.id]),T=(0,Z.useCallback)(e=>{u.updateStatus.mutate({itemId:e,status:`seen`}),p(t=>t?.id===e?{...t,status:`seen`}:t)},[u.updateStatus]),E=(0,Z.useCallback)((e,t)=>{u.updateStatus.mutate({itemId:e,status:t}),p(n=>n?.id===e?{...n,status:t}:n)},[u.updateStatus]),O=(0,Z.useCallback)(e=>{p(null),r(e)},[r]),k=u.data?.items??[],[A,j]=(0,Z.useState)(null);(0,Z.useEffect)(()=>{if(!a||o===A||u.isLoading)return;j(o??null);let e=k.find(e=>e.id===a);e&&e.status!==`dismissed`&&b(e),s?.()},[a,o,A,u.isLoading,k,b,s]);let M=D(k),N=M.filter(e=>e.status===`new`).length,P=M.length,I=f(),L=(0,Z.useCallback)(()=>{u.markAll.mutate(g(M))},[u.markAll,M]),R=(0,Z.useCallback)(()=>{u.markAll.mutate(C(M)),p(null)},[u.markAll,M]),{links:B,isPending:V}=y(d,e,!0),H=d?(0,Q.jsx)(ne,{item:d,isMobile:l,validConversationIds:t,onClose:x,onGoToThread:O,onUpdateStatus:E,onDismiss:S,entityLinks:V?[]:B,onNavigate:i}):null,U=(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-[var(--app-spacing-lg)] overflow-y-auto`,children:[u.isError?(0,Q.jsx)(`div`,{role:`alert`,className:`rounded-md border border-[var(--system-negative-weak)] bg-[var(--system-negative-weak)] px-[var(--app-spacing-lg)] py-[var(--app-spacing-md)] text-[var(--system-negative-strong)]`,children:u.error instanceof Error?c(`homePage.loadFailedDetail`,{message:u.error.message}):c(`homePage.loadFailed`)}):null,I&&(N>0||P>0)&&(0,Q.jsxs)(`div`,{className:`flex items-center justify-end gap-[var(--app-spacing-sm)]`,children:[N>0&&(0,Q.jsx)(n,{variant:`ghost`,size:`compact`,onClick:L,disabled:u.markAll.isPending,children:c(`actions.markAllAsRead`)}),P>0&&(0,Q.jsx)(n,{variant:`ghost`,size:`compact`,onClick:R,disabled:u.markAll.isPending,children:c(`actions.clearAll`)})]}),(0,Q.jsx)(ae,{items:k,selectedItemId:d?.id,validConversationIds:t,onSelectItem:b,onDismissItem:S,onRestoreItem:T,onToggleRead:E,onGoToThread:O,archivedOpen:m,onArchivedOpenChange:h,dismissedOpen:_,onDismissedOpenChange:v})]}),W=H&&!l?(0,Q.jsx)(ee,{storageKey:`homeDetailDrawerWidth`,detailKey:d?.id,section:U,detail:H}):U,G=u.isLoading?(0,Q.jsx)(ce,{}):(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-[var(--app-spacing-xl)]`,children:[l?null:(0,Q.jsx)(oe,{}),W]});return H&&l?(0,Q.jsx)(X,{children:H}):(0,Q.jsx)(Y,{children:G})}function ue(){let e=r(),t=i(),n=G(),a=t.state?.feedItemId??null,o=(0,Z.useCallback)(()=>{e(t.pathname+t.search,{replace:!0})},[e,t.pathname,t.search]),s=V.use.setTopBarCenter(),l=z(),{conversations:u}=H(n),{conversations:d}=U(n,!0),{conversations:f}=W(n,!0),p=(0,Z.useMemo)(()=>new Set(B(u,d,f).map(e=>e.conversationId)),[u,d,f]);return(0,Z.useEffect)(()=>(s(l?(0,Q.jsx)(c,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:`Activity`}):null),()=>{s(null)}),[l,s]),(0,Q.jsx)(le,{assistantId:n,validConversationIds:p,initialFeedItemId:a,navigationKey:t.key,onInitialFeedItemConsumed:o,onOpenConversation:t=>R(e,t),onNavigate:t=>e(t)})}export{ue as HomePageRoute};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-BFJW0bSv.js";import{n}from"./button-VkxVX0DM.js";import{n as r}from"./QueryClientProvider-EuRl-wrW.js";import{t as i}from"./useQuery-CTSuec5b.js";import{t as a}from"./useMutation-D2YPyfEH.js";import{t as o}from"./jsx-runtime-BJ8jcmzB.js";import{t as s}from"./cn-Cf8SmgbR.js";import{t as c}from"./typography-DekrYXvs.js";import{f as l,o as u}from"./list-row-CDwzGT9g.js";import{t as d}from"./createLucideIcon-B-ZPaMbU.js";import{t as f}from"./bell-CHRdx4mp.js";import{t as p}from"./brain-9Csfs96f.js";import{t as m}from"./calendar-5ZUL5438.js";import{t as h}from"./clock-1REtpnlM.js";import{t as g}from"./ellipsis-4L6z7PhT.js";import{t as _}from"./list-6yken9qv.js";import{t as v}from"./mail-9qQtaWSe.js";import{t as y}from"./message-square-ameAY_Gq.js";import{t as b}from"./rotate-ccw-Cs7aCSL9.js";import{t as x}from"./settings-B-74NxzZ.js";import{t as S}from"./shield-check-B-3lr0Uj.js";import{t as C}from"./trash-2-V2WT_DbX.js";import{I as w,S as ee,T as te,b as ne,g as T}from"./src-qDZBwoEm.js";import{t as re}from"./tag-Ddzwz3ij.js";import"./i18n--HmJLuhM.js";import{t as E}from"./useTranslation-DdVCKPgw.js";import{i as ie}from"./utils-BEkyAhbA.js";import{Bt as ae,Lt as oe,Rt as se,zt as ce}from"./sdk.gen-CiE6cMi0.js";import{d as D}from"./routes-B7wRw3UT.js";import{Nt as le,U as ue,W as O}from"./react-query.gen-Bbh5MII3.js";import{t as k}from"./use-bus-subscription-BuhDYgS1.js";import{t as de}from"./haptics-Sti0ZroX.js";import{t as fe}from"./use-media-query-oO6k9fDB.js";import{t as pe}from"./pointer-BMK9brNn.js";import{t as me}from"./interactive-target-CXv5tgJB.js";import{t as he}from"./swipe-action-reveal-Ctx7MIFN.js";import{t as ge}from"./native-anchor-WUfwamgX.js";import{i as _e}from"./format-date-B_oQDqU9.js";import{n as ve}from"./schedules-C2Tr1zNV.js";var A=d(`mail-open`,[[`path`,{d:`M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z`,key:`1jhwl8`}],[`path`,{d:`m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10`,key:`1qfld7`}]]),j=e(t(),1),ye=500,be=10;function M(e,t=ye,n={}){let{shouldSkip:r,ignoreInteractiveTarget:i=!1}=n,a=(0,j.useRef)(null),o=(0,j.useRef)(null),s=(0,j.useCallback)(()=>{a.current&&=(clearTimeout(a.current),null)},[]);return{onTouchStart:(0,j.useCallback)(n=>{if(!pe())return;let c=n.touches[0];if(!c)return;let l=n.target;!i&&me(l)||r?.(l)||(o.current={x:c.clientX,y:c.clientY},s(),a.current=setTimeout(()=>{let t=window.getSelection();if(t&&t.toString().length>0){s();return}de.light(),e()},t))},[e,t,s,r,i]),onTouchMove:(0,j.useCallback)(e=>{if(!o.current)return;let t=e.touches[0];if(!t)return;let n=t.clientX-o.current.x,r=t.clientY-o.current.y;Math.hypot(n,r)>be&&s()},[s]),onTouchEnd:(0,j.useCallback)(()=>{s(),o.current=null},[s]),onTouchCancel:(0,j.useCallback)(()=>{s(),o.current=null},[s])}}function N({shouldSkip:e}={}){let[t,n]=(0,j.useState)(!1),r=(0,j.useRef)(!1),i=M((0,j.useCallback)(()=>{r.current=!0,n(!0)},[]),void 0,{ignoreInteractiveTarget:!0,shouldSkip:e}),a=(0,j.useCallback)(e=>{n(e),e||(r.current=!1)},[]),o=(0,j.useCallback)(()=>a(!1),[a]),s=(0,j.useCallback)(e=>{r.current&&(r.current=!1,e.preventDefault(),e.stopPropagation())},[]),c=(0,j.useCallback)(e=>{i.onTouchEnd(),r.current&&e.preventDefault()},[i]);return{open:t,onOpenChange:a,close:o,wrapperProps:{className:`contents`,onClickCapture:s,onTouchStart:i.onTouchStart,onTouchMove:i.onTouchMove,onTouchEnd:c,onTouchCancel:i.onTouchCancel}}}var xe=`(hover: hover)`;function P(){return fe(xe)}function Se(e){let t=P();return e?t:!0}var Ce=`0.10.5`;function we(){return ie(Ce)}var F=o(),I={security:{icon:S,strong:`var(--feed-nudge-strong)`,weak:`var(--feed-nudge-weak)`,labelKey:`category.security`},email:{icon:v,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`,labelKey:`category.email`},scheduling:{icon:h,strong:`var(--feed-thread-strong)`,weak:`var(--feed-thread-weak)`,labelKey:`category.scheduling`},background:{icon:x,strong:`var(--system-info-strong)`,weak:`var(--system-info-weak)`,labelKey:`category.background`},system:{icon:f,strong:`var(--feed-digest-strong)`,weak:`var(--feed-digest-weak)`,labelKey:`category.system`}};function L(e){return e&&I[e]?I[e]:I.system}var Te=[`security`,`email`,`scheduling`,`background`,`system`],R=`all`;function Ee({categories:e,activeFilter:t,onFilterChange:n}){let{t:r}=E(`home`),i=Te.filter(t=>e.includes(t));if(i.length<=1)return null;let a=[{value:R,label:r(`category.all`),icon:(0,F.jsx)(_,{className:`h-4 w-4`})},...i.map(e=>{let{icon:t,labelKey:n}=I[e];return{value:e,label:r(n),icon:(0,F.jsx)(t,{className:`h-4 w-4`})}})];return(0,F.jsx)(u,{ariaLabel:r(`homeFeedFilterBar.ariaLabel`),value:t??R,onChange:e=>n(e===R?null:e),items:a,className:`self-start !w-auto [&>*]:!flex-none`})}function De({category:e}){let{t}=E(`home`),n=L(e);return(0,F.jsx)(re,{className:`bg-[var(--feed-chip-weak)] uppercase tracking-wide leading-none`,style:{"--feed-chip-weak":n.weak},children:t(n.labelKey)})}var Oe=12,z=280,B=4096,ke=B*4,Ae=`.,;:!?-…`,je=/(?:…|\.{3,})$/,Me=new Set([`break`,`delete`,`emphasis`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`link`,`linkReference`,`strong`,`text`]),Ne=ee().use(te).use(T);function V(e){return Ae.includes(e)}function Pe(e){let t=e.length;for(;t>0&&V(e[t-1]);)--t;return e.slice(0,t)}function Fe(e){if(e.length<=B)return H(e);let t=H(e.slice(0,B));return t.length>0||e.trim().length===0?t:H(e.slice(0,ke))}function H(e){return U(Ne.parse(e)).replace(/\s+/g,` `).trim()}function U(e){switch(e.type){case`code`:case`html`:case`thematicBreak`:case`yaml`:return``;case`inlineCode`:case`text`:return e.value??``;case`break`:return` `;case`delete`:case`emphasis`:case`link`:case`linkReference`:case`strong`:return W(e);case`image`:case`imageReference`:{let t=e.alt??``;return t.trim().length===0?``:t}default:return e.children===void 0?e.value??``:W(e)}}function W(e){let t=``;for(let n of e.children??[]){let e=U(n);e.length!==0&&(t.length>0&&!Me.has(n.type)&&(t+=` `),t+=e)}return t}function G(e){let t=[],n=!1;for(let r=0;r<e.length;r+=1){let i=e[r],a=r+1;if(/\s/.test(i)){if(n||t.length===0)continue;n=!0,t.push({char:` `,end:a});continue}n=!1;let o=i.toLowerCase();t.push({char:o.length===1?o:i,end:a})}return t}function K(e){return Pe(G(e).map(e=>e.char).join(``).trimEnd()).trimEnd()}function Ie(e,t){if(t<=0)return e;let n=G(e);return t>n.length?``:e.slice(n[t-1].end)}function Le(e){let t=0;for(;t<e.length;){let n=e[t];if(!/\s/.test(n)&&!V(n))break;t+=1}return e.slice(t)}function q(e){return e!==void 0&&/[\p{L}\p{M}\p{N}]/u.test(e)}function J(e,t){return e.startsWith(t)?!q(e[t.length]):!1}function Y(e,t){let n=t;for(;n>0&&q(e[n-1]);)--n;return n}function Re(e){if(e.length<=z)return e;let t=e.slice(0,z),n=q(e[z])?Y(t,t.length):t.length,r=t.slice(0,n).trimEnd();return r.length===0?t:r}function X(e){return Re(Fe(e))}function ze(e,t){let n=X(t);if(n.length===0)return null;let r=K(n),i=K(e);if(r===i)return null;let a=je.test(e.trimEnd());if(!(a?r.startsWith(i):J(r,i)))return(a?i.startsWith(r):J(i,r))?null:n;let o=Le(Ie(n,a&&q(r[i.length])?Y(r,i.length):i.length));return o.length<Oe?null:o}function Be({item:e,isUnread:t,validConversationIds:n,onDismiss:r,onToggleRead:i,onGoToThread:a,trailingAction:o,t:s}){if(o===`restore`)return[{id:`restore`,label:s(`actions.restore`),icon:b,onSelect:()=>r(e.id),swipeEdge:`trailing`,showsLabel:!0}];let c=[];i&&c.push({id:`toggle-read`,label:s(t?`actions.markAsRead`:`actions.markAsUnread`),icon:t?A:v,onSelect:()=>i(e.id,t?`seen`:`new`),swipeEdge:`trailing`});let l=e.conversationId;return a&&l!=null&&(!n||n.has(l))&&c.push({id:`go-to-thread`,label:s(`actions.goToThread`),icon:y,onSelect:()=>{t&&i&&i(e.id,`seen`),a(l)}}),c.push({id:`dismiss`,label:s(`actions.dismiss`),icon:C,onSelect:()=>r(e.id),destructive:!0,swipeEdge:`trailing`}),c}function Z(e,t){return e.filter(e=>e.swipeEdge===t).map(e=>({id:e.id,label:e.label,icon:e.icon,variant:e.destructive?`destructive`:`default`,onSelect:e.onSelect}))}var Q=s(`flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md`,`text-[var(--content-secondary)] transition-colors`,`hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`);function Ve({actions:e}){return(0,F.jsx)(F.Fragment,{children:e.map(({id:e,label:t,icon:r,onSelect:i,showsLabel:a})=>(0,F.jsx)(n,{content:t,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":t,onClick:e=>{e.stopPropagation(),i()},className:s(Q,a&&`w-auto gap-[var(--app-spacing-xs)] px-2`),children:[(0,F.jsx)(r,{width:16,height:16,"aria-hidden":`true`}),a?(0,F.jsx)(`span`,{className:`text-body-small-default`,children:t}):null]})},e))})}function He({label:e}){return(0,F.jsx)(w.Trigger,{asChild:!1,"aria-label":e,className:s(Q,`pointer-events-auto`),children:(0,F.jsx)(g,{width:16,height:16,"aria-hidden":`true`})})}function Ue({actions:e,title:t,open:n,onOpenChange:r,children:i}){return(0,F.jsxs)(w.Root,{open:n,onOpenChange:r,presentation:`sheet`,children:[i,(0,F.jsx)(w.Content,{title:t,showTitle:!0,children:e.map(({id:e,label:t,icon:n,onSelect:r,destructive:i})=>(0,F.jsx)(w.Item,{icon:n,label:t,tone:i?`destructive`:`default`,onSelect:r},e))})]})}function We(e){return[...e].sort((e,t)=>e.priority===t.priority?new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime():t.priority-e.priority)}function Ge(e){let t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),i={today:[],yesterday:[],older:[]};for(let t of e){let e=new Date(t.createdAt);e>=n?i.today.push(t):e>=r?i.yesterday.push(t):i.older.push(t)}let a=new Map;return i.today.length>0&&a.set(`today`,i.today),i.yesterday.length>0&&a.set(`yesterday`,i.yesterday),i.older.length>0&&a.set(`older`,i.older),a}function Ke(e,t){return t===null?e:e.filter(e=>(e.category??`system`)===t)}function qe(e){return e.filter(e=>e.urgency!==`high`&&e.urgency!==`critical`)}function Je(e){return qe(e.filter(e=>e.status!==`dismissed`))}function Ye(e,t){let n=e?.metadata?.[t];return typeof n==`string`&&n.length>0?n:null}function Xe(e){return Ye(e,`scheduleId`)}function Ze(e){return Ye(e,`skillId`)}var Qe=`Notification`;function $e(e){let t=e.title??X(e.summary);return t.length>0?t:Qe}function et(e){return{from:[`new`],to:`seen`,ids:e.filter(e=>e.status===`new`).map(e=>e.id)}}function tt(e){return{from:[`new`,`seen`,`acted_on`],to:`dismissed`,ids:e.map(e=>e.id)}}function nt(e){let t=new Set;for(let n of e)t.add(n.category??`system`);return[...t]}var $=`data-recap-card-link`,rt={[$]:``},it=e=>{let t=e?.closest(`button, a`);return t!=null&&!t.hasAttribute($)},at=new Set([`Conversation`,`Other`]),ot={comfortable:{card:`p-[var(--app-spacing-md)]`,stack:`gap-[var(--app-spacing-xs)]`,titleVariant:`title-small`,clamp:`line-clamp-2`,showsMetaRow:!0},compact:{card:`p-[var(--app-spacing-sm)]`,stack:`gap-[var(--app-spacing-xxs)]`,titleVariant:`body-medium-default`,clamp:`line-clamp-1`,showsMetaRow:!1}};function st({item:e,isActive:t=!1,validConversationIds:n,onSelect:r,onDismiss:i,onToggleRead:a,onGoToThread:o,trailingAction:u=`dismiss`,density:d=`comfortable`}){let{t:f}=E(`home`),p=e.status===`new`,m=ot[d],h=Be({item:e,isUnread:p,validConversationIds:n,onDismiss:i,onToggleRead:a,onGoToThread:o,trailingAction:u,t:f}),g=P(),_=N({shouldSkip:it}),v=f(`homeRecapRow.actionsTitle`),y=e.sourceLabel&&!at.has(e.sourceLabel)?e.sourceLabel:null,b=(0,j.useMemo)(()=>$e({title:e.title,summary:e.summary}),[e.title,e.summary]),x=(0,j.useMemo)(()=>ze(b,e.summary),[b,e.summary]),S=(0,F.jsx)(c,{"data-testid":`home-recap-row-title`,variant:m.titleVariant,className:s(`leading-snug text-[var(--content-default)]`,m.showsMetaRow?m.clamp:`min-w-0 flex-1 truncate`),children:b}),C=(0,F.jsx)(c,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,...g?{"data-reveal-yield":``}:{},children:_e(e.timestamp)}),w=(0,F.jsxs)(`div`,{"data-reveal-row":``,className:s(`group relative flex w-full items-start gap-[var(--app-spacing-sm)]`,`rounded-[var(--radius-lg)] border border-[var(--border-base)]`,`transition-[background-color,opacity] duration-150`,m.card,t?`bg-[var(--surface-active)]`:`bg-[var(--surface-overlay)] hover:bg-[var(--surface-hover)]`,!p&&!t&&`opacity-70`),children:[(0,F.jsx)(`button`,{type:`button`,"aria-label":b,onClick:()=>r(e),...rt,className:`absolute inset-0 w-full cursor-pointer rounded-[var(--radius-lg)]`}),(0,F.jsx)(`div`,{"data-testid":`home-recap-row-dot-gutter`,className:`pointer-events-none relative flex h-8 w-2 shrink-0 items-center`,children:p&&(0,F.jsx)(`span`,{"data-testid":`home-recap-row-unread-dot`,"aria-hidden":`true`,className:`h-2 w-2 rounded-full bg-[var(--system-mid-strong)]`})}),(0,F.jsxs)(`div`,{className:s(`pointer-events-none relative flex min-w-0 flex-1 flex-col`,m.stack),children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[m.showsMetaRow?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(De,{category:e.category}),y!==null&&(0,F.jsx)(c,{variant:`body-small-default`,className:`min-w-0 truncate text-[var(--content-tertiary)]`,children:y})]}):S,g?(0,F.jsxs)(l,{className:`ml-auto justify-items-end`,children:[C,(0,F.jsx)(`span`,{"data-reveal":``,className:`flex items-center gap-[var(--app-spacing-sm)]`,children:(0,F.jsx)(Ve,{actions:h})})]}):(0,F.jsxs)(`span`,{className:`ml-auto flex items-center gap-[var(--app-spacing-sm)]`,children:[C,(0,F.jsx)(He,{label:v})]})]}),m.showsMetaRow&&S,x!==null&&(0,F.jsx)(c,{variant:`body-medium-lighter`,className:s(`leading-normal text-[var(--content-secondary)]`,m.clamp),children:x})]})]});return(0,F.jsx)(Ue,{actions:h,title:v,open:_.open,onOpenChange:_.onOpenChange,children:(0,F.jsx)(`div`,{..._.wrapperProps,children:(0,F.jsx)(he,{leadingActions:Z(h,`leading`),trailingActions:Z(h,`trailing`),className:`rounded-[var(--radius-lg)]`,children:w})})})}var ct=[{kind:`schedule`,labelKey:`actions.viewSchedule`,icon:m,readId:Xe,toDetail:e=>D.schedules.detail(e)},{kind:`skill`,labelKey:`actions.viewSkill`,icon:p,readId:Ze,toDetail:e=>D.skills.detail(e)}];function lt(e,t,n){let r=i({...ve(t??void 0),enabled:n}),a=i({...le({path:{assistant_id:t??``},query:{kind:`installed`}}),enabled:n&&!!t}),o=r.data,s=a.data;return(0,j.useMemo)(()=>{if(!t)return{links:[],isPending:!1};let n={schedule:{items:o,isPending:r.isPending},skill:{items:s?.skills,isPending:a.isPending}},i=[],c=!1;for(let t of ct){let r=t.readId(e);if(r===null)continue;let a=n[t.kind];if(a.isPending)c=!0;else if(!a.items?.some(e=>e.id===r))continue;i.push({kind:t.kind,labelKey:t.labelKey,icon:t.icon,to:t.toDetail(r)})}return{links:i,isPending:c}},[t,e,o,s,r.isPending,a.isPending])}function ut(e){let t=r(),n=(0,j.useRef)(null),o=(0,j.useRef)(0),s=(0,j.useMemo)(()=>({path:{assistant_id:e??``},query:{timeAwaySeconds:0}}),[e]),c=(0,j.useMemo)(()=>ue(s),[s]);k(`app.hidden`,()=>{n.current=Date.now()}),k(`app.resume`,({signal:r})=>{r!==`online`&&n.current!==null&&(o.current=Math.round((Date.now()-n.current)/1e3),n.current=null,e&&t.invalidateQueries({queryKey:c}))});let l=i({queryKey:c,queryFn:async({signal:t})=>{let{data:n}=await ce({path:{assistant_id:e},query:{timeAwaySeconds:o.current},signal:t,throwOnError:!0});return n},enabled:!!e,staleTime:3e4}),u=a({mutationFn:async({itemId:t,status:n})=>{let{data:r}=await se({path:{assistant_id:e,id:t},body:{status:n},throwOnError:!0});return r},onMutate:async({itemId:e,status:n})=>{await t.cancelQueries({queryKey:c});let r=t.getQueryData(c);return O(t,s,t=>t&&{...t,items:t.items.map(t=>t.id===e?{...t,status:n}:t)}),{previous:r}},onError:(e,n,r)=>{r?.previous&&O(t,s,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:c})}}),d=a({mutationFn:async({itemId:t,actionId:n})=>{let{data:r}=await oe({path:{assistant_id:e,id:t,actionId:n},throwOnError:!0});return r},onMutate:async({itemId:e})=>{await t.cancelQueries({queryKey:c});let n=t.getQueryData(c);return O(t,s,t=>t&&{...t,items:t.items.map(t=>t.id===e?{...t,status:`acted_on`}:t)}),{previous:n}},onError:(e,n,r)=>{r?.previous&&O(t,s,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:c})}}),f=a({mutationFn:async({from:t,to:n,ids:r})=>{let{data:i}=await ae({path:{assistant_id:e},body:{from:t,to:n,ids:r},throwOnError:!0});return i},onMutate:async({from:e,to:n,ids:r})=>{await t.cancelQueries({queryKey:c});let i=t.getQueryData(c),a=new Set(e),o=r?new Set(r):null;return O(t,s,e=>{if(!e)return e;let t=e.items.map(e=>a.has(e.status)&&e.status!==n&&(!o||o.has(e.id))?{...e,status:n}:e),r=t.filter(e=>e.status===`new`).length;return{...e,items:t,contextBanner:{...e.contextBanner,newCount:r}}}),{previous:i}},onError:(e,n,r)=>{r?.previous&&O(t,s,r.previous)},onSettled:()=>{t.invalidateQueries({queryKey:c})}}),p=(0,j.useCallback)(()=>{e&&t.invalidateQueries({queryKey:c})},[e,t,c]);return{...l,updateStatus:u,triggerAction:d,markAll:f,invalidate:p}}var dt={p:({children:e})=>(0,F.jsx)(`p`,{className:`mb-2 text-body-medium-default last:mb-0`,style:{color:`var(--content-secondary)`},children:e}),strong:({children:e})=>(0,F.jsx)(`strong`,{style:{color:`var(--content-default)`},children:e}),em:({children:e})=>(0,F.jsx)(`em`,{style:{color:`var(--content-default)`},children:e}),a:({href:e,children:t})=>(0,F.jsx)(`a`,{href:e,className:`underline`,style:{color:`var(--content-link)`},target:`_blank`,rel:`noopener noreferrer`,onClick:t=>ge(t,e),children:t}),ul:({children:e})=>(0,F.jsx)(`ul`,{className:`mb-2 list-disc pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),ol:({children:e})=>(0,F.jsx)(`ol`,{className:`mb-2 list-decimal pl-5 text-body-medium-default`,style:{color:`var(--content-secondary)`},children:e}),li:({children:e})=>(0,F.jsx)(`li`,{className:`mb-0.5`,children:e}),code:({children:e})=>(0,F.jsx)(`code`,{className:`rounded px-1 py-0.5 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 8%, transparent)`,color:`var(--content-default)`},children:e}),pre:({children:e})=>(0,F.jsx)(`pre`,{className:`mb-2 overflow-x-auto rounded p-3 font-mono text-[0.85em]`,style:{backgroundColor:`color-mix(in oklab, var(--content-default) 6%, transparent)`,color:`var(--content-default)`},children:e}),h1:({children:e})=>(0,F.jsx)(`h1`,{className:`mb-2 text-title-medium first:mt-0`,style:{color:`var(--content-default)`},children:e}),h2:({children:e})=>(0,F.jsx)(`h2`,{className:`mb-2 text-title-small first:mt-0`,style:{color:`var(--content-default)`},children:e}),h3:({children:e})=>(0,F.jsx)(`h3`,{className:`mb-1 text-body-medium-default first:mt-0`,style:{color:`var(--content-default)`},children:e}),blockquote:({children:e})=>(0,F.jsx)(`blockquote`,{className:`mb-2 border-l-2 pl-3 text-body-medium-default`,style:{borderColor:`var(--border-base)`,color:`var(--content-tertiary)`},children:e}),table:({children:e})=>(0,F.jsx)(`div`,{className:`mb-2 overflow-x-auto`,children:(0,F.jsx)(`table`,{className:`w-full border-collapse text-body-small-default`,style:{color:`var(--content-secondary)`},children:e})}),thead:({children:e})=>(0,F.jsx)(`thead`,{style:{backgroundColor:`var(--surface-lift)`},children:e}),tbody:({children:e})=>(0,F.jsx)(`tbody`,{children:e}),tr:({children:e})=>(0,F.jsx)(`tr`,{style:{borderBottom:`1px solid var(--border-base)`},children:e}),th:({children:e})=>(0,F.jsx)(`th`,{className:`px-2 py-1.5 text-left font-semibold`,style:{color:`var(--content-default)`},children:e}),td:({children:e})=>(0,F.jsx)(`td`,{className:`px-2 py-1.5 align-top`,children:e})};function ft({content:e,className:t}){return(0,F.jsx)(`div`,{className:s(`text-body-medium-default`,t),children:(0,F.jsx)(ne,{remarkPlugins:[T],components:dt,children:e})})}function pt({item:e,className:t}){return(0,F.jsx)(ft,{content:e.summary,className:t})}function mt(e){switch(e){case`revoked`:case`expired`:return`var(--system-negative-strong)`;case`missing_scopes`:case`missing_token`:case`ping_failed`:return`var(--system-mid-strong)`;default:return`var(--content-disabled)`}}function ht(e){switch(e){case`revoked`:return`homeToolPermissionCard.status.revoked`;case`expired`:return`homeToolPermissionCard.status.expired`;case`missing_scopes`:return`homeToolPermissionCard.status.missingScopes`;case`missing_token`:return`homeToolPermissionCard.status.missingToken`;case`ping_failed`:return`homeToolPermissionCard.status.pingFailed`;case`unreachable`:return`homeToolPermissionCard.status.unreachable`;default:return null}}function gt(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function _t({item:e}){let{t}=E(`home`),n=e.metadata,r=n?.provider;if(!r)return(0,F.jsx)(c,{variant:`body-medium-default`,className:`text-[var(--content-secondary)]`,children:e.summary});let i=n?.accountInfo??null,a=n?.status??`unreachable`,o=ht(a),s=n?.details??``,l=Array.isArray(n?.missingScopes)?n.missingScopes:[];return(0,F.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-md)]`,children:[(0,F.jsx)(c,{variant:`title-small`,as:`h3`,children:r}),i?(0,F.jsx)(c,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:i}):null,(0,F.jsxs)(`div`,{className:`flex items-center gap-[var(--app-spacing-sm)]`,children:[(0,F.jsx)(`span`,{className:`inline-block shrink-0 rounded-full`,style:{width:8,height:8,backgroundColor:mt(a)},"aria-hidden":`true`}),(0,F.jsx)(c,{variant:`body-medium-default`,className:`text-[var(--content-default)]`,children:o?t(o):gt(a)})]}),s?(0,F.jsx)(c,{variant:`body-medium-lighter`,className:`text-[var(--content-secondary)]`,children:s}):null,l.length>0?(0,F.jsxs)(`div`,{className:`flex flex-col gap-[var(--app-spacing-xs)]`,children:[(0,F.jsx)(c,{variant:`body-small-emphasised`,className:`text-[var(--content-secondary)]`,children:t(`homeToolPermissionCard.missingScopes`)}),(0,F.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-[var(--app-spacing-xxs)] pl-[var(--app-spacing-lg)]`,children:l.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsx)(c,{variant:`body-small-default`,className:`text-[var(--content-tertiary)]`,children:e})},e))})]}):null]})}export{we as _,st as a,M as b,Ke as c,Ge as d,et as f,L as g,Ee as h,lt as i,nt as l,We as m,pt as n,tt as o,$e as p,ut as r,qe as s,_t as t,Je as u,Se as v,A as x,N as y};