@vellumai/web 0.10.7-dev.202607090141.ed32fa2 → 0.10.7-dev.202607090313.8da7b93
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/{AnimatePresence-DqW6iWlh.js → AnimatePresence-C8APSgIu.js} +1 -1
- package/dist/assets/{BundleConfirmPage-BlV33vAT.js → BundleConfirmPage-M2tkzwiz.js} +1 -1
- package/dist/assets/{a2a-invite-C30VRGys.js → a2a-invite-DOnZrhrr.js} +1 -1
- package/dist/assets/{about-page-DaFgRaRh.js → about-page-C-kIVb7a.js} +1 -1
- package/dist/assets/{account-page-B57V03ak.js → account-page-T8CWb0jR.js} +1 -1
- package/dist/assets/{account-shell-BS1ujMBP.js → account-shell-DPdpCd1U.js} +1 -1
- package/dist/assets/{acp-run-detail-panel-Ct4Ueoth.js → acp-run-detail-panel-BtZbfXD2.js} +4 -4
- package/dist/assets/activity-steps-panel-DvGBVDJ2.js +1 -0
- package/dist/assets/{add-credits-modal-Bn-PXbbp.js → add-credits-modal-Cadua0Sw.js} +1 -1
- package/dist/assets/{advanced-page-Co3qJOnY.js → advanced-page-BrOPl0Ap.js} +1 -1
- package/dist/assets/ai-page-CmcqHCkS.js +1 -0
- package/dist/assets/{animated-avatar-Dxwp_utr.js → animated-avatar-DFjPiW8b.js} +1 -1
- package/dist/assets/{api-CQOohQol.js → api-Bggo7FID.js} +1 -1
- package/dist/assets/{api-DRRpS7nk.js → api-CruH_Cwk.js} +1 -1
- package/dist/assets/{api-key-screen-yc1_hwX3.js → api-key-screen-jAoV2hph.js} +1 -1
- package/dist/assets/{app-info-CBCBV0FS.js → app-info-LSjlWG3w.js} +1 -1
- package/dist/assets/{archive-page-BovWjWLa.js → archive-page-DMctskiG.js} +1 -1
- package/dist/assets/{assistant-feature-flag-store-CJuCq9wC.js → assistant-feature-flag-store-B5K6-cBU.js} +1 -1
- package/dist/assets/assistant-identity-store-D27sxUrj.js +1 -0
- package/dist/assets/{assistant-status-panel-BqSoLPwJ.js → assistant-status-panel-ChpIQ9Qy.js} +1 -1
- package/dist/assets/{auth-store-BvlU1RxR.js → auth-store-CWjr3UVp.js} +2 -2
- package/dist/assets/background-task-detail-panel-BxasP5_3.js +1 -0
- package/dist/assets/{billing-page-B4KoCm6P.js → billing-page-DltCnrJq.js} +3 -3
- package/dist/assets/{bookmarks-page-Ipw06EBo.js → bookmarks-page-D6fhvAdf.js} +1 -1
- package/dist/assets/{browser-CRxGcQt6.js → browser-DvAumlJv.js} +2 -2
- package/dist/assets/{build-state-Bt-a-8nM.js → build-state-CMniPKfu.js} +1 -1
- package/dist/assets/{capture-error-B8K8lUhs.js → capture-error-BBsDM05E.js} +1 -1
- package/dist/assets/{channels-page-route-Bp9UIDMY.js → channels-page-route-DUeAwdj1.js} +2 -2
- package/dist/assets/{chat-markdown-message-Ci1LZXf1.js → chat-markdown-message-Dz-4rxwd.js} +2 -2
- package/dist/assets/{checkbox-C2cYfHyW.js → checkbox-KBE-OAEZ.js} +1 -1
- package/dist/assets/{client-feature-flag-store-Cah1sUgk.js → client-feature-flag-store-C46PkLyX.js} +1 -1
- package/dist/assets/{client-identity-DZxMHz5J.js → client-identity-C81XukT2.js} +1 -1
- package/dist/assets/{command-palette-CePi_Oay.js → command-palette-Ho1OyvMr.js} +1 -1
- package/dist/assets/{command-palette-window-page-BzqzEvs_.js → command-palette-window-page-CbkDd3Bb.js} +1 -1
- package/dist/assets/community-page-CnYB_x1S.js +1 -0
- package/dist/assets/{confirm-dialog-CtTSa3H1.js → confirm-dialog-CK0EKPcs.js} +1 -1
- package/dist/assets/{connect-page-BY5OFNBi.js → connect-page-ajujMjz8.js} +1 -1
- package/dist/assets/{consent-controls-D1ll210m.js → consent-controls-3fdLa91u.js} +1 -1
- package/dist/assets/{contacts-gateway-6Lb7w1FV.js → contacts-gateway-B-60fhT6.js} +1 -1
- package/dist/assets/contacts-page-route-CeBj7wkE.js +1 -0
- package/dist/assets/{conversation-list-fetchers-CrhirfkH.js → conversation-list-fetchers-CEpsG9Hq.js} +1 -1
- package/dist/assets/{conversation-store-1e8Eo8Pt.js → conversation-store-OASl5Zq2.js} +1 -1
- package/dist/assets/{credential-entry-page-F7LYgCg_.js → credential-entry-page-Bkamk0sx.js} +1 -1
- package/dist/assets/{credentials-page-DYkXIrT2.js → credentials-page-Bbj7lYzY.js} +1 -1
- package/dist/assets/{danger-zone-redirect-page-BY7JULmG.js → danger-zone-redirect-page-C4phNna7.js} +1 -1
- package/dist/assets/debug-page-BPrAnklG.js +4 -0
- package/dist/assets/{deploy-dialogs-BXT4AazP.js → deploy-dialogs-C31IGSl-.js} +1 -1
- package/dist/assets/{detail-card-Dx3HEsGW.js → detail-card-BtLydmm2.js} +1 -1
- package/dist/assets/{detail-panel-stop-button-Du6C-GiO.js → detail-panel-stop-button-CuO71j46.js} +1 -1
- package/dist/assets/{developer-page-Cjwn-t5N.js → developer-page-BI2sKxz-.js} +1 -1
- package/dist/assets/{devices-page-BqCWM55O.js → devices-page-C6c0f22Y.js} +1 -1
- package/dist/assets/{diagnostics-vA50Nu61.js → diagnostics-CGtu9POo.js} +1 -1
- package/dist/assets/{dictation-overlay-page-yj_UbTfy.js → dictation-overlay-page-uxGjRhgX.js} +1 -1
- package/dist/assets/{dist-DN2RsZWu.js → dist-DkjV98LA.js} +1 -1
- package/dist/assets/{dist-CqqTKNbU.js → dist-Ewcvjaqv.js} +1 -1
- package/dist/assets/{document-viewer-page-DDNhJ23w.js → document-viewer-page-B-6aidMH.js} +1 -1
- package/dist/assets/{dropdown-N_bjXYQD.js → dropdown-31r8-Thq.js} +1 -1
- package/dist/assets/{earn-credits-modal-BoT11JMd.js → earn-credits-modal-QzMpmMaj.js} +1 -1
- package/dist/assets/effective-timezone-CDoc_Drq.js +1 -0
- package/dist/assets/{emails-page-D2QtCpFz.js → emails-page-DThTbEAn.js} +1 -1
- package/dist/assets/{environment-store-tCME6zJN.js → environment-store-fb1I8_0E.js} +1 -1
- package/dist/assets/esm--eLOiZM6.js +2 -0
- package/dist/assets/esm-BzYZorkM.js +2 -0
- package/dist/assets/esm-DBciPwtV.js +2 -0
- package/dist/assets/{esm-Bnfj8IoA.js → esm-DTrfddt2.js} +2 -2
- package/dist/assets/esm-DZF2IJOt.js +2 -0
- package/dist/assets/esm-DzcLs4Qi.js +1 -0
- package/dist/assets/esm-w-MAO27I.js +2 -0
- package/dist/assets/{feature-flag-catalog-D-RRbwg1.js → feature-flag-catalog-BxFIDBSQ.js} +1 -1
- package/dist/assets/{file-editor-CNbsK7YO.js → file-editor-mVo7pWO6.js} +1 -1
- package/dist/assets/{file-markdown-D8HoWCNf.js → file-markdown-C-ODMWni.js} +1 -1
- package/dist/assets/{general-page-78vPpoz1.js → general-page-DqHnoTcX.js} +1 -1
- package/dist/assets/{haptics-Bj0g6WFb.js → haptics-CMudM-Xn.js} +2 -2
- package/dist/assets/{hatching-screen-BqYHY49o.js → hatching-screen-DaqR3XZZ.js} +1 -1
- package/dist/assets/home-page-route-zkrsn0fj.js +1 -0
- package/dist/assets/{hosting-screen-N2bYcMRD.js → hosting-screen-Dnv_xqTV.js} +1 -1
- package/dist/assets/identity-page-route-BTT5yGLM.js +1 -0
- package/dist/assets/index-hP3p8VUv.js +113 -0
- package/dist/assets/{inspect-page-Dz9u93QF.js → inspect-page-C-wpmimY.js} +3 -3
- package/dist/assets/integrations-page-BNnazL8i.js +1 -0
- package/dist/assets/intelligence-layout-WG-YF2Er.js +1 -0
- package/dist/assets/{keyboard-shortcuts-page-hdI3k2a9.js → keyboard-shortcuts-page-CfhZZg_0.js} +1 -1
- package/dist/assets/{library-detail-page-Rpf4b_D_.js → library-detail-page-Cq2jm-ws.js} +1 -1
- package/dist/assets/{library-page-G1aMiizX.js → library-page-DMRx30ri.js} +1 -1
- package/dist/assets/{list-row-CfxAtdcm.js → list-row-gk--xRb0.js} +1 -1
- package/dist/assets/{local-mode-VzlKSb2I.js → local-mode-grqHUoNh.js} +1 -1
- package/dist/assets/{login-flow-C-VRR_b2.js → login-flow-CW0ziAvs.js} +1 -1
- package/dist/assets/{login-page-CJwD1siQ.js → login-page-DwOPxmVe.js} +1 -1
- package/dist/assets/{logout-page-CxZ9cG2T.js → logout-page-U5gvG_Wz.js} +1 -1
- package/dist/assets/{logs-layout-DpB3ZnKl.js → logs-layout-CGTF5rhL.js} +1 -1
- package/dist/assets/{memory-router-playground-page-CZhKtL2B.js → memory-router-playground-page-D5QcX-wk.js} +1 -1
- package/dist/assets/{menu-zWipteeq.js → menu-CXOuNC8C.js} +1 -1
- package/dist/assets/{messages-fu9EvPMV.js → messages-Bsdi3iRd.js} +2 -2
- package/dist/assets/{metric-card-B5fh9AX6.js → metric-card-DowcVBWC.js} +1 -1
- package/dist/assets/{mobile-sidebar-drawer-D4Fmo4ih.js → mobile-sidebar-drawer-4x4mCC-9.js} +1 -1
- package/dist/assets/{modal-BGCSeBHg.js → modal-CGJ7DWt0.js} +1 -1
- package/dist/assets/mutation-error-B7caUDmr.js +1 -0
- package/dist/assets/{native-biometric-Qzoqupj3.js → native-biometric-C7brkm_n.js} +1 -1
- package/dist/assets/{native-file-DQ3ZLI_q.js → native-file-5Rcj7ogV.js} +2 -2
- package/dist/assets/{notice-DLzbYrbG.js → notice-DkcNAP8O.js} +1 -1
- package/dist/assets/{notifications-page-BMdKOtfC.js → notifications-page-CqYCJg1p.js} +1 -1
- package/dist/assets/{oauth-complete-page-ncWdt252.js → oauth-complete-page-CRGbAyU5.js} +1 -1
- package/dist/assets/{oauth-popup-complete-page-DzN4o5hz.js → oauth-popup-complete-page-DOBxQIMU.js} +1 -1
- package/dist/assets/{page-shell-Bp3RMa1P.js → page-shell-urkeNN8F.js} +1 -1
- package/dist/assets/{pairing-page-_89zh3bZ.js → pairing-page-C1ZLeRdJ.js} +1 -1
- package/dist/assets/{panel-item-HxFPJuum.js → panel-item-DvJGTiJi.js} +1 -1
- package/dist/assets/{password-reset-page-CxydPspO.js → password-reset-page-DhZqvXBi.js} +1 -1
- package/dist/assets/{platform-detection-DqNBGAtu.js → platform-detection-xyFuSZad.js} +1 -1
- package/dist/assets/{platform-loopback-page-CQP3OXuu.js → platform-loopback-page-hUlI_Ol4.js} +1 -1
- package/dist/assets/{plugin-detail-page-vEJBYtgl.js → plugin-detail-page-CgPP7qKm.js} +1 -1
- package/dist/assets/plugins-page-DcrBA9WJ.js +1 -0
- package/dist/assets/plugins-surface-BT6NGx63.js +1 -0
- package/dist/assets/{popover-BulBVPLe.js → popover-ChbtizWo.js} +1 -1
- package/dist/assets/{prechat-route-DvpeppgI.js → prechat-route-x8-u6Thr.js} +1 -1
- package/dist/assets/{prefs-BY0T5icG.js → prefs-YQnBqGt1.js} +1 -1
- package/dist/assets/privacy-page-Bda7UTLM.js +1 -0
- package/dist/assets/{privacy-screen-JyOMcMmd.js → privacy-screen-D4gZpnxa.js} +1 -1
- package/dist/assets/{provider-callback-page-osqizacK.js → provider-callback-page-AVPXwBEi.js} +1 -1
- package/dist/assets/{provider-key-DtQibfaH.js → provider-key-DgXeMpey.js} +1 -1
- package/dist/assets/{provider-signup-page-y63lE4tS.js → provider-signup-page-B7chI50L.js} +1 -1
- package/dist/assets/{quick-input-page-DOtwNJqG.js → quick-input-page-DRq1TmOI.js} +1 -1
- package/dist/assets/{react-query.gen-Do9r5bx8.js → react-query.gen-5m89qzvo.js} +1 -1
- package/dist/assets/react-query.gen-Cd49WvO7.js +1 -0
- package/dist/assets/{remote-gateway-session-BLu6IU0b.js → remote-gateway-session-C4vclOsm.js} +1 -1
- package/dist/assets/{research-mock-page-CXMPL97M.js → research-mock-page-BOwJkRjf.js} +1 -1
- package/dist/assets/{research-onboarding-persistence-BVt2pKip.js → research-onboarding-persistence-DnuHyFyB.js} +1 -1
- package/dist/assets/{research-onboarding-route-DC75BvrS.js → research-onboarding-route-pAxndKeE.js} +3 -3
- package/dist/assets/{resize-errors-B9g3wBHr.js → resize-errors-BkTsFd9i.js} +1 -1
- package/dist/assets/{resolved-assistants-store-CRFO9Spj.js → resolved-assistants-store-BSZbT8Ju.js} +1 -1
- package/dist/assets/{return-to-Dl2d46oZ.js → return-to-D9NlMEUo.js} +1 -1
- package/dist/assets/{review-terms-screen-Dtr_6OaO.js → review-terms-screen-B2TSIzoT.js} +1 -1
- package/dist/assets/risk-badge-BBLHtNVP.js +3 -0
- package/dist/assets/routes-DT0Mj7fI.js +1 -0
- package/dist/assets/{schedules-CS-RbZe0.js → schedules-C-XIazwq.js} +1 -1
- package/dist/assets/{sdk.gen-BXaGmR5-.js → sdk.gen-BVgkyBUC.js} +1 -1
- package/dist/assets/{sdk.gen-BjuK5OXz.js → sdk.gen-n387Ug06.js} +1 -1
- package/dist/assets/{security-page-D7hf5hjW.js → security-page-B5P0J2BI.js} +1 -1
- package/dist/assets/{select-assistant-screen-Bmeke-_4.js → select-assistant-screen-4iZuHIU4.js} +1 -1
- package/dist/assets/{setting-row-CWiazN_2.js → setting-row-QKgqbQ4U.js} +1 -1
- package/dist/assets/settings-layout-BEnbLrmq.js +1 -0
- package/dist/assets/{share-feedback-modal-DJH3cy0M.js → share-feedback-modal-De5OK1SE.js} +1 -1
- package/dist/assets/{sidebar-tree-DFy_DCVI.js → sidebar-tree-CsGUuKED.js} +1 -1
- package/dist/assets/{signup-page-ClJ12ZAn.js → signup-page-Cq1XPuV3.js} +1 -1
- package/dist/assets/{signup-shell-Pcpr_9A2.js → signup-shell-D4Afeijm.js} +1 -1
- package/dist/assets/site-favicon-DSv9fzq0.js +1 -0
- package/dist/assets/skill-detail-page-9QvIbkre.js +1 -0
- package/dist/assets/skill-detail-panel-B8z4lALs.js +1 -0
- package/dist/assets/skills-ZL8i7FRx.js +1 -0
- package/dist/assets/skills-page-ya4LjN8F.js +1 -0
- package/dist/assets/{sound-manager-CZLjLk_r.js → sound-manager-CspC5w00.js} +1 -1
- package/dist/assets/{sounds-page-DH8ARWma.js → sounds-page-CivyyNIu.js} +1 -1
- package/dist/assets/{src-CTfdzX7d.js → src-DQLGZRXb.js} +1 -1
- package/dist/assets/subagent-detail-panel-D1laitaw.js +4 -0
- package/dist/assets/{subagent-store-BsyYKDw0.js → subagent-store-BceuZWi6.js} +1 -1
- package/dist/assets/{system-events-page-GBAbRxWX.js → system-events-page-DvSbZKvh.js} +1 -1
- package/dist/assets/{system-events-redirect-page-BrFoBwKg.js → system-events-redirect-page-CiRNWmHX.js} +1 -1
- package/dist/assets/{tag-Fb8purwh.js → tag-Dawxigu4.js} +1 -1
- package/dist/assets/{tiptap-document-editor-DLQqbZ-8.js → tiptap-document-editor-DEDqvRFt.js} +1 -1
- package/dist/assets/{toast-DHD7Ht__.js → toast-Cf0TcOqg.js} +1 -1
- package/dist/assets/{tool-detail-panel-CGS7-koB.js → tool-detail-panel-BJRVBcye.js} +2 -2
- package/dist/assets/{upgrade-cancel-page-RVYbdY1c.js → upgrade-cancel-page-CkomOHea.js} +1 -1
- package/dist/assets/{upgrade-success-page-CWJ9Tmf5.js → upgrade-success-page-CjNArUTz.js} +1 -1
- package/dist/assets/{usage-page-D3K3QQut.js → usage-page-a4blzc4B.js} +1 -1
- package/dist/assets/{use-active-assistant-id-CwnoJiIp.js → use-active-assistant-id-BNRMo_Mi.js} +1 -1
- package/dist/assets/{use-bus-subscription-BeSk6Zc6.js → use-bus-subscription-BB_oIP0P.js} +1 -1
- package/dist/assets/{use-edge-swipe-back-m9rT386u.js → use-edge-swipe-back-B4Z4EaCF.js} +1 -1
- package/dist/assets/{use-invite-link-dialog-B22AjjvD.js → use-invite-link-dialog-DlGJL527.js} +1 -1
- package/dist/assets/use-is-org-ready-D1QY5FlS.js +1 -0
- package/dist/assets/{use-onboarding-login-Cm7bjW77.js → use-onboarding-login-B07uPNc5.js} +1 -1
- package/dist/assets/{use-reduced-motion-ztQz2c8x.js → use-reduced-motion-CcGT6CHV.js} +1 -1
- package/dist/assets/use-skill-actions-DFdfJGmF.js +1 -0
- package/dist/assets/{use-skill-categories-KeArdR0l.js → use-skill-categories-B6cq4S3f.js} +1 -1
- package/dist/assets/use-skill-detail-files-BUpxIhup.js +1 -0
- package/dist/assets/{utils-CaL2xuop.js → utils-DIM1bg0R.js} +1 -1
- package/dist/assets/viewer-store-Czrn_BBz.js +1 -0
- package/dist/assets/{voice-page-1Znu43M8.js → voice-page-CAcGfm0n.js} +1 -1
- package/dist/assets/{weather-forecast-display-DneoiMTR.js → weather-forecast-display-Bgf2vigr.js} +1 -1
- package/dist/assets/{web-CUSU9lXe.js → web-BX2xhWuK.js} +1 -1
- package/dist/assets/{web-vvcRjiUy.js → web-Bt_v62_Z.js} +1 -1
- package/dist/assets/{web-BCqvKGuo.js → web-D2mZM7S1.js} +1 -1
- package/dist/assets/{web-S0PcuWnq.js → web-DCZv_VE8.js} +1 -1
- package/dist/assets/{web-CdXIjGoo.js → web-DGlRyrJ3.js} +1 -1
- package/dist/assets/{web-BjLpxqIa.js → web-DIWxzE_L.js} +1 -1
- package/dist/assets/{web-C3-lfHqG.js → web-InoAUt-b.js} +1 -1
- package/dist/assets/{web-jaVDiDt4.js → web-PjLI5i1e.js} +1 -1
- package/dist/assets/{welcome-screen-Ct2oGHiG.js → welcome-screen-CXwSGa3-.js} +1 -1
- package/dist/assets/workflow-detail-panel-tzu3Zb-Q.js +1 -0
- package/dist/assets/{workflow-store-DMCvn8vu.js → workflow-store-BvFeogrn.js} +1 -1
- package/dist/assets/workspace-page-BEUBwlin.js +1 -0
- package/dist/index.html +134 -134
- package/package.json +1 -1
- package/dist/assets/activity-steps-panel-CCGqV3ia.js +0 -1
- package/dist/assets/ai-page-DnXxnDPh.js +0 -1
- package/dist/assets/assistant-identity-store-C-r2pCdE.js +0 -1
- package/dist/assets/background-task-detail-panel-BTuh-XLo.js +0 -1
- package/dist/assets/community-page-DSpR09ei.js +0 -1
- package/dist/assets/contacts-page-route-CNjjcqUG.js +0 -1
- package/dist/assets/debug-page-U1TnmDfa.js +0 -4
- package/dist/assets/detail-shell-RL6pic8_.js +0 -3
- package/dist/assets/effective-timezone-CRUxO0lu.js +0 -1
- package/dist/assets/esm-BAo3WjEU.js +0 -2
- package/dist/assets/esm-BHZsVkmW.js +0 -2
- package/dist/assets/esm-Dbas7BMg.js +0 -1
- package/dist/assets/esm-DvinS7VF.js +0 -2
- package/dist/assets/esm-mY5uQLbo.js +0 -2
- package/dist/assets/esm-s98aWlUj.js +0 -2
- package/dist/assets/home-page-route-5uZGPpwo.js +0 -1
- package/dist/assets/identity-page-route-yOesfA5F.js +0 -1
- package/dist/assets/index-I1w8ACGD.js +0 -113
- package/dist/assets/integrations-page-C-QUEHab.js +0 -1
- package/dist/assets/intelligence-layout-D0G45pWQ.js +0 -1
- package/dist/assets/mutation-error-BBm-OuDT.js +0 -1
- package/dist/assets/plugins-page-C_gY20OG.js +0 -1
- package/dist/assets/plugins-surface-Dvgn5iK4.js +0 -1
- package/dist/assets/privacy-page-C7EE7wbK.js +0 -1
- package/dist/assets/react-query.gen-CIiZpfEt.js +0 -1
- package/dist/assets/routes-Dzu6VaCS.js +0 -1
- package/dist/assets/settings-layout-DEUs9YoG.js +0 -1
- package/dist/assets/site-favicon-C2IkVr8i.js +0 -1
- package/dist/assets/skills-page-3UYQVgbf.js +0 -1
- package/dist/assets/subagent-detail-panel-DNIsFvvJ.js +0 -4
- package/dist/assets/use-is-org-ready-DJboMb1V.js +0 -1
- package/dist/assets/viewer-store-BJrTZO7F.js +0 -1
- package/dist/assets/workflow-detail-panel-Cm8OIrY3.js +0 -1
- package/dist/assets/workspace-page-CVVOLGRH.js +0 -1
- /package/dist/assets/{Combination-v9l9hzt_.js → Combination-CVPxMOlU.js} +0 -0
- /package/dist/assets/{api-errors-hnF5Vs7U.js → api-errors-D2CsZ6Xx.js} +0 -0
- /package/dist/assets/{avatar-bundled-components-ELDcio1Z.js → avatar-bundled-components--1Wyhs4r.js} +0 -0
- /package/dist/assets/{avatar-svg-compositor-D7Dy9s1k.js → avatar-svg-compositor-CnDf9Ibf.js} +0 -0
- /package/dist/assets/{brain-BDL_F8de.js → brain-BLDXGaUy.js} +0 -0
- /package/dist/assets/{browser-timezone-viO2H3SD.js → browser-timezone-2SnmKDjM.js} +0 -0
- /package/dist/assets/{bug-DpgA3wug.js → bug-BsuQ5ciQ.js} +0 -0
- /package/dist/assets/{build.umd-C9hy0alU.js → build.umd-wlq6sZjw.js} +0 -0
- /package/dist/assets/{by-tool-use-id-index-DOuKBKii.js → by-tool-use-id-index-BDdHasWX.js} +0 -0
- /package/dist/assets/{calendar-BsBBr1Nh.js → calendar-h-mv1itX.js} +0 -0
- /package/dist/assets/{chat-Rlp5eStK.js → chat-B8mgARYR.js} +0 -0
- /package/dist/assets/{check-BxTjPEIb.js → check-DFNrQERi.js} +0 -0
- /package/dist/assets/{chevron-down-CrCryYS_.js → chevron-down-qD-re7AW.js} +0 -0
- /package/dist/assets/{chevron-left-Ncgwat48.js → chevron-left-BMF1xNfR.js} +0 -0
- /package/dist/assets/{chevron-right-CpCJCjNw.js → chevron-right-DqqmezXC.js} +0 -0
- /package/dist/assets/{chevron-up-CiTEOcTn.js → chevron-up-3jCod9LW.js} +0 -0
- /package/dist/assets/{circle-alert-BpVEgu2n.js → circle-alert-zOqdmf25.js} +0 -0
- /package/dist/assets/{circle-check-CgHtt-mN.js → circle-check-VSiny8yl.js} +0 -0
- /package/dist/assets/{client.gen-DA8zvIMN.js → client.gen-BUTTddQZ.js} +0 -0
- /package/dist/assets/{clipboard-copy-0aofAwaM.js → clipboard-copy-DF6K1xc6.js} +0 -0
- /package/dist/assets/{cloud-off-CysJvmWr.js → cloud-off-Db1nySkc.js} +0 -0
- /package/dist/assets/{code-DsR1Npcp.js → code-Czx7d7SK.js} +0 -0
- /package/dist/assets/{composer-focus-9AYq_ZRn.js → composer-focus-Ck6HqiWm.js} +0 -0
- /package/dist/assets/{conversation-selection-CNssqGbG.js → conversation-selection-B3iOysPH.js} +0 -0
- /package/dist/assets/{copy-CytZjq76.js → copy-Cn1FKrEp.js} +0 -0
- /package/dist/assets/{cpu-C6_Tjhkh.js → cpu-BJuB2Khn.js} +0 -0
- /package/dist/assets/{create-selectors-BMFBr-tH.js → create-selectors-8NePGNlX.js} +0 -0
- /package/dist/assets/{credit-card-s3I7DYkY.js → credit-card-BuyWdO9t.js} +0 -0
- /package/dist/assets/{definitions-nBYmeqKu.js → definitions-B1DK4OsQ.js} +0 -0
- /package/dist/assets/{definitions-Bt4EwTQS.js → definitions-alqf_FBK.js} +0 -0
- /package/dist/assets/{dist-DYgyKb8r.js → dist-D7LHboeT.js} +0 -0
- /package/dist/assets/{dist-C3LFhPgk2.js → dist-D9vTKt742.js} +0 -0
- /package/dist/assets/{dist-CLd31vua.js → dist-DXXMZhbb.js} +0 -0
- /package/dist/assets/{domain-field-6GHeeXa3.js → domain-field-C5a2iMot.js} +0 -0
- /package/dist/assets/{domains-CYasAPyd.js → domains-Bb5wnUnB.js} +0 -0
- /package/dist/assets/{download-CO38a5Al.js → download-CAuK-nZ6.js} +0 -0
- /package/dist/assets/{emoji-catalog-data-ZiR2qmj7.js → emoji-catalog-data-D_xqkMQV.js} +0 -0
- /package/dist/assets/{event-bus--RGxdHGY.js → event-bus-BaXIL9Sv.js} +0 -0
- /package/dist/assets/{external-link-CfkE0LZW.js → external-link-Dqpx9nRm.js} +0 -0
- /package/dist/assets/{file-xi5GbREI.js → file-DsyJLS2u.js} +0 -0
- /package/dist/assets/{file-text-DDcypanB.js → file-text-CYJz-GvF.js} +0 -0
- /package/dist/assets/{format-date-DD-dKYMi.js → format-date-BczUbfC1.js} +0 -0
- /package/dist/assets/{format-file-size-CBQjPwkk.js → format-file-size-D7iZejgy.js} +0 -0
- /package/dist/assets/{globe-DBPUpuhF.js → globe-4qSOWE2N.js} +0 -0
- /package/dist/assets/{hard-drive-CqL91XYJ.js → hard-drive-rDxhoRUm.js} +0 -0
- /package/dist/assets/{impersonate-version-flag-CZkNRf0V.js → impersonate-version-flag-SEJUDSSh.js} +0 -0
- /package/dist/assets/{info-DBKmGHUD.js → info-DsOyuMO9.js} +0 -0
- /package/dist/assets/{input-DOcdV8Z3.js → input-BF89Fan0.js} +0 -0
- /package/dist/assets/{is-electron-BfJ5EybV.js → is-electron-y5bNUVyG.js} +0 -0
- /package/dist/assets/{key-round-BZjdkR0o.js → key-round-CD3JWrs1.js} +0 -0
- /package/dist/assets/{link-2-D2duleaP.js → link-2-4bMylQ5v.js} +0 -0
- /package/dist/assets/{llm-dimension-DPW4F-C9.js → llm-dimension-Bu_nHMF_.js} +0 -0
- /package/dist/assets/{loader-circle-CZg4IeLX.js → loader-circle-Cz7opInR.js} +0 -0
- /package/dist/assets/{log-in-zraK7tuA.js → log-in--aqELu3z.js} +0 -0
- /package/dist/assets/{minimize-2---agFY0e.js → minimize-2-Clnet2W7.js} +0 -0
- /package/dist/assets/{misc-iHjpjkrj.js → misc-BYQPh7vS.js} +0 -0
- /package/dist/assets/{monitor-BgvM1j-w.js → monitor-DfbL8_59.js} +0 -0
- /package/dist/assets/{moon-C3KPR4Ji.js → moon-B8qiwjrW.js} +0 -0
- /package/dist/assets/{native-deep-link-BFK_dZZ-.js → native-deep-link-UuqLR0OS.js} +0 -0
- /package/dist/assets/{onboarding-step-layout-DHdyggwl.js → onboarding-step-layout-zvLUIT7j.js} +0 -0
- /package/dist/assets/{optimistic-lifecycle-DqPbwF6F.js → optimistic-lifecycle-DTggtDfs.js} +0 -0
- /package/dist/assets/{pdf-C5IZXnZA.js → pdf-CuY9CA7Q.js} +0 -0
- /package/dist/assets/{pencil-D6w7OUM0.js → pencil-CUIr0IFo.js} +0 -0
- /package/dist/assets/{plus-po0lndeA.js → plus-DItfr5ux.js} +0 -0
- /package/dist/assets/{pointer-DcD0Nt7Z.js → pointer-Cdz7NGHe.js} +0 -0
- /package/dist/assets/{prechat-BujHxEsG.js → prechat-fFejNVfD.js} +0 -0
- /package/dist/assets/{prechat-names-BsAZS60j.js → prechat-names-b5RkG_F-.js} +0 -0
- /package/dist/assets/{progress-bar-BAx6vw2A.js → progress-bar-Ca8gmE3B.js} +0 -0
- /package/dist/assets/{proxy-B6mdWM9d.js → proxy-BzlH_XAe.js} +0 -0
- /package/dist/assets/{public-asset-6C1dczxh.js → public-asset-Di3QykUd.js} +0 -0
- /package/dist/assets/{refresh-cw-BED4KeZb.js → refresh-cw-DevIHL7J.js} +0 -0
- /package/dist/assets/{repeat-C_Kgh2Bj.js → repeat-C8Im6j--.js} +0 -0
- /package/dist/assets/{save-DFYEZCVM.js → save-aD5JFIZf.js} +0 -0
- /package/dist/assets/{sdk.gen-8pCB8ehU.js → sdk.gen-BhtkuoSl.js} +0 -0
- /package/dist/assets/{semver-C3Wz2tqf.js → semver-CYH4dyFO.js} +0 -0
- /package/dist/assets/{shortcut-keys-PuWXob-k.js → shortcut-keys-B2EE-634.js} +0 -0
- /package/dist/assets/{skill-icon-Bhr_gEJj.js → skill-icon-CEEEqpSq.js} +0 -0
- /package/dist/assets/{sparkles-BDlMxv2t.js → sparkles-PGiR5v1g.js} +0 -0
- /package/dist/assets/{stat-square-DL5SwiL6.js → stat-square-BkLJTTVc.js} +0 -0
- /package/dist/assets/{status-badge-pill-Bwe3k-op.js → status-badge-pill-BopXdkRS.js} +0 -0
- /package/dist/assets/{step-indicator-dots-BIGnoPJI.js → step-indicator-dots-Cou0-IgA.js} +0 -0
- /package/dist/assets/{three-dot-indicator-Ddu91mbW.js → three-dot-indicator-BVtP8eei.js} +0 -0
- /package/dist/assets/{toggle-BILuLR9Q.js → toggle-CDfguvUz.js} +0 -0
- /package/dist/assets/{triangle-alert-CWcUNtIQ.js → triangle-alert-Z0Gq0IuB.js} +0 -0
- /package/dist/assets/{typed-storage-CI2HgqOD.js → typed-storage-B-Fr5EIb.js} +0 -0
- /package/dist/assets/{usage-window-BMNKgXqp.js → usage-window-Btqj3Jpn.js} +0 -0
- /package/dist/assets/{use-copy-to-clipboard-CwPMAqGY.js → use-copy-to-clipboard-tXJpCn2M.js} +0 -0
- /package/dist/assets/{user-plus-BpXrXR_g.js → user-plus-DMh4_UTz.js} +0 -0
- /package/dist/assets/{workflow-status-By634GqH.js → workflow-status-DmbjJPT4.js} +0 -0
- /package/dist/assets/{x-eOtMyHx5.js → x-CkSVp1Ok.js} +0 -0
- /package/dist/assets/{xterm-zhpFg6yf.js → xterm-D9pOJCAq.js} +0 -0
- /package/dist/assets/{xterm-addon-fit-DkQgzk1J.js → xterm-addon-fit-BTV6oL76.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./api-errors-
|
|
1
|
+
import{t as e}from"./api-errors-D2CsZ6Xx.js";var t=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,n=globalThis,r=`10.52.0`;function i(){return a(n),n}function a(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.52.0`,t[r]=t[`10.52.0`]||{}}function o(e,t,i=n){let a=i.__SENTRY__=i.__SENTRY__||{},o=a[r]=a[`10.52.0`]||{};return o[e]||(o[e]=t())}var s=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],c=`Sentry Logger `,l={};function u(e){if(!(`console`in n))return e();let t=n.console,r={},i=Object.keys(l);i.forEach(e=>{let n=l[e];r[e]=t[e],t[e]=n});try{return e()}finally{i.forEach(e=>{t[e]=r[e]})}}function d(){ne().enabled=!0}function f(){ne().enabled=!1}function p(){return ne().enabled}function m(...e){te(`log`,...e)}function h(...e){te(`warn`,...e)}function ee(...e){te(`error`,...e)}function te(e,...r){t&&p()&&u(()=>{n.console[e](`${c}[${e}]:`,...r)})}function ne(){return t?o(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var g={enable:d,disable:f,isEnabled:p,log:m,warn:h,error:ee},re=50,ie=/\(error: (.*)\)/,ae=/captureMessage|captureException/;function oe(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
|
|
2
2
|
`);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=ie.test(n)?n.replace(ie,`$1`):n;if(!o.includes(`Error: `)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=re+r)break}}return ce(i.slice(r))}}function se(e){return Array.isArray(e)?oe(...e):e}function ce(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(_(t).function||``)&&t.pop(),t.reverse(),ae.test(_(t).function||``)&&(t.pop(),ae.test(_(t).function||``)&&t.pop()),t.slice(0,re).map(e=>({...e,filename:e.filename||_(t).filename,function:e.function||`?`}))}function _(e){return e[e.length-1]||{}}var le=`<anonymous>`;function ue(e){try{return!e||typeof e!=`function`?le:e.name||le}catch{return le}}function de(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function fe(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var pe=Object.prototype.toString;function me(e){switch(pe.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return x(e,Error)}}function v(e,t){return pe.call(e)===`[object ${t}]`}function he(e){return v(e,`ErrorEvent`)}function ge(e){return v(e,`DOMError`)}function _e(e){return v(e,`DOMException`)}function y(e){return v(e,`String`)}function ve(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function ye(e){return e===null||ve(e)||typeof e!=`object`&&typeof e!=`function`}function be(e){return v(e,`Object`)}function xe(e){return typeof Event<`u`&&x(e,Event)}function Se(e){return typeof Element<`u`&&x(e,Element)}function Ce(e){return v(e,`RegExp`)}function b(e){return!!(e?.then&&typeof e.then==`function`)}function we(e){return be(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function x(e,t){try{return e instanceof t}catch{return!1}}function Te(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function Ee(e){return typeof Request<`u`&&x(e,Request)}var De=n,Oe=80;function ke(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Oe;for(;n&&i++<5&&(o=Ae(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function Ae(e,t){let n=e,r=[];if(!n?.tagName)return``;if(De.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&y(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function je(){try{return De.document.location.href}catch{return``}}function Me(e,t=5){if(!De.HTMLElement)return null;let n=e;for(let e=0;e<t;e++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Ne(e,n,r){if(!(n in e))return;let i=e[n];if(typeof i!=`function`)return;let a=r(i);typeof a==`function`&&Pe(a,i);try{e[n]=a}catch{t&&g.log(`Failed to replace method "${n}" in object`,e)}}function S(e,n,r){try{Object.defineProperty(e,n,{value:r,writable:!0,configurable:!0})}catch{t&&g.log(`Failed to add non-enumerable property "${String(n)}" to object`,e)}}function Pe(e,t){try{e.prototype=t.prototype=t.prototype||{},S(e,`__sentry_original__`,t)}catch{}}function Fe(e){return e.__sentry_original__}function Ie(e){if(me(e))return{message:e.message,name:e.name,stack:e.stack,...Re(e)};if(xe(e)){let t={type:e.type,target:Le(e.target),currentTarget:Le(e.currentTarget),...Re(e)};return typeof CustomEvent<`u`&&x(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Le(e){try{return Se(e)?ke(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Re(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function ze(e){let t=Object.keys(Ie(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var C;function w(e){if(C!==void 0)return C?C(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),r=n;return t in r&&typeof r[t]==`function`?(C=r[t],C(e)):(C=null,e())}function T(){return w(()=>Math.random())}function Be(){return w(()=>Date.now())}function Ve(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function He(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Te(r)?n.push(fe(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function E(e,t,n=!1){return y(e)?Ce(t)?t.test(e):y(t)?n?e===t:e.includes(t):typeof t==`function`?t(e):!1:!1}function Ue(e,t=[],n=!1){return t.some(t=>E(e,t,n))}function We(){let e=n;return e.crypto||e.msCrypto}var Ge;function Ke(){return T()*16}function D(e=We()){try{if(e?.randomUUID)return w(()=>e.randomUUID()).replace(/-/g,``)}catch{}return Ge||=`10000000100040008000100000000000`,Ge.replace(/[018]/g,e=>(e^(Ke()&15)>>e/4).toString(16))}function qe(e){return e.exception?.values?.[0]}function Je(e){let{message:t,event_id:n}=e;if(t)return t;let r=qe(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Ye(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function Xe(e,t){let n=qe(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function Ze(e){if(Qe(e))return!0;try{S(e,`__sentry_captured__`,!0)}catch{}return!1}function Qe(e){try{return e.__sentry_captured__}catch{}}var $e=1e3;function O(){return Be()/$e}function et(){let{performance:e}=n;if(!e?.now||!e.timeOrigin)return O;let t=e.timeOrigin;return()=>(t+w(()=>e.now()))/$e}var tt;function k(){return(tt??=et())()}function nt(e){let t=k(),n={sid:D(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>it(n)};return e&&A(n,e),n}function A(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||k(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:D()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function rt(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),A(e,n)}function it(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function j(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=j(r[e],t[e],n-1));return r}function M(){return D()}function at(){return D().substring(16)}var ot=`_sentrySpan`;function st(e,t){t?S(e,ot,t):delete e[ot]}function ct(e){return e[ot]}var lt=100,N=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:M(),sampleRand:T()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,st(t,ct(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&A(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():be(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,st(this,void 0),this._attachments=[],this.setPropagationContext({traceId:M(),sampleRand:T()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:lt;if(n<=0)return this;let r={timestamp:O(),...e,message:e.message?Ve(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ct(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=j(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||D();if(!this._client)return t&&g.warn(`No client configured on scope - will not capture exception!`),r;let i=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureMessage(e,n,r){let i=r?.event_id||D();if(!this._client)return t&&g.warn(`No client configured on scope - will not capture message!`),i;let a=r?.syntheticException??Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:a,...r,event_id:i},this),i}captureEvent(e,n){let r=e.event_id||n?.event_id||D();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(t&&g.warn(`No client configured on scope - will not capture event!`),r)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function ut(){return o(`defaultCurrentScope`,()=>new N)}function dt(){return o(`defaultIsolationScope`,()=>new N)}var ft=e=>e instanceof Promise&&!e[pt],pt=Symbol(`chained PromiseLike`),mt=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return ft(r)&&ft(e)?r:ht(e,r)},ht=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[pt]:!0}),t},gt=class{constructor(e,t){let n;n=e||new N;let r;r=t||new N,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return b(n)?mt(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function P(){let e=a(i());return e.stack=e.stack||new gt(ut(),dt())}function _t(e){return P().withScope(e)}function vt(e,t){let n=P();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function yt(e){return P().withScope(()=>e(P().getIsolationScope()))}function bt(){return{withIsolationScope:yt,withScope:_t,withSetScope:vt,withSetIsolationScope:(e,t)=>yt(t),getCurrentScope:()=>P().getScope(),getIsolationScope:()=>P().getIsolationScope()}}function F(e){let t=a(e);return t.acs?t.acs:bt()}var xt;function St(){return xt?.()}function I(){return F(i()).getCurrentScope()}function L(){return F(i()).getIsolationScope()}function Ct(){return o(`globalScope`,()=>new N)}function wt(...e){let t=F(i());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function R(){return I().getClient()}function Tt(e){let t=St();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||at()};return r&&(a.parent_span_id=r),a}var Et=`sentry.source`,Dt=`sentry.sample_rate`,Ot=`sentry.op`,kt=`sentry.origin`,At=`sentry.measurement_unit`,jt=`sentry.measurement_value`,Mt=`sentry.custom_span_name`,Nt=`sentry.profile_id`,Pt=`sentry.exclusive_time`,Ft=`gen_ai.conversation.id`;function It(e){try{let t=n.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function Lt(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}var Rt=`_sentryScope`,zt=`_sentryIsolationScope`;function Bt(e,t,n){e&&(S(e,zt,It(n)),S(e,Rt,t))}function z(e){let t=e;return{scope:t[Rt],isolationScope:Lt(t[zt])}}function Vt(e){let t=Ht(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function Ht(e){if(!(!e||!y(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=Ut(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):Ut(e)}function Ut(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}var Wt=/^o(\d+)\./,Gt=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Kt(e){return e===`http`||e===`https`}function B(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function qt(e){let t=Gt.exec(e);if(!t){u(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,d=l.split(`/`);if(d.length>1&&(c=d.slice(0,-1).join(`/`),l=d.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return Jt({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Jt(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function Yt(e){if(!t)return!0;let{port:n,projectId:r,protocol:i}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(g.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:r.match(/^\d+$/)?Kt(i)?n&&isNaN(parseInt(n,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${n}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function Xt(e){return e.match(Wt)?.[1]}function Zt(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Xt(n)),r}function Qt(e){let t=typeof e==`string`?qt(e):Jt(e);if(!(!t||!Yt(t)))return t}function $t(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var en=!1;function tn(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=H(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function nn(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:H(e).parent_span_id,a=z(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||at():t,trace_id:n}}function rn(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function an(e){if(e?.length)return e.map(({context:{spanId:e,traceId:t,traceFlags:n},attributes:r})=>({span_id:e,trace_id:t,sampled:n===1,attributes:r}))}function V(e){return typeof e==`number`?on(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?on(e.getTime()):k()}function on(e){return e>9999999999?e/1e3:e}function H(e){if(ln(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(cn(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:sn(e),start_timestamp:V(i),timestamp:V(o)||void 0,status:un(s),op:r[Ot],origin:r[kt],links:rn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function sn(e){return`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0}function cn(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function ln(e){return typeof e.getSpanJSON==`function`}function U(e){let{traceFlags:t}=e.spanContext();return t===1}function un(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}function dn(e){return!e||e.code===1||e.code===0||e.message===`cancelled`?`ok`:`error`}var W=`_sentryChildSpans`,fn=`_sentryRootSpan`;function pn(e,t){S(t,fn,e[fn]||e),e[W]?e[W].add(t):S(e,W,new Set([t]))}function mn(e){let t=new Set;function n(e){if(!t.has(e)&&U(e)){t.add(e);let r=e[W]?Array.from(e[W]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}var G=hn;function hn(e){return e[fn]||e}function gn(){en||=(u(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}function _n(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||R()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function vn(e){g.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yn(e,n){if(!n?.length)return!1;for(let r of n){if(Sn(r)){if(e.description&&E(e.description,r))return t&&vn(e),!0;continue}let n=!!r.attributes&&Object.keys(r.attributes).length>0;if(!r.name&&!r.op&&!n)continue;let i=r.name?e.description&&E(e.description,r.name):!0,a=r.op?e.op&&E(e.op,r.op):!0,o=r.attributes?Object.entries(r.attributes).every(([t,n])=>bn(e.attributes?.[t],n)):!0;if(i&&a&&o)return t&&vn(e),!0}return!1}function bn(e,t){return typeof e==`string`&&(typeof t==`string`||t instanceof RegExp)?E(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}function xn(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function Sn(e){return typeof e==`string`||e instanceof RegExp}var Cn=`production`,wn=`_frozenDsc`;function Tn(e,t){S(e,wn,t)}function En(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:Zt(t)};return t.emit(`createDsc`,i),i}function Dn(e,t){let n=t.getPropagationContext();return n.dsc||En(n.traceId,e)}function K(e){let t=R();if(!t)return{};let n=G(e),r=H(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[wn];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&Vt(l);if(u)return s(u);let d=En(e.spanContext().traceId,t),f=i[`sentry.source`]??i[`sentry.span.source`],p=r.description;return f!==`url`&&p&&(d.transaction=p),_n()&&(d.sampled=String(U(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??z(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var q=class{constructor(e={}){this._traceId=e.traceId||M(),this._spanId=e.spanId||at(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function On(e){return!!e&&typeof e==`function`&&`_streamed`in e&&!!e._streamed}var kn=Symbol.for(`sentry.skipNormalization`),An=Symbol.for(`sentry.overrideNormalizationDepth`);function jn(e){return!!e[kn]}function Mn(e){let t=e[An];return typeof t==`number`?t:void 0}function J(e,t=100,n=1/0){try{return Pn(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Nn(e,t=3,n=100*1024){let r=J(e,t);return Rn(r)>n?Nn(e,t-1,n):r}function Pn(e,t,n=1/0,r=1/0,i=zn()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=Fn(e,t);if(!s.startsWith(`[object `))return s;if(jn(t))return t;let c=Mn(t),l=c===void 0?n:c;if(l===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let u=t;if(u&&typeof u.toJSON==`function`)try{return Pn(``,u.toJSON(),l-1,r,i)}catch{}let d=Array.isArray(t)?[]:{},f=0,p=Ie(t);for(let e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(f>=r){d[e]=`[MaxProperties ~]`;break}let t=p[e];d[e]=Pn(e,t,l-1,r,i),f++}return o(t),d}function Fn(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Te(t))return fe(t);if(we(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${ue(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=In(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function In(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function Ln(e){return~-encodeURI(e).split(/%..|./).length}function Rn(e){return Ln(JSON.stringify(e))}function zn(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function Y(e,t=[]){return[e,t]}function Bn(e,t){let[n,r]=e;return[n,[...r,t]]}function Vn(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function Hn(e,t){return Vn(e,(e,n)=>t.includes(n))}function Un(e){let t=a(n);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Wn(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Un(r),e]:r.push(typeof e==`string`?Un(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(J(n))}i(e)}}return typeof r==`string`?r:Gn(r)}function Gn(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function Kn(e){return[{type:`span`},e]}function qn(e){let t=typeof e.data==`string`?Un(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Jn={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function Yn(e){return e in Jn}function Xn(e){return Yn(e)?Jn[e]:e}function Zn(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Qn(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:B(r)},...i&&{trace:i}}}function $n(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function er(e,t,n,r){let i=Zn(n);return Y({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:B(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function tr(e,t,n,r){let i=Zn(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;$n(e,n?.sdk);let o=Qn(e,i,r,t);return delete e.sdkProcessingMetadata,Y(o,[[{type:a},e]])}function nr(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=K(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:B(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>{let t=H(e);return!yn({description:t.description,op:t.op,attributes:t.data},c)}):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=H(e);return(On(s)?t:s(t))||(gn(),t)}:H,f=[];for(let e of l){let t=d(e);t&&f.push(Kn(t))}return Y(o,f)}function rr(e){if(!t)return;let{description:n=`< unknown name >`,op:r=`< unknown op >`,parent_span_id:i}=H(e),{spanId:a}=e.spanContext(),o=U(e),s=G(e),c=s===e,l=`[Tracing] Starting ${o?`sampled`:`unsampled`} ${c?`root `:``}span`,u=[`op: ${r}`,`name: ${n}`,`ID: ${a}`];if(i&&u.push(`parent ID: ${i}`),!c){let{op:e,description:t}=H(s);u.push(`root ID: ${s.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}g.log(`${l}
|
|
3
3
|
${u.join(`
|
|
4
4
|
`)}`)}function ir(e){if(!t)return;let{description:n=`< unknown name >`,op:r=`< unknown op >`}=H(e),{spanId:i}=e.spanContext(),a=`[Tracing] Finishing "${r}" ${G(e)===e?`root `:``}span "${n}" with ID ${i}`;g.log(a)}function ar(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[At],i=n[jt];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}function X(e){return e.getOptions().traceLifecycle===`stream`}var or=1e3,sr=class{constructor(e={}){this._traceId=e.traceId||M(),this._spanId=e.spanId||at(),this._startTime=e.startTimestamp||k(),this._links=e.links,this._attributes={},this.setAttributes({[kt]:`manual`,[Ot]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=V(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Et,`custom`),this}end(e){this._endTime||(this._endTime=V(e),ir(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ot],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:un(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[kt],profile_id:this._attributes[Nt],exclusive_time:this._attributes[Pt],measurements:ar(this._events),is_segment:this._isStandaloneSpan&&G(this)===this||void 0,segment_id:this._isStandaloneSpan?G(this).spanContext().spanId:void 0,links:rn(this._links)}}getStreamedSpanJSON(){return{name:this._name??``,span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===G(this),status:dn(this._status),attributes:this._attributes,links:an(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){t&&g.log(`[Tracing] Adding an event to span:`,e);let i=cr(n)?n:r||k(),a=cr(n)?{}:n||{},o={name:e,time:V(i),attributes:a};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=R();if(e&&(e.emit(`spanEnd`,this),this._isStandaloneSpan||e.emit(`afterSpanEnd`,this)),!(this._isStandaloneSpan||this===G(this)))return;if(this._isStandaloneSpan){this._sampled?dr(nr([this],e)):(t&&g.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}else if(e&&X(e)){e.emit(`afterSegmentSpanEnd`,this);return}let n=this._convertSpanToTransaction();n&&(z(this).scope||I()).captureEvent(n)}_convertSpanToTransaction(){if(!lr(H(this)))return;this._name||=(t&&g.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:n}=z(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=mn(this).filter(e=>e!==this&&!ur(e)).map(e=>H(e)).filter(lr),a=this._attributes[Et];delete this._attributes[Mt],i.forEach(e=>{delete e.data[Mt]});let o={contexts:{trace:tn(this)},spans:i.length>or?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,or):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:K(this)},request:r,...a&&{transaction_info:{source:a}}},s=ar(this._events);return s&&Object.keys(s).length&&(t&&g.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(s,void 0,2)),o.measurements=s),o}};function cr(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function lr(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function ur(e){return e instanceof sr&&e.isStandaloneSpan()}function dr(e){let t=R();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function fr(e,n,r){if(!_n(e))return[!1];let i,a;typeof e.tracesSampler==`function`?(a=e.tracesSampler({...n,inheritOrSampleWith:e=>typeof n.parentSampleRate==`number`?n.parentSampleRate:typeof n.parentSampled==`boolean`?Number(n.parentSampled):e}),i=!0):n.parentSampled===void 0?e.tracesSampleRate!==void 0&&(a=e.tracesSampleRate,i=!0):a=n.parentSampled;let o=$t(a);if(o===void 0)return t&&g.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(a)} of type ${JSON.stringify(typeof a)}.`),[!1];if(!o)return t&&g.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,o,i];let s=r<o;return s||t&&g.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(a)})`),[s,o,i]}var pr=`__SENTRY_SUPPRESS_TRACING__`;function mr(e){let t=vr();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=_r(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>wt(e.scope,t):i===void 0?e=>e():e=>hr(i,e))(()=>{let t=I(),a=xr(t,i),o=R();return e.onlyIfParent&&!a?(o?.recordDroppedEvent(`no_parent_span`,`span`),new q):gr({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function hr(e,t){let n=vr();return n.withActiveSpan?n.withActiveSpan(e,t):wt(n=>(st(n,e||void 0),t(n)))}function gr({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!_n()){let r=new q;return(n||!e)&&Tn(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...K(r)}),r}let i=R();if(Sr(i,t))return Cr(r)||i?.recordDroppedEvent(`ignored`,`span`),new q({dropReason:`ignored`,traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});let a=L(),o;if(e&&!n)o=br(e,r,t),pn(e,o);else if(e){let n=K(e),{traceId:i,spanId:a}=e.spanContext(),s=U(e);o=yr({traceId:i,parentSpanId:a,...t},r,s),Tn(o,n)}else{let{traceId:e,dsc:n,parentSpanId:i,sampled:s}={...a.getPropagationContext(),...r.getPropagationContext()};o=yr({traceId:e,parentSpanId:i,...t},r,s),n&&Tn(o,n)}return rr(o),Bt(o,r,a),o}function _r(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=V(e.startTime),delete n.startTime,n}return t}function vr(){return F(i())}function yr(e,n,r){let i=R(),a=i?.getOptions()||{},{name:o=``}=e,s={spanAttributes:{...e.attributes},spanName:o,parentSampled:r};i?.emit(`beforeSampling`,s,{decision:!1});let c=s.parentSampled??r,l=s.spanAttributes,u=n.getPropagationContext(),d=Cr(n),[f,p,m]=d?[!1]:fr(a,{name:o,parentSampled:c,attributes:l,parentSampleRate:$t(u.dsc?.sample_rate)},u.sampleRand),h=new sr({...e,attributes:{[Et]:`custom`,[Dt]:p!==void 0&&m?p:void 0,...l},sampled:f});return!f&&i&&!d&&(t&&g.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),i.recordDroppedEvent(`sample_rate`,X(i)?`span`:`transaction`)),i&&i.emit(`spanStart`,h),h}function br(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=Cr(t),o=a?!1:U(e),s=o?new sr({...n,parentSpanId:r,traceId:i,sampled:o}):new q({traceId:i});pn(e,s);let c=R();return c?(X(c)&&s instanceof q&&(e instanceof q&&e.dropReason?(s.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,`span`)):a||(s.dropReason=`sample_rate`,c.recordDroppedEvent(`sample_rate`,`span`))),c.emit(`spanStart`,s),n.endTimestamp&&(c.emit(`spanEnd`,s),c.emit(`afterSpanEnd`,s)),s):s}function xr(e,t){if(t)return t;if(t===null)return;let n=ct(e);if(!n)return;let r=R();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?G(n):n}function Sr(e,t){let n=e?.getOptions().ignoreSpans;return!e||!X(e)||!n?.length?!1:yn({description:t.name||``,op:t.attributes?.[`sentry.op`]||t.op,attributes:t.attributes},n)}function Cr(e){return e.getScopeData().sdkProcessingMetadata[pr]===!0}function wr(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Dr(e,t),r&&Ar(e,r),jr(e,n),Or(e,i),kr(e,a)}function Tr(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Z(e,`extra`,n),Z(e,`tags`,r),Z(e,`attributes`,i),Z(e,`user`,a),Z(e,`contexts`,o),e.sdkProcessingMetadata=j(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Z(e,t,n){e[t]=j(e[t],n,1)}function Er(e,t){let n=Ct().getScopeData();return e&&Tr(n,e.getScopeData()),t&&Tr(n,t.getScopeData()),n}function Dr(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Or(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function kr(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ar(e,t){e.contexts={trace:nn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:K(t),...e.sdkProcessingMetadata};let n=H(G(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function jr(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var Mr=0,Nr=1,Pr=2;function Fr(e){return new Lr(t=>{t(e)})}function Ir(e){return new Lr((t,n)=>{n(e)})}var Lr=class e{constructor(e){this._state=Mr,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===Mr)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===Nr&&e[1](this._value),this._state===Pr&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===Mr){if(b(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(Nr,e)},r=e=>{t(Pr,e)};try{e(n,r)}catch(e){r(e)}}};function Rr(e,t,n,r=0){try{let i=zr(t,n,e,r);return b(i)?i:Fr(i)}catch(e){return Ir(e)}}function zr(e,n,r,i){let a=r[i];if(!e||!a)return e;let o=a({...e},n);return t&&o===null&&g.log(`Event processor "${a.id||`?`}" dropped event`),b(o)?o.then(e=>zr(e,n,r,i+1)):zr(o,n,r,i+1)}var Q,Br,Vr,$;function Hr(e){let t=n._sentryDebugIds,r=n._debugIds;if(!t&&!r)return{};let i=t?Object.keys(t):[],a=r?Object.keys(r):[];if($&&i.length===Br&&a.length===Vr)return $;Br=i.length,Vr=a.length,$={},Q||={};let o=(t,n)=>{for(let r of t){let t=n[r],i=Q?.[r];if(i&&$&&t)$[i[0]]=t,Q&&(Q[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&$&&Q){$[i]=t,Q[r]=[i,t];break}}}}};return t&&o(i,t),r&&o(a,r),$}function Ur(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||D(),timestamp:t.timestamp||O()},l=n.integrations||e.integrations.map(e=>e.name);Wr(c,e),qr(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Gr(c,e.stackParser);let u=Yr(r,n.captureContext);n.mechanism&&Xe(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Er(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),wr(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Fr(c):Rr(m,c,n)).then(e=>(e&&Kr(e),typeof o==`number`&&o>0?Jr(e,o,s):e))}function Wr(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=Ve(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=Ve(e.value,a)})}function Gr(e,t){let n=Hr(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Kr(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function qr(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Jr(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:J(e.data,t,n)}}))},...e.user&&{user:J(e.user,t,n)},...e.contexts&&{contexts:J(e.contexts,t,n)},...e.extra&&{extra:J(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=J(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:J(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=J(e.contexts.flags,3,n)),r}function Yr(e,t){if(!t)return e;let n=e?e.clone():new N;return n.update(t),n}function Xr(e){if(e)return Zr(e)||$r(e)?{captureContext:e}:e}function Zr(e){return e instanceof N||typeof e==`function`}var Qr=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function $r(e){return Object.keys(e).some(e=>Qr.includes(e))}function ei(e,t){return I().captureException(e,Xr(t))}function ti(e,t){let n=typeof t==`string`?t:void 0,r=typeof t==`string`?void 0:{captureContext:t};return I().captureMessage(e,n,r)}function ni(e,t){return I().captureEvent(e,t)}function ri(e,t){L().setContext(e,t)}function ii(){return L().lastEventId()}function ai(e){let t=L(),{user:r}=Er(t,I()),{userAgent:i}=n.navigator||{},a=nt({user:r,...i&&{userAgent:i},...e}),o=t.getSession();return o?.status===`ok`&&A(o,{status:`exited`}),oi(),t.setSession(a),a}function oi(){let e=L(),t=I().getSession()||e.getSession();t&&rt(t),si(),e.setSession()}function si(){let e=L(),t=R(),n=e.getSession();n&&t&&t.captureSession(n)}function ci(e=!1){if(e){oi();return}si()}var li=3;function ui(t){return t instanceof e?!!(t.status===503||t.status===502||t.status===401||t.status===400&&t.message.includes(`Organization-Id header`)):!1}function di(e,t){return e>=li?!1:ui(t)}function fi(e){if(!(e instanceof TypeError))return!1;let t=e.message;return!!(t===`Failed to fetch`||t.startsWith(`Failed to fetch (`)&&t.endsWith(`)`)||t===`Load failed`||t.startsWith(`Load failed (`)&&t.endsWith(`)`)||t===`NetworkError when attempting to fetch resource`||t===`NetworkError when attempting to fetch resource.`)}function pi(e){if(e instanceof Error)return e;if(typeof e==`object`&&e){let t=e,n=t.detail;if(typeof n==`string`){let t=Error(n);return t.cause=e,t}let r=t.message;if(typeof r==`string`){let t=Error(r);return t.cause=e,t}try{let t=Error(JSON.stringify(e));return t.cause=e,t}catch{let t=Error(`Non-serializable error object`);return t.cause=e,t}}return Error(String(e))}function mi(e,t){if(fi(e)||t.bestEffort&&ui(e))return;console.error(`[${t.context}]`,e);let n=pi(e),r={...t.extra};n!==e&&(r.originalError=e),ei(n,{level:t.level,tags:{context:t.context,...t.tags},...Object.keys(r).length>0?{extra:r}:{}})}export{D as $,yn as A,g as At,I as B,Wn as C,b as Ct,Dn as D,se as Dt,On as E,ue as Et,Qt as F,n as Ft,j as G,L as H,Ft as I,t as It,k as J,A as K,Pt as L,H as M,o as Mt,$t as N,i as Nt,Cn as O,s as Ot,B as P,r as Pt,Je as Q,Nt as R,Vn as S,y as St,Nn as T,de as Tt,Tt as U,Ct as V,wt as W,Ye as X,Xe as Y,Ze as Z,Bn as _,x as _t,ei as a,ze as at,Hn as b,ye as bt,ii as c,Pe as ct,Ur as d,ke as dt,He as et,Ir as f,ge as ft,er as g,xe as gt,tr as h,he as ht,ni as i,S as it,gn as j,l as jt,xn as k,u as kt,ri as l,Me as lt,mr as m,me as mt,fi as n,Be as nt,ti as o,Ne as ot,Fr as p,_e as pt,O as q,di as r,T as rt,ci as s,Fe as st,mi as t,Ue as tt,ai as u,je as ut,qn as v,ve as vt,J as w,oe as wt,Xn as x,Ee as xt,Y as y,be as yt,R as z};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./useMutation-Lj4VunQV.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./cn-C36Yvcac.js";import{t as d}from"./typography-D5f7kt80.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./chevron-down-CrCryYS_.js";import{t as m}from"./notice-DLzbYrbG.js";import{A as h,k as g,n as _,r as v}from"./src-CTfdzX7d.js";import{t as y}from"./tag-Fb8purwh.js";import{t as b}from"./input-DOcdV8Z3.js";import{t as x}from"./list-row-CfxAtdcm.js";import{n as S}from"./stat-square-DL5SwiL6.js";import{t as C}from"./panel-item-HxFPJuum.js";import{t as w}from"./confirm-dialog-CtTSa3H1.js";import{t as T}from"./dropdown-N_bjXYQD.js";import{n as E,t as D}from"./create-selectors-BMFBr-tH.js";import{c as O}from"./routes-Dzu6VaCS.js";import{n as k}from"./utils-CaL2xuop.js";import{t as A}from"./assistant-identity-store-C-r2pCdE.js";import{i as j,o as M,r as N}from"./sdk.gen-8pCB8ehU.js";import{t as P}from"./assistant-feature-flag-store-CJuCq9wC.js";import{t as F}from"./public-asset-6C1dczxh.js";import{At as I,Ca as L,Oi as ee,b as te,hr as ne,l as re,nr as ie,on as R,qi as ae,ra as z,sn as B,tr as oe,u as se,v as ce,y as V}from"./index-I1w8ACGD.js";import{t as le}from"./use-active-assistant-id-CwnoJiIp.js";import{a as ue,c as de,i as fe,l as pe,n as me,s as he,t as ge,u as H}from"./use-invite-link-dialog-B22AjjvD.js";import{t as _e}from"./detail-card-Dx3HEsGW.js";import{n as ve,t as ye}from"./mobile-sidebar-drawer-D4Fmo4ih.js";import{t as U}from"./mutation-error-BBm-OuDT.js";var W=e(t(),1),G=l();function K({icon:e,title:t,description:n,action:r,className:i}){return(0,G.jsxs)(`div`,{className:u(`flex flex-col items-center justify-center gap-3 px-4 py-12 text-center`,i),children:[e?(0,G.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl bg-[var(--surface-sunken)] text-[var(--content-tertiary)]`,children:e}):null,(0,G.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:t}),n?(0,G.jsx)(`p`,{className:`max-w-md text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:n}):null,r?(0,G.jsx)(`div`,{className:`mt-1`,children:r}):null]})}var q=D(E()(e=>({selectedAdapter:`slack`,selectAdapter:t=>e({selectedAdapter:t})})));function J({channels:e,selectedKey:t,onSelect:n}){return(0,G.jsx)(f.Root,{className:`flex h-full flex-col overflow-hidden`,children:(0,G.jsxs)(f.Body,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:`Channels`}),(0,G.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,G.jsx)(be,{channel:e,selected:e.key===t,onClick:()=>n(e.key)},e.key))})]})})}function be({channel:e,selected:t,onClick:n}){let r=e.status===`ready`,i=B(e.key),a=r?`Connected`:`Not connected`;return(0,G.jsx)(C,{asChild:!0,active:t,label:`${i}, ${a}`,children:(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-auto w-full items-center gap-2 rounded-[6px] px-[8px] py-2 text-left`,children:[(0,G.jsx)(R,{channelId:e.key,className:`h-4 w-4 shrink-0 text-[color:var(--content-secondary)]`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default`,children:i}),(0,G.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,G.jsx)(y,{tone:r?`positive`:`neutral`,children:a})})]})})}function xe({children:e}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`img`,{src:F(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,children:`Slack setup`})]})}),(0,G.jsx)(f.Body,{children:e})]})}var Y=ce.map(e=>e.riskThreshold),X={none:{label:V(`none`).label,sublabel:`ask before every action`,tone:`negative`},low:{label:V(`low`).label,sublabel:`low-risk actions, ask for the rest`,tone:`warning`},medium:{label:V(`medium`).label,sublabel:`beyond its workspace too`,tone:`info`},high:{label:V(`high`).label,sublabel:`acts freely`,tone:`positive`}},Z=[`trusted_contact`,`unverified_contact`,`unknown`];function Se(e,t){let n={};for(let r of e){if(r.selector.scope!==`channel`||r.selector.adapter!==t)continue;let e=r.selector.channelExternalId;e&&(r.contactType===`trusted_contact`||!(e in n))&&(n[e]=r.threshold)}return n}function Ce(e){return{tier:e??null,overridden:e!==void 0}}function we({channelName:e,settings:t,defaultTier:r,loading:i=!1,error:a=!1,onTierChange:o,onReset:s}){let c=i||a,l=Y.map(e=>({value:e,label:X[e].label,sublabel:X[e].sublabel,disabled:c}));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-2 pt-1 pb-4`,children:[t.overridden?(0,G.jsx)(m,{tone:`warning`,title:`Custom access.`,className:`border-dashed`,actions:(0,G.jsx)(n,{type:`button`,variant:`outlined`,onClick:s,disabled:c,children:`Reset to default`}),children:`This channel isn’t following your global Assistant Access setting.`}):null,(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:`Assistant Access`}),i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):a?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load — try reopening this page`}):t.overridden?(0,G.jsx)(y,{tone:`warning`,children:`overridden`}):(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`default`})]}),(0,G.jsx)(S,{items:l,value:t.tier??r,onChange:o,ariaLabel:`Assistant Access in ${e}`})]})}var Te={positive:`var(--system-positive-strong)`,negative:`var(--system-negative-strong)`,warning:`var(--system-mid-strong)`,info:`var(--system-info-strong)`,neutral:`var(--content-secondary)`};function Ee(e,t){switch(e){case`none`:return(0,G.jsxs)(G.Fragment,{children:[t,` replies in this channel, but asks you before taking any action.`]});case`low`:return(0,G.jsxs)(G.Fragment,{children:[t,` replies and runs safe, read-only actions on its own, like web searches and reading files in its workspace. Anything that writes, sends, or spends asks you first.`]});case`medium`:return(0,G.jsxs)(G.Fragment,{children:[t,` also handles medium-risk requests on its own, like network requests that use your connected accounts. Anything that writes, sends, or spends still asks you first.`]});case`high`:return(0,G.jsxs)(G.Fragment,{children:[t,` answers any request on its own without asking. Tools that take action — writing, sending, spending — still come to you first.`]})}}function De({assistantName:e}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:`Assistant Access levels`}),(0,G.jsx)(f.Body,{className:`grid gap-4 sm:grid-cols-2`,children:Y.map(t=>{let n=X[t];return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 rounded-full`,style:{backgroundColor:Te[n.tone]}}),(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,children:n.label})]}),(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:Ee(t,e)})]},t)})}),(0,G.jsx)(f.Footer,{children:(0,G.jsxs)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:[`Your`,` `,(0,G.jsx)(a,{to:O.settings.privacy,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`Trust Rules`}),` `,`fine-tune these levels: a rule raises or lowers how risky a specific action is treated, which changes when it asks first.`]})})]})}function Q(e){return e.type===`dm`?`dm`:e.isPrivate?`private`:`public`}function Oe(e){return e.filter(e=>Q(e)!==`dm`)}function ke(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>(n===null||Q(e)===n)&&(r===``||e.name.toLowerCase().includes(r))).sort((e,t)=>e.name.localeCompare(t.name))}function Ae(e){let t={public:0,private:0,dm:0};for(let n of e)t[Q(n)]+=1;return t}function je(e){return e.memberCount==null?null:e.memberCount===1?`1 member`:`${e.memberCount} members`}var Me=[{value:null,label:`All`},{value:`public`,label:`Public`},{value:`private`,label:`Private`}],Ne={public:z,private:ae},Pe=100,Fe=new Set;function Ie({assistantDisplayName:e,slackHandle:t,channels:r,loading:i=!1,error:a=!1,tierOverrides:o,defaultTier:s=null,accessControlsSupported:c=!0,tierOverridesLoading:l=!1,tierOverridesError:p=!1,pendingChannelIds:m=Fe,onTierChange:h,onTierReset:g}){let[y,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(new Set),[E,D]=(0,W.useState)(!1),O=e=>{T(t=>{if(E){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}return t.has(e)?new Set:new Set([e])})},k=()=>{E?(D(!1),T(new Set)):(D(!0),T(new Set(A.map(e=>e.id))))},A=(0,W.useMemo)(()=>Oe(r??[]),[r]),j=(0,W.useMemo)(()=>ke(A,y,S),[A,y,S]),M=(0,W.useMemo)(()=>Ae(A),[A]),N=t??`@${e}`,P=(0,G.jsxs)(G.Fragment,{children:[`To add `,e,` to a channel, type`,` `,(0,G.jsxs)(`code`,{className:`text-[color:var(--content-secondary)]`,children:[`/invite `,N]}),` `,`inside that Slack channel.`]});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[`Where `,e,` is present`,(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:P})]})}),(0,G.jsx)(f.Body,{className:`flex flex-col gap-3`,children:i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):a?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load channels. Try reopening this page.`}):A.length===0?(0,G.jsx)(K,{icon:(0,G.jsx)(z,{className:`h-6 w-6`}),title:`No channels yet`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,G.jsx)(b,{type:`search`,value:y,onChange:e=>x(e.target.value),placeholder:`Search channels`,"aria-label":`Search channels`,leftIcon:(0,G.jsx)(ee,{className:`h-4 w-4`}),fullWidth:!0})}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,role:`group`,"aria-label":`Filter channels by type`,children:Me.map(({value:e,label:t})=>{let n=S===e,r=e===null?A.length:M[e];return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:()=>C(e),className:u(`inline-flex h-6 items-center rounded-full px-2.5 text-body-small-emphasised leading-none transition-colors`,n?`bg-[var(--content-default)] text-[var(--surface-base)]`:`bg-[var(--tag-bg-neutral)] text-[color:var(--content-secondary)] hover:text-[color:var(--content-default)]`),children:[t,` `,r]},e??`all`)})}),(0,G.jsx)(n,{type:`button`,variant:`outlined`,onClick:k,children:E?`Collapse all`:`Expand all`})]}),j.length===0?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`py-4 text-center text-[color:var(--content-tertiary)]`,children:`No channels match.`}):(0,G.jsx)(_.Root,{type:`multiple`,value:[...w],children:j.length>Pe?(0,G.jsx)(`div`,{className:`h-96`,children:(0,G.jsx)(v,{items:j,computeItemKey:(e,t)=>t.id,itemContent:(e,t)=>(0,G.jsx)($,{channel:t,open:w.has(t.id),onToggle:()=>O(t.id),pending:m.has(t.id),overridesLoading:l,overridesError:p,defaultTier:s,accessControls:c,tierOverride:o?.[t.id],onTierChange:e=>h?.(t.id,e),onReset:()=>g?.(t.id)}),className:`h-full`})}):j.map(e=>(0,G.jsx)($,{channel:e,open:w.has(e.id),onToggle:()=>O(e.id),pending:m.has(e.id),overridesLoading:l,overridesError:p,defaultTier:s,accessControls:c,tierOverride:o?.[e.id],onTierChange:t=>h?.(e.id,t),onReset:()=>g?.(e.id)},e.id))})]})}),!i&&!a&&A.length>0?(0,G.jsx)(f.Footer,{children:(0,G.jsxs)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:[`Only showing channels `,e,` is in. To remove`,` `,e,` from a channel, use`,` `,(0,G.jsxs)(`code`,{className:`text-[color:var(--content-secondary)]`,children:[`/remove `,N]}),` `,`in that Slack channel.`]})}):null]}),c&&!i&&!a&&A.length>0?(0,G.jsx)(De,{assistantName:e}):null]})}function $({channel:e,open:t,pending:n,overridesLoading:r,overridesError:i,defaultTier:a,accessControls:o,tierOverride:s,onToggle:c,onTierChange:l,onReset:d}){let f=Q(e);if(f===`dm`)return null;let m=Ne[f],h=je(e),g=Ce(s),v=g.tier===null?null:X[g.tier],b=a===null?null:X[a];return o?(0,G.jsxs)(_.Item,{value:e.id,className:`[&+&]:border-t [&+&]:border-[var(--border-base)]`,children:[(0,G.jsx)(x,{leading:(0,G.jsx)(m,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),title:e.name,onClick:c,contentAriaLabel:`${e.name} — ${t?`collapse`:`expand`} channel settings`,showChevron:!1,selected:t,trailing:(0,G.jsxs)(G.Fragment,{children:[n?(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:`Saving…`}):h==null?null:(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:h}),v===null?(0,G.jsx)(y,{children:b===null?`Default`:`${b.label} • default`}):(0,G.jsxs)(y,{tone:v.tone,children:[v.label,` • custom`]}),(0,G.jsx)(p,{"aria-hidden":`true`,className:u(`h-4 w-4 text-[var(--content-tertiary)] transition-transform`,t&&`rotate-180`)})]})}),(0,G.jsx)(_.Content,{children:(0,G.jsx)(we,{channelName:e.name,settings:g,defaultTier:a,loading:r,error:i,onTierChange:l,onReset:d})})]}):(0,G.jsx)(x,{leading:(0,G.jsx)(m,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),title:e.name,trailing:h==null?void 0:(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:h})})}var Le=`0.10.7`;function Re(){return k(Le)}function ze(e,t,n){return Z.map(r=>({selector:{scope:`channel`,adapter:e,channelExternalId:t},contactType:r,threshold:n}))}function Be(e,t,n){return e.selector.scope===`channel`&&e.selector.adapter===t&&e.selector.channelExternalId===n}function Ve({assistantId:e,adapter:t}){let n=o(),r=P.use.channelTrustFloors(),i=Re(),a=r&&i&&!!e,l=(0,W.useMemo)(()=>({path:{assistant_id:e}}),[e]),u=(0,W.useMemo)(()=>ie(l),[l]),d=s({...oe(l),enabled:a,select:e=>Se(e.cells,t)}),f=s({queryKey:[`channel-permission-resolve`,e,t],queryFn:async()=>{let{data:e}=await M({...l,body:{adapter:t,contactType:`trusted_contact`},throwOnError:!0});return e.resolved?.threshold??null},enabled:a,retry:!1,staleTime:3e4}),p=(e,r)=>{let i=n.getQueryData(u),a=Date.now();return n.setQueryData(u,n=>({cells:[...(n?.cells??[]).filter(n=>!Be(n,t,e)),...r.map(e=>({...e,updatedAt:a}))]})),{previous:i}},m=c({mutationFn:async({channelExternalId:e,tier:n})=>{await Promise.all(ze(t,e,n).map(e=>j({...l,body:e,throwOnError:!0})))},onMutate:({channelExternalId:e,tier:n})=>p(e,ze(t,e,n)),onError:(e,t,r)=>{n.setQueryData(u,r?.previous),U(`Failed to save channel settings`)(e)},onSettled:()=>n.invalidateQueries({queryKey:u})}),h=c({mutationFn:async({channelExternalId:e})=>{await Promise.all(Z.map(n=>N({...l,body:{selector:{scope:`channel`,adapter:t,channelExternalId:e},contactType:n},throwOnError:!0})))},onMutate:({channelExternalId:e})=>p(e,[]),onError:(e,t,r)=>{n.setQueryData(u,r?.previous),U(`Failed to reset channel settings`)(e)},onSettled:()=>n.invalidateQueries({queryKey:u})}),g=(0,W.useMemo)(()=>{let e=new Set;return m.isPending&&m.variables&&e.add(m.variables.channelExternalId),h.isPending&&h.variables&&e.add(h.variables.channelExternalId),e},[m.isPending,m.variables,h.isPending,h.variables]);return a?{supported:!0,tierOverrides:d.data,defaultCellTier:f.data,pendingChannelIds:g,isLoading:d.isPending,isError:d.isError,onTierChange:(e,t)=>m.mutate({channelExternalId:e,tier:t}),onTierReset:e=>{d.data?.[e]!==void 0&&h.mutate({channelExternalId:e})}}:{supported:!1,tierOverrides:void 0,defaultCellTier:void 0,pendingChannelIds:new Set,isLoading:!1,isError:!1,onTierChange:void 0,onTierReset:void 0}}function He({assistantId:e,assistantDisplayName:t,slackHandle:n}){let r=s({...re(e),enabled:!!e,select:e=>e.channels}),i=Ve({assistantId:e,adapter:`slack`}),a=s({queryKey:[`thresholds`,e],queryFn:()=>te(e),enabled:i.supported&&!!e,staleTime:3e4}).data?.interactive??null,o=i.defaultCellTier===void 0?null:i.defaultCellTier??a;return(0,G.jsx)(Ie,{assistantDisplayName:t,slackHandle:n,accessControlsSupported:i.supported,defaultTier:o,channels:r.data,loading:r.isPending,error:r.isError,tierOverrides:i.tierOverrides,tierOverridesLoading:i.isLoading,tierOverridesError:i.isError,pendingChannelIds:i.pendingChannelIds,onTierChange:i.onTierChange,onTierReset:i.onTierReset})}function Ue({slackHandle:e,disconnectPending:t=!1,onDisconnect:r,children:i}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`img`,{src:F(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),e?(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,children:e}):null,(0,G.jsx)(y,{tone:`positive`,leftIcon:(0,G.jsx)(L,{}),children:`Connected`}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(n,{type:`button`,variant:`ghost`,onClick:r,disabled:!r||t,children:t?`Disconnecting…`:`Disconnect`})})]})}),(0,G.jsx)(f.Body,{children:i})]})}function We({threadMode:e,threadModePending:t=!1,onThreadModeChange:n}){return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:`Thread Behavior`}),(0,G.jsxs)(h,{value:e??`mention_then_thread`,onValueChange:e=>n?.(e),disabled:t||!n,"aria-label":`Slack thread behavior`,children:[(0,G.jsx)(g,{value:`mention_only`,label:`Mentions only`,helperText:`Bot only responds when @mentioned.`}),(0,G.jsx)(g,{value:`mention_then_thread`,label:`Follow threads after first mention`,helperText:`After an @mention in a thread, bot listens to all subsequent replies.`})]})]})}var Ge={no_one:{title:`Block all messages?`,message:`Setting this channel to “No one” hard-denies every inbound message — including messages from you.
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i,t as a}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as o}from"./QueryClientProvider-DKhXIxGb.js";import{t as s}from"./useQuery-B45lW1Kk.js";import{t as c}from"./useMutation-Lj4VunQV.js";import{t as l}from"./jsx-runtime-CVSDxk6A.js";import{t as u}from"./cn-C36Yvcac.js";import{t as d}from"./typography-D5f7kt80.js";import{t as f}from"./card-Bv5O5juh.js";import{t as p}from"./chevron-down-qD-re7AW.js";import{t as m}from"./notice-DkcNAP8O.js";import{A as h,k as g,n as _,r as v}from"./src-DQLGZRXb.js";import{t as y}from"./tag-Dawxigu4.js";import{t as b}from"./input-BF89Fan0.js";import{t as x}from"./list-row-gk--xRb0.js";import{n as S}from"./stat-square-BkLJTTVc.js";import{t as C}from"./panel-item-DvJGTiJi.js";import{t as w}from"./confirm-dialog-CK0EKPcs.js";import{t as T}from"./dropdown-31r8-Thq.js";import{n as E,t as D}from"./create-selectors-8NePGNlX.js";import{c as O}from"./routes-DT0Mj7fI.js";import{n as k}from"./utils-DIM1bg0R.js";import{t as A}from"./assistant-identity-store-D27sxUrj.js";import{i as j,o as M,r as N}from"./sdk.gen-BhtkuoSl.js";import{t as P}from"./assistant-feature-flag-store-B5K6-cBU.js";import{t as F}from"./public-asset-Di3QykUd.js";import{Ji as I,b as L,cn as R,d as ee,gr as te,ia as z,jt as ne,ki as re,l as ie,nr as ae,rr as oe,sn as B,wa as V,x as se,y as ce}from"./index-hP3p8VUv.js";import{t as le}from"./use-active-assistant-id-BNRMo_Mi.js";import{a as ue,c as de,i as fe,l as pe,n as me,s as he,t as ge,u as H}from"./use-invite-link-dialog-DlGJL527.js";import{t as _e}from"./detail-card-BtLydmm2.js";import{n as ve,t as ye}from"./mobile-sidebar-drawer-4x4mCC-9.js";import{t as U}from"./mutation-error-B7caUDmr.js";var W=e(t(),1),G=l();function K({icon:e,title:t,description:n,action:r,className:i}){return(0,G.jsxs)(`div`,{className:u(`flex flex-col items-center justify-center gap-3 px-4 py-12 text-center`,i),children:[e?(0,G.jsx)(`div`,{className:`flex h-12 w-12 items-center justify-center rounded-xl bg-[var(--surface-sunken)] text-[var(--content-tertiary)]`,children:e}):null,(0,G.jsx)(`h3`,{className:`text-title-small text-[var(--content-default)]`,children:t}),n?(0,G.jsx)(`p`,{className:`max-w-md text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:n}):null,r?(0,G.jsx)(`div`,{className:`mt-1`,children:r}):null]})}var q=D(E()(e=>({selectedAdapter:`slack`,selectAdapter:t=>e({selectedAdapter:t})})));function J({channels:e,selectedKey:t,onSelect:n}){return(0,G.jsx)(f.Root,{className:`flex h-full flex-col overflow-hidden`,children:(0,G.jsxs)(f.Body,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-4`,children:[(0,G.jsx)(`h2`,{className:`text-title-medium`,style:{color:`var(--content-default)`},children:`Channels`}),(0,G.jsx)(`div`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,G.jsx)(be,{channel:e,selected:e.key===t,onClick:()=>n(e.key)},e.key))})]})})}function be({channel:e,selected:t,onClick:n}){let r=e.status===`ready`,i=R(e.key),a=r?`Connected`:`Not connected`;return(0,G.jsx)(C,{asChild:!0,active:t,label:`${i}, ${a}`,children:(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-auto w-full items-center gap-2 rounded-[6px] px-[8px] py-2 text-left`,children:[(0,G.jsx)(B,{channelId:e.key,className:`h-4 w-4 shrink-0 text-[color:var(--content-secondary)]`}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-body-medium-default`,children:i}),(0,G.jsx)(`span`,{className:`flex shrink-0 items-center`,children:(0,G.jsx)(y,{tone:r?`positive`:`neutral`,children:a})})]})})}function xe({children:e}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`img`,{src:F(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,children:`Slack setup`})]})}),(0,G.jsx)(f.Body,{children:e})]})}var Y=ce.map(e=>e.riskThreshold),X={none:{label:L(`none`).label,sublabel:`ask before every action`,tone:`negative`},low:{label:L(`low`).label,sublabel:`low-risk actions, ask for the rest`,tone:`warning`},medium:{label:L(`medium`).label,sublabel:`beyond its workspace too`,tone:`info`},high:{label:L(`high`).label,sublabel:`acts freely`,tone:`positive`}},Z=[`trusted_contact`,`unverified_contact`,`unknown`];function Se(e,t){let n={};for(let r of e){if(r.selector.scope!==`channel`||r.selector.adapter!==t)continue;let e=r.selector.channelExternalId;e&&(r.contactType===`trusted_contact`||!(e in n))&&(n[e]=r.threshold)}return n}function Ce(e){return{tier:e??null,overridden:e!==void 0}}function we({channelName:e,settings:t,defaultTier:r,loading:i=!1,error:a=!1,onTierChange:o,onReset:s}){let c=i||a,l=Y.map(e=>({value:e,label:X[e].label,sublabel:X[e].sublabel,disabled:c}));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3 px-2 pt-1 pb-4`,children:[t.overridden?(0,G.jsx)(m,{tone:`warning`,title:`Custom access.`,className:`border-dashed`,actions:(0,G.jsx)(n,{type:`button`,variant:`outlined`,onClick:s,disabled:c,children:`Reset to default`}),children:`This channel isn’t following your global Assistant Access setting.`}):null,(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:`Assistant Access`}),i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):a?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load — try reopening this page`}):t.overridden?(0,G.jsx)(y,{tone:`warning`,children:`overridden`}):(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`default`})]}),(0,G.jsx)(S,{items:l,value:t.tier??r,onChange:o,ariaLabel:`Assistant Access in ${e}`})]})}var Te={positive:`var(--system-positive-strong)`,negative:`var(--system-negative-strong)`,warning:`var(--system-mid-strong)`,info:`var(--system-info-strong)`,neutral:`var(--content-secondary)`};function Ee(e,t){switch(e){case`none`:return(0,G.jsxs)(G.Fragment,{children:[t,` replies in this channel, but asks you before taking any action.`]});case`low`:return(0,G.jsxs)(G.Fragment,{children:[t,` replies and runs safe, read-only actions on its own, like web searches and reading files in its workspace. Anything that writes, sends, or spends asks you first.`]});case`medium`:return(0,G.jsxs)(G.Fragment,{children:[t,` also handles medium-risk requests on its own, like network requests that use your connected accounts. Anything that writes, sends, or spends still asks you first.`]});case`high`:return(0,G.jsxs)(G.Fragment,{children:[t,` answers any request on its own without asking. Tools that take action — writing, sending, spending — still come to you first.`]})}}function De({assistantName:e}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:`Assistant Access levels`}),(0,G.jsx)(f.Body,{className:`grid gap-4 sm:grid-cols-2`,children:Y.map(t=>{let n=X[t];return(0,G.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(`span`,{"aria-hidden":`true`,className:`h-1.5 w-1.5 rounded-full`,style:{backgroundColor:Te[n.tone]}}),(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,children:n.label})]}),(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:Ee(t,e)})]},t)})}),(0,G.jsx)(f.Footer,{children:(0,G.jsxs)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:[`Your`,` `,(0,G.jsx)(a,{to:O.settings.privacy,className:`text-[var(--content-link)] underline hover:text-[var(--content-link-hover)]`,children:`Trust Rules`}),` `,`fine-tune these levels: a rule raises or lowers how risky a specific action is treated, which changes when it asks first.`]})})]})}function Q(e){return e.type===`dm`?`dm`:e.isPrivate?`private`:`public`}function Oe(e){return e.filter(e=>Q(e)!==`dm`)}function ke(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>(n===null||Q(e)===n)&&(r===``||e.name.toLowerCase().includes(r))).sort((e,t)=>e.name.localeCompare(t.name))}function Ae(e){let t={public:0,private:0,dm:0};for(let n of e)t[Q(n)]+=1;return t}function je(e){return e.memberCount==null?null:e.memberCount===1?`1 member`:`${e.memberCount} members`}var Me=[{value:null,label:`All`},{value:`public`,label:`Public`},{value:`private`,label:`Private`}],Ne={public:z,private:I},Pe=100,Fe=new Set;function Ie({assistantDisplayName:e,slackHandle:t,channels:r,loading:i=!1,error:a=!1,tierOverrides:o,defaultTier:s=null,accessControlsSupported:c=!0,tierOverridesLoading:l=!1,tierOverridesError:p=!1,pendingChannelIds:m=Fe,onTierChange:h,onTierReset:g}){let[y,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(null),[w,T]=(0,W.useState)(new Set),[E,D]=(0,W.useState)(!1),O=e=>{T(t=>{if(E){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}return t.has(e)?new Set:new Set([e])})},k=()=>{E?(D(!1),T(new Set)):(D(!0),T(new Set(A.map(e=>e.id))))},A=(0,W.useMemo)(()=>Oe(r??[]),[r]),j=(0,W.useMemo)(()=>ke(A,y,S),[A,y,S]),M=(0,W.useMemo)(()=>Ae(A),[A]),N=t??`@${e}`,P=(0,G.jsxs)(G.Fragment,{children:[`To add `,e,` to a channel, type`,` `,(0,G.jsxs)(`code`,{className:`text-[color:var(--content-secondary)]`,children:[`/invite `,N]}),` `,`inside that Slack channel.`]});return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[`Where `,e,` is present`,(0,G.jsx)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:P})]})}),(0,G.jsx)(f.Body,{className:`flex flex-col gap-3`,children:i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):a?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load channels. Try reopening this page.`}):A.length===0?(0,G.jsx)(K,{icon:(0,G.jsx)(z,{className:`h-6 w-6`}),title:`No channels yet`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,G.jsx)(`div`,{className:`min-w-56 flex-1`,children:(0,G.jsx)(b,{type:`search`,value:y,onChange:e=>x(e.target.value),placeholder:`Search channels`,"aria-label":`Search channels`,leftIcon:(0,G.jsx)(re,{className:`h-4 w-4`}),fullWidth:!0})}),(0,G.jsx)(`div`,{className:`flex items-center gap-2`,role:`group`,"aria-label":`Filter channels by type`,children:Me.map(({value:e,label:t})=>{let n=S===e,r=e===null?A.length:M[e];return(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":n,onClick:()=>C(e),className:u(`inline-flex h-6 items-center rounded-full px-2.5 text-body-small-emphasised leading-none transition-colors`,n?`bg-[var(--content-default)] text-[var(--surface-base)]`:`bg-[var(--tag-bg-neutral)] text-[color:var(--content-secondary)] hover:text-[color:var(--content-default)]`),children:[t,` `,r]},e??`all`)})}),(0,G.jsx)(n,{type:`button`,variant:`outlined`,onClick:k,children:E?`Collapse all`:`Expand all`})]}),j.length===0?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`py-4 text-center text-[color:var(--content-tertiary)]`,children:`No channels match.`}):(0,G.jsx)(_.Root,{type:`multiple`,value:[...w],children:j.length>Pe?(0,G.jsx)(`div`,{className:`h-96`,children:(0,G.jsx)(v,{items:j,computeItemKey:(e,t)=>t.id,itemContent:(e,t)=>(0,G.jsx)($,{channel:t,open:w.has(t.id),onToggle:()=>O(t.id),pending:m.has(t.id),overridesLoading:l,overridesError:p,defaultTier:s,accessControls:c,tierOverride:o?.[t.id],onTierChange:e=>h?.(t.id,e),onReset:()=>g?.(t.id)}),className:`h-full`})}):j.map(e=>(0,G.jsx)($,{channel:e,open:w.has(e.id),onToggle:()=>O(e.id),pending:m.has(e.id),overridesLoading:l,overridesError:p,defaultTier:s,accessControls:c,tierOverride:o?.[e.id],onTierChange:t=>h?.(e.id,t),onReset:()=>g?.(e.id)},e.id))})]})}),!i&&!a&&A.length>0?(0,G.jsx)(f.Footer,{children:(0,G.jsxs)(d,{as:`p`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:[`Only showing channels `,e,` is in. To remove`,` `,e,` from a channel, use`,` `,(0,G.jsxs)(`code`,{className:`text-[color:var(--content-secondary)]`,children:[`/remove `,N]}),` `,`in that Slack channel.`]})}):null]}),c&&!i&&!a&&A.length>0?(0,G.jsx)(De,{assistantName:e}):null]})}function $({channel:e,open:t,pending:n,overridesLoading:r,overridesError:i,defaultTier:a,accessControls:o,tierOverride:s,onToggle:c,onTierChange:l,onReset:d}){let f=Q(e);if(f===`dm`)return null;let m=Ne[f],h=je(e),g=Ce(s),v=g.tier===null?null:X[g.tier],b=a===null?null:X[a];return o?(0,G.jsxs)(_.Item,{value:e.id,className:`[&+&]:border-t [&+&]:border-[var(--border-base)]`,children:[(0,G.jsx)(x,{leading:(0,G.jsx)(m,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),title:e.name,onClick:c,contentAriaLabel:`${e.name} — ${t?`collapse`:`expand`} channel settings`,showChevron:!1,selected:t,trailing:(0,G.jsxs)(G.Fragment,{children:[n?(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:`Saving…`}):h==null?null:(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:h}),v===null?(0,G.jsx)(y,{children:b===null?`Default`:`${b.label} • default`}):(0,G.jsxs)(y,{tone:v.tone,children:[v.label,` • custom`]}),(0,G.jsx)(p,{"aria-hidden":`true`,className:u(`h-4 w-4 text-[var(--content-tertiary)] transition-transform`,t&&`rotate-180`)})]})}),(0,G.jsx)(_.Content,{children:(0,G.jsx)(we,{channelName:e.name,settings:g,defaultTier:a,loading:r,error:i,onTierChange:l,onReset:d})})]}):(0,G.jsx)(x,{leading:(0,G.jsx)(m,{className:`h-4 w-4 text-[var(--content-tertiary)]`}),title:e.name,trailing:h==null?void 0:(0,G.jsx)(`span`,{className:`text-body-small-default text-[color:var(--content-tertiary)]`,children:h})})}var Le=`0.10.7`;function Re(){return k(Le)}function ze(e,t,n){return Z.map(r=>({selector:{scope:`channel`,adapter:e,channelExternalId:t},contactType:r,threshold:n}))}function Be(e,t,n){return e.selector.scope===`channel`&&e.selector.adapter===t&&e.selector.channelExternalId===n}function Ve({assistantId:e,adapter:t}){let n=o(),r=P.use.channelTrustFloors(),i=Re(),a=r&&i&&!!e,l=(0,W.useMemo)(()=>({path:{assistant_id:e}}),[e]),u=(0,W.useMemo)(()=>oe(l),[l]),d=s({...ae(l),enabled:a,select:e=>Se(e.cells,t)}),f=s({queryKey:[`channel-permission-resolve`,e,t],queryFn:async()=>{let{data:e}=await M({...l,body:{adapter:t,contactType:`trusted_contact`},throwOnError:!0});return e.resolved?.threshold??null},enabled:a,retry:!1,staleTime:3e4}),p=(e,r)=>{let i=n.getQueryData(u),a=Date.now();return n.setQueryData(u,n=>({cells:[...(n?.cells??[]).filter(n=>!Be(n,t,e)),...r.map(e=>({...e,updatedAt:a}))]})),{previous:i}},m=c({mutationFn:async({channelExternalId:e,tier:n})=>{await Promise.all(ze(t,e,n).map(e=>j({...l,body:e,throwOnError:!0})))},onMutate:({channelExternalId:e,tier:n})=>p(e,ze(t,e,n)),onError:(e,t,r)=>{n.setQueryData(u,r?.previous),U(`Failed to save channel settings`)(e)},onSettled:()=>n.invalidateQueries({queryKey:u})}),h=c({mutationFn:async({channelExternalId:e})=>{await Promise.all(Z.map(n=>N({...l,body:{selector:{scope:`channel`,adapter:t,channelExternalId:e},contactType:n},throwOnError:!0})))},onMutate:({channelExternalId:e})=>p(e,[]),onError:(e,t,r)=>{n.setQueryData(u,r?.previous),U(`Failed to reset channel settings`)(e)},onSettled:()=>n.invalidateQueries({queryKey:u})}),g=(0,W.useMemo)(()=>{let e=new Set;return m.isPending&&m.variables&&e.add(m.variables.channelExternalId),h.isPending&&h.variables&&e.add(h.variables.channelExternalId),e},[m.isPending,m.variables,h.isPending,h.variables]);return a?{supported:!0,tierOverrides:d.data,defaultCellTier:f.data,pendingChannelIds:g,isLoading:d.isPending,isError:d.isError,onTierChange:(e,t)=>m.mutate({channelExternalId:e,tier:t}),onTierReset:e=>{d.data?.[e]!==void 0&&h.mutate({channelExternalId:e})}}:{supported:!1,tierOverrides:void 0,defaultCellTier:void 0,pendingChannelIds:new Set,isLoading:!1,isError:!1,onTierChange:void 0,onTierReset:void 0}}function He({assistantId:e,assistantDisplayName:t,slackHandle:n}){let r=s({...ie(e),enabled:!!e,select:e=>e.channels}),i=Ve({assistantId:e,adapter:`slack`}),a=s({queryKey:[`thresholds`,e],queryFn:()=>se(e),enabled:i.supported&&!!e,staleTime:3e4}).data?.interactive??null,o=i.defaultCellTier===void 0?null:i.defaultCellTier??a;return(0,G.jsx)(Ie,{assistantDisplayName:t,slackHandle:n,accessControlsSupported:i.supported,defaultTier:o,channels:r.data,loading:r.isPending,error:r.isError,tierOverrides:i.tierOverrides,tierOverridesLoading:i.isLoading,tierOverridesError:i.isError,pendingChannelIds:i.pendingChannelIds,onTierChange:i.onTierChange,onTierReset:i.onTierReset})}function Ue({slackHandle:e,disconnectPending:t=!1,onDisconnect:r,children:i}){return(0,G.jsxs)(f.Root,{children:[(0,G.jsx)(f.Header,{children:(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(`img`,{src:F(`/images/integrations/slack.svg`),alt:``,className:`size-8 rounded-lg bg-[var(--surface-sunken)] p-1`}),e?(0,G.jsx)(d,{as:`span`,variant:`body-medium-default`,children:e}):null,(0,G.jsx)(y,{tone:`positive`,leftIcon:(0,G.jsx)(V,{}),children:`Connected`}),(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(n,{type:`button`,variant:`ghost`,onClick:r,disabled:!r||t,children:t?`Disconnecting…`:`Disconnect`})})]})}),(0,G.jsx)(f.Body,{children:i})]})}function We({threadMode:e,threadModePending:t=!1,onThreadModeChange:n}){return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:`Thread Behavior`}),(0,G.jsxs)(h,{value:e??`mention_then_thread`,onValueChange:e=>n?.(e),disabled:t||!n,"aria-label":`Slack thread behavior`,children:[(0,G.jsx)(g,{value:`mention_only`,label:`Mentions only`,helperText:`Bot only responds when @mentioned.`}),(0,G.jsx)(g,{value:`mention_then_thread`,label:`Follow threads after first mention`,helperText:`After an @mention in a thread, bot listens to all subsequent replies.`})]})]})}var Ge={no_one:{title:`Block all messages?`,message:`Setting this channel to “No one” hard-denies every inbound message — including messages from you.
|
|
2
2
|
|
|
3
3
|
You can reverse this at any time.`,confirmLabel:`Block all`,destructive:!0},any_contact:{title:`Allow any contact?`,message:`“Any contact” admits every matched contact in this channel — including pending, unverified ones — not just your verified contacts.
|
|
4
4
|
|
|
@@ -6,4 +6,4 @@ Best for channels consisting of only people you already trust.`,confirmLabel:`Al
|
|
|
6
6
|
|
|
7
7
|
Doing so could cost you money and open you up to security and privacy vulnerabilities.
|
|
8
8
|
|
|
9
|
-
Enable with extreme caution.`,confirmLabel:`Allow strangers`,destructive:!0}},Ke={slack:{label:`Slack`,disconnectMessage:`This clears the stored Slack bot and app tokens for this assistant. You can reconnect later.`,hasTrustFloorControl:!1},telegram:{label:`Telegram`,disconnectMessage:`This clears the stored Telegram bot token for this assistant. You can reconnect later.`,hasTrustFloorControl:!0,disconnectedPitch:e=>`Connect a Telegram bot so ${e} can send and receive messages on Telegram.`},phone:{label:`Phone Calling`,disconnectMessage:`This clears the stored Twilio credentials for this assistant. You can reconnect later.`,hasTrustFloorControl:!0,disconnectedPitch:e=>`Connect your Twilio account so ${e} can make and answer phone calls.`}};function qe({assistantId:e,assistantName:t,channels:n,pendingChannelKey:r=null,slackThreadMode:i,slackThreadModePending:a=!1,channelPolicies:o,policySavingKey:s=null,policiesLoading:c=!1,policiesError:l=!1,onChannelPolicyChange:u,onSetup:d,onDisconnect:f,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,initialChannel:y=null}){let b=q.use.selectedAdapter(),x=q.use.selectAdapter(),[S,C]=(0,W.useState)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(!1),[k]=(0,W.useState)(y);(0,W.useEffect)(()=>{k&&x(k)},[k,x]);let A=H(t),j=S?Ke[S]:null,M=T?Ge[T.policy]:null,N=(e,t)=>{if(Ge[t]){E({channelKey:e,policy:t});return}u?.(e,t)},P=e=>{x(e),O(!1)},F=n.find(e=>e.key===b)??n[0];if(!F)return null;let I=(0,G.jsx)(Je,{channel:F,assistantId:e,assistantName:t,assistantDisplayName:A,pending:r===F.key,initialManualEntry:k===F.key,onSetup:d?()=>d(F.key):void 0,onDisconnect:f?()=>C(F.key):void 0,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,slackThreadMode:i,slackThreadModePending:a,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,policy:o?.[F.key],policySaving:s===F.key,policyLoading:c,policyError:l,onPolicyChange:u?e=>N(F.key,e):void 0},F.key);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden sm:flex-row sm:gap-6`,children:[(0,G.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,G.jsx)(ve,{onClick:()=>O(!0)})}),(0,G.jsx)(ye,{open:D,onClose:()=>O(!1),title:`Channels`,children:(0,G.jsx)(J,{channels:n,selectedKey:F.key,onSelect:P})}),(0,G.jsx)(`aside`,{className:`hidden min-h-0 w-[320px] shrink-0 overflow-y-auto self-stretch sm:block`,children:(0,G.jsx)(J,{channels:n,selectedKey:F.key,onSelect:P})}),(0,G.jsx)(`section`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:F.key===`slack`?I:(0,G.jsx)(_e,{children:I})})]}),(0,G.jsx)(w,{open:S!==null,title:`Disconnect ${j?.label??``}?`,message:j?.disconnectMessage??``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{S&&f&&f(S),C(null)},onCancel:()=>C(null)}),(0,G.jsx)(w,{open:T!==null,title:M?.title??``,message:M?.message??``,confirmLabel:M?.confirmLabel??`Confirm`,destructive:M?.destructive??!1,onConfirm:()=>{T&&u?.(T.channelKey,T.policy),E(null)},onCancel:()=>E(null)})]})}function Je({channel:e,assistantId:t,assistantName:r,assistantDisplayName:i,pending:a,initialManualEntry:o=!1,onSetup:s,onDisconnect:c,onSaveTelegramToken:l,onSaveSlackConfig:u,slackSaveStatus:d,slackSaveError:f,slackThreadMode:p,slackThreadModePending:m=!1,onSlackThreadModeChange:h,onSaveTwilioCredentials:g,policy:_,policySaving:v=!1,policyLoading:b=!1,policyError:x=!1,onPolicyChange:S}){let C=Ke[e.key],w=e.status===`ready`,[T,E]=(0,W.useState)(o),D=w||T;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.key!==`slack`&&w?(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(y,{tone:`positive`,leftIcon:(0,G.jsx)(
|
|
9
|
+
Enable with extreme caution.`,confirmLabel:`Allow strangers`,destructive:!0}},Ke={slack:{label:`Slack`,disconnectMessage:`This clears the stored Slack bot and app tokens for this assistant. You can reconnect later.`,hasTrustFloorControl:!1},telegram:{label:`Telegram`,disconnectMessage:`This clears the stored Telegram bot token for this assistant. You can reconnect later.`,hasTrustFloorControl:!0,disconnectedPitch:e=>`Connect a Telegram bot so ${e} can send and receive messages on Telegram.`},phone:{label:`Phone Calling`,disconnectMessage:`This clears the stored Twilio credentials for this assistant. You can reconnect later.`,hasTrustFloorControl:!0,disconnectedPitch:e=>`Connect your Twilio account so ${e} can make and answer phone calls.`}};function qe({assistantId:e,assistantName:t,channels:n,pendingChannelKey:r=null,slackThreadMode:i,slackThreadModePending:a=!1,channelPolicies:o,policySavingKey:s=null,policiesLoading:c=!1,policiesError:l=!1,onChannelPolicyChange:u,onSetup:d,onDisconnect:f,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,initialChannel:y=null}){let b=q.use.selectedAdapter(),x=q.use.selectAdapter(),[S,C]=(0,W.useState)(null),[T,E]=(0,W.useState)(null),[D,O]=(0,W.useState)(!1),[k]=(0,W.useState)(y);(0,W.useEffect)(()=>{k&&x(k)},[k,x]);let A=H(t),j=S?Ke[S]:null,M=T?Ge[T.policy]:null,N=(e,t)=>{if(Ge[t]){E({channelKey:e,policy:t});return}u?.(e,t)},P=e=>{x(e),O(!1)},F=n.find(e=>e.key===b)??n[0];if(!F)return null;let I=(0,G.jsx)(Je,{channel:F,assistantId:e,assistantName:t,assistantDisplayName:A,pending:r===F.key,initialManualEntry:k===F.key,onSetup:d?()=>d(F.key):void 0,onDisconnect:f?()=>C(F.key):void 0,onSaveTelegramToken:p,onSaveSlackConfig:m,slackSaveStatus:h,slackSaveError:g,slackThreadMode:i,slackThreadModePending:a,onSlackThreadModeChange:_,onSaveTwilioCredentials:v,policy:o?.[F.key],policySaving:s===F.key,policyLoading:c,policyError:l,onPolicyChange:u?e=>N(F.key,e):void 0},F.key);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 overflow-hidden sm:flex-row sm:gap-6`,children:[(0,G.jsx)(`div`,{className:`flex items-center sm:hidden`,children:(0,G.jsx)(ve,{onClick:()=>O(!0)})}),(0,G.jsx)(ye,{open:D,onClose:()=>O(!1),title:`Channels`,children:(0,G.jsx)(J,{channels:n,selectedKey:F.key,onSelect:P})}),(0,G.jsx)(`aside`,{className:`hidden min-h-0 w-[320px] shrink-0 overflow-y-auto self-stretch sm:block`,children:(0,G.jsx)(J,{channels:n,selectedKey:F.key,onSelect:P})}),(0,G.jsx)(`section`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:F.key===`slack`?I:(0,G.jsx)(_e,{children:I})})]}),(0,G.jsx)(w,{open:S!==null,title:`Disconnect ${j?.label??``}?`,message:j?.disconnectMessage??``,confirmLabel:`Disconnect`,destructive:!0,onConfirm:()=>{S&&f&&f(S),C(null)},onCancel:()=>C(null)}),(0,G.jsx)(w,{open:T!==null,title:M?.title??``,message:M?.message??``,confirmLabel:M?.confirmLabel??`Confirm`,destructive:M?.destructive??!1,onConfirm:()=>{T&&u?.(T.channelKey,T.policy),E(null)},onCancel:()=>E(null)})]})}function Je({channel:e,assistantId:t,assistantName:r,assistantDisplayName:i,pending:a,initialManualEntry:o=!1,onSetup:s,onDisconnect:c,onSaveTelegramToken:l,onSaveSlackConfig:u,slackSaveStatus:d,slackSaveError:f,slackThreadMode:p,slackThreadModePending:m=!1,onSlackThreadModeChange:h,onSaveTwilioCredentials:g,policy:_,policySaving:v=!1,policyLoading:b=!1,policyError:x=!1,onPolicyChange:S}){let C=Ke[e.key],w=e.status===`ready`,[T,E]=(0,W.useState)(o),D=w||T;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[e.key!==`slack`&&w?(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,G.jsx)(y,{tone:`positive`,leftIcon:(0,G.jsx)(V,{}),children:`Connected`}),e.address?(0,G.jsx)(`span`,{className:`text-body-medium-lighter`,style:{color:`var(--content-tertiary)`},children:e.address}):null,(0,G.jsx)(`div`,{className:`ml-auto`,children:(0,G.jsx)(n,{type:`button`,variant:`danger`,onClick:c,disabled:!c||a,children:a?`Disconnecting…`:`Disconnect`})})]}):e.key!==`slack`&&!T?(0,G.jsx)(K,{icon:(0,G.jsx)(B,{channelId:e.key,className:`h-6 w-6`}),title:`${R(e.key)} isn't connected`,description:C.disconnectedPitch?.(i),action:(0,G.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,G.jsx)(n,{type:`button`,variant:`outlined`,onClick:s,disabled:!s||a,children:a?`Opening…`:`Set up`}),(0,G.jsx)(n,{type:`button`,variant:`link`,onClick:()=>E(!0),children:`or connect manually`})]})}):null,w&&C.hasTrustFloorControl&&S?(0,G.jsx)(Ye,{assistantDisplayName:i,policy:_,saving:v,loading:b,error:x,onChange:S}):null,e.key===`telegram`&&D?(0,G.jsx)(Xe,{onSave:l}):null,e.key===`slack`?w?(0,G.jsx)(Ue,{slackHandle:e.address,disconnectPending:a,onDisconnect:c,children:(0,G.jsx)(We,{threadMode:p,threadModePending:m,onThreadModeChange:h})}):(0,G.jsx)(xe,{children:(0,G.jsx)(ee,{assistantName:r,onSave:u,saveStatus:d,saveError:f})}):null,e.key===`slack`&&w?(0,G.jsx)(He,{assistantId:t,assistantDisplayName:i,slackHandle:e.address}):null,e.key===`phone`&&D?(0,G.jsx)(Ze,{onSave:g}):null]})}function Ye({assistantDisplayName:e,policy:t,saving:n=!1,loading:r=!1,error:i=!1,onChange:a}){let o=t??`trusted_contacts`,s=pe(e),c=he.map(e=>({value:e,label:de[e],tooltip:s[e]}));return(0,G.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,G.jsxs)(d,{as:`span`,variant:`body-small-emphasised`,className:`text-[color:var(--content-secondary)]`,children:[`Who can message `,e]}),r?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:`Loading…`}):i?(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-negative)]`,children:`Couldn’t load this setting. Try reopening this page.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{style:{maxWidth:280},children:(0,G.jsx)(T,{value:o,onChange:a,options:c,disabled:n,"aria-label":`Who can message ${e}`})}),(0,G.jsx)(d,{as:`span`,variant:`body-small-default`,className:`text-[color:var(--content-tertiary)]`,children:s[o]}),o===`trusted_contacts`?(0,G.jsxs)(m,{tone:`info`,className:`max-w-lg`,children:[`People you haven’t verified yet — even teammates in the same channel — can’t get through: `,e,` lets them know they need to be verified and notifies you. You can verify people ahead of time in Contacts.`]}):null]})]})}function Xe({onSave:e}){let[t,r]=(0,W.useState)(``),[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(null),c=t.trim().length>0&&!i;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(b,{label:`Bot Token`,type:`password`,value:t,onChange:e=>r(e.target.value),placeholder:`Paste your Telegram bot token`,disabled:i,fullWidth:!0}),o?(0,G.jsx)(`p`,{className:`text-label-small`,style:{color:`var(--content-negative)`},children:o}):null,(0,G.jsx)(`div`,{children:(0,G.jsx)(n,{type:`button`,onClick:async()=>{if(!(!e||!c)){a(!0),s(null);try{await e(t.trim()),r(``)}catch(e){s(e instanceof Error?e.message:`Failed to save`)}finally{a(!1)}}},disabled:!c,children:i?`Saving…`:`Save`})})]})}function Ze({onSave:e}){let[t,r]=(0,W.useState)(``),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(!1),[c,l]=(0,W.useState)(null),u=t.trim().length>0&&i.trim().length>0&&!o;return(0,G.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,G.jsx)(b,{label:`Account SID`,type:`text`,value:t,onChange:e=>r(e.target.value),placeholder:`ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,disabled:o,fullWidth:!0}),(0,G.jsx)(b,{label:`Auth Token`,type:`password`,value:i,onChange:e=>a(e.target.value),placeholder:`Twilio auth token`,disabled:o,fullWidth:!0}),c?(0,G.jsx)(`p`,{className:`text-label-small`,style:{color:`var(--content-negative)`},children:c}):null,(0,G.jsx)(`div`,{children:(0,G.jsx)(n,{type:`button`,onClick:async()=>{if(!(!e||!u)){s(!0),l(null);try{await e(t.trim(),i.trim()),r(``),a(``)}catch(e){l(e instanceof Error?e.message:`Failed to save`)}finally{s(!1)}}},disabled:!u,children:o?`Saving…`:`Save`})})]})}function Qe(){let[e,t]=i(),n=e.get(`setup`),r=n&&ne(n)?n:null;return(0,W.useEffect)(()=>{r&&t(e=>(e.delete(`setup`),e),{replace:!0})},[r,t]),r}function $e({assistantId:e,onStartSetupConversation:t}){let n=P.use.a2aChannel(),r=A.use.name(),i=Qe(),a=ge(e);return(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 overflow-hidden`,children:[(0,G.jsx)(qe,{assistantId:e,assistantName:H(r),initialChannel:i,...me({assistantId:e,onStartSetupConversation:t})}),n?(0,G.jsx)(fe,{onClick:a.open}):null,(0,G.jsx)(ue,{open:a.isOpen,assistantId:e,onClose:a.close})]})}function et(){let e=r(),t=le();return(0,G.jsx)($e,{assistantId:t,onStartSetupConversation:t=>{te(e,{prompt:t})}},t)}export{et as ChannelsPageRoute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-file-
|
|
2
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-B8K8lUhs.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,t as i}from"./button-D1p5nVKJ.js";import{t as a}from"./preload-helper-BewR0kVT.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./chevron-left-Ncgwat48.js";import{t as u}from"./chevron-right-CpCJCjNw.js";import{t as d}from"./download-CO38a5Al.js";import{t as f}from"./file-xi5GbREI.js";import{t as p}from"./loader-circle-CZg4IeLX.js";import{t as m}from"./x-eOtMyHx5.js";import{a as h,m as g}from"./src-CTfdzX7d.js";import{n as _,t as v}from"./file-markdown-D8HoWCNf.js";import{l as y}from"./sdk.gen-BXaGmR5-.js";import{t as b}from"./dist-C3LFhPgk2.js";import{t as x}from"./browser-CRxGcQt6.js";var S=e(n(),1),ee=e(r(),1),C=s(),w=`width=500,height=600`;function T(e){if(!e)return null;let t;try{let n=typeof window>`u`?`http://localhost`:window.location.origin;t=new URL(e,n)}catch{return null}return t.protocol!==`https:`&&t.protocol!==`http:`?null:t}function E(e){let t=T(e);if(!t)return!1;let n=t.pathname.toLowerCase();return t.searchParams.get(`response_type`)===`code`&&t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)||t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)&&/oauth|authorize|auth/.test(n)}function D(e){if(typeof window>`u`)return null;let t=T(e);return!t||t.origin!==window.location.origin?null:`${t.pathname}${t.search}${t.hash}`}function O(e){return T(e)?.href??null}function k(e){if(!E(e))return!1;if(b.isNativePlatform()){let t=O(e);return t?(x(t),!0):!1}let t=window.open(e,`_blank`,w);return t===null?!1:(t.focus(),!0)}function A(e){return k(e)}function j(e){if(k(e))return!0;let t=window.open(e,`_blank`);return t===null?!1:(t.focus(),!0)}function M(e,t){let n=D(e);if(n)return t.push(n),{kind:`routed`};let r=O(e);return r?t.isNative?(x(r),{kind:`opened`}):j(r)?{kind:`opened`}:{kind:`blocked`,url:r}:{kind:`invalid`}}async function N(e,t){if(!t||t.startsWith(`rehydrated:`))return null;try{let{data:n,error:r}=await y({path:{assistant_id:e,id:t},parseAs:`blob`,throwOnError:!1});return!r&&n instanceof Blob?n:null}catch{return null}}async function P(e,t){let{saveFile:n}=await a(async()=>{let{saveFile:e}=await import(`./native-file-DQ3ZLI_q.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));if(t){let r=await N(t,e.id);if(r){await n(r,e.filename);return}}e.previewUrl&&await n(e.previewUrl,e.filename)}function F(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?Math.round(n).toString():n.toFixed(1)} ${t[r]}`}function I(e,t){let n=(e||``).toLowerCase(),r=t.split(`.`).pop()?.toLowerCase()??``;return n.startsWith(`image/`)?`image`:n.startsWith(`video/`)?`video`:n.startsWith(`audio/`)?`audio`:n===`application/pdf`||r===`pdf`?`pdf`:n===`application/zip`||n===`application/x-tar`||n===`application/gzip`||[`zip`,`tar`,`gz`,`tgz`,`rar`,`7z`].includes(r)?`archive`:n===`text/csv`||n===`application/vnd.ms-excel`||n===`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`||[`csv`,`xlsx`,`xls`,`numbers`].includes(r)?`spreadsheet`:`ts.tsx.js.jsx.py.rb.go.rs.java.kt.swift.c.cc.cpp.h.hpp.sh.bash.zsh.html.css.scss.json.yaml.yml.toml.xml`.split(`.`).includes(r)?`code`:n===`application/msword`||n===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||[`doc`,`docx`,`pages`].includes(r)?`document`:n.startsWith(`text/`)||[`txt`,`md`,`rtf`].includes(r)?`text`:`file`}function L(e){let t=e.replace(/\s/g,``),n=t.endsWith(`==`)?2:+!!t.endsWith(`=`);return Math.max(0,Math.floor(t.length*3/4)-n)}function R(e){let t=e.match(/;base64,(.*)$/);if(!t?.[1])return null;let n=atob(t[1]),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function z(e,t=28){if(e.length<=t)return e;let n=Math.max(4,Math.floor((t-1)/2));return`${e.slice(0,n)}…${e.slice(e.length-n)}`}var B=1.5,V=20,H=!1;async function U(){let e=await a(()=>import(`./pdf-C5IZXnZA.js`),__vite__mapDeps([4,2]));return H||=(e.GlobalWorkerOptions.workerSrc=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${e.version}/legacy/build/pdf.worker.min.mjs`,!0),e}function te({url:e,className:t}){let n=(0,S.useRef)(null),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!0),[l,u]=(0,S.useState)(null),d=(0,S.useRef)(new Map),f=(0,S.useRef)(new Set);(0,S.useEffect)(()=>{let t=!1;async function n(){c(!0),u(null),i(null),o(0),f.current.clear();try{let n=await U(),r;if(e.startsWith(`data:`)){let t=R(e);r=t?{data:t}:e}else r=e;let a=await n.getDocument(r).promise;if(t){a.destroy();return}i(a),o(Math.min(a.numPages,V))}catch{t||u(`Failed to load PDF.`)}finally{t||c(!1)}}return n(),()=>{t=!0}},[e]),(0,S.useEffect)(()=>()=>{r&&r.destroy()},[r]);let m=(0,S.useCallback)(async e=>{if(!r||f.current.has(e))return;let t=d.current.get(e);if(t){f.current.add(e);try{let n=await r.getPage(e),i=n.getViewport({scale:B});t.width=i.width,t.height=i.height,await n.render({canvas:t,viewport:i}).promise}catch{f.current.delete(e)}}},[r]);(0,S.useEffect)(()=>{if(!r||a===0)return;let e=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=Number(t.target.dataset.page);e&&m(e)}},{root:n.current,rootMargin:`200px`});return d.current.forEach(t=>e.observe(t)),()=>e.disconnect()},[r,a,m]);let h=(0,S.useCallback)(e=>t=>{t?d.current.set(e,t):d.current.delete(e)},[]);return s?(0,C.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,C.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):l?(0,C.jsx)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:(0,C.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:l})}):(0,C.jsx)(`div`,{ref:n,className:`flex max-h-[80vh] flex-col items-center gap-2 overflow-y-auto rounded ${t??``}`,children:Array.from({length:a},(e,t)=>(0,C.jsx)(`canvas`,{ref:h(t+1),"data-page":t+1,className:`w-[90vw] max-w-[800px]`,style:{height:`auto`}},t+1))})}function W({message:e,filename:t,onDownload:n,downloadDisabled:r=!1}){return(0,C.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,C.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:e}),(0,C.jsx)(i,{variant:`ghost`,leftIcon:(0,C.jsx)(d,{}),onClick:n,disabled:r,"aria-label":`Download ${t}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}var G=class extends Error{};async function K(e,t,n){if(t>204800)throw new G;if(e.startsWith(`data:`)){let t=R(e);if(!t)throw Error(`Malformed data URI`);return new TextDecoder().decode(t)}let r=await fetch(e,{signal:n});if(!r.ok)throw Error(`Failed to load file: ${r.status}`);let i=await r.blob();if(i.size>204800)throw new G;return i.text()}function ne({url:e,filename:n,mimeType:r,sizeBytes:i}){let[o,s]=(0,S.useState)({status:`loading`});return(0,S.useEffect)(()=>{let n=new AbortController;return s({status:`loading`}),K(e,i,n.signal).then(e=>{n.signal.aborted||s({status:`ready`,text:e})}).catch(e=>{if(n.signal.aborted)return;let r=e instanceof G;r||t(e,{context:`attachment-text-preview`,bestEffort:!0}),s({status:`error`,tooLarge:r})}),()=>n.abort()},[e,i]),o.status===`loading`?(0,C.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,C.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):o.status===`error`?(0,C.jsx)(W,{message:o.tooLarge?`File too large to preview inline.`:`Failed to load preview.`,filename:n,onDownload:async()=>{let{saveFile:t}=await a(async()=>{let{saveFile:e}=await import(`./native-file-DQ3ZLI_q.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));await t(e,n)}}):(0,C.jsx)(`div`,{className:`max-h-[80vh] w-[min(90vw,800px)] overflow-auto rounded-lg p-6`,style:{backgroundColor:`var(--surface-overlay)`,color:`var(--content-default)`},children:(0,C.jsx)(re,{text:o.text,filename:n,mimeType:r})})}function re({text:e,filename:t,mimeType:n}){return _(t,n)?(0,C.jsx)(v,{content:e}):(0,C.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-body-small-default`,children:e})}var ie=new Set([`ts`,`tsx`,`js`,`jsx`,`py`,`json`,`md`,`sh`,`bash`,`html`,`css`,`yaml`,`yml`,`txt`]),ae=new Set([`application/json`,`application/javascript`,`application/xml`]),q=e=>{let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?``:e.slice(t+1).toLowerCase()},J=({open:e,onClose:t,attachment:n,assistantId:r,siblingAttachments:s,onNavigate:h})=>{let g=(0,S.useRef)(null),_=(0,S.useRef)(null);(0,S.useEffect)(()=>{e&&_.current?.focus()},[e]);let v=!n.previewUrl&&n.id.startsWith(`rehydrated:`),y=e&&!n.previewUrl&&!!r&&!!n.id&&!v,{data:b,isError:x}=o({queryKey:[`attachmentContent`,r,n.id],queryFn:async()=>{let e=await N(r,n.id);if(!e)throw Error(`Failed to load file`);return e},enabled:y,staleTime:1/0,retry:!1}),[w,T]=(0,S.useState)(null);(0,S.useEffect)(()=>{if(!b){T(null);return}let e=URL.createObjectURL(b);return T(e),()=>{URL.revokeObjectURL(e),T(null)}},[b]);let E=n.previewUrl??w,[D,O]=(0,S.useState)(null),k=y&&!w&&!x,A=v?`Preview unavailable — file content was not preserved in chat history.`:x?`Failed to load preview.`:null,j=(0,S.useMemo)(()=>!s||s.length<=1?-1:s.findIndex(e=>e.id===n.id),[s,n.id]),M=j!==-1&&s!=null&&s.length>1,P=(0,S.useCallback)(()=>{!M||!s||!h||h(s[(j-1+s.length)%s.length])},[M,s,j,h]),I=(0,S.useCallback)(()=>{!M||!s||!h||h(s[(j+1)%s.length])},[M,s,j,h]),L=(0,S.useCallback)(e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowLeft`&&M?(e.preventDefault(),P()):e.key===`ArrowRight`&&M&&(e.preventDefault(),I())},[t,P,I,M]),R=(0,S.useCallback)(e=>{e.target===g.current&&t()},[t]),z=(0,S.useCallback)(async()=>{if(!E)return;let{saveFile:e}=await a(async()=>{let{saveFile:e}=await import(`./native-file-DQ3ZLI_q.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));await e(E,n.filename)},[E,n.filename]);if(!e)return null;let B=n.mimeType.toLowerCase(),V=B.startsWith(`image/`),H=B.startsWith(`video/`),U=B===`application/pdf`||B===`application/octet-stream`&&n.filename.toLowerCase().endsWith(`.pdf`),G=q(n.filename),K=B.startsWith(`text/`)||ae.has(B)||ie.has(G);return(0,ee.createPortal)((0,C.jsxs)(`div`,{ref:g,role:`dialog`,"aria-modal":`true`,"aria-label":`Preview of ${n.filename}`,className:`fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/80 [-webkit-app-region:no-drag]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},onKeyDown:L,onClick:R,children:[(0,C.jsx)(i,{ref:_,variant:`ghost`,iconOnly:(0,C.jsx)(m,{}),expandOnMobile:!1,onClick:t,"aria-label":`Close preview`,className:`absolute right-4 top-4 z-10 h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),M&&(0,C.jsxs)(`div`,{className:`pointer-events-none absolute inset-x-0 top-1/2 z-10 flex -translate-y-1/2 items-center justify-between px-4`,children:[(0,C.jsx)(i,{variant:`ghost`,iconOnly:(0,C.jsx)(l,{}),expandOnMobile:!1,onClick:P,"aria-label":`Previous attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),(0,C.jsx)(i,{variant:`ghost`,iconOnly:(0,C.jsx)(u,{}),expandOnMobile:!1,onClick:I,"aria-label":`Next attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`})]}),(0,C.jsx)(`div`,{className:`flex items-center justify-center`,onClick:e=>e.stopPropagation(),children:k?(0,C.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,C.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):A?(0,C.jsx)(W,{message:A,filename:n.filename,onDownload:z,downloadDisabled:!E}):U&&E?(0,C.jsx)(te,{url:E}):V&&E&&D!==E?(0,C.jsx)(`img`,{src:E,alt:n.filename,onError:()=>O(E),className:`max-h-[80vh] max-w-[90vw] rounded object-contain`}):H&&E?(0,C.jsx)(`video`,{"data-testid":`video-preview`,src:E,poster:n.thumbnailUrl??void 0,controls:!0,className:`max-h-[80vh] max-w-[90vw] rounded`}):K&&E?(0,C.jsx)(ne,{url:E,filename:n.filename,mimeType:n.mimeType,sizeBytes:n.sizeBytes}):(0,C.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,C.jsx)(f,{className:`h-16 w-16 text-white/60`}),(0,C.jsx)(`p`,{className:`mt-4 text-body-medium-default text-white/90`,children:n.filename}),(0,C.jsx)(`p`,{className:`mt-1 text-body-small-default text-white/60`,children:F(n.sizeBytes)}),(0,C.jsx)(i,{variant:`ghost`,leftIcon:(0,C.jsx)(d,{}),onClick:z,disabled:!E,"aria-label":`Download ${n.filename}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}),(0,C.jsxs)(`div`,{className:`mt-4 flex w-full max-w-[800px] items-center justify-between rounded-lg px-4 py-2`,style:{backgroundColor:`rgba(0, 0, 0, 0.5)`},onClick:e=>e.stopPropagation(),children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,C.jsx)(c,{variant:`body-medium-lighter`,className:`truncate text-white/90`,children:n.filename}),(0,C.jsx)(c,{variant:`body-small-default`,className:`shrink-0 text-white/50`,children:F(n.sizeBytes)}),M&&(0,C.jsxs)(c,{variant:`body-small-default`,className:`shrink-0 text-white/50`,children:[j+1,` / `,s.length]})]}),(0,C.jsx)(i,{variant:`ghost`,iconOnly:(0,C.jsx)(d,{}),onClick:z,disabled:!E,"aria-label":`Download ${n.filename}`,className:`shrink-0 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent max-md:hover:bg-white/10 max-md:active:bg-white/10`,tintColor:`currentColor`})]})]}),document.body)};function Y(e,t){let[n,r]=(0,S.useState)(null),i=(0,S.useCallback)(e=>r(e),[]),a=(0,S.useCallback)(()=>r(null),[]),o=(0,S.useCallback)(e=>r(e),[]);return{openPreview:i,previewModal:n?(0,C.jsx)(J,{open:!0,onClose:a,attachment:n,assistantId:e,siblingAttachments:t,onNavigate:o}):null}}function X(e){return e!=null&&(e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`))}function Z(e){return e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`)?e:g(e)}function oe({href:e,children:t}){return(0,C.jsx)(`a`,{href:e,target:`_blank`,rel:E(e)?void 0:`noopener noreferrer`,onClick:t=>{A(e)&&t.preventDefault()},className:`text-[var(--system-positive-strong)] underline hover:opacity-80`,children:t})}var Q=`my-2 max-w-full max-h-[400px] rounded-lg border border-[var(--border-default)] object-contain`;function $({alt:e}){return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-[var(--surface-sunken)] px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Image failed to load`,e?` (${e})`:``]})}function se({src:e,alt:t}){let[n,r]=(0,S.useState)(!1);return n?(0,C.jsx)($,{alt:t}):(0,C.jsx)(`img`,{src:e,alt:t,onError:()=>r(!0),className:Q})}function ce(e){try{return decodeURIComponent(e)}catch{return e}}function le({src:e,alt:n,attachments:r,assistantId:i,onOpenPreview:a}){let[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(!1),u=ce(e.split(`/`).pop()??``),d=r?.find(e=>e.filename===u);if((0,S.useEffect)(()=>{if(!d||!i||d.id.startsWith(`rehydrated:`))return;let e=!1;return(async()=>{try{let{data:t,error:n}=await y({path:{assistant_id:i,id:d.id},parseAs:`blob`,throwOnError:!1});if(e)return;if(n||!(t instanceof Blob)){l(!0);return}s(URL.createObjectURL(t))}catch(n){e||(l(!0),t(n,{context:`WorkspaceInlineImage`,bestEffort:!0}))}})(),()=>{e=!0,s(e=>(e&&URL.revokeObjectURL(e),null))}},[d,i]),c||!d&&!o)return(0,C.jsx)($,{alt:n||u});if(!o)return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-[var(--surface-sunken)] px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Loading image…`,n?` (${n})`:``]});let f=(0,C.jsx)(`img`,{src:o,alt:n,className:Q});return!d||!a?f:(0,C.jsx)(`button`,{type:`button`,onClick:()=>a(d),className:`cursor-zoom-in appearance-none border-0 bg-transparent p-0`,"aria-label":n?`Expand image: ${n}`:`Expand image`,children:f})}var ue=(0,S.memo)(function({content:e,className:t,hardLineBreaks:n,onVellumLinkClick:r,attachments:i,assistantId:a}){let{openPreview:o,previewModal:s}=Y(a,i);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h,{content:e,className:t,hardLineBreaks:n,linkComponent:(0,S.useCallback)(({href:e,children:t})=>r&&X(e)?(0,C.jsx)(`a`,{href:e,onClick:t=>{t.preventDefault(),e&&r(e,t.currentTarget.textContent??``)},className:`text-[var(--system-positive-strong)] underline hover:opacity-80 cursor-pointer`,children:t}):(0,C.jsx)(oe,{href:e,children:t}),[r]),imageComponent:(0,S.useMemo)(()=>({src:e,alt:t})=>X(e)?(0,C.jsx)(le,{src:e,alt:t,attachments:i,assistantId:a,onOpenPreview:o}):(0,C.jsx)(se,{src:e,alt:t}),[i,a,o]),urlTransform:Z}),s]})});export{L as a,P as c,j as d,I as i,N as l,Y as n,F as o,J as r,z as s,ue as t,M as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/native-file-5Rcj7ogV.js","assets/chunk-jRWAZmH_.js","assets/preload-helper-BewR0kVT.js","assets/dist-D9vTKt742.js","assets/pdf-CuY9CA7Q.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./capture-error-BBsDM05E.js";import{t as n}from"./react-DJZBPgpf.js";import{F as r,t as i}from"./button-D1p5nVKJ.js";import{t as a}from"./preload-helper-BewR0kVT.js";import{t as o}from"./useQuery-B45lW1Kk.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./chevron-left-BMF1xNfR.js";import{t as u}from"./chevron-right-DqqmezXC.js";import{t as d}from"./download-CAuK-nZ6.js";import{t as f}from"./file-DsyJLS2u.js";import{t as p}from"./loader-circle-Cz7opInR.js";import{t as m}from"./x-CkSVp1Ok.js";import{a as h,m as g}from"./src-DQLGZRXb.js";import{n as _,t as v}from"./file-markdown-C-ODMWni.js";import{l as y}from"./sdk.gen-BVgkyBUC.js";import{t as b}from"./dist-D9vTKt742.js";import{t as x}from"./browser-DvAumlJv.js";var S=e(n(),1),ee=e(r(),1),C=s(),w=`width=500,height=600`;function T(e){if(!e)return null;let t;try{let n=typeof window>`u`?`http://localhost`:window.location.origin;t=new URL(e,n)}catch{return null}return t.protocol!==`https:`&&t.protocol!==`http:`?null:t}function E(e){let t=T(e);if(!t)return!1;let n=t.pathname.toLowerCase();return t.searchParams.get(`response_type`)===`code`&&t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)||t.searchParams.has(`client_id`)&&t.searchParams.has(`redirect_uri`)&&/oauth|authorize|auth/.test(n)}function D(e){if(typeof window>`u`)return null;let t=T(e);return!t||t.origin!==window.location.origin?null:`${t.pathname}${t.search}${t.hash}`}function O(e){return T(e)?.href??null}function k(e){if(!E(e))return!1;if(b.isNativePlatform()){let t=O(e);return t?(x(t),!0):!1}let t=window.open(e,`_blank`,w);return t===null?!1:(t.focus(),!0)}function A(e){return k(e)}function j(e){if(k(e))return!0;let t=window.open(e,`_blank`);return t===null?!1:(t.focus(),!0)}function M(e,t){let n=D(e);if(n)return t.push(n),{kind:`routed`};let r=O(e);return r?t.isNative?(x(r),{kind:`opened`}):j(r)?{kind:`opened`}:{kind:`blocked`,url:r}:{kind:`invalid`}}async function N(e,t){if(!t||t.startsWith(`rehydrated:`))return null;try{let{data:n,error:r}=await y({path:{assistant_id:e,id:t},parseAs:`blob`,throwOnError:!1});return!r&&n instanceof Blob?n:null}catch{return null}}async function P(e,t){let{saveFile:n}=await a(async()=>{let{saveFile:e}=await import(`./native-file-5Rcj7ogV.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));if(t){let r=await N(t,e.id);if(r){await n(r,e.filename);return}}e.previewUrl&&await n(e.previewUrl,e.filename)}function F(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?Math.round(n).toString():n.toFixed(1)} ${t[r]}`}function I(e,t){let n=(e||``).toLowerCase(),r=t.split(`.`).pop()?.toLowerCase()??``;return n.startsWith(`image/`)?`image`:n.startsWith(`video/`)?`video`:n.startsWith(`audio/`)?`audio`:n===`application/pdf`||r===`pdf`?`pdf`:n===`application/zip`||n===`application/x-tar`||n===`application/gzip`||[`zip`,`tar`,`gz`,`tgz`,`rar`,`7z`].includes(r)?`archive`:n===`text/csv`||n===`application/vnd.ms-excel`||n===`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`||[`csv`,`xlsx`,`xls`,`numbers`].includes(r)?`spreadsheet`:`ts.tsx.js.jsx.py.rb.go.rs.java.kt.swift.c.cc.cpp.h.hpp.sh.bash.zsh.html.css.scss.json.yaml.yml.toml.xml`.split(`.`).includes(r)?`code`:n===`application/msword`||n===`application/vnd.openxmlformats-officedocument.wordprocessingml.document`||[`doc`,`docx`,`pages`].includes(r)?`document`:n.startsWith(`text/`)||[`txt`,`md`,`rtf`].includes(r)?`text`:`file`}function L(e){let t=e.replace(/\s/g,``),n=t.endsWith(`==`)?2:+!!t.endsWith(`=`);return Math.max(0,Math.floor(t.length*3/4)-n)}function R(e){let t=e.match(/;base64,(.*)$/);if(!t?.[1])return null;let n=atob(t[1]),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function z(e,t=28){if(e.length<=t)return e;let n=Math.max(4,Math.floor((t-1)/2));return`${e.slice(0,n)}…${e.slice(e.length-n)}`}var B=1.5,V=20,H=!1;async function U(){let e=await a(()=>import(`./pdf-CuY9CA7Q.js`),__vite__mapDeps([4,2]));return H||=(e.GlobalWorkerOptions.workerSrc=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${e.version}/legacy/build/pdf.worker.min.mjs`,!0),e}function te({url:e,className:t}){let n=(0,S.useRef)(null),[r,i]=(0,S.useState)(null),[a,o]=(0,S.useState)(0),[s,c]=(0,S.useState)(!0),[l,u]=(0,S.useState)(null),d=(0,S.useRef)(new Map),f=(0,S.useRef)(new Set);(0,S.useEffect)(()=>{let t=!1;async function n(){c(!0),u(null),i(null),o(0),f.current.clear();try{let n=await U(),r;if(e.startsWith(`data:`)){let t=R(e);r=t?{data:t}:e}else r=e;let a=await n.getDocument(r).promise;if(t){a.destroy();return}i(a),o(Math.min(a.numPages,V))}catch{t||u(`Failed to load PDF.`)}finally{t||c(!1)}}return n(),()=>{t=!0}},[e]),(0,S.useEffect)(()=>()=>{r&&r.destroy()},[r]);let m=(0,S.useCallback)(async e=>{if(!r||f.current.has(e))return;let t=d.current.get(e);if(t){f.current.add(e);try{let n=await r.getPage(e),i=n.getViewport({scale:B});t.width=i.width,t.height=i.height,await n.render({canvas:t,viewport:i}).promise}catch{f.current.delete(e)}}},[r]);(0,S.useEffect)(()=>{if(!r||a===0)return;let e=new IntersectionObserver(e=>{for(let t of e){if(!t.isIntersecting)continue;let e=Number(t.target.dataset.page);e&&m(e)}},{root:n.current,rootMargin:`200px`});return d.current.forEach(t=>e.observe(t)),()=>e.disconnect()},[r,a,m]);let h=(0,S.useCallback)(e=>t=>{t?d.current.set(e,t):d.current.delete(e)},[]);return s?(0,C.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,C.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):l?(0,C.jsx)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:(0,C.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:l})}):(0,C.jsx)(`div`,{ref:n,className:`flex max-h-[80vh] flex-col items-center gap-2 overflow-y-auto rounded ${t??``}`,children:Array.from({length:a},(e,t)=>(0,C.jsx)(`canvas`,{ref:h(t+1),"data-page":t+1,className:`w-[90vw] max-w-[800px]`,style:{height:`auto`}},t+1))})}function W({message:e,filename:t,onDownload:n,downloadDisabled:r=!1}){return(0,C.jsxs)(`div`,{className:`w-full max-w-sm rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,C.jsx)(`p`,{className:`text-body-medium-lighter text-white/80`,children:e}),(0,C.jsx)(i,{variant:`ghost`,leftIcon:(0,C.jsx)(d,{}),onClick:n,disabled:r,"aria-label":`Download ${t}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}var G=class extends Error{};async function K(e,t,n){if(t>204800)throw new G;if(e.startsWith(`data:`)){let t=R(e);if(!t)throw Error(`Malformed data URI`);return new TextDecoder().decode(t)}let r=await fetch(e,{signal:n});if(!r.ok)throw Error(`Failed to load file: ${r.status}`);let i=await r.blob();if(i.size>204800)throw new G;return i.text()}function ne({url:e,filename:n,mimeType:r,sizeBytes:i}){let[o,s]=(0,S.useState)({status:`loading`});return(0,S.useEffect)(()=>{let n=new AbortController;return s({status:`loading`}),K(e,i,n.signal).then(e=>{n.signal.aborted||s({status:`ready`,text:e})}).catch(e=>{if(n.signal.aborted)return;let r=e instanceof G;r||t(e,{context:`attachment-text-preview`,bestEffort:!0}),s({status:`error`,tooLarge:r})}),()=>n.abort()},[e,i]),o.status===`loading`?(0,C.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,C.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):o.status===`error`?(0,C.jsx)(W,{message:o.tooLarge?`File too large to preview inline.`:`Failed to load preview.`,filename:n,onDownload:async()=>{let{saveFile:t}=await a(async()=>{let{saveFile:e}=await import(`./native-file-5Rcj7ogV.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));await t(e,n)}}):(0,C.jsx)(`div`,{className:`max-h-[80vh] w-[min(90vw,800px)] overflow-auto rounded-lg p-6`,style:{backgroundColor:`var(--surface-overlay)`,color:`var(--content-default)`},children:(0,C.jsx)(re,{text:o.text,filename:n,mimeType:r})})}function re({text:e,filename:t,mimeType:n}){return _(t,n)?(0,C.jsx)(v,{content:e}):(0,C.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-body-small-default`,children:e})}var ie=new Set([`ts`,`tsx`,`js`,`jsx`,`py`,`json`,`md`,`sh`,`bash`,`html`,`css`,`yaml`,`yml`,`txt`]),ae=new Set([`application/json`,`application/javascript`,`application/xml`]),q=e=>{let t=e.lastIndexOf(`.`);return t===-1||t===e.length-1?``:e.slice(t+1).toLowerCase()},J=({open:e,onClose:t,attachment:n,assistantId:r,siblingAttachments:s,onNavigate:h})=>{let g=(0,S.useRef)(null),_=(0,S.useRef)(null);(0,S.useEffect)(()=>{e&&_.current?.focus()},[e]);let v=!n.previewUrl&&n.id.startsWith(`rehydrated:`),y=e&&!n.previewUrl&&!!r&&!!n.id&&!v,{data:b,isError:x}=o({queryKey:[`attachmentContent`,r,n.id],queryFn:async()=>{let e=await N(r,n.id);if(!e)throw Error(`Failed to load file`);return e},enabled:y,staleTime:1/0,retry:!1}),[w,T]=(0,S.useState)(null);(0,S.useEffect)(()=>{if(!b){T(null);return}let e=URL.createObjectURL(b);return T(e),()=>{URL.revokeObjectURL(e),T(null)}},[b]);let E=n.previewUrl??w,[D,O]=(0,S.useState)(null),k=y&&!w&&!x,A=v?`Preview unavailable — file content was not preserved in chat history.`:x?`Failed to load preview.`:null,j=(0,S.useMemo)(()=>!s||s.length<=1?-1:s.findIndex(e=>e.id===n.id),[s,n.id]),M=j!==-1&&s!=null&&s.length>1,P=(0,S.useCallback)(()=>{!M||!s||!h||h(s[(j-1+s.length)%s.length])},[M,s,j,h]),I=(0,S.useCallback)(()=>{!M||!s||!h||h(s[(j+1)%s.length])},[M,s,j,h]),L=(0,S.useCallback)(e=>{e.key===`Escape`?(e.preventDefault(),t()):e.key===`ArrowLeft`&&M?(e.preventDefault(),P()):e.key===`ArrowRight`&&M&&(e.preventDefault(),I())},[t,P,I,M]),R=(0,S.useCallback)(e=>{e.target===g.current&&t()},[t]),z=(0,S.useCallback)(async()=>{if(!E)return;let{saveFile:e}=await a(async()=>{let{saveFile:e}=await import(`./native-file-5Rcj7ogV.js`).then(e=>e.t);return{saveFile:e}},__vite__mapDeps([0,1,2,3]));await e(E,n.filename)},[E,n.filename]);if(!e)return null;let B=n.mimeType.toLowerCase(),V=B.startsWith(`image/`),H=B.startsWith(`video/`),U=B===`application/pdf`||B===`application/octet-stream`&&n.filename.toLowerCase().endsWith(`.pdf`),G=q(n.filename),K=B.startsWith(`text/`)||ae.has(B)||ie.has(G);return(0,ee.createPortal)((0,C.jsxs)(`div`,{ref:g,role:`dialog`,"aria-modal":`true`,"aria-label":`Preview of ${n.filename}`,className:`fixed inset-0 z-50 flex flex-col items-center justify-center bg-black/80 [-webkit-app-region:no-drag]`,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},onKeyDown:L,onClick:R,children:[(0,C.jsx)(i,{ref:_,variant:`ghost`,iconOnly:(0,C.jsx)(m,{}),expandOnMobile:!1,onClick:t,"aria-label":`Close preview`,className:`absolute right-4 top-4 z-10 h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),M&&(0,C.jsxs)(`div`,{className:`pointer-events-none absolute inset-x-0 top-1/2 z-10 flex -translate-y-1/2 items-center justify-between px-4`,children:[(0,C.jsx)(i,{variant:`ghost`,iconOnly:(0,C.jsx)(l,{}),expandOnMobile:!1,onClick:P,"aria-label":`Previous attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`}),(0,C.jsx)(i,{variant:`ghost`,iconOnly:(0,C.jsx)(u,{}),expandOnMobile:!1,onClick:I,"aria-label":`Next attachment`,className:`pointer-events-auto h-11 w-11 rounded-full bg-white/10 text-white/70 hover:bg-white/20 hover:text-white`,tintColor:`currentColor`})]}),(0,C.jsx)(`div`,{className:`flex items-center justify-center`,onClick:e=>e.stopPropagation(),children:k?(0,C.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,C.jsx)(p,{className:`h-8 w-8 animate-spin text-white/70`})}):A?(0,C.jsx)(W,{message:A,filename:n.filename,onDownload:z,downloadDisabled:!E}):U&&E?(0,C.jsx)(te,{url:E}):V&&E&&D!==E?(0,C.jsx)(`img`,{src:E,alt:n.filename,onError:()=>O(E),className:`max-h-[80vh] max-w-[90vw] rounded object-contain`}):H&&E?(0,C.jsx)(`video`,{"data-testid":`video-preview`,src:E,poster:n.thumbnailUrl??void 0,controls:!0,className:`max-h-[80vh] max-w-[90vw] rounded`}):K&&E?(0,C.jsx)(ne,{url:E,filename:n.filename,mimeType:n.mimeType,sizeBytes:n.sizeBytes}):(0,C.jsxs)(`div`,{className:`flex w-full max-w-sm flex-col items-center rounded-lg border border-white/15 bg-white/[0.08] p-8 text-center`,children:[(0,C.jsx)(f,{className:`h-16 w-16 text-white/60`}),(0,C.jsx)(`p`,{className:`mt-4 text-body-medium-default text-white/90`,children:n.filename}),(0,C.jsx)(`p`,{className:`mt-1 text-body-small-default text-white/60`,children:F(n.sizeBytes)}),(0,C.jsx)(i,{variant:`ghost`,leftIcon:(0,C.jsx)(d,{}),onClick:z,disabled:!E,"aria-label":`Download ${n.filename}`,className:`mt-4 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent`,tintColor:`currentColor`,children:`Download`})]})}),(0,C.jsxs)(`div`,{className:`mt-4 flex w-full max-w-[800px] items-center justify-between rounded-lg px-4 py-2`,style:{backgroundColor:`rgba(0, 0, 0, 0.5)`},onClick:e=>e.stopPropagation(),children:[(0,C.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,C.jsx)(c,{variant:`body-medium-lighter`,className:`truncate text-white/90`,children:n.filename}),(0,C.jsx)(c,{variant:`body-small-default`,className:`shrink-0 text-white/50`,children:F(n.sizeBytes)}),M&&(0,C.jsxs)(c,{variant:`body-small-default`,className:`shrink-0 text-white/50`,children:[j+1,` / `,s.length]})]}),(0,C.jsx)(i,{variant:`ghost`,iconOnly:(0,C.jsx)(d,{}),onClick:z,disabled:!E,"aria-label":`Download ${n.filename}`,className:`shrink-0 text-white/70 hover:bg-white/10 hover:text-white max-md:bg-transparent max-md:hover:bg-white/10 max-md:active:bg-white/10`,tintColor:`currentColor`})]})]}),document.body)};function Y(e,t){let[n,r]=(0,S.useState)(null),i=(0,S.useCallback)(e=>r(e),[]),a=(0,S.useCallback)(()=>r(null),[]),o=(0,S.useCallback)(e=>r(e),[]);return{openPreview:i,previewModal:n?(0,C.jsx)(J,{open:!0,onClose:a,attachment:n,assistantId:e,siblingAttachments:t,onNavigate:o}):null}}function X(e){return e!=null&&(e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`))}function Z(e){return e.startsWith(`vellum://workspace/`)||e.startsWith(`vellum://host/`)?e:g(e)}function oe({href:e,children:t}){return(0,C.jsx)(`a`,{href:e,target:`_blank`,rel:E(e)?void 0:`noopener noreferrer`,onClick:t=>{A(e)&&t.preventDefault()},className:`text-[var(--system-positive-strong)] underline hover:opacity-80`,children:t})}var Q=`my-2 max-w-full max-h-[400px] rounded-lg border border-[var(--border-default)] object-contain`;function $({alt:e}){return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-[var(--surface-sunken)] px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Image failed to load`,e?` (${e})`:``]})}function se({src:e,alt:t}){let[n,r]=(0,S.useState)(!1);return n?(0,C.jsx)($,{alt:t}):(0,C.jsx)(`img`,{src:e,alt:t,onError:()=>r(!0),className:Q})}function ce(e){try{return decodeURIComponent(e)}catch{return e}}function le({src:e,alt:n,attachments:r,assistantId:i,onOpenPreview:a}){let[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(!1),u=ce(e.split(`/`).pop()??``),d=r?.find(e=>e.filename===u);if((0,S.useEffect)(()=>{if(!d||!i||d.id.startsWith(`rehydrated:`))return;let e=!1;return(async()=>{try{let{data:t,error:n}=await y({path:{assistant_id:i,id:d.id},parseAs:`blob`,throwOnError:!1});if(e)return;if(n||!(t instanceof Blob)){l(!0);return}s(URL.createObjectURL(t))}catch(n){e||(l(!0),t(n,{context:`WorkspaceInlineImage`,bestEffort:!0}))}})(),()=>{e=!0,s(e=>(e&&URL.revokeObjectURL(e),null))}},[d,i]),c||!d&&!o)return(0,C.jsx)($,{alt:n||u});if(!o)return(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-[var(--surface-sunken)] px-1.5 py-0.5 text-body-small-default text-[var(--content-tertiary)]`,children:[`Loading image…`,n?` (${n})`:``]});let f=(0,C.jsx)(`img`,{src:o,alt:n,className:Q});return!d||!a?f:(0,C.jsx)(`button`,{type:`button`,onClick:()=>a(d),className:`cursor-zoom-in appearance-none border-0 bg-transparent p-0`,"aria-label":n?`Expand image: ${n}`:`Expand image`,children:f})}var ue=(0,S.memo)(function({content:e,className:t,hardLineBreaks:n,onVellumLinkClick:r,attachments:i,assistantId:a}){let{openPreview:o,previewModal:s}=Y(a,i);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(h,{content:e,className:t,hardLineBreaks:n,linkComponent:(0,S.useCallback)(({href:e,children:t})=>r&&X(e)?(0,C.jsx)(`a`,{href:e,onClick:t=>{t.preventDefault(),e&&r(e,t.currentTarget.textContent??``)},className:`text-[var(--system-positive-strong)] underline hover:opacity-80 cursor-pointer`,children:t}):(0,C.jsx)(oe,{href:e,children:t}),[r]),imageComponent:(0,S.useMemo)(()=>({src:e,alt:t})=>X(e)?(0,C.jsx)(le,{src:e,alt:t,attachments:i,assistantId:a,onOpenPreview:o}):(0,C.jsx)(se,{src:e,alt:t}),[i,a,o]),urlTransform:Z}),s]})});export{L as a,P as c,j as d,I as i,N as l,Y as n,F as o,J as r,z as s,ue as t,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{a as r,t as i}from"./cn-C36Yvcac.js";import{t as a}from"./typography-D5f7kt80.js";import{t as o}from"./createLucideIcon-IRfcSUxS.js";import{t as s}from"./check-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{a as r,t as i}from"./cn-C36Yvcac.js";import{t as a}from"./typography-D5f7kt80.js";import{t as o}from"./createLucideIcon-IRfcSUxS.js";import{t as s}from"./check-DFNrQERi.js";import{a as c,i as l,o as u,r as d,s as f,t as p}from"./dist-D7LHboeT.js";var m=o(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),h=e(t(),1);function g(e){let t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function _(e){let[t,n]=h.useState(void 0);return c(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var v=n(),y=`Checkbox`,[b,x]=f(y),[S,C]=b(y);function w(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=l({prop:n,defaultProp:i??!1,onChange:c,caller:y}),[g,_]=h.useState(null),[b,x]=h.useState(null),C=h.useRef(!1),w=g?!!o||!!g.closest(`form`):!0,T={checked:p,disabled:a,setChecked:m,control:g,setControl:_,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:C,required:u,defaultChecked:N(i)?!1:i,isFormControl:w,bubbleInput:b,setBubbleInput:x};return(0,v.jsx)(S,{scope:t,...T,children:M(f)?f(T):r})}var T=`CheckboxTrigger`,E=h.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...i},a)=>{let{control:o,value:s,disabled:c,checked:l,required:d,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:_,bubbleInput:y}=C(T,e),b=r(a,f),x=h.useRef(l);return h.useEffect(()=>{let e=o?.form;if(e){let t=()=>m(x.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[o,m]),(0,v.jsx)(p.button,{type:`button`,role:`checkbox`,"aria-checked":N(l)?`mixed`:l,"aria-required":d,"data-state":P(l),"data-disabled":c?``:void 0,disabled:c,value:s,...i,ref:b,onKeyDown:u(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:u(n,e=>{m(e=>N(e)?!0:!e),y&&_&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})});E.displayName=T;var D=h.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(w,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(E,{...d,ref:t,__scopeCheckbox:n}),e&&(0,v.jsx)(j,{__scopeCheckbox:n})]})})});D.displayName=y;var O=`CheckboxIndicator`,k=h.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=C(O,n);return(0,v.jsx)(d,{present:r||N(a.checked)||a.checked===!0,children:(0,v.jsx)(p.span,{"data-state":P(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});k.displayName=O;var A=`CheckboxBubbleInput`,j=h.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:i,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:s,required:c,disabled:l,name:u,value:d,form:f,bubbleInput:m,setBubbleInput:y}=C(A,e),b=r(n,y),x=g(o),S=_(i);h.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!a.current;if(x!==o&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=N(o),n.call(e,N(o)?!1:o),e.dispatchEvent(t)}},[m,x,o,a]);let w=h.useRef(N(o)?!1:o);return(0,v.jsx)(p.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:s??w.current,required:c,disabled:l,name:u,value:d,form:f,...t,tabIndex:-1,ref:b,style:{...t.style,...S,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});j.displayName=A;function M(e){return typeof e==`function`}function N(e){return e===`indeterminate`}function P(e){return N(e)?`indeterminate`:e?`checked`:`unchecked`}function F({checked:e,onCheckedChange:t,label:n,helperText:r,disabled:o=!1,id:c,name:l,className:u,ref:d,"aria-label":f,...p}){let g=(0,h.useId)(),_=c??g,y=n?`${_}-label`:void 0,b=r?`${_}-helper`:void 0,x=e===`indeterminate`,S=i(`inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-[4px]`,`border transition-colors outline-none cursor-pointer`,`keyboard-focus:ring-2 keyboard-focus:ring-[var(--ring)] keyboard-focus:ring-offset-0`,`bg-[var(--surface-lift)] border-[var(--border-base)]`,`data-[state=checked]:bg-[var(--system-positive-strong)] data-[state=checked]:border-transparent`,`data-[state=indeterminate]:bg-[var(--system-positive-strong)] data-[state=indeterminate]:border-transparent`,`disabled:cursor-not-allowed disabled:bg-[var(--surface-overlay)]`,`disabled:data-[state=checked]:bg-[var(--surface-overlay)]`,`disabled:data-[state=indeterminate]:bg-[var(--surface-overlay)]`,`disabled:border-[var(--border-base)]`),C=i(`h-3 w-3`,o?`text-[color:var(--content-disabled)]`:`text-[color:var(--aux-white)]`),w=(0,v.jsx)(D,{...p,ref:d,id:_,name:l,checked:e,disabled:o,onCheckedChange:t,"aria-label":n?void 0:f,"aria-labelledby":n?y:void 0,"aria-describedby":b,"data-slot":`checkbox`,className:S,children:(0,v.jsx)(k,{forceMount:!0,className:`flex items-center justify-center`,children:x?(0,v.jsx)(m,{className:C,strokeWidth:3,"aria-hidden":`true`}):e===!0?(0,v.jsx)(s,{className:C,strokeWidth:3,"aria-hidden":`true`}):null})});return!n&&!r?(0,v.jsx)(`span`,{"data-slot":`checkbox`,className:u,children:w}):(0,v.jsxs)(`div`,{"data-slot":`checkbox`,className:i(`flex gap-2.5`,r?`items-start`:`items-center`,u),children:[w,(0,v.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[n?(0,v.jsx)(a,{as:`label`,variant:`body-medium-default`,id:y,htmlFor:_,className:i(`cursor-pointer select-none`,o?`cursor-not-allowed text-[color:var(--content-disabled)]`:`text-[color:var(--content-default)]`),children:n}):null,r?(0,v.jsx)(`span`,{id:b,className:`text-body-small-default text-[color:var(--content-secondary)]`,children:r}):null]})]})}export{F as t};
|
package/dist/assets/{client-feature-flag-store-Cah1sUgk.js → client-feature-flag-store-C46PkLyX.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./create-selectors-
|
|
1
|
+
import{n as e,t}from"./create-selectors-8NePGNlX.js";import{i as n,r,s as i}from"./feature-flag-catalog-BxFIDBSQ.js";var a=`vellum:ff:`,o=`vellum:ff-str:`;function s(){if(typeof window>`u`)return{};let e={};try{for(let t of Object.keys(r)){let n=localStorage.getItem(a+t);n!==null&&(e[t]=n===`true`)}}catch{}return e}function c(){if(typeof window>`u`)return{};let e={};try{for(let t of Object.keys(n)){let n=localStorage.getItem(o+t);n!==null&&(e[t]=n)}}catch{}return e}var l=s(),u=c(),d=i(`client`),f=t(e()(e=>{let t=e;return{...r,...l,...d.bool,stringFlags:{...n,...u,...d.str},hydrated:!1,setFlags:t=>e(e=>{let n=s(),r={...t,...n,...d.bool};return Object.keys(r).some(t=>r[t]!==e[t])?{...r,hydrated:!0}:e.hydrated?e:{hydrated:!0}}),setFlag:(t,n)=>{try{localStorage.setItem(a+t,String(n))}catch{}e({[t]:d.bool[t]??n})},clearOverride:t=>{try{localStorage.removeItem(a+t)}catch{}let n=d.bool[t]??r[t];n!==void 0&&e({[t]:n})},setStringFlags:e=>t(t=>{let n=c(),r={...e,...n,...d.str},i=t.stringFlags;return Object.keys(r).some(e=>r[e]!==i[e])?{stringFlags:r}:t}),setStringFlag:(e,n)=>{try{localStorage.setItem(o+e,n)}catch{}t(t=>({stringFlags:{...t.stringFlags,[e]:d.str[e]??n}}))},clearStringOverride:e=>{try{localStorage.removeItem(o+e)}catch{}let r=d.str[e]??n[e];t(t=>({stringFlags:{...t.stringFlags,[e]:r??``}}))}}}));export{f as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./platform-detection-
|
|
1
|
+
import{n as e,t}from"./platform-detection-xyFuSZad.js";var n={browser_family:`x-vellum-browser-family`,browser_version:`x-vellum-browser-version`,os:`x-vellum-client-os`,interface_version:`x-vellum-interface-version`},r=/^[a-z0-9._-]{1,64}$/;function i(e){let t=e?.trim().toLowerCase();if(t)return r.test(t)?t:void 0}var a=null;function o(){return a||(a=crypto.randomUUID(),a)}var s=null;function c(){if(s)return s;let r=t(),a=[[n.browser_family,r.family],[n.browser_version,r.version],[n.os,e()],[n.interface_version,void 0]],o={};for(let[e,t]of a){let n=i(t);n&&(o[e]=n)}return s=o,o}function l(){return{"X-Vellum-Client-Id":o(),"X-Vellum-Interface-Id":`web`,...c()}}export{l as n,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{F as n,t as r}from"./button-D1p5nVKJ.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-D5f7kt80.js";import{t as o}from"./loader-circle-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{F as n,t as r}from"./button-D1p5nVKJ.js";import{t as i}from"./jsx-runtime-CVSDxk6A.js";import{t as a}from"./typography-D5f7kt80.js";import{t as o}from"./loader-circle-Cz7opInR.js";import{t as s}from"./x-CkSVp1Ok.js";import"./src-DQLGZRXb.js";import{t as c}from"./panel-item-DvJGTiJi.js";import{Pr as l,ki as u}from"./index-hP3p8VUv.js";var d=e(t(),1),f=e(n(),1),p=i();function m({icon:e,title:t,subtitle:n,shortcutHint:r,isSelected:i,onClick:a,surface:o=`overlay`}){let s=e;return o===`window`?(0,p.jsxs)(`button`,{type:`button`,role:`option`,"aria-current":i?`page`:void 0,"aria-selected":i,onClick:a,className:[`flex h-10 w-full items-center gap-3 rounded-md px-3 text-left text-sm font-medium outline-none transition-colors`,i?`bg-[var(--surface-active)] text-[var(--content-default)]`:`text-[var(--content-secondary)] hover:bg-[var(--surface-overlay)] hover:text-[var(--content-default)]`].join(` `),children:[s?(0,p.jsx)(s,{size:16,"aria-hidden":!0,className:i?`shrink-0 text-[var(--content-default)]`:`shrink-0 text-[var(--content-tertiary)]`}):null,(0,p.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`truncate`,children:t}),n?(0,p.jsx)(`span`,{className:`shrink-0 truncate text-xs text-[var(--content-tertiary)]`,children:n}):null,r?(0,p.jsx)(`span`,{className:`ml-auto shrink-0 text-xs text-[var(--content-tertiary)]`,children:r}):null]})]}):(0,p.jsx)(c,{icon:e,label:(0,p.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`truncate`,children:t}),n?(0,p.jsx)(`span`,{className:`shrink-0 truncate text-[var(--content-tertiary)] text-body-small-default`,children:n}):null,r?(0,p.jsx)(`span`,{className:`ml-auto shrink-0 text-[var(--content-tertiary)] text-body-small-default`,children:r}):null]}),active:i,onSelect:a,className:`px-3 py-2`})}var h=({isOpen:e,onClose:t,query:n,onQueryChange:i,selectedIndex:c,sections:h,isSearching:g=!1,onItemSelect:_,onKeyDown:v,surface:y=`overlay`})=>{let b=l(),x=(0,d.useRef)(null),S=(0,d.useRef)(null),C=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(e){let e=requestAnimationFrame(()=>{S.current?.focus()});return()=>cancelAnimationFrame(e)}},[e]),(0,d.useEffect)(()=>{if(!e||!C.current)return;let t=C.current.querySelector(`[aria-current='page']`);t&&t.scrollIntoView({block:`nearest`})},[e,c]);let w=(0,d.useCallback)(e=>{e.target===x.current&&t()},[t]);if(!e)return null;let T=0,E=y===`window`,D=b&&!E,O=(0,p.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-[var(--border-base)] px-4 py-3`,children:[g?(0,p.jsx)(o,{size:16,"aria-hidden":!0,className:`shrink-0 animate-spin text-[var(--content-tertiary)]`}):(0,p.jsx)(u,{size:16,"aria-hidden":!0,className:`shrink-0 text-[var(--content-tertiary)]`}),(0,p.jsx)(`input`,{ref:S,type:`text`,value:n,onChange:e=>i(e.target.value),placeholder:`Search conversations, memories…`,className:E?`min-w-0 flex-1 bg-transparent text-sm font-medium text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`:`min-w-0 flex-1 bg-transparent text-body-medium-lighter text-[var(--content-default)] placeholder:text-[var(--content-tertiary)] outline-none`,"aria-label":`Search`}),n?D?(0,p.jsx)(`button`,{type:`button`,className:`shrink-0 text-body-medium-lighter text-[var(--content-tertiary)]`,onClick:()=>i(``),"aria-label":`Clear search`,children:`Clear`}):E?(0,p.jsx)(`button`,{type:`button`,className:`flex size-7 shrink-0 items-center justify-center rounded-md text-[var(--content-tertiary)] transition-colors hover:bg-[var(--surface-overlay)] hover:text-[var(--content-default)]`,"aria-label":`Clear search`,onClick:()=>i(``),children:(0,p.jsx)(s,{size:16,"aria-hidden":!0})}):(0,p.jsx)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,p.jsx)(s,{}),"aria-label":`Clear search`,onClick:()=>i(``),tintColor:`var(--content-tertiary)`}):D?null:(0,p.jsx)(`kbd`,{className:E?`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-xs font-medium text-[var(--content-secondary)]`:`shrink-0 rounded-md border border-[var(--border-base)] bg-[var(--surface-active)] px-1.5 py-0.5 text-label-small-default text-[var(--content-tertiary)]`,children:`⌘K`}),D?(0,p.jsx)(r,{variant:`ghost`,size:`compact`,iconOnly:(0,p.jsx)(s,{}),expandOnMobile:!1,"aria-label":`Close search`,onClick:t,tintColor:`var(--content-tertiary)`}):null]}),k=(0,p.jsx)(`div`,{ref:C,className:D?`flex-1 overflow-y-auto overscroll-contain p-2`:`max-h-[360px] overflow-y-auto overscroll-contain p-2`,role:`listbox`,children:h.length===0?(0,p.jsx)(`div`,{className:`px-3 py-6 text-center`,children:(0,p.jsx)(a,{variant:`body-medium-lighter`,className:`text-[var(--content-tertiary)]`,children:g?`Searching…`:`No results`})}):h.map(e=>(0,p.jsxs)(`div`,{role:`group`,"aria-label":e.label,children:[(0,p.jsx)(a,{variant:`label-small-default`,as:`div`,className:E?`px-3 pb-1 pt-2 text-xs font-semibold text-[var(--content-tertiary)]`:`px-3 pb-1 pt-2 text-[var(--content-tertiary)]`,children:e.label}),e.items.map(e=>{let t=T++;return(0,p.jsx)(m,{icon:e.icon,title:e.title,subtitle:e.subtitle,shortcutHint:D?void 0:e.shortcutHint,isSelected:t===c,onClick:()=>_?.(e,t),surface:y},e.id)})]},e.id))});if(D)return(0,p.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col bg-[var(--surface-lift)]`,role:`dialog`,"aria-modal":`true`,"aria-label":`Search`,onKeyDown:v,style:{paddingTop:`var(--safe-area-inset-top, env(safe-area-inset-top, 0px))`,paddingBottom:`var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))`,paddingLeft:`var(--safe-area-inset-left, env(safe-area-inset-left, 0px))`,paddingRight:`var(--safe-area-inset-right, env(safe-area-inset-right, 0px))`},children:[O,k]});let A=(0,p.jsx)(`div`,{ref:x,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,className:y===`window`?`flex h-full w-full items-start justify-center bg-transparent p-3`:`fixed inset-0 z-50 flex items-start justify-center bg-black/40 pt-[15vh]`,onClick:w,onKeyDown:v,children:(0,p.jsxs)(`div`,{className:`flex w-full max-w-[560px] flex-col overflow-hidden rounded-xl border border-[var(--border-base)] bg-[var(--surface-base)] shadow-xl`,children:[O,k]})});return y===`window`?A:(0,f.createPortal)(A,document.body)};export{h as CommandPalette};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{ct as r}from"./local-mode-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./jsx-runtime-CVSDxk6A.js";import{ct as r}from"./local-mode-grqHUoNh.js";import{n as i}from"./resolved-assistants-store-BSZbT8Ju.js";import{D as a,O as o,i as s,n as c,o as l}from"./auth-store-CWjr3UVp.js";import{t as u}from"./client-feature-flag-store-C46PkLyX.js";import{$n as d,_n as f,hr as p,on as m,vn as h,xn as g,xr as _}from"./index-hP3p8VUv.js";import{CommandPalette as v}from"./command-palette-Ho1OyvMr.js";var y=e(t(),1),b=n(),x=()=>void 0,S=e=>void 0,C=e=>{switch(e.id){case`action-new-conversation`:return{kind:`newConversation`};case`action-current-conversation`:return{kind:`currentConversation`};case`action-settings`:return{kind:`openSettings`};case`action-library`:return{kind:`openLibrary`};case`action-intelligence`:return{kind:`openIdentity`};case`action-back`:return{kind:`navigateBack`};case`action-forward`:return{kind:`navigateForward`};case`action-zoom-in`:return{kind:`zoomIn`};case`action-zoom-out`:return{kind:`zoomOut`};case`action-actual-size`:return{kind:`actualSize`};default:return e.id.startsWith(`conv-`)?{kind:`openConversation`,conversationId:e.id.slice(5)}:e.id.startsWith(`search-conv-`)?{kind:`openConversation`,conversationId:e.id.slice(12)}:e.id.startsWith(`search-schedule-`)||e.id.startsWith(`search-contact-`)?{kind:`openIdentity`}:null}};function w(){let e=c.use.sessionStatus(),t=l(),n=s();_(),d(!t),p({sessionStatus:e,hasPlatformSession:n});let w=i.use.assistants(),T=i.use.activeAssistantId(),E=i.use.selectedAssistantId(),D=a.use.currentOrganizationId(),O=u.use.multiPlatformAssistant(),k=(0,y.useMemo)(()=>{let e=O&&!r()&&D?o(D):T;if(!e)return null;let t=w.find(t=>t.id===e);return t?{id:t.id,name:t.name}:null},[O,T,w,D,E]),A=k?.id??null,{conversations:j}=g(A,!0),M=(0,y.useCallback)(e=>{let t=C(e);t&&h(t)},[]),{commandPalette:N,mergedSections:P,handleItemSelect:F}=m({assistantId:A,assistantName:k?.name,conversations:j,activeConversationId:void 0,startNewConversation:x,switchConversation:x,navigate:S,navigateToSettings:x,isOpen:!0,onClose:()=>{f()},onItemSelect:M});return(0,b.jsx)(`div`,{className:`h-screen w-screen bg-transparent`,children:(0,b.jsx)(v,{isOpen:!0,surface:`window`,onClose:N.close,query:N.query,onQueryChange:N.setQuery,selectedIndex:N.selectedIndex,sections:P,isSearching:N.isSearching,onItemSelect:F,onKeyDown:N.handleKeyDown})})}export{w as CommandPaletteWindowPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./button-D1p5nVKJ.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{t as n}from"./card-Bv5O5juh.js";import{t as r}from"./createLucideIcon-IRfcSUxS.js";import{r as i}from"./middleware-pbPQ0upo.js";import{t as a}from"./bug-BsuQ5ciQ.js";import{t as o}from"./external-link-Dqpx9nRm.js";import{t as s}from"./globe-4qSOWE2N.js";import{t as c}from"./sparkles-PGiR5v1g.js";import{t as l}from"./tag-Dawxigu4.js";import{Fi as u,bi as d,f,m as p,mi as m,n as h,p as g,ra as _,ut as v}from"./index-hP3p8VUv.js";var y=r(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),b=t();function x({size:e=24,className:t,style:n}){return(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,b.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})})}function S({size:e=24,className:t,style:n}){return(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,b.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})})}function C({size:e=24,className:t,style:n}){return(0,b.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,width:e,height:e,fill:`currentColor`,className:t,style:n,"aria-hidden":!0,children:(0,b.jsx)(`path`,{d:`M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814ZM9.545 15.568V8.432L15.818 12l-6.273 3.568Z`})})}function w(){return(0,b.jsx)(n,{padding:`lg`,className:`bg-[var(--surface-lift)]`,children:(0,b.jsxs)(`div`,{className:`relative`,children:[(0,b.jsx)(`div`,{className:`pointer-events-none absolute -right-16 -top-16 h-64 w-64 rounded-full opacity-30 blur-3xl`,style:{background:`radial-gradient(circle, var(--system-mid-weak) 0%, transparent 70%)`},"aria-hidden":!0}),(0,b.jsxs)(`div`,{className:`relative flex flex-col items-start gap-3`,children:[(0,b.jsxs)(l,{tone:`neutral`,children:[(0,b.jsx)(u,{className:`h-3.5 w-3.5`}),`Community`]}),(0,b.jsx)(`h1`,{className:`text-[28px] font-semibold leading-tight tracking-tight text-[var(--content-emphasised)]`,children:`Build with us, in the open.`}),(0,b.jsx)(`p`,{className:`max-w-xl text-body-medium-default text-[color:var(--content-tertiary)]`,children:`Vellum is built in the open with a growing community of developers, designers, and tinkerers. Here's how to get involved.`})]})]})})}function T({icon:e,text:t}){return(0,b.jsxs)(`li`,{className:`flex items-center gap-3`,children:[(0,b.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-md bg-[var(--surface-base)]`,children:(0,b.jsx)(e,{size:14,className:`text-[var(--content-secondary)]`,"aria-hidden":!0})}),(0,b.jsx)(`span`,{className:`text-body-medium-lighter text-[color:var(--content-secondary)]`,children:t})]})}function E({accentColor:t,iconColor:r=`var(--aux-white)`,label:a,icon:o,title:s,subtitle:c,benefits:l,primaryAction:u,secondaryAction:d}){return(0,b.jsx)(n,{padding:`lg`,className:`flex-1`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,b.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg`,style:{backgroundColor:t,color:r},children:o}),(0,b.jsx)(`span`,{className:`text-label-medium-default uppercase tracking-wider text-[color:var(--content-tertiary)]`,children:a})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,b.jsx)(`h2`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:s}),(0,b.jsx)(`p`,{className:`text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:c})]}),(0,b.jsx)(`ul`,{className:`flex flex-col gap-3`,children:l.map(({icon:e,text:t})=>(0,b.jsx)(T,{icon:e,text:t},t))}),(0,b.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,b.jsxs)(e,{onClick:u.onClick,children:[u.icon,u.label]}),d&&(0,b.jsxs)(e,{variant:`ghost`,onClick:()=>window.open(d.href,`_blank`,`noopener,noreferrer`),children:[d.label,(0,b.jsx)(i,{className:`h-3.5 w-3.5`})]})]})]})})}function D({icon:e,iconBg:t,iconColor:r=`white`,title:i,description:a,href:s}){return(0,b.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,className:`flex flex-1 cursor-pointer`,children:(0,b.jsx)(n,{className:`flex-1 transition-shadow hover:shadow-md`,padding:`lg`,children:(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,b.jsx)(`span`,{className:`flex size-10 items-center justify-center rounded-lg`,style:{backgroundColor:t,color:r},children:e}),(0,b.jsx)(o,{size:14,className:`text-[var(--content-tertiary)]`,"aria-hidden":!0})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,b.jsx)(`span`,{className:`text-title-medium text-[var(--content-emphasised)]`,children:i}),(0,b.jsx)(`p`,{className:`text-body-medium-lighter text-[color:var(--content-tertiary)]`,children:a})]})]})})})}function O(){let{handleStar:e}=p();return(0,b.jsxs)(`div`,{className:`space-y-6`,children:[(0,b.jsx)(w,{}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-2`,children:[(0,b.jsx)(E,{accentColor:`var(--content-emphasised)`,iconColor:`var(--surface-base)`,label:`Open Source`,icon:(0,b.jsx)(x,{size:20}),title:`Vellum is open source`,subtitle:`Read the source, star the repo, and contribute fixes and features on GitHub.`,benefits:[{icon:d,text:`Star the repo to follow updates`},{icon:a,text:`Open issues and report bugs`},{icon:y,text:`Contribute fixes and new features`}],primaryAction:{label:`Star on GitHub`,icon:(0,b.jsx)(d,{size:16}),onClick:e},secondaryAction:{label:`View source`,href:g}}),(0,b.jsx)(E,{accentColor:`#5865F2`,label:`Discord`,icon:(0,b.jsx)(v,{size:20}),title:`Join our community`,subtitle:`Talk to the team, share feedback, request features, and get answers faster.`,benefits:[{icon:_,text:`Talk directly with the team`},{icon:c,text:`Share feedback and request features`},{icon:m,text:`Get answers faster from the community`}],primaryAction:{label:`Join Discord`,icon:(0,b.jsx)(v,{size:16,style:{color:`currentColor`}}),onClick:f}})]}),(0,b.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,b.jsx)(`h2`,{className:`text-label-medium-default uppercase tracking-wider text-[color:var(--content-tertiary)]`,children:`More from Vellum`}),(0,b.jsxs)(`div`,{className:`grid grid-cols-1 gap-4 md:grid-cols-3`,children:[(0,b.jsx)(D,{icon:(0,b.jsx)(s,{size:20}),iconBg:`#22c55e`,title:`Community Hub`,description:`Showcases, guides, and projects shared by the community.`,href:h}),(0,b.jsx)(D,{icon:(0,b.jsx)(S,{size:20}),iconBg:`var(--content-default)`,iconColor:`var(--surface-base)`,title:`Follow on X`,description:`Product updates, releases, and behind-the-scenes.`,href:`https://x.com/vellum_ai`}),(0,b.jsx)(D,{icon:(0,b.jsx)(C,{size:20}),iconBg:`#ef4444`,title:`YouTube channel`,description:`Walkthroughs, tutorials, and product deep-dives.`,href:`https://www.youtube.com/@Vellum_AI`})]})]})]})}export{O as CommunityPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./button-D1p5nVKJ.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{t as n}from"./loader-circle-
|
|
1
|
+
import{t as e}from"./button-D1p5nVKJ.js";import{t}from"./jsx-runtime-CVSDxk6A.js";import{t as n}from"./loader-circle-Cz7opInR.js";import{t as r}from"./triangle-alert-Z0Gq0IuB.js";import{t as i}from"./modal-CGJ7DWt0.js";var a=t(),o=`data-confirm-dialog-confirm`;function s({open:t,title:s,message:c,confirmLabel:l=`Confirm`,cancelLabel:u=`Cancel`,destructive:d=!1,isPending:f=!1,onConfirm:p,onCancel:m}){return(0,a.jsx)(i.Root,{open:t,onOpenChange:e=>{!e&&!f&&m()},children:(0,a.jsxs)(i.Content,{size:`sm`,hideCloseButton:!0,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[${o}]`);t&&(e.preventDefault(),t.focus())},onEscapeKeyDown:e=>{e.preventDefault(),e.stopPropagation(),f||m()},children:[(0,a.jsx)(i.Header,{children:(0,a.jsx)(i.Title,{icon:d?r:void 0,children:s})}),(0,a.jsx)(i.Body,{children:(0,a.jsx)(i.Description,{children:c})}),(0,a.jsxs)(i.Footer,{children:[(0,a.jsx)(e,{variant:`outlined`,onClick:m,disabled:f,children:u}),(0,a.jsx)(e,{variant:d?`danger`:`primary`,onClick:p,disabled:f,leftIcon:f?(0,a.jsx)(n,{className:`animate-spin`}):void 0,[o]:``,children:l})]})]})})}export{s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./card-Bv5O5juh.js";import{t as u}from"./link-2-
|
|
1
|
+
import{o as e}from"./chunk-jRWAZmH_.js";import{t}from"./react-DJZBPgpf.js";import{t as n}from"./button-D1p5nVKJ.js";import{d as r,h as i}from"./chunk-5KNZJZUH-DdS6bb-3.js";import{n as a}from"./QueryClientProvider-DKhXIxGb.js";import{t as o}from"./useMutation-Lj4VunQV.js";import{t as s}from"./jsx-runtime-CVSDxk6A.js";import{t as c}from"./typography-D5f7kt80.js";import{t as l}from"./card-Bv5O5juh.js";import{t as u}from"./link-2-4bMylQ5v.js";import{t as d}from"./loader-circle-Cz7opInR.js";import{t as f}from"./triangle-alert-Z0Gq0IuB.js";import{n as p}from"./toast-Cf0TcOqg.js";import{c as m}from"./routes-DT0Mj7fI.js";import{t as h}from"./use-active-assistant-id-BNRMo_Mi.js";import{n as g}from"./a2a-invite-DOnZrhrr.js";import{r as _}from"./contacts-gateway-B-60fhT6.js";var v=e(t(),1),y=s();function b(e){let t=e[0];return typeof t==`object`&&!!t&&t._id===`contactsGet`}function x(e,t){switch(e){case`expired`:case`not_found`:return`This invite link has expired or already been used.`;case`already_redeemed_by_other`:return`This invite has already been claimed by someone else.`;case`sender_not_found`:return`The sender's assistant could not be found.`;case`not_platform_managed`:return`A2A invite links are only supported for platform-hosted assistants.`;default:return t||`Something went wrong. Please try again.`}}function S(){return(0,y.jsx)(C,{assistantId:h()})}function C({assistantId:e}){let t=r(),s=a(),[h]=i(),S=(0,v.useMemo)(()=>g(h),[h]),C=o({mutationFn:()=>{if(!S)throw Error(`Invalid invite link`);return _(e,{senderAssistantId:S.senderAssistantId,token:S.token})},onSuccess:e=>{e.success&&(s.invalidateQueries({predicate:e=>b(e.queryKey)}),e.alreadyConnected?p(`Already connected`):p(`Connected!`),t(m.contacts.root))}}),w=(0,v.useCallback)(()=>{t(m.contacts.root)},[t]),T=(0,v.useCallback)(()=>{C.mutate()},[C]),E=(0,v.useMemo)(()=>C.isError?C.error instanceof Error?C.error.message:`Something went wrong. Please try again.`:C.data&&!C.data.success?x(C.data.errorCode,C.data.error):null,[C.isError,C.error,C.data]);return S?(0,y.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,y.jsx)(l,{className:`w-full max-w-md`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(u,{className:`h-6 w-6`,style:{color:`var(--content-secondary)`}}),(0,y.jsx)(c,{variant:`title-small`,children:`Connect assistants`})]}),(0,y.jsx)(c,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`Accepting this link will create a trusted A2A connection between your assistant and the sender's.`}),E&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md p-3`,style:{backgroundColor:`var(--surface-negative-subtle)`,color:`var(--system-negative-strong)`},children:[(0,y.jsx)(f,{className:`h-4 w-4 shrink-0`}),(0,y.jsx)(c,{variant:`body-small-default`,children:E})]}),(0,y.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,y.jsx)(n,{variant:`primary`,onClick:T,disabled:C.isPending,children:C.isPending?(0,y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(d,{className:`h-4 w-4 animate-spin`}),`Connecting…`]}):`Connect`}),(0,y.jsx)(n,{variant:`outlined`,onClick:w,disabled:C.isPending,children:`Cancel`})]})]})})}):(0,y.jsx)(`div`,{className:`flex min-h-full items-center justify-center p-6`,children:(0,y.jsx)(l,{className:`w-full max-w-md`,children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 p-6`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,y.jsx)(f,{className:`h-6 w-6`,style:{color:`var(--system-negative-strong)`}}),(0,y.jsx)(c,{variant:`title-small`,children:`Invalid invite link`})]}),(0,y.jsx)(c,{variant:`body-medium-lighter`,style:{color:`var(--content-secondary)`},children:`The link you followed is missing required parameters and cannot be used.`}),(0,y.jsx)(`div`,{className:`flex gap-2 pt-2`,children:(0,y.jsx)(n,{variant:`primary`,onClick:w,children:`Go to Contacts`})})]})})})}export{S as ConnectPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./card-Bv5O5juh.js";import{t as n}from"./checkbox-
|
|
1
|
+
import{t as e}from"./jsx-runtime-CVSDxk6A.js";import{t}from"./card-Bv5O5juh.js";import{t as n}from"./checkbox-KBE-OAEZ.js";import{c as r,s as i}from"./routes-DT0Mj7fI.js";import{t as a}from"./setting-row-QKgqbQ4U.js";var o=e(),s=[`[&_button[data-state=checked]]:bg-[var(--primary-base)]`,`[&_svg]:text-[var(--content-inset)]`,`[&_button[data-state=unchecked]]:bg-[var(--surface-base)]`,`[&_button[data-state=unchecked]]:border-[var(--border-element)]`].join(` `),c=`mb-2.5 ml-1 text-body-small-default font-medium uppercase tracking-wider text-[var(--content-tertiary)]`,l={privacy:{href:r.docs.legal.privacyPolicy,text:`Privacy and AI Data Sharing Policy`,aria:`I agree to the Privacy and AI Data Sharing Policy`},tos:{href:r.docs.legal.termsOfUse,text:`Terms of Service`,aria:`I agree to the Terms of Service`}};function u({kind:e,checked:t,onChange:r}){let a=l[e];return(0,o.jsx)(n,{checked:t,onCheckedChange:e=>r(e===!0),label:(0,o.jsxs)(`span`,{className:`text-body-medium-lighter text-[var(--content-default)]`,children:[`I agree to the`,` `,(0,o.jsx)(`a`,{href:i(a.href),target:`_blank`,rel:`noreferrer`,className:`underline`,children:a.text})]}),"aria-label":a.aria,className:s})}function d(){return(0,o.jsx)(`div`,{className:`h-px bg-[var(--surface-active)] dark:bg-[var(--surface-lift)]`})}function f({notes:e}){return!e||e.length===0?null:(0,o.jsxs)(`div`,{className:`rounded-r-md border-l-2 border-[var(--content-secondary)] bg-[var(--surface-base)] py-3 pl-3.5 pr-3.5`,children:[(0,o.jsx)(`p`,{className:`text-body-small-default font-medium text-[var(--content-secondary)]`,children:`What's changed`}),e.length===1?(0,o.jsx)(`p`,{className:`mt-1.5 text-body-medium-lighter text-[var(--content-default)]`,children:e[0]}):(0,o.jsx)(`ul`,{className:`mt-2 flex flex-col gap-1.5`,children:e.map(e=>(0,o.jsxs)(`li`,{className:`flex gap-2.5 text-body-medium-lighter text-[var(--content-default)]`,children:[(0,o.jsx)(`span`,{"aria-hidden":!0,className:`mt-[0.5em] h-1 w-1 flex-none rounded-full bg-[var(--content-tertiary)]`}),(0,o.jsx)(`span`,{children:e})]},e))})]})}function p({electron:e,showAnalytics:n=!0,showDiagnostics:r=!0,shareAnalytics:i,shareDiagnostics:s,onShareAnalyticsChange:l,onShareDiagnosticsChange:u,className:f,style:p}){return(0,o.jsxs)(`section`,{className:f,style:p,children:[(0,o.jsx)(`p`,{className:c,children:`Privacy preferences`}),(0,o.jsx)(t,{padding:e?`sm`:`md`,className:`w-full`,children:(0,o.jsxs)(`div`,{className:`flex flex-col ${e?`gap-3`:`gap-4`}`,children:[n&&(0,o.jsx)(a,{label:`Share Analytics`,helperText:`Send aggregated product usage data`,checked:i,onChange:l}),n&&r&&(0,o.jsx)(d,{}),r&&(0,o.jsx)(a,{label:`Share Diagnostics`,helperText:`Send crash reports, conversation traces, and session replay data`,checked:s,onChange:u})]})})]})}function m({electron:e,showPrivacy:n=!0,showTos:r=!0,privacyConsent:i,tosAccepted:a,onPrivacyChange:s,onTosChange:l,privacyNotes:d,tosNotes:p,className:m,style:h}){return(0,o.jsxs)(`section`,{className:m,style:h,children:[(0,o.jsx)(`p`,{className:c,children:`Agreements`}),(0,o.jsx)(t,{padding:e?`sm`:`md`,className:`w-full`,children:(0,o.jsxs)(`div`,{className:`flex flex-col ${e?`gap-3.5`:`gap-4`}`,children:[n&&(0,o.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,o.jsx)(f,{notes:d}),(0,o.jsx)(u,{kind:`privacy`,checked:i,onChange:s})]}),r&&(0,o.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,o.jsx)(f,{notes:p}),(0,o.jsx)(u,{kind:`tos`,checked:a,onChange:l})]})]})})]})}export{p as n,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./api-errors-
|
|
1
|
+
import{n as e,r as t,t as n}from"./api-errors-D2CsZ6Xx.js";import{t as r}from"./client.gen-BUTTddQZ.js";import{c as i,s as a,u as o}from"./sdk.gen-BhtkuoSl.js";async function s(r,i){let{data:a,error:s,response:c}=await o({path:{assistant_id:r},body:i,throwOnError:!1});if(e(c,s,`Failed to save contact`),!c.ok||!a?.contact)throw new n(c.status,t(s,c,`Failed to save contact`));return a.contact}async function c(r,a){let{error:o,response:s}=await i({path:{assistant_id:r,contact_id:a},throwOnError:!1});if(e(s,o,`Failed to delete contact`),!s.ok&&s.status!==204)throw new n(s.status,t(o,s,`Failed to delete contact`))}async function l(r,i){let{error:o,response:s}=await a({path:{assistant_id:r,channel_id:i},throwOnError:!1});if(e(s,o,`Failed to verify channel`),!s.ok)throw new n(s.status,t(o,s,`Failed to verify channel`))}async function u(e,t,r){let i=(await s(e,{id:t.id,displayName:t.displayName,channels:[{type:r.type,address:r.address}]})).channels.find(e=>e.type===r.type&&e.address.toLowerCase()===r.address.toLowerCase());if(!i)throw new n(409,`That account is already linked to another contact.`);if(i.status===`blocked`)throw new n(409,`That account is blocked for this contact. Unblock it before linking.`);await l(e,i.id)}async function d(i,a){let{data:o,error:s,response:c}=await r.post({url:`/v1/assistants/{assistant_id}/a2a/invites/redeem/`,path:{assistant_id:i},body:{sender_assistant_id:a.senderAssistantId,token:a.token},headers:{"Content-Type":`application/json`},throwOnError:!1});if(e(c,s,`Failed to redeem A2A invite`),!c.ok)throw new n(c.status,t(s,c,`Failed to redeem A2A invite`));return{success:o?.success??!0,alreadyConnected:o?.already_connected,error:o?.error,errorCode:o?.error_code}}export{l as a,s as i,u as n,d as r,c as t};
|