@vellumai/web 0.12.0-dev.202609111724.a78dcda → 0.12.0-dev.202609111819.3dcbf21
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.
- package/dist/assets/{a2a-invite-DP_g_AcM.js → a2a-invite-B1TM1bCe.js} +1 -1
- package/dist/assets/{about-page-udNu3FXz.js → about-page-BuwaJW-s.js} +1 -1
- package/dist/assets/{account-page--5Tm7jQl.js → account-page-COntpqZS.js} +1 -1
- package/dist/assets/{account-shell-CsU22xMC.js → account-shell-Bb4i1hLJ.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-B6HbGukQ.js → acp-run-detail-panel-DVWbxXdR.js} +1 -1
- package/dist/assets/activation-Ckc07hGM.js +1 -0
- package/dist/assets/activation-lGUjCvXn.js +1 -0
- package/dist/assets/{activation-list-route-D8odVKBq.js → activation-list-route-Cy4cJpzM.js} +1 -1
- package/dist/assets/activation-tasks-Byy7LAtJ.js +1 -0
- package/dist/assets/activation-tasks-DuI0OvEq.js +1 -0
- package/dist/assets/{activity-redirect-page-loob8Z92.js → activity-redirect-page-B3t-ORmq.js} +1 -1
- package/dist/assets/{activity-steps-panel-Ctcf3Szq.js → activity-steps-panel-C2T3ethe.js} +1 -1
- package/dist/assets/{add-credits-modal-Cb--6uK8.js → add-credits-modal-DtyG_azx.js} +1 -1
- package/dist/assets/{ai-page-CJllvbSV.js → ai-page-Blhcs4jF.js} +1 -1
- package/dist/assets/{android-billing-handoff-DKjMf3JW.js → android-billing-handoff-HF9Svz1a.js} +1 -1
- package/dist/assets/{api-key-screen-Bx2C9leM.js → api-key-screen-BpcMiBSR.js} +1 -1
- package/dist/assets/{app-info-Qll2Bjji.js → app-info-BbCvvipM.js} +1 -1
- package/dist/assets/archive-redirect-page-Ceht6zQ4.js +1 -0
- package/dist/assets/{assistant-status-panel-Cp5kjYGq.js → assistant-status-panel-B1_oLYb3.js} +1 -1
- package/dist/assets/{auth-welcome-screen-9Q4FMrAq.js → auth-welcome-screen-D1oXENpF.js} +1 -1
- package/dist/assets/{avatar-random-8Kp8Nqc1.js → avatar-random-O2MS8mkz.js} +2 -2
- package/dist/assets/{await-org-header-settled-z5jHxGxi.js → await-org-header-settled-BaAPkcNY.js} +1 -1
- package/dist/assets/{background-task-detail-panel-D3KHA1BC.js → background-task-detail-panel-CdlE7jGD.js} +1 -1
- package/dist/assets/{billing-page-TgzXTfGr.js → billing-page-CGQR61l5.js} +3 -3
- package/dist/assets/{billing-redirect-page-Dis_ysv4.js → billing-redirect-page-DTsQav18.js} +1 -1
- package/dist/assets/{bookmarks-page-Ld67F6tS.js → bookmarks-page-Coo-o6tN.js} +1 -1
- package/dist/assets/{bundle-confirm-page-DEzGhKAp.js → bundle-confirm-page-bHHwLMqs.js} +1 -1
- package/dist/assets/{channel-transcript-panel-DQGJoY4V.js → channel-transcript-panel-T9LGnxtx.js} +1 -1
- package/dist/assets/{channels-page-route-DDpTZ0sk.js → channels-page-route-be5AxEBS.js} +1 -1
- package/dist/assets/{chat-efFvZ0DL.js → chat-DClgR3ch.js} +2 -2
- package/dist/assets/{chat-X7mUO9_x.js → chat-DySgrdNv.js} +2 -2
- package/dist/assets/{chat-info-panel-qxFTO9bs.js → chat-info-panel-D0hdaY9y.js} +1 -1
- package/dist/assets/{checkout-continuation-Czqo9cv_.js → checkout-continuation-CasqofaZ.js} +1 -1
- package/dist/assets/{checkout-page-DPRsrrnT.js → checkout-page-CJQCyy4V.js} +1 -1
- package/dist/assets/checkout-return-target-DI8P9jJo.js +1 -0
- package/dist/assets/{command-palette-ChTwP3HM.js → command-palette-CTTOCYEh.js} +1 -1
- package/dist/assets/{command-palette-window-page-D5oU_cAl.js → command-palette-window-page-Ddyoo8lT.js} +1 -1
- package/dist/assets/{community-page-C2Z9w0kr.js → community-page-BXwMupbZ.js} +1 -1
- package/dist/assets/{companion-accent-uCkWMXEt.js → companion-accent-BwWgOv7U.js} +1 -1
- package/dist/assets/{companion-layout-CwvFzZrj.js → companion-layout-CocOY9k0.js} +1 -1
- package/dist/assets/{companion-surface-page-CVF0yRiM.js → companion-surface-page-DC64P76K.js} +1 -1
- package/dist/assets/{companion-watch-frame-page-B0QW7vng.js → companion-watch-frame-page-C8pt70Ax.js} +1 -1
- package/dist/assets/{connect-page-exbWkgam.js → connect-page-D4JlQKYu.js} +1 -1
- package/dist/assets/{consent-controls-BQu7iq5e.js → consent-controls-BlYAuLbg.js} +1 -1
- package/dist/assets/{contacts-gateway-5_gPpXAz.js → contacts-gateway-BZ5dqaxm.js} +1 -1
- package/dist/assets/{contacts-page-route-C78XjeBX.js → contacts-page-route-Dwa1SNKh.js} +1 -1
- package/dist/assets/{credential-entry-page-9--fxhHR.js → credential-entry-page-B4ILsvEv.js} +1 -1
- package/dist/assets/{credentials-page-WIsWULpM.js → credentials-page-DK3pDeqd.js} +1 -1
- package/dist/assets/{csv-preview-Cd3HCzYw.js → csv-preview-B386P-zj.js} +1 -1
- package/dist/assets/danger-zone-redirect-page-Dchd67zh.js +1 -0
- package/dist/assets/{debug-page-BUfF3N0S.js → debug-page-BIxAiGp9.js} +1 -1
- package/dist/assets/{deploy-dialogs-BP-kbL8H.js → deploy-dialogs-CCPmFOvq.js} +1 -1
- package/dist/assets/{detail-card-KqTFI_aO.js → detail-card-Eweuo5tS.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-DRm2XwFn.js → detail-panel-stop-button-CdK_e0So.js} +1 -1
- package/dist/assets/{detail-primitives-DyjdUu5Z.js → detail-primitives-BxS40gwc.js} +1 -1
- package/dist/assets/{developer-page-CBQTiBEj.js → developer-page-CzRFQCEL.js} +1 -1
- package/dist/assets/devices-redirect-page-CSlZDDyJ.js +1 -0
- package/dist/assets/{dictation-overlay-page-CtQNkVUY.js → dictation-overlay-page-Cd1nBzzb.js} +1 -1
- package/dist/assets/{document-viewer-page-D24Ff8ow.js → document-viewer-page-C_zklMel.js} +1 -1
- package/dist/assets/{emails-page-CLWBqFOS.js → emails-page-zTHs9CZS.js} +1 -1
- package/dist/assets/{environment-store-Da2oTF1h.js → environment-store-BvHAssAh.js} +1 -1
- package/dist/assets/{file-diff-view-Oc2pQSof.js → file-diff-view-eeBmav_-.js} +1 -1
- package/dist/assets/{file-editor-6a20KxRi.js → file-editor-r5efUadh.js} +1 -1
- package/dist/assets/{general-page-CCTue9MU.js → general-page-Dc9VXRfA.js} +1 -1
- package/dist/assets/{hatching-screen-BZMAm80J.js → hatching-screen-B0LlaOTI.js} +1 -1
- package/dist/assets/{hosting-screen-BcSLTC-q.js → hosting-screen-gnnq8JsF.js} +1 -1
- package/dist/assets/{identity-page-route-C7DKOGvp.js → identity-page-route-YVcu3hoE.js} +1 -1
- package/dist/assets/{index-DA0GBGXJ.js → index-BGc71lz7.js} +10 -10
- package/dist/assets/{inspect-page-CZJsiLEe.js → inspect-page-C-46GP55.js} +3 -3
- package/dist/assets/{integrations-page-B3dMqw8M.js → integrations-page-B-XPVmaT.js} +1 -1
- package/dist/assets/{intelligence-layout-RhyTxMSe.js → intelligence-layout-DbWlafD2.js} +1 -1
- package/dist/assets/intelligence-layout-slots-store-BEOZeNOk.js +1 -0
- package/dist/assets/keyboard-shortcuts-redirect-page-XQfGq-aG.js +1 -0
- package/dist/assets/{latest-assistant-text-CiZ2aiBH.js → latest-assistant-text-28_-13vC.js} +1 -1
- package/dist/assets/{library-detail-page-_Q0hBYE_.js → library-detail-page-DHOztt36.js} +1 -1
- package/dist/assets/{library-page-Dr1BhFXm.js → library-page-BbRkHb4Q.js} +1 -1
- package/dist/assets/{login-page-CuBtuBOw.js → login-page-BbrLhUPN.js} +1 -1
- package/dist/assets/{logout-page-C5KjPVFy.js → logout-page-C8YsxQVr.js} +1 -1
- package/dist/assets/{logs-layout-CsW3faxO.js → logs-layout-wBztKOYt.js} +1 -1
- package/dist/assets/{markdown-preview-0Ch4z4pz.js → markdown-preview-C4OQT-kf.js} +1 -1
- package/dist/assets/{media-preview-AnqFAH9t.js → media-preview-C3YHOZec.js} +1 -1
- package/dist/assets/{memory-page-route-VwP679Jm.js → memory-page-route-BMfR6AkJ.js} +1 -1
- package/dist/assets/{memory-router-playground-page-CD7hF0hP.js → memory-router-playground-page-BjY6R5nq.js} +1 -1
- package/dist/assets/{message-files-panel-DPDdn0By.js → message-files-panel-BJX8nH8c.js} +1 -1
- package/dist/assets/{metric-card-Cdu_e5nI.js → metric-card-oVwydQvD.js} +1 -1
- package/dist/assets/{notifications-page-PHDLqDBN.js → notifications-page-B6WbxBpc.js} +1 -1
- package/dist/assets/{oauth-complete-page-DJdZLOdY.js → oauth-complete-page-BF6caqFq.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-B7XQ-5vJ.js → oauth-popup-complete-page-DStImm8d.js} +1 -1
- package/dist/assets/{onboarding-B148eClt.js → onboarding-DWgPOz2r.js} +1 -1
- package/dist/assets/{onboarding-kwhcCPBT.js → onboarding-MeAaJoiW.js} +1 -1
- package/dist/assets/{pairing-page-CBkofvmg.js → pairing-page-Cv1SPZ6q.js} +1 -1
- package/dist/assets/password-reset-page-Bx4i58cv.js +1 -0
- package/dist/assets/{pdf-file-preview-DaoJx_fr.js → pdf-file-preview-B-D2Hb67.js} +1 -1
- package/dist/assets/{personality-page-CnBgQ_Ti.js → personality-page-Pk21z6qw.js} +1 -1
- package/dist/assets/{personality-page-DXA4PnZD.js → personality-page-nBWpzwmd.js} +1 -1
- package/dist/assets/{personality-sliders-N4SuXULx.js → personality-sliders-BVThWm_r.js} +1 -1
- package/dist/assets/{plans-page-Cj5GzxUq.js → plans-page-DjgMJFKs.js} +1 -1
- package/dist/assets/{platform-loopback-page-B59rEovu.js → platform-loopback-page-Ch8FHpH3.js} +1 -1
- package/dist/assets/{plugin-detail-page-BNu8lvKs.js → plugin-detail-page-BziDav6Y.js} +1 -1
- package/dist/assets/{plugins-page-Dgzyns7w.js → plugins-page-9G4uVySk.js} +1 -1
- package/dist/assets/plugins-surface-Cf8ruv38.js +1 -0
- package/dist/assets/{preview-error-BzQPJj0w.js → preview-error-DtZ0mjgO.js} +1 -1
- package/dist/assets/{privacy-page-Dj3ILD9r.js → privacy-page-BoF-wtyG.js} +1 -1
- package/dist/assets/{privacy-screen-ByqqsGU_.js → privacy-screen-BTCARBNX.js} +1 -1
- package/dist/assets/{provider-callback-page-B6H1Rvf7.js → provider-callback-page-CL5mEpY-.js} +1 -1
- package/dist/assets/{provider-key-BKQpSk7P.js → provider-key-nLHA-vrA.js} +1 -1
- package/dist/assets/{provider-signup-page-CP-FctDo.js → provider-signup-page-CMd__W3N.js} +1 -1
- package/dist/assets/{quick-input-page-CcsJzXFa.js → quick-input-page-XWEwDtv5.js} +1 -1
- package/dist/assets/{research-mock-page-BkF9RGen.js → research-mock-page-DIhOAxCF.js} +1 -1
- package/dist/assets/{research-onboarding-route-rPOozDNc.js → research-onboarding-route-Dd0-0CyM.js} +1 -1
- package/dist/assets/{review-terms-screen-B9Bx_3aC.js → review-terms-screen-CF1aaQI1.js} +1 -1
- package/dist/assets/{schedules-BKEvcn5Y.js → schedules-C6o11_7j.js} +1 -1
- package/dist/assets/{schedules-page-DP117KwE.js → schedules-page-CyGYePYz.js} +1 -1
- package/dist/assets/security-redirect-page-BLNu1Rsa.js +1 -0
- package/dist/assets/{select-assistant-screen-BeiTStgG.js → select-assistant-screen-DgYHoLTl.js} +1 -1
- package/dist/assets/{self-hosted-servers-BGmx-jtk.js → self-hosted-servers-DEAKDkLi.js} +1 -1
- package/dist/assets/{service-form-controls-CSRaq9bh.js → service-form-controls-DktsnkKk.js} +1 -1
- package/dist/assets/{setting-row-CymQ5trC.js → setting-row-uWULksXj.js} +1 -1
- package/dist/assets/{settings-62XDVp9M.js → settings-DAZx3UMV.js} +1 -1
- package/dist/assets/{settings-D-ZBeAh8.js → settings-UQFKpPlZ.js} +1 -1
- package/dist/assets/{settings-divider-CAUYVvDn.js → settings-divider-BKCX5X7_.js} +1 -1
- package/dist/assets/{settings-layout-BrLaFbHi.js → settings-layout-BfoGETLu.js} +1 -1
- package/dist/assets/{share-feedback-modal-D07btX6t.js → share-feedback-modal-CR7uFcXo.js} +1 -1
- package/dist/assets/{sidebar-tree-BHSckrNt.js → sidebar-tree-Dpyg9Gd-.js} +1 -1
- package/dist/assets/{signup-page-CF9kuXtf.js → signup-page-wIkWcZ9S.js} +1 -1
- package/dist/assets/{signup-shell-DnGBpItW.js → signup-shell-ov7b3EFc.js} +1 -1
- package/dist/assets/{skill-detail-page-OHUI1VDL.js → skill-detail-page-AcYYwc6Y.js} +1 -1
- package/dist/assets/{skill-detail-panel-DjOI7a3J.js → skill-detail-panel-DFSVR47k.js} +1 -1
- package/dist/assets/{skill-removal-dialog-B1Ifr9Qf.js → skill-removal-dialog-DqVA6ZY3.js} +1 -1
- package/dist/assets/{skills-page-Di07w0sz.js → skills-page-BVvT6S7g.js} +1 -1
- package/dist/assets/{sounds-page-DPrfZ8Cd.js → sounds-page-D_jusJc1.js} +1 -1
- package/dist/assets/{start-screen-Co0El9QJ.js → start-screen-CNkVAAtG.js} +1 -1
- package/dist/assets/{stt-language-picker-modal-BlX9Ngse.js → stt-language-picker-modal-DtomTRfu.js} +1 -1
- package/dist/assets/{subagent-detail-panel-ChjDemxQ.js → subagent-detail-panel-BnDNicsB.js} +1 -1
- package/dist/assets/{superpowers-page-DSUlxdn9.js → superpowers-page-B1qs7ru9.js} +1 -1
- package/dist/assets/{system-events-page-BCU1KqJM.js → system-events-page-BHiTE8u6.js} +1 -1
- package/dist/assets/system-events-redirect-page-ncrdquaI.js +1 -0
- package/dist/assets/{text-preview-CuNjVggK.js → text-preview-YMvQVK9x.js} +1 -1
- package/dist/assets/{theme-stage-page-DzDdh-x5.js → theme-stage-page-Cd4ojVlR.js} +1 -1
- package/dist/assets/{tiptap-document-editor-CBx260ZF.js → tiptap-document-editor-BGMDrrIo.js} +1 -1
- package/dist/assets/{tool-detail-panel-CNi__9cn.js → tool-detail-panel-AZsQ-NK7.js} +1 -1
- package/dist/assets/{trait-cycle-row-C4sWC22V.js → trait-cycle-row-TTQUYBE4.js} +1 -1
- package/dist/assets/{upgrade-cancel-page-C_PtNj2O.js → upgrade-cancel-page-NexIIHWA.js} +1 -1
- package/dist/assets/{upgrade-success-page-BSQB9_Cm.js → upgrade-success-page-C6pFzQP7.js} +1 -1
- package/dist/assets/{usage-redirect-page-CjPFduG4.js → usage-redirect-page-DNHDVCSi.js} +1 -1
- package/dist/assets/{use-app-delete-CkS5JHqY.js → use-app-delete-yjoWefi2.js} +1 -1
- package/dist/assets/{use-assistant-identity-details-Wn7L87Qi.js → use-assistant-identity-details-CB3HbXtP.js} +1 -1
- package/dist/assets/{use-checkout-dismiss-refresh-BLqdQJ6t.js → use-checkout-dismiss-refresh-vaMDDxbF.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-cqgtKC7U.js → use-edge-swipe-back-VtlKpCI9.js} +1 -1
- package/dist/assets/{use-hotkey-recorder-D2r7fJ8G.js → use-hotkey-recorder-Dtp0Q3Pl.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-Cji1m5nT.js → use-invite-link-dialog-CYXgHF94.js} +1 -1
- package/dist/assets/{use-platform-assistant-id-CIhRO2t6.js → use-platform-assistant-id-uGT6QKV1.js} +1 -1
- package/dist/assets/{use-return-to-short-circuit-BiPB34GV.js → use-return-to-short-circuit-DSf4X06z.js} +1 -1
- package/dist/assets/{use-side-list-room-DkZxNs0h.js → use-side-list-room-uFC4K56E.js} +1 -1
- package/dist/assets/{use-skill-actions-DdWetx8c.js → use-skill-actions-BikZh5hd.js} +1 -1
- package/dist/assets/{use-skill-detail-files-BIz84eHS.js → use-skill-detail-files-BU9E_tqV.js} +1 -1
- package/dist/assets/use-supports-credentials-settings-B0hFNSuE.js +1 -0
- package/dist/assets/use-transcript-message-by-id-B1o6T9cm.js +1 -0
- package/dist/assets/{voice-page-CiZxWg44.js → voice-page-CswRtKVb.js} +1 -1
- package/dist/assets/{wake-detail-panel-pJssTIGS.js → wake-detail-panel-BFw4dQtG.js} +1 -1
- package/dist/assets/{weather-forecast-display-CM95Xppv.js → weather-forecast-display-BQ5gzjZn.js} +1 -1
- package/dist/assets/{welcome-screen-tl7YCRo9.js → welcome-screen-jVv9dhX0.js} +1 -1
- package/dist/assets/{workflow-detail-panel-osVXzNYK.js → workflow-detail-panel-ByPhHsB6.js} +1 -1
- package/dist/assets/{workspace-page-C1-M8gUL.js → workspace-page-BCI125Zv.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/activation-DNTHICWu.js +0 -1
- package/dist/assets/activation-LB7FclIH.js +0 -1
- package/dist/assets/activation-tasks-B4YTC7sk.js +0 -1
- package/dist/assets/activation-tasks-DEC1jM2E.js +0 -1
- package/dist/assets/archive-redirect-page-BLDVxCoz.js +0 -1
- package/dist/assets/checkout-return-target-UpUQrOya.js +0 -1
- package/dist/assets/danger-zone-redirect-page-BI9sVp_S.js +0 -1
- package/dist/assets/devices-redirect-page-BTaqT1YT.js +0 -1
- package/dist/assets/intelligence-layout-slots-store-BWpVsdSd.js +0 -1
- package/dist/assets/keyboard-shortcuts-redirect-page-B1-jjDXg.js +0 -1
- package/dist/assets/password-reset-page-lV4eaZuP.js +0 -1
- package/dist/assets/plugins-surface-CesNLzwK.js +0 -1
- package/dist/assets/security-redirect-page-BEV17bTy.js +0 -1
- package/dist/assets/system-events-redirect-page-BY49O_Mi.js +0 -1
- package/dist/assets/use-supports-credentials-settings-BCljiCHR.js +0 -1
- package/dist/assets/use-transcript-message-by-id-zYuNL1yM.js +0 -1
package/dist/assets/{select-assistant-screen-BeiTStgG.js → select-assistant-screen-DgYHoLTl.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{er as t,j as n}from"./vendor-yoekmcrB.js";import{_ as r,f as i,t as a,x as o}from"./react-BJ4PZBJN.js";import{$n as s,It as c,Ki as l,ar as u,hi as d,xr as f}from"./icons-BjnVKAw1.js";import{t as p}from"./ellipsis-vertical-DqnIbNNJ.js";import{$_ as m,Am as h,Ao as g,Av as _,Cv as v,Cy as y,Dv as b,Gy as x,Hv as S,In as C,Jy as w,Lv as ee,Nv as T,Q_ as te,Ro as ne,Rr as re,Sp as ie,Uv as E,Vr as D,Vy as O,Xv as ae,Yv as k,_m as oe,aa as se,by as ce,ca as le,cm as ue,d as de,em as A,ev as fe,fb as j,fv as pe,gu as me,gv as he,ia as M,jo as ge,lb as _e,mv as N,nb as P,oa as ve,pv as ye,ru as F,sa as be,tv as I,up as xe,uv as Se,xm as Ce,xy as we,yv as Te,yy as L,zv as Ee,zy as R}from"./index-DA0GBGXJ.js";import{t as De}from"./radio-card-nav-BsBWpdyn.js";import{a as Oe,i as ke,n as Ae,o as z,r as B,t as je}from"./self-hosted-servers-BGmx-jtk.js";import{t as Me}from"./format-countdown-Ck7dI0Xw.js";var V=e(o(),1),Ne=k.remotePair.slice(`${k.assistant}/`.length);async function Pe(e,t){let n=t?S(e.url,t):null,r=t&&n!==null?`${Ne}?${new URLSearchParams({device_code:t}).toString()}`:null,i=()=>window.location.assign(n??`${e.url}${k.assistant}`);if(!A()){i();return}(r===null?await Ae(e.url):await B(e.url,r))||i()}function Fe(e){return Oe(ye()?h():window.location.origin)===e.url}var H=a();function Ie({traits:e,imageUrl:t,size:r=48,fallback:i,className:a,decorative:o=!1,onImageError:s}){let{t:c}=n(),l=D();if(e){if(!l)return i;if(ie(l,e.bodyShape,e.eyeStyle,e.color)){let t=(0,H.jsx)(C,{components:l,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:r,className:a});return o?(0,H.jsx)(`span`,{"aria-hidden":`true`,children:t}):t}}return t?(0,H.jsx)(`img`,{src:t,alt:o?``:c(`chooserAvatarChip.alt`),width:r,height:r,className:`rounded-full object-cover ${a??``}`.trim(),style:{width:r,height:r,flexShrink:0},onError:s}):i}function Le(e){let t;try{t=ce(e)}catch{return{ok:!1,reason:`unparseable`}}if(L(t))return{ok:!1,reason:`service-website`};let n=Oe(t);return n===null?{ok:!1,reason:`non-https`}:{ok:!0,url:n,deviceCode:we(e).deviceCode}}function Re({open:e,onClose:t,onAdded:r}){let{t:i}=n(`onboarding`),[a,o]=(0,V.useState)(``),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(null);(0,V.useEffect)(()=>{e&&(o(``),c(!1),u(null))},[e]);let d=()=>{s||t()},p=async()=>{if(!a.trim()||s)return;let e=Le(a);if(!e.ok){u(E(e.reason,a));return}c(!0),u(null);try{let t=await z.getState().addOrigin({url:e.url});if(t.ok){r(t.origin,e.deviceCode);return}u(i(`addRemoteOriginDialog.addFailed`))}catch(e){console.error(`addRemoteOriginDialog.add failed`,e),u(i(`addRemoteOriginDialog.addFailed`))}c(!1)};return(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{e||d()},children:(0,H.jsxs)(w.Content,{size:`md`,children:[(0,H.jsxs)(w.Header,{icon:f,children:[(0,H.jsx)(w.Title,{children:i(`addRemoteOriginDialog.title`)}),(0,H.jsx)(w.Description,{children:i(`addRemoteOriginDialog.body`)})]}),(0,H.jsx)(w.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`add-remote-origin-url`,children:i(`addRemoteOriginDialog.addressLabel`)}),(0,H.jsx)(P,{id:`add-remote-origin-url`,type:`url`,value:a,onChange:e=>o(e.target.value),placeholder:`https://example.com/assistant-1`,fullWidth:!0,autoFocus:!0})]}),l&&(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:l})]})}),(0,H.jsxs)(w.Footer,{children:[(0,H.jsx)(j,{variant:`ghost`,onClick:d,disabled:s,children:i(`actions.cancel`)}),(0,H.jsx)(j,{variant:`primary`,onClick:()=>void p(),disabled:!a.trim()||s,children:i(s?`actions.adding`:`actions.add`)})]})]})})}var U=e=>new Promise(t=>setTimeout(t,e)),W=30,ze=e=>{let t=Date.parse(e);return Number.isFinite(t)&&Date.now()>=t};function Be({open:e,initialAddress:t,guidanceKind:r,onClose:i,onImported:a}){let{t:o}=n(`onboarding`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(!1),[m,h]=(0,V.useState)(null),[g,_]=(0,V.useState)(null),[y,b]=(0,V.useState)(0),[x,S]=(0,V.useState)(!1),[C,ee]=(0,V.useState)(null),T=(0,V.useRef)(null),te=(0,V.useRef)({abandoned:!1}),ne=()=>{let e=T.current;T.current=null,e&&I(e)};(0,V.useEffect)(()=>{if(!e)return;l(t??``),d(``),p(!1),h(null),_(null),S(!1),ee(null);let n={abandoned:!1};return te.current=n,()=>{n.abandoned=!0,ne()}},[e,t]),(0,V.useEffect)(()=>{if(!g)return;let e=setInterval(()=>b(Date.parse(g.expiresAt)-Date.now()),1e3);return()=>clearInterval(e)},[g]);let re=async()=>{let e=c.trim();if(!e||f)return;p(!0),h(null);let t=u.trim()||void 0,n=te.current;try{let r=await v(e);if(n.abandoned){r.ok&&I(r.handle);return}if(!r.ok){h(r.rejection?{kind:`rejected-address`,rejection:r.rejection,address:e}:{kind:`message`,text:r.error}),p(!1);return}T.current=r.handle,r.userCode&&(_({userCode:r.userCode,expiresAt:r.expiresAt}),b(Date.parse(r.expiresAt)-Date.now()));let i=r.userCode!==null,s=r.expiresAt,c=r.intervalSeconds,l=0;for(;;){let e=await he(r.handle,t);if(n.abandoned)return;if(!e.ok){let t=i&&N(e);if(t&&!ze(s)){if(l+=1,l===1&&S(!0),await U(Math.min(c*l,W)*1e3),n.abandoned)return;continue}ne(),_(null),S(!1),h({kind:`message`,text:t?o(`connectAssistantDialog.retryExpired`):e.error});break}if(l>0&&(l=0,S(!1)),e.status===`imported`){if(T.current=null,e.accessOnly){_(null),ee(e.assistantId);break}a(e.assistantId);return}if(e.expiresAt!==s&&(_(t=>t&&{...t,expiresAt:e.expiresAt}),b(Date.parse(e.expiresAt)-Date.now())),s=e.expiresAt,c=e.intervalSeconds,await U(c*1e3),n.abandoned)return}}catch(e){console.error(`connectAssistantDialog.pairing failed`,e),ne(),_(null),S(!1),h({kind:`message`,text:o(`connectAssistantDialog.submitError`)})}p(!1)};return C==null?(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,H.jsxs)(w.Content,{size:`md`,children:[(0,H.jsxs)(w.Header,{icon:s,children:[(0,H.jsx)(w.Title,{children:o(`connectAssistantDialog.title`)}),(0,H.jsx)(w.Description,{children:o(`connectAssistantDialog.instruction`)})]}),(0,H.jsx)(w.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[r&&(0,H.jsx)(_e,{tone:`info`,children:o(r===`legacy`?`connectAssistantDialog.legacyLinkGuidance`:`connectAssistantDialog.linkGuidance`)}),g?(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-3 py-2 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`,children:g.userCode}),(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:o(`connectAssistantDialog.approveOnHost`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,H.jsx)(`span`,{className:x?`text-[color:var(--system-warning-strong)]`:void 0,children:o(x?`connectAssistantDialog.retrying`:`connectAssistantDialog.waitingForApproval`)}),(0,H.jsx)(`span`,{children:o(`connectAssistantDialog.expiresIn`,{time:Me(y)})})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-address`,children:o(`connectAssistantDialog.addressLabel`)}),(0,H.jsx)(P,{id:`connect-assistant-address`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:o(`connectAssistantDialog.addressPlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-name`,children:o(`connectAssistantDialog.nameLabel`)}),(0,H.jsx)(P,{id:`connect-assistant-name`,type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`office-mac`,fullWidth:!0})]})]}),m&&(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:m.kind===`rejected-address`?E(m.rejection,m.address):m.text})]})}),(0,H.jsxs)(w.Footer,{children:[(0,H.jsx)(j,{variant:`ghost`,onClick:i,children:o(`actions.cancel`)}),!g&&(0,H.jsx)(j,{variant:`primary`,onClick:()=>void re(),disabled:!c.trim()||f,children:o(f?`actions.connecting`:`actions.connect`)})]})]})}):(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,H.jsxs)(w.Content,{size:`sm`,children:[(0,H.jsx)(w.Header,{icon:s,children:(0,H.jsx)(w.Title,{children:o(`connectAssistantDialog.importedTitle`)})}),(0,H.jsx)(w.Body,{children:(0,H.jsx)(_e,{tone:`warning`,children:o(`connectAssistantDialog.importedBody`)})}),(0,H.jsx)(w.Footer,{children:(0,H.jsx)(j,{variant:`primary`,onClick:()=>a(C),children:o(`actions.continue`)})})]})})}function Ve({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:o,onRetire:s}){let{t:c}=n(`onboarding`),[l,u]=(0,V.useState)(`menu`);(0,V.useEffect)(()=>{e&&u(`menu`)},[e]);let d=i?(0,H.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return l===`confirm-repair`?(0,H.jsx)(x,{open:e,title:c(`connectRecoveryDialog.repairTitle`),message:(0,H.jsxs)(H.Fragment,{children:[c(`connectRecoveryDialog.repairBody`),d]}),confirmLabel:c(`connectRecoveryDialog.repairConfirm`),isPending:r,onConfirm:o,onCancel:()=>u(`menu`)}):l===`confirm-retire`?(0,H.jsx)(M,{open:e,isPending:r,extraMessage:d,onConfirm:s,onCancel:()=>u(`menu`)}):(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,H.jsxs)(w.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,H.jsx)(w.Header,{children:(0,H.jsx)(w.Title,{children:c(`connectRecoveryDialog.authFailedTitle`)})}),(0,H.jsxs)(w.Body,{children:[(0,H.jsx)(w.Description,{children:c(`connectRecoveryDialog.authFailedBody`,{name:t})}),d,(0,H.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,H.jsx)(j,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>u(`confirm-repair`),children:c(`connectRecoveryDialog.wakeAndRepair`)}),(0,H.jsx)(j,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>u(`confirm-retire`),children:c(`connectRecoveryDialog.retire`)}),(0,H.jsx)(j,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:c(`actions.cancel`)})]})]})]})})}function He(e){return e.name?e.name:e.isPaired?`Paired Assistant`:e.isLocal&&e.cloud===`local`?e.id:e.isLocal?`Local Assistant`:`Cloud Assistant`}function G(e,t){if(e)try{return t(`selectAssistantScreen.selfHostedWithHost`,{host:new URL(e).hostname})}catch{}return t(`selectAssistantScreen.selfHosted`)}function K(e,t){let n=e.isPaired?y(e.runtimeUrl):e.isLocal?pe()?`On this computer`:G(e.ingressUrl,t):`Cloud-hosted`;return e.hatchedAt?`${n} · Created ${de(e.hatchedAt)}`:n}function Ue(e){return new URL(e.url).hostname}function We(e){return e.name??Ue(e)}function Ge(e){return`origin:${e.url}`}var q=`origin:vellum-cloud`;function Ke(e){let t=new URLSearchParams(e);return t.delete(`register`),t.delete(`name`),t}function J(){let{t:e}=n(`onboarding`),a=i(),o=t(),[l,u]=r(),p=l.get(`fromLogin`)===`1`,h=l.get(`noAutoSkip`)===`1`,v=ae(),y=pe(),x=xe(),S=m.use.assistants(),C=Ce.use.currentOrganizationId(),w=z.use.origins(),ie=z.use.hydrated(),E=ue(),{loading:D,error:O,login:ce,cancel:de}=ne(),[A,he]=(0,V.useState)(null),M=A===null?null:{url:A,name:`Vellum Cloud`},ge=M!==null,_e=e=>e.isPaired||e.isLocal&&y||x,N=S.filter(te),P=N.filter(_e),ye=P.length>0||w.length>0||M!==null,I=b(),we=!x&&I,[L,R]=(0,V.useState)(null),[B,Me]=(0,V.useState)(!1),[Ne,Ie]=(0,V.useState)(!1),[Le,U]=(0,V.useState)(null),[W,ze]=(0,V.useState)(null),[G,K]=(0,V.useState)(!1),[Ue,J]=(0,V.useState)(null),[Y,X]=(0,V.useState)(null),[Ze,Qe]=(0,V.useState)(!1),[$e,Z]=(0,V.useState)(null),[et,tt]=(0,V.useState)(!1),[Q,nt]=(0,V.useState)(null),[rt,it]=(0,V.useState)(!1),[at,ot]=(0,V.useState)(null),st=F.use.open(),ct=F.use.initialAddress(),lt=F.use.guidanceKind(),ut=F.use.deepLinkDrainSettled(),dt=(0,V.useRef)(!1);(0,V.useEffect)(()=>{me()},[]),(0,V.useEffect)(()=>{je(),z.getState().hydrate()},[]),(0,V.useEffect)(()=>{if(!E)return;let e=!1;return ke().then(t=>{e||he(t)}),()=>{e=!0}},[E]);let ft=(0,V.useRef)(!1);(0,V.useEffect)(()=>{if(ft.current)return;ft.current=!0;let e=l.get(`register`);if(e===null)return;let t=()=>u(Ke,{replace:!0}),n=Oe(e);if(n===null){t();return}z.getState().addOrigin({url:n,name:l.get(`name`)??void 0}).then(e=>{e.ok?t():ft.current=!1}).catch(()=>{ft.current=!1})},[l,u]),(0,V.useEffect)(()=>{if(L===q&&ge||L!=null&&w.some(e=>Ge(e)===L))return;if(P.length===0){let e=w[0],t=e?Ge(e):ge?q:null;L!==t&&R(t);return}if(L!=null&&P.some(e=>e.id===L))return;let e=oe(C);R(P.find(t=>t.id===e)?.id??P[0].id)},[L,P,C,w,ge]);let $=async e=>{Me(!0),U(null);try{await be(e),a(k.assistant,{replace:!0})}catch(t){console.error(`selectAssistant.handleConnect failed`,t),e.isLocal&&b()&&(_(t)||Ee(t)||t instanceof fe)&&Se(e.id)?ze(e):e.isPaired&&_(t)?U(`This pairing has expired. Run vellum pair on the assistant's machine and import it again with vellum connect import.`):U(`Failed to connect. Please try again.`),Me(!1)}},pt=()=>{ze(null),K(!1),J(null),Ie(!1)},mt=async()=>{if(!(!W||G)){K(!0),J(null);try{let e=await T(W.id,{repairGuardian:!0});if(e.ok){ee(),pt(),$(W);return}J(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),J(`Repair failed. Please try again.`)}K(!1)}},ht=async()=>{if(!(!W||G)){K(!0),J(null);try{let e=await le(o,W.id);if(e.ok){pt(),a(e.nextRoute,{replace:!0});return}J(e.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),J(`Failed to retire assistant. Please try again.`)}K(!1)}},gt=()=>{Ze||(X(null),Z(null))},_t=async()=>{if(!(!Y||Ze)){if(Qe(!0),Z(null),Y.isPaired){let e=await ve(o,Y.id);e.ok?(dt.current=!0,X(null)):Z(e.error),Qe(!1);return}try{let e=await Te(Y.id);if(e.ok){let e=m.getState();e.activeAssistantId===Y.id&&e.setActiveAssistantId(null),g(o,Y.id),dt.current=!0,X(null)}else Z(e.error??`Failed to remove. Please try again.`)}catch(e){console.error(`selectAssistant.removeFromDevice failed`,e),Z(`Failed to remove. Please try again.`)}Qe(!1)}},vt=()=>{rt||(nt(null),ot(null))},yt=async()=>{!Q||rt||(it(!0),ot(null),await z.getState().removeOrigin(Q.url),z.getState().origins.some(e=>e.url===Q.url)?ot(`Failed to remove. Please try again.`):(dt.current=!0,nt(null)),it(!1))},bt=e=>{F.getState().closeConnectDialog(),$(m.getState().assistants.find(t=>t.id===e)??{id:e,isLocal:!1,isPlatformHosted:!1,isPaired:!0})},xt=(e,t)=>{tt(!1),Pe(e,t??void 0)};(0,V.useEffect)(()=>{p||h||dt.current||y&&ie&&(w.length>0||v&&!ut||B||Ne||st||N.length!==0&&N.length===1&&P.length===1&&(Ie(!0),$(P[0])))},[N.length,P.length,ut,y,w.length,ie]);let St=()=>{if(L===q){Ae(null).then(e=>{!e&&A!==null&&window.location.assign(A)});return}let e=w.find(e=>Ge(e)===L);if(e){Fe(e)?a(k.assistant,{replace:!0}):Pe(e);return}let t=N.find(e=>e.id===L);t&&$(t)},Ct=()=>{a(y?k.welcome:k.assistant)},wt=O??Le;return Ne&&!wt&&!W?(0,H.jsx)(qe,{}):(0,H.jsxs)(re,{avatarWave:`beside`,children:[(0,H.jsx)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${v?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-6 md:min-h-full md:pb-6`} text-[var(--content-default)]`,children:(0,H.jsxs)(`div`,{className:`flex w-full flex-col items-center ${v?``:`flex-1 justify-center`}`,children:[(0,H.jsx)(`h1`,{className:`text-center text-5xl font-normal tracking-tight md:text-4xl lg:text-5xl`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`selectAssistantScreen.title`)}),wt&&(0,H.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:wt}),(0,H.jsxs)(`div`,{role:`radiogroup`,"aria-label":e(`selectAssistantScreen.listAriaLabel`),onKeyDown:De,className:`flex w-full flex-col ${v?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:[N.map(t=>{let n=_e(t);return(0,H.jsx)(Ye,{assistant:t,selected:L===t.id,locked:!n,tabStop:L==null?P[0]?.id===t.id:L===t.id,onSelect:()=>{n&&R(t.id)},loginLabel:e(D?`actions.cancel`:`actions.loginToUse`),loginDisabled:B,onLogin:!n&&(t.isPlatformHosted||t.isLocal)?D?de:()=>void ce():void 0,onRemove:t.isPlatformHosted&&we||t.isPaired&&I?()=>X(t):void 0},t.id)}),w.map((e,t)=>{let n=Ge(e),r=Fe(e);return(0,H.jsx)(Xe,{origin:e,selected:L===n,current:r,tabStop:L==null?P.length===0&&t===0:L===n,onSelect:()=>R(n),onRemove:r&&E?void 0:()=>nt(e)},e.url)}),M&&(0,H.jsx)(Xe,{origin:M,icon:(0,H.jsx)(d,{className:`h-5 w-5`}),selected:L===q,current:!1,tabStop:L==null?P.length===0&&w.length===0:L===q,onSelect:()=>R(q)}),y&&(0,H.jsx)(Je,{icon:(0,H.jsx)(c,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.createNew`),disabled:B||D,onClick:()=>void a(`${k.onboarding.hosting}?from=select-assistant`)}),I&&(0,H.jsx)(Je,{icon:(0,H.jsx)(s,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.connectRemote`),disabled:B||D,onClick:()=>F.getState().openConnectDialog()}),!I&&(0,H.jsx)(Je,{icon:(0,H.jsx)(f,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.addRemote`),disabled:B||D,onClick:()=>tt(!0)})]}),ye&&(0,H.jsx)(`div`,{className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:(0,H.jsx)(j,{variant:`primary`,size:`regular`,fullWidth:!0,className:v?void 0:`h-11 text-base`,onClick:St,disabled:!L||B,children:e(B?`actions.connecting`:`actions.continue`)})}),(0,H.jsx)(`div`,{className:ye?`mt-3`:`mt-8`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,H.jsx)(j,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,onClick:Ct,disabled:B||D,children:e(`actions.back`)})})]})}),(0,H.jsx)(Re,{open:et,onClose:()=>tt(!1),onAdded:xt}),(0,H.jsx)(Be,{open:st,initialAddress:ct??void 0,guidanceKind:lt??void 0,onClose:()=>F.getState().closeConnectDialog(),onImported:bt}),(0,H.jsx)(Ve,{open:W!=null,assistantName:W?He(W):``,isPending:G,errorMessage:Ue??void 0,onCancel:pt,onRepair:()=>void mt(),onRetire:()=>void ht()}),(0,H.jsx)(se,{open:Y!=null,kind:Y?.isPaired?`paired`:`platform`,assistantName:Y?He(Y):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:$e??void 0,isPending:Ze,onConfirm:()=>void _t(),onCancel:gt}),(0,H.jsx)(se,{open:Q!=null,kind:`origin`,assistantName:Q?We(Q):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:at??void 0,isPending:rt,onConfirm:()=>void yt(),onCancel:vt})]})}function qe(){let{t:e}=n(`onboarding`);return(0,H.jsx)(re,{avatarWave:`beside`,children:(0,H.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,H.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`selectAssistantScreen.connectingToAssistant`)})})})}function Je({icon:e,label:t,disabled:n,onClick:r}){let i=ae();return(0,H.jsxs)(`button`,{type:`button`,onClick:r,disabled:n,className:[`group flex w-full items-center justify-center gap-2 border border-dashed border-[var(--border-element)]/50 text-[var(--content-tertiary)]`,i?`rounded-lg px-3 py-2.5`:`rounded-xl px-5 py-3`,`cursor-pointer transition-all duration-200 ease-out`,`hover:border-[var(--border-element)] hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),children:[e,(0,H.jsx)(`span`,{className:i?`text-body-small-default`:`text-body-medium-default`,children:t})]})}function Y({label:e,onRemove:t}){let{t:r}=n(`onboarding`);return(0,H.jsxs)(O.Root,{children:[(0,H.jsx)(O.Trigger,{asChild:!0,children:(0,H.jsx)(j,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,iconOnly:(0,H.jsx)(p,{}),"aria-label":r(`selectAssistantScreen.rowActionsAriaLabel`,{name:e})})}),(0,H.jsx)(O.Content,{align:`end`,sideOffset:4,children:(0,H.jsx)(O.Item,{onSelect:t,className:R.anchored,children:r(`selectAssistantScreen.removeFromDevice`)})})]})}function X({icon:e,title:t,subtitle:n,selected:r,locked:i=!1,tabStop:a,onSelect:o,action:s,removeMenu:c}){let u=ae();return(0,H.jsxs)(`div`,{role:i?void 0:`radio`,"aria-checked":i?void 0:r,tabIndex:i?void 0:a?0:-1,onClick:i?void 0:o,onKeyDown:i?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:[`group flex w-full items-center border text-left`,u?`gap-3 rounded-lg px-[10px] py-3`:`gap-4 rounded-2xl px-[18px] py-4`,`transition-all duration-200 ease-out`,i?`border-[var(--border-base)] bg-[var(--surface-overlay)]`:`cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--primary-base)]`,i?``:r?`border-[var(--primary-base)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-lift)]/60 hover:border-[var(--border-element)] hover:bg-[var(--surface-lift)]`].join(` `),children:[(0,H.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,`h-12 w-12 rounded-[10px]`,r&&!i?`bg-[var(--primary-base)] text-[var(--surface-base)]`:`bg-[var(--surface-active)]/40 text-[var(--content-secondary)]`].join(` `),children:e}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t}),(0,H.jsx)(`span`,{className:`mt-1 block text-[var(--content-tertiary)] ${u?`text-label-medium-default font-normal`:`text-body-small-lighter`}`,children:n})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s,c&&(i?c:(0,H.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:c})),!i&&(0,H.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:r&&(0,H.jsx)(l,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})]})}function Ye({assistant:e,selected:t,locked:r,tabStop:i,onSelect:a,loginLabel:o,loginDisabled:c,onLogin:l,onRemove:f}){let{t:p}=n(`onboarding`),m=He(e),{traits:h,imageUrl:g,onImageError:_}=ge(e);return(0,H.jsx)(X,{icon:(0,H.jsx)(Ie,{traits:h,imageUrl:g,fallback:e.isPaired?(0,H.jsx)(s,{className:`h-5 w-5`}):e.isLocal?(0,H.jsx)(u,{className:`h-5 w-5`}):(0,H.jsx)(d,{className:`h-5 w-5`}),decorative:!0,onImageError:_}),title:m,subtitle:K(e,p),selected:t,locked:r,tabStop:i,onSelect:a,action:r&&l?(0,H.jsx)(j,{variant:`primary`,size:`regular`,onClick:l,disabled:c,children:o}):void 0,removeMenu:f&&(0,H.jsx)(Y,{label:m,onRemove:f})})}function Xe({origin:e,icon:t,selected:r,current:i,tabStop:a,onSelect:o,onRemove:s}){let{t:c}=n(`onboarding`),l=We(e);return(0,H.jsx)(X,{icon:t??(0,H.jsx)(f,{className:`h-5 w-5`}),title:l,subtitle:c(i?`selectAssistantScreen.currentWithHost`:`selectAssistantScreen.remoteWithHost`,{host:Ue(e)}),selected:r,tabStop:a,onSelect:o,removeMenu:s&&(0,H.jsx)(Y,{label:l,onRemove:s})})}export{J as SelectAssistantScreen};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{er as t,j as n}from"./vendor-yoekmcrB.js";import{_ as r,f as i,t as a,x as o}from"./react-BJ4PZBJN.js";import{$n as s,It as c,Ki as l,ar as u,hi as d,xr as f}from"./icons-BjnVKAw1.js";import{t as p}from"./ellipsis-vertical-DqnIbNNJ.js";import{$_ as m,Am as h,Ao as g,Av as _,Cv as v,Cy as y,Dv as b,Gy as x,Hv as S,In as C,Jy as w,Lv as ee,Nv as T,Q_ as te,Ro as ne,Rr as re,Sp as ie,Uv as E,Vr as D,Vy as O,Xv as ae,Yv as k,_m as oe,aa as se,by as ce,ca as le,cm as ue,d as de,em as A,ev as fe,fb as j,fv as pe,gu as me,gv as he,ia as M,jo as ge,lb as _e,mv as N,nb as P,oa as ve,pv as ye,ru as F,sa as be,tv as I,up as xe,uv as Se,xm as Ce,xy as we,yv as Te,yy as L,zv as Ee,zy as R}from"./index-BGc71lz7.js";import{t as De}from"./radio-card-nav-BsBWpdyn.js";import{a as Oe,i as ke,n as Ae,o as z,r as B,t as je}from"./self-hosted-servers-DEAKDkLi.js";import{t as Me}from"./format-countdown-Ck7dI0Xw.js";var V=e(o(),1),Ne=k.remotePair.slice(`${k.assistant}/`.length);async function Pe(e,t){let n=t?S(e.url,t):null,r=t&&n!==null?`${Ne}?${new URLSearchParams({device_code:t}).toString()}`:null,i=()=>window.location.assign(n??`${e.url}${k.assistant}`);if(!A()){i();return}(r===null?await Ae(e.url):await B(e.url,r))||i()}function Fe(e){return Oe(ye()?h():window.location.origin)===e.url}var H=a();function Ie({traits:e,imageUrl:t,size:r=48,fallback:i,className:a,decorative:o=!1,onImageError:s}){let{t:c}=n(),l=D();if(e){if(!l)return i;if(ie(l,e.bodyShape,e.eyeStyle,e.color)){let t=(0,H.jsx)(C,{components:l,bodyShapeId:e.bodyShape,eyeStyleId:e.eyeStyle,colorId:e.color,size:r,className:a});return o?(0,H.jsx)(`span`,{"aria-hidden":`true`,children:t}):t}}return t?(0,H.jsx)(`img`,{src:t,alt:o?``:c(`chooserAvatarChip.alt`),width:r,height:r,className:`rounded-full object-cover ${a??``}`.trim(),style:{width:r,height:r,flexShrink:0},onError:s}):i}function Le(e){let t;try{t=ce(e)}catch{return{ok:!1,reason:`unparseable`}}if(L(t))return{ok:!1,reason:`service-website`};let n=Oe(t);return n===null?{ok:!1,reason:`non-https`}:{ok:!0,url:n,deviceCode:we(e).deviceCode}}function Re({open:e,onClose:t,onAdded:r}){let{t:i}=n(`onboarding`),[a,o]=(0,V.useState)(``),[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(null);(0,V.useEffect)(()=>{e&&(o(``),c(!1),u(null))},[e]);let d=()=>{s||t()},p=async()=>{if(!a.trim()||s)return;let e=Le(a);if(!e.ok){u(E(e.reason,a));return}c(!0),u(null);try{let t=await z.getState().addOrigin({url:e.url});if(t.ok){r(t.origin,e.deviceCode);return}u(i(`addRemoteOriginDialog.addFailed`))}catch(e){console.error(`addRemoteOriginDialog.add failed`,e),u(i(`addRemoteOriginDialog.addFailed`))}c(!1)};return(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{e||d()},children:(0,H.jsxs)(w.Content,{size:`md`,children:[(0,H.jsxs)(w.Header,{icon:f,children:[(0,H.jsx)(w.Title,{children:i(`addRemoteOriginDialog.title`)}),(0,H.jsx)(w.Description,{children:i(`addRemoteOriginDialog.body`)})]}),(0,H.jsx)(w.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`add-remote-origin-url`,children:i(`addRemoteOriginDialog.addressLabel`)}),(0,H.jsx)(P,{id:`add-remote-origin-url`,type:`url`,value:a,onChange:e=>o(e.target.value),placeholder:`https://example.com/assistant-1`,fullWidth:!0,autoFocus:!0})]}),l&&(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:l})]})}),(0,H.jsxs)(w.Footer,{children:[(0,H.jsx)(j,{variant:`ghost`,onClick:d,disabled:s,children:i(`actions.cancel`)}),(0,H.jsx)(j,{variant:`primary`,onClick:()=>void p(),disabled:!a.trim()||s,children:i(s?`actions.adding`:`actions.add`)})]})]})})}var U=e=>new Promise(t=>setTimeout(t,e)),W=30,ze=e=>{let t=Date.parse(e);return Number.isFinite(t)&&Date.now()>=t};function Be({open:e,initialAddress:t,guidanceKind:r,onClose:i,onImported:a}){let{t:o}=n(`onboarding`),[c,l]=(0,V.useState)(``),[u,d]=(0,V.useState)(``),[f,p]=(0,V.useState)(!1),[m,h]=(0,V.useState)(null),[g,_]=(0,V.useState)(null),[y,b]=(0,V.useState)(0),[x,S]=(0,V.useState)(!1),[C,ee]=(0,V.useState)(null),T=(0,V.useRef)(null),te=(0,V.useRef)({abandoned:!1}),ne=()=>{let e=T.current;T.current=null,e&&I(e)};(0,V.useEffect)(()=>{if(!e)return;l(t??``),d(``),p(!1),h(null),_(null),S(!1),ee(null);let n={abandoned:!1};return te.current=n,()=>{n.abandoned=!0,ne()}},[e,t]),(0,V.useEffect)(()=>{if(!g)return;let e=setInterval(()=>b(Date.parse(g.expiresAt)-Date.now()),1e3);return()=>clearInterval(e)},[g]);let re=async()=>{let e=c.trim();if(!e||f)return;p(!0),h(null);let t=u.trim()||void 0,n=te.current;try{let r=await v(e);if(n.abandoned){r.ok&&I(r.handle);return}if(!r.ok){h(r.rejection?{kind:`rejected-address`,rejection:r.rejection,address:e}:{kind:`message`,text:r.error}),p(!1);return}T.current=r.handle,r.userCode&&(_({userCode:r.userCode,expiresAt:r.expiresAt}),b(Date.parse(r.expiresAt)-Date.now()));let i=r.userCode!==null,s=r.expiresAt,c=r.intervalSeconds,l=0;for(;;){let e=await he(r.handle,t);if(n.abandoned)return;if(!e.ok){let t=i&&N(e);if(t&&!ze(s)){if(l+=1,l===1&&S(!0),await U(Math.min(c*l,W)*1e3),n.abandoned)return;continue}ne(),_(null),S(!1),h({kind:`message`,text:t?o(`connectAssistantDialog.retryExpired`):e.error});break}if(l>0&&(l=0,S(!1)),e.status===`imported`){if(T.current=null,e.accessOnly){_(null),ee(e.assistantId);break}a(e.assistantId);return}if(e.expiresAt!==s&&(_(t=>t&&{...t,expiresAt:e.expiresAt}),b(Date.parse(e.expiresAt)-Date.now())),s=e.expiresAt,c=e.intervalSeconds,await U(c*1e3),n.abandoned)return}}catch(e){console.error(`connectAssistantDialog.pairing failed`,e),ne(),_(null),S(!1),h({kind:`message`,text:o(`connectAssistantDialog.submitError`)})}p(!1)};return C==null?(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,H.jsxs)(w.Content,{size:`md`,children:[(0,H.jsxs)(w.Header,{icon:s,children:[(0,H.jsx)(w.Title,{children:o(`connectAssistantDialog.title`)}),(0,H.jsx)(w.Description,{children:o(`connectAssistantDialog.instruction`)})]}),(0,H.jsx)(w.Body,{children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[r&&(0,H.jsx)(_e,{tone:`info`,children:o(r===`legacy`?`connectAssistantDialog.legacyLinkGuidance`:`connectAssistantDialog.linkGuidance`)}),g?(0,H.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,H.jsx)(`code`,{className:`w-fit rounded-md bg-[var(--surface-active)] px-3 py-2 text-title-medium tracking-wide text-[color:var(--content-emphasised)]`,children:g.userCode}),(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--content-secondary)]`,children:o(`connectAssistantDialog.approveOnHost`)}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,H.jsx)(`span`,{className:x?`text-[color:var(--system-warning-strong)]`:void 0,children:o(x?`connectAssistantDialog.retrying`:`connectAssistantDialog.waitingForApproval`)}),(0,H.jsx)(`span`,{children:o(`connectAssistantDialog.expiresIn`,{time:Me(y)})})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-address`,children:o(`connectAssistantDialog.addressLabel`)}),(0,H.jsx)(P,{id:`connect-assistant-address`,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:o(`connectAssistantDialog.addressPlaceholder`),fullWidth:!0,autoFocus:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,H.jsx)(`label`,{className:`text-body-small-default text-[var(--content-secondary)]`,htmlFor:`connect-assistant-name`,children:o(`connectAssistantDialog.nameLabel`)}),(0,H.jsx)(P,{id:`connect-assistant-name`,type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`office-mac`,fullWidth:!0})]})]}),m&&(0,H.jsx)(`p`,{className:`text-body-small-default text-[var(--system-negative-strong)]`,children:m.kind===`rejected-address`?E(m.rejection,m.address):m.text})]})}),(0,H.jsxs)(w.Footer,{children:[(0,H.jsx)(j,{variant:`ghost`,onClick:i,children:o(`actions.cancel`)}),!g&&(0,H.jsx)(j,{variant:`primary`,onClick:()=>void re(),disabled:!c.trim()||f,children:o(f?`actions.connecting`:`actions.connect`)})]})]})}):(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{e||i()},children:(0,H.jsxs)(w.Content,{size:`sm`,children:[(0,H.jsx)(w.Header,{icon:s,children:(0,H.jsx)(w.Title,{children:o(`connectAssistantDialog.importedTitle`)})}),(0,H.jsx)(w.Body,{children:(0,H.jsx)(_e,{tone:`warning`,children:o(`connectAssistantDialog.importedBody`)})}),(0,H.jsx)(w.Footer,{children:(0,H.jsx)(j,{variant:`primary`,onClick:()=>a(C),children:o(`actions.continue`)})})]})})}function Ve({open:e,assistantName:t,isPending:r,errorMessage:i,onCancel:a,onRepair:o,onRetire:s}){let{t:c}=n(`onboarding`),[l,u]=(0,V.useState)(`menu`);(0,V.useEffect)(()=>{e&&u(`menu`)},[e]);let d=i?(0,H.jsx)(`span`,{className:`mt-3 block text-body-small-default text-[var(--system-negative-strong)]`,children:i}):null;return l===`confirm-repair`?(0,H.jsx)(x,{open:e,title:c(`connectRecoveryDialog.repairTitle`),message:(0,H.jsxs)(H.Fragment,{children:[c(`connectRecoveryDialog.repairBody`),d]}),confirmLabel:c(`connectRecoveryDialog.repairConfirm`),isPending:r,onConfirm:o,onCancel:()=>u(`menu`)}):l===`confirm-retire`?(0,H.jsx)(M,{open:e,isPending:r,extraMessage:d,onConfirm:s,onCancel:()=>u(`menu`)}):(0,H.jsx)(w.Root,{open:e,onOpenChange:e=>{!e&&!r&&a()},children:(0,H.jsxs)(w.Content,{size:`sm`,hideCloseButton:!0,onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),r||a()},children:[(0,H.jsx)(w.Header,{children:(0,H.jsx)(w.Title,{children:c(`connectRecoveryDialog.authFailedTitle`)})}),(0,H.jsxs)(w.Body,{children:[(0,H.jsx)(w.Description,{children:c(`connectRecoveryDialog.authFailedBody`,{name:t})}),d,(0,H.jsxs)(`div`,{className:`mt-5 flex w-full flex-col gap-2`,children:[(0,H.jsx)(j,{variant:`primary`,fullWidth:!0,disabled:r,onClick:()=>u(`confirm-repair`),children:c(`connectRecoveryDialog.wakeAndRepair`)}),(0,H.jsx)(j,{variant:`dangerOutline`,fullWidth:!0,disabled:r,onClick:()=>u(`confirm-retire`),children:c(`connectRecoveryDialog.retire`)}),(0,H.jsx)(j,{variant:`outlined`,fullWidth:!0,disabled:r,onClick:a,children:c(`actions.cancel`)})]})]})]})})}function He(e){return e.name?e.name:e.isPaired?`Paired Assistant`:e.isLocal&&e.cloud===`local`?e.id:e.isLocal?`Local Assistant`:`Cloud Assistant`}function G(e,t){if(e)try{return t(`selectAssistantScreen.selfHostedWithHost`,{host:new URL(e).hostname})}catch{}return t(`selectAssistantScreen.selfHosted`)}function K(e,t){let n=e.isPaired?y(e.runtimeUrl):e.isLocal?pe()?`On this computer`:G(e.ingressUrl,t):`Cloud-hosted`;return e.hatchedAt?`${n} · Created ${de(e.hatchedAt)}`:n}function Ue(e){return new URL(e.url).hostname}function We(e){return e.name??Ue(e)}function Ge(e){return`origin:${e.url}`}var q=`origin:vellum-cloud`;function Ke(e){let t=new URLSearchParams(e);return t.delete(`register`),t.delete(`name`),t}function J(){let{t:e}=n(`onboarding`),a=i(),o=t(),[l,u]=r(),p=l.get(`fromLogin`)===`1`,h=l.get(`noAutoSkip`)===`1`,v=ae(),y=pe(),x=xe(),S=m.use.assistants(),C=Ce.use.currentOrganizationId(),w=z.use.origins(),ie=z.use.hydrated(),E=ue(),{loading:D,error:O,login:ce,cancel:de}=ne(),[A,he]=(0,V.useState)(null),M=A===null?null:{url:A,name:`Vellum Cloud`},ge=M!==null,_e=e=>e.isPaired||e.isLocal&&y||x,N=S.filter(te),P=N.filter(_e),ye=P.length>0||w.length>0||M!==null,I=b(),we=!x&&I,[L,R]=(0,V.useState)(null),[B,Me]=(0,V.useState)(!1),[Ne,Ie]=(0,V.useState)(!1),[Le,U]=(0,V.useState)(null),[W,ze]=(0,V.useState)(null),[G,K]=(0,V.useState)(!1),[Ue,J]=(0,V.useState)(null),[Y,X]=(0,V.useState)(null),[Ze,Qe]=(0,V.useState)(!1),[$e,Z]=(0,V.useState)(null),[et,tt]=(0,V.useState)(!1),[Q,nt]=(0,V.useState)(null),[rt,it]=(0,V.useState)(!1),[at,ot]=(0,V.useState)(null),st=F.use.open(),ct=F.use.initialAddress(),lt=F.use.guidanceKind(),ut=F.use.deepLinkDrainSettled(),dt=(0,V.useRef)(!1);(0,V.useEffect)(()=>{me()},[]),(0,V.useEffect)(()=>{je(),z.getState().hydrate()},[]),(0,V.useEffect)(()=>{if(!E)return;let e=!1;return ke().then(t=>{e||he(t)}),()=>{e=!0}},[E]);let ft=(0,V.useRef)(!1);(0,V.useEffect)(()=>{if(ft.current)return;ft.current=!0;let e=l.get(`register`);if(e===null)return;let t=()=>u(Ke,{replace:!0}),n=Oe(e);if(n===null){t();return}z.getState().addOrigin({url:n,name:l.get(`name`)??void 0}).then(e=>{e.ok?t():ft.current=!1}).catch(()=>{ft.current=!1})},[l,u]),(0,V.useEffect)(()=>{if(L===q&&ge||L!=null&&w.some(e=>Ge(e)===L))return;if(P.length===0){let e=w[0],t=e?Ge(e):ge?q:null;L!==t&&R(t);return}if(L!=null&&P.some(e=>e.id===L))return;let e=oe(C);R(P.find(t=>t.id===e)?.id??P[0].id)},[L,P,C,w,ge]);let $=async e=>{Me(!0),U(null);try{await be(e),a(k.assistant,{replace:!0})}catch(t){console.error(`selectAssistant.handleConnect failed`,t),e.isLocal&&b()&&(_(t)||Ee(t)||t instanceof fe)&&Se(e.id)?ze(e):e.isPaired&&_(t)?U(`This pairing has expired. Run vellum pair on the assistant's machine and import it again with vellum connect import.`):U(`Failed to connect. Please try again.`),Me(!1)}},pt=()=>{ze(null),K(!1),J(null),Ie(!1)},mt=async()=>{if(!(!W||G)){K(!0),J(null);try{let e=await T(W.id,{repairGuardian:!0});if(e.ok){ee(),pt(),$(W);return}J(e.error||`Repair failed. Please try again.`)}catch(e){console.error(`selectAssistant.recoveryRepair failed`,e),J(`Repair failed. Please try again.`)}K(!1)}},ht=async()=>{if(!(!W||G)){K(!0),J(null);try{let e=await le(o,W.id);if(e.ok){pt(),a(e.nextRoute,{replace:!0});return}J(e.error)}catch(e){console.error(`selectAssistant.recoveryRetire failed`,e),J(`Failed to retire assistant. Please try again.`)}K(!1)}},gt=()=>{Ze||(X(null),Z(null))},_t=async()=>{if(!(!Y||Ze)){if(Qe(!0),Z(null),Y.isPaired){let e=await ve(o,Y.id);e.ok?(dt.current=!0,X(null)):Z(e.error),Qe(!1);return}try{let e=await Te(Y.id);if(e.ok){let e=m.getState();e.activeAssistantId===Y.id&&e.setActiveAssistantId(null),g(o,Y.id),dt.current=!0,X(null)}else Z(e.error??`Failed to remove. Please try again.`)}catch(e){console.error(`selectAssistant.removeFromDevice failed`,e),Z(`Failed to remove. Please try again.`)}Qe(!1)}},vt=()=>{rt||(nt(null),ot(null))},yt=async()=>{!Q||rt||(it(!0),ot(null),await z.getState().removeOrigin(Q.url),z.getState().origins.some(e=>e.url===Q.url)?ot(`Failed to remove. Please try again.`):(dt.current=!0,nt(null)),it(!1))},bt=e=>{F.getState().closeConnectDialog(),$(m.getState().assistants.find(t=>t.id===e)??{id:e,isLocal:!1,isPlatformHosted:!1,isPaired:!0})},xt=(e,t)=>{tt(!1),Pe(e,t??void 0)};(0,V.useEffect)(()=>{p||h||dt.current||y&&ie&&(w.length>0||v&&!ut||B||Ne||st||N.length!==0&&N.length===1&&P.length===1&&(Ie(!0),$(P[0])))},[N.length,P.length,ut,y,w.length,ie]);let St=()=>{if(L===q){Ae(null).then(e=>{!e&&A!==null&&window.location.assign(A)});return}let e=w.find(e=>Ge(e)===L);if(e){Fe(e)?a(k.assistant,{replace:!0}):Pe(e);return}let t=N.find(e=>e.id===L);t&&$(t)},Ct=()=>{a(y?k.welcome:k.assistant)},wt=O??Le;return Ne&&!wt&&!W?(0,H.jsx)(qe,{}):(0,H.jsxs)(re,{avatarWave:`beside`,children:[(0,H.jsx)(`div`,{className:`mx-auto flex w-full max-w-xl flex-col items-center ${v?`min-h-full px-8 pt-21 pb-4 electron-prechat-type`:`min-h-screen px-6 pb-40 pt-6 md:min-h-full md:pb-6`} text-[var(--content-default)]`,children:(0,H.jsxs)(`div`,{className:`flex w-full flex-col items-center ${v?``:`flex-1 justify-center`}`,children:[(0,H.jsx)(`h1`,{className:`text-center text-5xl font-normal tracking-tight md:text-4xl lg:text-5xl`,style:{fontFamily:`var(--font-serif)`,animation:`fadeInUp 0.5s ease-out 0.1s both`},children:e(`selectAssistantScreen.title`)}),wt&&(0,H.jsx)(`p`,{className:`mt-4 text-body-small-default text-[var(--system-negative-strong)]`,children:wt}),(0,H.jsxs)(`div`,{role:`radiogroup`,"aria-label":e(`selectAssistantScreen.listAriaLabel`),onKeyDown:De,className:`flex w-full flex-col ${v?`mt-8 gap-2`:`mt-10 gap-3`}`,style:{animation:`fadeInUp 0.5s ease-out 0.3s both`},children:[N.map(t=>{let n=_e(t);return(0,H.jsx)(Ye,{assistant:t,selected:L===t.id,locked:!n,tabStop:L==null?P[0]?.id===t.id:L===t.id,onSelect:()=>{n&&R(t.id)},loginLabel:e(D?`actions.cancel`:`actions.loginToUse`),loginDisabled:B,onLogin:!n&&(t.isPlatformHosted||t.isLocal)?D?de:()=>void ce():void 0,onRemove:t.isPlatformHosted&&we||t.isPaired&&I?()=>X(t):void 0},t.id)}),w.map((e,t)=>{let n=Ge(e),r=Fe(e);return(0,H.jsx)(Xe,{origin:e,selected:L===n,current:r,tabStop:L==null?P.length===0&&t===0:L===n,onSelect:()=>R(n),onRemove:r&&E?void 0:()=>nt(e)},e.url)}),M&&(0,H.jsx)(Xe,{origin:M,icon:(0,H.jsx)(d,{className:`h-5 w-5`}),selected:L===q,current:!1,tabStop:L==null?P.length===0&&w.length===0:L===q,onSelect:()=>R(q)}),y&&(0,H.jsx)(Je,{icon:(0,H.jsx)(c,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.createNew`),disabled:B||D,onClick:()=>void a(`${k.onboarding.hosting}?from=select-assistant`)}),I&&(0,H.jsx)(Je,{icon:(0,H.jsx)(s,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.connectRemote`),disabled:B||D,onClick:()=>F.getState().openConnectDialog()}),!I&&(0,H.jsx)(Je,{icon:(0,H.jsx)(f,{className:`h-4 w-4`}),label:e(`selectAssistantScreen.addRemote`),disabled:B||D,onClick:()=>tt(!0)})]}),ye&&(0,H.jsx)(`div`,{className:`mt-8 w-full`,style:{animation:`fadeInUp 0.5s ease-out 0.4s both`},children:(0,H.jsx)(j,{variant:`primary`,size:`regular`,fullWidth:!0,className:v?void 0:`h-11 text-base`,onClick:St,disabled:!L||B,children:e(B?`actions.connecting`:`actions.continue`)})}),(0,H.jsx)(`div`,{className:ye?`mt-3`:`mt-8`,style:{animation:`fadeInUp 0.5s ease-out 0.5s both`},children:(0,H.jsx)(j,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,onClick:Ct,disabled:B||D,children:e(`actions.back`)})})]})}),(0,H.jsx)(Re,{open:et,onClose:()=>tt(!1),onAdded:xt}),(0,H.jsx)(Be,{open:st,initialAddress:ct??void 0,guidanceKind:lt??void 0,onClose:()=>F.getState().closeConnectDialog(),onImported:bt}),(0,H.jsx)(Ve,{open:W!=null,assistantName:W?He(W):``,isPending:G,errorMessage:Ue??void 0,onCancel:pt,onRepair:()=>void mt(),onRetire:()=>void ht()}),(0,H.jsx)(se,{open:Y!=null,kind:Y?.isPaired?`paired`:`platform`,assistantName:Y?He(Y):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:$e??void 0,isPending:Ze,onConfirm:()=>void _t(),onCancel:gt}),(0,H.jsx)(se,{open:Q!=null,kind:`origin`,assistantName:Q?We(Q):e(`selectAssistantScreen.unnamedAssistant`),errorMessage:at??void 0,isPending:rt,onConfirm:()=>void yt(),onCancel:vt})]})}function qe(){let{t:e}=n(`onboarding`);return(0,H.jsx)(re,{avatarWave:`beside`,children:(0,H.jsx)(`div`,{className:`mx-auto flex min-h-screen w-full max-w-xl flex-col items-center justify-center px-6 text-[var(--content-default)]`,children:(0,H.jsx)(`p`,{className:`text-body-medium-lighter text-[var(--content-tertiary)]`,children:e(`selectAssistantScreen.connectingToAssistant`)})})})}function Je({icon:e,label:t,disabled:n,onClick:r}){let i=ae();return(0,H.jsxs)(`button`,{type:`button`,onClick:r,disabled:n,className:[`group flex w-full items-center justify-center gap-2 border border-dashed border-[var(--border-element)]/50 text-[var(--content-tertiary)]`,i?`rounded-lg px-3 py-2.5`:`rounded-xl px-5 py-3`,`cursor-pointer transition-all duration-200 ease-out`,`hover:border-[var(--border-element)] hover:bg-[var(--surface-hover)] hover:text-[var(--content-default)]`,`disabled:cursor-not-allowed disabled:opacity-50`].join(` `),children:[e,(0,H.jsx)(`span`,{className:i?`text-body-small-default`:`text-body-medium-default`,children:t})]})}function Y({label:e,onRemove:t}){let{t:r}=n(`onboarding`);return(0,H.jsxs)(O.Root,{children:[(0,H.jsx)(O.Trigger,{asChild:!0,children:(0,H.jsx)(j,{variant:`ghost`,size:`regular`,className:`text-[var(--content-tertiary)]`,iconOnly:(0,H.jsx)(p,{}),"aria-label":r(`selectAssistantScreen.rowActionsAriaLabel`,{name:e})})}),(0,H.jsx)(O.Content,{align:`end`,sideOffset:4,children:(0,H.jsx)(O.Item,{onSelect:t,className:R.anchored,children:r(`selectAssistantScreen.removeFromDevice`)})})]})}function X({icon:e,title:t,subtitle:n,selected:r,locked:i=!1,tabStop:a,onSelect:o,action:s,removeMenu:c}){let u=ae();return(0,H.jsxs)(`div`,{role:i?void 0:`radio`,"aria-checked":i?void 0:r,tabIndex:i?void 0:a?0:-1,onClick:i?void 0:o,onKeyDown:i?void 0:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},className:[`group flex w-full items-center border text-left`,u?`gap-3 rounded-lg px-[10px] py-3`:`gap-4 rounded-2xl px-[18px] py-4`,`transition-all duration-200 ease-out`,i?`border-[var(--border-base)] bg-[var(--surface-overlay)]`:`cursor-pointer focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--primary-base)]`,i?``:r?`border-[var(--primary-base)] bg-[var(--surface-lift)]`:`border-[var(--border-base)] bg-[var(--surface-lift)]/60 hover:border-[var(--border-element)] hover:bg-[var(--surface-lift)]`].join(` `),children:[(0,H.jsx)(`div`,{className:[`flex shrink-0 items-center justify-center transition-colors duration-200`,`h-12 w-12 rounded-[10px]`,r&&!i?`bg-[var(--primary-base)] text-[var(--surface-base)]`:`bg-[var(--surface-active)]/40 text-[var(--content-secondary)]`].join(` `),children:e}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:t}),(0,H.jsx)(`span`,{className:`mt-1 block text-[var(--content-tertiary)] ${u?`text-label-medium-default font-normal`:`text-body-small-lighter`}`,children:n})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[s,c&&(i?c:(0,H.jsx)(`div`,{onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:c})),!i&&(0,H.jsx)(`div`,{className:[`flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-all duration-200`,r?`border-[var(--primary-base)] bg-[var(--primary-base)]`:`border-[var(--border-element)] group-hover:border-[var(--content-tertiary)]`].join(` `),children:r&&(0,H.jsx)(l,{className:`h-3 w-3 text-[var(--surface-base)]`,strokeWidth:3})})]})]})}function Ye({assistant:e,selected:t,locked:r,tabStop:i,onSelect:a,loginLabel:o,loginDisabled:c,onLogin:l,onRemove:f}){let{t:p}=n(`onboarding`),m=He(e),{traits:h,imageUrl:g,onImageError:_}=ge(e);return(0,H.jsx)(X,{icon:(0,H.jsx)(Ie,{traits:h,imageUrl:g,fallback:e.isPaired?(0,H.jsx)(s,{className:`h-5 w-5`}):e.isLocal?(0,H.jsx)(u,{className:`h-5 w-5`}):(0,H.jsx)(d,{className:`h-5 w-5`}),decorative:!0,onImageError:_}),title:m,subtitle:K(e,p),selected:t,locked:r,tabStop:i,onSelect:a,action:r&&l?(0,H.jsx)(j,{variant:`primary`,size:`regular`,onClick:l,disabled:c,children:o}):void 0,removeMenu:f&&(0,H.jsx)(Y,{label:m,onRemove:f})})}function Xe({origin:e,icon:t,selected:r,current:i,tabStop:a,onSelect:o,onRemove:s}){let{t:c}=n(`onboarding`),l=We(e);return(0,H.jsx)(X,{icon:t??(0,H.jsx)(f,{className:`h-5 w-5`}),title:l,subtitle:c(i?`selectAssistantScreen.currentWithHost`:`selectAssistantScreen.remoteWithHost`,{host:Ue(e)}),selected:r,tabStop:a,onSelect:o,removeMenu:s&&(0,H.jsx)(Y,{label:l,onRemove:s})})}export{J as SelectAssistantScreen};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Q as e,k as t}from"./vendor-yoekmcrB.js";import{__ as n,_y as r,em as i,gm as a,wy as o}from"./index-
|
|
1
|
+
import{Q as e,k as t}from"./vendor-yoekmcrB.js";import{__ as n,_y as r,em as i,gm as a,wy as o}from"./index-BGc71lz7.js";var s=`vellum:remembered-origins`;function c(e){let t=e.trim();if(t===``)return null;let n;try{n=new URL(t)}catch{return null}return n.protocol!==`https:`||n.hostname===``?null:`${n.origin}${n.pathname.replace(/\/+$/,``)}`}function l(e,t){let n=[],r=new Set,i=t??new Date().toISOString();for(let t of e){if(typeof t!=`object`||!t)continue;let{url:e,name:a,addedAt:o}=t;if(typeof e!=`string`)continue;let s=c(e);s===null||r.has(s)||(r.add(s),n.push({url:s,...typeof a==`string`&&a!==``?{name:a}:{},addedAt:typeof o==`string`?o:i}))}return n}function u(e){let t=JSON.parse(e);return Array.isArray(t)?l(t):null}var d=n({key:s,scope:`device`,parse:u,serialize:JSON.stringify,fallback:[]}),f={load:async()=>d.load(),save:async e=>{d.save(e)},watch:e=>r(s,e)},p=f,m=null,h=0,g=Promise.resolve(),_=`vellum:remembered-origins:mutate`;async function v(e){let t=typeof navigator>`u`?void 0:navigator.locks;return t?await t.request(_,e):e()}function y(e){let t=()=>v(e),n=g.then(t,t);return g=n.catch(()=>void 0),n}var b=null,x=!1;function S(e){return y(async()=>{try{let t=await p.load();if(e!==h)return;T.getState().hydrated?T.setState({origins:t}):m===null?T.getState().hydrate():x=!0}catch{}})}function C(){b?.();let e=h;b=p.watch?.(()=>void S(e))??null}function w(e){p=e,h+=1,m=null,x=!1,T.setState({hydrated:!1}),C(),T.getState().hydrate()}var T=e()((e,t)=>({origins:[],hydrated:!1,hydrate:()=>(m??=(async()=>{let t=h;await Promise.resolve();try{let n=await p.load();t===h&&(e({origins:n,hydrated:!0}),x&&(x=!1,S(t)))}catch{t===h&&(m=null)}})(),m),addOrigin:async({url:n,name:r})=>{let i=c(n);return i===null?{ok:!1}:y(async()=>{if(await t().hydrate(),!t().hydrated)return{ok:!1};let n=p,a=h,o;try{o=await n.load()}catch{return{ok:!1}}if(a!==h)return{ok:!1};let s=r?.trim(),c=o.find(e=>e.url===i),l=c??{url:i,addedAt:new Date().toISOString()},u=s?{...l,name:s}:l,d=c?o.map(e=>e.url===i?u:e):[...o,u];try{await n.save(d)}catch{return{ok:!1}}return a===h?(e({origins:d}),{ok:!0,origin:u}):{ok:!1}})},removeOrigin:async n=>{let r=c(n);r!==null&&await y(async()=>{if(await t().hydrate(),!t().hydrated)return;let n=p,i=h,a;try{a=await n.load()}catch{return}if(i!==h)return;let o=a.filter(e=>e.url!==r);if(o.length!==a.length)try{await n.save(o)}catch{return}i===h&&e({origins:o})})}}));C();var E=o(T),D=t(`SelfHostedServers`),O=`1970-01-01T00:00:00.000Z`;async function k(){try{return await D.list()}catch(e){return console.debug(`[self-hosted-servers] bridge unavailable:`,e),null}}var A=`vellum:remembered-origins:native-migrated`;function j(){try{return window.localStorage.getItem(A)===`true`}catch{return!0}}function M(){try{window.localStorage.setItem(A,`true`)}catch{}}async function N(e){if(j())return e;let t=[];try{t=await f.load()}catch{t=[]}let n=new Set(e.map(e=>e.url)),r=t.filter(e=>!n.has(e.url)),i=[];for(let t of r){try{await D.add({url:t.url,...t.name?{name:t.name}:{}})}catch(t){return console.debug(`[self-hosted-servers] migration add failed:`,t),[...e,...i]}i.push(t)}return M(),[...e,...i]}function P(){return{load:async()=>{let e=await k();return e===null?f.load():N(l(e.servers,O))},save:async e=>{let t=await k();if(t===null){await f.save(e);return}let n=new Map(l(t.servers,O).map(e=>[e.url,e.name])),r=new Set(e.map(e=>e.url));for(let e of n.keys())r.has(e)||await D.remove({url:e});for(let t of e)(!n.has(t.url)||t.name&&t.name!==n.get(t.url))&&await D.add({url:t.url,...t.name?{name:t.name}:{}})},watch:f.watch}}var F=!1;function I(){F||!i()||(F=!0,w(P()))}async function L(e,t){if(!i())return!1;await a();try{return await t(),!0}catch(t){return console.debug(`[self-hosted-servers] ${e} unavailable:`,t),!1}}async function R(e){return L(`switchTo`,()=>D.switchTo(e===null?{}:{url:e}))}async function z(e,t){return L(`switchToPath`,()=>D.switchToPath({...e===null?{}:{url:e},path:t}))}async function B(){if(!i())return null;let e=await k();return e===null||!e.activeUrl?null:e.bakedUrl?c(e.bakedUrl):null}export{c as a,B as i,R as n,E as o,z as r,I as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./vendor-yoekmcrB.js";import{t}from"./react-BJ4PZBJN.js";import{Yr as n,ur as r}from"./icons-BjnVKAw1.js";import{fb as i}from"./index-
|
|
1
|
+
import{j as e}from"./vendor-yoekmcrB.js";import{t}from"./react-BJ4PZBJN.js";import{Yr as n,ur as r}from"./icons-BjnVKAw1.js";import{fb as i}from"./index-BGc71lz7.js";import{t as a}from"./detail-card-Eweuo5tS.js";var o=t();function s({id:e,title:t,subtitle:n,children:r}){return(0,o.jsx)(a,{id:e,title:t,subtitle:n,children:(0,o.jsx)(`div`,{className:`mt-4`,children:r})})}function c({onClick:t,disabled:n}){let{t:r}=e();return(0,o.jsx)(i,{onClick:t,disabled:n,children:r(`serviceFormControls.save`)})}function l({onClick:t,filled:n=!1}){let{t:r}=e();return(0,o.jsx)(i,{variant:n?`danger`:`dangerGhost`,onClick:t,children:r(`serviceFormControls.reset`)})}function u({guide:e}){return(0,o.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg border border-[var(--border-subtle)] bg-[var(--surface-sunken)] p-3 text-body-small-default text-[var(--content-tertiary)]`,children:[(0,o.jsx)(r,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-[var(--system-positive-strong)]`}),(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsx)(`span`,{children:e.description}),(0,o.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[var(--system-positive-strong)] underline hover:opacity-80`,children:[e.linkLabel,(0,o.jsx)(n,{className:`h-3 w-3`})]})]})]})}export{s as i,l as n,c as r,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{t,x as n}from"./react-BJ4PZBJN.js";import{tb as r}from"./index-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-BM3Ffeng.js";import{t,x as n}from"./react-BJ4PZBJN.js";import{tb as r}from"./index-BGc71lz7.js";var i=e(n(),1),a=t();function o({label:e,helperText:t,checked:n,onChange:o,variant:s=`toggle-leading`}){let c=(0,i.useId)(),l=(0,a.jsx)(r,{checked:n,onChange:o,id:c}),u=(0,a.jsxs)(`label`,{htmlFor:c,className:`min-w-0 flex-1 cursor-pointer`,children:[(0,a.jsx)(`span`,{className:`block text-body-medium-default text-[var(--content-default)]`,children:e}),(0,a.jsx)(`span`,{className:`mt-1 block text-body-small-default text-[var(--content-tertiary)]`,children:t})]});return s===`toggle-trailing`?(0,a.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[u,l]}):(0,a.jsxs)(`div`,{className:`flex items-center gap-4`,children:[l,u]})}export{o as t};
|